UNPKG

1.37 kBTypeScriptView Raw
1import { URI, MaybeArray } from '../common';
2import { Widget, BaseWidget } from './widgets';
3/**
4 * `Navigatable` provides an access to an URI of an underlying instance of `Resource`.
5 */
6export interface Navigatable {
7 /**
8 * Return an underlying resource URI.
9 */
10 getResourceUri(): URI | undefined;
11 /**
12 * Creates a new URI to which this navigatable should moved based on the given target resource URI.
13 */
14 createMoveToUri(resourceUri: URI): URI | undefined;
15}
16export declare namespace Navigatable {
17 function is(arg: unknown): arg is Navigatable;
18}
19export declare type NavigatableWidget = BaseWidget & Navigatable;
20export declare namespace NavigatableWidget {
21 function is(arg: unknown): arg is NavigatableWidget;
22 function getAffected<T extends Widget>(widgets: Iterable<T>, context: MaybeArray<URI>): IterableIterator<[URI, T & NavigatableWidget]>;
23 function get<T extends Widget>(widgets: Iterable<T>, filter?: (resourceUri: URI) => boolean): IterableIterator<[URI, T & NavigatableWidget]>;
24 function getUri(widget?: Widget): URI | undefined;
25}
26export interface NavigatableWidgetOptions {
27 kind: 'navigatable';
28 uri: string;
29 counter?: number;
30}
31export declare namespace NavigatableWidgetOptions {
32 function is(arg: unknown): arg is NavigatableWidgetOptions;
33}
34//# sourceMappingURL=navigatable-types.d.ts.map
\No newline at end of file