import { Delegation, Capability, Ability, Resource, Caveats } from '@ucanto/client' import * as Assert from '../capability/assert.js' import { AssertEquals, AssertInclusion, AssertIndex, AssertLocation, AssertPartition, AssertRelation } from '../capability/api.js' type InferCaveats = C extends Capability ? NB : never type InferContent = C extends { content: infer T} ? T : never /** A verifiable claim about data. */ export interface ContentClaim { /** Subject of the claim e.g. CAR, DAG root etc. */ readonly content: InferContent> /** Discriminator for different types of claims. */ readonly type: T /** * Returns the underlying delegation this is based on */ delegation() : Delegation } /** A claim not known to this library. */ export interface UnknownClaim extends ContentClaim<'unknown'> {} /** A claim that a CID is available at a URL. */ export interface LocationClaim extends ContentClaim, Readonly> { } /** A claim that a CID's graph can be read from the blocks found in parts. */ export interface PartitionClaim extends ContentClaim, Readonly> { } /** A claim that a CID includes the contents claimed in another CID. */ export interface InclusionClaim extends ContentClaim, Readonly> { } /** * A claim that a content graph can be found in blob(s) that are identified and * indexed in the given index CID. */ export interface IndexClaim extends ContentClaim, Readonly> { } /** A claim that a CID links to other CIDs. */ export interface RelationClaim extends ContentClaim, Readonly> { } /** A claim that the same data is referred to by another CID and/or multihash */ export interface EqualsClaim extends ContentClaim, Readonly> { } /** Types of claim that are known to this library. */ export type KnownClaimTypes = | typeof Assert.location.can | typeof Assert.partition.can | typeof Assert.inclusion.can | typeof Assert.index.can | typeof Assert.relation.can | typeof Assert.equals.can /** A verifiable claim about data. */ export type Claim = | LocationClaim | PartitionClaim | InclusionClaim | IndexClaim | RelationClaim | EqualsClaim | UnknownClaim