import { type Readable } from '@vielzeug/ripple'; export type PropsDef> = { [K in keyof Required]: PropDef; }; export type PropDef = { readonly default: T; readonly parse: (value: string | null) => T; reflect?: boolean; }; export type PropInputDefs = Record>; /** * Prop definition factory — use these helpers for all prop definitions. * No implicit type inference; all parser behavior is explicit and intentional. */ type PropFactory = { bool(defaultValue?: boolean): PropDef; /** * JS-only property — never reads from or writes to an HTML attribute. * Use for complex objects, arrays, callbacks, or any non-serialisable value. * * @example * ```ts * columns: prop.data([]), * config: prop.data(), * getRowKey: prop.data<(row: T) => string>(), * onSelect: prop.data<(item: T) => void>(), * ``` */ data(): PropDef; data(defaultValue: T): PropDef; json(defaultValue: T): PropDef; number(): PropDef; number(defaultValue: number): PropDef; oneOf(allowed: readonly NonNullable[], defaultValue: D): PropDef; string(): PropDef; string(defaultValue: string): PropDef; }; export declare const prop: PropFactory; /** * Validate and normalize a prop definition. * Throws if definition is invalid or incomplete. * * Accepts any object shaped like `PropDef` — not just `prop.*` helper output — so you can * define a custom prop with explicit parser and reflection behavior when the `prop.*` helpers * don't cover your type: * * ```ts * const customProp = (): PropDef => ({ * default: new MyCustomType(), * parse: (value) => JSON.parse(value || '{}') as MyCustomType, * reflect: false, * }); * ``` */ export declare function normalizePropDefinition(value: unknown, propName: string): PropDef; /** * Validate all prop definitions at define-time. * Returns validation error messages or empty array if valid. */ export declare function validatePropDefs(defs: Record): string[]; /** * Look up the registered prop metadata for a given attribute name on an element. * Used by the template compiler to resolve prop bindings without exposing the registry. */ export declare const getPropMeta: (el: HTMLElement, attrName: string) => PropMeta | undefined; export type InferPropValue = T extends PropDef ? U : T; /** * Infer the reactive props object type from a `PropInputDefs` map. * Each entry becomes a `Reactive` keyed by the prop name. * * @example * ```ts * const propDefs = { count: prop.number(0), label: prop.string('hi') }; * type Props = InferProps; * // => { readonly count: Readable; readonly label: Readable } * ``` */ export type InferProps = { readonly [K in keyof D]-?: Readable>; }; export declare function createProps(el: HTMLElement, defs: D): InferProps; export {}; //# sourceMappingURL=props.d.ts.map