/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { FlexObjectNodeSchema, FlexTreeField, FlexTreeObjectNode, LocalNodeKey } from "../feature-libraries/index.js";
import { InsertableContent } from "./proxies.js";
import { NodeKind, ImplicitFieldSchema, TreeNodeSchemaClass, WithType, TreeFieldFromImplicitField, InsertableTreeFieldFromImplicitField, FieldSchema } from "./schemaTypes.js";
import { TreeNode } from "./types.js";
import { RestrictiveReadonlyRecord } from "../util/index.js";
import { RawTreeNode } from "./rawNode.js";
/**
 * Helper used to produce types for object nodes.
 * @public
 */
export type ObjectFromSchemaRecord<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>> = {
    -readonly [Property in keyof T]: TreeFieldFromImplicitField<T[Property]>;
};
/**
 * A {@link TreeNode} which modules a JavaScript object.
 * @remarks
 * Object nodes consist of a type which specifies which {@link TreeNodeSchema} they use (see {@link TreeNodeApi.schema}), and a collections of fields, each with a distinct `key` and its own {@link FieldSchema} defining what can be placed under that key.
 *
 * All fields on an object node are exposed as own properties with string keys.
 * Non-empty fields are enumerable and empty optional fields are non-enumerable own properties with the value `undefined`.
 * No other own `own` or `enumerable` properties are included on object nodes unless the user of the node manually adds custom session only state.
 * This allows a majority of general purpose JavaScript object processing operations (like `for...in`, `Reflect.ownKeys()` and `Object.entries()`) to enumerate all the children.
 * @public
 */
export type TreeObjectNode<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>, TypeName extends string = string> = TreeNode & ObjectFromSchemaRecord<T> & WithType<TypeName>;
/**
 * Helper used to produce types for:
 *
 * 1. Insertable content which can be used to construct an object node.
 *
 * 2. Insertable content which is an unhydrated object node.
 *
 * 3. Union of 1 and 2.
 *
 * @privateRemarks TODO: consider separating these cases into different types.
 *
 * @public
 */
export type InsertableObjectFromSchemaRecord<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>> = {
    readonly [Property in keyof T]: InsertableTreeFieldFromImplicitField<T[Property]>;
};
export declare function setField(field: FlexTreeField, simpleFieldSchema: FieldSchema, value: InsertableContent): void;
type ObjectNodeSchema<TName extends string = string, T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema> = RestrictiveReadonlyRecord<string, ImplicitFieldSchema>, ImplicitlyConstructable extends boolean = boolean> = TreeNodeSchemaClass<TName, NodeKind.Object, TreeNode & WithType<TName>, InsertableObjectFromSchemaRecord<T>, ImplicitlyConstructable, T>;
/**
 * Define a {@link TreeNodeSchema} for a {@link TreeObjectNode}.
 *
 * @param name - Unique identifier for this schema within this factory's scope.
 * @param fields - Schema for fields of the object node's schema. Defines what children can be placed under each key.
 */
export declare function objectSchema<TName extends string, const T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>, const ImplicitlyConstructable extends boolean>(base: ObjectNodeSchema<TName, T, ImplicitlyConstructable>): TreeNodeSchemaClass<TName, NodeKind.Object, TreeObjectNode<T, TName>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
/**
 * The implementation of an object node created by {@link createRawNode}.
 */
export declare class RawObjectNode<TSchema extends FlexObjectNodeSchema, TContent extends object> extends RawTreeNode<TSchema, TContent> implements FlexTreeObjectNode {
    get localNodeKey(): LocalNodeKey | undefined;
}
export {};
//# sourceMappingURL=objectNode.d.ts.map