alinea
Version:
Headless git-based CMS
20 lines (19 loc) • 871 B
TypeScript
import type { FieldOptions, WithoutLabel } from 'alinea/core/Field';
import { type FieldsDefinition, type Type } from 'alinea/core/Type';
import { RecordField } from 'alinea/core/field/RecordField';
import type { ReactNode } from 'react';
export interface ObjectOptions<Definition> extends FieldOptions<Type.Infer<Definition>> {
/** Width of the field in the dashboard UI (0-1) */
width?: number;
/** Add instructional text to a field */
help?: ReactNode;
/** Display a minimal version */
inline?: boolean;
}
export declare class ObjectField<Definition> extends RecordField<Type.Infer<Definition>, ObjectOptions<Definition> & {
fields: Type<Definition>;
}> {
}
export declare function object<Fields extends FieldsDefinition>(label: string, options: WithoutLabel<ObjectOptions<Fields> & {
fields: Fields;
}>): ObjectField<Fields> & Fields;