Options
All
  • Public
  • Public/Protected
  • All
Menu

Module lib/interface

Index

Type aliases

CIDString

CIDString: Tagged<string, CID>

CID in string representation

Deal

Encoded

Encoded<T, Format>: MatchRecord<T, Rule<Format[number]>>

Represents T encoded with a given Format.

example
type Format = [
[URL, { type: 'URL', href: string }]
[CID, { type: 'CID', cid: string }]
[Blob, { type: 'Blob', href: string }]
]

type Response<T> = Encoded<T, Format>

Type parameters

EncodedError

EncodedError: { message: string }

Type declaration

  • message: string

EncodedURL

EncodedURL: Tagged<string, URL>

MatchRecord

MatchRecord<T, R>: { [ K in keyof T]: MatchRule<T[K], R> extends never ? MatchRecord<T[K], R> : MatchRule<T[K], R> }

Type parameters

PinStatus

PinStatus: "queued" | "pinning" | "pinned" | "failed"

Result

Result<X, T>: { ok: true; value: T } | { error: X; ok: false }

Type parameters

  • X

  • T

StoreResponse

StoreResponse<T>: Result<EncodedError, EncodedToken<T>>

Type parameters

Tagged

Tagged<T, Tag>: T & { tag?: Tag }

Define nominal type of U based on type of T. Similar to Opaque types in Flow

Type parameters

  • T

  • Tag

Generated using TypeDoc