From 5c69bdeb4541a496f65171559a5de025e6a126b3 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 26 Aug 2015 15:26:57 -0700 Subject: [PATCH 01/31] Add indexer to option constructors in 'winston'. --- winston/winston.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/winston/winston.d.ts b/winston/winston.d.ts index 954e3358b..c816a533a 100644 --- a/winston/winston.d.ts +++ b/winston/winston.d.ts @@ -98,6 +98,11 @@ declare module "winston" { * @type {(boolean|(err: Error) => void)} */ exitOnError?: any; + + // TODO: Need to make instances specific, + // and need to get options for each instance. + // Unfortunately, the documentation is unhelpful. + [optionName: string]: any; } export interface TransportStatic { @@ -141,6 +146,11 @@ declare module "winston" { raw?: boolean; name?: string; handleExceptions?: boolean; + + // TODO: Need to make instances specific, + // and need to get options for each instance. + // Unfortunately, the documentation is unhelpful. + [optionName: string]: any; } export interface QueryOptions { From 6ffcb6a8d6cab7413e60ed8390a7654dae996a0e Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 26 Aug 2015 17:33:49 -0700 Subject: [PATCH 02/31] Use 'namespace' keyword in 'vexflow'. --- vexflow/vexflow.d.ts | 68 ++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/vexflow/vexflow.d.ts b/vexflow/vexflow.d.ts index 1822c0c67..bba0c6a44 100644 --- a/vexflow/vexflow.d.ts +++ b/vexflow/vexflow.d.ts @@ -6,7 +6,7 @@ //inconsistent namespace: this is a helper funtion from tables.js and should not pollute the global namespace! declare function sanitizeDuration(duration : string) : string; -declare module Vex { +declare namespace Vex { function L(block : string, args : any[]) : void; function Merge(destination : T, source : Object) : T; @@ -90,7 +90,7 @@ declare module Vex { original_font_information? : {postscript_name : string, version_string : string, vendor_url : string, full_font_name : string, font_family_name : string, copyright : string, description : string, trademark : string, designer : string, designer_url : string, unique_font_identifier : string, license_url : string, license_description : string, manufacturer_name : string, font_sub_family_name : string}; } - module Flow { + namespace Flow { const RESOLUTION : number; @@ -137,7 +137,7 @@ declare module Vex { original_font_information : {postscript_name : string, version_string : string, vendor_url : string, full_font_name : string, font_family_name : string, copyright : string, description : string, trademark : string, designer : string, designer_url : string, unique_font_identifier : string, license_url : string, license_description : string, manufacturer_name : string, font_sub_family_name : string}; } - module Accidental { + namespace Accidental { const CATEGORY : string; } @@ -154,7 +154,7 @@ declare module Vex { static applyAccidentals(voices : Voice[], keySignature? : string) : void; } - export module Annotation { + namespace Annotation { const enum Justify {LEFT, CENTER, RIGHT, CENTER_STEM} const enum VerticalJustify {TOP, CENTER, BOTTOM, CENTER_STEM} const CATEGORY : string; @@ -172,7 +172,7 @@ declare module Vex { draw() : void; } - module Articulation { + namespace Articulation { const CATEGORY : string; } @@ -193,7 +193,7 @@ declare module Vex { draw() : void; } - export module Barline { + namespace Barline { const enum type {SINGLE, DOUBLE, END, REPEAT_BEGIN, REPEAT_END, REPEAT_BOTH, NONE} } @@ -228,7 +228,7 @@ declare module Vex { static generateBeams(notes : StemmableNote[], config? : {groups? : Fraction[], stem_direction? : number, beam_rests? : boolean, beam_middle_only? : boolean, show_stemlets? : boolean, maintain_stem_directions? : boolean}) : Beam[]; } - module Bend { + namespace Bend { const CATEGORY : string; } @@ -354,7 +354,7 @@ declare module Vex { draw() : void; } - export module Curve { + namespace Curve { const enum Position {NEAR_HEAD, NEAR_TOP} } @@ -368,7 +368,7 @@ declare module Vex { draw() : boolean; } - module Dot { + namespace Dot { const CATEGORY : string; } @@ -433,7 +433,7 @@ declare module Vex { parse(str : string) : Fraction; } - module FretHandFinger { + namespace FretHandFinger { const CATEGORY : string; } @@ -489,7 +489,7 @@ declare module Vex { draw() : void; } - module GraceNoteGroup { + namespace GraceNoteGroup { const CATEGORY : string; } @@ -531,7 +531,7 @@ declare module Vex { convertAccLines(clef : string, type : string) : void; } - export module Modifier { + namespace Modifier { const enum Position {LEFT, RIGHT, ABOVE, BELOW} const CATEGORY : string } @@ -570,7 +570,7 @@ declare module Vex { postFormat() : void; } - module Music { + namespace Music { const NUM_TONES : number; const roots : string[]; const root_values : number[]; @@ -600,7 +600,7 @@ declare module Vex { createScaleMap(keySignature : string) : {[rootName : string] : string}; } - module Note { + namespace Note { const CATEGORY : string; } @@ -687,7 +687,7 @@ declare module Vex { draw() : void; } - module Ornament { + namespace Ornament { const CATEGORY : string; } @@ -701,7 +701,7 @@ declare module Vex { draw() : void; } - export module PedalMarking { + namespace PedalMarking { const enum Styles {TEXT, BRACKET, MIXED} const GLYPHS : {[name : string] : {code : string, x_shift : number, y_shift : number}}; } @@ -760,7 +760,7 @@ declare module Vex { restore() : RaphaelContext; } - export module Renderer { + namespace Renderer { const enum Backends {CANVAS, RAPHAEL, SVG, VML} const enum LineEndType {NONE, UP, DOWN} } @@ -778,7 +778,7 @@ declare module Vex { getContext() : IRenderContext; } - export module Repetition { + namespace Repetition { const enum type {NONE, CODA_LEFT, CODA_RIGHT, SEGNO_LEFT, SEGNO_RIGHT, DC, DC_AL_CODA, DC_AL_FINE, DS, DS_AL_CODA, DS_AL_FINE, FINE} } @@ -847,7 +847,7 @@ declare module Vex { setConfigForLines(lines_configuration : {visible : boolean}[]) : Stave; } - export module StaveConnector { + namespace StaveConnector { const enum type {SINGLE_RIGHT, SINGLE_LEFT, SINGLE, DOUBLE, BRACE, BRACKET, BOLD_DOUBLE_LEFT, BOLD_DOUBLE_RIGHT, THIN_DOUBLE} } @@ -862,7 +862,7 @@ declare module Vex { drawBoldDoubleLine(ctx : Object, type : StaveConnector.type, topX : number, topY : number, botY : number) : void; } - export module StaveHairpin { + namespace StaveHairpin { const enum type {CRESC, DECRESC} } @@ -877,7 +877,7 @@ declare module Vex { draw() : boolean; } - export module StaveLine { + namespace StaveLine { const enum TextVerticalPosition {TOP, BOTTOM} const enum TextJustification {LEFT, CENTER, RIGHT} } @@ -907,7 +907,7 @@ declare module Vex { addEndModifier() : void; } - module StaveNote { + namespace StaveNote { const STEM_UP : number; const STEM_DOWN : number; const CATEGORY : string; @@ -1019,7 +1019,7 @@ declare module Vex { draw() : boolean; } - module Stem { + namespace Stem { const UP : number; const DOWN : number; } @@ -1071,7 +1071,7 @@ declare module Vex { drawStem(stem_struct : {x_begin? : number, x_end? : number, y_top? : number, y_bottom? : number, y_extend? : number, stem_extension? : number, stem_direction? : number}) : void; } - module StringNumber { + namespace StringNumber { const CATEGORY : string; } @@ -1096,7 +1096,7 @@ declare module Vex { draw() : void; } - export module Stroke { + namespace Stroke { const enum Type {BRUSH_DOWN, BRUSH_UP, ROLL_DOWN, ROLL_UP, RASQUEDO_DOWN, RASQUEDO_UP} const CATEGORY : string; } @@ -1175,7 +1175,7 @@ declare module Vex { draw() : void; } - module TabSlide { + namespace TabSlide { const SLIDE_UP : number; const SLIDE_DOWN : number; } @@ -1200,7 +1200,7 @@ declare module Vex { draw() : boolean; } - export module TextBracket { + namespace TextBracket { const enum Positions {TOP, BOTTOM} } @@ -1223,7 +1223,7 @@ declare module Vex { draw() : void; } - export module TextNote { + namespace TextNote { const enum Justification {LEFT, CENTER, RIGHT} const GLYPHS : {[name : string] : {code : string, point : number, x_shift : number, y_shift : number}} } @@ -1286,7 +1286,7 @@ declare module Vex { static getNextContext(tContext : TickContext) : TickContext; } - module TimeSignature { + namespace TimeSignature { const glyphs : {[name : string] : {code : string, point : number, line : number}}; } @@ -1321,7 +1321,7 @@ declare module Vex { draw() : void; } - module Tuning { + namespace Tuning { const names : {[name : string] : string}; } @@ -1334,7 +1334,7 @@ declare module Vex { getNoteForFret(fretNum : string, stringNum : string) : string; } - module Tuplet { + namespace Tuplet { const LOCATION_TOP : number; const LOCATION_BOTTOM : number; } @@ -1355,7 +1355,7 @@ declare module Vex { draw() : void; } - module Vibrato { + namespace Vibrato { const CATEGORY : string; } @@ -1366,7 +1366,7 @@ declare module Vex { draw() : void; } - export module Voice { + namespace Voice { const enum Mode {STRICT, SOFT, FULL} } @@ -1399,7 +1399,7 @@ declare module Vex { addVoice(voice : Voice) : void; } - export module Volta { + namespace Volta { const enum type {NONE, BEGIN, MID, END, BEGIN_END} } From f4b5bc37e4fd4cba6ae393f04b8b079fe1a024eb Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 26 Aug 2015 17:47:21 -0700 Subject: [PATCH 03/31] Fixed ordering of namespaces/classes to avoid errors from https://github.com/Microsoft/TypeScript/issues/4485 in 'vexflow'. --- vexflow/vexflow.d.ts | 250 +++++++++++++++++++++---------------------- 1 file changed, 125 insertions(+), 125 deletions(-) diff --git a/vexflow/vexflow.d.ts b/vexflow/vexflow.d.ts index bba0c6a44..c17e96576 100644 --- a/vexflow/vexflow.d.ts +++ b/vexflow/vexflow.d.ts @@ -137,10 +137,6 @@ declare namespace Vex { original_font_information : {postscript_name : string, version_string : string, vendor_url : string, full_font_name : string, font_family_name : string, copyright : string, description : string, trademark : string, designer : string, designer_url : string, unique_font_identifier : string, license_url : string, license_description : string, manufacturer_name : string, font_sub_family_name : string}; } - namespace Accidental { - const CATEGORY : string; - } - class Accidental extends Modifier { //TODO remove the following lines once TypeScript allows subclass overrides with type changes setNote(note : Note) : Modifier; @@ -154,9 +150,7 @@ declare namespace Vex { static applyAccidentals(voices : Voice[], keySignature? : string) : void; } - namespace Annotation { - const enum Justify {LEFT, CENTER, RIGHT, CENTER_STEM} - const enum VerticalJustify {TOP, CENTER, BOTTOM, CENTER_STEM} + namespace Accidental { const CATEGORY : string; } @@ -172,7 +166,9 @@ declare namespace Vex { draw() : void; } - namespace Articulation { + namespace Annotation { + const enum Justify {LEFT, CENTER, RIGHT, CENTER_STEM} + const enum VerticalJustify {TOP, CENTER, BOTTOM, CENTER_STEM} const CATEGORY : string; } @@ -183,6 +179,10 @@ declare namespace Vex { draw() : void; } + namespace Articulation { + const CATEGORY : string; + } + class BarNote extends Note { static DEBUG : boolean; getType() : Barline.type; @@ -228,10 +228,6 @@ declare namespace Vex { static generateBeams(notes : StemmableNote[], config? : {groups? : Fraction[], stem_direction? : number, beam_rests? : boolean, beam_middle_only? : boolean, show_stemlets? : boolean, maintain_stem_directions? : boolean}) : Beam[]; } - namespace Bend { - const CATEGORY : string; - } - class Bend extends Modifier { constructor(text : string, release? : boolean, phrase? : {type : number, text : string, width : number}[]); static UP : number; @@ -244,6 +240,10 @@ declare namespace Vex { draw() : void; } + namespace Bend { + const CATEGORY : string; + } + class BoundingBox { constructor(x : number, y : number, w : number, h : number); static copy(that : BoundingBox) : BoundingBox; @@ -354,10 +354,6 @@ declare namespace Vex { draw() : void; } - namespace Curve { - const enum Position {NEAR_HEAD, NEAR_TOP} - } - class Curve { constructor(from : Note, to : Note, options? : {spacing? : number, thickness? : number, x_shift? : number, y_shift : number, position : Curve.Position, invert : boolean, cps? : {x : number, y : number}[]}); static DEBUG : boolean; @@ -368,8 +364,8 @@ declare namespace Vex { draw() : boolean; } - namespace Dot { - const CATEGORY : string; + namespace Curve { + const enum Position {NEAR_HEAD, NEAR_TOP} } class Dot extends Modifier { @@ -382,6 +378,10 @@ declare namespace Vex { draw() : void; } + namespace Dot { + const CATEGORY : string; + } + class Formatter { static DEBUG : boolean; static FormatAndDraw(ctx : IRenderContext, stave : Stave, notes : Note[], params? : {auto_beam : boolean, align_rests : boolean}) : BoundingBox; @@ -433,10 +433,6 @@ declare namespace Vex { parse(str : string) : Fraction; } - namespace FretHandFinger { - const CATEGORY : string; - } - class FretHandFinger extends Modifier { constructor(number : number); static format(nums : FretHandFinger[], state : {left_shift : number, right_shift : number, text_line : number}) : void; @@ -452,6 +448,10 @@ declare namespace Vex { draw() : void; } + namespace FretHandFinger { + const CATEGORY : string; + } + class GhostNote extends StemmableNote { //TODO remove the following lines once TypeScript allows subclass overrides with type changes or type inconsistencies mentioned below are fixed setStave(stave : Stave) : Note; @@ -489,10 +489,6 @@ declare namespace Vex { draw() : void; } - namespace GraceNoteGroup { - const CATEGORY : string; - } - class GraceNoteGroup extends Modifier { //TODO remove the following lines once TypeScript allows subclass overrides with type changes or type inconsistencies mentioned below are fixed setWidth(width : number) : Modifier; @@ -510,6 +506,10 @@ declare namespace Vex { draw() : void; } + namespace GraceNoteGroup { + const CATEGORY : string; + } + class KeyManager { constructor(key : string); setKey(key : string) : KeyManager; @@ -531,11 +531,6 @@ declare namespace Vex { convertAccLines(clef : string, type : string) : void; } - namespace Modifier { - const enum Position {LEFT, RIGHT, ABOVE, BELOW} - const CATEGORY : string - } - class Modifier { static DEBUG : boolean; getCategory() : string; @@ -557,6 +552,11 @@ declare namespace Vex { draw() : void; } + namespace Modifier { + const enum Position {LEFT, RIGHT, ABOVE, BELOW} + const CATEGORY : string + } + class ModifierContext { static DEBUG : boolean; addModifier(modifier : Modifier) : ModifierContext; @@ -570,20 +570,6 @@ declare namespace Vex { postFormat() : void; } - namespace Music { - const NUM_TONES : number; - const roots : string[]; - const root_values : number[]; - const root_indices : {[root : string] : number}; - const canonical_notes : string[]; - const diatonic_intervals : string[]; - const diatonic_accidentals : {[diatonic_interval : string] : {note : number, accidental : number}}; - const intervals : {[interval : string] : number}; - const scales : {[scale : string] : number[]}; - const accidentals : string[]; - const noteValues : {[value : string] : {root_index : number, int_val : number}}; - } - class Music { isValidNoteValue(note : number) : boolean; isValidIntervalValue(interval : number) : boolean; @@ -600,8 +586,18 @@ declare namespace Vex { createScaleMap(keySignature : string) : {[rootName : string] : string}; } - namespace Note { - const CATEGORY : string; + namespace Music { + const NUM_TONES : number; + const roots : string[]; + const root_values : number[]; + const root_indices : {[root : string] : number}; + const canonical_notes : string[]; + const diatonic_intervals : string[]; + const diatonic_accidentals : {[diatonic_interval : string] : {note : number, accidental : number}}; + const intervals : {[interval : string] : number}; + const scales : {[scale : string] : number[]}; + const accidentals : string[]; + const noteValues : {[value : string] : {root_index : number, int_val : number}}; } class Note implements Tickable { @@ -664,6 +660,10 @@ declare namespace Vex { setPreFormatted(value : boolean) : void; } + namespace Note { + const CATEGORY : string; + } + class NoteHead extends Note { constructor(head_options : {x? : number, y? : number, note_type? : string, duration : string, displaced? : boolean, stem_direction? : number, line : number, x_shift : number, custom_glyph_code? : string, style? : string, slashed? : boolean, glyph_font_scale? : number}); static DEBUG : boolean; @@ -687,10 +687,6 @@ declare namespace Vex { draw() : void; } - namespace Ornament { - const CATEGORY : string; - } - class Ornament extends Modifier { constructor(type : string); static DEBUG : boolean; @@ -701,9 +697,8 @@ declare namespace Vex { draw() : void; } - namespace PedalMarking { - const enum Styles {TEXT, BRACKET, MIXED} - const GLYPHS : {[name : string] : {code : string, x_shift : number, y_shift : number}}; + namespace Ornament { + const CATEGORY : string; } class PedalMarking { @@ -721,6 +716,11 @@ declare namespace Vex { draw() : void; } + namespace PedalMarking { + const enum Styles {TEXT, BRACKET, MIXED} + const GLYPHS : {[name : string] : {code : string, x_shift : number, y_shift : number}}; + } + class RaphaelContext implements IRenderContext { //TODO remove the following lines once TypeScript allows subclass overrides with type changes or type inconsistencies mentioned below are fixed setLineWidth(width : number) : RaphaelContext; @@ -760,11 +760,6 @@ declare namespace Vex { restore() : RaphaelContext; } - namespace Renderer { - const enum Backends {CANVAS, RAPHAEL, SVG, VML} - const enum LineEndType {NONE, UP, DOWN} - } - class Renderer { constructor(sel : HTMLElement, backend : Renderer.Backends) static USE_CANVAS_PROXY : boolean; @@ -778,8 +773,9 @@ declare namespace Vex { getContext() : IRenderContext; } - namespace Repetition { - const enum type {NONE, CODA_LEFT, CODA_RIGHT, SEGNO_LEFT, SEGNO_RIGHT, DC, DC_AL_CODA, DC_AL_FINE, DS, DS_AL_CODA, DS_AL_FINE, FINE} + namespace Renderer { + const enum Backends {CANVAS, RAPHAEL, SVG, VML} + const enum LineEndType {NONE, UP, DOWN} } class Repetition extends StaveModifier { @@ -792,6 +788,10 @@ declare namespace Vex { drawSignoFixed(stave : Stave, x : number) : Repetition; //inconsistent name: drawSignoFixed -> drawSegnoFixed drawSymbolText(stave : Stave, x : number, text : string, draw_coda : boolean) : Repetition; } + + namespace Repetition { + const enum type { NONE, CODA_LEFT, CODA_RIGHT, SEGNO_LEFT, SEGNO_RIGHT, DC, DC_AL_CODA, DC_AL_FINE, DS, DS_AL_CODA, DS_AL_FINE, FINE } + } class Stave { constructor(x : number, y : number, width : number, options? : {vertical_bar_width? : number, glyph_spacing_px? : number, num_lines? : number, fill_style? : string, spacing_between_lines_px? : number, space_above_staff_ln? : number, space_below_staff_ln? : number, top_text_position? : number}); @@ -847,10 +847,6 @@ declare namespace Vex { setConfigForLines(lines_configuration : {visible : boolean}[]) : Stave; } - namespace StaveConnector { - const enum type {SINGLE_RIGHT, SINGLE_LEFT, SINGLE, DOUBLE, BRACE, BRACKET, BOLD_DOUBLE_LEFT, BOLD_DOUBLE_RIGHT, THIN_DOUBLE} - } - class StaveConnector { constructor(top_stave : Stave, bottom_stave : Stave); setContext(ctx : IRenderContext) : StaveConnector; @@ -861,9 +857,9 @@ declare namespace Vex { draw() : void; drawBoldDoubleLine(ctx : Object, type : StaveConnector.type, topX : number, topY : number, botY : number) : void; } - - namespace StaveHairpin { - const enum type {CRESC, DECRESC} + + namespace StaveConnector { + const enum type { SINGLE_RIGHT, SINGLE_LEFT, SINGLE, DOUBLE, BRACE, BRACKET, BOLD_DOUBLE_LEFT, BOLD_DOUBLE_RIGHT, THIN_DOUBLE } } class StaveHairpin { @@ -876,10 +872,9 @@ declare namespace Vex { renderHairpin(params : {first_x : number, last_x : number, first_y : number, last_y : number, staff_height : number}) : void; draw() : boolean; } - - namespace StaveLine { - const enum TextVerticalPosition {TOP, BOTTOM} - const enum TextJustification {LEFT, CENTER, RIGHT} + + namespace StaveHairpin { + const enum type { CRESC, DECRESC } } class StaveLine { @@ -896,6 +891,11 @@ declare namespace Vex { render_options : {padding_left : number, padding_right : number, line_width : number, line_dash : number[], rounded_end : boolean, color : string, draw_start_arrow : boolean, draw_end_arrow : boolean, arrowhead_length : number, arrowhead_angle : number, text_position_vertical : StaveLine.TextVerticalPosition, text_justification : StaveLine.TextJustification}; } + namespace StaveLine { + const enum TextVerticalPosition { TOP, BOTTOM } + const enum TextJustification { LEFT, CENTER, RIGHT } + } + class StaveModifier { getCategory() : string; makeSpacer(padding : number) : {getContext: Function, setStave: Function, renderToStave: Function, getMetrics: Function}; @@ -907,12 +907,6 @@ declare namespace Vex { addEndModifier() : void; } - namespace StaveNote { - const STEM_UP : number; - const STEM_DOWN : number; - const CATEGORY : string; - } - class StaveNote extends StemmableNote { //TODO remove the following lines once TypeScript allows subclass overrides with type changes and/or inconsistencies mentioned below are fixed buildStem() : StemmableNote; @@ -972,6 +966,12 @@ declare namespace Vex { drawStem(struct : {x_begin? : number, x_end? : number, y_top? : number, y_bottom? : number, y_extend? : number, stem_extension? : number, stem_direction? : number}) : void; draw() : void; } + + namespace StaveNote { + const STEM_UP: number; + const STEM_DOWN: number; + const CATEGORY: string; + } class StaveSection extends Modifier { //TODO remove the following lines once TypeScript allows subclass overrides with type changes @@ -1019,11 +1019,6 @@ declare namespace Vex { draw() : boolean; } - namespace Stem { - const UP : number; - const DOWN : number; - } - class Stem { constructor(options : {x_begin? : number, x_end? : number, y_top? : number, y_bottom? : number, y_extend? : number, stem_extension? : number, stem_direction? : number}); static DEBUG : boolean; @@ -1044,6 +1039,11 @@ declare namespace Vex { //inconsistent API: this should be set via the options object in the constructor hide : boolean; } + + namespace Stem { + const UP: number; + const DOWN: number; + } class StemmableNote extends Note { //TODO remove the following lines once TypeScript allows subclass overrides with type changes @@ -1071,10 +1071,6 @@ declare namespace Vex { drawStem(stem_struct : {x_begin? : number, x_end? : number, y_top? : number, y_bottom? : number, y_extend? : number, stem_extension? : number, stem_direction? : number}) : void; } - namespace StringNumber { - const CATEGORY : string; - } - class StringNumber extends Modifier { //TODO remove the following lines once TypeScript allows subclass overrides with type changes setNote(note : Note) : StringNumber; @@ -1095,10 +1091,9 @@ declare namespace Vex { setDashed(dashed : boolean) : StringNumber; draw() : void; } - - namespace Stroke { - const enum Type {BRUSH_DOWN, BRUSH_UP, ROLL_DOWN, ROLL_UP, RASQUEDO_DOWN, RASQUEDO_UP} - const CATEGORY : string; + + namespace StringNumber { + const CATEGORY: string; } class Stroke extends Modifier { @@ -1109,6 +1104,11 @@ declare namespace Vex { draw() : void; } + namespace Stroke { + const enum Type {BRUSH_DOWN, BRUSH_UP, ROLL_DOWN, ROLL_UP, RASQUEDO_DOWN, RASQUEDO_UP} + const CATEGORY : string; + } + class SVGContext implements IRenderContext { constructor(element : HTMLElement); iePolyfill() : boolean; @@ -1175,11 +1175,6 @@ declare namespace Vex { draw() : void; } - namespace TabSlide { - const SLIDE_UP : number; - const SLIDE_DOWN : number; - } - class TabSlide extends TabTie { constructor(notes : {first_note: Note, last_note: Note, first_indices : number[], last_indices : number[]}, direction? : number); static createSlideUp(notes : {first_note: Note, last_note: Note, first_indices : number[], last_indices : number[]}) : TabSlide; @@ -1187,6 +1182,11 @@ declare namespace Vex { renderTie(params : {first_ys : number[], last_ys : number[], last_x_px : number, first_x_px : number, direction : number}) : void; } + namespace TabSlide { + const SLIDE_UP : number; + const SLIDE_DOWN : number; + } + class TabStave extends Stave { constructor(x : number, y : number, width : number, options? : {vertical_bar_width? : number, glyph_spacing_px? : number, num_lines? : number, fill_style? : string, spacing_between_lines_px? : number, space_above_staff_ln? : number, space_below_staff_ln? : number, top_text_position? : number}); getYForGlyphs() : number; @@ -1200,10 +1200,6 @@ declare namespace Vex { draw() : boolean; } - namespace TextBracket { - const enum Positions {TOP, BOTTOM} - } - class TextBracket { constructor(bracket_data : {start : Note, stop : Note, text? : string, superscript? : string, position? : TextBracket.Positions}); static DEBUG : boolean; @@ -1215,6 +1211,10 @@ declare namespace Vex { draw() : void; } + namespace TextBracket { + const enum Positions {TOP, BOTTOM} + } + class TextDynamics extends Note { constructor(text_struct : {duration : string, text : string, line? : number}); static DEBUG : boolean; @@ -1222,11 +1222,6 @@ declare namespace Vex { preFormat() : TextDynamics; draw() : void; } - - namespace TextNote { - const enum Justification {LEFT, CENTER, RIGHT} - const GLYPHS : {[name : string] : {code : string, point : number, x_shift : number, y_shift : number}} - } class TextNote extends Note { constructor(text_struct : {duration : string, text? : string, superscript? : boolean, subscript? : boolean, glyph? : string, font? : {family : string, size : number, weight : string}, line? : number, smooth? : boolean, ignore_ticks? : boolean}); @@ -1236,6 +1231,11 @@ declare namespace Vex { draw() : void; } + namespace TextNote { + const enum Justification {LEFT, CENTER, RIGHT} + const GLYPHS : {[name : string] : {code : string, point : number, x_shift : number, y_shift : number}} + } + interface Tickable { setContext(context : IRenderContext) : void; getBoundingBox() : BoundingBox; @@ -1286,10 +1286,6 @@ declare namespace Vex { static getNextContext(tContext : TickContext) : TickContext; } - namespace TimeSignature { - const glyphs : {[name : string] : {code : string, point : number, line : number}}; - } - class TimeSignature extends StaveModifier { //TODO remove the following lines once TypeScript allows subclass overrides with type changes addModifier() : void; @@ -1303,6 +1299,10 @@ declare namespace Vex { addEndModifier(stave : Stave) : void; } + namespace TimeSignature { + const glyphs : {[name : string] : {code : string, point : number, line : number}}; + } + class TimeSigNote extends Note { //TODO remove the following lines once TypeScript allows subclass overrides with type changes or type inconsistencies mentioned below are fixed setStave(stave : Stave) : Note; @@ -1321,10 +1321,6 @@ declare namespace Vex { draw() : void; } - namespace Tuning { - const names : {[name : string] : string}; - } - class Tuning { constructor(tuningString? : string); noteToInteger(noteString : string) : number; @@ -1334,9 +1330,8 @@ declare namespace Vex { getNoteForFret(fretNum : string, stringNum : string) : string; } - namespace Tuplet { - const LOCATION_TOP : number; - const LOCATION_BOTTOM : number; + namespace Tuning { + const names: { [name: string]: string }; } class Tuplet { @@ -1354,9 +1349,10 @@ declare namespace Vex { resolveGlyphs() : void; draw() : void; } - - namespace Vibrato { - const CATEGORY : string; + + namespace Tuplet { + const LOCATION_TOP : number; + const LOCATION_BOTTOM : number; } class Vibrato extends Modifier { @@ -1366,8 +1362,8 @@ declare namespace Vex { draw() : void; } - namespace Voice { - const enum Mode {STRICT, SOFT, FULL} + namespace Vibrato { + const CATEGORY : string; } class Voice { @@ -1393,21 +1389,25 @@ declare namespace Vex { draw(context : IRenderContext, stave? : Stave) : void; } + namespace Voice { + const enum Mode {STRICT, SOFT, FULL} + } + class VoiceGroup { getVoices() : Voice[]; getModifierContexts() : ModifierContext[]; addVoice(voice : Voice) : void; } - namespace Volta { - const enum type {NONE, BEGIN, MID, END, BEGIN_END} - } - class Volta extends StaveModifier { constructor(type : Volta.type, number : number, x : number, y_shift : number); getCategory() : string; setShiftY(y : number) : Volta; draw(stave : Stave, x : number) : Volta; } + + namespace Volta { + const enum type {NONE, BEGIN, MID, END, BEGIN_END} + } } } \ No newline at end of file From 4d9af200a7d28cac4aece6660702294064cc03ca Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 26 Aug 2015 17:48:02 -0700 Subject: [PATCH 04/31] Removed undocumented property in object literal in test for 'vexflow'. --- vexflow/vexflow-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vexflow/vexflow-tests.ts b/vexflow/vexflow-tests.ts index 351ad2ee8..742e3b00f 100644 --- a/vexflow/vexflow-tests.ts +++ b/vexflow/vexflow-tests.ts @@ -32,7 +32,7 @@ var gracenote = new Vex.Flow.GraceNote({keys: ["e/5"], duration: "16", slash: tr notes1[2].addModifier(0, new Vex.Flow.GraceNoteGroup([gracenote], true).beamNotes()); // Color the chord -notes1[3].setStyle({fillStyle: "blue", strokeStyle: "blue", stemStyle: "blue"}); +notes1[3].setStyle({fillStyle: "blue", strokeStyle: "blue"}); // Create a voice in 4/4 and add notes var voice1 = new Vex.Flow.Voice({ From d02c586416f77c441a6891df71700998e82b9e96 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 26 Aug 2015 17:51:47 -0700 Subject: [PATCH 05/31] Fixed misspelled property for test of 'tedious-connection-pool'. --- tedious-connection-pool/tedious-connection-pool-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tedious-connection-pool/tedious-connection-pool-tests.ts b/tedious-connection-pool/tedious-connection-pool-tests.ts index aef2c9f60..60ca44d7e 100644 --- a/tedious-connection-pool/tedious-connection-pool-tests.ts +++ b/tedious-connection-pool/tedious-connection-pool-tests.ts @@ -16,7 +16,7 @@ var config: tedious.ConnectionConfig = { server: "127.0.0.1", options: { database: "somedb", - instance: "someinstance" + instanceName: "someinstance" } }; From 14c1dd16fe740802cf772e9818284e4b89b59b14 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 26 Aug 2015 17:54:35 -0700 Subject: [PATCH 06/31] Add 'enclosure' property to 'podcast'. --- podcast/podcast.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/podcast/podcast.d.ts b/podcast/podcast.d.ts index cfe4766ad..c4e280d2d 100644 --- a/podcast/podcast.d.ts +++ b/podcast/podcast.d.ts @@ -64,6 +64,12 @@ interface IItemOptions date: Date; lat?: number; long?: number; + enclosure?: { + url: string; + file?: string; + size?: number; + mime?: string; + } itunesAuthor?: string; itunesExplicit?: boolean; itunesSubtitle?: string; From 85df2c157bd54fea536626066bda175c0a46cbad Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 26 Aug 2015 18:17:43 -0700 Subject: [PATCH 07/31] Fixed params for 'ui' in 'fbsdk'. --- fbsdk/fbsdk.d.ts | 59 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/fbsdk/fbsdk.d.ts b/fbsdk/fbsdk.d.ts index eb3f23269..8e575632b 100644 --- a/fbsdk/fbsdk.d.ts +++ b/fbsdk/fbsdk.d.ts @@ -15,10 +15,65 @@ interface FBInitParams{ xfbml ?: boolean; } -interface FBUIParams{ - method : string; +interface ShareDialogParams { + method: string; // "share" + href: string; } +interface PageTabDialogParams { + method: string; // "pagetab" + app_id: string; + redirect_uri?: string; + display?: any; +} + +interface RequestsDialogParams { + method: string; // "apprequests" + app_id: string; + redirect_uri?: string; + to?: string; + message: string; + action_type?: string; // "send" | "askfor" | "turn" + object_id?: string; + filters: string /* "app_users" | "app_non_users" */ | { + name: string; + user_ids: string[]; + }; + suggestions?: string[]; + exclude_ids?: string[]; + max_recipients?: number; + data?: string; + title?: string; +} + +interface SendDialogParams { + method: string; // "send" + app_id: string; + redirect_uri?: string; + display?: any; + to?: string; + link: string; +} + +interface PayDialogParams { + method: string; // "pay" + action: string; // "purchaseitem" + product: string; + quantity?: number; + quantity_min?: number; + quantity_max?: number; + request_id?: string; + pricepoint_id?: string; + test_currency?: string; +} + +// TODO: add login dialog, which isn't well-documented at all +declare type FBUIParams = ShareDialogParams + | PageTabDialogParams + | RequestsDialogParams + | SendDialogParams + | PayDialogParams; + interface FBLoginOptions{ auth_type ?: string; scope ?: string; From 2309ef1c42a670a32ece5121d6bd8687af6e58ed Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 26 Aug 2015 18:19:09 -0700 Subject: [PATCH 08/31] Tabs to spaces, removed spaces before question marks in 'fbsdk'. --- fbsdk/fbsdk-tests.ts | 46 +++++++------- fbsdk/fbsdk.d.ts | 148 +++++++++++++++++++++---------------------- 2 files changed, 97 insertions(+), 97 deletions(-) diff --git a/fbsdk/fbsdk-tests.ts b/fbsdk/fbsdk-tests.ts index e359369ad..8ec38d8bc 100644 --- a/fbsdk/fbsdk-tests.ts +++ b/fbsdk/fbsdk-tests.ts @@ -1,29 +1,29 @@ /// window.fbAsyncInit = function() { - FB.init( - { - appId : '{your-app-id}', - xfbml : true, - version : 'v2.0' - } - ); + FB.init( + { + appId : '{your-app-id}', + xfbml : true, + version : 'v2.0' + } + ); - FB.ui( - { - method: 'share', - href: 'https://developers.facebook.com/docs/dialogs/' - }, - function(response) { - console.log(response); - } - ); + FB.ui( + { + method: 'share', + href: 'https://developers.facebook.com/docs/dialogs/' + }, + function(response) { + console.log(response); + } + ); - FB.api( - "/me", - "POST", - function (fbResponse){ - console.log(fbResponse); - } - ); + FB.api( + "/me", + "POST", + function (fbResponse){ + console.log(fbResponse); + } + ); }; \ No newline at end of file diff --git a/fbsdk/fbsdk.d.ts b/fbsdk/fbsdk.d.ts index 8e575632b..8ecdbbdf8 100644 --- a/fbsdk/fbsdk.d.ts +++ b/fbsdk/fbsdk.d.ts @@ -4,15 +4,15 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped interface FBInitParams{ - appId ?: string; - authResponse ?: string; - cookie ?: boolean; - frictionlessRequests ?: boolean; - hideFlashCallback ?: Function; - logging ?: boolean; - status ?: boolean; - version ?: string; - xfbml ?: boolean; + appId?: string; + authResponse?: string; + cookie?: boolean; + frictionlessRequests?: boolean; + hideFlashCallback?: Function; + logging?: boolean; + status?: boolean; + version?: string; + xfbml?: boolean; } interface ShareDialogParams { @@ -75,116 +75,116 @@ declare type FBUIParams = ShareDialogParams | PayDialogParams; interface FBLoginOptions{ - auth_type ?: string; - scope ?: string; - return_scopes ?: boolean; - enable_profile_selector ?: boolean; - profile_selector_ids ?: string; + auth_type?: string; + scope?: string; + return_scopes?: boolean; + enable_profile_selector?: boolean; + profile_selector_ids?: string; } interface FBSDKEvents{ - /* This method allows you to subscribe to a range of events, and define callback functions for when they fire. */ - subscribe(event : string, callback : (fbResponseObject : Object) => any) : void; + /* This method allows you to subscribe to a range of events, and define callback functions for when they fire. */ + subscribe(event : string, callback : (fbResponseObject : Object) => any) : void; - /* This method allows you to un-subscribe a callback from any events previously subscribed to using .Event.subscribe(). */ - unsubscribe(event : string, callback : (fbResponseObject : Object) => any) : void; + /* This method allows you to un-subscribe a callback from any events previously subscribed to using .Event.subscribe(). */ + unsubscribe(event : string, callback : (fbResponseObject : Object) => any) : void; } interface FBSDKXFBML{ - /* This function parses and renders XFBML markup in a document on the fly. */ - parse(ParseElement ?: Element) : void; - parse(ParseElement ?: HTMLElement) : void; + /* This function parses and renders XFBML markup in a document on the fly. */ + parse(ParseElement?: Element) : void; + parse(ParseElement?: HTMLElement) : void; } interface FBSDKCanvasPrefetcher{ - /* Tells Facebook that the current page uses a specified resource. */ - addStaticResource(res : string) : void; + /* Tells Facebook that the current page uses a specified resource. */ + addStaticResource(res : string) : void; - /* Controls how statistics are collected on resources used by your application. */ - setCollectionMode(option : string) : void; + /* Controls how statistics are collected on resources used by your application. */ + setCollectionMode(option : string) : void; } interface FBSDKCanvasSize{ - height ?: Number; - width ?: Number; + height?: Number; + width?: Number; } interface FBSDKCanvasDoneLoading{ - time_delta_ms : Number; + time_delta_ms : Number; } interface FBSDKCanvas{ - Prefetcher : FBSDKCanvasPrefetcher; + Prefetcher : FBSDKCanvasPrefetcher; - /* Hides the HTML element passed in via the elem param from view. */ - hideFlashElement(element : Element) : void; - hideFlashElement(element : HTMLElement) : void; + /* Hides the HTML element passed in via the elem param from view. */ + hideFlashElement(element : Element) : void; + hideFlashElement(element : HTMLElement) : void; - /* Displays the HTML element passed in via the elem param, after it has been hidden via FB.Canvas.hideFlashElement. */ - showFlashElement(element : Element) : void; - showFlashElement(element : HTMLElement) : void; + /* Displays the HTML element passed in via the elem param, after it has been hidden via FB.Canvas.hideFlashElement. */ + showFlashElement(element : Element) : void; + showFlashElement(element : HTMLElement) : void; - /* Tells Facebook to scroll to a specific location of your canvas page. */ - scrollTo(x : Number, y : Number) : void; + /* Tells Facebook to scroll to a specific location of your canvas page. */ + scrollTo(x : Number, y : Number) : void; - /* Starts or stops a timer which will grow your iframe to fit the content every few milliseconds. */ - setAutoGrow(stopTimer : boolean) : void; - setAutoGrow(diffInterval : Number) : void; - setAutoGrow(stopTimer : boolean, diffInterval : Number) : void + /* Starts or stops a timer which will grow your iframe to fit the content every few milliseconds. */ + setAutoGrow(stopTimer : boolean) : void; + setAutoGrow(diffInterval : Number) : void; + setAutoGrow(stopTimer : boolean, diffInterval : Number) : void - /* Tells Facebook to resize your iframe. */ - setSize(canvasSizeOptions : FBSDKCanvasSize) : void; + /* Tells Facebook to resize your iframe. */ + setSize(canvasSizeOptions : FBSDKCanvasSize) : void; - /* Registers the callback for inline processing (i.e. without page reload) of user actions when they click on any link to the current app from Canvas */ - setUrlHandler(handler ?: Function) : string; + /* Registers the callback for inline processing (i.e. without page reload) of user actions when they click on any link to the current app from Canvas */ + setUrlHandler(handler?: Function) : string; - /* Calls you back with an integer, in milliseconds, of the timing of the page load, beginning from the time when the first bytes arrive on - the client, and ending from the point at which you call this function. - */ - setDoneLoading(handler ?: Function) : FBSDKCanvasDoneLoading; + /* Calls you back with an integer, in milliseconds, of the timing of the page load, beginning from the time when the first bytes arrive on + the client, and ending from the point at which you call this function. + */ + setDoneLoading(handler?: Function) : FBSDKCanvasDoneLoading; - /* Call startTimer to resume the timer after a period of time for the page load that you didn't wish to measure, which you began by calling stopTimer. */ - startTimer() : void; + /* Call startTimer to resume the timer after a period of time for the page load that you didn't wish to measure, which you began by calling stopTimer. */ + startTimer() : void; - /* Call stopTimer when you wish to stop timing the page load for a period of time */ - stopTimer(handler ?: (fbResponseObject : Object) => any) : void; + /* Call stopTimer when you wish to stop timing the page load for a period of time */ + stopTimer(handler?: (fbResponseObject : Object) => any) : void; } interface FBSDK{ - /* This method is used to initialize and setup the SDK. */ - init(fbInitObject : FBInitParams) : void; + /* This method is used to initialize and setup the SDK. */ + init(fbInitObject : FBInitParams) : void; - /* This method lets you make calls to the Graph API. */ - api(path : string, method : string, callback : (fbResponseObject : Object) => any) : Object; - api(path : string, params : Object, callback : (fbResponseObject : Object) => any) : Object; - api(path : string, method : string, params : Object, callback : (fbResponseObject : Object) => any) : Object; + /* This method lets you make calls to the Graph API. */ + api(path : string, method : string, callback : (fbResponseObject : Object) => any) : Object; + api(path : string, params : Object, callback : (fbResponseObject : Object) => any) : Object; + api(path : string, method : string, params : Object, callback : (fbResponseObject : Object) => any) : Object; - /* This method is used to trigger different forms of Facebook created UI dialogs. */ - ui(params : FBUIParams, handler : (fbResponseObject : Object) => any) : void; + /* This method is used to trigger different forms of Facebook created UI dialogs. */ + ui(params : FBUIParams, handler : (fbResponseObject : Object) => any) : void; - /* Allows you to determine if a user is logged in to Facebook and has authenticated your app */ - getLoginStatus(handler : Function, force ?: Boolean) : void; + /* Allows you to determine if a user is logged in to Facebook and has authenticated your app */ + getLoginStatus(handler : Function, force?: Boolean) : void; - /* Calling FB.login prompts the user to authenticate your application using the Login Dialog. */ - login(handler : (fbResponseObject : Object) => any, params ?: FBLoginOptions): void; + /* Calling FB.login prompts the user to authenticate your application using the Login Dialog. */ + login(handler : (fbResponseObject : Object) => any, params?: FBLoginOptions): void; - /* Log the user out of your site and Facebook */ - logout(handler : (fbResponseObject : Object) => any) : void; + /* Log the user out of your site and Facebook */ + logout(handler : (fbResponseObject : Object) => any) : void; - /* Synchronous accessor for the current authResponse. */ - getAuthResponse() : Object; + /* Synchronous accessor for the current authResponse. */ + getAuthResponse() : Object; - Event : FBSDKEvents; - XFBML : FBSDKXFBML; - Canvas : FBSDKCanvas; + Event : FBSDKEvents; + XFBML : FBSDKXFBML; + Canvas : FBSDKCanvas; } interface Window{ - fbAsyncInit() : any; + fbAsyncInit() : any; } declare module "FB" { - export = FB; + export = FB; } declare var FB : FBSDK; From 7071c7602728ddcebc92fefefd3cf158bfe54188 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 27 Aug 2015 00:20:30 -0700 Subject: [PATCH 09/31] Added 'optgroups' option property in 'selectize'. --- selectize/selectize.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/selectize/selectize.d.ts b/selectize/selectize.d.ts index 3ac665458..3a61334f5 100644 --- a/selectize/selectize.d.ts +++ b/selectize/selectize.d.ts @@ -183,6 +183,13 @@ declare module Selectize { */ valueField?: string; + /** + * Option groups that options will be bucketed into. + * If your element is a