procxy / GetProcxyMode
Type Alias: GetProcxyMode<P>
ts
type GetProcxyMode<P> = P extends Procxy<any, infer Mode, any> ? Mode : never;Defined in: src/types/isomorphism.ts:64
Extract the serialization mode from a Procxy type.
Type Parameters
| Type Parameter | Description |
|---|---|
P | A Procxy type |
Example
typescript
import type { GetProcxyMode, Procxy } from 'procxy';
type Mode1 = GetProcxyMode<Procxy<Calculator, 'json'>>; // 'json'
type Mode2 = GetProcxyMode<Procxy<Worker, 'advanced'>>; // 'advanced'