import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@metamask/base-controller"; import { BaseController } from "@metamask/base-controller"; import type { Messenger } from "@metamask/messenger"; import type { LoggingControllerMethodActions } from "./LoggingController-method-action-types.mjs"; import type { Log } from "./logTypes/index.mjs"; /** * LogEntry is the entry that will be added to the logging controller state. * It consists of a entry key that must be on of the Log union types, and an * additional id and timestamp. */ export type LogEntry = { id: string; timestamp: number; log: Log; }; /** * Logging controller state * * @property logs - An object of logs indexed by their ids */ export type LoggingControllerState = { logs: { [id: string]: LogEntry; }; }; declare const name = "LoggingController"; export type LoggingControllerGetStateAction = ControllerGetStateAction; export type LoggingControllerActions = LoggingControllerGetStateAction | LoggingControllerMethodActions; export type LoggingControllerStateChangeEvent = ControllerStateChangeEvent; export type LoggingControllerEvents = LoggingControllerStateChangeEvent; export type LoggingControllerMessenger = Messenger; /** * Controller that manages a list of logs for signature requests. */ export declare class LoggingController extends BaseController { #private; /** * Creates a LoggingController instance. * * @param options - Constructor options * @param options.messenger - An instance of the Messenger * @param options.state - Initial state to set on this controller. * @param options.expiryTime - The number of milliseconds before we consider a log entry expired. */ constructor({ messenger, state, expiryTime, }: { messenger: LoggingControllerMessenger; state?: Partial; expiryTime?: number; }); /** * Add log to the state. * * @param log - Log to add to the controller */ add(log: Log): void; /** * Removes all log entries. */ clear(): void; } export {}; //# sourceMappingURL=LoggingController.d.mts.map