1 | import { ReactNode } from 'react';
|
2 | import { Disposable, DisposableCollection, Emitter, Event, MaybePromise } from '../../common';
|
3 | import { TreeWidget } from '../tree';
|
4 | export interface TreeElement {
|
5 |
|
6 | readonly id?: number | string | undefined;
|
7 |
|
8 | readonly visible?: boolean;
|
9 | render(host: TreeWidget): ReactNode;
|
10 | open?(): MaybePromise<any>;
|
11 | }
|
12 | export interface CompositeTreeElement extends TreeElement {
|
13 |
|
14 | readonly hasElements?: boolean;
|
15 | getElements(): MaybePromise<IterableIterator<TreeElement>>;
|
16 | }
|
17 | export declare namespace CompositeTreeElement {
|
18 | function is(element: unknown): element is CompositeTreeElement;
|
19 | function hasElements(element: unknown): element is CompositeTreeElement;
|
20 | }
|
21 | export declare abstract class TreeSource implements Disposable {
|
22 | protected readonly onDidChangeEmitter: Emitter<void>;
|
23 | readonly onDidChange: Event<void>;
|
24 | protected fireDidChange(): void;
|
25 | readonly id: string | undefined;
|
26 | readonly placeholder: string | undefined;
|
27 | constructor(options?: TreeSourceOptions);
|
28 | protected readonly toDispose: DisposableCollection;
|
29 | dispose(): void;
|
30 | abstract getElements(): MaybePromise<IterableIterator<TreeElement>>;
|
31 | }
|
32 | export interface TreeSourceOptions {
|
33 | id?: string;
|
34 | placeholder?: string;
|
35 | }
|
36 |
|
\ | No newline at end of file |