import { a1 as Statement, a8 as Tag, w as FilterXdo, a9 as TaggedValue, p as FieldDescriptor, Z as ResponseDef } from './response-CVAE2kMj.js'; /** A stored statement envelope as it appears in a Xano bundle's `run[]`. */ type RawEnvelope = Record; /** * Wrap a stored statement envelope so it compiles back to itself verbatim. * * Every key present on `envelope` — including keys this SDK does not model — * survives untouched, and a key the envelope does not carry is NOT invented: an * engine that omits a key at its default gets that exact shape back. * * @param envelope A stored `run[]` entry. Must be an object carrying a `name`. */ declare function raw(envelope: RawEnvelope): Statement; /** * `rawValue()` — the value-level escape hatch codegen emits for a stored value it * cannot express through `c.*` / `ref` / `inp` / `withFilters`. * * `Value` is structurally just `{value, tag, filters}`, so an annotated literal * is already byte-exact; this wrapper exists for two reasons a bare literal does * not cover. It types the `tag` as a real `Tag` so the literal also checks out in * a widening position (a `const` declaration in a shared file, not only a * contextually-typed argument), and it makes every non-idiomatic value in a * generated tree greppable by one name. * * Reached via `@xanots/core/codegen`, alongside `raw()` — same reasoning * (KTD-10): a passthrough should not sit in tab-completion next to `c.text`. */ /** * A stored value as it appears in a bundle. `filters` defaults to none. * * `value` admits the NATIVE scalar spellings as well as the string one, because * the engine stores both and this type describes what a bundle holds rather than * what the SDK writes. The corpus is genuinely mixed — the same tag appears with * a quoted and an unquoted value in one workspace — and codegen echoes whichever * it found. Declaring it `string` alone made a pulled tree fail its own * type-check (issue #133), which broke every npm script in the scaffold, since * each one runs `tsc --noEmit` first. * * Coercing to the string form at emit would be the other repair. It is the wrong * one for `null`: `normalize()` reconciles a numeric or boolean `value` with its * string spelling, so those compare equal either way, but it does NOT do that for * `null` — so emitting `"null"` for a stored `null` would change the bytes and * fail the round trip. */ interface RawValueInput { readonly value: string | number | boolean | null; readonly tag: Tag; readonly filters?: readonly FilterXdo[]; } /** * Carry a stored tagged value through verbatim. * * The cast is the point of the escape hatch: `TaggedValue.value` is declared * `string` because that is what every `c.*` constructor writes, while a bundle * may hold a native scalar under the same key. Preserving the stored spelling is * what keeps the round trip exact, so the runtime value is passed through * untouched rather than being coerced to satisfy the declaration. */ declare function rawValue(v: RawValueInput): TaggedValue; /** A stored field envelope as it appears in a bundle's `schema[]` / `input[]`. */ type RawFieldEnvelope = Record; /** * Carry a stored field envelope through encoding unchanged. * * The envelope's own `name` and `type` win over the map key it is attached to, * and a key the envelope does not carry is NOT invented. Preservation is the * whole contract: nothing about the stored shape is rewritten to match its * surroundings, and nothing is added to it. * * @param envelope A stored `schema[]` / `input[]` entry. Must carry `name` and `type`. */ declare function rawField(envelope: RawFieldEnvelope): FieldDescriptor; /** * `rawResponse()` — the response-level verbatim passthrough. * * The fourth and last escape hatch, alongside `raw()` for statements, * `rawValue()` for values, and `rawField()` for fields. Together they mean a * pulled workspace never loses data on the way into TypeScript: whatever the * engine stored comes back out unchanged, whether or not this SDK models it. * * It is needed because `encodeResponse` writes `_xsid` and `disabled` * unconditionally at their defaults. No authoring surface reaches either, so a * stored `result[]` item that sets one differently cannot round-trip through the * `response:` field in any form. This carries the whole `result[]` array * instead. * * Reached via `@xanots/core/codegen`, never from the discoverable authoring * namespace, for the same reason `raw()` stays off `s` (KTD-10). */ /** A stored `result[]` entry as it appears in a bundle. */ type RawResponseEnvelope = Record; /** * Carry a stored `result[]` array through encoding unchanged. * * A key an item does not carry is **NOT** invented. Preservation is the whole * contract: only key ordering is normalized, and nothing is added. * * That absence rule is not incidental. `raw()` and `rawField()` both shipped * completing absent keys with their defaults, which silently broke their own * passthrough contract — the engine omits keys at their defaults, so filling * them in changes the bytes on the way back. This preserves absence from the * start rather than being fixed into it later. * * @param items Stored `result[]` entries. An empty array means "no response". */ declare function rawResponse(items: readonly RawResponseEnvelope[]): ResponseDef; export { type RawEnvelope, type RawFieldEnvelope, type RawResponseEnvelope, type RawValueInput, raw, rawField, rawResponse, rawValue };