/** * Walk every prop on a panel's component, replacing each `{ $bind: "field" }` * reference with a literal value drawn from `result`. Renderer-agnostic: every * renderer integration calls this before producing its own IR (a json-render * `Spec`, a markdown string, Slack Block Kit JSON, etc.). Non-bind props are * passed through unchanged. */ export declare function resolveBindings(props: Record, result: unknown): Record; /** * Extract a single bound value from a panel's result by field name. * * Resolution rules: * - `"*"` → the entire result, unchanged. Used by table-shaped components * that want every row + every column. * - Array result + field → column-extracted across rows. * `[{ jobType, failureRate }, ...]` + `"jobType"` * resolves to `["email_sender", "webhook_delivery", ...]`. * - Object result + field → the field's value directly. * - **Dotted paths** (e.g. `"kpis.mrr.value"`) walk nested values. Against * an array result each row is walked, producing a column of nested * values: `[{ a: { b: 1 } }, { a: { b: 2 } }]` + `"a.b"` → `[1, 2]`. * - **Numeric-string segments** index into arrays (`"rows.0"` against * `{ rows: [{ id: "r_1" }, ...] }` returns the first element). Works * consistently with JS bracket-access semantics. * - Anything else → `undefined` (the renderer falls back). * * Backwards-compat: a field name without a `.` resolves identically to * the flat-key behaviour shipped before this change. The walker uses * `Object.hasOwn` for every property access — own-properties only, no * prototype-chain traversal — so an attacker-influenced `$bind` like * `"__proto__.toString"` resolves to `undefined`, never a function. * That is a deliberate strengthening over the pre-dotted-path resolver, * which used direct bracket access without an own-property guard. * * Field names that contain a literal dot (e.g. a database column called * `"foo.bar"`) are not addressable as a single segment — the resolver * always treats `.` as a path separator. Pick column names accordingly, * or bind via `"*"` and walk client-side. * * **Trust contract.** Property access goes through direct subscript * (`current[segment]`), so JavaScript getters fire and Proxies see the * read. Carte's threat model trusts query results — they came from your * `query` function. If a `query` returns objects with side-effectful * getters, those side effects WILL run at hydration time. Keep `query` * functions side-effect-free or use plain data objects. */ export declare function extractBoundValue(result: unknown, field: string): unknown; //# sourceMappingURL=resolve-bindings.d.ts.map