@theia/core
Version:
Theia is a cloud & desktop IDE framework implemented in TypeScript.
87 lines • 4.32 kB
TypeScript
import { ContributionProvider, CommandRegistry, MenuModelRegistry, BackendStopwatch, Stopwatch } from '../common';
import { MaybePromise } from '../common/types';
import { KeybindingRegistry } from './keybinding';
import { ApplicationShell } from './shell/application-shell';
import { ShellLayoutRestorer } from './shell/shell-layout-restorer';
import { FrontendApplicationStateService } from './frontend-application-state';
import { CorePreferences } from './core-preferences';
import { WindowService } from './window/window-service';
import { TooltipService } from './tooltip-service';
import { FrontendApplicationContribution } from './frontend-application-contribution';
export declare class FrontendApplication {
protected readonly commands: CommandRegistry;
protected readonly menus: MenuModelRegistry;
protected readonly keybindings: KeybindingRegistry;
protected readonly layoutRestorer: ShellLayoutRestorer;
protected readonly contributions: ContributionProvider<FrontendApplicationContribution>;
protected readonly _shell: ApplicationShell;
protected readonly stateService: FrontendApplicationStateService;
protected readonly corePreferences: CorePreferences;
protected readonly windowsService: WindowService;
protected readonly tooltipService: TooltipService;
protected readonly stopwatch: Stopwatch;
protected readonly backendStopwatch: BackendStopwatch;
constructor(commands: CommandRegistry, menus: MenuModelRegistry, keybindings: KeybindingRegistry, layoutRestorer: ShellLayoutRestorer, contributions: ContributionProvider<FrontendApplicationContribution>, _shell: ApplicationShell, stateService: FrontendApplicationStateService);
get shell(): ApplicationShell;
/**
* Start the frontend application.
*
* Start up consists of the following steps:
* - start frontend contributions
* - attach the application shell to the host element
* - initialize the application shell layout
* - reveal the application shell if it was hidden by a startup indicator
*/
start(): Promise<void>;
/**
* Return a promise to the host element to which the application shell is attached.
*/
protected getHost(): Promise<HTMLElement>;
/**
* Return an HTML element that indicates the startup phase, e.g. with an animation or a splash screen.
*/
protected getStartupIndicator(host: HTMLElement): HTMLElement | undefined;
/**
* Register global event listeners.
*/
protected registerEventListeners(): void;
/**
* Attach the application shell to the host element. If a startup indicator is present, the shell is
* inserted before that indicator so it is not visible yet.
*/
protected attachShell(host: HTMLElement): void;
/**
* Attach the tooltip container to the host element.
*/
protected attachTooltip(host: HTMLElement): void;
/**
* If a startup indicator is present, it is first hidden with the `theia-hidden` CSS class and then
* removed after a while. The delay until removal is taken from the CSS transition duration.
*/
protected revealShell(host: HTMLElement): Promise<void>;
/**
* Initialize the shell layout either using the layout restorer service or, if no layout has
* been stored, by creating the default layout.
*/
protected initializeLayout(): Promise<void>;
/**
* Try to restore the shell layout from the storage service. Resolves to `true` if successful.
*/
protected restoreLayout(): Promise<boolean>;
/**
* Let the frontend application contributions initialize the shell layout. Override this
* method in order to create an application-specific custom layout.
*/
protected createDefaultLayout(): Promise<void>;
protected fireOnDidInitializeLayout(): Promise<void>;
/**
* Initialize and start the frontend application contributions.
*/
protected startContributions(): Promise<void>;
/**
* Stop the frontend application contributions. This is called when the window is unloaded.
*/
protected stopContributions(): void;
protected measure<T>(name: string, fn: () => MaybePromise<T>, message?: string, threshold?: boolean): Promise<T>;
}
//# sourceMappingURL=frontend-application.d.ts.map