type-alias / @typed/guard

Guard.Error

Extracts the typed error channel 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.Error through the imported Guard export. Its declaration below describes the member.

Signatures

type Error<T> = [
    T
] extends [
    Guard<infer _I, infer _O, infer E, infer _R>
] ? E : [
    T
] extends [
    AsGuard<infer _I, infer _O, infer E, infer _R>
] ? E : never;

Why

Typed failure remains distinct from None, defects, and interruption throughout composition.

Ownership and lifetime

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

Examples

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

Other public imports

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

Source