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

Import

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

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