/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import type { IIdCompressor } from "@fluidframework/id-compressor";
import { type StoredSchemaCollection, type TreeFieldStoredSchema, type TreeNodeSchemaIdentifier } from "../../../core/index.js";
import type { FullSchemaPolicy } from "../../modular-schema/index.js";
import { EncoderContext, type FieldEncoder, type FieldEncodeBuilder, type NodeEncodeBuilder } from "./compressedEncode.js";
import type { FieldBatch } from "./fieldBatch.js";
import { type EncodedFieldBatch } from "./format.js";
import type { IncrementalEncoder } from "./codecs.js";
import { NodeShapeBasedEncoder } from "./nodeEncoder.js";
/**
 * Encode data from `fieldBatch` in into an `EncodedChunk`.
 * @remarks
 * If `incrementalEncoder` is provided,
 * fields that support incremental encoding will encode their chunks separately via the `incrementalEncoder`.
 * See {@link IncrementalEncoder} for more details.
 *
 * Optimized for encoded size and encoding performance.
 * TODO: This function should eventually also take in the root FieldSchema to more efficiently compress the nodes.
 */
export declare function schemaCompressedEncode(schema: StoredSchemaCollection, policy: FullSchemaPolicy, fieldBatch: FieldBatch, idCompressor: IIdCompressor, incrementalEncoder?: IncrementalEncoder): EncodedFieldBatch;
export declare function buildContext(storedSchema: StoredSchemaCollection, policy: FullSchemaPolicy, idCompressor: IIdCompressor, incrementalEncoder?: IncrementalEncoder): EncoderContext;
/**
 * Selects an encoder to use to encode fields.
 */
export declare function getFieldEncoder(nodeBuilder: NodeEncodeBuilder, field: TreeFieldStoredSchema, context: EncoderContext, storedSchema: StoredSchemaCollection): FieldEncoder;
/**
 * Selects an encoder to use to encode nodes.
 */
export declare function getNodeEncoder(fieldBuilder: FieldEncodeBuilder, storedSchema: StoredSchemaCollection, schemaName: TreeNodeSchemaIdentifier, incrementalEncoder?: IncrementalEncoder): NodeShapeBasedEncoder;
export declare function oneFromSet<T>(set: ReadonlySet<T> | undefined): T | undefined;
//# sourceMappingURL=schemaBasedEncode.d.ts.map