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'; export type GalleryOption = { id: string; thumbnailUrl: string; label?: string; value: T; }; export type GalleryPage = { options: GalleryOption[]; }; type GetOptionsType = () => GalleryPage | Promise>; type Config = { label?: string; description?: string; getOptions: GetOptionsType; }; type ItemType = C extends Config ? Item : never; type DataType = GalleryOption>; type ValueType = DataType; type ResolvedValueType = GalleryOption>['value'] | undefined; declare class Definition extends ControlDefinition, ValueType, ResolvedValueType> { static readonly type: "makeswift::controls::gallery"; static schema(item: SchemaType): { type: z.ZodLiteral<"makeswift::controls::gallery">; data: SchemaType>; value: SchemaType>; resolvedValue: z.ZodOptional>; config: z.ZodObject<{ getOptions: z.ZodFunction, z.ZodUnion<[z.ZodObject<{ options: z.ZodArray>, "many">; }, "strip", z.ZodTypeAny, { options: GalleryOption[]; }, { options: GalleryOption[]; }>, z.ZodPromise>, "many">; }, "strip", z.ZodTypeAny, { options: GalleryOption[]; }, { options: GalleryOption[]; }>>]>>; label: z.ZodOptional; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { getOptions: (...args: unknown[]) => { options: GalleryOption[]; } | Promise<{ options: GalleryOption[]; }>; label?: string | undefined; description?: string | undefined; }, { getOptions: (...args: unknown[]) => { options: GalleryOption[]; } | Promise<{ options: GalleryOption[]; }>; label?: string | undefined; description?: string | undefined; }>; definition: z.ZodObject<{ type: z.ZodLiteral<"makeswift::controls::gallery">; config: z.ZodObject<{ getOptions: z.ZodFunction, z.ZodUnion<[z.ZodObject<{ options: z.ZodArray>, "many">; }, "strip", z.ZodTypeAny, { options: GalleryOption[]; }, { options: GalleryOption[]; }>, z.ZodPromise>, "many">; }, "strip", z.ZodTypeAny, { options: GalleryOption[]; }, { options: GalleryOption[]; }>>]>>; label: z.ZodOptional; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { getOptions: (...args: unknown[]) => { options: GalleryOption[]; } | Promise<{ options: GalleryOption[]; }>; label?: string | undefined; description?: string | undefined; }, { getOptions: (...args: unknown[]) => { options: GalleryOption[]; } | Promise<{ options: GalleryOption[]; }>; label?: string | undefined; description?: string | undefined; }>; }, "strip", z.ZodTypeAny, { type: "makeswift::controls::gallery"; config: { getOptions: (...args: unknown[]) => { options: GalleryOption[]; } | Promise<{ options: GalleryOption[]; }>; label?: string | undefined; description?: string | undefined; }; }, { type: "makeswift::controls::gallery"; config: { getOptions: (...args: unknown[]) => { options: GalleryOption[]; } | Promise<{ options: GalleryOption[]; }>; label?: string | undefined; description?: string | undefined; }; }>; }; static deserialize(data: DeserializedRecord): unstable_GalleryDefinition; get controlType(): "makeswift::controls::gallery"; get schema(): { type: z.ZodLiteral<"makeswift::controls::gallery">; data: SchemaType>>; value: SchemaType>>; resolvedValue: z.ZodOptional>>; config: z.ZodObject<{ getOptions: z.ZodFunction, z.ZodUnion<[z.ZodObject<{ options: z.ZodArray>>, "many">; }, "strip", z.ZodTypeAny, { options: GalleryOption>[]; }, { options: GalleryOption>[]; }>, z.ZodPromise>>, "many">; }, "strip", z.ZodTypeAny, { options: GalleryOption>[]; }, { options: GalleryOption>[]; }>>]>>; label: z.ZodOptional; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { getOptions: (...args: unknown[]) => { options: GalleryOption>[]; } | Promise<{ options: GalleryOption>[]; }>; label?: string | undefined; description?: string | undefined; }, { getOptions: (...args: unknown[]) => { options: GalleryOption>[]; } | Promise<{ options: GalleryOption>[]; }>; label?: string | undefined; description?: string | undefined; }>; definition: z.ZodObject<{ type: z.ZodLiteral<"makeswift::controls::gallery">; config: z.ZodObject<{ getOptions: z.ZodFunction, z.ZodUnion<[z.ZodObject<{ options: z.ZodArray>>, "many">; }, "strip", z.ZodTypeAny, { options: GalleryOption>[]; }, { options: GalleryOption>[]; }>, z.ZodPromise>>, "many">; }, "strip", z.ZodTypeAny, { options: GalleryOption>[]; }, { options: GalleryOption>[]; }>>]>>; label: z.ZodOptional; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { getOptions: (...args: unknown[]) => { options: GalleryOption>[]; } | Promise<{ options: GalleryOption>[]; }>; label?: string | undefined; description?: string | undefined; }, { getOptions: (...args: unknown[]) => { options: GalleryOption>[]; } | Promise<{ options: GalleryOption>[]; }>; label?: string | undefined; description?: string | undefined; }>; }, "strip", z.ZodTypeAny, { type: "makeswift::controls::gallery"; config: { getOptions: (...args: unknown[]) => { options: GalleryOption>[]; } | Promise<{ options: GalleryOption>[]; }>; label?: string | undefined; description?: string | undefined; }; }, { type: "makeswift::controls::gallery"; config: { getOptions: (...args: unknown[]) => { options: GalleryOption>[]; } | Promise<{ options: GalleryOption>[]; }>; label?: string | undefined; description?: string | undefined; }; }>; }; 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 unstable_GalleryDefinition extends Definition { } type NormedConfig> = Config & { getOptions: GetOptions; }; export declare function unstable_Gallery>(config: Config & { getOptions: GetOptions; }): unstable_GalleryDefinition>; export { type Config as GalleryConfig }; //# sourceMappingURL=gallery.d.ts.map