跳转到内容

plugin

此内容尚不支持你的语言。

function plugin<
Tools extends Record<string, Any>,
Inject extends readonly Dependency[] = [],
E = never,
>(
options: {
handlers: Effect<HandlersFrom<Tools>, E, Requirements<Inject>>
inject?: Inject
name: string
toolkit: Toolkit<Tools>
} & ([Undeclared<Tools, Inject>] extends [never]
? unknown
: {
"List these services in inject": Undeclared<Tools, Inject>
}),
): Definition<void, void, SchemaError | E>

Defined in: Tools.ts:77

A plugin that serves a toolkit while it is loaded. handlers builds the handlers and may use the services in inject; so may the tools, through their dependencies and schemas.

Type Parameter Default type
Tools extends Record<string, Any> -
Inject extends readonly Dependency[] []
E never
Parameter Type
options { handlers: Effect<HandlersFrom<Tools>, E, Requirements<Inject>>; inject?: Inject; name: string; toolkit: Toolkit<Tools>; } & ([Undeclared<Tools, Inject>] extends [never] ? unknown : { "List these services in inject": Undeclared<Tools, Inject>; })

Definition<void, void, SchemaError | E>