Skip to content

Type Alias: CLIEntrypointHandler<T> ​

CLIEntrypointHandler<T> = (context, abortController?) => Promise<T>

Dispatch a CLI request to the action of its command, given to a CLIEntrypoint. The promise resolves to the action's result; it rejects with a ControllerActionNotFoundException when no action has the command, and with the error of the input validation, the access control or the action. Aborting the controller cancels the request: its result is dropped and the promise resolves to undefined; a request aborted before it starts is not run at all.

Type Parameters ​

T ​

T = unknown

Parameters ​

context ​

CLIContext

The request: its command and its data (the input of the action).

abortController? ​

AbortController

Aborts the request, for example when its client goes away.

Returns ​

Promise<T>

The action's result.

Released under the MIT License.