///
import * as ng from 'angular';
import * as moment from 'moment';
import { services } from 'typescript-angular-utilities';
import __array = services.array;
export declare var factoryName: string;
export interface IUser {
id: number;
name: string;
}
export interface IMessage {
id?: number;
message: string;
createdBy?: IUser;
createdDate?: moment.Moment;
isSystemNote?: boolean;
lastUpdatedDate?: moment.Moment;
lastUpdatedBy?: IUser;
edited?: boolean;
}
export interface IGetMessagesResult {
messages: IMessage[];
hasMoreMessages: boolean;
}
export interface IMessageLogDataService {
saveMessage(message: IMessage): ng.IPromise;
getMessages(startFrom: number, quantity: number): ng.IPromise;
deleteMessage(message: IMessage): ng.IPromise;
updateMessage(message: IMessage): ng.IPromise;
}
export interface IMessageLog {
addMessage(message: IMessage): ng.IPromise;
deleteMessage(message: IMessage): ng.IPromise;
updateMessage(message: IMessage): ng.IPromise;
visibleMessages: IMessage[];
getNextPage(): ng.IPromise;
getPreviousPage(): ng.IPromise;
getTopPage(): ng.IPromise;
refresh(): ng.IPromise;
hasForwardMessages: boolean;
hasBackwardMessages: boolean;
pageSize: number;
dataService: IMessageLogDataService;
busy: boolean;
}
export declare class MessageLog {
private arrayUtility;
private currentStartingMessage;
private _hasForwardMessages;
private _hasBackwardMessages;
private _pageSize;
private _dataService;
busy: boolean;
visibleMessages: IMessage[];
constructor(arrayUtility: __array.IArrayUtility);
pageSize: number;
readonly hasForwardMessages: boolean;
readonly hasBackwardMessages: boolean;
dataService: IMessageLogDataService;
addMessage(message: IMessage): ng.IPromise;
updateMessage(message: IMessage): ng.IPromise;
deleteMessage(message: IMessage): ng.IPromise;
getNextPage(): ng.IPromise;
getPreviousPage(): ng.IPromise;
getTopPage(): ng.IPromise;
refresh(): ng.IPromise;
private updateCurrentPage();
}
export interface IMessageLogFactory {
getInstance(): IMessageLog;
}
export declare function messageLogFactory(arrayUtility: __array.IArrayUtility): IMessageLogFactory;