import { Component, Descriptor as Desc, Descriptor, Property as Prop, RenderFunction } from 'hybrids'; import { emit } from './events.js'; import { Disposable as Disp, Fn, Type } from './factories/disposable.js'; import { HostedMutationCallback } from './factories/mo.js'; import { slotted } from './refs/slotted.js'; type Connect = Descriptor['connect']; /** * Create a type-curried builder for Hybrid components. * @category Define * @typeParam E - host element type * @returns type-curried helpers for building Hybrid components. */ export declare const HybridBuilder: () => { prop: (property: Prop) => Prop; be: (value: Desc["value"]) => Desc; disposable: (Ctor: Type | Fn) => Prop; effect: (property: Prop, ...effects: Desc["observe"][]) => Prop; mo: (prop: Prop, init: MutationObserverInit & { callback?: HostedMutationCallback; }) => Desc; mouse: ({ target, clamp, }?: { target?: Element; clamp?: boolean; }) => Desc; reflect: (prop: Prop, bidirectional?: boolean) => { reflect: boolean; connect(host: any, key: any, invalidate: any): () => void; value: V | ((host: E & HTMLElement) => V) | ((host: E & HTMLElement, value: any) => V); observe?(host: E & HTMLElement, value: V, lastValue: V): void; }; ro: (prop: Prop) => Desc; ref: (query: string) => Desc; refs: (queryAll: string) => Desc; slotted: typeof slotted; render: (renderer: RenderFunction) => RenderFunction; shadow: (value: RenderFunction) => { value: RenderFunction; shadow: boolean; }; alpine: { (string: any, ...parts: any[]): import("hybrids").UpdateFunctionWithMethods; engine: any; resolve: any; set: any; transition: any; host: typeof import("./template/alpine/x-host.js").xHost; prop: typeof import("./template/alpine/x-prop.js").xProp; config(Alp: typeof import("alpinejs"), directives?: Record): void; } | ((_: E_1) => void); html: { (string: any, ...parts: any[]): import("hybrids").UpdateFunctionWithMethods; engine: any; resolve: any; set: any; transition: any; host: typeof import("./template/alpine/x-host.js").xHost; prop: typeof import("./template/alpine/x-prop.js").xProp; config(Alp: typeof import("alpinejs"), directives?: Record): void; } | { (parts: TemplateStringsArray, ...args: unknown[]): import("hybrids").UpdateFunctionWithMethods; set(property: keyof E_1, valueOrPath?: any): import("hybrids").EventHandler; set(property: M, valueOrPath: string | null): import("hybrids").EventHandler; resolve(promise: Promise, placeholder?: import("hybrids").UpdateFunction, delay?: number): import("hybrids").UpdateFunction; transition(template: import("hybrids").UpdateFunction): import("hybrids").UpdateFunction; msg(parts: TemplateStringsArray, ...args: unknown[]): string; }; xhost: (prop: Prop) => { connect(host: any, _key: any): void; observe(host: any, value: any, last: any): void; value: V | ((host: E & HTMLElement) => V) | ((host: E & HTMLElement, value: any) => V); reflect?: boolean | ((value: V) => string); }; hy: { print: (data: any, space?: string | number) => import("hybrids").UpdateFunctionWithMethods; if: (condition: boolean | (() => boolean), frag: import("hybrids").UpdateFunctionWithMethods, fallback?: import("hybrids").UpdateFunctionWithMethods) => import("hybrids").UpdateFunctionWithMethods; regex: (regexp: R, frag: (match: RegExpExecArray) => import("hybrids").UpdateFunctionWithMethods, fallback?: import("hybrids").UpdateFunctionWithMethods) => (value: string) => import("hybrids").UpdateFunctionWithMethods; map: (items: T[] | ((...args: any[]) => T[]), predicate: (item: T, i: number, arr: T[]) => import("hybrids").UpdateFunctionWithMethods) => import("hybrids").UpdateFunctionWithMethods[]; case: (value: T_1, cases: Record> & { default?: import("hybrids").UpdateFunctionWithMethods; }) => import("hybrids").UpdateFunctionWithMethods; keyvalue: (record: Record, template: (key: any, value: any) => import("hybrids").UpdateFunctionWithMethods) => import("hybrids").UpdateFunctionWithMethods[]; }; emit: typeof emit; set: (property: keyof E, extractor?: (e: Ev) => E[typeof property]) => (host: E, e: Event) => E[keyof E]; stop: (handler: (host: E, e: CustomEvent) => void) => (host: E & HTMLElement, e: CustomEvent) => void; prevent: (handler: (host: E, e: CustomEvent) => void) => (host: E & HTMLElement, e: CustomEvent) => void; define: (component: Component) => Component; compile: (component: Component) => import("hybrids").HybridElement; }; /** * Build and define a web component with helpers. * @function * @category Define * @param factory a function which returns a component definition. * @typeParam E - host element type * @returns the defined component or null if the tag is already defined. */ export declare function build(factory: (builder: ReturnType> & { onconnect: (...connectors: Connect[]) => void; ondisconnect: (...disconnectors: Connect[]) => void; }) => Component): Component | null; export declare namespace build { var compile: (factory: (builder: ReturnType>) => Component) => import("hybrids").HybridElement; } export {};