NamedRegistry
A read-only set of named plug-ins, such as decoders or formatters. A
definition names what it needs; the registry supplies it. with and
without return new registries, so a shared one is never changed.
This is an interface exported by @mapcairn/core, checked against version 0.2.0.
Signature
import type { NamedRegistry } from "@mapcairn/core";
interface NamedRegistry<T>
Type parameters
T
Methods
get
get(name: string): T | undefined;
The item registered under the name, or undefined.
name(string)
has
has(name: string): boolean;
Whether an item is registered under the name.
name(string)
names
names(): readonly string[];
Every registered name, in the order added.
with
with(items: Readonly<Record<string, T>>): NamedRegistry<T>;
A copy with items added, replacing any of the same name.
items(Readonly<Record<string, T>>)
without
without(name: string): NamedRegistry<T>;
A copy without name.
name(string)