type-alias / @typed/guard

Guard.Input

Extracts the accepted input type from a Guard or Guard adapter.

Package version
1.0.0-beta.13
Category
Type utilities
Since
1.0.0
Member of
Guard

Import

import { Guard } from "@typed/guard";

Access Guard.Input through the imported Guard export. Its declaration below describes the member.

Signatures

type Input<T> = [
    T
] extends [
    Guard<infer I, infer _R, infer _E, infer _O>
] ? I : [
    T
] extends [
    AsGuard<infer I, infer _R, infer _E, infer _O>
] ? I : never;

Why

The extractor keeps generic APIs aligned with the exact input contract without repeating inference logic.

Ownership and lifetime

This compile-time type acquires no resources and has no runtime lifetime.

Examples

import type { Guard } from "@typed/guard"
type Input = Guard.Input<Guard<string, number>>

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source