import type { JsonValue } from './json-value.ts';
import type { Nxtpression } from './nxtpression.ts';
import type { WidgetOptions, WidgetType } from './widget.ts';
export interface SchemaRootProperty<Value extends JsonValue = JsonValue> extends NxtpressionSchemaProperty<Value> {
    domain?: string;
    path?: string;
    recordName?: Nxtpression<string, {
        id: string;
        domain?: string;
    } & NxtpressionSchemaProperty<Value>>;
    setter?: Nxtpression<(value: unknown) => void, {
        id: string;
        value: unknown;
    }>;
    /** An object specifying where to index the data. Adding this will effectively make the data searchable. */
    index?: {
        /** A string specifying the user-friendly title of the search property. This is what users will see when creating search filters and bookmarks. */
        label: string;
        /** A string specifying where to store the data in the search index. Note that this should be a globally unique value in the system. Typically you'd use `{domain}.{path}` and you should prefer English in camel case */
        path: string;
    };
}
export type NxtpressionSchemaProperty<Value extends JsonValue = JsonValue> = {
    [K in keyof SchemaProperty<Value>]: Nxtpression<SchemaProperty<Value>[K], {
        id: string;
    }>;
};
export interface SchemaProperty<Value extends JsonValue = JsonValue> {
    /** Specifying what type of data will be entered into the field. */
    type?: "array" | "asset" | "boolean" | "datetime" | "number" | "string" | "object" | "rpc";
    /** User-friendly title of the property. This will be used as the field's label in the UI. */
    title?: string;
    description?: string;
    /** If present, indicates that the user must specify a value for the asset to be treated as valid. */
    required?: boolean;
    oneOf?: Array<SchemaProperty>;
    anyOf?: Array<SchemaProperty>;
    enum?: Value[];
    minItems?: number;
    maxItems?: number;
    items?: SchemaProperty<Value>;
    properties?: Record<string, SchemaProperty>;
    default?: Value;
    const?: Value;
    widget?: WidgetType | WidgetOptions;
    placeholder?: string;
    helpText?: string;
    invalid?: boolean;
    emptyValue?: Value;
}
