import type { ColdCode } from "../core/types.js"; import type { Versionage } from "../tables/table-types.js"; import type { Kind } from "../tables/versions.js"; import { type MapperField, type MapperMap } from "./mapper.js"; import type { CounterGroupLike, GroupEntry } from "./primitive.js"; import { Structor } from "./structor.js"; /** One aggregate-list element: either a compact qb64 commitment or a disclosed map. */ export type AggorElement = string | MapperMap; /** Semantic aggregate element list aligned with KERIpy `list[dict|str]`. */ export type AggorList = AggorElement[]; /** * `Aggor` is the aggregate-list sibling to `Compactor`. * * Where `Compactor` contracts nested map branches to SAIDs, `Aggor` contracts a * list of aggregate elements down to one commitment in slot zero (`agid`) while * still supporting later selective disclosure of map elements. * * Boundary rule: * - `Aggor` owns selective disclosure for aggregate lists * - `Compactor` owns hierarchical map disclosure * - `disclosure.ts` owns fixed-field blind/bound/media disclosure */ /** True when counter code belongs to aggregate-list group families. */ export declare function isAggorListCode(code: string): boolean; /** True when counter code belongs to aggregate-map group families. */ export declare function isAggorMapCode(code: string): boolean; /** True when counter code belongs to any aggregate list/map family. */ export declare function isAggorCode(code: string): boolean; /** * Supported constructor inputs for `Aggor`. * * The semantic lane is `ael` (aggregate element list). Raw/qb64/qb2 inputs are * for inhale from an existing aggregate wire representation. */ export interface AggorInit { ael?: AggorList; raw?: Uint8Array; qb64?: string; qb64b?: Uint8Array; qb2?: Uint8Array; version?: Versionage; code?: string; makify?: boolean; verify?: boolean; strict?: boolean; saids?: Record; kind?: Kind; } /** * Aggregate list/map primitive. * * KERIpy substance: * - list-form `Aggor` owns aggregate-element-list (`ael`) semantics and `agid` * computation/disclosure * - map-form `Aggor` is preserved here only as a compatibility bridge for * parser-group projections that still classify generic map groups as aggor * families in the TS codebase * * The important tradeoff is intentional: * - the list lane is the real graduated-disclosure story here * - the map lane mainly keeps parser projections lossless and readable */ export declare class Aggor extends Structor { readonly kind: "list" | "map"; /** Map-style compatibility projection for parser-origin map groups. */ readonly mapFields?: readonly MapperField[]; readonly strict: boolean; readonly saids: Record; /** Digest code used to compute the aggregate identifier (`agid`). */ readonly digestCode: string; readonly wireKind: Kind; private readonly _ael; /** * Construct one aggregate primitive. * * Two semantic lanes exist: * - list lane: real aggregate semantics (`ael`, `agid`, disclosure) * - map lane: compatibility bridge for existing TS parser projections that * still bucket generic map groups into aggregate families */ constructor(init: AggorInit | { structor: Structor; mapFields?: readonly MapperField[]; }); /** Aggregate identifier at element zero for list-form aggregates. */ get agid(): string | null; /** Aggregate element list in semantic form. */ get ael(): AggorList; /** Tuple/list payload items for parser-origin list aggregate families. */ get listItems(): readonly GroupEntry[] | undefined; /** * Verify that the disclosed aggregate list still hashes to the agid in slot zero. * * Example: * a disclosure list like `[agid, {d: "...", x: 1}, "E...undisclosed"]` * verifies when replacing the disclosed map with its computed SAID reproduces * the agid at position zero. */ static verifyDisclosure(ael: AggorList, kind?: Kind, code?: "E", saids?: Record): boolean; /** * Produce a disclosure view where only `indices` are expanded back into maps. * * Index `0` is always the agid and stays compact; only later map elements are * eligible for disclosure expansion. */ disclose(indices?: number[]): [AggorList, Kind]; /** Hydrate from an already parsed counter-group node. */ static fromGroup(group: CounterGroupLike, sourceDomain?: Extract): Aggor; private static materializeStructor; static canonicalize(raw: Uint8Array, version: Versionage): Uint8Array; private static clone; private static serializeList; private static deserializeList; private static computeAgid; } /** * Parse aggregate attachment groups as semantic aggregate containers. * * Example: * a list body `-JAE...` becomes an `Aggor` whose `.ael` * exposes the readable element list and whose `.agid` is the commitment in slot * zero. A map-group still parses for compatibility, but exposes `.mapFields` * rather than aggregate-list semantics. */ export declare function parseAggor(input: Uint8Array, version: Versionage, cold: Extract): Aggor; //# sourceMappingURL=aggor.d.ts.map