import type { Tier } from "../core/vocabulary.js"; import { Labeler } from "./labeler.js"; import { Noncer } from "./noncer.js"; import { NumberPrimitive } from "./number.js"; import { type BlindState as BlindStateRecord, type BoundState as BoundStateRecord, type TypeMedia as TypeMediaRecord } from "./structing.js"; import { Texter } from "./texter.js"; /** * Disclosure-workflow input accepted for sequence-number slots. * * TypeScript-specific convenience: * - KERIpy takes flexible Python values through keyword arguments; this union * keeps the same ergonomic range while staying explicit in TS. */ export type NumberLike = NumberPrimitive | number | bigint | string; /** * Disclosure-workflow input accepted for nonce-like slots. * * Empty string / null / undefined preserve KERIpy placeholder semantics. */ export type NoncerLike = Noncer | string | null | undefined; /** Disclosure-workflow input accepted for label-text slots. */ export type LabelerLike = Labeler | string | null | undefined; /** Disclosure-workflow input accepted for text-payload slots. */ export type TexterLike = Texter | string | null | undefined; /** * Inputs used to derive the deterministic disclosure UUID. * * KERIpy correspondence: * - mirrors the keyword-argument surface accepted by `Blinder.makeUUID(...)` * * Defaults: * - `sn=1` * - if `raw`, `salt`, and `tier` are omitted, a fresh `Salter` is generated */ export interface MakeBlindUuidOptions { /** Raw salt bytes fed into `Salter` when the caller already has them. */ raw?: Uint8Array; /** Qualified CESR salt (`Salter.qb64`) used instead of `raw`. */ salt?: string; /** Sequence number projected through `numh` before entering the salty path. */ sn?: NumberLike; /** Salty derivation tier forwarded into `Salter.stretch(...)`. */ tier?: Tier; } /** * Inputs for building one `BlindState`. * * Placeholder semantics intentionally match KERIpy: * - omitted `uuid` means "derive it deterministically" * - omitted `acdc` / `state` mean "use empty disclosure placeholders" * - omitted `code` means "reuse an existing digest-capable code or default to * Blake3-256" */ export interface MakeBlindStateOptions extends MakeBlindUuidOptions { /** Disclosure UUID. Omit to derive via `makeBlindUuid(...)`. */ uuid?: NoncerLike; /** Disclosed ACDC/TEL SAID, or empty placeholder. */ acdc?: NoncerLike; /** Disclosed state label, or empty placeholder. */ state?: LabelerLike; /** Optional digest/noncer code for the committed `d` field. */ code?: string; } /** * Inputs for building one `BoundState`. * * Adds the issuee key-state cross-anchor pair used by bound-state sextuples. */ export interface MakeBoundStateOptions extends MakeBlindStateOptions { /** Bound issuee key-state sequence number. Defaults to placeholder `0`. */ bsn?: NumberLike; /** Bound issuee key-state digest/nonce. Defaults to empty placeholder. */ bd?: NoncerLike; } /** * Inputs for building one `TypeMedia`. * * This is the typed-media sibling to blind/bound state disclosure helpers. */ export interface MakeTypeMediaOptions extends MakeBlindUuidOptions { /** Disclosure UUID. Omit to derive via `makeBlindUuid(...)`. */ uuid?: NoncerLike; /** Media type label, such as `application/json`. */ mt?: LabelerLike; /** Media value/payload text. */ mv?: TexterLike; /** Optional digest/noncer code for the committed `d` field. */ code?: string; } /** * Inputs for rebuilding one matching `BlindState` from a disclosed commitment. * * Search semantics: * - `said` is the commitment being matched * - `states` is the candidate state-label search space * - the helper automatically includes the empty placeholder state and empty * placeholder ACDC value so callers do not need to remember those cases */ export interface UnblindBlindStateOptions extends MakeBlindUuidOptions { /** Target commitment nonce (`BlindState.d.nonce`) to match. */ said: string; /** Disclosure UUID. Omit to deterministically reconstruct it. */ uuid?: NoncerLike; /** Candidate disclosed ACDC/TEL SAID. Empty placeholder is auto-included. */ acdc?: NoncerLike; /** Candidate state labels to try while searching for the matching record. */ states?: readonly LabelerLike[]; /** Optional digest/noncer code for recomputed candidates. */ code?: string; } /** * Inputs for rebuilding one matching `BoundState` from a disclosed commitment. * * Search semantics: * - `bounds` is the candidate `(bn, bd)` cross-anchor search space * - the helper automatically includes placeholder `(0, "")` */ export interface UnblindBoundStateOptions extends UnblindBlindStateOptions { /** Candidate issuee key-state cross-anchor pairs to try. */ bounds?: readonly (readonly [NumberLike, NoncerLike])[]; } /** * Derive the deterministic disclosure UUID used by blinded/bound/media * commitment records. * * KERIpy correspondence: * - mirrors `Blinder.makeUUID(...)` * - sequence numbers feed the salty path through `numh`, not decimal text */ export declare function makeBlindUuid({ raw, salt, sn, tier, }?: MakeBlindUuidOptions): Noncer; /** * Recompute the committed `d` field for one `BlindState`. * * KERIpy correspondence: * - same semantic role as building `Blinder(..., makify=True)` for the * blind-state quadruple without instantiating a transport wrapper */ export declare function commitBlindState(value: BlindStateRecord, code?: string): BlindStateRecord; /** * Recompute the committed `d` field for one `BoundState`. * * KERIpy correspondence: * - same semantic role as the bound-state branch of `Blinder.blind(...)` */ export declare function commitBoundState(value: BoundStateRecord, code?: string): BoundStateRecord; /** * Recompute the committed `d` field for one `TypeMedia`. * * KERIpy correspondence: * - same semantic role as `Mediar(..., makify=True)` for typed-media records */ export declare function commitTypeMedia(value: TypeMediaRecord, code?: string): TypeMediaRecord; /** * Build one blinded disclosure-state record and compute its `d` commitment. * * KERIpy correspondence: * - mirrors `Blinder.blind(..., bound=False)` */ export declare function makeBlindState({ uuid, raw, salt, sn, tier, acdc, state, code, }?: MakeBlindStateOptions): BlindStateRecord; /** * Build one bound blinded-state record and compute its `d` commitment. * * KERIpy correspondence: * - mirrors `Blinder.blind(..., bound=True)` */ export declare function makeBoundState({ uuid, raw, salt, sn, tier, acdc, state, bsn, bd, code, }?: MakeBoundStateOptions): BoundStateRecord; /** * Build one typed-media disclosure record and compute its `d` commitment. * * KERIpy correspondence: * - matches `Mediar(..., makify=True)` without recreating a wrapper object */ export declare function makeTypeMedia({ uuid, raw, salt, sn, tier, mt, mv, code, }?: MakeTypeMediaOptions): TypeMediaRecord; /** * Rebuild the matching blinded-state candidate if one exists. * * KERIpy correspondence: * - mirrors `Blinder.unblind(..., bound=False)` * - tries the placeholder combinations too, so callers do not need to add the * empty `acdc` / empty `state` cases themselves * * Search strategy: * - derive or validate the UUID * - try the candidate `acdc` plus empty placeholder * - try each caller-supplied state plus empty placeholder * - return the first candidate whose recomputed `d` matches `said` */ export declare function unblindBlindState({ said, uuid, raw, salt, sn, tier, acdc, states, code, }: UnblindBlindStateOptions): BlindStateRecord | null; /** * Rebuild the matching bound blinded-state candidate if one exists. * * KERIpy correspondence: * - mirrors `Blinder.unblind(..., bound=True)` * - tries placeholder bound pairs automatically by including `(0, "")` * * Search strategy: * - same placeholder search as `unblindBlindState(...)` * - plus candidate `(bn, bd)` pairs, with placeholder `(0, "")` always added */ export declare function unblindBoundState({ said, uuid, raw, salt, sn, tier, acdc, states, bounds, code, }: UnblindBoundStateOptions): BoundStateRecord | null; //# sourceMappingURL=disclosure.d.ts.map