import { SemVer } from "./semver.js"; import { SupportedEncodings } from "uint8arrays/util/bases.js"; import { Capability } from "./capability/index.js"; export declare type Ucan = { header: UcanHeader; payload: UcanPayload; signedData: string; signature: string; }; export interface UcanParts { header: UcanHeader; payload: UcanPayload; } export declare type UcanHeader = { alg: string; typ: string; ucv: SemVer; }; export declare type UcanPayload = { iss: string; aud: string; exp: number; nbf?: number; nnc?: string; att: Array; fct?: Array; prf: Array; }; export declare type Fact = Record; /** Unlike tslib's CryptoKeyPair, this requires the `privateKey` and `publicKey` fields */ export interface AvailableCryptoKeyPair { privateKey: CryptoKey; publicKey: CryptoKey; } export interface Didable { publicKeyStr: (format?: Encodings) => string; did: () => string; } export interface ExportableKey { export: (format?: Encodings) => Promise; } export interface Keypair { publicKey: Uint8Array; keyType: KeyType; sign: (msg: Uint8Array) => Promise; } export declare type KeyType = "rsa" | "p256" | "ed25519" | "bls12-381"; export declare type NamedCurve = "P-256"; export declare type PublicKeyJwk = { kty: string; crv: string; x: string; y: string; }; export declare type PrivateKeyJwk = PublicKeyJwk & { d: string; }; export declare type Encodings = SupportedEncodings; export declare function isAvailableCryptoKeyPair(keypair: CryptoKeyPair): keypair is AvailableCryptoKeyPair; export declare function isKeypair(obj: unknown): obj is Keypair; export declare function isUcanHeader(obj: unknown): obj is UcanHeader; export declare function isUcanPayload(obj: unknown): obj is UcanPayload;