@launchmenu/core
Version:
An environment for visual keyboard controlled applets
38 lines • 1.77 kB
TypeScript
import { IAction } from "./_types/IAction";
import { IActionBinding } from "./_types/IActionBinding";
import { IActionTransformer } from "./_types/IActionTransformer";
import { IBindingCreator, IBindingCreatorConfig } from "./_types/IBindingCreator";
import { TPureAction } from "./_types/TPureAction";
/**
* Creates an action that conforms to all constraints of a proper action
* @param actionInput The data to construct the action from
* @returns The created action
*/
export declare function createAction<
/** The input data type */
I,
/** The result data type */
O = never,
/** The parent actions types (union of parents) */
P extends IAction | void = void,
/** The possible resulting bindings of this action */
K extends P extends IAction ? IActionBinding<TPureAction<P>> : void = never,
/** The create binding function, which may want to specify generic types for more elaborate interfaces */
CB = IBindingCreator<I, O, P>,
/** The remaining functions specified on the object */
EXTRAS = unknown>(actionInput: {
/** The name of the action */
name: string;
/** The parent actions of this action */
parents?: P[];
/** The core transformer of the action */
core: IActionTransformer<I, O, K>;
/** A custom binding creator in case generic types are needed */
createBinding?: CB;
/** Extra data to set on the created action */
extras?: EXTRAS;
}): /** The action as well as an interface to create bindings for this action with */ IAction<I, O, P> & {
createBinding: CB;
} & (EXTRAS extends never ? unknown : EXTRAS);
export declare function createStandardBinding(this: IAction, config: any | IBindingCreatorConfig<any>): IActionBinding;
//# sourceMappingURL=createAction.d.ts.map