Skip to content

procxy / UnwrapProcxy

Type Alias: UnwrapProcxy<P> ​

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

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

Extract the original type T from Procxy<T, Mode, SupportHandles>.

Type Parameters ​

Type ParameterDescription
PA Procxy type to unwrap

Remarks ​

Inverse of the Procxy<T> transformation. When you have a Procxy<T> and need to recover T for type-level operations, use this utility. Returns never for non-Procxy types.

Example ​

typescript
import type { Procxy, UnwrapProcxy } from 'procxy';
import { Calculator } from './calculator.js';

type CalcProxy = Procxy<Calculator>;
type Original = UnwrapProcxy<CalcProxy>; // Calculator

Released under the MIT License.