import type { Counter } from "./counter.js"; import type { Indexer } from "./indexer.js"; import type { Matter } from "./matter.js"; import type { Streamer } from "./streamer.js"; import type { UnknownPrimitive } from "./unknown.js"; /** * Structural contract used by parser outputs for counted group payloads. * * Parsers return concrete `CounterGroup` instances, but this interface keeps * downstream typing stable without creating an import cycle on `counter.ts`. */ export interface CounterGroupLike extends Counter { readonly raw: Uint8Array; readonly items: readonly GroupEntry[]; } /** Any first-class hydrated CESR primitive returned by parser hydration. */ export type Primitive = Matter | Indexer | Counter | UnknownPrimitive; /** * Rehydratable qualified primitive from one parsed recursive group graph. * * These entries are safe to pass through `new X({ qb64b: entry.qb64b })` style * reconstruction because they are real qualified CESR primitives, not tuple * payloads, nested counted groups, or lossless unknown placeholders. */ export type QualifiedPrimitive = Matter | Indexer | Counter; /** * Primitive family that cipher encryption/decryption can faithfully round-trip. * * This intentionally excludes `UnknownPrimitive`: sealed-box decrypt returns a * fully hydrated constructor-backed value, not a parser fallback placeholder. */ export type CipherHydratable = QualifiedPrimitive | Streamer; /** Constructor contract for cipher plaintext rehydration. */ export type CipherHydratableCtor = new (...args: any[]) => T; /** Ordered tuple payload used by grouped attachments (for fixed small tuples). */ export type PrimitiveTuple = readonly GroupEntry[]; /** Recursive parser graph entry for attachment/native payloads. */ export type GroupEntry = Primitive | PrimitiveTuple | CounterGroupLike; /** Runtime guard for tuple-shaped group entries. */ export declare function isPrimitiveTuple(entry: GroupEntry): entry is PrimitiveTuple; /** Runtime guard for parsed counter-group nodes in recursive payload graphs. */ export declare function isCounterGroupLike(entry: GroupEntry): entry is CounterGroupLike; /** * Runtime guard for one rehydratable qualified primitive in a parsed group graph. * * This intentionally means "real CESR primitive with `qb64b`" rather than * "any parser primitive union member", so tuples, nested counter groups, and * `UnknownPrimitive` placeholders are all excluded. */ export declare function isQualifiedPrimitive(entry: unknown): entry is QualifiedPrimitive; //# sourceMappingURL=primitive.d.ts.map