/** Minimal shape of the compiled artifact's `ledger(state)` return we rely on. */
export interface DisclosureLedger {
    attestation_owners: Iterable<[Uint8Array, Uint8Array]>;
    disclosures: {
        member(key: Uint8Array): boolean;
        lookup(key: Uint8Array): Iterable<[Uint8Array, bigint]>;
    };
}
export interface DisclosureGrantRecord {
    payloadHash: string;
    grantee: string;
    level: number;
}
/**
 * Enumerate every active grant in a decoded ledger. Works around the
 * non-iterable outer `disclosures` map by iterating `attestation_owners`.
 */
export declare function enumerateGrants(led: DisclosureLedger): DisclosureGrantRecord[];
export interface ReindexDeps {
    db: any;
    contractAddress: string;
    /** Decoder from the compiled artifact (`ledger`). */
    ledger: (state: any) => DisclosureLedger;
    /** publicDataProvider.queryContractState — returns ContractState | null. */
    queryContractState: (contractAddress: string) => Promise<any | null>;
}
export interface ReindexResult {
    /** Grants found on-chain for this contract. */
    indexed: number;
    /** Previously-active rows flipped to inactive (revoked on-chain). */
    deactivated: number;
}
/**
 * Re-materialize `DisclosureGrants` for one contract from current on-chain
 * state. Idempotent: existing rows are updated in place (preserving the
 * optimistic `grantedTxHash` the handler wrote), new on-chain grants are
 * inserted, and any previously-active row no longer present on-chain is swept
 * to `active=false` (its grantee was revoked).
 */
export declare function reindexDisclosures(deps: ReindexDeps): Promise<ReindexResult>;
export interface ReindexForContractArgs {
    db: any;
    contractAddress: string;
    /** Path to the compiled contract artifact (`.../contract/index.js`). */
    artifactPath: string;
    /** Config for the contract-only provider bundle (no wallet needed to read). */
    contractProvidersConfig: import('../midnight/providers').ContractProvidersConfig;
}
/**
 * Production wrapper: build a contract-only provider bundle, load the
 * artifact's `ledger`, and reindex. Best-effort by design — callers run this
 * after a successful grant/revoke submit and must not let an indexing failure
 * fail the submission (the optimistic row already records intent; a later
 * reindex reconciles). Dynamic import keeps the ESM-only SDK out of CJS load.
 */
export declare function reindexDisclosuresForContract(args: ReindexForContractArgs): Promise<ReindexResult>;
