@docsvision/webclient
Version:
Type definitions for DocsVision WebClient scripts and extensions.
72 lines (71 loc) • 4.15 kB
TypeScript
import { IUnreadCounter } from "@docsvision/webclient/Platform/$UnreadCounter";
import { IFoldersToCountData } from "@docsvision/webclient/Platform/IFoldersToCountData";
import { IFolderToCountOptions } from "@docsvision/webclient/Platform/IFolderToCountOptions";
import { ILocalCounterData } from "@docsvision/webclient/Platform/ILocalCounter";
import { IUnreadCountersData } from "@docsvision/webclient/Platform/IUnreadCountersData";
import { IBasicEvent } from "@docsvision/webclient/System/IBasicEvent";
import { $RealtimeCommunicationService } from "@docsvision/webclient/System/$RealtimeCommunicationService";
import { IRealTimeCommunicationMessage } from "@docsvision/webclient/System/IRealTimeCommunicationMessage";
import { $ApplicationSettings } from '@docsvision/webclient/StandardServices';
/** @internal */
export declare class UnreadCounter implements IUnreadCounter {
private services;
private updateTimeout;
private realtimeCommunicationService;
private globalTabsFolders;
private sessionStorageKey;
private foldersToCountData;
private foldersToCountChangedEvent;
private unreadCountersData;
private unreadCountersDataChangedEvent;
private triggerUnreadCountersChanged;
private static CurrentUnreadCountersMessage;
private static RequestCurrentCountersMessage;
static SendLocalCountsMessage: string;
constructor(services: $RealtimeCommunicationService & $ApplicationSettings);
get foldersToCount(): IFoldersToCountData;
set foldersToCount(data: IFoldersToCountData);
get foldersToCountChanged(): IBasicEvent<IFoldersToCountData>;
addFolderToCount(folderId: string, sourceId: string, options: IFolderToCountOptions): void;
removeFolderToCount(folderId: string, sourceId: string): void;
get unreadCardCounters(): IUnreadCountersData;
set unreadCardCounters(data: IUnreadCountersData);
get unreadCardCountersChanged(): IBasicEvent<IUnreadCountersData>;
/**
* Устанавливает локальное значение счётчика
* @param folderId ИД Папки
* @param value Значение
* @param timestamp Если имеется существующий timestamp для локального значения и мы хотим использовать его
* @param shouldNotify Нужно ли оповещать другие вкладки об изменении
*/
setLocalCount(folderId: string, value: number, timestamp?: number, shouldNotify?: boolean): void;
protected onUpdateLocalCounts: (message: IRealTimeCommunicationMessage<ILocalCounterData>) => void;
incrementLocalCount(folderId: string, timestamp?: number, shouldNotify?: boolean): void;
decrementLocalCount(folderId: string, timestamp?: number, shouldNotify?: boolean): void;
getUnreadCardsCount(folderId: string): number | undefined;
protected Initialize(): void;
protected get serverResponseMessage(): string;
protected onFoldersToCountChanged(): void;
protected sendCurrentCountersToOtherTab: (messageItem: IRealTimeCommunicationMessage<string>) => void;
protected onReceivedCurrentCounters: (message: IRealTimeCommunicationMessage<IUnreadCountersData>) => void;
protected onConnected: (message: IRealTimeCommunicationMessage<any>) => void;
protected onSessionAwoken: () => void;
protected onSessionCreated: () => void;
protected onApplicationActivityRestored(): void;
refreshServerState(): void;
protected sendFoldersToService(preventAwakeOrCreateSession?: boolean): void;
protected sendFoldersToServer: (message: IRealTimeCommunicationMessage<any>, connection: signalR.HubConnection) => Promise<void>;
protected processResponse: (response: IRealTimeCommunicationMessage<UnreadCountersResponse>) => void;
protected getCurrentEmployee(): string;
}
/** @internal */
export declare class UnreadCountersResponse {
EmployeeId: string;
RealtimeSessionId: string;
ClientFolders: Array<ClientFolderCounter>;
}
export declare class ClientFolderCounter {
FolderId: string;
Counter?: number;
ForceVirtualFolderSearch?: boolean;
}