|
@@ -1,136 +1,194 @@
|
|
|
declare namespace Vex {
|
|
|
- export module Flow {
|
|
|
- const RESOLUTION: any;
|
|
|
+ export module Flow {
|
|
|
+ const RESOLUTION: any;
|
|
|
|
|
|
- export class Formatter {
|
|
|
- constructor(opts?: any);
|
|
|
+ export class Formatter {
|
|
|
+ constructor(opts?: any);
|
|
|
|
|
|
- public hasMinTotalWidth: boolean;
|
|
|
- public minTotalWidth: number;
|
|
|
- public joinVoices(voices: Voice[]): void;
|
|
|
- public format(voices: Voice[], width: number): void;
|
|
|
- public preCalculateMinTotalWidth(voices: Voice[]): number;
|
|
|
- }
|
|
|
+ public hasMinTotalWidth: boolean;
|
|
|
+ public minTotalWidth: number;
|
|
|
|
|
|
- export class BoundingBox {
|
|
|
- constructor(x: number, y: number, w: number, h: number);
|
|
|
+ public joinVoices(voices: Voice[]): void;
|
|
|
|
|
|
- public mergeWith(bb: BoundingBox): BoundingBox;
|
|
|
- public getX(): number;
|
|
|
- public getY(): number;
|
|
|
- public getW(): number;
|
|
|
- public getH(): number;
|
|
|
- }
|
|
|
+ public format(voices: Voice[], width: number): void;
|
|
|
|
|
|
- export class Voice {
|
|
|
- constructor(time: any);
|
|
|
- public static Mode: any;
|
|
|
+ public preCalculateMinTotalWidth(voices: Voice[]): number;
|
|
|
+ }
|
|
|
|
|
|
- public getBoundingBox(): BoundingBox;
|
|
|
- public setStave(stave: Stave): Voice;
|
|
|
- public addTickables(notes: StaveNote[]): Voice;
|
|
|
- public addTickable(note: StaveNote): Voice;
|
|
|
- public setMode(mode: any): Voice;
|
|
|
- public draw(ctx: any, stave: Stave): void;
|
|
|
- }
|
|
|
+ export class BoundingBox {
|
|
|
+ constructor(x: number, y: number, w: number, h: number);
|
|
|
|
|
|
- export class StaveNote {
|
|
|
- constructor(note_struct: any);
|
|
|
+ public mergeWith(bb: BoundingBox): BoundingBox;
|
|
|
|
|
|
- public getNoteHeadBounds(): any;
|
|
|
- public getNoteHeadBeginX(): number;
|
|
|
- public getNoteHeadEndX(): number;
|
|
|
- public addAccidental(index: number, accidental: Accidental): StaveNote;
|
|
|
- public setStyle(style: any): void;
|
|
|
- }
|
|
|
+ public getX(): number;
|
|
|
|
|
|
- export class Stave {
|
|
|
- constructor(x: number, y: number, width: number, options: any);
|
|
|
-
|
|
|
- public setX(x: number): Stave;
|
|
|
- public setY(y: number): Stave;
|
|
|
- public getX(): number;
|
|
|
- public addClef(clefSpec: string, size: any, annotation: any, position: any): void;
|
|
|
- public setEndClef(clefSpec: string, size: any, annotation: any): void;
|
|
|
- public getModifiers(): StaveModifier[];
|
|
|
- public getYForGlyphs(): number;
|
|
|
- public getWidth(): number;
|
|
|
- public setWidth(width: number): Stave;
|
|
|
- public getNoteStartX(): number;
|
|
|
- public getNoteEndX(): number;
|
|
|
- public setNoteStartX(x: number): Stave;
|
|
|
- public setKeySignature(keySpec: any, cancelKeySpec: any, position: any): Stave;
|
|
|
- public format(): void;
|
|
|
- public getSpacingBetweenLines(): number;
|
|
|
- public getNumLines(): number;
|
|
|
- public getLineForY(y: number): number;
|
|
|
- public getModifiers(pos: any, cat: any): Clef[]; // FIXME
|
|
|
- public setContext(ctx: CanvasContext): Stave;
|
|
|
- public addModifier(mod: any, pos: any): void;
|
|
|
- public draw(): void;
|
|
|
- public addTimeSignature(sig: string): void;
|
|
|
- }
|
|
|
+ public getY(): number;
|
|
|
|
|
|
- export class Modifier {
|
|
|
- public static Position: any;
|
|
|
- public getCategory(): string;
|
|
|
- public getWidth(): number;
|
|
|
- public getPadding(index: number): number;
|
|
|
- }
|
|
|
+ public getW(): number;
|
|
|
|
|
|
- export class StaveModifier extends Modifier {}
|
|
|
+ public getH(): number;
|
|
|
+ }
|
|
|
|
|
|
- export class Clef extends StaveModifier {
|
|
|
- constructor(type: any);
|
|
|
+ export class Voice {
|
|
|
+ constructor(time: any);
|
|
|
|
|
|
- public static category: string;
|
|
|
- public static types: { [type: string]: any; } ;
|
|
|
- public glyph: any;
|
|
|
- public x: number;
|
|
|
- public stave: Stave;
|
|
|
+ public static Mode: any;
|
|
|
|
|
|
- public getBoundingBox(): BoundingBox;
|
|
|
- public setStave(stave: Stave): void;
|
|
|
- }
|
|
|
+ public getBoundingBox(): BoundingBox;
|
|
|
|
|
|
- export class Renderer {
|
|
|
- constructor(canvas: HTMLCanvasElement, backend: any);
|
|
|
+ public setStave(stave: Stave): Voice;
|
|
|
|
|
|
- public static Backends: any;
|
|
|
- public resize(a: number, b: number): void;
|
|
|
- public getContext(): CanvasContext;
|
|
|
- }
|
|
|
+ public addTickables(notes: StaveNote[]): Voice;
|
|
|
|
|
|
- export class TimeSignature {
|
|
|
- constructor(timeSpec: string, customPadding?: any);
|
|
|
- }
|
|
|
- export class KeySignature {
|
|
|
- constructor(keySpec: string, cancelKeySpec: string, alterKeySpec?: string);
|
|
|
- }
|
|
|
+ public addTickable(note: StaveNote): Voice;
|
|
|
|
|
|
- export class Accidental {
|
|
|
- constructor(type: string);
|
|
|
- }
|
|
|
+ public setMode(mode: any): Voice;
|
|
|
|
|
|
- export class Beam {
|
|
|
- constructor(notes: StaveNote[], auto_stem: boolean);
|
|
|
- public setContext(ctx: CanvasContext): Beam;
|
|
|
- public draw(): void;
|
|
|
- }
|
|
|
+ public draw(ctx: any, stave: Stave): void;
|
|
|
+ }
|
|
|
|
|
|
- export class CanvasContext {
|
|
|
- public scale(x: number, y: number): CanvasContext;
|
|
|
- }
|
|
|
+ export class StaveNote {
|
|
|
+ constructor(note_struct: any);
|
|
|
|
|
|
- export class StaveConnector {
|
|
|
- constructor(top: Stave, bottom: Stave);
|
|
|
- public static type: any;
|
|
|
- public setType(type: any): StaveConnector;
|
|
|
- public setContext(ctx: CanvasContext): StaveConnector;
|
|
|
- public draw(): void;
|
|
|
- }
|
|
|
+ public getNoteHeadBounds(): any;
|
|
|
+
|
|
|
+ public getNoteHeadBeginX(): number;
|
|
|
+
|
|
|
+ public getNoteHeadEndX(): number;
|
|
|
+
|
|
|
+ public addAccidental(index: number, accidental: Accidental): StaveNote;
|
|
|
+
|
|
|
+ public setStyle(style: any): void;
|
|
|
+ }
|
|
|
+
|
|
|
+ export class StaveTie {
|
|
|
+ constructor(notes_struct: any);
|
|
|
+
|
|
|
+ public setContext(ctx: CanvasContext): StaveTie;
|
|
|
+
|
|
|
+ public draw(): void;
|
|
|
+ }
|
|
|
+
|
|
|
+ export class Stave {
|
|
|
+ constructor(x: number, y: number, width: number, options: any);
|
|
|
+
|
|
|
+ public setX(x: number): Stave;
|
|
|
+
|
|
|
+ public setY(y: number): Stave;
|
|
|
+
|
|
|
+ public getX(): number;
|
|
|
+
|
|
|
+ public addClef(clefSpec: string, size: any, annotation: any, position: any): void;
|
|
|
+
|
|
|
+ public setEndClef(clefSpec: string, size: any, annotation: any): void;
|
|
|
+
|
|
|
+ public getModifiers(): StaveModifier[];
|
|
|
+
|
|
|
+ public getYForGlyphs(): number;
|
|
|
+
|
|
|
+ public getWidth(): number;
|
|
|
+
|
|
|
+ public setWidth(width: number): Stave;
|
|
|
+
|
|
|
+ public getNoteStartX(): number;
|
|
|
+
|
|
|
+ public getNoteEndX(): number;
|
|
|
+
|
|
|
+ public setNoteStartX(x: number): Stave;
|
|
|
|
|
|
- }
|
|
|
+ public setKeySignature(keySpec: any, cancelKeySpec: any, position: any): Stave;
|
|
|
+
|
|
|
+ public format(): void;
|
|
|
+
|
|
|
+ public getSpacingBetweenLines(): number;
|
|
|
+
|
|
|
+ public getNumLines(): number;
|
|
|
+
|
|
|
+ public getLineForY(y: number): number;
|
|
|
+
|
|
|
+ public getModifiers(pos: any, cat: any): Clef[]; // FIXME
|
|
|
+ public setContext(ctx: CanvasContext): Stave;
|
|
|
+
|
|
|
+ public addModifier(mod: any, pos: any): void;
|
|
|
+
|
|
|
+ public draw(): void;
|
|
|
+
|
|
|
+ public addTimeSignature(sig: string): void;
|
|
|
+ }
|
|
|
+
|
|
|
+ export class Modifier {
|
|
|
+ public static Position: any;
|
|
|
+
|
|
|
+ public getCategory(): string;
|
|
|
+
|
|
|
+ public getWidth(): number;
|
|
|
+
|
|
|
+ public getPadding(index: number): number;
|
|
|
+ }
|
|
|
+
|
|
|
+ export class StaveModifier extends Modifier {
|
|
|
+ }
|
|
|
+
|
|
|
+ export class Clef extends StaveModifier {
|
|
|
+ constructor(type: any);
|
|
|
+
|
|
|
+ public static category: string;
|
|
|
+ public static types: { [type: string]: any; };
|
|
|
+ public glyph: any;
|
|
|
+ public x: number;
|
|
|
+ public stave: Stave;
|
|
|
+
|
|
|
+ public getBoundingBox(): BoundingBox;
|
|
|
+
|
|
|
+ public setStave(stave: Stave): void;
|
|
|
+ }
|
|
|
+
|
|
|
+ export class Renderer {
|
|
|
+ constructor(canvas: HTMLCanvasElement, backend: any);
|
|
|
+
|
|
|
+ public static Backends: any;
|
|
|
+
|
|
|
+ public resize(a: number, b: number): void;
|
|
|
+
|
|
|
+ public getContext(): CanvasContext;
|
|
|
+ }
|
|
|
+
|
|
|
+ export class TimeSignature {
|
|
|
+ constructor(timeSpec: string, customPadding?: any);
|
|
|
+ }
|
|
|
+ export class KeySignature {
|
|
|
+ constructor(keySpec: string, cancelKeySpec: string, alterKeySpec?: string);
|
|
|
+ }
|
|
|
+
|
|
|
+ export class Accidental {
|
|
|
+ constructor(type: string);
|
|
|
+ }
|
|
|
+
|
|
|
+ export class Beam {
|
|
|
+ constructor(notes: StaveNote[], auto_stem: boolean);
|
|
|
+
|
|
|
+ public setContext(ctx: CanvasContext): Beam;
|
|
|
+
|
|
|
+ public draw(): void;
|
|
|
+ }
|
|
|
+
|
|
|
+ export class CanvasContext {
|
|
|
+ public scale(x: number, y: number): CanvasContext;
|
|
|
+ }
|
|
|
+
|
|
|
+ export class StaveConnector {
|
|
|
+ constructor(top: Stave, bottom: Stave);
|
|
|
+
|
|
|
+ public static type: any;
|
|
|
+
|
|
|
+ public setType(type: any): StaveConnector;
|
|
|
+
|
|
|
+ public setContext(ctx: CanvasContext): StaveConnector;
|
|
|
+
|
|
|
+ public draw(): void;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
declare module "vexflow" {
|