/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { EmptyObject } from "../feature-libraries";
import { SchemaFactory } from "./schemaFactory";
import { type NodeKind as _dummy } from "./schemaTypes";
/**
 * Create a schema for a node with no state.
 * @remarks
 * This is commonly used in unions when the only information needed is which kind of node the value is.
 * Enums are a common example of this pattern.
 * @alpha
 */
export declare function singletonSchema<TScope extends string, TName extends string | number>(factory: SchemaFactory<TScope, TName>, name: TName): {
    new (data?: EmptyObject): {
        readonly value: TName;
    };
    readonly identifier: `${TScope}.${TName}`;
    readonly kind: _dummy.Object;
    readonly info: unknown;
};
/**
 * Converts an enum into a collection of schema which can be used in a union.
 * @remarks
 * Currently only supports `string` enums.
 * @example
 * ```typescript
 * enum Mode {
 * 	a = "A",
 * 	b = "B",
 * }
 * const ModeNodes = adaptEnum(schema, Mode);
 * type ModeNodes = NodeFromSchema<(typeof ModeNodes)[keyof typeof ModeNodes]>;
 * const nodeFromString: ModeNodes = ModeNodes(Mode.a);
 * const nodeFromSchema: ModeNodes = new ModeNodes.a();
 * const nameFromNode: Mode = nodeFromSchema.value;
 * class Parent extends schemaFactory.object("Parent", {
 * 	mode: typedObjectValues(ModeNodes),
 * }) {}
 * ```
 * @privateRemarks
 * TODO:
 * Extends this to support numeric enums.
 * Maybe require an explicit nested scope to group them under, or at least a warning about collisions.
 * Maybe just provide `SchemaFactory.nested` to east creating nested scopes?
 * @alpha
 */
export declare function adaptEnum<TScope extends string, const TEnum extends Record<string, string>>(factory: SchemaFactory<TScope>, members: TEnum): (<TValue extends TEnum[keyof TEnum]>(value: TValue) => {
    readonly value: TValue;
}) & { readonly [Property in keyof TEnum]: {
    new (data?: EmptyObject | undefined): {
        readonly value: TEnum[Property];
    };
    readonly identifier: `${TScope}.${TEnum[Property]}`;
    readonly kind: _dummy.Object;
    readonly info: unknown;
}; };
/**
 * `Object.values`, but with more specific types.
 * @alpha
 */
export declare function typedObjectValues<TKey extends string, TValues>(object: Record<TKey, TValues>): TValues[];
/**
 * Converts an array of distinct strings into a collection of schema which can be used like an enum style union.
 * @remarks
 * The returned collection is also a function which can be used to convert strings into {@link Unhydrated} nodes in the union.
 * Each node type has a `.value` getter which returns the associated string.
 *
 * The produced nodes use the provided strings as their `name`, and don't store any data beyond that.
 * @example
 * ```typescript
 * const Mode = enumFromStrings(schemaFactory, ["Fun", "Cool"]);
 * type Mode = NodeFromSchema<(typeof Mode)[keyof typeof Mode]>;
 * const nodeFromString: Mode = Mode("Fun");
 * const nodeFromSchema: Mode = new Mode.Fun();
 * const nameFromNode = nodeFromSchema.value;
 *
 * class Parent extends schemaFactory.object("Parent", { mode: typedObjectValues(Mode) }) {}
 * ```
 * @alpha
 */
export declare function enumFromStrings<TScope extends string, const Members extends string>(factory: SchemaFactory<TScope>, members: Members[]): (<TValue extends Members>(value: TValue) => {
    readonly value: TValue;
}) & Record<Members, {
    new (data?: EmptyObject | undefined): {
        readonly value: Members;
    };
    readonly identifier: `${TScope}.${Members}`;
    readonly kind: _dummy.Object;
    readonly info: unknown;
}>;
//# sourceMappingURL=schemaCreationUtilities.d.ts.map