import { type RecoveryDiagnosticObserver } from "../core/recovery-diagnostics.js"; import type { AttachmentGroup } from "../core/types.js"; import type { Versionage } from "../tables/table-types.js"; import { type AttachmentDispatchDomain, type AttachmentVersionFallbackPolicy, type AttachmentVersionFallbackPolicyOptions } from "./attachment-fallback-policy.js"; export { createAttachmentVersionFallbackPolicy } from "./attachment-fallback-policy.js"; export type { AttachmentDispatchMode, AttachmentVersionFallbackPolicy, VersionDispatchDecision, VersionFallbackInfo, } from "./attachment-fallback-policy.js"; /** Attachment parsing can only proceed in counter domains. */ type ParseDomain = AttachmentDispatchDomain; /** Primitive token families used by tuple/repetition parsers. */ type PrimitiveKind = "matter" | "indexer"; /** * Public options for attachment dispatch behavior and fallback observability. * * Precedence: * 1) `versionFallbackPolicy` when provided (fully explicit strategy injection) * 2) otherwise build default strategy from `mode` and adapt * `onVersionFallback` into structured diagnostics. */ export interface AttachmentDispatchOptions extends AttachmentVersionFallbackPolicyOptions { /** Explicit strategy override for fallback + wrapper remainder decisions. */ versionFallbackPolicy?: AttachmentVersionFallbackPolicy; /** Structured recovery diagnostics observer. */ onRecoveryDiagnostic?: RecoveryDiagnosticObserver; } /** * Dispatch table major-version discriminator. * * Invariant: * all dispatch artifacts in this module are built for exactly these two major * versions; runtime fallback policy decides when/if cross-version retry occurs. */ type DispatchVersion = 1 | 2; /** * Parser family keys used to map descriptor entries to concrete parser functions. * * Maintainer rule: * adding a new parser family requires touching this union and * `parserForDescriptor(...)` together so routing remains exhaustive. */ type DispatchParserKind = "genusVersion" | "quadlet" | "repeatTuple" | "transIdxSigGroups" | "transLastIdxSigGroups" | "sadPathSig" | "sadPathSigGroup"; /** * Semantic classification for descriptor entries. * * This metadata is intentionally domain-facing (review/debug/docs) and does not * alter parser behavior by itself. Behavioral switches are driven only by * `parserKind`, `tupleKinds`, `wrapperGroup`, and `allowsSigerList`. */ type DispatchSemanticShape = "genusVersionMarker" | "countedGroupPayload" | "wrapperGroupPayload" | "primitiveTuples" | "signatureGroupTuples" | "lastSignatureGroupTuples" | "sadPathSignatures" | "sadPathSignatureGroup"; /** * Authoring-time dispatch spec row. * * This form groups equivalent parser semantics across major versions to reduce * duplicate declarations in the canonical spec constant. */ interface DispatchFamilySpec { parserKind: DispatchParserKind; semanticShape: DispatchSemanticShape; codesByVersion: Partial>; tupleKinds?: readonly PrimitiveKind[]; wrapperGroup?: boolean; allowsSigerList?: boolean; } /** * Canonical attachment dispatch specification (authoring form). * * This is the single source of truth for: * - code -> parser routing * - semantic shape classification * - wrapper-group recursion eligibility * - nested siger-list allowance * * Maintainer workflow: * when adding/removing a counter route, edit this constant only, then rely on * descriptor expansion + generated dispatch maps below. */ export declare const ATTACHMENT_DISPATCH_SPEC: readonly DispatchFamilySpec[]; /** * Parse one attachment group with policy-aware fallback behavior. * * By default this uses compat policy semantics to mirror historical * `parseAttachmentDispatchCompat` behavior unless overridden via * `options.versionFallbackPolicy`. */ export declare function parseAttachmentDispatchCompat(input: Uint8Array, version: Versionage, domain: ParseDomain, options?: AttachmentDispatchOptions): { group: AttachmentGroup; consumed: number; }; /** * Parse one attachment group with strict fail-fast semantics. * * Why: * this API guarantees no major-version fallback and no wrapper opaque-tail * preservation, matching parity/validation use cases. */ export declare function parseAttachmentDispatch(input: Uint8Array, version: Versionage, domain: ParseDomain): { group: AttachmentGroup; consumed: number; }; //# sourceMappingURL=group-dispatch.d.ts.map