/// <reference types="angular" />
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<void>;
    getMessages(startFrom: number, quantity: number): ng.IPromise<IGetMessagesResult>;
    deleteMessage(message: IMessage): ng.IPromise<void>;
    updateMessage(message: IMessage): ng.IPromise<void>;
}
export interface IMessageLog {
    addMessage(message: IMessage): ng.IPromise<void>;
    deleteMessage(message: IMessage): ng.IPromise<void>;
    updateMessage(message: IMessage): ng.IPromise<void>;
    visibleMessages: IMessage[];
    getNextPage(): ng.IPromise<void>;
    getPreviousPage(): ng.IPromise<void>;
    getTopPage(): ng.IPromise<void>;
    refresh(): ng.IPromise<void>;
    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<void>;
    updateMessage(message: IMessage): ng.IPromise<void>;
    deleteMessage(message: IMessage): ng.IPromise<void>;
    getNextPage(): ng.IPromise<void>;
    getPreviousPage(): ng.IPromise<void>;
    getTopPage(): ng.IPromise<void>;
    refresh(): ng.IPromise<void>;
    private updateCurrentPage();
}
export interface IMessageLogFactory {
    getInstance(): IMessageLog;
}
export declare function messageLogFactory(arrayUtility: __array.IArrayUtility): IMessageLogFactory;
