import { DmConversationQuery, DmConversationPage, DmMessageQuery, DmMessagePage, DmMessage, Subscription, DmSendRequest, DmSendResult, DmStatus, DmSubscribeRequest, DmSubscription, DmOk } from '@napplet/core'; /** * Napplet NAP dm sdk entrypoint. * * @module */ /** * @napplet/nap/dm -- SDK helpers wrapping window.napplet.dm. * * These functions delegate to `window.napplet.dm.*` at call time. The shim must * be imported somewhere to install the global. */ /** * Get current DM availability and advisory runtime labels. * * @returns Promise resolving to the runtime DM status */ declare function dmStatus(): Promise; /** * Fetch normalized conversations visible to this napplet. * * @param query Optional cursor and limit * @returns Promise resolving to a page of conversations */ declare function dmConversations(query?: DmConversationQuery): Promise; /** * Fetch normalized message history for one conversation. * * @param query Conversation id plus optional cursor and limit * @returns Promise resolving to a page of messages */ declare function dmMessages(query: DmMessageQuery): Promise; /** * Ask the runtime to send a direct message. * * @param request Recipients, content, and optional conversation/client ids * @returns Promise resolving to the normalized send result */ declare function dmSend(request: DmSendRequest): Promise; /** * Start live delivery for one conversation or all visible conversations. * * @param request Optional conversation scope * @returns Promise resolving to the runtime subscription id */ declare function dmSubscribe(request?: DmSubscribeRequest): Promise; /** * Stop a live DM subscription. * * @param subscriptionId Runtime subscription id from dmSubscribe() * @returns Promise resolving to the runtime acknowledgement */ declare function dmUnsubscribe(subscriptionId: string): Promise; /** * Register for shell-pushed `dm.message` deliveries. * * @param handler Called with each message and its runtime subscription id * @returns A Subscription with `close()` to stop listening */ declare function dmOnMessage(handler: (message: DmMessage, subscriptionId: string) => void): Subscription; export { dmConversations, dmMessages, dmOnMessage, dmSend, dmStatus, dmSubscribe, dmUnsubscribe };