/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { type AnnotatedAllowedType, type AllowedTypesFullEvaluated } from "./allowedTypes.js";
import { type TreeNodeSchema } from "./treeNodeSchema.js";
/**
 * Traverses all {@link TreeNodeSchema} schema reachable from `schema`, applying the visitor pattern.
 * @internal
 */
export declare function walkNodeSchema(schema: TreeNodeSchema, visitor: SchemaVisitor, visitedSet: Set<TreeNodeSchema>): void;
/**
 * Traverses all {@link TreeNodeSchema} schema reachable from `allowedTypes`, applying the visitor pattern.
 * @internal
 */
export declare function walkAllowedTypes(annotatedAllowedTypes: AllowedTypesFullEvaluated, visitor: SchemaVisitor, visitedSet?: Set<TreeNodeSchema>): void;
/**
 * Callbacks and options for use in {@link walkFieldSchema} / {@link walkAllowedTypes} / {@link walkNodeSchema}.
 * @internal
 */
export interface SchemaVisitor {
    /**
     * Called once for each node schema reached.
     */
    node?: (schema: TreeNodeSchema) => void;
    /**
     * Called once for each set of allowed types.
     * @remarks
     * This includes every field, as well as the allowed types for maps and arrays nodes and the root if starting at {@link walkAllowedTypes}.
     *
     * Each allowed types in the schema is visited as it was in the original schema except for normalization.
     *
     * After this is called {@link SchemaVisitor.allowedTypeFilter} is applied to each allowed type in the schema to determine which of them are walked into.
     */
    allowedTypes?: (allowedTypes: AllowedTypesFullEvaluated) => void;
    /**
     * If true, will walk into this `allowedType`.
     * If false, the `allowedType` will not be walked into.
     *
     * If not provided, all allowedTypes will be walked into.
     * @remarks
     * Called after {@link SchemaVisitor.allowedTypes}.
     * @privateRemarks
     * It would be possible to combine this with `allowedTypes` into a single callback, but for the current usage this separation is more convenient.
     */
    allowedTypeFilter?: (allowedType: AnnotatedAllowedType<TreeNodeSchema>) => boolean;
}
//# sourceMappingURL=walkSchema.d.ts.map