import { JsonType, 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 } from '../../common/json-schema';
export interface PreferenceValidator<T> {
    name: string;
    validate(value: unknown): T;
}
export interface ValidatablePreference extends IJSONSchema, Pick<PreferenceItem, 'defaultValue'> {
}
export declare type ValueValidator = (value: JSONValue) => JSONValue;
export interface PreferenceValidationResult<T extends JSONValue> {
    original: JSONValue | undefined;
    valid: T;
    messages: string[];
}
export declare class PreferenceValidationService {
    protected readonly schemaProvider: PreferenceSchemaProvider;
    protected readonly languageOverrideService: PreferenceLanguageOverrideService;
    validateOptions(options: Record<string, JSONValue>): Record<string, JSONValue>;
    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 mapValidators(key: string, value: JSONValue, validators: Iterable<(value: JSONValue) => JSONValue>): JSONValue;
    protected validateArray(key: string, value: JSONValue, schema: ValidatablePreference): 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;
}
//# sourceMappingURL=preference-validation-service.d.ts.map