UNPKG

@difizen/mana-app

Version:

25 lines 1.35 kB
import type { CommandHandler } from '@difizen/mana-core'; import type { SelectionService } from '@difizen/mana-core'; export declare class SelectionCommandHandler<S> implements CommandHandler { protected readonly selectionService: SelectionService; protected readonly toSelection: (arg: any) => S | undefined; protected readonly options: SelectionCommandHandler.Options<S>; constructor(selectionService: SelectionService, toSelection: (arg: any) => S | undefined, options: SelectionCommandHandler.Options<S>); execute(...args: any[]): Record<any, any> | undefined; isVisible(...args: any[]): boolean; isEnabled(...args: any[]): boolean; protected isMulti(): boolean; protected getSelection(...args: any[]): S | S[] | undefined; protected getSingleSelection(arg: any | undefined): S | undefined; protected getMultiSelection(arg: any | undefined): S[] | undefined; } export declare namespace SelectionCommandHandler { type Options<S> = SelectionOptions<false, S> | SelectionOptions<true, S[]>; type SelectionOptions<Multi extends boolean, T> = { multi: Multi; execute(selection: T, ...args: any[]): any; isEnabled?(selection: T, ...args: any[]): boolean; isVisible?(selection: T, ...args: any[]): boolean; }; } //# sourceMappingURL=selection-command-handler.d.ts.map