1 | import { SelectionService } from '../common/selection-service';
|
2 | import { CommandHandler } from './command';
|
3 | import URI from './uri';
|
4 | import { MaybeArray } from './types';
|
5 | export interface UriCommandHandler<T extends MaybeArray<URI>> extends CommandHandler {
|
6 | execute(uri: T, ...args: any[]): any;
|
7 | isEnabled?(uri: T, ...args: any[]): boolean;
|
8 | isVisible?(uri: T, ...args: any[]): boolean;
|
9 | }
|
10 |
|
11 |
|
12 |
|
13 | export interface SingleUriCommandHandler extends UriCommandHandler<URI> {
|
14 | }
|
15 |
|
16 |
|
17 |
|
18 | export interface MultiUriCommandHandler extends UriCommandHandler<URI[]> {
|
19 | }
|
20 | export declare class UriAwareCommandHandler<T extends MaybeArray<URI>> implements UriCommandHandler<T> {
|
21 | protected readonly selectionService: SelectionService;
|
22 | protected readonly handler: UriCommandHandler<T>;
|
23 | protected readonly options?: UriAwareCommandHandler.Options | undefined;
|
24 | |
25 |
|
26 |
|
27 | constructor(selectionService: SelectionService, handler: UriCommandHandler<T>, options?: UriAwareCommandHandler.Options | undefined);
|
28 | protected getUri(...args: any[]): T | undefined;
|
29 | protected getArgsWithUri(...args: any[]): [T | undefined, ...any[]];
|
30 | execute(...args: any[]): object | undefined;
|
31 | isVisible(...args: any[]): boolean;
|
32 | isEnabled(...args: any[]): boolean;
|
33 | protected isMulti(): boolean | undefined;
|
34 | }
|
35 | export declare namespace UriAwareCommandHandler {
|
36 | |
37 |
|
38 |
|
39 | interface Options {
|
40 | |
41 |
|
42 |
|
43 | readonly multi?: boolean;
|
44 | }
|
45 | |
46 |
|
47 |
|
48 | function MonoSelect(selectionService: SelectionService, handler: UriCommandHandler<URI>): UriAwareCommandHandler<URI>;
|
49 | |
50 |
|
51 |
|
52 | function MultiSelect(selectionService: SelectionService, handler: UriCommandHandler<URI[]>): UriAwareCommandHandler<URI[]>;
|
53 | }
|
54 |
|
\ | No newline at end of file |