import type { Block as IPLDBlock, Version as LinkVersion } from 'multiformats'; import type { Phantom, Await } from '@ipld/dag-ucan'; import * as UCAN from '@ipld/dag-ucan'; import type { Capability, ServiceInvocation, InferReceipts, InferInvocations, Receipt, ByteView, Invocation, AgentMessage } from './lib.js'; /** * This utility type can be used in place of `T[]` where you * want TS to infer things as tuples as opposed to array. This */ export type Tuple = [T, ...T[]]; export interface EncodeOptions { readonly hasher?: UCAN.MultihashHasher; } export interface RequestEncodeOptions extends EncodeOptions { /** * If provided will be set as an `accept` header of the request. */ accept?: string; } export interface Channel> extends Phantom { request>>(request: HTTPRequest; Out: Tuple; }>>): Await; In: Tuple; }>>>; } export interface RequestEncoder { encode(message: T, options?: RequestEncodeOptions): Await>; } export interface RequestDecoder { decode(request: HTTPRequest): Await; } export interface ResponseEncoder { encode(message: T, options?: EncodeOptions): Await>; } export interface ResponseDecoder { decode(response: HTTPResponse): Await; } export interface HTTPRequest { method?: string; headers: Readonly>; body: ByteView; } export interface HTTPResponse { status?: number; headers: Readonly>; body: ByteView; } /** * Extends {@link IPLDBlock} with an optional `data` field. */ export interface Block extends IPLDBlock { data?: T; } //# sourceMappingURL=transport.d.ts.map