/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { type FlexTreeNode } from "../feature-libraries/index.js";
import { type TreeNodeSchema, TreeNode, type InternalTreeNode, type Context, type UnhydratedFlexTreeNode } from "./core/index.js";
/**
 * Class which all {@link TreeNode}s must extend.
 * Since this is not exported, it allows robust detection of attempts to create TreeNodes which do not go through SchemaFactory which is the only place which exposes classes that extend this.
 *
 * This has static members which schema classes can override to provide schema specific functionality.
 * These static members are only intended to be used / overridden by code within this package, and are used by the various node kinds.
 * Access to these static members has to be done via `this.constructor.staticMember` to support the overrides, and thus can only be used in the constructor, after the base constructor has been invoked.
 */
export declare abstract class TreeNodeValid<TInput> extends TreeNode {
    /**
     * Schema classes can override this to control what happens at the end of the constructor.
     * The return value from this is returned from the constructor, allowing substituting a proxy if desired.
     *
     * This is not simply done in the derived constructor to enable:
     * - this class to access the value which is being returned before it's returned from the constructor.
     * - the derived class to be provided the input `FlexTreeNode` without relying on a field on the node to hold it.
     */
    protected static prepareInstance<T>(this: typeof TreeNodeValid<T>, instance: TreeNodeValid<T>, input: FlexTreeNode): TreeNodeValid<T>;
    /**
     * Schema classes must override to provide an implementation of RawTreeNode construction.
     */
    protected static buildRawNode<T>(this: typeof TreeNodeValid<T>, instance: TreeNodeValid<T>, input: T): UnhydratedFlexTreeNode;
    /**
     * Schema classes can override to provide a callback that is called once when the first node is constructed.
     * This is a good place to perform extra validation and cache schema derived data needed for the implementation of the node.
     * @remarks
     * It is valid to dereference LazyItem schema references in this function (or anything that runs after it).
     */
    protected static oneTimeSetup<T>(this: typeof TreeNodeValid<T>): Context;
    /**
     * The most derived constructor (the one invoked with the `new` operator, not a parent class constructor invoked with as `super`) used to construct an instance of this type.
     * @remarks
     * Captured when an instance is constructed.
     *
     * Used to ensure that some derived class (which must override this member, defaulting it to `undefined`) is only instantiated with a single "most derived" class (the constructor actually invoked the the user with `new`).
     *
     * Typically this is override in the class that statically implements {@link TreeNodeSchema} to enforce that all nodes using that schema use the same class and not different subclasses of it.
     *
     * Also used to detect if oneTimeSetup has run.
     *
     * @privateRemarks
     * This defaults to "default", which is used to trigger an error if not overridden in the derived class.
     *
     * The value of this on TreeNodeValid must only be overridden by base classes and never modified.
     * Ways to enforce this immutability prevent it from being overridden,
     * so code modifying constructorCached should be extra careful to avoid accidentally modifying the base/inherited value.
     */
    protected static constructorCached: MostDerivedData | "default" | undefined;
    /**
     * Indicate that `this` is the most derived version of a schema, and thus the only one allowed to be used (other than by being subclassed a single time).
     */
    static markMostDerived(this: typeof TreeNodeValid & TreeNodeSchema): MostDerivedData;
    /**
     * Node creation function for implementing the TreeNodeSchemaNonClass half of TreeNodeSchemaBoth.
     * @remarks
     * When used as TreeNodeSchemaNonClass and subclassed,
     * does not actually have the correct compile time type for the return value due to TypeScript limitations.
     * This is why this is not exposed as part of TreeNodeSchemaClass where subclassing is allowed.
     */
    static create<TInput, TOut, TThis extends new (args: TInput) => TOut>(this: TThis, input: TInput): TOut;
    /**
     * See {@link TreeNodeSchemaCore.createFromInsertable}.
     */
    static createFromInsertable<TInput, TOut, TThis extends new (args: TInput) => TOut>(this: TThis, input: TInput): TOut;
    /**
     * Idempotent initialization function that pre-caches data and can dereference lazy schema references.
     */
    static oneTimeInitialize(this: typeof TreeNodeValid & TreeNodeSchema): Required<MostDerivedData>;
    constructor(input: TInput | InternalTreeNode);
}
/**
 * Data cached about the most derived type in a schema's class hierarchy.
 * @remarks
 * The most derived type is the only one allowed to be referenced by other schema or constructed as a node.
 * It has to be discovered lazily (when a node is constructed or when a {@link TreeViewConfiguration} is made),
 * since JavaScript provides no way to find derived classes, or inject static class initialization time logic into base classes.
 * Additionally since schema can reference other schema through lazy references which might be forward or recursive references,
 * this can not be evaluated for one schema when referenced by another schema.
 *
 * See {@link TreeNodeValid.constructorCached} and {@link TreeNodeValid.markMostDerived}.
 */
export interface MostDerivedData {
    readonly constructor: typeof TreeNodeValid & TreeNodeSchema;
    oneTimeInitialized?: Context;
}
//# sourceMappingURL=treeNodeValid.d.ts.map