import { Display } from 'westfield-runtime-server'; import Globals from './Globals'; import { CompositorSession } from './index'; import { FrameDecoder } from './remotestreaming/buffer-decoder'; import Renderer from './render/Renderer'; import { UserShellApi } from './UserShellApi'; export interface LogFn { (obj: T, msg?: string, ...args: any[]): void; (msg: string, ...args: any[]): void; } export declare type GreenfieldLogger = { /** * Log at `'error'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line. * If more args follows `msg`, these will be used to format `msg` using `util.format`. * * @typeParam T: the interface of the object being serialized. Default is object. * @param obj: object to be serialized * @param msg: the log message to write * @param ...args: format string values when `msg` is a format string */ error: LogFn; /** * Log at `'warn'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line. * If more args follows `msg`, these will be used to format `msg` using `util.format`. * * @typeParam T: the interface of the object being serialized. Default is object. * @param obj: object to be serialized * @param msg: the log message to write * @param ...args: format string values when `msg` is a format string */ warn: LogFn; /** * Log at `'info'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line. * If more args follows `msg`, these will be used to format `msg` using `util.format`. * * @typeParam T: the interface of the object being serialized. Default is object. * @param obj: object to be serialized * @param msg: the log message to write * @param ...args: format string values when `msg` is a format string */ info: LogFn; /** * Log at `'debug'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line. * If more args follows `msg`, these will be used to format `msg` using `util.format`. * * @typeParam T: the interface of the object being serialized. Default is object. * @param obj: object to be serialized * @param msg: the log message to write * @param ...args: format string values when `msg` is a format string */ debug: LogFn; /** * Log at `'trace'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line. * If more args follows `msg`, these will be used to format `msg` using `util.format`. * * @typeParam T: the interface of the object being serialized. Default is object. * @param obj: object to be serialized * @param msg: the log message to write * @param ...args: format string values when `msg` is a format string */ trace: LogFn; }; declare class Session implements CompositorSession { readonly display: Display; readonly compositorSessionId: string; readonly logger: GreenfieldLogger; readonly globals: Globals; readonly renderer: Renderer; readonly userShell: UserShellApi; readonly frameDecoder: FrameDecoder; private constructor(); static create(sessionId?: string, logger?: GreenfieldLogger): Promise; terminate(): void; flush(): void; } export default Session;