import { Tone } from "../Tone"; import { TimeClass } from "../type/Time"; import { Frequency, Hertz, Seconds, Ticks, Time } from "../type/Units"; import { RecursivePartial } from "../util/Interface"; import { Context } from "./Context"; /** * A unit which process audio */ export interface ToneWithContextOptions { context: Context; } /** * The Base class for all nodes that have an AudioContext. */ export declare abstract class ToneWithContext extends Tone { /** * The context belonging to the node. */ readonly context: Context; /** * The default context to use if no AudioContext is passed in to the constructor. * Probably should not be set manually. Used internally. * @hidden */ readonly defaultContext?: Context; /** * Pass in a constructor as the first argument */ constructor(context?: Context); constructor(options?: Partial); static getDefaults(): ToneWithContextOptions; /** * Return the current time of the Context clock plus the lookAhead. */ now(): Seconds; /** * Return the current time of the Context clock without any lookAhead. */ immediate(): Seconds; /** * The duration in seconds of one sample. */ readonly sampleTime: Seconds; /** * The number of seconds of 1 processing block (128 samples) */ readonly blockTime: Seconds; /** * Convert the incoming time to seconds */ toSeconds(time?: Time): Seconds; /** * Convert the input to a frequency number */ toFrequency(freq: Frequency): Hertz; /** * Convert the input time into ticks */ toTicks(time?: Time | TimeClass): Ticks; /** * Get a subset of the properties which are in the partial props */ protected _getPartialProperties(props: Options): Partial; /** * Get the object's attributes. * @example * osc.get(); * //returns {"type" : "sine", "frequency" : 440, ...etc} */ get(): Options; /** * Set the parameters at once. Either pass in an * object mapping parameters to values, or to set a * single parameter, by passing in a string and value. * The last argument is an optional ramp time which * will ramp any signal values to their destination value * over the duration of the rampTime. * @param params * @example * //set values using an object * filter.set({ * "frequency" : 300, * "type" : "highpass" * }); */ set(props: RecursivePartial): this; }