Skip to content

RouteRegistry

Defined in: src/mft/RouteRegistry.ts:13

Mutable in-memory registry of MFT routes.

new RouteRegistry(routes?: Iterable<MftRoute>): RouteRegistry;

Defined in: src/mft/RouteRegistry.ts:21

Creates a registry and optionally seeds it with route definitions.

ParameterTypeDefault valueDescription
routesIterable<MftRoute>[]Routes to register immediately.

RouteRegistry

get size(): number;

Defined in: src/mft/RouteRegistry.ts:115

Returns the number of routes currently registered.

number

get(routeId: string): MftRoute | undefined;

Defined in: src/mft/RouteRegistry.ts:80

Gets a route definition when registered.

ParameterTypeDescription
routeIdstringRoute id to retrieve.

MftRoute | undefined

The route, or undefined when missing.


has(routeId: string): boolean;

Defined in: src/mft/RouteRegistry.ts:70

Checks whether a route id is registered.

ParameterTypeDescription
routeIdstringRoute id to inspect.

boolean

true when a route exists.


list(): MftRoute[];

Defined in: src/mft/RouteRegistry.ts:110

Returns all registered routes in registration order.

MftRoute[]

Array of route definitions.


register(route: MftRoute): this;

Defined in: src/mft/RouteRegistry.ts:34

Registers a route definition.

ParameterTypeDescription
routeMftRouteRoute to add.

this

This registry for fluent setup.

ConfigurationError When the route id is already registered or empty.


require(routeId: string): MftRoute;

Defined in: src/mft/RouteRegistry.ts:91

Gets a route definition or throws a typed SDK error.

ParameterTypeDescription
routeIdstringRoute id to retrieve.

MftRoute

The registered route.

ConfigurationError When no route is registered under the id.


unregister(routeId: string): boolean;

Defined in: src/mft/RouteRegistry.ts:60

Removes a route from the registry.

ParameterTypeDescription
routeIdstringRoute id to remove.

boolean

true when a route was removed.