/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { FieldKey, TreeStoredSchema, UpPath } from "../../core";
import { StableNodeKey } from "../node-key";
import { EditableTree, TreeStatus } from "./editableTreeTypes";
/**
 * @returns true iff `schema` trees should default to being viewed as just their value when possible.
 *
 * @remarks
 * This may return true for some types which EditableTree does not unwrap to just their value,
 * since EditableTree avoids ever unwrapping primitives that are objects
 * so users checking for primitives by type won't be broken.
 * Checking for this object case is done elsewhere.
 * @alpha
 */
export declare function isPrimitive(schema: TreeStoredSchema): boolean;
/**
 * Variant of ProxyHandler covering when the type of the target and implemented interface are different.
 * Only the parts needed so far are included.
 */
export interface AdaptingProxyHandler<T extends object, TImplements extends object> {
    deleteProperty?(target: T, p: string | symbol): boolean;
    get?(target: T, p: string | symbol, receiver: unknown): unknown;
    getOwnPropertyDescriptor?(target: T, p: string | symbol): PropertyDescriptor | undefined;
    has?(target: T, p: string | symbol): boolean;
    ownKeys?(target: T): ArrayLike<keyof TImplements>;
    set?(target: T, p: string | symbol, value: unknown, receiver: unknown): boolean;
}
export declare function adaptWithProxy<From extends object, To extends object>(target: From, proxyHandler: AdaptingProxyHandler<From, To>): To;
export declare function getOwnArrayKeys(length: number): string[];
export declare function keyIsValidIndex(key: string | number, length: number): boolean;
/**
 * Retrieve a {@link StableNodeKey} on the given {@link EditableTree} node.
 * @param nodeKeyFieldKey - the key of the field under which the node key resides
 * @param node - the {@link EditableTree} node from which to retrieve the node key
 * @returns the {@link StableNodeKey} on `node`, or undefined if there is none.
 */
export declare function getStableNodeKey(nodeKeyFieldKey: FieldKey, node: EditableTree): StableNodeKey | undefined;
/**
 * Checks the path and returns the TreeStatus based on whether or not the detached field is the root field.
 * TODO: Performance: This is a slow initial implementation which traverses the entire path up to the root of the tree.
 * This should eventually be optimized.
 * @param path - the path you want to check
 * @returns the {@link TreeStatus} from the path provided.
 */
export declare function treeStatusFromPath(path: UpPath): TreeStatus;
//# sourceMappingURL=utilities.d.ts.map