import { Title, Widget } from '@phosphor/widgets'; import { Message } from '@phosphor/messaging'; import { Emitter, Event, Disposable, DisposableCollection, MaybePromise } from '../../common'; import { KeyCode, KeysOrKeyCodes } from '../keyboard/keys'; import PerfectScrollbar from 'perfect-scrollbar'; export * from '@phosphor/widgets'; export * from '@phosphor/messaging'; export declare const ACTION_ITEM = "action-label"; export declare function codiconArray(name: string, actionItem?: boolean): string[]; export declare function codicon(name: string, actionItem?: boolean): string; export declare const DISABLED_CLASS = "theia-mod-disabled"; export declare const EXPANSION_TOGGLE_CLASS = "theia-ExpansionToggle"; export declare const CODICON_TREE_ITEM_CLASSES: string[]; export declare const COLLAPSED_CLASS = "theia-mod-collapsed"; export declare const BUSY_CLASS = "theia-mod-busy"; export declare const CODICON_LOADING_CLASSES: string[]; export declare const SELECTED_CLASS = "theia-mod-selected"; export declare const FOCUS_CLASS = "theia-mod-focus"; export declare const PINNED_CLASS = "theia-mod-pinned"; export declare const LOCKED_CLASS = "theia-mod-locked"; export declare const DEFAULT_SCROLL_OPTIONS: PerfectScrollbar.Options; /** * At a number of places in the code, we have effectively reimplemented Phosphor's Widget.attach and Widget.detach, * but omitted the checks that Phosphor expects to be performed for those operations. That is a bad idea, because it * means that we are telling widgets that they are attached or detached when not all the conditions that should apply * do apply. We should explicitly mark those locations so that we know where we should go fix them later. */ export declare namespace UnsafeWidgetUtilities { /** * Ordinarily, the following checks should be performed before detaching a widget: * It should not be the child of another widget * It should be attached and it should be a child of document.body */ function detach(widget: Widget): void; /** * @param ref The child of the host element to insert the widget before. * Ordinarily the following checks should be performed: * The widget should have no parent * The widget should not be attached, and its node should not be a child of document.body * The host should be a child of document.body * We often violate the last condition. */ function attach(widget: Widget, host: HTMLElement, ref?: HTMLElement | null): void; } export declare class BaseWidget extends Widget { protected readonly onScrollYReachEndEmitter: Emitter; readonly onScrollYReachEnd: Event; protected readonly onScrollUpEmitter: Emitter; readonly onScrollUp: Event; protected readonly onDidChangeVisibilityEmitter: Emitter; readonly onDidChangeVisibility: Event; protected readonly onDidDisposeEmitter: Emitter; readonly onDidDispose: Event; protected readonly toDispose: DisposableCollection; protected readonly toDisposeOnDetach: DisposableCollection; protected scrollBar?: PerfectScrollbar; protected scrollOptions?: PerfectScrollbar.Options; dispose(): void; protected onCloseRequest(msg: Message): void; protected onBeforeAttach(msg: Message): void; protected onAfterDetach(msg: Message): void; protected onBeforeDetach(msg: Message): void; protected onAfterAttach(msg: Message): void; protected getScrollContainer(): MaybePromise; protected disableScrollBarFocus(scrollContainer: HTMLElement): void; protected onUpdateRequest(msg: Message): void; protected addUpdateListener(element: HTMLElement, type: K, useCapture?: boolean): void; protected addEventListener(element: HTMLElement, type: K, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; protected addKeyListener(element: HTMLElement, keysOrKeyCodes: KeyCode.Predicate | KeysOrKeyCodes, action: (event: KeyboardEvent) => boolean | void | Object, ...additionalEventTypes: K[]): void; protected addClipboardListener(element: HTMLElement, type: K, listener: EventListenerOrEventListenerObject): void; setFlag(flag: Widget.Flag): void; clearFlag(flag: Widget.Flag): void; } export declare function setEnabled(element: HTMLElement, enabled: boolean): void; export declare function createIconButton(...classNames: string[]): HTMLSpanElement; export declare type EventListener = (this: HTMLElement, event: HTMLElementEventMap[K]) => any; export interface EventListenerObject { handleEvent(evt: HTMLElementEventMap[K]): void; } export declare namespace EventListenerObject { function is(listener: unknown): listener is EventListenerObject; } export declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; export declare function addEventListener(element: HTMLElement, type: K, listener: EventListenerOrEventListenerObject, useCapture?: boolean): Disposable; export declare function addKeyListener(element: HTMLElement, keysOrKeyCodes: KeyCode.Predicate | KeysOrKeyCodes, action: (event: KeyboardEvent) => boolean | void | Object, ...additionalEventTypes: K[]): Disposable; export declare function addClipboardListener(element: HTMLElement, type: K, listener: EventListenerOrEventListenerObject): Disposable; /** * Resolves when the given widget is detached and hidden. */ export declare function waitForClosed(widget: Widget): Promise; /** * Resolves when the given widget is attached and visible. */ export declare function waitForRevealed(widget: Widget): Promise; /** * Resolves when the given widget is hidden regardless of attachment. */ export declare function waitForHidden(widget: Widget): Promise; export declare function isPinned(title: Title): boolean; export declare function unpin(title: Title): void; export declare function pin(title: Title): void; export declare function lock(title: Title): void; export declare function togglePinned(title?: Title): void; //# sourceMappingURL=widget.d.ts.map