Skip to content

Taxum / @taxum/core / http / ExtensionKey

Class: ExtensionKey<T>

Defined in: http/extensions.ts:23

Represents a unique identifier for an extension, defined by a symbol.

The ExtensionKey class provides a way to create and manage keys for extensions that are associated with a specific type, ensuring type safety and uniqueness.

Example

ts
import { ExtensionKey } from "taxum/core/http";

type MyExtensionValue = { foo: string };
const MY_EXTENSION = new ExtensionKey<MyExtensionValue>("My extension");

Type Parameters

T

T

Constructors

Constructor

new ExtensionKey<T>(description): ExtensionKey<T>

Defined in: http/extensions.ts:28

Parameters

description

string

Returns

ExtensionKey<T>

Methods

toJSON()

toJSON(): string

Defined in: http/extensions.ts:32

Returns

string