1 | import URI from '../common/uri';
|
2 | import { ContributionProvider, MaybePromise, Emitter, Event, Disposable } from '../common';
|
3 | export interface OpenerOptions {
|
4 | }
|
5 | export declare const OpenHandler: unique symbol;
|
6 |
|
7 |
|
8 |
|
9 | export interface OpenHandler {
|
10 | |
11 |
|
12 |
|
13 | readonly id: string;
|
14 | |
15 |
|
16 |
|
17 | readonly label?: string;
|
18 | |
19 |
|
20 |
|
21 | readonly iconClass?: string;
|
22 | |
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | canHandle(uri: URI, options?: OpenerOptions): MaybePromise<number>;
|
30 | |
31 |
|
32 |
|
33 |
|
34 |
|
35 | open(uri: URI, options?: OpenerOptions): MaybePromise<object | undefined>;
|
36 | }
|
37 | export declare const OpenerService: unique symbol;
|
38 |
|
39 |
|
40 |
|
41 | export interface OpenerService {
|
42 | |
43 |
|
44 |
|
45 |
|
46 | getOpeners(): Promise<OpenHandler[]>;
|
47 | |
48 |
|
49 |
|
50 |
|
51 |
|
52 | getOpeners(uri: URI, options?: OpenerOptions): Promise<OpenHandler[]>;
|
53 | |
54 |
|
55 |
|
56 |
|
57 | getOpener(uri: URI, options?: OpenerOptions): Promise<OpenHandler>;
|
58 | |
59 |
|
60 |
|
61 | addHandler?(openHandler: OpenHandler): Disposable;
|
62 | |
63 |
|
64 |
|
65 | onDidChangeOpeners?: Event<void>;
|
66 | }
|
67 | export declare function open(openerService: OpenerService, uri: URI, options?: OpenerOptions): Promise<object | undefined>;
|
68 | export declare class DefaultOpenerService implements OpenerService {
|
69 | protected readonly handlersProvider: ContributionProvider<OpenHandler>;
|
70 | protected readonly customEditorOpenHandlers: OpenHandler[];
|
71 | protected readonly onDidChangeOpenersEmitter: Emitter<void>;
|
72 | readonly onDidChangeOpeners: Event<void>;
|
73 | constructor(handlersProvider: ContributionProvider<OpenHandler>);
|
74 | addHandler(openHandler: OpenHandler): Disposable;
|
75 | getOpener(uri: URI, options?: OpenerOptions): Promise<OpenHandler>;
|
76 | getOpeners(uri?: URI, options?: OpenerOptions): Promise<OpenHandler[]>;
|
77 | protected prioritize(uri: URI, options?: OpenerOptions): Promise<OpenHandler[]>;
|
78 | protected getHandlers(): OpenHandler[];
|
79 | }
|
80 | //# sourceMappingURL=opener-service.d.ts.map |
\ | No newline at end of file |