/* tslint:disable */ import { URI } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri'; import { ActivationTimes } from '../../core'; import { ILocalExtension, EnablementState } from './extension-management'; import { CancellationToken } from '@vscode-alt/monaco-editor/esm/vs/base/common/cancellation'; import Severity from '@vscode-alt/monaco-editor/esm/vs/base/common/severity'; import { ExtensionIdentifier} from '../../core/extension/extension'; import { IExtensionManifest, IExtensionIdentifier, IGalleryExtension, IExtensionType as ExtensionType } from '../generated-model'; export const MANIFEST_CACHE_FOLDER = 'CachedExtensions'; export const USER_MANIFEST_CACHE_FILE = 'user'; export const BUILTIN_MANIFEST_CACHE_FILE = 'builtin'; export interface IMessage { type: Severity; message: string; extensionId: ExtensionIdentifier; extensionPointId: string; } export interface IExtensionsStatus { messages: IMessage[]; activationTimes: ActivationTimes; runtimeErrors: Error[]; } export interface IExtensionDescription { readonly identifier: ExtensionIdentifier; readonly name: string; readonly uuid?: string; readonly displayName?: string; readonly version: string; readonly publisher: string; readonly isBuiltin: boolean; readonly isUnderDevelopment: boolean; readonly extensionLocation: URI; readonly extensionDependencies?: string[]; readonly activationEvents?: string[]; readonly engines: { vscode: string; }; readonly main?: string; readonly contributes?: { [point: string]: any; }; readonly keywords?: string[]; readonly repository?: { url: string; }; enableProposedApi?: boolean; } /** * e.g. * ``` * { * startTime: 1511954813493000, * endTime: 1511954835590000, * deltas: [ 100, 1500, 123456, 1500, 100000 ], * ids: [ 'idle', 'self', 'extension1', 'self', 'idle' ] * } * ``` */ export interface IExtensionHostProfile { /** * Profiling start timestamp in microseconds. */ startTime: number; /** * Profiling end timestamp in microseconds. */ endTime: number; /** * Duration of segment in microseconds. */ deltas: number[]; /** * Segment identifier: extension id or one of the four known strings. */ ids: ProfileSegmentId[]; /** * Get the information as a .cpuprofile. */ data: object; /** * Get the aggregated time per segmentId */ getAggregatedTimes(): Map; } /** * Extension id or one of the four known program states. */ export type ProfileSegmentId = string | 'idle' | 'program' | 'gc' | 'self'; export const ExtensionHostLogFileName = 'exthost'; export interface IWillActivateEvent { readonly event: string; readonly activation: Promise; } export interface IResponsiveStateChangeEvent { target: ICpuProfilerTarget; isResponsive: boolean; } export interface ICpuProfilerTarget { /** * Check if the extension host can be profiled. */ canProfileExtensionHost(): boolean; /** * Begin an extension host process profile session. */ startExtensionHostProfile(): Promise; } export interface ProfileSession { stop(): Promise; } // from vs/platform/extensionManagement/common/extensionManagement export const EXTENSION_IDENTIFIER_PATTERN = '^([a-z0-9A-Z][a-z0-9\-A-Z]*)\\.([a-z0-9A-Z][a-z0-9\-A-Z]*)$'; export const EXTENSION_IDENTIFIER_REGEX = new RegExp(EXTENSION_IDENTIFIER_PATTERN); export interface IExtensionCommand { command: string; title: string; category?: string; } // use IExtensionConfiguration from `generated-model.ts` // export interface IConfigurationProperty { // description: string; // type: string | string[]; // default?: any; // } // export interface IConfiguration { // properties: { [key: string]: IConfigurationProperty; }; // } export type ExtensionKind = 'ui' | 'workspace'; export { ExtensionType}; export const enum ExtensionState { Installing, Installed, Uninstalling, Uninstalled } export interface IExtension { type?: ExtensionType; state: ExtensionState; name: string; displayName: string; identifier: IExtensionIdentifier; publisher: string; publisherDisplayName: string; version: string; latestVersion: string; description: string; url?: string; repository?: string; iconUrl: string; iconUrlFallback: string; licenseUrl?: string; installCount?: number; rating?: number; ratingCount?: number; outdated: boolean; enablementState: EnablementState; dependencies: string[]; extensionPack: string[]; telemetryData: any; preview: boolean; getManifest(token: CancellationToken): Promise; getReadme(token: CancellationToken): Promise; hasReadme(): boolean; getChangelog(token: CancellationToken): Promise; hasChangelog(): boolean; local?: ILocalExtension; locals?: ILocalExtension[]; gallery?: IGalleryExtension; isMalicious: boolean; } export interface IExtensionDependencies { dependencies: IExtensionDependencies[]; hasDependencies: boolean; identifier: string; extension: IExtension; dependent: IExtensionDependencies | null; } export interface IExtensionsConfiguration { autoUpdate: boolean; autoCheckUpdates: boolean; ignoreRecommendations: boolean; showRecommendationsOnlyOnDemand: boolean; closeExtensionDetailsOnViewChange: boolean; }