import { z } from 'zod'; import { type ParseResult } from '../../lib/zod'; 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::code"; static get schema(): { version: z.ZodLiteral<1>; relaxed: { type: z.ZodLiteral<"makeswift::controls::code">; data: SchemaType; value: SchemaType; resolvedValue: SchemaType<{ value: string; } | undefined>; config: z.ZodObject<{ label: z.ZodOptional; description: z.ZodOptional; defaultValue: SchemaType; }, "strip", z.ZodTypeAny, { label?: string | undefined; description?: string | undefined; defaultValue?: string | undefined; }, { label?: string | undefined; description?: string | undefined; defaultValue?: string | undefined; }>; definition: z.ZodObject<{ type: z.ZodLiteral<"makeswift::controls::code">; config: z.ZodObject<{ label: z.ZodOptional; description: z.ZodOptional; defaultValue: SchemaType; }, "strip", z.ZodTypeAny, { label?: string | undefined; description?: string | undefined; defaultValue?: string | undefined; }, { label?: string | undefined; description?: string | undefined; defaultValue?: string | undefined; }>; version: z.ZodLiteral<1>; }, "strip", z.ZodTypeAny, { type: "makeswift::controls::code"; config: { label?: string | undefined; description?: string | undefined; defaultValue?: string | undefined; }; version: 1; }, { type: "makeswift::controls::code"; config: { label?: string | undefined; description?: string | undefined; defaultValue?: string | undefined; }; version: 1; }>; 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.ZodLiteral<1>; }; strict: { type: z.ZodLiteral<"makeswift::controls::code">; data: SchemaType; value: SchemaType; resolvedValue: SchemaType<{ value: string; }>; config: z.ZodObject<{ label: z.ZodOptional; description: z.ZodOptional; defaultValue: SchemaType; }, "strip", z.ZodTypeAny, { defaultValue: string; label?: string | undefined; description?: string | undefined; }, { defaultValue: string; label?: string | undefined; description?: string | undefined; }>; definition: z.ZodObject<{ type: z.ZodLiteral<"makeswift::controls::code">; config: z.ZodObject<{ label: z.ZodOptional; description: z.ZodOptional; defaultValue: SchemaType; }, "strip", z.ZodTypeAny, { defaultValue: string; label?: string | undefined; description?: string | undefined; }, { defaultValue: string; label?: string | undefined; description?: string | undefined; }>; version: z.ZodLiteral<1>; }, "strip", z.ZodTypeAny, { type: "makeswift::controls::code"; config: { defaultValue: string; label?: string | undefined; description?: string | undefined; }; version: 1; }, { type: "makeswift::controls::code"; config: { defaultValue: string; label?: string | undefined; description?: string | undefined; }; version: 1; }>; 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.ZodLiteral<1>; }; }; static deserialize(data: DeserializedRecord): CodeDefinition; constructor(config: C, version: z.infer); get controlType(): "makeswift::controls::code"; 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; resolveValue(data: DataType | undefined): Resolvable | undefined>; createInstance(args: ControlInstanceArgs): DefaultControlInstance; accept(visitor: ControlDefinitionVisitor, ...args: unknown[]): R; } export declare class CodeDefinition extends Definition { } type UserConfig = Config & { defaultValue?: D; }; type NormedConfig = z.infer['config']>; export declare function Code(config?: UserConfig): CodeDefinition>; export {}; //# sourceMappingURL=code.d.ts.map