import { IStringDictionary } from "../../../base/common/collections.js"; import { Event } from "../../../base/common/event.js"; import { IJSONSchema } from "../../../base/common/jsonSchema.js"; import { IPolicy, IPolicyReference, ManagedSettingValue, PolicyName } from "../../../base/common/policy.js"; export declare enum EditPresentationTypes { Multiline = "multilineText", Singleline = "singlelineText" } export declare const Extensions: { Configuration: string; }; export type ManagedSettingsPresentationValue = ManagedSettingValue | readonly string[] | Readonly>; export interface IConfigurationDelta { removedDefaults?: IConfigurationDefaults[]; removedConfigurations?: IConfigurationNode[]; addedDefaults?: IConfigurationDefaults[]; addedConfigurations?: IConfigurationNode[]; } /** * Declares that a setting's value should be mirrored into the agent host's root * configuration, removing the need to hand-write a forwarder per setting. * * Only the setting's *globally-scoped* value is mirrored — the resolution order * is policy, then user, then application, then default. Workspace and folder * values are deliberately ignored: the agent host root config is shared by every * window connected to a host, so a workspace-specific value would leak across * unrelated windows on a last-writer-wins basis. * * A setting that genuinely needs per-workspace behavior should not use this; * push it through session config instead, where the session → parent → host * chain resolves precedence correctly. */ export interface IAgentHostConfigurationSync { /** The agent host root configuration key to write the value to. */ readonly key: string; /** * Maps the globally-scoped setting value to the value written to {@link key}. * Defaults to the identity, which is what most settings want: the resolver * already skips layers whose value does not conform to the declared `type` * and falls back to the registered default, so a transform is only needed to * change the *shape* of the value (for example mapping an enum to a * different representation the agent host expects). */ readonly transform?: (value: unknown) => unknown; /** * Additional root configuration keys written alongside {@link key}, each * computed from the mirrored value. Use to keep legacy keys that older agent * hosts still read in step with a setting that replaced them. */ readonly derivedKeys?: Readonly unknown>>; /** Which Agent Host targets receive this setting. Defaults to {@link AgentHostConfigurationSyncScope.All}. */ readonly scope?: AgentHostConfigurationSyncScope; } export declare enum AgentHostConfigurationSyncScope { /** Mirror to every Agent Host connection. */ All = "all", /** Mirror only to the local utility-process Agent Host. */ Local = "local", /** Mirror to the ambient Agent Host, whether local or colocated with a remote extension host. */ Ambient = "ambient" } export interface IConfigurationRegistry { /** * Register a configuration to the registry. */ registerConfiguration(configuration: IConfigurationNode): IConfigurationNode; /** * Register multiple configurations to the registry. */ registerConfigurations(configurations: IConfigurationNode[], validate?: boolean): void; /** * Deregister multiple configurations from the registry. */ deregisterConfigurations(configurations: IConfigurationNode[]): void; /** * update the configuration registry by * - registering the configurations to add * - dereigstering the configurations to remove */ updateConfigurations(configurations: { add: IConfigurationNode[]; remove: IConfigurationNode[]; }): void; /** * Register multiple default configurations to the registry. */ registerDefaultConfigurations(defaultConfigurations: IConfigurationDefaults[]): void; /** * Deregister multiple default configurations from the registry. */ deregisterDefaultConfigurations(defaultConfigurations: IConfigurationDefaults[]): void; /** * Bulk update of the configuration registry (default and configurations, remove and add) * @param delta */ deltaConfiguration(delta: IConfigurationDelta): void; /** * Return the registered default configurations */ getRegisteredDefaultConfigurations(): IConfigurationDefaults[]; /** * Return the registered configuration defaults overrides */ getConfigurationDefaultsOverrides(): Map; /** * 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 whenever a configuration has been * registered. */ readonly onDidSchemaChange: Event; /** * Event that fires whenever a configuration has been * registered. */ readonly onDidUpdateConfiguration: Event<{ properties: ReadonlySet; defaultsOverrides?: boolean; }>; /** * Returns all configuration nodes contributed to this registry. */ getConfigurations(): IConfigurationNode[]; /** * Returns all configurations settings of all configuration nodes contributed to this registry. */ getConfigurationProperties(): IStringDictionary; /** * Returns the owning setting key per policy name (at most one owner per name). */ getPolicyConfigurations(): Map; /** * Returns the referencing setting keys per policy name. */ getPolicyReferenceConfigurations(): Map>; /** * Returns the {@link IAgentHostConfigurationSync} descriptor per setting key * for every setting that declares one. Includes settings hidden from the * Settings UI via `included: false`, which are absent from * {@link getConfigurationProperties}. */ getAgentHostSyncConfigurations(): Map; /** * Returns all excluded configurations settings of all configuration nodes contributed to this registry. */ getExcludedConfigurationProperties(): IStringDictionary; /** * Register the identifiers for editor configurations */ registerOverrideIdentifiers(identifiers: string[]): void; } export declare enum ConfigurationScope { /** * Application specific configuration, which can be configured only in default profile user settings. */ APPLICATION = 1, /** * Machine specific configuration, which can be configured only in local and remote user settings. */ MACHINE = 2, /** * An application machine specific configuration, which can be configured only in default profile user settings and remote user settings. */ APPLICATION_MACHINE = 3, /** * Window specific configuration, which can be configured in the user or workspace settings. */ WINDOW = 4, /** * Resource specific configuration, which can be configured in the user, workspace or folder settings. */ RESOURCE = 5, /** * Resource specific configuration that can be configured in language specific settings */ LANGUAGE_OVERRIDABLE = 6, /** * Machine specific configuration that can also be configured in workspace or folder settings. */ MACHINE_OVERRIDABLE = 7 } export interface IConfigurationPropertySchema extends IJSONSchema { scope?: ConfigurationScope; /** * 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; /** * Keep this setting visible in the Settings editor even when it has a deprecation message and is not configured. * Defaults to false; use for advance deprecation warnings. */ deprecationMessageShowInSettings?: boolean; /** * List of tags associated to the property. * - A tag can be used for filtering * - Use `experimental` tag for marking the setting as experimental. */ 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; /** * Disallow extensions to contribute configuration default value for this setting. */ disallowConfigurationDefault?: boolean; /** * Labels for enumeration items */ enumItemLabels?: string[]; /** * Optional keywords used for search purposes. */ keywords?: 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. Exactly one setting may *own* a given policy name. */ policy?: IPolicy; /** * When specified, this setting is governed by a policy owned by another setting. * A setting must not declare both `policy` and `policyReference`. * The non-null types must match the owning setting (enforced when exporting the policy catalog). */ policyReference?: IPolicyReference; /** Explains an effective policy value and the saved value it overrides in Settings UI and JSON. */ policyValueDescription?: (policyValue: unknown, configuredValue: unknown) => string; /** * Projects runtime-managed restrictions into the Settings UI without changing configuration values. * Return undefined when editable. Runtime policy enforcement remains authoritative. */ managedSettingsPresentation?: (read: (key: string) => ManagedSettingValue | undefined, localValue?: unknown) => ManagedSettingsPresentationValue | undefined; /** * When specified, this setting's globally-scoped value is mirrored into the * agent host's root configuration automatically, without any per-setting * plumbing. See {@link IAgentHostConfigurationSync}. */ agentHost?: IAgentHostConfigurationSync; /** * When specified, this setting's default value can always be overwritten by * an experiment. */ experiment?: { /** * The mode of the experiment. * - `startup`: The setting value is updated to the experiment value only on startup. * - `auto`: The setting value is updated to the experiment value automatically (whenever the experiment value changes). */ mode: "startup" | "auto"; /** * The name of the experiment. By default, this is `config.${settingId}` */ name?: string; }; /** * When specified, provides configuration overrides for the Agents window. */ agentsWindow?: { /** * Override default value for this setting in the Agents window. */ default?: unknown; /** * When `true`, this setting is read-only in the Agents window * and cannot be changed by the user. */ readOnly?: boolean; }; } export interface IExtensionInfo { id: string; displayName?: string; } export interface IConfigurationNode { id?: string; order?: number; type?: string | string[]; title?: string; description?: string; properties?: IStringDictionary; allOf?: IConfigurationNode[]; scope?: ConfigurationScope; extensionInfo?: IExtensionInfo; restrictedProperties?: string[]; } export type ConfigurationDefaultSource = IExtensionInfo | string; /** * The treatment through which an experiment assigns the default value of an * experiment-controlled setting, see {@link IConfigurationPropertySchema.experiment}. */ export declare function getConfigurationExperimentName(key: string, experiment: { readonly name?: string; } | undefined): string; export declare function isConfigurationDefaultSourceEquals(a: ConfigurationDefaultSource | undefined, b: ConfigurationDefaultSource | undefined): boolean; export type ConfigurationDefaultValueSource = ConfigurationDefaultSource | Map; export interface IConfigurationDefaults { overrides: IStringDictionary; source?: ConfigurationDefaultSource; donotCache?: boolean; preventExperimentOverride?: boolean; } export type IRegisteredConfigurationPropertySchema = IConfigurationPropertySchema & { section?: { id?: string; title?: string; order?: number; extensionInfo?: IExtensionInfo; }; defaultDefaultValue?: unknown; agentsWindowDefaultDefaultValue?: unknown; source?: ConfigurationDefaultSource; defaultValueSource?: ConfigurationDefaultValueSource; }; export interface IConfigurationDefaultOverride { readonly value: unknown; readonly source?: ConfigurationDefaultSource; } export interface IConfigurationDefaultOverrideValue { readonly value: unknown; readonly source?: ConfigurationDefaultValueSource; } export declare const allSettings: { properties: IStringDictionary; patternProperties: IStringDictionary; }; export declare const applicationSettings: { properties: IStringDictionary; patternProperties: IStringDictionary; }; export declare const applicationMachineSettings: { properties: IStringDictionary; patternProperties: IStringDictionary; }; export declare const machineSettings: { properties: IStringDictionary; patternProperties: IStringDictionary; }; export declare const machineOverridableSettings: { properties: IStringDictionary; patternProperties: IStringDictionary; }; export declare const windowSettings: { properties: IStringDictionary; patternProperties: IStringDictionary; }; export declare const resourceSettings: { properties: IStringDictionary; patternProperties: IStringDictionary; }; export declare const resourceLanguageSettingsSchemaId = "vscode://schemas/settings/resourceLanguage"; export declare const configurationDefaultsSchemaId = "vscode://schemas/settings/configurationDefaults"; export declare const OVERRIDE_PROPERTY_PATTERN = "^(\\[([^\\]]+)\\])+$"; export declare const OVERRIDE_PROPERTY_REGEX: RegExp; export declare function overrideIdentifiersFromKey(key: string): string[]; export declare function keyFromOverrideIdentifiers(overrideIdentifiers: string[]): string; export declare function getDefaultValue(type: string | string[] | undefined): {} | null; export declare function validateProperty(property: string, schema: IRegisteredConfigurationPropertySchema, extensionId?: string): string | null; export declare function getScopes(): [ string, ConfigurationScope | undefined ][]; export declare function getAllConfigurationProperties(configurationNode: IConfigurationNode[]): IStringDictionary; export declare function parseScope(scope: string): ConfigurationScope; export declare const EXTENSION_UNIFICATION_EXTENSION_IDS: Set;