Skip to main content
Module

x/enzastdlib/events/mod.ts>TypedEventRecord

enzastdlib is a set of TypeScript modules that follow a common design API philosophy aiming at sane defaults and ease-of-use targeting the Deno TypeScript runtime.
Latest
type alias TypedEventRecord
import { type TypedEventRecord } from "https://deno.land/x/enzastdlib@v0.0.4/events/mod.ts";

Represents a record of event names associated with their CustomEvent-derived classes.

Examples

Example 1

class UpdateEvent extends CustomEvent<{ original: unknown, replacement: unknown }> {}

// **NOTE**: While you can import this type and use `interface MyEvents extends TypedEventRecord`
// you will lose autocomplete in IDEs.
//
// So this example is just showcasing the expected interface of `Record<string, CustomEvent>`.
type MyEvents = {
    update: UpdateEvent;
};
definition: Record<string, CustomEvent>