import type { DocHandle, Repo } from '@automerge/automerge-repo'; import { type Store } from '@xstate/store'; import type { Address } from 'viem'; import type { InboxSenderAuthPolicy } from './inboxes/types.js'; import type { Identity } from './index.js'; import type { Invitation, Updates } from './messages/index.js'; import type { SpaceEvent, SpaceState } from './space-events/index.js'; export type InboxMessageStorageEntry = { id: string; plaintext: string; ciphertext: string; signature: { hex: string; recovery: number; } | null; createdAt: string; authorAccountAddress: string | null; }; export type SpaceInboxStorageEntry = { inboxId: string; isPublic: boolean; authPolicy: InboxSenderAuthPolicy; encryptionPublicKey: string; secretKey: string; lastMessageClock: string; messages: InboxMessageStorageEntry[]; seenMessageIds: Set; }; export type AccountInboxStorageEntry = { inboxId: string; isPublic: boolean; authPolicy: InboxSenderAuthPolicy; encryptionPublicKey: string; lastMessageClock: string; messages: InboxMessageStorageEntry[]; seenMessageIds: Set; }; export type SpaceStorageEntry = { id: string; events: SpaceEvent[]; state: SpaceState | undefined; keys: { id: string; key: string; }[]; automergeDocHandle: DocHandle | undefined; inboxes: SpaceInboxStorageEntry[]; }; interface StoreContext { spaces: SpaceStorageEntry[]; updatesInFlight: string[]; invitations: Invitation[]; repo: Repo | null; identities: { [accountAddress: string]: { encryptionPublicKey: string; signaturePublicKey: string; accountProof: string; keyProof: string; }; }; authenticated: boolean; accountAddress: Address | null; sessionToken: string | null; keys: Identity.IdentityKeys | null; lastUpdateClock: { [spaceId: string]: number; }; accountInboxes: AccountInboxStorageEntry[]; } type StoreEvent = { type: 'setInvitations'; invitations: Invitation[]; } | { type: 'reset'; } | { type: 'addUpdateInFlight'; updateId: string; } | { type: 'removeUpdateInFlight'; updateId: string; } | { type: 'applyEvent'; spaceId: string; event: SpaceEvent; state: SpaceState; } | { type: 'updateConfirmed'; spaceId: string; clock: number; } | { type: 'applyUpdate'; spaceId: string; firstUpdateClock: number; lastUpdateClock: number; } | { type: 'addVerifiedIdentity'; accountAddress: string; encryptionPublicKey: string; signaturePublicKey: string; accountProof: string; keyProof: string; } | { type: 'setSpaceInbox'; spaceId: string; inbox: SpaceInboxStorageEntry; } | { type: 'setSpaceInboxMessages'; spaceId: string; inboxId: string; messages: InboxMessageStorageEntry[]; lastMessageClock: string; } | { type: 'setAccountInbox'; inbox: AccountInboxStorageEntry; } | { type: 'setAccountInboxMessages'; inboxId: string; messages: InboxMessageStorageEntry[]; lastMessageClock: string; } | { type: 'setSpace'; spaceId: string; name: string; updates?: Updates; events: SpaceEvent[]; inboxes?: SpaceInboxStorageEntry[]; spaceState: SpaceState; keys: { id: string; key: string; }[]; } | { type: 'setAuth'; accountAddress: Address; sessionToken: string; keys: Identity.IdentityKeys; } | { type: 'resetAuth'; } | { type: 'setRepo'; repo: Repo; }; type GenericEventObject = { type: string; }; export declare const store: Store; export {}; //# sourceMappingURL=store-connect.d.ts.map