// show group card comparison // remove viewRevision // add bot api // formaize delete vs block remote channel // articles share by cards now import type { Channel, Topic, Asset, Tag, Article, Group, Card, Profile, Call, AccountStatus, NodeConfig, NodeAccount, Repeater } from './types'; 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 Crypto { } export interface Logging { error(m: any): void; warn(m: any): void; info(m: any): void; } export interface Session { close(): void; getAccount(): Account; getIdentity(): Identity; getContact(): Contact; getAlias(): Alias; getAttribute(): Attribute; getContent(): Content; getStream(): Stream; getRing(): Ring; addFocus(cardId: string | null, channelId: string): Focus; removeFocus(focus: Focus): void; resync(): void; addStatusListener(ev: (status: string) => void): void; removeStatusListener(ev: (status: string) => void): void; } export interface Ring { addCallingListener(ev: (calls: Call[]) => void): void; removeCallingListener(ev: (calls: Call[]) => void): void; addCallListener(ev: (call: Call | null) => void): void; removeCallListener(ev: (call: Call | null) => void): void; accept(callId: string): void; ignore(callId: string): void; decline(callId: string): void; } export interface Account { setLogin(username: string, password: string): Promise; enableNotifications(): Promise; disableNotifications(): Promise; enableRegistry(): Promise; disableRegistry(): Promise; enableMFA(): Promise<{ secretImage: string, secretText: string }>; disableMFA(): Promise; confirmMFA(code: string): Promise; setAccountSeal(password: string): Promise; clearAccountSeal(): Promise; unlockAccountSeal(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; getProfileImageUrl(): string; addProfileListener(ev: (profile: Profile) => void): void; removeProfileListener(ev: (profile: Profile) => void): void; } export interface Contact { addCard(server: string, guid: string): Promise; removeCard(cardId: string): Promise; confirmCard(cardId: string): Promise; connectCard(cardId: string): Promise; disconnectCard(cardId: string): Promise; rejectCard(cardId: string): Promise; ignoreCard(cardId: string): Promise; resyncCard(cardId: string): Promise; removeArticle(cardId: string, articleId: string): Promise; removeChannel(cardId: string, channelId: string): Promise; addTopic(cardId: string, channelId: string, type: string, subject: string, assets: Asset[]): Promise; removeTopic(cardId: string, channelId: string, topicId: string): Promise; setTopicSubject(cardId: string, channelId: string, topicId: string, subject: string): Promise; addTag(cardId: string, channelId: string, topicId: string, type: string, subject: string): Promise; removeTag(cardId: string, topicId: string, tagId: string): Promise; setTagSubject(cardId: string, topicId: string, tagId: string, subject: string): Promise; getTopics(cardId: string, channelId: string): Promise; getMoreTopics(cardId: string, channelId: string): Promise; getTags(cardId: string, channelId: string, topicId: string): Promise; getMoreTags(cardId: string, channelId: string, topicId: string): Promise; flagCard(cardId: string): Promise; flagArticle(cardId: string, articleId: string): Promise; flagChannel(cardId: string, channelId: string): Promise; flagTopic(cardId: string, channelId: string, topicId: string): Promise; flagTag(cardId: string, channelId: string, topicId: string, tagId: string): Promise; setBlockCard(cardId: string): Promise; setBlockArticle(cardId: string, articleId: string): Promise; setBlockChannel(cardId: string, channelId: string): Promise; setBlockTopic(cardId: string, channelId: string, topicId: string): Promise; setBlockTag(cardId: string, channelId: string, topicId: string, tagId: string): Promise; clearBlockCard(cardId: string): Promise; clearBlockArticle(cardId: string, articleId: string): Promise; clearBlockChannel(cardId: string, channelId: string): Promise; clearBlockTopic(cardId: string, channelId: string, topicId: string): Promise; clearBlockTag(cardId: string, channelId: string, topicId: string, tagId: string): Promise; getBlockedCards(): Promise<{ cardId: string }[]>; getBlockedChannels(): Promise<{ cardId: string, channelId: string }[]>; getBlockedTopics(): Promise<{ cardId: string, channelId: string, topicId: string }[]>; getBlockedTags(): Promise<{ cardId: string, channelId: string, topicId: string, tagId: string }[]>; getBlockedArticles(): Promise<{ cardId: string, articleId: string }[]>; setUnreadChannel(cardId: string, channelId: string): Promise; clearUnreadChannel(cardId: string, channelId: string): Promise; getRegistry(server: string): Promise; getRegistryImageUrl(server: string, guid: string): string; getCardImageUrl(cardId: string): string; getTopicAssetUrl(cardId: string, channelId: string, topicId: string, assetId: string): string; addRepeaterAccess(cardId: string, channelId: string, name: string): Promise; removeRepeaterAccess(cardId: string, channelId: string, repeaterId: string): Promise; addCardListener(ev: (cards: Card[]) => void): void; removeCardListener(ev: (cards: Card[]) => void): void; } export interface Alias { addGroup(sealed: boolean, type: string, subject: string, cardIds: string[]): Promise; removeGroup(groupId: string): Promise; setGroupSubject(groupId: string, subject: string): Promise; setGroupCard(groupId: string, cardId: string): Promise; clearGroupCard(groupId: string, cardId: string): Promise; compare(groupIds: string[], cardIds: string[]): Promise>; addGroupListener(ev: (groups: Group[]) => void): void; removeGroupListener(ev: (groups: Group[]) => void): void; } export interface Attribute { addArticle(sealed: boolean, type: string, subject: string, cardIds: string[], groupIds: string[]): Promise; removeArticle(articleId: string): Promise; setArticleSubject(articleId: string, subject: string): Promise; setArticleCard(articleId: string, cardId: string): Promise; clearArticleCard(articleId: string, cardId: string): Promise; setArticleGroup(articleId: string, groupId: string): Promise; clearArticleGroup(articleId: string, groupId: string): Promise; addArticleListener(ev: (articles: Article[]) => void): void; removeArticleListener(ev: (articles: Article[]) => void): void; } export interface Content { addChannel(sealed: boolean, type: string, subject: string, cardIds: string[], groupIds: string[]): Promise; removeChannel(channelId: string): Promise; setChannelSubject(channelId: string, subject: string): Promise; setChannelCard(channelId: string, cardId: string): Promise; clearChannelCard(channelId: string, cardId: string): Promise; setChannelGroup(channelId: string, cardId: string): Promise; clearChannelGroup(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, subject: string): Promise; addTag(channelId: string, topicId: string, type: string, value: string): Promise; removeTag(channelId: string, topicId: string, tagId: string): Promise; setTagSubject(channelId: string, topicId: string, tagId: string, subject: string): Promise; getTopicAssetUrl(channelId: string, topicId: string, assetId: string): string; flagTopic(channelId: string, topicId: string): Promise; flagTag(channelId: string, topicId: string, tagId: string): Promise; setBlockTopic(channelId: string, topicId: string): Promise; setBlockTag(channelId: string, topicId: string, tagId: string): Promise; clearBlockTopic(channelId: string, topicId: string): Promise; clearBlockTag(channelId: string, topicId: string, tagId: string): Promise; getBlockedTopics(): Promise<{ channelId: string, topicId: string }[]>; getBlockedTags(): Promise<{ channelId: string, topicId: string, tagId: string }[]>; getTopics(channelId: string): Promise; getMoreTopics(channelId: string): Promise; getTags(channelId: string, topicId: string): Promise; getMoreTags(channelId: string, topicId: string): Promise; setUnreadChannel(channelId: string): Promise; clearUnreadChannel(channelId: string): Promise; addRepeaterAccess(channelId: string, name: string): Promise; removeRepeaterAccess(channelId: string, repeaterId: string): Promise; addChannelListener(ev: (channels: Channel[]) => void): void; removeChannelListener(ev: (channels: Channel[]) => void): void; } export interface Stream { addChannelListener(ev: (channels: Channel[]) => void): void; removeChannelListener(ev: (channels: Channel[]) => void): void; } export interface Focus { blur(): void; addTopic(type: string, message: string, assets: Asset[]): Promise; removeTopic(topicId: string): Promise; setTopicSubject(topicId: string, subject: string): Promise; addTag(topicId: string, type: string, subject: string): Promise; removeTag(cardId: string, tagId: string): Promise; setTagSubject(topicId: string, tagId: string, subject: string): Promise; viewMoreTopics(): Promise; viewMoreTags(topicId: string): Promise; setUnreadChannel(cardId: string, channelId: string): Promise; clearUnreadChannel(cardId: string, channelId: string): Promise; getTopicAssetUrl(topicId: string, assetId: string): string; addRepeaterAccess(name: string): Promise; removeRepeaterAccess(repeaterId: string): Promise; flagTopic(topicId: string): Promise; flagTag(topicId: string, tagId: string): Promise; setBlockTopic(topicId: string): Promise; setBlockTag(topicId: string, tagId: string): Promise; clearBlockTopic(topicId: string): Promise; clearBlockTag(topicId: string, tagId: string): Promise; addTopicListener(ev: (topics: Topic[]) => void): void; removeTopicListener(ev: (topics: Topic[]) => void): void; } export interface Node { getAccounts(): Promise; createAccountAccess(): Promise; resetAccountAccess(): Promise; blockAccount(flag: boolean): Promise; removeAccount(accountId: number): Promise; getConfig(): Promise; setConfig(config: NodeConfig): Promise; } export interface Bot { addTopic(type: string, message: string, assets: Asset[]): Promise; removeTopic(topicId: string): Promise; addTag(topicId: string, type: string, value: string): Promise; removeTag(topicId: string, tagId: string): Promise; }