import type Ajv from 'ajv';
export type JSONSchemaType = 'null' | 'boolean' | 'object' | 'array' | 'number' | 'string' | 'integer';
export type JSONSchemaDefinition = JSONSchema | boolean;
export interface JSONSchema {
    $id?: string;
    $schema?: string;
    $ref?: string;
    $comment?: string;
    title?: string;
    description?: string;
    default?: unknown;
    examples?: unknown[];
    readOnly?: boolean;
    writeOnly?: boolean;
    deprecated?: boolean;
    type?: JSONSchemaType | JSONSchemaType[];
    enum?: unknown[];
    const?: unknown;
    multipleOf?: number;
    maximum?: number;
    exclusiveMaximum?: number;
    minimum?: number;
    exclusiveMinimum?: number;
    maxLength?: number;
    minLength?: number;
    pattern?: string;
    format?: string;
    items?: JSONSchemaDefinition | JSONSchemaDefinition[];
    additionalItems?: JSONSchemaDefinition;
    maxItems?: number;
    minItems?: number;
    uniqueItems?: boolean;
    contains?: JSONSchemaDefinition;
    minContains?: number;
    maxContains?: number;
    maxProperties?: number;
    minProperties?: number;
    required?: string[];
    properties?: Record<string, JSONSchemaDefinition>;
    patternProperties?: Record<string, JSONSchemaDefinition>;
    additionalProperties?: JSONSchemaDefinition;
    dependencies?: Record<string, JSONSchemaDefinition | string[]>;
    propertyNames?: JSONSchemaDefinition;
    if?: JSONSchemaDefinition;
    then?: JSONSchemaDefinition;
    else?: JSONSchemaDefinition;
    allOf?: JSONSchemaDefinition[];
    anyOf?: JSONSchemaDefinition[];
    oneOf?: JSONSchemaDefinition[];
    not?: JSONSchemaDefinition;
    dependentRequired?: Record<string, string[]>;
    dependentSchemas?: Record<string, JSONSchemaDefinition>;
    unevaluatedItems?: JSONSchemaDefinition;
    unevaluatedProperties?: JSONSchemaDefinition;
    prefixItems?: JSONSchemaDefinition[];
    contentEncoding?: string;
    contentMediaType?: string;
    contentSchema?: JSONSchemaDefinition;
    definitions?: Record<string, JSONSchemaDefinition>;
    $defs?: Record<string, JSONSchemaDefinition>;
    [key: string]: unknown;
}
export type SchemaConflict = {
    readonly path: ReadonlyArray<PropertyKey>;
    readonly message: string;
    readonly conflictingValues: readonly unknown[];
};
export type AllOfMergeResult = {
    readonly mergedSchema: JSONSchema;
    readonly conflicts: readonly SchemaConflict[];
};
export type NotViolation = {
    readonly path: ReadonlyArray<PropertyKey>;
    readonly message: string;
    readonly notSchema: JSONSchema;
};
export type SchemaContextOptions = {
    schema: JSONSchemaDefinition;
    definition: JSONSchemaDefinition;
    horizontal: boolean;
    path: ReadonlyArray<PropertyKey>;
    ajv?: Ajv;
    isPropertyRequired?: boolean;
    suppressLabel?: boolean;
    schemaConflicts?: readonly SchemaConflict[];
    notViolations?: readonly NotViolation[];
};
export declare class SchemaContext {
    readonly schema: JSONSchemaDefinition;
    readonly definition: JSONSchemaDefinition;
    readonly horizontal: boolean;
    readonly path: ReadonlyArray<PropertyKey>;
    readonly ajv: Ajv | undefined;
    readonly isPropertyRequired: boolean;
    readonly suppressLabel: boolean;
    readonly schemaConflicts: readonly SchemaConflict[];
    readonly notViolations: readonly NotViolation[];
    constructor(options: SchemaContextOptions);
    readonly with: (options: Partial<SchemaContextOptions>) => SchemaContext;
    readonly append: (segment: PropertyKey) => SchemaContext;
    get isRoot(): boolean;
    get name(): string | undefined;
    get widgetName(): string;
    get widgetLabel(): string | undefined;
    readonly hasRequiredProperty: (name: string) => boolean;
    get nullable(): any;
    get isNullable(): boolean;
    /**
     * Determines if this property is optional (can be absent from parent object).
     * This is different from nullable - optional means the key can be missing,
     * while nullable means the value can be explicitly null.
     */
    get isOptional(): boolean;
    /**
     * Determines if this property should show a presence toggle.
     * Optional properties that are not at the root level should have presence toggles,
     * but primitive values that allow null should use nullable controls instead.
     */
    get shouldShowPresenceToggle(): boolean;
    /**
     * Determines if this schema represents a primitive type (string, number, boolean, null).
     */
    get isPrimitive(): boolean;
    /**
     * Determines if this property is marked as readOnly.
     */
    get isReadOnly(): boolean;
    /**
     * Determines if this property is marked as writeOnly.
     */
    get isWriteOnly(): boolean;
    /**
     * Determines if this property is marked as deprecated.
     */
    get isDeprecated(): boolean;
    /**
     * Checks if readOnly should be ignored based on x:ui.ignoreReadOnly.
     */
    get shouldIgnoreReadOnly(): boolean;
    /**
     * Checks if writeOnly should be shown based on x:ui.showWriteOnly.
     */
    get shouldShowWriteOnly(): boolean;
    get anyOf(): SchemaContext[] | undefined;
    get oneOf(): SchemaContext[] | undefined;
    get allOf(): SchemaContext[] | undefined;
    readonly hasType: (type: JSONSchemaType) => boolean;
    readonly hasEnumValue: (value: unknown) => boolean;
    readonly hasConstValue: (value: unknown) => boolean;
    get description(): string | undefined;
    get examples(): unknown[] | undefined;
    get default(): unknown;
}
/**
 * Deep merge allOf branches into a single effective schema.
 * - Intersects types (detects conflicts like string ∧ number)
 * - Unions required arrays
 * - Deep merges properties objects
 * - Detects and reports conflicts as non-blocking schema errors
 */
export declare function mergeAllOf(allOfSchemas: readonly JSONSchema[], basePath?: ReadonlyArray<PropertyKey>): AllOfMergeResult;
/**
 * Evaluate `not` subschema against the current value using AJV.
 * Returns a NotViolation if the value matches the disallowed schema.
 */
export declare function evaluateNotViolation(notSchema: JSONSchema, value: unknown, ajv: Ajv | undefined, basePath?: ReadonlyArray<PropertyKey>): NotViolation | null;
/**
 * Evaluate if/then/else and dependencies overlays for an object schema without
 * mutating the base definition. Returns a new effective schema plus any merge
 * conflicts discovered while composing overlays.
 */
export declare function composeEffectiveObjectSchema(baseDef: JSONSchema, value: unknown, ajv: Ajv | undefined, basePath?: ReadonlyArray<PropertyKey>): {
    effective: JSONSchema;
    conflicts: readonly SchemaConflict[];
};
/**
 * Returns the overlay schema coming from if/then/else for the given value or
 * null if no overlay applies or no AJV instance is available.
 */
export declare function evaluateIfThenElseOverlay(def: JSONSchema, value: unknown, ajv: Ajv | undefined): JSONSchema | null;
/**
 * Tracks which properties have been evaluated by various JSON Schema keywords.
 * This is used to implement unevaluatedProperties semantics for 2019-09/2020-12.
 */
export declare function getEvaluatedProperties(schema: JSONSchema, value: Record<string, unknown> | undefined, ajv: Ajv | undefined): Set<string>;
