import type { TagsBase, RecordTags } from '@credo-ts/core'; import type { VaultHeader, PolicyMode } from '../models'; import { BaseRecord } from '@credo-ts/core'; export type CustomVaultTags = TagsBase; export type DefaultVaultTags = { vaultId: string; docId: string; ownerDid: string; policyMode?: PolicyMode; suite: string; epoch: string; storageType?: string; }; export type VaultTags = RecordTags; /** * Reference to externally stored vault ciphertext */ export interface VaultStorageReference { /** Storage type (s3, ipfs, arweave, http) */ type: 's3' | 'ipfs' | 'arweave' | 'http'; /** Storage URI */ uri: string; /** SHA-256 checksum of ciphertext */ checksum: string; /** Size in bytes */ size: number; /** Content type */ contentType?: string; } export interface VaultRecordProps { id?: string; createdAt?: Date; updatedAt?: Date; tags?: CustomVaultTags; vaultId: string; docId: string; ownerDid: string; header: VaultHeader; ciphertext: string; storageReference?: VaultStorageReference; } /** * Database record for an encrypted vault * * Stores the vault header (metadata) and ciphertext (encrypted data) * All encryption/decryption happens client-side */ export declare class VaultRecord extends BaseRecord { /** Logical vault identifier */ vaultId: string; /** Document identifier (unique per document version) */ docId: string; /** DID of the vault owner */ ownerDid: string; /** Vault header with metadata and policy info */ header: VaultHeader; /** Base64url-encoded ciphertext (encrypted data) */ ciphertext: string; /** External storage reference (for large files) */ storageReference?: VaultStorageReference; static readonly type = "VaultRecord"; readonly type = "VaultRecord"; constructor(props: VaultRecordProps); getTags(): DefaultVaultTags & CustomVaultTags; /** * Get the policy mode of this vault */ get policyMode(): PolicyMode | undefined; /** * Check if this is a passphrase-protected vault */ get isPassphraseVault(): boolean; /** * Check if this is an any-of policy vault */ get isAnyOfVault(): boolean; /** * Check if this is a threshold policy vault */ get isThresholdVault(): boolean; /** * Get human-readable description if available */ get description(): string | undefined; /** * Get tags if available */ get metadataTags(): string[] | undefined; /** * Check if this vault uses external storage */ get hasExternalStorage(): boolean; /** * Check if ciphertext needs to be downloaded from external storage */ get needsDownload(): boolean; /** * Get storage URI if using external storage */ get storageUri(): string | undefined; /** * Get ciphertext size (from storage reference or actual data) */ get ciphertextSize(): number; }