import { ProtocolCatalog, ProtocolDefinition, ProtocolSupport } from "@dsh-std/core"; //#region src/index.d.ts declare const API_VERSION = "messages.dsh/v1alpha1"; declare const KIND = "MessageObserver"; declare const READ_PERMISSION = "messages.observe.read"; declare const EVENT_TYPE = "messages.observe"; declare const EVENT_VERSION = "0.15"; type PrivacyClass = 'public' | 'internal' | 'sensitive'; type MessageEventKind = 'message.created' | 'message.received' | 'message.sent'; interface TextContentBlock { readonly type: 'text'; readonly text: string; } interface ImageContentBlock { readonly type: 'image'; readonly data: string; readonly mimeType: string; } type MessageContentBlock = TextContentBlock | ImageContentBlock; interface MessagePayload { readonly kind: MessageEventKind; readonly messageId?: string; readonly author?: string; readonly content: readonly MessageContentBlock[]; readonly truncated?: boolean; } interface MessageEvent { readonly eventType: typeof EVENT_TYPE; readonly eventVersion: typeof EVENT_VERSION; readonly eventId: string; readonly scope: string; readonly sequence: number; readonly privacyClass: PrivacyClass; readonly summary: string; readonly payload: MessagePayload; } interface MessageSubscription { readonly scope?: string; } type MessageObserverErrorCode = 'PERMISSION_NOT_GRANTED' | 'UNKNOWN_PRIVACY_CLASS' | 'INVALID_EVENT_ENVELOPE' | 'SUBSCRIPTION_CLOSED'; declare const protocol: ProtocolDefinition; declare const support: ProtocolSupport; declare function register(catalog: ProtocolCatalog): () => void; declare function validateSubscription(value: unknown): asserts value is MessageSubscription; declare function validateMessageEvent(value: unknown): asserts value is MessageEvent; declare function parseMessageEvent(value: unknown): MessageEvent; declare function validateContentBlock(value: unknown): asserts value is MessageContentBlock; //#endregion export { API_VERSION, EVENT_TYPE, EVENT_VERSION, ImageContentBlock, KIND, MessageContentBlock, MessageEvent, MessageEventKind, MessageObserverErrorCode, MessagePayload, MessageSubscription, PrivacyClass, READ_PERMISSION, TextContentBlock, parseMessageEvent, protocol, register, support, validateContentBlock, validateMessageEvent, validateSubscription }; //# sourceMappingURL=index.d.ts.map