import { IJSONSchema } from '@vscode-alt/monaco-editor/esm/vs/base/common/jsonSchema'; import { IConfigurationExtensionInfo, ConfigurationScope } from '../generated-model'; import { ExtensionIdentifier } from '../../core'; import { Event } from '@vscode-alt/monaco-editor/esm/vs/base/common/event'; export enum EditPresentationTypes { Multiline = 'multilineText', Singleline = 'singlelineText' } export interface PolicyConfiguration { /** * The policy name. */ readonly name: string; /** * The Code version in which this policy was introduced. */ readonly minimumVersion: any;/*`${number}.${number}`;*/ } export interface IConfigurationPropertySchema extends IJSONSchema { overridable?: boolean; //deprecated scope?: T; /** * When restricted, value of this configuration will be read only from trusted sources. * For eg., If the workspace is not trusted, then the value of this configuration is not read from workspace settings file. */ restricted?: boolean; /** * When `false` this property is excluded from the registry. Default is to include. */ included?: boolean; /** * List of tags associated to the property. * - A tag can be used for filtering * - Use `experimental` tag for marking the setting as experimental. **Note:** Defaults of experimental settings can be changed by the running experiments. */ tags?: string[]; /** * When enabled this setting is ignored during sync and user can override this. */ ignoreSync?: boolean; /** * When enabled this setting is ignored during sync and user cannot override this. */ disallowSyncIgnore?: boolean; /** * Labels for enumeration items */ enumItemLabels?: string[]; /** * When specified, controls the presentation format of string settings. * Otherwise, the presentation format defaults to `singleline`. */ editPresentation?: EditPresentationTypes; /** * When specified, gives an order number for the setting * within the settings editor. Otherwise, the setting is placed at the end. */ order?: number; /** * When specified, this setting's value can always be overwritten by * a system-wide policy. */ policy?: PolicyConfiguration; } export interface IConfigurationNode { id?: string; order?: number; type?: string | string[]; title?: string; description?: string; properties?: { [path: string]: IConfigurationPropertySchema; }; allOf?: IConfigurationNode[]; overridable?: boolean; scope?: T; // contributedByExtension?: boolean; extensionInfo?: IConfigurationExtensionInfo; } export interface IDefaultConfigurationExtension { id: ExtensionIdentifier; name: string; defaults: { [key: string]: {} }; } export interface IConfigurationRegistry { /** * Register a configuration to the registry. */ registerConfiguration(configuration: IConfigurationNode): void; /** * Register multiple configurations to the registry. */ registerConfigurations(configurations: IConfigurationNode[], validate?: boolean): void; /** * Deregister multiple configurations from the registry. */ deregisterConfigurations(configurations: IConfigurationNode[]): void; /** * Register multiple default configurations to the registry. */ registerDefaultConfigurations(defaultConfigurations: IDefaultConfigurationExtension[]): void; /** * Deregister multiple default configurations from the registry. */ deregisterDefaultConfigurations(defaultConfigurations: IDefaultConfigurationExtension[]): void; /** * Signal that the schema of a configuration setting has changes. It is currently only supported to change enumeration values. * Property or default value changes are not allowed. */ notifyConfigurationSchemaUpdated(...configurations: IConfigurationNode[]): void; /** * Event that fires whenver a configuration has been * registered. */ onDidSchemaChange: Event; /** * Event that fires whenver a configuration has been * registered. */ onDidUpdateConfiguration: Event; /** * Returns all configuration nodes contributed to this registry. */ getConfigurations(): IConfigurationNode[]; /** * Returns all configurations settings of all configuration nodes contributed to this registry. */ getConfigurationProperties(): { [qualifiedKey: string]: IConfigurationPropertySchema }; /** * Returns all excluded configurations settings of all configuration nodes contributed to this registry. */ getExcludedConfigurationProperties(): { [qualifiedKey: string]: IConfigurationPropertySchema }; /** * Register the identifiers for editor configurations */ registerOverrideIdentifiers(identifiers: string[]): void; }