import { GroupManager, type CreateGroupResult, type GroupData, type GroupDecryptedEvent } from "./Group"; import type { SessionManager } from "./SessionManager"; import { type StorageAdapter } from "./StorageAdapter"; import { type NostrFetch, type NostrPublish, type NostrSubscribe, type Rumor, type Unsubscribe } from "./types"; import type { OnEventMeta } from "./session-manager/types"; import type { VerifiedEvent } from "nostr-tools"; export interface SendGroupEventOptions { nowMs?: number; } export interface RuntimeGroupEvent { kind: number; content: string; tags?: string[][]; } interface SessionGroupRuntimeSharedOptions { nostrSubscribe: NostrSubscribe; nostrPublish: NostrPublish; nostrFetch?: NostrFetch; groupStorage?: StorageAdapter; onReadyStateChange?: (ready: boolean) => void; } interface SessionGroupRuntimeAttachedOptions extends SessionGroupRuntimeSharedOptions { sessionManager: SessionManager; ourOwnerPubkey: string; ourDevicePubkey: string; } interface SessionGroupRuntimeDeferredOptions extends SessionGroupRuntimeSharedOptions { waitForSessionManager: (ownerPubkey?: string) => Promise; getOwnerPubkey: () => string | null; getCurrentDevicePubkey: () => string | null; } export type SessionGroupRuntimeOptions = SessionGroupRuntimeAttachedOptions | SessionGroupRuntimeDeferredOptions; export declare class SessionGroupRuntime { private readonly nostrSubscribe; private readonly nostrPublish; private readonly nostrFetch?; private readonly groupStorage; private readonly waitForSessionManagerFn; private readonly getOwnerPubkey; private readonly getCurrentDevicePubkey; private readonly onReadyStateChange?; private groupManager; private groupManagerInitPromise; private sessionManager; private sessionBridgeCleanup; private readonly groupEventCallbacks; constructor(options: SessionGroupRuntimeOptions); getGroupManager(): GroupManager | null; getManager(): GroupManager | null; waitForManager(ownerPubkey?: string): Promise; waitForGroupManager(ownerPubkey?: string): Promise; onGroupEvent(callback: (event: GroupDecryptedEvent) => void): Unsubscribe; setSessionManager(manager: SessionManager | null, options?: { bridgeSessionEvents?: boolean; }): void; processSessionEvent(event: Rumor, from: string, meta?: OnEventMeta): void; upsertGroup(group: GroupData, ownerPubkey?: string): Promise; syncGroups(groups: GroupData[], ownerPubkey?: string): Promise; removeGroup(groupId: string): void; createGroup(name: string, memberOwnerPubkeys: string[], opts?: { fanoutMetadata?: boolean; nowMs?: number; }): Promise; sendGroupEvent(groupId: string, event: RuntimeGroupEvent, opts?: SendGroupEventOptions): Promise<{ outer: VerifiedEvent; inner: Rumor; }>; sendGroupMessage(groupId: string, message: string, opts?: SendGroupEventOptions): Promise<{ outer: VerifiedEvent; inner: Rumor; }>; close(): void; private clearSessionBridge; private shouldEmitPairwiseGroupEvent; private buildPairwiseGroupEvent; private emitGroupEvent; } export { SessionGroupRuntime as RuntimeGroupController }; //# sourceMappingURL=RuntimeGroupController.d.ts.map