import type { DataStore } from './types/data-store.js'; import type { EventLog } from './types/event-log.js'; import type { MessageStore } from './types/message-store.js'; import type { Readable } from 'readable-stream'; import type { TenantGate } from './core/tenant-gate.js'; import type { EventsGetMessage, EventsGetReply } from './types/event-types.js'; import type { GenericMessageReply, UnionMessageReply } from './core/message-reply.js'; import type { MessagesGetMessage, MessagesGetReply } from './types/messages-types.js'; import type { PermissionsGrantMessage, PermissionsRequestMessage, PermissionsRevokeMessage } from './types/permissions-types.js'; import type { ProtocolsConfigureMessage, ProtocolsQueryMessage, ProtocolsQueryReply } from './types/protocols-types.js'; import type { RecordsDeleteMessage, RecordsQueryMessage, RecordsQueryReply, RecordsReadMessage, RecordsReadReply, RecordsWriteMessage } from './types/records-types.js'; import { DidResolver } from './did/did-resolver.js'; import { DwnInterfaceName, DwnMethodName } from './enums/dwn-interface-method.js'; export declare class Dwn { private methodHandlers; private didResolver; private messageStore; private dataStore; private eventLog; private tenantGate; private constructor(); /** * Creates an instance of the DWN. */ static create(config: DwnConfig): Promise; private open; close(): Promise; /** * Processes the given DWN message and returns with a reply. * @param tenant The tenant DID to route the given message to. */ processMessage(tenant: string, rawMessage: EventsGetMessage): Promise; processMessage(tenant: string, rawMessage: MessagesGetMessage): Promise; processMessage(tenant: string, rawMessage: ProtocolsConfigureMessage): Promise; processMessage(tenant: string, rawMessage: ProtocolsQueryMessage): Promise; processMessage(tenant: string, rawMessage: PermissionsRequestMessage): Promise; processMessage(tenant: string, rawMessage: PermissionsGrantMessage): Promise; processMessage(tenant: string, rawMessage: PermissionsRevokeMessage): Promise; processMessage(tenant: string, rawMessage: RecordsDeleteMessage): Promise; processMessage(tenant: string, rawMessage: RecordsQueryMessage): Promise; processMessage(tenant: string, rawMessage: RecordsReadMessage): Promise; processMessage(tenant: string, rawMessage: RecordsWriteMessage, dataStream?: Readable): Promise; processMessage(tenant: string, rawMessage: unknown, dataStream?: Readable): Promise; /** * Privileged method for writing a pruned initial `RecordsWrite` to a DWN without needing to supply associated data. */ synchronizePrunedInitialRecordsWrite(tenant: string, message: RecordsWriteMessage): Promise; /** * Checks tenant gate to see if tenant is allowed. * @param tenant The tenant DID to route the given message to. * @returns GenericMessageReply if the message has an integrity error, otherwise undefined. */ validateTenant(tenant: string): Promise; /** * Validates structure of DWN message * @param tenant The tenant DID to route the given message to. * @param dwnMessageInterface The interface of DWN message. * @param dwnMessageMethod The interface of DWN message. * @returns GenericMessageReply if the message has an integrity error, otherwise undefined. */ validateMessageIntegrity(rawMessage: any, expectedInterface?: DwnInterfaceName, expectedMethod?: DwnMethodName): Promise; } /** * DWN configuration. */ export type DwnConfig = { didResolver?: DidResolver; tenantGate?: TenantGate; messageStore: MessageStore; dataStore: DataStore; eventLog: EventLog; }; //# sourceMappingURL=dwn.d.ts.map