Skip to content

procxy / GetProcxyLifecycleMethods

Type Alias: GetProcxyLifecycleMethods<P>

ts
type GetProcxyLifecycleMethods<P> = P extends Procxy<any, any, any> ? Extract<keyof P, `$${string}` | symbol> : never;

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

Extract the lifecycle method and property names from a Procxy type.

Type Parameters

Type ParameterDescription
PA Procxy type

Remarks

Returns the union of all $-prefixed keys ($terminate, $process, $sendHandle) plus symbol keys (Symbol.dispose, Symbol.asyncDispose). Returns never for non-Procxy types.

Example

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

type LC = GetProcxyLifecycleMethods<Procxy<Calculator>>;
// '$terminate' | '$process' | typeof Symbol.dispose | typeof Symbol.asyncDispose

Released under the MIT License.