@maxgraph/core
Version:
maxGraph is a fully client side JavaScript diagramming library that uses SVG and HTML for rendering.
96 lines (95 loc) • 2.96 kB
TypeScript
import MaxWindow from './MaxWindow.js';
import { KeyboardEventListener, MouseEventListener } from '../types.js';
/**
* A singleton class that implements a simple console.
*
* @category GUI
* @category Logging
*/
declare class MaxLog {
static textarea: HTMLTextAreaElement | null;
static window: MaxWindow;
static td: HTMLTableCellElement;
/**
* Initializes the DOM node for the console.
* This requires `document.body` to point to a non-null value.
* This is called from within setVisible if the log has not yet been initialized.
*/
static init(): void;
/**
* Specifies the name of the console window.
* @default 'Console'
*/
static consoleName: string;
/**
* Specified if the output for {@link enter} and {@link leave} should be visible in the console.
* @default false
*/
static TRACE: boolean;
/**
* Specifies if the output for {@link debug} should be visible in the console.
* @default true
*/
static DEBUG: boolean;
/**
* Specifies if the output for {@link warn} should be visible in the console.
* @default true
*/
static WARN: boolean;
/**
* Buffer for pre-initialized content.
*/
static buffer: string;
/**
* Writes the current navigator information to the console.
*/
static info(): void;
/**
* Adds a button to the console using the given label and function.
*/
static addButton(lab: string, funct: MouseEventListener | KeyboardEventListener): void;
/**
* Returns `true` if the console is visible.
*/
static isVisible(): boolean;
/**
* Shows the console.
*/
static show(): void;
/**
* Shows or hides the console.
*/
static setVisible(visible: boolean): void;
/**
* Writes the specified string to the console if {@link TRACE} is `true` and returns the current time in milliseconds.
*/
static enter(string: string): number | undefined;
/**
* Writes the specified string to the console if {@link TRACE} is `true` and computes the difference between the current
* time and t0 in milliseconds.
*
* @see {@link enter} for an example.
*/
static leave(string: string, t0?: number): void;
/**
* Adds all arguments to the console if {@link DEBUG} is enabled.
*/
static debug(...args: string[]): void;
/**
* Adds all arguments to the console if {@link TRACE} is enabled.
*/
static trace(...args: string[]): void;
/**
* Adds all arguments to the console if {@link WARN} is enabled.
*/
static warn(...args: string[]): void;
/**
* Adds the specified strings to the console.
*/
static write(...args: string[]): void;
/**
* Adds the specified strings to the console, appending a linefeed at the end of each string.
*/
static writeln(...args: string[]): void;
}
export default MaxLog;