import { ILogEntry, IRPCMethod, IRPCReply, RPC } from '@mcph/miix-std/dist/internal';
import { Observable } from 'rxjs/Observable';
import { IMessage, Message } from './messages/message';
/**
 * IFilter can be passed to the ConsoleService to configure which messages
 * are displayed.
 */
export interface IFilter {
    /**
     * Map of message kinds, setting one to `false` will hide it.
     */
    kinds?: {
        [key in keyof typeof Message]?: boolean;
    };
    /**
     * Pattern to match against in the message text. Can be wrapped in slashes
     * to denote a regex.
     */
    pattern?: string;
}
export interface IMessageEntry {
    /**
     * The source message.
     */
    message: IMessage;
    /**
     * The time when the message was posted.
     */
    createdAt: Date;
    /**
     * Whether the user has seen this message yet (reset with `markRead()`)
     */
    hasSeen: boolean;
}
/**
 * The ConsoleService stores a log of data sent and received from the iframed
 * controls.
 */
export declare class ConsoleService {
    /**
     * Max number of messages to display in the console.
     */
    static maxMessages: number;
    /**
     * Observable store of console messages.
     */
    private readonly messages;
    /**
     * Currently connected RPC instance.
     */
    private rpc;
    /**
     * callToIframe records a call made into the iframed controls.
     */
    callToIframe(message: IRPCMethod<any>): void;
    /**
     * callFromIframe records a method call that the iframe made against us.
     */
    callFromIframe(message: IRPCMethod<any>): void;
    /**
     * replyToIframe records a reply made into the iframed controls.
     */
    replyToIframe(message: IRPCReply<any>): void;
    /**
     * replyFromIframe records a method reply that the iframe made against us.
     */
    replyFromIframe(message: IRPCReply<any>): void;
    /**
     * addLog records a log message the iframe sent to us.
     */
    addLog(entry: ILogEntry): void;
    /**
     * read returns a feed of messages filtered with the provided options.
     */
    read(filter?: IFilter): Observable<IMessageEntry[]>;
    /**
     * Returns the number of messages omitted by the provided filter.
     */
    omitted(filter?: IFilter): Observable<number>;
    /**
     * Wipes all messages from storage.
     */
    clear(): void;
    /**
     * Marks all messages as having been read.
     */
    markRead(): void;
    /**
     * Sends a command to the frame.
     */
    run(method: string, params: any): void;
    /**
     * Binds the console to read data from the RPC socket.
     */
    bindToRPC(rpc: RPC): void;
    /**
     * Tries to return the given message's paired friend. A method call if the
     * message is a reply, a method response if it's a call.
     */
    getPairMessage(message: IMessage): Readonly<IMessageEntry> | undefined;
    /**
     * A utility function that can be used in Angular *ngFor templates to
     * track messages.
     */
    trackBy: (message: IMessage) => string;
    /**
     * Adds the message to the console output.
     */
    private push(message);
    /**
     * Returns a function to test whether a message passes the filter.
     */
    private test(filter);
}
