import { Disposable, WorkspaceFolder } from 'vscode-languageserver'; import { LogLevel } from './log_types'; import type { TypedGetter, TypedSetter } from './utils/type_utils.d'; import type { ITelemetryOptions, IClientInfo } from './tracking/tracking_types'; export interface ICodeCompletionConfig { enableSecretRedaction?: boolean; additionalLanguages?: string[]; disabledSupportedLanguages?: string[]; } export interface ISuggestionsCacheOptions { enabled?: boolean; maxSize?: number; ttl?: number; prefixLines?: number; suffixLines?: number; } export interface IHttpAgentOptions { ca?: string; cert?: string; certKey?: string; } export interface ISnowplowTrackerOptions { gitlab_instance_id?: string; gitlab_global_user_id?: string; gitlab_host_name?: string; gitlab_saas_duo_pro_namespace_ids?: number[]; } export interface ISecurityScannerOptions { enabled?: boolean; serviceUrl?: string; } export interface IWorkflowSettings { dockerSocket?: string; } export interface IDuoConfig { enabledWithoutGitlabProject?: boolean; } export interface IClientConfig { /** GitLab API URL used for getting code suggestions */ baseUrl?: string; /** Full project path. */ projectPath?: string; /** PAT or OAuth token used to authenticate to GitLab API */ token?: string; /** The base URL for language server assets in the client-side extension */ baseAssetsUrl?: string; clientInfo?: IClientInfo; codeCompletion?: ICodeCompletionConfig; openTabsContext?: boolean; telemetry?: ITelemetryOptions; /** Config used for caching code suggestions */ suggestionsCache?: ISuggestionsCacheOptions; workspaceFolders?: WorkspaceFolder[] | null; /** Collection of Feature Flag values which are sent from the client */ featureFlags?: Record; logLevel?: LogLevel; ignoreCertificateErrors?: boolean; httpAgentOptions?: IHttpAgentOptions; snowplowTrackerOptions?: ISnowplowTrackerOptions; duoWorkflowSettings?: IWorkflowSettings; securityScannerOptions?: ISecurityScannerOptions; duo?: IDuoConfig; featureFlagOverrides?: Record; } export interface IConfig { client: IClientConfig; } /** * ConfigService manages user configuration (e.g. baseUrl) and application state (e.g. codeCompletion.enabled) * TODO: Maybe in the future we would like to separate these two */ export interface ConfigService { get: TypedGetter; /** * set sets the property of the config * the new value completely overrides the old one */ set: TypedSetter; onConfigChange(listener: (config: IConfig) => void): Disposable; /** * merge adds `newConfig` properties into existing config, if the * property is present in both old and new config, `newConfig` * properties take precedence unless not defined * * This method performs deep merge * * **Arrays are not merged; they are replaced with the new value.** * */ merge(newConfig: Partial): void; } export declare const ConfigService: import("@gitlab-org/di").InterfaceId; export declare class DefaultConfigService implements ConfigService { #private; constructor(); get: TypedGetter; set: TypedSetter; onConfigChange(listener: (config: IConfig) => void): Disposable; merge(newConfig: Partial): void; }