UNPKG

@tomjs/vscode-types

Version:

Some vscode internal d.ts

282 lines (277 loc) 7.7 kB
/** * copy from https://github.com/microsoft/vscode/blob/main/src/vs/platform/environment/common/environment.ts */ /** * Type of extension. * * **NOTE**: This is defined in `platform/environment` because it can appear as a CLI argument. */ type ExtensionKind = 'ui' | 'workspace' | 'web'; interface ILocalizedString { /** * The localized value of the string. */ value: string; /** * The original (non localized value of the string) */ original: string; } /** * copy from https://github.com/microsoft/vscode/blob/main/src/vs/platform/extensions/common/extensions.ts */ interface ICommand { command: string; title: string | ILocalizedString; category?: string | ILocalizedString; } interface IConfigurationProperty { description: string; type: string | string[]; default?: any; } interface IConfiguration { id?: string; order?: number; title?: string; properties: { [key: string]: IConfigurationProperty; }; } interface IDebugger { label?: string; type: string; runtime?: string; } interface IGrammar { language: string; } interface IJSONValidation { fileMatch: string | string[]; url: string; } interface IKeyBinding { command: string; key: string; when?: string; mac?: string; linux?: string; win?: string; } interface ILanguage { id: string; extensions: string[]; aliases: string[]; } interface IMenu { command: string; alt?: string; when?: string; group?: string; } interface ISnippet { language: string; } interface ITheme { label: string; } interface IViewContainer { id: string; title: string; } interface IView { id: string; name: string; } interface IColor { id: string; description: string; defaults: { light: string; dark: string; highContrast: string; }; } interface IWebviewEditor { readonly viewType: string; readonly priority: string; readonly selector: readonly { readonly filenamePattern?: string; }[]; } interface ICodeActionContributionAction { readonly kind: string; readonly title: string; readonly description?: string; } interface ICodeActionContribution { readonly languages: readonly string[]; readonly actions: readonly ICodeActionContributionAction[]; } interface IAuthenticationContribution { readonly id: string; readonly label: string; } interface IWalkthroughStep { readonly id: string; readonly title: string; readonly description: string | undefined; readonly media: { image: string | { dark: string; light: string; hc: string; }; altText: string; markdown?: never; svg?: never; } | { markdown: string; image?: never; svg?: never; } | { svg: string; altText: string; markdown?: never; image?: never; }; readonly completionEvents?: string[]; /** @deprecated use `completionEvents: 'onCommand:...'` */ readonly doneOn?: { command: string; }; readonly when?: string; } interface IWalkthrough { readonly id: string; readonly title: string; readonly icon?: string; readonly description: string; readonly steps: IWalkthroughStep[]; readonly featuredFor: string[] | undefined; readonly when?: string; } interface IStartEntry { readonly title: string; readonly description: string; readonly command: string; readonly when?: string; readonly category: 'file' | 'folder' | 'notebook'; } interface INotebookEntry { readonly type: string; readonly displayName: string; } interface INotebookRendererContribution { readonly id: string; readonly displayName: string; readonly mimeTypes: string[]; } interface IDebugVisualizationContribution { readonly id: string; readonly when: string; } interface ITranslation { id: string; path: string; } interface ILocalizationContribution { languageId: string; languageName?: string; localizedLanguageName?: string; translations: ITranslation[]; minimalTranslations?: { [key: string]: string; }; } interface IExtensionContributions { commands?: ICommand[]; configuration?: IConfiguration | IConfiguration[]; debuggers?: IDebugger[]; grammars?: IGrammar[]; jsonValidation?: IJSONValidation[]; keybindings?: IKeyBinding[]; languages?: ILanguage[]; menus?: { [context: string]: IMenu[]; }; snippets?: ISnippet[]; themes?: ITheme[]; iconThemes?: ITheme[]; productIconThemes?: ITheme[]; viewsContainers?: { [location: string]: IViewContainer[]; }; views?: { [location: string]: IView[]; }; colors?: IColor[]; localizations?: ILocalizationContribution[]; readonly customEditors?: readonly IWebviewEditor[]; readonly codeActions?: readonly ICodeActionContribution[]; authentication?: IAuthenticationContribution[]; walkthroughs?: IWalkthrough[]; startEntries?: IStartEntry[]; readonly notebooks?: INotebookEntry[]; readonly notebookRenderer?: INotebookRendererContribution[]; readonly debugVisualizers?: IDebugVisualizationContribution[]; } interface IExtensionCapabilities { readonly virtualWorkspaces?: ExtensionVirtualWorkspaceSupport; readonly untrustedWorkspaces?: ExtensionUntrustedWorkspaceSupport; } type LimitedWorkspaceSupportType = 'limited'; type ExtensionUntrustedWorkspaceSupportType = boolean | LimitedWorkspaceSupportType; type ExtensionUntrustedWorkspaceSupport = { supported: true; } | { supported: false; description: string; } | { supported: LimitedWorkspaceSupportType; description: string; restrictedConfigurations?: string[]; }; type ExtensionVirtualWorkspaceSupportType = boolean | LimitedWorkspaceSupportType; type ExtensionVirtualWorkspaceSupport = boolean | { supported: true; } | { supported: false | LimitedWorkspaceSupportType; description: string; }; interface IRelaxedExtensionManifest { name: string; displayName?: string; publisher: string; version: string; engines: { readonly vscode: string; }; description?: string; main?: string; browser?: string; preview?: boolean; l10n?: string; icon?: string; categories?: string[]; keywords?: string[]; activationEvents?: string[]; extensionDependencies?: string[]; extensionPack?: string[]; extensionKind?: ExtensionKind | ExtensionKind[]; contributes?: IExtensionContributions; repository?: { url: string; }; bugs?: { url: string; }; enabledApiProposals?: readonly string[]; api?: string; scripts?: { [key: string]: string; }; capabilities?: IExtensionCapabilities; } type IExtensionManifest = Readonly<IRelaxedExtensionManifest>; export type { ExtensionKind, ExtensionUntrustedWorkspaceSupport, ExtensionUntrustedWorkspaceSupportType, ExtensionVirtualWorkspaceSupport, ExtensionVirtualWorkspaceSupportType, IAuthenticationContribution, ICodeActionContribution, ICodeActionContributionAction, IColor, ICommand, IConfiguration, IConfigurationProperty, IDebugVisualizationContribution, IDebugger, IExtensionCapabilities, IExtensionContributions, IExtensionManifest, IGrammar, IJSONValidation, IKeyBinding, ILanguage, ILocalizationContribution, IMenu, INotebookEntry, INotebookRendererContribution, IRelaxedExtensionManifest, ISnippet, IStartEntry, ITheme, ITranslation, IView, IViewContainer, IWalkthrough, IWalkthroughStep, LimitedWorkspaceSupportType };