type-alias / @typed/template

EventHandler.Error

Extracts the typed error channel of an EventHandler.

Package version
1.0.0-beta.7
Category
Handler failures
Since
1.0.0
Member of
EventHandler

Import

import { EventHandler } from "@typed/template";

Access EventHandler.Error through the imported EventHandler export. Its declaration below describes the member.

This public exposure is a re-export. Its import path is supported; declaration documentation is shared with the other public exposures below.

Signatures

export type Error<T> = T extends EventHandler<infer _Ev, infer E, infer _R> ? E : never;

Why

Handler failures remain visible when a handler is embedded in a template.

Ownership and lifetime

This is a compile-time projection and has no runtime lifetime.

Examples

import type { Error, EventHandler } from "@typed/template/EventHandler"

type Failure = Error<EventHandler<MouseEvent, "save-failed">>

Other public imports

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

Source