UNPKG

1.28 kBTypeScriptView Raw
1import type { BaseContext } from "../context/BaseContext.js";
2import type { Time } from "../type/Units.js";
3/**
4 * Assert that the statement is true, otherwise invoke the error.
5 * @param statement
6 * @param error The message which is passed into an Error
7 */
8export declare function assert(statement: boolean, error: string): asserts statement;
9/**
10 * Make sure that the given value is within the range
11 */
12export declare function assertRange(value: number, gte: number, lte?: number): void;
13/**
14 * Warn if the context is not running.
15 */
16export declare function assertContextRunning(context: BaseContext): void;
17/**
18 * Notify that the following block of code is occurring inside a Transport callback.
19 */
20export declare function enterScheduledCallback(insideCallback: boolean): void;
21/**
22 * Make sure that a time was passed into
23 */
24export declare function assertUsedScheduleTime(time?: Time): void;
25/**
26 * A basic logging interface
27 */
28interface Logger {
29 log: (args?: any[]) => void;
30 warn: (args?: any[]) => void;
31}
32/**
33 * Set the logging interface
34 */
35export declare function setLogger(logger: Logger): void;
36/**
37 * Log anything
38 */
39export declare function log(...args: any[]): void;
40/**
41 * Warn anything
42 */
43export declare function warn(...args: any[]): void;
44export {};