export interface SqlStore { set(stmt: string, params: (string | number)[]): Promise; get(stmt: string, params: (string | number)[]): Promise; } export interface WebStore { getValue(key: string): Promise; setValue(key: string, value: string): Promise; clearValue(key: string): Promise; clearAll(): Promise; } export interface Session { getAccount(): Account; getIdentity(): Identity; getContact(): Contact; getGroup(): Group; getAttribute(): Attribute; getContent(): Content; resync(): void; addStatusListener(ev: (status: string) => void): void; removeStatusListener(ev: (status: string) => void): void; } export interface Node { } export interface Account { setNotifications(flag: boolean): Promise; setSearchable(flag: boolean): Promise; enableMFA(): Promise; disableMFA(): Promise; confirmMFA(): Promise; setAccountSeal(seal: Seal, key: SealKey): Promise unlockAccountSeal(key: SealKey): Promise setLogin(username: string, password: string): Promise addStatusListener(ev: (status: AccountStatus) => void): void; removeStatusListener(ev: (status: AccountStatus) => void): void; } export interface Identity { setProfileData(name: string, location: string, description: string): Promise; setProfileImage(image: string): Promise; getHandleStatus(handle: string): Promise; addProfileListener(ev: (profile: Profile) => void): void; removeProfileListener(ev: (profile: Profile) => void): void; } export interface Contact { addCard(message: SignedMessage): Promise; removeCard(cardId: string): Promise; setCardConnecting(cardId: string): Promise; setCardConnected(cardId: string, token: string, rev: number): Promise; setCardConfirmed(cardId: string): Promise; getCardOpenMessage(cardId: string): Promise; setCardOpenMessage(server: string, message: SignedMessage): Promise; getCardCloseMessage(cardId: string): Promise; setCardCloseMessage(server: string, message: SignedMessage): Promise; removeChannel(cardId: string, channelId: string): Promise; addTopic(cardId: string, channelId: string, type: string, message: string, assets: Asset[]): Promise; removeTopic(cardId: string, channelId: string, topicId: string): Promise; setTopicSubject(cardId: string, channelId: string, topicId: string, type: string, subject: string): Promise; getTopics(cardId: string, channelId: string, revision: number, count: number, begin: number, end: number): Promise; getTopic(cardId: string, channelId: string, topicId: string): Promise; resyncCard(cardId: string): Promise; getTopicAssetUrl(cardId: string, channelId: string, topicId: string, assetId: string): string; getCardImageUrl(cardId: string): string; addCardListener(ev: (cards: Card[]) => void): void; removeCardListener(ev: (cards: Card[]) => void): void; } export interface Group { } export interface Attribute { addArticle(type: string, subject: string, cardIds: string[]): Promise; removeArticle(articleId: string): Promise; setArticleSubject(articleId: string, type: string, subject: string): Promise; setArticleCard(articleId: string, cardId: string): Promise; clearArticleCard(articleId: string, cardId: string): Promise; addArticleListener(ev: (articles: Article[]) => void): void; removeArticleListener(ev: (articles: Article[]) => void): void; } export interface Content { addChannel(type: string, subject: string, cardIds: string[]): Promise; removeChannel(channelId: string): Promise; setChannelSubject(channelId: string, type: string, subject: string): Promise; setChannelCard(channelId: string, cardId: string): Promise; clearChannelCard(channelId: string, cardId: string): Promise; addTopic(channelId: string, type: string, message: string, assets: Asset[]): Promise; removeTopic(channelId: string, topicId: string): Promise; setTopicSubject(channelId: string, topicId: string, type: string, subject: string): Promise; getTopics(channelId: string, revision: number, count: number, begin: number, end: number): Promise; getTopic(channelId: string, topicId: string): Promise; getTopicAssetUrl(channelId: string, topicId: string, assetId: string): string; addChannelListener(ev: (channels: Channel[]) => void): void; removeChannelListener(ev: (channels: Channel[]) => void): void; } export interface SealKey { publicKey: string; privateKey: string; } export interface Seal { passwordSalt: string; privateKeyIv: string; privateKeyEncrypted: string; publicKey: string; } export interface AccountStatus { disabled: boolean; storageUsed: number; storageAvailable: number; forwardingAddress: string; searchable: boolean; allowUnsealed: boolean; pushEnabled: boolean; sealable: boolean; seal: Seal; enableIce: boolean; multiFactorAuth: boolean; webPushKey: string; } export interface Profile { guid: string; handle: string; name: string; description: string; location: string; image: string; revision: number; seal: string; version: string; node: string; } export interface Card { } export interface Channel { } export interface Topic { } export interface Asset { } export interface Alias { } export interface Article { } export interface SignedMessage { message: string; keyType: string; publicKey: string; signature: string; signatureType: string; } export interface ContactStatus { token: string; profileRevision: number; articleRevision: number; channelRevision: number; viewRevision: number; status: string; }