/** * @import {DelegationValidateOptions, Policy, DelegationOptions, DelegationPayload, DID, DIDURL, StandardSchemaV1} from './types.js' * @import {CID} from 'multiformats' */ /** * UCAN Delegation */ export class Delegation { /** * Create a delegation from bytes and validate it * * Does not validate "not before" time, call {@link Delegation.validate} to validate it * * @param {import("./types.js").DelegationFromOptions} options */ static from(options: import("./types.js").DelegationFromOptions): Promise; /** * Create a delegation from a base64 encoded string * * @param {string} token * @param { {now?: number}} [options] */ static fromString(token: string, options?: { now?: number; }): Promise; /** * * @template {StandardSchemaV1} Schema * @param {DelegationOptions} options */ static create(options: DelegationOptions): Promise; /** * * @param {import("./types.js").DecodedEnvelope<'dlg'>} envelope * @param {Uint8Array} bytes * @param {CID} cid */ constructor(envelope: import("./types.js").DecodedEnvelope<"dlg">, bytes: Uint8Array, cid: CID); /** @type {DIDURL} */ iss: DIDURL; /** @type {DID} */ aud: DID; /** @type {DID | null} */ sub: DID | null; /** @type {string} */ cmd: string; /** @type {Policy} */ pol: Policy; /** @type {number | undefined} */ nbf: number | undefined; /** @type {Uint8Array} */ nonce: Uint8Array; /** @type {Record | undefined} */ meta: Record | undefined; /** @type {number | null} */ exp: number | null; envelope: import("./types.js").DecodedEnvelope<"dlg">; bytes: Uint8Array; cid: CID; /** * Validate a delegation * * Checks the structure, "not before" time, signature, and revocation status * * @param {DelegationValidateOptions} options */ validate(options: DelegationValidateOptions): Promise; toString(): string; toJSON(): { token: string; cid: string; envelope: { payload: { iss: string; aud: string; sub: string | null; cmd: string; pol: Policy; exp: number | null; nbf: number | undefined; nonce: string; meta: Record | undefined; }; signature: string; alg: import("iso-signatures/types").SignatureType; enc: import("./types.js").VarsigEncoding; spec: "dlg"; version: string; }; }; } import type { DIDURL } from './types.js'; import type { DID } from './types.js'; import type { Policy } from './types.js'; import type { CID } from 'multiformats'; import type { DelegationValidateOptions } from './types.js'; import type { StandardSchemaV1 } from './types.js'; import type { DelegationOptions } from './types.js'; //# sourceMappingURL=delegation.d.ts.map