export function isLink(value: API.Proof): value is UCAN.Link, UCAN.SigAlg>; export function isDelegation(proof: API.Proof): proof is API.Delegation; export function allows, ...API.Delegation[]]>(...delegations: T): API.InferAllowedFromDelegations; /** * Represents UCAN chain view over the set of DAG UCAN nodes. You can think of * this as UCAN interface of the CAR. * * @template {API.Capabilities} C * @implements {API.Delegation} * @extends {DelegationView} */ export class Delegation implements API.Delegation { /** * @param {API.UCANBlock} root * @param {DAG.BlockStore} [blocks] */ constructor(root: API.UCANBlock, blocks?: DAG.BlockStore | undefined); root: UCAN.Block, UCAN.SigAlg>; blocks: DAG.BlockStore; /** * @returns {API.AttachedLinkSet} */ get attachedLinks(): API.AttachedLinkSet; get version(): `${number}.${number}.${number}`; get signature(): UCAN.SignatureView; get cid(): UCAN.IPLDLink, UCAN.MulticodecCode, UCAN.SigAlg, 1>; link(): UCAN.IPLDLink, UCAN.MulticodecCode, UCAN.SigAlg, 1>; get asCID(): UCAN.IPLDLink, UCAN.MulticodecCode, UCAN.SigAlg, 1>; get bytes(): UCAN.ByteView>; get data(): UCAN.View; /** * Attach a block to the delegation DAG so it would be included in the * block iterator. * ⚠️ You can only attach blocks that are referenced from the `capabilities` * or `facts`. * * @param {API.Block} block */ attach(block: API.Block): void; export(): IterableIterator>; /** * @returns {API.Await>} */ archive(): API.Await>; iterateIPLDBlocks(): IterableIterator>; /** * @type {API.Proof[]} */ get proofs(): API.Proof[]; /** * @type {API.Principal} */ get issuer(): UCAN.Principal<`did:${string}:${string}`>; /** * @type {API.Principal} */ get audience(): UCAN.Principal<`did:${string}:${string}`>; /** * @returns {C} */ get capabilities(): C; /** * @returns {number} */ get expiration(): number; /** * @returns {undefined|number} */ get notBefore(): number | undefined; /** * @returns {undefined|string} */ get nonce(): string | undefined; /** * @returns {API.Fact[]} */ get facts(): UCAN.Fact[]; /** * Iterate over the proofs * * @returns {IterableIterator} */ iterate(): IterableIterator; delegate(): Delegation; buildIPLDView(): Delegation; /** * @returns {API.DelegationJSON} */ toJSON(): API.DelegationJSON>; } export function archive(delegation: API.Delegation): Promise>; export const ArchiveSchema: Schema.VariantSchema<{ 'ucan@0.9.1': Schema.Schema, UCAN.SigAlg>, any>; }, unknown>; export function extract(archive: Uint8Array): Promise<{ error: API.Failure; ok?: undefined; } | { ok: API.Delegation; error?: undefined; }>; export function delegate({ issuer, audience, proofs, attachedBlocks, ...input }: API.DelegationOptions, options?: API.EncodeOptions | undefined): Promise>; export function exportDAG(root: UCAN.Block, UCAN.SigAlg>, blocks: DAG.BlockStore, attachedLinks: API.AttachedLinkSet): IterableIterator; export function importDAG(dag: Iterable): API.Delegation; export function create({ root, blocks }: { root: UCAN.Block, UCAN.SigAlg>; blocks?: DAG.BlockStore | undefined; }): API.Delegation; export function view({ root, blocks }: { root: UCAN.Link, UCAN.SigAlg>; blocks: DAG.BlockStore; }, fallback?: E | undefined): E | API.Delegation; export { Delegation as View }; import * as API from '@ucanto/interface'; import * as UCAN from '@ipld/dag-ucan'; import * as DAG from './dag.js'; import * as Schema from './schema.js'; //# sourceMappingURL=delegation.d.ts.map