UNPKG

1.67 kBTypeScriptView Raw
1export interface BaseToneOptions {
2}
3/**
4 * Tone is the base class of all other classes.
5 *
6 * @category Core
7 * @constructor
8 */
9export declare abstract class Tone {
10 /**
11 * The version number semver
12 */
13 static version: string;
14 /**
15 * The name of the class
16 */
17 protected abstract name: string;
18 /**
19 * Returns all of the default options belonging to the class.
20 */
21 static getDefaults(): BaseToneOptions;
22 /**
23 * Set this debug flag to log all events that happen in this class.
24 */
25 debug: boolean;
26 /**
27 * Prints the outputs to the console log for debugging purposes.
28 * Prints the contents only if either the object has a property
29 * called `debug` set to true, or a variable called TONE_DEBUG_CLASS
30 * is set to the name of the class.
31 * @example
32 * const osc = new Tone.Oscillator();
33 * // prints all logs originating from this oscillator
34 * osc.debug = true;
35 * // calls to start/stop will print in the console
36 * osc.start();
37 */
38 protected log(...args: any[]): void;
39 /**
40 * Indicates if the instance was disposed
41 */
42 private _wasDisposed;
43 /**
44 * disconnect and dispose.
45 */
46 dispose(): this;
47 /**
48 * Indicates if the instance was disposed. 'Disposing' an
49 * instance means that all of the Web Audio nodes that were
50 * created for the instance are disconnected and freed for garbage collection.
51 */
52 get disposed(): boolean;
53 /**
54 * Convert the class to a string
55 * @example
56 * const osc = new Tone.Oscillator();
57 * console.log(osc.toString());
58 */
59 toString(): string;
60}