import type { Web5Agent } from '@tbd54566975/web5-agent'; import type { UnionMessageReply, RecordsReadOptions, RecordsQueryOptions, RecordsWriteOptions, RecordsDeleteOptions, ProtocolsQueryOptions, ProtocolsConfigureOptions, ProtocolsConfigureDescriptor } from '@tbd54566975/dwn-sdk-js'; import { Record } from './record.js'; import { Protocol } from './protocol.js'; export type ProtocolsConfigureRequest = { message: Omit; }; export type ProtocolsConfigureResponse = { status: UnionMessageReply['status']; protocol?: Protocol; }; export type ProtocolsQueryReplyEntry = { descriptor: ProtocolsConfigureDescriptor; }; export type ProtocolsQueryRequest = { from?: string; message: Omit; }; export type ProtocolsQueryResponse = { protocols: Protocol[]; status: UnionMessageReply['status']; }; export type RecordsCreateRequest = RecordsWriteRequest; export type RecordsCreateResponse = RecordsWriteResponse; export type RecordsCreateFromRequest = { author: string; data: unknown; message?: Omit; record: Record; }; export type RecordsDeleteRequest = { from?: string; message: Omit; }; export type RecordsDeleteResponse = { status: UnionMessageReply['status']; }; export type RecordsQueryRequest = { /** The from property indicates the DID to query from and return results. */ from?: string; message: Omit; }; export type RecordsQueryResponse = { status: UnionMessageReply['status']; records?: Record[]; }; export type RecordsReadRequest = { /** The from property indicates the DID to read from and return results fro. */ from?: string; message: Omit; }; export type RecordsReadResponse = { status: UnionMessageReply['status']; record: Record; }; export type RecordsWriteRequest = { data: unknown; message?: Omit, 'authorizationSignatureInput'>; store?: boolean; }; export type RecordsWriteResponse = { status: UnionMessageReply['status']; record?: Record; }; /** * TODO: Document class. */ export declare class DwnApi { private web5Agent; private connectedDid; constructor(web5Agent: Web5Agent, connectedDid: string); /** * TODO: Document namespace. */ get protocols(): { /** * TODO: Document method. */ configure: (request: ProtocolsConfigureRequest) => Promise; /** * TODO: Document method. */ query: (request: ProtocolsQueryRequest) => Promise; }; /** * TODO: Document namespace. */ get records(): { /** * TODO: Document method. */ create: (request: RecordsCreateRequest) => Promise; /** * TODO: Document method. */ createFrom: (request: RecordsCreateFromRequest) => Promise; /** * TODO: Document method. */ delete: (request: RecordsDeleteRequest) => Promise; /** * TODO: Document method. */ query: (request: RecordsQueryRequest) => Promise; /** * TODO: Document method. */ read: (request: RecordsReadRequest) => Promise; /** * TODO: Document method. * * As a convenience, the Record instance returned will cache a copy of the data if the * data size, in bytes, is less than the DWN 'max data size allowed to be encoded' * parameter of 10KB. This is done to maintain consistency with other DWN methods, * like RecordsQuery, that include relatively small data payloads when returning * RecordsWrite message properties. Regardless of data size, methods such as * `record.data.stream()` will return the data when called even if it requires fetching * from the DWN datastore. */ write: (request: RecordsWriteRequest) => Promise; }; } //# sourceMappingURL=dwn-api.d.ts.map