Skip to content

procxy / ChangeProcxyMode

Type Alias: ChangeProcxyMode<P, NewMode>

ts
type ChangeProcxyMode<P, NewMode> = P extends Procxy<infer T, any, infer SH> ? Procxy<T, NewMode, SH> : never;

Defined in: src/types/isomorphism.ts:101

Produce a new Procxy type identical to P except with a different serialization mode.

Type Parameters

Type ParameterDescription
PSource Procxy type
NewMode extends SerializationModeThe target serialization mode

Example

typescript
import type { ChangeProcxyMode, Procxy } from 'procxy';

type JsonProxy = Procxy<Calculator, 'json'>;
type AdvancedProxy = ChangeProcxyMode<JsonProxy, 'advanced'>;
// Procxy<Calculator, 'advanced', false>

Released under the MIT License.