Skip to content

layer

function layer<
ROut,
E,
RIn extends any,
Inject extends readonly Dependency[] = readonly [],
>(
self: Layer<ROut, E, RIn>,
options: Options<Inject> & {
provides: readonly Key<ROut, any>[]
},
): Definition<
void,
void,
SchemaError | E | ServiceConflict | RIn extends Tasks<Error> ? Error : never
>

Defined in: Plugin.ts:215

Turns a layer into a plugin. Only the keys listed in provides are published, and the layer is built from scratch on every activation.

Type Parameter Default type
ROut -
E -
RIn extends any -
Inject extends readonly Dependency[] readonly []
Parameter Type
self Layer<ROut, E, RIn>
options Options<Inject> & { provides: readonly Key<ROut, any>[]; }

Definition<void, void, | SchemaError | E | ServiceConflict | RIn extends Tasks<Error> ? Error : never>