Skip to content

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 ParameterDescription
PSource Procxy type
NewSH extends booleanThe 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>

Released under the MIT License.