procxy / ToggleProcxyHandles
Type Alias: ToggleProcxyHandles<P, NewSH>
ts
type ToggleProcxyHandles<P, NewSH> = P extends Procxy<infer T, infer Mode, any> ? Procxy<T, Mode, NewSH> : never;Defined in: src/types/isomorphism.ts:121
Produce a new Procxy type identical to P except with a different SupportHandles flag.
Type Parameters
| Type Parameter | Description |
|---|---|
P | Source Procxy type |
NewSH extends boolean | The new handle-support literal boolean |
Example
typescript
import type { ToggleProcxyHandles, Procxy } from 'procxy';
type NoHandles = Procxy<Worker, 'advanced', false>;
type WithHandles = ToggleProcxyHandles<NoHandles, true>;
// Procxy<Worker, 'advanced', true>