import { z } from 'zod'; import { type ParseResult } from '../../lib/zod'; import { type Data } from '../../common'; import { type CopyContext } from '../../context'; import { type DeserializedRecord } from '../../serialization'; import { ControlDefinition, type Resolvable, type SchemaType } from '../definition'; import { DefaultControlInstance, type ControlInstanceArgs } from '../instance'; import { ControlDefinitionVisitor } from '../visitor'; type Config = z.infer; type SchemaByDefaultValue = undefined extends D ? typeof Definition.schema.relaxed : typeof Definition.schema.strict; type Schema = SchemaByDefaultValue; type DataType = z.infer['data']>; type ValueType = z.infer['value']>; type ResolvedValueType = z.infer['resolvedValue']>; type ReturnedSchemaType = { definition: typeof Definition.schema.relaxed.definition; type: typeof Definition.schema.relaxed.type; data: SchemaType>; value: SchemaType>; resolvedValue: SchemaType>; }; declare class Definition extends ControlDefinition, ValueType, ResolvedValueType> { readonly version: z.infer; private static readonly v1DataType; private static readonly dataSignature; static readonly type: "makeswift::controls::text-input"; static get schema(): { version: z.ZodOptional>; relaxed: { type: z.ZodLiteral<"makeswift::controls::text-input">; data: SchemaType; value: SchemaType; resolvedValue: SchemaType; config: z.ZodObject<{ label: z.ZodOptional; description: z.ZodOptional; defaultValue: SchemaType; selectAll: z.ZodOptional; }, "strip", z.ZodTypeAny, { label?: string | undefined; description?: string | undefined; defaultValue?: string | undefined; selectAll?: boolean | undefined; }, { label?: string | undefined; description?: string | undefined; defaultValue?: string | undefined; selectAll?: boolean | undefined; }>; definition: z.ZodObject<{ type: z.ZodLiteral<"makeswift::controls::text-input">; config: z.ZodObject<{ label: z.ZodOptional; description: z.ZodOptional; defaultValue: SchemaType; selectAll: z.ZodOptional; }, "strip", z.ZodTypeAny, { label?: string | undefined; description?: string | undefined; defaultValue?: string | undefined; selectAll?: boolean | undefined; }, { label?: string | undefined; description?: string | undefined; defaultValue?: string | undefined; selectAll?: boolean | undefined; }>; version: z.ZodOptional>; }, "strip", z.ZodTypeAny, { type: "makeswift::controls::text-input"; config: { label?: string | undefined; description?: string | undefined; defaultValue?: string | undefined; selectAll?: boolean | undefined; }; version?: 1 | undefined; }, { type: "makeswift::controls::text-input"; config: { label?: string | undefined; description?: string | undefined; defaultValue?: string | undefined; selectAll?: boolean | undefined; }; version?: 1 | undefined; }>; versionedData: z.ZodObject<{ "@@makeswift/type": z.ZodEnum<["text", "text-input::v1", "text-area::v1", "code::v1", "prop-controllers::text-input::v1", "prop-controllers::text-area::v1"]>; value: z.ZodString; }, "strip", z.ZodTypeAny, { value: string; "@@makeswift/type": "text" | "text-input::v1" | "text-area::v1" | "code::v1" | "prop-controllers::text-input::v1" | "prop-controllers::text-area::v1"; }, { value: string; "@@makeswift/type": "text" | "text-input::v1" | "text-area::v1" | "code::v1" | "prop-controllers::text-input::v1" | "prop-controllers::text-area::v1"; }>; version: z.ZodOptional>; }; strict: { type: z.ZodLiteral<"makeswift::controls::text-input">; data: SchemaType; value: SchemaType; resolvedValue: SchemaType; config: z.ZodObject<{ label: z.ZodOptional; description: z.ZodOptional; defaultValue: SchemaType; selectAll: z.ZodOptional; }, "strip", z.ZodTypeAny, { defaultValue: string; label?: string | undefined; description?: string | undefined; selectAll?: boolean | undefined; }, { defaultValue: string; label?: string | undefined; description?: string | undefined; selectAll?: boolean | undefined; }>; definition: z.ZodObject<{ type: z.ZodLiteral<"makeswift::controls::text-input">; config: z.ZodObject<{ label: z.ZodOptional; description: z.ZodOptional; defaultValue: SchemaType; selectAll: z.ZodOptional; }, "strip", z.ZodTypeAny, { defaultValue: string; label?: string | undefined; description?: string | undefined; selectAll?: boolean | undefined; }, { defaultValue: string; label?: string | undefined; description?: string | undefined; selectAll?: boolean | undefined; }>; version: z.ZodOptional>; }, "strip", z.ZodTypeAny, { type: "makeswift::controls::text-input"; config: { defaultValue: string; label?: string | undefined; description?: string | undefined; selectAll?: boolean | undefined; }; version?: 1 | undefined; }, { type: "makeswift::controls::text-input"; config: { defaultValue: string; label?: string | undefined; description?: string | undefined; selectAll?: boolean | undefined; }; version?: 1 | undefined; }>; versionedData: z.ZodObject<{ "@@makeswift/type": z.ZodEnum<["text", "text-input::v1", "text-area::v1", "code::v1", "prop-controllers::text-input::v1", "prop-controllers::text-area::v1"]>; value: z.ZodString; }, "strip", z.ZodTypeAny, { value: string; "@@makeswift/type": "text" | "text-input::v1" | "text-area::v1" | "code::v1" | "prop-controllers::text-input::v1" | "prop-controllers::text-area::v1"; }, { value: string; "@@makeswift/type": "text" | "text-input::v1" | "text-area::v1" | "code::v1" | "prop-controllers::text-input::v1" | "prop-controllers::text-area::v1"; }>; version: z.ZodOptional>; }; }; static deserialize(data: DeserializedRecord): TextInputDefinition; constructor(config: C, version: z.infer); get controlType(): "makeswift::controls::text-input"; get schema(): ReturnedSchemaType; get dataSchema(): SchemaType | SchemaType; safeParse(data: unknown | undefined): ParseResult | undefined>; fromData(data: DataType | undefined): ValueType | undefined; toData(value: ValueType): DataType; copyData(data: DataType | undefined, _context: CopyContext): DataType | undefined; getTranslatableData(data: DataType | undefined): Data; resolveValue(data: DataType | undefined): Resolvable | undefined>; createInstance(args: ControlInstanceArgs): DefaultControlInstance; accept(visitor: ControlDefinitionVisitor, ...args: unknown[]): R; } export declare class TextInputDefinition extends Definition { } type UserConfig = Config & { defaultValue?: D; }; type NormedConfig = z.infer['config']>; export declare function TextInput(config?: UserConfig): TextInputDefinition>; export {}; //# sourceMappingURL=text-input.d.ts.map