/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { IFluidDataStoreRuntime, IChannelStorageService } from "@fluidframework/datastore-definitions";
import { ITelemetryContext, ISummaryTreeWithStats, IGarbageCollectionData } from "@fluidframework/runtime-definitions";
import { ICodecOptions } from "../codec";
import { Dependee, Dependent, TreeFieldStoredSchema, TreeStoredSchema, StoredSchemaRepository, TreeNodeStoredSchema, TreeNodeSchemaIdentifier, SchemaEvents } from "../core";
import { Summarizable, SummaryElementParser, SummaryElementStringifier } from "../shared-tree-core";
import { JsonCompatible, JsonCompatibleReadOnly } from "../util";
import { Format } from "./schemaIndexFormat";
/**
 * Provides methods for summarizing and loading a schema repository.
 */
export declare class SchemaSummarizer implements Summarizable {
    private readonly runtime;
    private readonly schema;
    readonly key = "Schema";
    private readonly schemaBlob;
    private readonly codec;
    constructor(runtime: IFluidDataStoreRuntime, schema: StoredSchemaRepository, options: ICodecOptions);
    getAttachSummary(stringify: SummaryElementStringifier, fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
    summarize(stringify: SummaryElementStringifier, fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise<ISummaryTreeWithStats>;
    getGCData(fullGC?: boolean): IGarbageCollectionData;
    load(services: IChannelStorageService, parse: SummaryElementParser): Promise<void>;
}
interface SchemaOp {
    readonly type: "SchemaOp";
    readonly data: Format;
}
/**
 * Wraps a StoredSchemaRepository, adjusting its "update" function to hook into Fluid Ops.
 *
 * TODO: this should be more integrated with transactions.
 */
export declare class SchemaEditor<TRepository extends StoredSchemaRepository> implements StoredSchemaRepository {
    readonly inner: TRepository;
    private readonly submit;
    private readonly codec;
    private readonly formatValidator;
    constructor(inner: TRepository, submit: (op: SchemaOp) => void, options: ICodecOptions);
    on<K extends keyof SchemaEvents>(eventName: K, listener: SchemaEvents[K]): () => void;
    /**
     * @returns true if this is a schema op and was handled.
     *
     * TODO: Shared tree needs a pattern for handling non-changeset operations.
     * See TODO on `SharedTree.processCore`.
     */
    tryHandleOp(encodedOp: JsonCompatibleReadOnly): boolean;
    tryApplyStashedOp(encodedOp: JsonCompatibleReadOnly): boolean;
    /**
     * @returns true iff this is a schema op and was submitted.
     *
     * TODO: Shared tree needs a pattern for handling non-changeset operations.
     * See TODO on `SharedTree.processCore`.
     */
    tryResubmitOp(content: JsonCompatibleReadOnly): boolean;
    update(newSchema: TreeStoredSchema): void;
    registerDependent(dependent: Dependent): boolean;
    removeDependent(dependent: Dependent): void;
    get computationName(): string;
    get listDependees(): undefined | (() => Iterable<Dependee>);
    get rootFieldSchema(): TreeFieldStoredSchema;
    get treeSchema(): ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;
    private tryDecodeOp;
}
/**
 * Dumps schema into a deterministic JSON compatible semi-human readable but unspecified format.
 *
 * @remarks
 * This can be used to help inspect schema for debugging, and to save a snapshot of schema to help detect and review changes to an applications schema.
 *
 * This format may change across major versions of this package: such changes are considered breaking.
 * Beyond that, no compatibility guarantee is provided for this format: it should never be relied upon to load data, it should only be used for comparing outputs from this function.
 * @privateRemarks
 * This currently uses the schema summary format, but that could be changed to something more human readable (particularly if the encoded format becomes less human readable).
 * This intentionally does not leak the format types in the API.
 * @alpha
 */
export declare function encodeTreeSchema(schema: TreeStoredSchema): JsonCompatible;
export {};
//# sourceMappingURL=schemaSummarizer.d.ts.map