/** * @fileoverview Capability Token serialization/deserialization helpers * * Converts ICapabilityToken instances to/from JSON strings, handling: * - Uint8Array fields ↔ hex string encoding * - Date fields ↔ ISO 8601 string encoding * - All other fields pass through as-is * * Follows the same pattern as aclDocumentSerialization.ts. * * @see BrightDB Write ACLs design, Capability Token Format * @see Requirements 6.6 */ import { ICapabilityToken } from './capabilityToken'; import { IAclScope } from './writeAcl'; /** * JSON-serializable representation of ICapabilityToken. * * Uint8Array fields are hex-encoded strings. * Date fields are ISO 8601 strings. */ export interface SerializedCapabilityToken { granteePublicKey: string; scope: IAclScope; expiresAt: string; grantorSignature: string; grantorPublicKey: string; } /** * Serialize an ICapabilityToken to a JSON string. * * - Uint8Array fields (granteePublicKey, grantorSignature, * grantorPublicKey) are hex-encoded. * - Date fields (expiresAt) are ISO 8601 strings. * - All other fields pass through unchanged. * * @param token - The capability token to serialize * @returns JSON string representation * @see Requirements 6.6 */ export declare function serializeCapabilityToken(token: ICapabilityToken): string; /** * Deserialize a JSON string into an ICapabilityToken. * * - Hex-encoded strings are converted back to Uint8Array. * - ISO 8601 strings are converted back to Date objects. * - All other fields pass through unchanged. * * @param json - JSON string to deserialize * @returns The deserialized capability token * @throws Error if the JSON is malformed or contains invalid data * @see Requirements 6.6 */ export declare function deserializeCapabilityToken(json: string): ICapabilityToken; //# sourceMappingURL=capabilityTokenSerialization.d.ts.map