import { PreferenceItem } from '../../common/preferences/preference-schema'; import { JSONObject, JSONValue } from '../../../shared/@phosphor/coreutils'; import { PreferenceSchemaProvider } from './preference-contribution'; import { PreferenceLanguageOverrideService } from './preference-language-override-service'; import { IJSONSchema, JsonType } from '../../common/json-schema'; export interface PreferenceValidator { name: string; validate(value: unknown): T; } export interface ValidatablePreference extends IJSONSchema, Pick { } export declare type ValueValidator = (value: JSONValue) => JSONValue; export interface PreferenceValidationResult { original: JSONValue | undefined; valid: T; messages: string[]; } declare type ValidatablePreferenceTuple = ValidatablePreference & ({ items: ValidatablePreference[]; } | { prefixItems: ValidatablePreference[]; }); export declare class PreferenceValidationService { protected readonly schemaProvider: PreferenceSchemaProvider; protected readonly languageOverrideService: PreferenceLanguageOverrideService; validateOptions(options: Record): Record; validateByName(preferenceName: string, value: JSONValue): JSONValue; protected doValidateByName(preferenceName: string, value: JSONValue): JSONValue; validateBySchema(key: string, value: JSONValue, schema: ValidatablePreference | undefined): JSONValue; protected getSchema(name: string): ValidatablePreference | undefined; protected validateMultiple(key: string, value: JSONValue, schema: ValidatablePreference & { type: JsonType[]; }): JSONValue; protected validateAnyOf(key: string, value: JSONValue, schema: ValidatablePreference & { anyOf: ValidatablePreference[]; }): JSONValue; protected validateOneOf(key: string, value: JSONValue, schema: ValidatablePreference & { oneOf: ValidatablePreference[]; }): JSONValue; protected mapValidators(key: string, value: JSONValue, validators: Iterable<(value: JSONValue) => JSONValue>): JSONValue; protected validateArray(key: string, value: JSONValue, schema: ValidatablePreference): JSONValue[]; protected validateTuple(key: string, value: JSONValue, schema: ValidatablePreferenceTuple): JSONValue[]; protected validateConst(key: string, value: JSONValue, schema: ValidatablePreference & { const: JSONValue; }): JSONValue; protected validateEnum(key: string, value: JSONValue, schema: ValidatablePreference & { enum: JSONValue[]; }): JSONValue; protected validateBoolean(key: string, value: JSONValue, schema: ValidatablePreference): boolean; protected validateInteger(key: string, value: JSONValue, schema: ValidatablePreference): number; protected validateNumber(key: string, value: JSONValue, schema: ValidatablePreference): number; protected validateObject(key: string, value: JSONValue, schema: ValidatablePreference): JSONObject; protected objectMatchesSchema(key: string, value: JSONValue, schema: ValidatablePreference): value is JSONObject; protected validateString(key: string, value: JSONValue, schema: ValidatablePreference): string; protected getDefaultFromSchema(schema: ValidatablePreference): JSONValue; } export {}; //# sourceMappingURL=preference-validation-service.d.ts.map