import type { SchemaValidationErrorItem } from '@takeshape/errors';
import type { Entitlements } from '@takeshape/util';
import type { SetRequired } from 'type-fest';
import type { AnyProjectSchemaJSON, ProjectSchemaJSON, ShapeMap } from '../project-schema/index.js';
import type { LayerState } from '../types/index.js';
export type Path = Array<string | number>;
export type SchemaValidationResult = {
    valid: true;
    schema: AnyProjectSchemaJSON;
    errors: undefined;
} | {
    valid: false;
    schema: undefined;
    errors: SchemaValidationErrorItem[];
};
export type Validation = {
    version: string;
    schemaId: string;
    isVersion: (schemaVersion?: string) => boolean;
    validate: (schema: unknown, options?: ValidateSyntaxOptions) => SchemaValidationResult;
};
export type ValidateSyntaxOptions = {
    suppressErrors?: (error: SchemaValidationErrorItem) => boolean;
    resolveLayer?: ResolveLayer;
};
export type ResolveLayer = (layerId: string) => Promise<LayerState>;
export type EntitlementsOptions = {
    ignoreEntitlements: true;
    entitlements?: Entitlements;
} | {
    ignoreEntitlements?: false;
    entitlements: Entitlements;
};
export type ValidateContext = {
    builtInShapes: ShapeMap;
    builtInShapeNames: Set<string>;
    projectSchema: ProjectSchemaJSON;
} & ValidateOptions;
export type ValidateOptions = {
    allowDisconnectedLayers?: boolean;
    structureOnly?: boolean;
} & EntitlementsOptions & ValidateSyntaxOptions;
export type ValidateReferencesContext = SetRequired<ValidateContext, 'resolveLayer'>;
