UNPKG

9.83 kBTypeScriptView Raw
1import { MenuContribution, MenuModelRegistry } from '../common/menu';
2import { KeybindingContribution, KeybindingRegistry } from './keybinding';
3import { FrontendApplication } from './frontend-application';
4import { FrontendApplicationContribution, OnWillStopAction } from './frontend-application-contribution';
5import { CommandContribution, CommandRegistry, Command } from '../common/command';
6import { SelectionService } from '../common/selection-service';
7import { MessageService } from '../common/message-service';
8import { OpenerService } from '../browser/opener-service';
9import { ApplicationShell } from './shell/application-shell';
10import { AboutDialog } from './about-dialog';
11import { ContextKey, ContextKeyService } from './context-key-service';
12import { ResourceContextKey } from './resource-context-key';
13import { StorageService } from './storage-service';
14import { IconThemeService } from './icon-theme-service';
15import { ColorContribution } from './color-application-contribution';
16import { ColorRegistry } from './color-registry';
17import { CoreConfiguration, CorePreferences } from './core-preferences';
18import { ThemeService } from './theming';
19import { PreferenceService, PreferenceChangeEvent } from './preferences';
20import { ClipboardService } from './clipboard-service';
21import { EncodingRegistry } from './encoding-registry';
22import { EnvVariablesServer } from '../common/env-variables';
23import { AuthenticationService } from './authentication-service';
24import { SaveOptions } from './saveable';
25import { QuickInputService } from './quick-input';
26import { AsyncLocalizationProvider } from '../common/i18n/localization';
27import { WindowService } from './window/window-service';
28import { Title, Widget } from './widgets';
29import { SaveResourceService } from './save-resource-service';
30import { UserWorkingDirectoryProvider } from './user-working-directory-provider';
31import { UntitledResourceResolver } from '../common';
32import { LanguageQuickPickService } from './i18n/language-quick-pick-service';
33export declare namespace CommonMenus {
34 const FILE: string[];
35 const FILE_NEW_TEXT: string[];
36 const FILE_NEW: string[];
37 const FILE_OPEN: string[];
38 const FILE_SAVE: string[];
39 const FILE_AUTOSAVE: string[];
40 const FILE_SETTINGS: string[];
41 const FILE_SETTINGS_SUBMENU: string[];
42 const FILE_SETTINGS_SUBMENU_OPEN: string[];
43 const FILE_SETTINGS_SUBMENU_THEME: string[];
44 const FILE_CLOSE: string[];
45 const FILE_NEW_CONTRIBUTIONS = "file/newFile";
46 const EDIT: string[];
47 const EDIT_UNDO: string[];
48 const EDIT_CLIPBOARD: string[];
49 const EDIT_FIND: string[];
50 const VIEW: string[];
51 const VIEW_PRIMARY: string[];
52 const VIEW_APPEARANCE: string[];
53 const VIEW_APPEARANCE_SUBMENU: string[];
54 const VIEW_APPEARANCE_SUBMENU_SCREEN: string[];
55 const VIEW_APPEARANCE_SUBMENU_BAR: string[];
56 const VIEW_EDITOR_SUBMENU: string[];
57 const VIEW_EDITOR_SUBMENU_SPLIT: string[];
58 const VIEW_EDITOR_SUBMENU_ORTHO: string[];
59 const VIEW_VIEWS: string[];
60 const VIEW_LAYOUT: string[];
61 const VIEW_TOGGLE: string[];
62 const MANAGE_GENERAL: string[];
63 const MANAGE_SETTINGS: string[];
64 const MANAGE_SETTINGS_THEMES: string[];
65 const HELP: string[];
66}
67export declare namespace CommonCommands {
68 const FILE_CATEGORY = "File";
69 const VIEW_CATEGORY = "View";
70 const CREATE_CATEGORY = "Create";
71 const PREFERENCES_CATEGORY = "Preferences";
72 const MANAGE_CATEGORY = "Manage";
73 const FILE_CATEGORY_KEY: string;
74 const VIEW_CATEGORY_KEY: string;
75 const PREFERENCES_CATEGORY_KEY: string;
76 const OPEN: Command;
77 const CUT: Command;
78 const COPY: Command;
79 const PASTE: Command;
80 const COPY_PATH: Command;
81 const UNDO: Command;
82 const REDO: Command;
83 const SELECT_ALL: Command;
84 const FIND: Command;
85 const REPLACE: Command;
86 const NEXT_TAB: Command;
87 const PREVIOUS_TAB: Command;
88 const NEXT_TAB_IN_GROUP: Command;
89 const PREVIOUS_TAB_IN_GROUP: Command;
90 const NEXT_TAB_GROUP: Command;
91 const PREVIOUS_TAB_GROUP: Command;
92 const CLOSE_TAB: Command;
93 const CLOSE_OTHER_TABS: Command;
94 const CLOSE_SAVED_TABS: Command;
95 const CLOSE_RIGHT_TABS: Command;
96 const CLOSE_ALL_TABS: Command;
97 const CLOSE_MAIN_TAB: Command;
98 const CLOSE_OTHER_MAIN_TABS: Command;
99 const CLOSE_ALL_MAIN_TABS: Command;
100 const COLLAPSE_PANEL: Command;
101 const COLLAPSE_ALL_PANELS: Command;
102 const TOGGLE_BOTTOM_PANEL: Command;
103 const TOGGLE_STATUS_BAR: Command;
104 const PIN_TAB: Command;
105 const UNPIN_TAB: Command;
106 const TOGGLE_MAXIMIZED: Command;
107 const OPEN_VIEW: Command;
108 const SHOW_MENU_BAR: Command;
109 /**
110 * Command Parameters:
111 * - `fileName`: string
112 * - `directory`: URI
113 */
114 const NEW_FILE: Command;
115 const NEW_UNTITLED_TEXT_FILE: Command;
116 const NEW_UNTITLED_FILE: Command;
117 const SAVE: Command;
118 const SAVE_AS: Command;
119 const SAVE_WITHOUT_FORMATTING: Command;
120 const SAVE_ALL: Command;
121 const AUTO_SAVE: Command;
122 const ABOUT_COMMAND: Command;
123 const OPEN_PREFERENCES: Command;
124 const SELECT_COLOR_THEME: Command;
125 const SELECT_ICON_THEME: Command;
126 const CONFIGURE_DISPLAY_LANGUAGE: Command;
127 const TOGGLE_BREADCRUMBS: Command;
128}
129export declare const supportCut: boolean;
130export declare const supportCopy: boolean;
131export declare const supportPaste: boolean;
132export declare const RECENT_COMMANDS_STORAGE_KEY = "commands";
133export declare const CLASSNAME_OS_MAC = "mac";
134export declare const CLASSNAME_OS_WINDOWS = "windows";
135export declare const CLASSNAME_OS_LINUX = "linux";
136export declare class CommonFrontendContribution implements FrontendApplicationContribution, MenuContribution, CommandContribution, KeybindingContribution, ColorContribution {
137 protected readonly shell: ApplicationShell;
138 protected readonly selectionService: SelectionService;
139 protected readonly messageService: MessageService;
140 protected readonly openerService: OpenerService;
141 protected readonly aboutDialog: AboutDialog;
142 protected readonly localizationProvider: AsyncLocalizationProvider;
143 protected readonly saveResourceService: SaveResourceService;
144 protected commonDecorationsStyleSheet: CSSStyleSheet;
145 constructor(shell: ApplicationShell, selectionService: SelectionService, messageService: MessageService, openerService: OpenerService, aboutDialog: AboutDialog, localizationProvider: AsyncLocalizationProvider, saveResourceService: SaveResourceService);
146 protected readonly contextKeyService: ContextKeyService;
147 protected readonly resourceContextKey: ResourceContextKey;
148 protected readonly commandRegistry: CommandRegistry;
149 protected readonly menuRegistry: MenuModelRegistry;
150 protected readonly storageService: StorageService;
151 protected readonly quickInputService: QuickInputService;
152 protected readonly iconThemes: IconThemeService;
153 protected readonly themeService: ThemeService;
154 protected readonly preferences: CorePreferences;
155 protected readonly preferenceService: PreferenceService;
156 protected readonly clipboardService: ClipboardService;
157 protected readonly encodingRegistry: EncodingRegistry;
158 protected readonly environments: EnvVariablesServer;
159 protected readonly authenticationService: AuthenticationService;
160 protected readonly windowService: WindowService;
161 protected readonly workingDirProvider: UserWorkingDirectoryProvider;
162 protected readonly languageQuickPickService: LanguageQuickPickService;
163 protected readonly untitledResourceResolver: UntitledResourceResolver;
164 protected pinnedKey: ContextKey<boolean>;
165 configure(app: FrontendApplication): Promise<void>;
166 protected setOsClass(): void;
167 protected updateStyles(): void;
168 protected updatePinnedKey(): void;
169 protected handlePreferenceChange(e: PreferenceChangeEvent<CoreConfiguration>, app: FrontendApplication): void;
170 protected setSashProperties(): void;
171 onStart(): void;
172 onStop(): void;
173 protected initResourceContextKeys(): void;
174 registerMenus(registry: MenuModelRegistry): void;
175 registerCommands(commandRegistry: CommandRegistry): void;
176 protected getOrdinalNumbers(): readonly string[];
177 protected isElectron(): boolean;
178 protected togglePinned(title?: Title<Widget>): void;
179 registerKeybindings(registry: KeybindingRegistry): void;
180 protected save(options?: SaveOptions): Promise<void>;
181 protected openAbout(): Promise<void>;
182 protected shouldPreventClose: boolean;
183 /**
184 * registers event listener which make sure that
185 * window doesn't get closed if CMD/CTRL W is pressed.
186 * Too many users have that in their muscle memory.
187 * Chrome doesn't let us rebind or prevent default the keybinding, so this
188 * at least doesn't close the window immediately.
189 */
190 protected registerCtrlWHandling(): void;
191 onWillStop(): OnWillStopAction | undefined;
192 private confirmExitWithOrWithoutSaving;
193 protected unsavedTabsCaptions(): string[];
194 protected unsavedUntitledTabsCaptions(): Widget[];
195 protected configureDisplayLanguage(): Promise<void>;
196 /**
197 * saves any dirty widget in toSave
198 * side effect - will pop all widgets from toSave that was saved
199 * @param toSave
200 */
201 protected saveDirty(toSave: Widget[]): Promise<void>;
202 protected toggleBreadcrumbs(): void;
203 protected isBreadcrumbsEnabled(): boolean;
204 protected confirmRestart(languageName: string): Promise<boolean>;
205 protected selectIconTheme(): void;
206 protected selectColorTheme(): void;
207 /**
208 * @todo https://github.com/eclipse-theia/theia/issues/12824
209 */
210 protected showNewFilePicker(): Promise<void>;
211 registerColors(colors: ColorRegistry): void;
212}
213//# sourceMappingURL=common-frontend-contribution.d.ts.map
\No newline at end of file