import type { CeremonyOrder } from "../types.js"; import type { Credential } from "../../types.js"; import type { CredentialKind } from "./dcql.js"; import { type DisclosedEntry } from "../mdoc/mdoc.js"; export type { CredentialKind } from "./dcql.js"; export interface GateResult { gate: string; pass: boolean; detail: string; } export interface CredGateResult { verified: boolean; /** Membership id when a membership gate verified; null otherwise. */ membershipNumber: string | null; gates: GateResult[]; /** Honesty axis — stated in the receipt, not buried in prose. */ trust_level: "presence-only-demo"; } /** A wallet presentation's result: the policy outcome plus the DeviceResponse it was * decided on (base64url) — the route returns it only when `inspectPresentations` is on. */ export type PresentationResult = CredGateResult & { deviceResponse?: string; }; export interface EvaluateOpts { /** The minimum age the order's products demand (age gate only; default 21). */ minimumAge?: number; /** The membership discount percent surfaced in the gate detail (default 10). */ percent?: number; } /** * Re-derive the age threshold this order requires from its catalog-priced lines — * the strictest `minimumAge` present, or `null` when nothing is age-restricted. * Always read from the (re-priced) lines, never the order token (invariant 2). */ export declare function requiredAgeForOrder(order: CeremonyOrder): number | null; /** True iff this order is age-restricted but carries no positive per-order age claim. */ export declare function isAgeUnsatisfied(order: CeremonyOrder, verification: { ageVerified?: boolean; } | undefined | null): boolean; /** * Evaluate disclosed claims (PRESENCE-ONLY) for one credential kind. Reuses the * package's `age.over(N)` / `membership.discount()` `verify()` so the positive-claim * rule has a single definition. */ export declare function evaluateCredential(kind: CredentialKind, claims: Record, opts?: EvaluateOpts): CredGateResult; /** * Evaluate disclosed claims for a CUSTOM credential (007) with that credential's OWN * `verify` — the explicit-positive-claim control (invariant 5) is the developer's * predicate (e.g. `c.license_active === true`), run SERVER-SIDE here; it never crosses * the wire (Principle VI). Same presence-only posture as the built-ins: disclosure + * nonce binding are enforced, issuer/device trust is not (trust_level presence-only-demo). */ export declare function evaluateCustom(credential: Credential, claims: Record): CredGateResult; export declare function verifyCredentialPresentation(args: { kind: CredentialKind; result: { protocol?: string; data?: unknown; }; readerContextToken: string; secret: string; minimumAge?: number; percent?: number; /** Custom credential (007): when present, its OWN `verify` runs instead of the * built-in age/membership policy — same decrypt/nonce-binding path. */ credential?: Credential; }): Promise; export declare function evaluateDisclosed(kind: CredentialKind, disclosed: DisclosedEntry[], opts?: EvaluateOpts): CredGateResult; export declare function evaluateDisclosedCustom(credential: Credential, disclosed: DisclosedEntry[]): CredGateResult;