import { Component, ComponentReturnType } from './component-class'; import { Root, createRoot, resolveRenderable } from './root'; import { DOMApi, GenericReturnType, Slots, ComponentRenderTarget, RENDERING_CONTEXT_PROPERTY, RENDERED_NODES_PROPERTY, COMPONENT_ID_PROPERTY } from './types'; import { Cell, MergedCell } from './reactive'; import { SyncListComponent, AsyncListComponent, InverseFn } from './control-flow/list'; import { $_blk, StaticBlockDef, StaticBlockSlot } from './static-block'; import { DestructorFn, Destructors } from './glimmer/destroyable'; import { SVGProvider, HTMLProvider, MathMLProvider } from './provider'; import { IfCondition, IfFunction } from './control-flow/if'; import { pushParentContext, popParentContext, setParentContext, getParentContext } from './tracking'; import { $_MANAGERS } from './manager-integration'; export { Root, createRoot, resolveRenderable }; export { $_blk, type StaticBlockDef, type StaticBlockSlot }; export { pushParentContext, popParentContext, setParentContext, getParentContext }; type ModifierFn = (element: HTMLElement, ...args: unknown[]) => void | DestructorFn; type Attr = MergedCell | Cell | string | ((element: HTMLElement, attribute: string) => void); type TagAttr = [string, Attr]; type TagProp = [string, Attr]; type TagEvent = [string, EventListener | ModifierFn]; type FwType = [TagProp[], TagAttr[], TagEvent[]]; type Props = [TagProp[], TagAttr[], TagEvent[], FwType?]; type InElementFnArg = () => HTMLElement; type BranchCb = (ctx: IfCondition) => GenericReturnType | Node | null; export declare const $_edp: Props; export declare const $_emptySlot: Readonly<{}>; export declare const $SLOTS_SYMBOL: unique symbol; export declare const $PROPS_SYMBOL: unique symbol; export declare const $BLOCK_WRAPPER_SYMBOL: unique symbol; export declare const $_SVGProvider: typeof SVGProvider; export declare const $_HTMLProvider: typeof HTMLProvider; export declare const $_MathMLProvider: typeof MathMLProvider; export { $_MANAGERS }; export declare function $_TO_VALUE(reference: unknown): unknown; /** * Unwrap a helper argument - if it's a getter function, call it to get the actual value. * If it's a Tag (reactive cell), get its .value property. */ export declare function $_unwrapHelperArg(value: unknown): unknown; /** * Component helper - curries a component with pre-bound args. * Handles both class/function components and string component names. */ export declare function $_componentHelper(params: any[], hash: Record): (args: Record) => any; /** * Modifier helper - curries a modifier with pre-bound args. */ export declare function $_modifierHelper(params: any[], hash: Record): (node: HTMLElement, _params: any[], _hash: Record) => any; /** * Helper helper - curries a helper with pre-bound args. */ export declare function $_helperHelper(params: any[], hash: Record): unknown; export declare function $prop(api: DOMApi, element: Node, key: string, value: unknown, destructors: DestructorFn[]): void; export declare function $attr(api: DOMApi, element: HTMLElement, key: string, value: unknown, destructors: Destructors): void; export declare const EVENT_TYPE: { ON_CREATED: string; TEXT_CONTENT: string; }; export declare function $ev(api: DOMApi, element: HTMLElement, eventName: string, fn: EventListener | ModifierFn, destructors: DestructorFn[]): void; export declare function incrementNodeCounter(): void; export declare function resetNodeCounter(): void; export declare function getNodeCounter(): number; export declare function setNodeCounter(n: number): void; export declare function $_hasBlock(slots: Record, name?: string): boolean; export declare function $_hasBlockParams(slots: Record, slotName?: string): unknown; declare function _DOM(tag: string | (() => string), tagProps: Props, ctx: any, children?: (ComponentReturnType | string | Cell | MergedCell | Function)[]): Node; export declare const IN_ELEMENT_APPEND = 0; export declare const IN_ELEMENT_CLEAR = 1; export declare function $_inElement(elementRef: HTMLElement | Cell | InElementFnArg, roots: (context: Component) => (Node | ComponentReturnType)[], ctx: any, mode?: number | string): any; export declare function $_ucw(roots: (context: Component) => (Node | ComponentReturnType)[], ctx: any): ComponentReturnType; /** * Mark `fn` as a node-producing thunk and return it (identity). * Emitted by the compiler around component-child DOM producers in compat mode. */ export declare function $_nt(fn: T): T; /** * True when `fn` is a thunk the compiler marked as DOM-producing (via `$_nt`). * Hosts call this instead of `.toString()` source-sniffing — it is * minification-proof. */ export declare function isNodeThunk(fn: unknown): boolean; /** * Mark `fn` as a named-block factory thunk carrying slot `name`, and return it * (identity). Emitted by the compiler around a compat-mode `<:name>` block's * `$_tag(':name', …)` producer. Also sets the node-thunk flag ($_nt superset) * so `isNodeThunk(fn)` stays true (the factory must be invoked to yield its * `__isNamedBlock` marker). */ export declare function $_nbt(fn: T, name: string): T; /** * The slot name of a thunk the compiler marked as a named-block factory (via * `$_nbt`), or `null` when `fn` is not a named-block factory. Hosts call this * instead of `.toString()` source-sniffing `$_tag(':` — it is * minification-proof, and returns the slot name directly. */ export declare function getNamedBlockName(fn: unknown): string | null; export declare function $_GET_SCOPES(hashOrCtx: Record | any, ctx?: any): any; export declare const $_maybeHelper: (value: any, args: any[], _hashOrCtx?: Record | any, // Hash object for known bindings, context for unknown, or undefined _maybeCtx?: any) => any; export declare function $_unwrapArgs(args: any[]): any[]; export type ComponentRenderErrorReporter = (error: unknown, context: { component: unknown; args: Record; }) => void; export declare function setComponentRenderErrorReporter(reporter: ComponentRenderErrorReporter | null): void; declare function component(comp: ComponentReturnType | Component | typeof Component, args: Record, ctx: Component | Root): any; declare function slot(name: string, params: () => unknown[], $slot: Slots, ctx: any): Comment | Component | IfCondition | AsyncListComponent | SyncListComponent; declare function ifCond(cell: Cell | MergedCell | IfFunction, trueBranch: BranchCb, falseBranch: BranchCb, ctx: Component): Component | IfCondition | AsyncListComponent | SyncListComponent; type EachBlockValuesFn = (item: T, index: number | MergedCell, ctx: unknown) => readonly unknown[]; export declare function $_eachSync(items: Cell | MergedCell, fn: (item: T) => Array, key: string | null | undefined, ctx: Component, inverseFn?: InverseFn, hasIndex?: boolean, block?: StaticBlockDef, blockValues?: EachBlockValuesFn): Component | IfCondition | AsyncListComponent | SyncListComponent; export declare function $_each(items: Cell | MergedCell, fn: (item: T) => Array, key: string | null | undefined, ctx: Component, inverseFn?: InverseFn, hasIndex?: boolean, block?: StaticBlockDef, blockValues?: EachBlockValuesFn): Component | IfCondition | AsyncListComponent | SyncListComponent; export declare function $_GET_ARGS(ctx: Component, args: IArguments): void; export declare function $_GET_SLOTS(ctx: any, args: any): any; export declare function $_GET_FW(ctx: any, args: any): any; export declare function $_args(args: Record, slots: Record Array> | false, props: FwType): {}; export declare const $_if: typeof ifCond; export declare const $_slot: typeof slot; export declare const $_c: typeof component; /** * Predicate replicating ember's `hasSplatProps`: a dynamic-tag props tuple is * worth re-deriving only when it carries actual splat props (tuple[0] non-empty) * or a NON-`@` forwarded attribute (tuple[1]). A tuple whose only tuple[1] * entries are `@`-args — or one carrying only events — is left to the base path * (matching the ember wrapper, which does not intervene in those cases). */ export declare function hasDynamicSplatProps(tuple: unknown): boolean; /** * Split a dynamic-tag props tuple into the manager `fw` tuple + the `@`-prefixed * argument entries that must be re-homed onto the component's args. Pure; value * functions are copied by reference so reactivity is preserved. Mirrors the * split loops in ember.js' `$_dc_splatfix`: * • tuple[0] props → fw props (''/`class` values nullish-guarded so a * null/false value renders as '' instead of stringifying) * • tuple[1] attrs → `@`-prefixed keys become arg getters (value unwrapped if * a function); the rest stay as fw attrs * • tuple[2] events → fw events (unchanged) */ export declare function deriveManagerFwFromPropsTuple(tuple: FwType | undefined | null): { fw: FwType; argEntries: Array<[string, () => unknown]>; }; /** * Apply a derived manager fw split to the live `args` object: expose each * `@`-arg as an enumerable getter and REPLACE `args[$PROPS_SYMBOL]` with the * split fw tuple. The component manager reads `args[$PROPS_SYMBOL]` as its fw * fallback and copies `Object.keys(args)` into the render context, so after * this the manager sees the args a static invocation would. `$_args` marks * `$PROPS_SYMBOL` configurable/writable for exactly this rethread; * `defineProperty` forwards through the (trap-less) prod-compat args Proxy to * the underlying target, so this is correct for the dev-object / prod-proxy / * non-compat plain-object shapes alike. Returns the split fw. */ export declare function applyDynamicManagerFwSplit(args: Record, tuple: FwType | undefined | null): FwType; export declare function $_dc(comp: () => ComponentReturnType | Component, args: Record, ctx: Component, fw?: FwType): { [RENDERING_CONTEXT_PROPERTY]: DOMApi | undefined; [COMPONENT_ID_PROPERTY]: number; [RENDERED_NODES_PROPERTY]: Node[]; }; export declare const $_component: (component: any) => any; export declare const $_maybeModifier: (modifier: any, element: HTMLElement, props: any[], hashArgs: () => Record) => any; export declare const $_helper: (helper: any) => any; export declare const $_tag: typeof _DOM; /** * Trusted-HTML node helper — the first-class runtime behind a compat-mode * trusting mustache (`{{{expr}}}`), emitted as `$_html(() => expr, this)`. * * Returns a live DOM range (a start/end comment-anchor pair carrying its * reactive content between them, wrapped in a `RENDERED_NODES_PROPERTY` carrier) * whose content is `innerHTML`-parsed from `String(getterValue)`: * - a SafeString value contributes its `.toHTML()`; `null`/`undefined`/an * un-stringable object contribute `''` (empty range), * - the range updates reactively whenever the getter's tracked cells change * (a `formula` + `opcodeFor`, mirroring gxt's reactive text binding), * - CONTEXTUAL PARSE: unlike Ember's out-of-band `RENDERING_CONTEXT` probe, * gxt reads the REAL parent straight off `endAnchor.parentNode`. A reactive * reparse targets the true ``/`