1 | import { Disposable } from "../index";
|
2 |
|
3 |
|
4 | export interface Pane {
|
5 |
|
6 |
|
7 | onDidChangeFlexScale(callback: (flexScale: number) => void): Disposable;
|
8 |
|
9 |
|
10 | observeFlexScale(callback: (flexScale: number) => void): Disposable;
|
11 |
|
12 |
|
13 | onDidActivate(callback: () => void): Disposable;
|
14 |
|
15 |
|
16 | onWillDestroy(callback: () => void): Disposable;
|
17 |
|
18 |
|
19 | onDidDestroy(callback: () => void): Disposable;
|
20 |
|
21 |
|
22 | onDidChangeActive(callback: (active: boolean) => void): Disposable;
|
23 |
|
24 | |
25 |
|
26 |
|
27 |
|
28 | observeActive(callback: (active: boolean) => void): Disposable;
|
29 |
|
30 |
|
31 | onDidAddItem(callback: (event: PaneListItemShiftedEvent) => void): Disposable;
|
32 |
|
33 |
|
34 | onDidRemoveItem(callback: (event: PaneListItemShiftedEvent) => void): Disposable;
|
35 |
|
36 |
|
37 | onWillRemoveItem(callback: (event: PaneListItemShiftedEvent) => void): Disposable;
|
38 |
|
39 |
|
40 | onDidMoveItem(callback: (event: PaneItemMovedEvent) => void): Disposable;
|
41 |
|
42 |
|
43 | observeItems(callback: (item: object) => void): Disposable;
|
44 |
|
45 |
|
46 | onDidChangeActiveItem(callback: (activeItem: object) => void): Disposable;
|
47 |
|
48 | |
49 |
|
50 |
|
51 |
|
52 | onChooseNextMRUItem(callback: (nextRecentlyUsedItem: object) => void): Disposable;
|
53 |
|
54 | |
55 |
|
56 |
|
57 |
|
58 | onChooseLastMRUItem(callback: (previousRecentlyUsedItem: object) => void): Disposable;
|
59 |
|
60 | |
61 |
|
62 |
|
63 |
|
64 |
|
65 | onDoneChoosingMRUItem(callback: () => void): Disposable;
|
66 |
|
67 |
|
68 | observeActiveItem(callback: (activeItem: object) => void): Disposable;
|
69 |
|
70 |
|
71 | onWillDestroyItem(callback: (event: PaneListItemShiftedEvent) => void): Disposable;
|
72 |
|
73 |
|
74 |
|
75 | getItems(): object[];
|
76 |
|
77 |
|
78 | getActiveItem(): object;
|
79 |
|
80 |
|
81 | itemAtIndex(index: number): object | undefined;
|
82 |
|
83 |
|
84 | activateNextItem(): void;
|
85 |
|
86 |
|
87 | activatePreviousItem(): void;
|
88 |
|
89 |
|
90 | moveItemRight(): void;
|
91 |
|
92 |
|
93 | moveItemLeft(): void;
|
94 |
|
95 |
|
96 | getActiveItemIndex(): number;
|
97 |
|
98 |
|
99 | activateItemAtIndex(index: number): void;
|
100 |
|
101 |
|
102 | activateItem(item: object, options?: { pending: boolean }): void;
|
103 |
|
104 |
|
105 | addItem(item: object, options?: { index?: number | undefined; pending?: boolean | undefined }): object;
|
106 |
|
107 |
|
108 | addItems(items: object[], index?: number): object[];
|
109 |
|
110 |
|
111 | moveItem(item: object, index: number): void;
|
112 |
|
113 |
|
114 | moveItemToPane(item: object, pane: Pane, index: number): void;
|
115 |
|
116 |
|
117 | destroyActiveItem(): Promise<boolean>;
|
118 |
|
119 |
|
120 | destroyItem(item: object, force?: boolean): Promise<boolean>;
|
121 |
|
122 |
|
123 | destroyItems(): Promise<boolean[]>;
|
124 |
|
125 |
|
126 | destroyInactiveItems(): Promise<boolean[]>;
|
127 |
|
128 |
|
129 | saveActiveItem<T = void>(nextAction?: (error?: Error) => T): Promise<T> | undefined;
|
130 |
|
131 | /**
|
132 | * Prompt the user for a location and save the active item with the path
|
133 | * they select.
|
134 | */
|
135 | saveActiveItemAs<T = void>(nextAction?: (error?: Error) => T): Promise<T> | undefined;
|
136 |
|
137 | /** Save the given item. */
|
138 | saveItem<T = void>(item: object, nextAction?: (error?: Error) => T): Promise<T> | undefined;
|
139 |
|
140 | /**
|
141 | * Prompt the user for a location and save the active item with the path
|
142 | * they select.
|
143 | */
|
144 | saveItemAs<T = void>(item: object, nextAction?: (error?: Error) => T): Promise<T> | undefined;
|
145 |
|
146 | /** Save all items. */
|
147 | saveItems(): void;
|
148 |
|
149 | /** Return the first item that matches the given URI or undefined if none exists. */
|
150 | itemForURI(uri: string): object | undefined;
|
151 |
|
152 | /** Activate the first item that matches the given URI. */
|
153 | activateItemForURI(uri: string): boolean;
|
154 |
|
155 | // Lifecycle
|
156 | /** Determine whether the pane is active. */
|
157 | isActive(): boolean;
|
158 |
|
159 | /** Makes this pane the active pane, causing it to gain focus. */
|
160 | activate(): void;
|
161 |
|
162 | /** Close the pane and destroy all its items. */
|
163 | destroy(): void;
|
164 |
|
165 | /** Determine whether this pane has been destroyed. */
|
166 | isDestroyed(): boolean;
|
167 |
|
168 | // Splitting
|
169 | /** Create a new pane to the left of this pane. */
|
170 | splitLeft(params?: { items?: object[] | undefined; copyActiveItem?: boolean | undefined }): Pane;
|
171 |
|
172 | /** Create a new pane to the right of this pane. */
|
173 | splitRight(params?: { items?: object[] | undefined; copyActiveItem?: boolean | undefined }): Pane;
|
174 |
|
175 | /** Creates a new pane above the receiver. */
|
176 | splitUp(params?: { items?: object[] | undefined; copyActiveItem?: boolean | undefined }): Pane;
|
177 |
|
178 | /** Creates a new pane below the receiver. */
|
179 | splitDown(params?: { items?: object[] | undefined; copyActiveItem?: boolean | undefined }): Pane;
|
180 | }
|
181 |
|
182 | export interface PaneListItemShiftedEvent {
|
183 | /** The pane item that was added or removed. */
|
184 | item: object;
|
185 |
|
186 | /** A number indicating where the item is located. */
|
187 | index: number;
|
188 | }
|
189 |
|
190 | export interface PaneItemMovedEvent {
|
191 | /** The removed pane item. */
|
192 | item: object;
|
193 |
|
194 | /** A number indicating where the item was located. */
|
195 | oldIndex: number;
|
196 |
|
197 | /** A number indicating where the item is now located. */
|
198 | newIndex: number;
|
199 | }
|
200 |
|
201 | export interface PaneItemObservedEvent {
|
202 | item: object;
|
203 | pane: Pane;
|
204 | index: number;
|
205 | }
|
206 |
|
207 | export interface PaneItemOpenedEvent extends PaneItemObservedEvent {
|
208 | uri: string;
|
209 | }
|
210 |
|
\ | No newline at end of file |