/** * adowire — HTML-style component tag preprocessor * * Transforms HTML-style tags into their @adowire() / @end Edge * tag equivalents before Edge.js compiles the template. * * Registered as an edge.processor 'raw' handler so it runs on every * template string — both file-based templates and renderRaw() calls. * * Supported syntaxes: * * Self-closing (most common): * * * * * * * Block form (for slots — future use): * * ... slot content ... * * * Props mapping: * Static: title="Hello" → title: 'Hello' * Dynamic: :count="$count" → count: $count * Boolean: disabled → disabled: true * kebab: initial-count="5" → initialCount: '5' * Dynamic: :initial-count="$n" → initialCount: $n * Special: :is="$expr" (on dynamic-component) → uses $expr as component name * * @module */ /** * Converts a kebab-case attribute name to camelCase. * * @example * toCamelCase('initial-count') // → 'initialCount' * toCamelCase('my-prop-name') // → 'myPropName' * toCamelCase('count') // → 'count' (no change) */ export declare function toCamelCase(str: string): string; /** * Parses an HTML attribute string and converts it into two pieces of * information needed by `buildAdowireCall`: * * - `props` — A JavaScript object-literal string suitable for use as the * second argument to `@adowire(name, props)`. * - `isExpr` — When the attribute `:is=""` is present (on a * `` tag), this holds the raw * JS expression string so the component name can be dynamic. * `null` when no `:is` attribute was found. * * Attribute-to-prop mapping rules: * - Static `title="Hello"` → `title: 'Hello'` * - Dynamic `:count="$count"` → `count: $count` * - Boolean `disabled` → `disabled: true` * - Kebab `initial-count="5"` → `initialCount: '5'` * - Kebab+Dyn `:initial-count="$n"` → `initialCount: $n` * - Special `:is="$expr"` → consumed as `isExpr`, not added to props * * Uses a character-by-character state machine internally — not a regex — so * attribute values containing spaces, `>`, or mismatched quotes are handled * reliably. * * @param attrString Raw attribute section from the HTML tag (everything * between the component name and the closing `>` / `/>`). */ export declare function parseAttrsToProps(attrString: string): { props: string; isExpr: string | null; }; /** * Builds the `@adowire(...)` / `@end` call string that replaces an * `` HTML tag in the template source. * * @param tagName The component name extracted from the HTML tag, * e.g. `'counter'`, `'post.create'`, `'dynamic-component'`. * @param attrString The raw attribute string from the HTML tag. * @param content Optional inner content for block-form tags. When present * (even if an empty string), the content is emitted between * the opening `@adowire(...)` call and `@end`. * * @example * // Self-closing — no content * buildAdowireCall('counter', 'title="Hello" :count="$n"') * // → "@adowire('counter', { title: 'Hello', count: $n })\n@end" * * // Dynamic component — :is overrides the name * buildAdowireCall('dynamic-component', ':is="$tab"') * // → "@adowire($tab)\n@end" * * // Block form — content between tags * buildAdowireCall('modal', 'title="Hi"', '

slot

') * // → "@adowire('modal', { title: 'Hi' })\n

slot

\n@end" */ export declare function buildAdowireCall(tagName: string, attrString: string, content?: string): string; /** * Edge.js `raw` processor that transforms `` HTML-style tags into * `@adowire(...)` / `@end` Edge tag calls **before** Edge.js compiles the * template. * * This function is exported as a **named** function so that Edge.js's internal * `Set`-based deduplication works correctly: two calls to * `edge.processor.process('raw', adowireHtmlProcessor)` pass the same function * reference, and the `Set` silently discards the duplicate registration. * * The function mutates `value.raw` **in place** and intentionally returns * `void` — Edge.js v6 raw processors MUST NOT return a value. * * Processing order: * 1. **Self-closing pass** — `` → `@adowire(NAME, PROPS)\n@end` * 2. **Block pass** (iterative) — `CONTENT` * → `@adowire(NAME, PROPS)\nCONTENT\n@end` * Runs in a loop so that nested block tags are expanded from innermost * outward; each iteration reduces the nesting depth by one. * * @param value The mutable processor value object supplied by Edge.js. * `value.path` is the template file path (may be empty for * inline strings). `value.raw` is the raw template source. */ export declare function adowireHtmlProcessor(value: { path: string; raw: string; }): void;