import { EventEmitter } from 'events';
import type { InjectedDependenciesParam, InjectedOptionsParam } from '.';
export interface BaseLog {
    message: string;
    createdAt: number;
    timestamp: number;
    isStdErr: boolean;
}
export interface ServiceLog extends BaseLog {
    isSystem: false;
    serviceId: number;
}
export interface SystemLog extends BaseLog {
    isSystem: true;
}
export type LogMessage = ServiceLog | SystemLog;
export interface LogsSubscription extends EventEmitter {
    unsubscribe(): void;
}
export interface LogsOptions {
    start?: number | string;
    count?: number | 'all';
}
declare const getLogs: ({ request, sdkInstance, }: InjectedDependenciesParam, opts: InjectedOptionsParam) => {
    /**
     * @typedef LogSubscription
     * @type {EventEmitter}
     * @memberof balena.logs
     *
     * @description
     * The log subscription emits events as log data arrives.
     * You can get a LogSubscription for a given device by calling `balena.logs.subscribe(deviceId)`
     */
    /**
     * @summary Unsubscribe from device logs
     * @name unsubscribe
     * @function
     * @public
     * @memberof balena.logs.LogSubscription
     *
     * @description
     * Disconnect from the logs feed and stop receiving any future events on this emitter.
     *
     * @example
     * logs.unsubscribe();
     */
    /**
     * @summary Event fired when a new line of log output is available
     * @event line
     * @memberof balena.logs.LogSubscription
     * @example
     * logs.on('line', function(line) {
     * 	console.log(line);
     * });
     */
    /**
     * @summary Event fired when an error has occured reading the device logs
     * @event error
     * @memberof balena.logs.LogSubscription
     * @example
     * logs.on('error', function(error) {
     * 	console.error(error);
     * });
     */
    /**
     * @summary Subscribe to device logs
     * @name subscribe
     * @function
     * @public
     * @memberof balena.logs
     *
     * @description
     * Connects to the stream of devices logs, returning a LogSubscription, which
     * can be used to listen for logs as they appear, line by line.
     *
     * @param {String|Number} uuidOrId - device uuid (string) or id (number)
     * @param {Object} [options] - options
     * @param {Number|'all'} [options.count=0] - number of historical messages to include (or 'all')
     * @param {Number|String} [options.start] - the timestamp or ISO Date string after which to retrieve historical messages. When specified, the count parameter needs to also be provided.
     * @fulfil {balena.logs.LogSubscription}
     * @returns {Promise<LogSubscription>}
     *
     * @example
     * balena.logs.subscribe('7cf02a69e4d34c9da573914963cf54fd').then(function(logs) {
     * 	logs.on('line', function(line) {
     * 		console.log(line);
     * 	});
     * });
     *
     * @example
     * balena.logs.subscribe(123).then(function(logs) {
     * 	logs.on('line', function(line) {
     * 		console.log(line);
     * 	});
     * });
     */
    subscribe(uuidOrId: string | number, options?: Pick<LogsOptions, "count"> | Required<LogsOptions>): Promise<LogsSubscription>;
    /**
     * @summary Get device logs history
     * @name history
     * @function
     * @public
     * @memberof balena.logs
     *
     * @description
     * Get an array of the latest log messages for a given device.
     *
     * @param {String|Number} uuidOrId - device uuid (string) or id (number)
     * @param {Object} [options] - options
     * @param {Number|'all'} [options.count=1000] - number of log messages to return (or 'all')
     * @param {Number|String} [options.start] - the timestamp or ISO Date string after which to retrieve historical messages
     * @fulfil {Object[]} - history lines
     * @returns {Promise}
     *
     * @example
     * balena.logs.history('7cf02a69e4d34c9da573914963cf54fd').then(function(lines) {
     * 	lines.forEach(function(line) {
     * 		console.log(line);
     * 	});
     * });
     *
     * @example
     * balena.logs.history(123).then(function(lines) {
     * 	lines.forEach(function(line) {
     * 		console.log(line);
     * 	});
     * });
     *
     * @example
     * const oneDayAgoTimestamp = Date.now() - 24*60*60*1000;
     * balena.logs.history('7cf02a69e4d34c9da573914963cf54fd', { start: oneDayAgoTimestamp }).then(function(lines) {
     * 	lines.forEach(function(line) {
     * 		console.log(line);
     * 	});
     * });
     *
     * @example
     * const oneDayAgoIsoDateString = new Date(Date.now() - 24*60*60*1000).toISOString();
     * balena.logs.history('7cf02a69e4d34c9da573914963cf54fd', { start: oneDayAgoIsoDateString }).then(function(lines) {
     * 	lines.forEach(function(line) {
     * 		console.log(line);
     * 	});
     * });
     */
    history(uuidOrId: string | number, options?: LogsOptions): Promise<LogMessage[]>;
};
export default getLogs;
