mirror of
https://github.com/Tonejs/Tone.js
synced 2025-01-13 20:39:06 +00:00
Merge pull request #847 from vibertthio/fix-docs
Fix docs of class Tone
This commit is contained in:
commit
646330b485
2 changed files with 5 additions and 4 deletions
|
@ -16,7 +16,8 @@ import { log } from "./util/Debug";
|
|||
export interface BaseToneOptions { }
|
||||
|
||||
/**
|
||||
* @class Tone is the base class of all other classes.
|
||||
* Tone is the base class of all other classes.
|
||||
*
|
||||
* @category Core
|
||||
* @constructor
|
||||
*/
|
||||
|
|
|
@ -18,7 +18,7 @@ type ClassesWithoutSingletons = Omit<typeof Classes, "Transport" | "Destination"
|
|||
* The exported Tone object. Contains all of the classes that default
|
||||
* to the same context and contains a singleton Transport and Destination node.
|
||||
*/
|
||||
type Tone = {
|
||||
type ToneObject = {
|
||||
Transport: Transport;
|
||||
Destination: Destination;
|
||||
Listener: Listener;
|
||||
|
@ -39,7 +39,7 @@ function bindTypeClass(context: Context, type) {
|
|||
* Return an object with all of the classes bound to the passed in context
|
||||
* @param context The context to bind all of the nodes to
|
||||
*/
|
||||
export function fromContext(context: Context): Tone {
|
||||
export function fromContext(context: Context): ToneObject {
|
||||
|
||||
const classesWithContext: Partial<ClassesWithoutSingletons> = {};
|
||||
Object.keys(omitFromObject(Classes, ["Transport", "Destination", "Draw"])).map(key => {
|
||||
|
@ -56,7 +56,7 @@ export function fromContext(context: Context): Tone {
|
|||
}
|
||||
});
|
||||
|
||||
const toneFromContext: Tone = {
|
||||
const toneFromContext: ToneObject = {
|
||||
...(classesWithContext as ClassesWithoutSingletons),
|
||||
now: context.now.bind(context),
|
||||
immediate: context.immediate.bind(context),
|
||||
|
|
Loading…
Reference in a new issue