import { SchemaOptions, Static, StringOptions, TObject, TString, TUnknown, ExtendedTypeBuilder as TypeboxTypeBuilder } from '@sinclair/typebox'; import type { Except, LiteralUnion, ReadonlyDeep, Simplify } from 'type-fest'; import { LCDS } from '@cloudbase/cals'; import React from 'react'; export type { Static } from '@sinclair/typebox'; export type { Simplify }; declare const dataSourceFormat: readonly ["string", "tel", "x-long-text", "phone", "datetime", "date", "time", "boolean", "array", "object", "email", "url", "x-image", "x-rtf", "x-enum", "x-location", "x-file", "x-autonumber", "x-area-code", "function", "related", "father-son", "many-many"]; type PropertyFormat = typeof dataSourceFormat[number]; declare class TypeBuilder extends TypeboxTypeBuilder { private makeEnumOptions; StringEnum>(options: T): import("@sinclair/typebox").TUnsafe; NumberEnum>(options: T): import("@sinclair/typebox").TUnsafe; Slot>(options?: T): import("@sinclair/typebox").TUnsafe; String(options?: StringOptions): TString; BasicTypeUnion(options?: SchemaOptions): import("@sinclair/typebox").TUnion[]>; FormatTypeUnion(options?: SchemaOptions): import("@sinclair/typebox").TUnion[]>; BreakPoint(options: T): TBreakPoint; } export declare const Type: TypeBuilder; type CommonLinkageItem = { target: string; condition?: boolean | string; /** x-linkage 的注释 */ _comment?: string; }; type LinkageStateOptions = Record; type LinkageSchemaOptions = Record; type TValueVisibleLinkageItem = CommonLinkageItem & { type: 'value:visible'; }; type TValueStateLinkageItem = CommonLinkageItem & { type: 'value:state'; state: LinkageStateOptions; }; type TValueSchemaLinkageItem = CommonLinkageItem & { type: 'value:schema'; schema: LinkageSchemaOptions; }; type TXLinkagesItem = TValueVisibleLinkageItem | TValueStateLinkageItem | TValueSchemaLinkageItem; type XComponentProps = T extends 'flex-align-select' ? { direction: 'mainAxis' | 'crossAxis'; } : Record; type XPlatform = 'MP' | 'WEB' | 'PCWEB' | 'MOBILEWEB'; type XComponentUnion = LiteralUnion<'radio' | 'textarea' | 'checkbox' | 'color' | 'image' | 'page-list' | 'select' | 'flex-align-select', string>; type BreakPointEnum = 'xs' | 'lg'; type TBreakPoint = TString & { type: 'string'; description: string; breakpoint: BreakPointEnum; }; declare module '@sinclair/typebox' { interface SchemaOptions { 'x-index'?: number; 'x-valid-breakpoint'?: TBreakPoint; 'x-category'?: string; 'x-linkages'?: TXLinkagesItem[]; 'x-component-props'?: XComponentProps; 'x-platforms'?: XPlatform[] | ['']; 'x-component'?: XComponent; 'x-props'?: { 'data-hidebind'?: boolean; 'data-withBindMeta'?: boolean; [k: string]: unknown; }; format?: PropertyFormat; } } export declare const Tuple: (xs: readonly [...T]) => T; interface EnumSchemaOptions extends SchemaOptions { 'x-index'?: number; enum: ReturnType; readonly value: Readonly; }[]>>; } export type Events = Readonly<(LCDS.IEvent & { 'x-platforms'?: XPlatform[]; description?: string; detail?: TObject | TUnknown; })[]>; type VisibleItem = 'APP' | 'COMPONENT'; type ValidateRuleItem = { rule: string; [k: string]: unknown; }; type Method = { name: string; label: string; 'x-platforms'?: XPlatform[]; description?: string; params?: any; }; type ClassApiItem = { name: string; selector: string; description: string; }; type ConfigMeta = Simplify)[]; extra?: Record<'container', { 'x-component': string; 'x-component-props': string[]; 'x-index': number; }>; }; contextData?: any; }>>; export type StaticEventsType = { events: { [E in T[number] as E['name']]: (eventDetail: E['detail'] extends TObject ? Static : unknown, ...args: unknown[]) => unknown; }; }; type Schema = Simplify & { $schema: 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json'; data: D; events: Events; properties?: P; classes?: ClassApiItem[]; methods?: Method[]; defaultStyles?: React.CSSProperties; compConfig?: Partial, unknown>>; meta: LCDS.IComponent['meta'] & ConfigMeta & { name?: string; componentName?: string; categoryOrder?: number; platform?: XPlatform[]; inlineStyleForm?: Record | { $blockedAll: true; }; visible?: VisibleItem[] | string; validate?: ValidateRuleItem[]; templates?: Array<{ to: string; autoSelectPath?: `template${string}`; body: string; when?: LiteralUnion<'$attached', string>; }>; }; /** @deprecated no meant to be public */ configMeta?: ConfigMeta; }>>; export declare function defineConfig>(config: T): T;