From 5aca285de7bf04b073a96b6003c3009442cbbb18 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 20 Aug 2015 12:25:28 -0700 Subject: [PATCH 01/42] The difference is Nil in 'tcomb'. --- tcomb/tcomb.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcomb/tcomb.d.ts b/tcomb/tcomb.d.ts index c189a6a0f5..923bd2fa8f 100644 --- a/tcomb/tcomb.d.ts +++ b/tcomb/tcomb.d.ts @@ -16,7 +16,7 @@ declare module TComb { assert: (condition: boolean, message?: string, ...values: any[]) => void; fail: (message?: string) => void; Any: Any_Static; - Nil: Str_Static; + Nil: Nil_Static; Str: Str_Static; Num: Num_Static; Bool: Bool_Static; From bfeb69f3e359a3b7453583954d20a540b7bd6e9e Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 20 Aug 2015 12:37:47 -0700 Subject: [PATCH 02/42] Fixed indentation in 'tcomb'. --- tcomb/tcomb.d.ts | 175 ++++++++++++++++++++++++----------------------- 1 file changed, 88 insertions(+), 87 deletions(-) diff --git a/tcomb/tcomb.d.ts b/tcomb/tcomb.d.ts index 923bd2fa8f..c4676adfd2 100644 --- a/tcomb/tcomb.d.ts +++ b/tcomb/tcomb.d.ts @@ -24,8 +24,9 @@ declare module TComb { Obj: Obj_Static; Func: Func_Static; - func: { (domain: TCombBase[], codomain: TCombBase, name?: string) : Func_Static; - (domain: TCombBase, codomain: TCombBase, name?: string) : Func_Static; + func: { + (domain: TCombBase[], codomain: TCombBase, name?: string): Func_Static; + (domain: TCombBase, codomain: TCombBase, name?: string) : Func_Static; } Err: Err_Static; Re: Re_Static; @@ -61,13 +62,13 @@ declare module TComb { export interface TCombBase { meta: { - /** - * The type kind, equal to "irreducible" for irreducible types. - */ + /** + * The type kind, equal to "irreducible" for irreducible types. + */ kind: string; - /** - * The type name. - */ + /** + * The type name. + */ name: string; }; displayName: string; @@ -107,17 +108,17 @@ declare module TComb { new (value: string): Str_Instance; (value: string): Str_Instance; meta: { - /** - * The type kind, equal to "irreducible" for irreducible types. - */ + /** + * The type kind, equal to "irreducible" for irreducible types. + */ kind: string; - /** - * The type name. - */ + /** + * The type name. + */ name: string; - /** - * The type predicate. - */ + /** + * The type predicate. + */ is: TypePredicate; }; } @@ -210,15 +211,15 @@ declare module TComb { - /** - * @param name - The type name. - * @param is - A predicate. - */ + /** + * @param name - The type name. + * @param is - A predicate. + */ - /** - * @param props - A hash whose keys are the field names and the values are the fields types. - * @param name - Useful for debugging purposes. - */ + /** + * @param props - A hash whose keys are the field names and the values are the fields types. + * @param name - Useful for debugging purposes. + */ export interface Struct_Static extends TCombBase { @@ -229,52 +230,52 @@ declare module TComb { name: string; props: any[]; }; - /** - * @param mixins - Contains the new props. - * @param name - Useful for debugging purposes. - */ + /** + * @param mixins - Contains the new props. + * @param name - Useful for debugging purposes. + */ extend(mixins: Object, name?: string): Struct_Static; - /** - * @param mixins - Contains the new props. - * @param name - Useful for debugging purposes. - */ + /** + * @param mixins - Contains the new props. + * @param name - Useful for debugging purposes. + */ extend(mixins: Struct_Static, name?: string): Struct_Static; - /** - * @param mixins - Contains the new props. - * @param name - Useful for debugging purposes. - */ + /** + * @param mixins - Contains the new props. + * @param name - Useful for debugging purposes. + */ extend(mixins: Object[], name?: string): Struct_Static; - /** - * @param mixins - Contains the new props. - * @param name - Useful for debugging purposes. - */ + /** + * @param mixins - Contains the new props. + * @param name - Useful for debugging purposes. + */ extend(mixins: Struct_Static[], name?: string): Struct_Static; } interface Struct_Instance { } - /** - * @param map - A hash whose keys are the enums (values are free). - * @param name - Useful for debugging purposes. - */ + /** + * @param map - A hash whose keys are the enums (values are free). + * @param name - Useful for debugging purposes. + */ export module enums { - /** - * @param keys - Array of enums. - * @param name - Useful for debugging purposes. - */ + /** + * @param keys - Array of enums. + * @param name - Useful for debugging purposes. + */ export function of(keys: string[], name?: string): TCombBase; - /** - * @param keys - String of enums separated by spaces. - * @param name - Useful for debugging purposes. - */ + /** + * @param keys - String of enums separated by spaces. + * @param name - Useful for debugging purposes. + */ export function of(keys: string, name?: string): TCombBase; } - /** - * @param name - Useful for debugging purposes. - */ + /** + * @param name - Useful for debugging purposes. + */ export interface Union_Static extends TCombBase { new (value: any, mutable?: boolean): Union_Instance; @@ -291,10 +292,10 @@ declare module TComb { } - /** - * @param type - The wrapped type. - * @param name - Useful for debugging purposes. - */ + /** + * @param type - The wrapped type. + * @param name - Useful for debugging purposes. + */ @@ -312,9 +313,9 @@ declare module TComb { } - /** - * @param name - Useful for debugging purposes. - */ + /** + * @param name - Useful for debugging purposes. + */ interface Tuple_Static extends TCombBase { new (value: any, mutable?: boolean): Tuple_Instance; @@ -329,11 +330,11 @@ declare module TComb { interface Tuple_Instance { } - /** - * Combines old types into a new one. - * @param type - A type already defined. - * @param name - Useful for debugging purposes. - */ + /** + * Combines old types into a new one. + * @param type - A type already defined. + * @param name - Useful for debugging purposes. + */ export interface Subtype_Static extends TCombBase { @@ -350,10 +351,10 @@ declare module TComb { interface Subtype_Instance { } - /** - * @param type - The type of list items. - * @param name - Useful for debugging purposes. - */ + /** + * @param type - The type of list items. + * @param name - Useful for debugging purposes. + */ export function list(type: TCombBase, name?: string): List_Static; interface List_Static extends TCombBase { @@ -369,11 +370,11 @@ declare module TComb { interface List_Instance { } - /** - * @param domain - The type of keys. - * @param codomain - The type of values. - * @param name - Useful for debugging purposes. - */ + /** + * @param domain - The type of keys. + * @param codomain - The type of values. + * @param name - Useful for debugging purposes. + */ interface Dict_Static extends TCombBase { @@ -390,16 +391,16 @@ declare module TComb { interface Dict_Instance { } - /** - * @param type - The type of the function's argument. - * @param codomain - The type of the function's return value. - * @param name - Useful for debugging purposes. - */ - /** - * @param type - The list of types of the function's arguments. - * @param codomain - The type of the function's return value. - * @param name - Useful for debugging purposes. - */ + /** + * @param type - The type of the function's argument. + * @param codomain - The type of the function's return value. + * @param name - Useful for debugging purposes. + */ + /** + * @param type - The list of types of the function's arguments. + * @param codomain - The type of the function's return value. + * @param name - Useful for debugging purposes. + */ interface Func_Static extends TCombBase { new (value: any, mutable?: boolean): Func_Instance; From 69a917929357233930258ebd45c1529ff06fa268 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 20 Aug 2015 12:38:05 -0700 Subject: [PATCH 03/42] Added 'any' cast in 'tcomb'. --- tcomb/tcomb-tests.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tcomb/tcomb-tests.ts b/tcomb/tcomb-tests.ts index 3a27ffc7fe..aafd5e55b2 100644 --- a/tcomb/tcomb-tests.ts +++ b/tcomb/tcomb-tests.ts @@ -577,17 +577,16 @@ describe('irreducible types constructors', function () { {T: Dat, x: new Date()} ].forEach(function (o) { - var T = o.T; - var x = o.x; + var { T, x } = o; it('should accept only valid values', function () { - eq(T(x), x); + eq((T)(x), x); }); it('should throw if used with new', function () { throwsWithMessage(function () { /* jshint ignore:start */ - var x = new (T) (); + var x = new (T) (); /* jshint ignore:end */ }, 'Operator `new` is forbidden for type `' + getTypeName(T) + '`'); }); From fd06a4cbb56754a33dabf3906ee6dd0bff98f402 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 20 Aug 2015 13:52:02 -0700 Subject: [PATCH 04/42] Fix spelling mistakes gere and tgere in 'royalslider'. --- royalslider/royalslider-tests.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/royalslider/royalslider-tests.ts b/royalslider/royalslider-tests.ts index 6cafcb6d65..4246ec90b3 100644 --- a/royalslider/royalslider-tests.ts +++ b/royalslider/royalslider-tests.ts @@ -10,10 +10,10 @@ $(".royalSlider").royalSlider({ jQuery(document).ready(function () { $(".royalSlider").royalSlider({ - // general options go gere + // general options go here autoScaleSlider: true, thumbs: { - // thumbnails options go gere + // thumbnails options go here spacing: 10, arrowsAutoHide: true } @@ -22,10 +22,10 @@ jQuery(document).ready(function () { jQuery(document).ready(function () { $(".royalSlider").royalSlider({ - // general options go gere + // general options go here autoScaleSlider: true, fullscreen: { - // fullscreen options go gere + // fullscreen options go here enabled: true, nativeFS: true } @@ -34,10 +34,10 @@ jQuery(document).ready(function () { jQuery(document).ready(function () { $(".royalSlider").royalSlider({ - // general options go gere + // general options go here autoScaleSlider: true, deeplinking: { - // deep linking options go gere + // deep linking options go here enabled: true, prefix: 'slider-' } @@ -47,10 +47,10 @@ jQuery(document).ready(function () { jQuery(document).ready(function () { $(".royalSlider").royalSlider({ - // general options go gere + // general options go here autoScaleSlider: true, autoplay: { - // autoplay options go gere + // autoplay options go here enabled: true, pauseOnHover: true } @@ -59,10 +59,10 @@ jQuery(document).ready(function () { jQuery(document).ready(function () { $(".royalSlider").royalSlider({ - // general options go gere + // general options go here autoScaleSlider: true, video: { - // video options go gere + // video options go here autoHideBlocks: true, autoHideArrows: false } @@ -71,10 +71,10 @@ jQuery(document).ready(function () { jQuery(document).ready(function () { $(".royalSlider").royalSlider({ - // general options go gere + // general options go here autoScaleSlider: true, block: { - // animated blocks options go gere + // animated blocks options go here fadeEffect: false, moveEffect: 'left' } @@ -83,7 +83,7 @@ jQuery(document).ready(function () { jQuery(document).ready(function () { $(".royalSlider").royalSlider({ - // general options go gere + // general options go here keyboardNavEnabled: true, visibleNearby: { enabled: true, @@ -174,7 +174,7 @@ slider.ev.on('rsBeforeAnimStart', function (event) { slider.ev.on('rsBeforeMove', function (event: JQueryEventObject, type?: string, userAction?: boolean) { // before any transition start (including after drag release) // "type" - can be "next", "prev", or ID of slide to move - // userAction (Boolean) - defines if action is triggered by user (e.g. will be false if movement is triggered by autoPlay) + // userAction (Boolean) - defines if action is trighered by user (e.g. will be false if movement is trighered by autoPlay) }); slider.ev.on('rsBeforeSizeSet', function (event) { // before size of slider is changed From c8157285b7a1f4da8ecdedd7d36bae1c9108d3fe Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 20 Aug 2015 13:57:52 -0700 Subject: [PATCH 05/42] Added string overload for 'data' to return appropriate type in 'royalslider'. --- royalslider/royalslider-tests.ts | 2 +- royalslider/royalslider.d.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/royalslider/royalslider-tests.ts b/royalslider/royalslider-tests.ts index 4246ec90b3..88e44a6fba 100644 --- a/royalslider/royalslider-tests.ts +++ b/royalslider/royalslider-tests.ts @@ -100,7 +100,7 @@ jQuery(document).ready(function () { // Another example: $(".royalSlider").royalSlider('goTo', 3); // But it's recommended to get instance once if you have many calls: -var slider: RoyalSlider.RoyalSlider = $(".royalSlider").royalSlider().data('royalSlider'); +var slider = $(".royalSlider").royalSlider().data('royalSlider'); slider.goTo(3); // go to slide with id slider.next(); // next slide diff --git a/royalslider/royalslider.d.ts b/royalslider/royalslider.d.ts index 5dd7c2771f..3f06b41b58 100644 --- a/royalslider/royalslider.d.ts +++ b/royalslider/royalslider.d.ts @@ -493,4 +493,6 @@ interface JQuery { * @param options The options */ royalSlider(options?: RoyalSlider.RoyalSliderOptions): JQuery; + + data(key: "royalSlider"): RoyalSlider.RoyalSlider; } \ No newline at end of file From d2f69d40abc7fc3bdc383eb8abf68cc9809b8080 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 20 Aug 2015 14:24:27 -0700 Subject: [PATCH 06/42] Add index signature to 'ComponentSpec' in 'react'. --- react/react-global.d.ts | 2 ++ react/react-tests.ts | 10 +++++----- react/react.d.ts | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/react/react-global.d.ts b/react/react-global.d.ts index f8b3763555..58ff14f396 100644 --- a/react/react-global.d.ts +++ b/react/react-global.d.ts @@ -215,6 +215,8 @@ declare module React { interface ComponentSpec extends Mixin { render(): ReactElement; + + [propertyName: string]: any; } // diff --git a/react/react-tests.ts b/react/react-tests.ts index a4d2c4f7ac..fbd1cb5163 100644 --- a/react/react-tests.ts +++ b/react/react-tests.ts @@ -41,24 +41,24 @@ var container: Element; var ClassicComponent: React.ClassicComponentClass = React.createClass({ - getDefaultProps: () => { + getDefaultProps() { return { hello: undefined, world: "peace", foo: undefined, - bar: undefined + bar: undefined, }; }, - getInitialState: () => { + getInitialState() { return { inputValue: this.context.someValue, seconds: this.props.foo }; }, - reset: () => { + reset() { this.replaceState(this.getInitialState()); }, - render: () => { + render() { return React.DOM.div(null, React.DOM.input({ ref: input => this._input = input, diff --git a/react/react.d.ts b/react/react.d.ts index 218c6c94ac..671b237844 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -215,6 +215,8 @@ declare module __React { interface ComponentSpec extends Mixin { render(): ReactElement; + + [propertyName: string]: any; } // From fb0b124b2aa7e3d301114832426dc61849cd585b Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 20 Aug 2015 14:36:58 -0700 Subject: [PATCH 07/42] Added indexer to CSS properties in 'react'. --- react/react-global.d.ts | 4 ++++ react/react.d.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/react/react-global.d.ts b/react/react-global.d.ts index 58ff14f396..83c2d54a4b 100644 --- a/react/react-global.d.ts +++ b/react/react-global.d.ts @@ -396,10 +396,14 @@ declare module React { zIndex?: number; zoom?: number; + fontSize?: number | string; + // SVG-related properties fillOpacity?: number; strokeOpacity?: number; strokeWidth?: number; + + [propertyName: string]: string | number | boolean; } interface HTMLAttributes extends DOMAttributes { diff --git a/react/react.d.ts b/react/react.d.ts index 671b237844..f6dd255115 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -396,10 +396,14 @@ declare module __React { zIndex?: number; zoom?: number; + fontSize?: number | string; + // SVG-related properties fillOpacity?: number; strokeOpacity?: number; strokeWidth?: number; + + [propertyName: string]: string | number | boolean; } interface HTMLAttributes extends DOMAttributes { From d333e3deb09c5aea1063c45d80ccaeba48bcb93b Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 20 Aug 2015 16:52:54 -0700 Subject: [PATCH 08/42] Add type annotation to avoid complaining about missing index signature in 'react'. --- react/react-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/react-tests.ts b/react/react-tests.ts index fbd1cb5163..6540cc9f35 100644 --- a/react/react-tests.ts +++ b/react/react-tests.ts @@ -204,7 +204,7 @@ myComponent.reset(); // -------------------------------------------------------------------------- var children: any[] = ["Hello world", [null], React.DOM.span(null)]; -var divStyle = { // CSSProperties +var divStyle: React.CSSProperties = { // CSSProperties flex: "1 1 main-size", backgroundImage: "url('hello.png')" }; From 40ff00391a4b9f3c64a24e5071dfd96182ccceee Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 20 Aug 2015 16:47:19 -0700 Subject: [PATCH 09/42] Added 'events_listener', created subscription types, 'module' to 'namespace', etc. in 'sipml'. See https://groups.google.com/d/msg/doubango/AmmTDLGdon4/z6vZbMGyDAAJ for details. --- sipml/sipml.d.ts | 114 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 103 insertions(+), 11 deletions(-) diff --git a/sipml/sipml.d.ts b/sipml/sipml.d.ts index 84a6944548..4d45fa6f49 100644 --- a/sipml/sipml.d.ts +++ b/sipml/sipml.d.ts @@ -3,7 +3,7 @@ // Definitions by: A. Groenenboom // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module SIPml { +declare namespace SIPml { class Event { public description: string; public type: string; @@ -14,12 +14,12 @@ declare module SIPml { public getSipResponseCode(): number; } - class EventTarget { - public addEventListener(type: any, listener: Function): void; - public removeEventListener(type: any): void; + class EventTarget { + public addEventListener(type: EventSubscriptionType, listener: (e: EventType) => void): void; + public removeEventListener(type: EventSubscriptionType): void; } - class Session extends EventTarget { + class Session extends EventTarget { public accept(configuration?: Session.Configuration): number; public getId(): number; public getRemoteFriendlyName(): string; @@ -28,10 +28,36 @@ declare module SIPml { public setConfiguration(configuration?: Session.Configuration): void; } - export module Session { + export namespace Session { + /** + * Should be + * + * "*" | + * "connecting" | + * "connected" | + * "terminating" | + * "terminated" | + * "i_ao_request" | + * "media_added" | + * "media_removed" | + * "i_request" | + * "o_request" | + * "cancelled_request" | + * "sent_request" | + * "transport_error" | + * "global_error" | + * "message_error" | + * "webrtc_error" | + */ + type EventSubscriptionType = string; + interface Configuration { audio_remote?: HTMLElement; bandwidth?: Object; + events_listener?: { + events: EventSubscriptionType | EventSubscriptionType[]; + listener: (e: Session.Event) => void + }; expires?: number; from?: string; sip_caps?: Object[]; @@ -41,7 +67,7 @@ declare module SIPml { video_size?: Object; } - class Call extends Session { + class Call extends Session implements EventTarget { public acceptTransfer(configuration?: Session.Configuration): number; public call(to: string, configuration?: Session.Configuration): number; public dtmf(): number; @@ -52,6 +78,42 @@ declare module SIPml { public resume(): number; public transfer(): number; } + + namespace Call { + /** + * Should be + * + * Session.EventSubscriptionType | + * "m_early_media" | + * "m_local_hold_ok" | + * "m_local_hold_nok" | + * "m_local_resume_ok" | + * "m_local_resume_nok" | + * "m_remote_hold" | + * "m_remote_resume" | + * "m_stream_video_local_added" | + * "m_stream_video_local_removed" | + * "m_stream_video_remote_added" | + * "m_stream_video_remote_removed" | + * "m_stream_audio_local_added" | + * "m_stream_audio_local_removed" | + * "m_stream_audio_remote_added" | + * "m_stream_audio_remote_removed" | + * "i_ect_new_call" | + * "o_ect_trying" | + * "o_ect_accepted" | + * "o_ect_completed" | + * "i_ect_completed" | + * "o_ect_failed" | + * "i_ect_failed" | + * "o_ect_notify" | + * "i_ect_notify" | + * "i_ect_requested " | + * "m_bfcp_info" | + * "i_info" | + */ + type EventSubscriptionType = Session.EventSubscriptionType; + } class Event extends SIPml.Event { public session: Session; @@ -74,13 +136,22 @@ declare module SIPml { public unregister(configuration?: Session.Configuration): void; } - class Subscribe extends Session { + class Subscribe extends Session implements EventTarget { public subscribe(to: string, configuration?: Session.Configuration): number; public unsubscribe(configuration?: Session.Configuration): number; } + + namespace Subscribe { + /** + * Should be + * + * Session.EventSubscriptionType | "i_notify" + */ + type EventSubscriptionType = Session.EventSubscriptionType; + } } - class Stack extends EventTarget { + class Stack extends EventTarget { public constructor(configuration?: Stack.Configuration); public setConfiguration(configuration: Stack.Configuration): number; public newSession(type: string, configuration?: Session.Configuration): any; @@ -88,7 +159,25 @@ declare module SIPml { public stop(timeout?: number): number; } - export module Stack { + export namespace Stack { + /** + * Should be + * + * "*" | + * "starting" | + * "started" | + * "stopping" | + * "stopped" | + * "failed_to_start" | + * "failed_to_stop" | + * "i_new_call" | + * "i_new_message" | + * "m_permission_requested" | + * "m_permission_accepted" | + * "m_permission_refused"; + */ + type EventSubscriptionType = string; + interface Configuration { bandwidth?: Object; display_name?: string; @@ -96,7 +185,10 @@ declare module SIPml { enable_early_ims?: boolean; enable_media_stream_cache?: boolean; enable_rtcweb_breaker?: boolean; - events_listener?: Object; + events_listener?: { + events: EventSubscriptionType | EventSubscriptionType[]; + listener: (e: Stack.Event) => void + }; ice_servers?: Object[]; impi?: string; impu?: string; From f4999e92bfe03f2edc2335b7d38bc664e2dc0916 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 20 Aug 2015 16:52:08 -0700 Subject: [PATCH 10/42] Replaced a few 'Object' types in 'sipml'. --- sipml/sipml.d.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sipml/sipml.d.ts b/sipml/sipml.d.ts index 4d45fa6f49..d033565e71 100644 --- a/sipml/sipml.d.ts +++ b/sipml/sipml.d.ts @@ -53,7 +53,7 @@ declare namespace SIPml { interface Configuration { audio_remote?: HTMLElement; - bandwidth?: Object; + bandwidth?: { audio: number; video: number; }; events_listener?: { events: EventSubscriptionType | EventSubscriptionType[]; listener: (e: Session.Event) => void @@ -64,7 +64,12 @@ declare namespace SIPml { sip_headers?: Object[]; video_local?: HTMLElement; video_remote?: HTMLElement; - video_size?: Object; + video_size?: { + minWidth?: number; + maxWidth?: number; + minHeight?: number; + maxHeight?: number; + }; } class Call extends Session implements EventTarget { @@ -179,7 +184,7 @@ declare namespace SIPml { type EventSubscriptionType = string; interface Configuration { - bandwidth?: Object; + bandwidth?: { audio: number; video: number; }; display_name?: string; enable_click2call?: boolean; enable_early_ims?: boolean; @@ -196,7 +201,12 @@ declare namespace SIPml { password?: string; realm?: string; sip_headers?: Object[]; - video_size?: Object; + video_size?: { + minWidth?: number; + maxWidth?: number; + minHeight?: number; + maxHeight?: number; + }; websocket_proxy_url?: string; } From 25db4a0cdfaad1adb29659e44b3cc6a45edd165e Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 20 Aug 2015 16:56:11 -0700 Subject: [PATCH 11/42] Normalize line endings in 'sipml'. --- sipml/sipml.d.ts | 396 +++++++++++++++++++++++------------------------ 1 file changed, 198 insertions(+), 198 deletions(-) diff --git a/sipml/sipml.d.ts b/sipml/sipml.d.ts index d033565e71..b6c77d8983 100644 --- a/sipml/sipml.d.ts +++ b/sipml/sipml.d.ts @@ -1,37 +1,37 @@ -// Type definitions for SIPml5 -// Project: http://sipml5.org/ -// Definitions by: A. Groenenboom -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare namespace SIPml { - class Event { - public description: string; - public type: string; - - public getContent(): Object; - public getContentString(): string; - public getContentType(): Object; - public getSipResponseCode(): number; - } - - class EventTarget { - public addEventListener(type: EventSubscriptionType, listener: (e: EventType) => void): void; - public removeEventListener(type: EventSubscriptionType): void; - } - - class Session extends EventTarget { - public accept(configuration?: Session.Configuration): number; - public getId(): number; - public getRemoteFriendlyName(): string; - public getRemoteUri(): string; - public reject(configuration?: Session.Configuration): number; - public setConfiguration(configuration?: Session.Configuration): void; - } - - export namespace Session { - /** - * Should be - * +// Type definitions for SIPml5 +// Project: http://sipml5.org/ +// Definitions by: A. Groenenboom +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare namespace SIPml { + class Event { + public description: string; + public type: string; + + public getContent(): Object; + public getContentString(): string; + public getContentType(): Object; + public getSipResponseCode(): number; + } + + class EventTarget { + public addEventListener(type: EventSubscriptionType, listener: (e: EventType) => void): void; + public removeEventListener(type: EventSubscriptionType): void; + } + + class Session extends EventTarget { + public accept(configuration?: Session.Configuration): number; + public getId(): number; + public getRemoteFriendlyName(): string; + public getRemoteUri(): string; + public reject(configuration?: Session.Configuration): number; + public setConfiguration(configuration?: Session.Configuration): void; + } + + export namespace Session { + /** + * Should be + * * "*" | * "connecting" | * "connected" | @@ -47,48 +47,48 @@ declare namespace SIPml { * "transport_error" | * "global_error" | * "message_error" | - * "webrtc_error" | - */ - type EventSubscriptionType = string; - - interface Configuration { - audio_remote?: HTMLElement; - bandwidth?: { audio: number; video: number; }; - events_listener?: { - events: EventSubscriptionType | EventSubscriptionType[]; - listener: (e: Session.Event) => void - }; - expires?: number; - from?: string; - sip_caps?: Object[]; - sip_headers?: Object[]; - video_local?: HTMLElement; - video_remote?: HTMLElement; - video_size?: { - minWidth?: number; - maxWidth?: number; - minHeight?: number; - maxHeight?: number; - }; - } - - class Call extends Session implements EventTarget { - public acceptTransfer(configuration?: Session.Configuration): number; - public call(to: string, configuration?: Session.Configuration): number; - public dtmf(): number; - public hangup(configuration?: Session.Configuration): number; - public hold(configuration?: Session.Configuration): number; - public info(): number; - public rejectTransfer(): number; - public resume(): number; - public transfer(): number; - } - - namespace Call { - /** - * Should be - * - * Session.EventSubscriptionType | + * "webrtc_error" | + */ + type EventSubscriptionType = string; + + interface Configuration { + audio_remote?: HTMLElement; + bandwidth?: { audio: number; video: number; }; + events_listener?: { + events: EventSubscriptionType | EventSubscriptionType[]; + listener: (e: Session.Event) => void + }; + expires?: number; + from?: string; + sip_caps?: Object[]; + sip_headers?: Object[]; + video_local?: HTMLElement; + video_remote?: HTMLElement; + video_size?: { + minWidth?: number; + maxWidth?: number; + minHeight?: number; + maxHeight?: number; + }; + } + + class Call extends Session implements EventTarget { + public acceptTransfer(configuration?: Session.Configuration): number; + public call(to: string, configuration?: Session.Configuration): number; + public dtmf(): number; + public hangup(configuration?: Session.Configuration): number; + public hold(configuration?: Session.Configuration): number; + public info(): number; + public rejectTransfer(): number; + public resume(): number; + public transfer(): number; + } + + namespace Call { + /** + * Should be + * + * Session.EventSubscriptionType | * "m_early_media" | * "m_local_hold_ok" | * "m_local_hold_nok" | @@ -115,57 +115,57 @@ declare namespace SIPml { * "i_ect_notify" | * "i_ect_requested " | * "m_bfcp_info" | - * "i_info" | - */ - type EventSubscriptionType = Session.EventSubscriptionType; - } - - class Event extends SIPml.Event { - public session: Session; - - public getTransferDestinationFriendlyName(): string; - } - - class Message extends Session { - public send(to: string, content?: any, contentType?: string, configuration?: Session.Configuration): number; - } - - class Publish extends Session { - public publish(content?: any, contentType?: string, configuration?: Session.Configuration): number; - - public unpublish(configuration?: Session.Configuration): void; - } - - class Registration extends Session { - public register(configuration?: Session.Configuration): void; - public unregister(configuration?: Session.Configuration): void; - } - - class Subscribe extends Session implements EventTarget { - public subscribe(to: string, configuration?: Session.Configuration): number; - public unsubscribe(configuration?: Session.Configuration): number; - } - - namespace Subscribe { - /** - * Should be - * - * Session.EventSubscriptionType | "i_notify" - */ - type EventSubscriptionType = Session.EventSubscriptionType; - } - } - - class Stack extends EventTarget { - public constructor(configuration?: Stack.Configuration); - public setConfiguration(configuration: Stack.Configuration): number; - public newSession(type: string, configuration?: Session.Configuration): any; - public start(): number; - public stop(timeout?: number): number; - } - - export namespace Stack { - /** + * "i_info" | + */ + type EventSubscriptionType = Session.EventSubscriptionType; + } + + class Event extends SIPml.Event { + public session: Session; + + public getTransferDestinationFriendlyName(): string; + } + + class Message extends Session { + public send(to: string, content?: any, contentType?: string, configuration?: Session.Configuration): number; + } + + class Publish extends Session { + public publish(content?: any, contentType?: string, configuration?: Session.Configuration): number; + + public unpublish(configuration?: Session.Configuration): void; + } + + class Registration extends Session { + public register(configuration?: Session.Configuration): void; + public unregister(configuration?: Session.Configuration): void; + } + + class Subscribe extends Session implements EventTarget { + public subscribe(to: string, configuration?: Session.Configuration): number; + public unsubscribe(configuration?: Session.Configuration): number; + } + + namespace Subscribe { + /** + * Should be + * + * Session.EventSubscriptionType | "i_notify" + */ + type EventSubscriptionType = Session.EventSubscriptionType; + } + } + + class Stack extends EventTarget { + public constructor(configuration?: Stack.Configuration); + public setConfiguration(configuration: Stack.Configuration): number; + public newSession(type: string, configuration?: Session.Configuration): any; + public start(): number; + public stop(timeout?: number): number; + } + + export namespace Stack { + /** * Should be * * "*" | @@ -179,74 +179,74 @@ declare namespace SIPml { * "i_new_message" | * "m_permission_requested" | * "m_permission_accepted" | - * "m_permission_refused"; - */ - type EventSubscriptionType = string; - - interface Configuration { - bandwidth?: { audio: number; video: number; }; - display_name?: string; - enable_click2call?: boolean; - enable_early_ims?: boolean; - enable_media_stream_cache?: boolean; - enable_rtcweb_breaker?: boolean; - events_listener?: { - events: EventSubscriptionType | EventSubscriptionType[]; - listener: (e: Stack.Event) => void - }; - ice_servers?: Object[]; - impi?: string; - impu?: string; - outbound_proxy_url?: string; - password?: string; - realm?: string; - sip_headers?: Object[]; - video_size?: { - minWidth?: number; - maxWidth?: number; - minHeight?: number; - maxHeight?: number; - }; - websocket_proxy_url?: string; - } - - class Event extends SIPml.Event { - public description: string; - public newSession: Session; - public type: string; - } - } - - function getNavigatorFriendlyName(): string; - - function getNavigatorVersion(): string; - - function getSystemFriendlyName(): string; - - function getWebRtc4AllVersion(): string; - - function haveMediaStream(): boolean; - - function init(readyCallback?: (e:any) => any, errorCallback?: (e:any) => any): boolean; - - function isInitialized(): boolean; - - function isNavigatorOutdated(): boolean; - - function isReady(): boolean; - - function isScreenShareSupported(): boolean; - - function isWebRtcPluginOutdated(): boolean; - - function isWebRtc4AllSupported(): boolean; - - function isWebRtcSupported(): boolean; - - function isWebSocketSupported(): boolean; - - function setDebugLevel(level: string): void; - - function setWebRtcType(type: string): boolean; -} - + * "m_permission_refused"; + */ + type EventSubscriptionType = string; + + interface Configuration { + bandwidth?: { audio: number; video: number; }; + display_name?: string; + enable_click2call?: boolean; + enable_early_ims?: boolean; + enable_media_stream_cache?: boolean; + enable_rtcweb_breaker?: boolean; + events_listener?: { + events: EventSubscriptionType | EventSubscriptionType[]; + listener: (e: Stack.Event) => void + }; + ice_servers?: Object[]; + impi?: string; + impu?: string; + outbound_proxy_url?: string; + password?: string; + realm?: string; + sip_headers?: Object[]; + video_size?: { + minWidth?: number; + maxWidth?: number; + minHeight?: number; + maxHeight?: number; + }; + websocket_proxy_url?: string; + } + + class Event extends SIPml.Event { + public description: string; + public newSession: Session; + public type: string; + } + } + + function getNavigatorFriendlyName(): string; + + function getNavigatorVersion(): string; + + function getSystemFriendlyName(): string; + + function getWebRtc4AllVersion(): string; + + function haveMediaStream(): boolean; + + function init(readyCallback?: (e:any) => any, errorCallback?: (e:any) => any): boolean; + + function isInitialized(): boolean; + + function isNavigatorOutdated(): boolean; + + function isReady(): boolean; + + function isScreenShareSupported(): boolean; + + function isWebRtcPluginOutdated(): boolean; + + function isWebRtc4AllSupported(): boolean; + + function isWebRtcSupported(): boolean; + + function isWebSocketSupported(): boolean; + + function setDebugLevel(level: string): void; + + function setWebRtcType(type: string): boolean; +} + From 2df5e8ac4f73f8d685aeaf1f334360cdcaf91abb Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 20 Aug 2015 17:03:58 -0700 Subject: [PATCH 12/42] Fixed tests/typings for 'photoswipe'. --- photoswipe/photoswipe-tests.ts | 2 -- photoswipe/photoswipe.d.ts | 10 ++++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/photoswipe/photoswipe-tests.ts b/photoswipe/photoswipe-tests.ts index 79125bd05f..ca136f3a2e 100644 --- a/photoswipe/photoswipe-tests.ts +++ b/photoswipe/photoswipe-tests.ts @@ -6,13 +6,11 @@ function test_defaultUI() { src: "path/to/image.jpg", w: 100, h: 200, - specialProperty: true }, { src: "path/to/image2.jpg", w: 1000, h: 2000, - specialProperty: false } ]; diff --git a/photoswipe/photoswipe.d.ts b/photoswipe/photoswipe.d.ts index b09fe75ddf..4916c2123f 100644 --- a/photoswipe/photoswipe.d.ts +++ b/photoswipe/photoswipe.d.ts @@ -268,6 +268,16 @@ declare module PhotoSwipe { */ mainClass?: string; + /** + * Undocumented. + */ + mainScrollEndFriction?: number; + + /** + * Undocumented. + */ + panEndFriction?: number; + /** * Function that should return total number of items in gallery. Don't put very complex code here, function is executed very often. * From e4eed4a208ce764dd36920cf5a4f668379504f81 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 13:07:36 -0700 Subject: [PATCH 13/42] Encapsulated interfaces, made typings more precise according to documentation, removed 'ParseDefaultOptions' in 'parse'. --- parse/parse.d.ts | 294 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 204 insertions(+), 90 deletions(-) diff --git a/parse/parse.d.ts b/parse/parse.d.ts index cb4fa8b2b3..1f3e6993c7 100644 --- a/parse/parse.d.ts +++ b/parse/parse.d.ts @@ -15,53 +15,37 @@ declare module Parse { var serverURL: string; var VERSION: string; - interface ParseDefaultOptions { - wait?: boolean; - silent?: boolean; + interface SuccessOption { success?: Function; + } + + interface ErrorOption { error?: Function; + } + + interface BackboneStyleOptions extends SuccessOption, ErrorOption { + } + + interface WaitOption { + /** + * Set to true to wait for the server to confirm success + * before triggering an event. + */ + wait?: boolean; + } + + interface UseMasterKeyOption { + /** + * In Cloud Code and Node only, causes the Master Key to be used for this request. + */ useMasterKey?: boolean; } - interface CollectionOptions { - model?: Object; - query?: Query; - comparator?: string; - } - - interface CollectionAddOptions { - at?: number; - } - - interface RouterOptions { - routes: any; - } - - interface NavigateOptions { - trigger?: boolean; - } - - interface ViewOptions { - model?: any; - collection?: any; - el?: any; - id?: string; - className?: string; - tagName?: string; - attributes?: any[]; - } - - interface PushData { - channels?: string[]; - push_time?: Date; - expiration_time?: Date; - expiration_interval?: number; - where?: Query; - data?: any; - alert?: string; - badge?: string; - sound?: string; - title?: string; + interface SilentOption { + /** + * Set to true to avoid firing the event. + */ + silent?: boolean; } /** @@ -199,7 +183,7 @@ declare module Parse { constructor(name: string, data: any, type?: string); name(): string; url(): string; - save(options?: ParseDefaultOptions): Promise; + save(options?: BackboneStyleOptions): Promise; } @@ -233,7 +217,7 @@ declare module Parse { constructor(arg1?: any, arg2?: any); - current(options?: ParseDefaultOptions): GeoPoint; + current(options?: BackboneStyleOptions): GeoPoint; radiansTo(point: GeoPoint): number; kilometersTo(point: GeoPoint): number; milesTo(point: GeoPoint): number; @@ -332,10 +316,10 @@ declare module Parse { constructor(attributes?: string[], options?: any); static extend(className: string, protoProps?: any, classProps?: any): any; - static fetchAll(list: Object[], options: ParseDefaultOptions): Promise; - static fetchAllIfNeeded(list: Object[], options: ParseDefaultOptions): Promise; - static destroyAll(list: Object[], options?: ParseDefaultOptions): Promise; - static saveAll(list: Object[], options?: ParseDefaultOptions): Promise; + static fetchAll(list: Object[], options: BackboneStyleOptions): Promise; + static fetchAllIfNeeded(list: Object[], options: BackboneStyleOptions): Promise; + static destroyAll(list: Object[], options?: Object.DestroyAllOptions): Promise; + static saveAll(list: Object[], options?: Object.SaveAllOptions): Promise; initialize(): void; add(attr: string, item: any): Object; @@ -344,12 +328,12 @@ declare module Parse { changedAttributes(diff: any): boolean; clear(options: any): any; clone(): Object; - destroy(options?: ParseDefaultOptions): Promise; + destroy(options?: Object.DestroyOptions): Promise; dirty(attr: String): boolean; dirtyKeys(): string[]; escape(attr: string): string; existed(): boolean; - fetch(options?: ParseDefaultOptions): Promise; + fetch(options?: Object.FetchOptions): Promise; get(attr: string): any; getACL(): ACL; has(attr: string): boolean; @@ -361,12 +345,27 @@ declare module Parse { previousAttributes(): any; relation(attr: string): Relation; remove(attr: string, item: any): any; - save(options?: ParseDefaultOptions, arg2?: any, arg3?: any): Promise; - set(key: string, value: any, options?: ParseDefaultOptions): boolean; - setACL(acl: ACL, options?: ParseDefaultOptions): boolean; + save(options?: Object.SaveOptions, arg2?: any, arg3?: any): Promise; + set(key: string, value: any, options?: Object.SetOptions): boolean; + setACL(acl: ACL, options?: BackboneStyleOptions): boolean; unset(attr: string, options?: any): any; - validate(attrs: any, options?: ParseDefaultOptions): boolean; + validate(attrs: any, options?: BackboneStyleOptions): boolean; + } + namespace Object { + interface DestroyOptions extends BackboneStyleOptions, WaitOption, UseMasterKeyOption { } + + interface DestroyAllOptions extends BackboneStyleOptions, UseMasterKeyOption { } + + interface FetchOptions extends BackboneStyleOptions, UseMasterKeyOption { } + + interface SaveOptions extends BackboneStyleOptions, SilentOption, UseMasterKeyOption, WaitOption { } + + interface SaveAllOptions extends BackboneStyleOptions, UseMasterKeyOption { } + + interface SetOptions extends ErrorOption, SilentOption { + promise?: any; + } } /** @@ -420,24 +419,49 @@ declare module Parse { query: Query; comparator: (object: Object) => any; - constructor(models?: Object[], options?: CollectionOptions); + constructor(models?: Object[], options?: Collection.Options); static extend(instanceProps: any, classProps: any): any; initialize(): void; - add(models: any[], options?: CollectionAddOptions): Collection; + add(models: any[], options?: Collection.AddOptions): Collection; at(index: number): Object; chain(): _Chain>; - fetch(options?: ParseDefaultOptions): Promise; - create(model: Object, options?: ParseDefaultOptions): Object; + fetch(options?: Collection.FetchOptions): Promise; + create(model: Object, options?: Collection.CreateOptions): Object; get(id: string): Object; getByCid(cid: any): any; pluck(attr: string): any[]; - remove(model: any, options?: ParseDefaultOptions): Collection; - remove(models: any[], options?: ParseDefaultOptions): Collection; - reset(models: any[], options?: ParseDefaultOptions): Collection; - sort(options?: ParseDefaultOptions): Collection; + remove(model: any, options?: Collection.RemoveOptions): Collection; + remove(models: any[], options?: Collection.RemoveOptions): Collection; + reset(models: any[], options?: Collection.ResetOptions): Collection; + sort(options?: Collection.SortOptions): Collection; toJSON(): any; + } + namespace Collection { + interface Options { + model?: Object; + query?: Query; + comparator?: string; + } + + interface AddOptions extends SilentOption { + /** + * The index at which to add the models. + */ + at?: number; + } + + interface CreateOptions extends BackboneStyleOptions, WaitOption, SilentOption, UseMasterKeyOption { + } + + interface FetchOptions extends BackboneStyleOptions, SilentOption, UseMasterKeyOption { } + + interface RemoveOptions extends SilentOption { } + + interface ResetOptions extends SilentOption { } + + interface SortOptions extends SilentOption { } } /** @@ -549,23 +573,23 @@ declare module Parse { addDescending(key: string[]): Query; ascending(key: string): Query; ascending(key: string[]): Query; - collection(items?: Object[], options?: ParseDefaultOptions): Collection; + collection(items?: Object[], options?: Collection.Options): Collection; containedIn(key: string, values: any[]): Query; contains(key: string, substring: string): Query; containsAll(key: string, values: any[]): Query; - count(options?: ParseDefaultOptions): Promise; + count(options?: Query.CountOptions): Promise; descending(key: string): Query; descending(key: string[]): Query; doesNotExist(key: string): Query; doesNotMatchKeyInQuery(key: string, queryKey: string, query: Query): Query; doesNotMatchQuery(key: string, query: Query): Query; - each(callback: Function, options?: ParseDefaultOptions): Promise; + each(callback: Function, options?: BackboneStyleOptions): Promise; endsWith(key: string, suffix: string): Query; equalTo(key: string, value: any): Query; exists(key: string): Query; - find(options?: ParseDefaultOptions): Promise; - first(options?: ParseDefaultOptions): Promise; - get(objectId: string, options?: ParseDefaultOptions): Promise; + find(options?: Query.FindOptions): Promise; + first(options?: Query.FirstOptions): Promise; + get(objectId: string, options?: Query.GetOptions): Promise; greaterThan(key: string, value: any): Query; greaterThanOrEqualTo(key: string, value: any): Query; include(key: string): Query; @@ -588,6 +612,13 @@ declare module Parse { withinRadians(key: string, point: GeoPoint, maxDistance: number): Query; } + namespace Query { + interface CountOptions extends BackboneStyleOptions, UseMasterKeyOption { } + interface FindOptions extends BackboneStyleOptions, UseMasterKeyOption { } + interface FirstOptions extends BackboneStyleOptions, UseMasterKeyOption { } + interface GetOptions extends BackboneStyleOptions, UseMasterKeyOption { } + } + /** * Represents a Role on the Parse server. Roles represent groupings of * Users for the purposes of granting permissions (e.g. specifying an ACL @@ -608,7 +639,7 @@ declare module Parse { getRoles(): Relation; getUsers(): Relation; getName(): string; - setName(name: string, options?: ParseDefaultOptions): any; + setName(name: string, options?: BackboneStyleOptions): any; } /** @@ -624,17 +655,31 @@ declare module Parse { */ class Router extends Events { - routes: any[]; + routes: Router.RouteMap; - constructor(options?: RouterOptions); + constructor(options?: Router.Options); static extend(instanceProps: any, classProps: any): any; initialize(): void; - navigate(fragment: string, options?: NavigateOptions): Router; + navigate(fragment: string, options?: Router.NavigateOptions): Router; navigate(fragment: string, trigger?: boolean): Router; route(route: string, name: string, callback: Function): Router; } + namespace Router { + interface Options { + routes: RouteMap; + } + + interface RouteMap { + [url: string]: string; + } + + interface NavigateOptions { + trigger?: boolean; + } + } + /** * @class * @@ -647,27 +692,27 @@ declare module Parse { class User extends Object { static current(): User; - static signUp(username: string, password: string, attrs: any, options?: ParseDefaultOptions): Promise; - static logIn(username: string, password: string, options?: ParseDefaultOptions): Promise; + static signUp(username: string, password: string, attrs: any, options?: BackboneStyleOptions): Promise; + static logIn(username: string, password: string, options?: BackboneStyleOptions): Promise; static logOut(): Promise; static allowCustomUserClass(isAllowed: boolean): void; - static become(sessionToken: string, options?: ParseDefaultOptions): Promise; - static requestPasswordReset(email: string, options?: ParseDefaultOptions): Promise; + static become(sessionToken: string, options?: BackboneStyleOptions): Promise; + static requestPasswordReset(email: string, options?: BackboneStyleOptions): Promise; - signUp(attrs: any, options?: ParseDefaultOptions): Promise; - logIn(options?: ParseDefaultOptions): Promise; - fetch(options?: ParseDefaultOptions): Promise; + signUp(attrs: any, options?: BackboneStyleOptions): Promise; + logIn(options?: BackboneStyleOptions): Promise; + fetch(options?: BackboneStyleOptions): Promise; save(arg1: any, arg2: any, arg3: any): Promise; authenticated(): boolean; isCurrent(): boolean; getEmail(): string; - setEmail(email: string, options: ParseDefaultOptions): boolean; + setEmail(email: string, options: BackboneStyleOptions): boolean; getUsername(): string; - setUsername(username: string, options?: ParseDefaultOptions): boolean; + setUsername(username: string, options?: BackboneStyleOptions): boolean; - setPassword(password: string, options?: ParseDefaultOptions): boolean; + setPassword(password: string, options?: BackboneStyleOptions): boolean; getSessionToken(): string; } @@ -695,7 +740,7 @@ declare module Parse { $el: JQuery; attributes: any; - constructor(options?: ViewOptions); + constructor(options?: View.Options); static extend(properties: any, classProperties?: any): any; @@ -704,12 +749,28 @@ declare module Parse { setElement(element: JQuery, delegate?: boolean): View; render(): View; remove(): View; - make(tagName: any, attributes?: any, content?: any): any; + make(tagName: any, attributes?: View.Attribute[], content?: any): any; delegateEvents(events?: any): any; undelegateEvents(): any; } + namespace View { + interface Options { + model?: any; + collection?: any; + el?: any; + id?: string; + className?: string; + tagName?: string; + attributes?: Attribute[]; + } + + interface Attribute { + [attributeName: string]: string | number | boolean; + } + } + module Analytics { function track(name: string, dimensions: any):Promise; @@ -724,9 +785,9 @@ declare module Parse { function init(options?: any): void; function isLinked(user: User): boolean; - function link(user: User, permissions: any, options?: ParseDefaultOptions): void; - function logIn(permissions: any, options?: ParseDefaultOptions): void; - function unlink(user: User, options?: ParseDefaultOptions): void; + function link(user: User, permissions: any, options?: BackboneStyleOptions): void; + function logIn(permissions: any, options?: BackboneStyleOptions): void; + function unlink(user: User, options?: BackboneStyleOptions): void; } /** @@ -796,10 +857,46 @@ declare module Parse { function beforeDelete(arg1: any, func?: (request: BeforeDeleteRequest, response: BeforeDeleteResponse) => void): void; function beforeSave(arg1: any, func?: (request: BeforeSaveRequest, response: BeforeSaveResponse) => void): void; function define(name: string, func?: (request: FunctionRequest, response: FunctionResponse) => void): void; - function httpRequest(options: ParseDefaultOptions): Promise; + function httpRequest(options: HTTPOptions): Promise; function job(name: string, func?: (request: JobRequest, status: JobStatus) => void): HttpResponse; - function run(name: string, data?: any, options?: ParseDefaultOptions): Promise; + function run(name: string, data?: any, options?: BackboneStyleOptions): Promise; function useMasterKey(): void; + + /** + * To use this Cloud Module in Cloud Code, you must require 'buffer' in your JavaScript file. + * + * import Buffer = require("buffer").Buffer; + */ + let HTTPOptions: { + new (): HTTPOptions; + }; + interface HTTPOptions extends FunctionResponse { + /** + * The body of the request. + * If it is a JSON object, then the Content-Type set in the headers must be application/x-www-form-urlencoded or application/json. + * You can also set this to a Buffer object to send raw bytes. + * If you use a Buffer, you should also set the Content-Type header explicitly to describe what these bytes represent. + */ + body?: string | Buffer | Object; + /** + * Defaults to 'false'. + */ + followRedirects?: boolean; + /** + * The headers for the request. + */ + headers?: { + [headerName: string]: string | number | boolean; + }; + /** + *The method of the request (i.e GET, POST, etc). + */ + method?: string; + /** + * The url to send the request to. + */ + url: string; + } } @@ -919,8 +1016,25 @@ declare module Parse { * @namespace */ module Push { + function send(data: PushData, options?: SendOptions): Promise; - function send(data: PushData, options?: ParseDefaultOptions):Promise; + interface PushData { + channels?: string[]; + push_time?: Date; + expiration_time?: Date; + expiration_interval?: number; + where?: Query; + data?: any; + alert?: string; + badge?: string; + sound?: string; + title?: string; + } + + interface SendOptions { + success?: () => void; + error?: (error: Error) => void; + } } /** From 3f66eb02dbf3bbb3a49f43286a05091d754f2b2c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 13:09:08 -0700 Subject: [PATCH 14/42] Use 'namespace' keyword in 'parse'. --- parse/parse.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/parse/parse.d.ts b/parse/parse.d.ts index 1f3e6993c7..f5f7ad4a0b 100644 --- a/parse/parse.d.ts +++ b/parse/parse.d.ts @@ -7,7 +7,7 @@ /// /// -declare module Parse { +declare namespace Parse { var applicationId: string; var javaScriptKey: string; @@ -771,7 +771,7 @@ declare module Parse { } } - module Analytics { + namespace Analytics { function track(name: string, dimensions: any):Promise; } @@ -781,7 +781,7 @@ declare module Parse { * @namespace * Provides a set of utilities for using Parse with Facebook. */ - module FacebookUtils { + namespace FacebookUtils { function init(options?: any): void; function isLinked(user: User): boolean; @@ -797,7 +797,7 @@ declare module Parse { * Some functions are only available from Cloud Code. *

*/ - module Cloud { + namespace Cloud { interface CookieOptions { domain?: string; @@ -980,7 +980,7 @@ declare module Parse { * You should not create subclasses of Parse.Op or instantiate Parse.Op * directly. */ - module Op { + namespace Op { interface BaseOperation extends IBaseObject { objects(): any[]; @@ -1015,7 +1015,7 @@ declare module Parse { * @name Parse.Push * @namespace */ - module Push { + namespace Push { function send(data: PushData, options?: SendOptions): Promise; interface PushData { From 79617fa3aac8254c652cf761e33aabf8aebd7bb3 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 13:12:30 -0700 Subject: [PATCH 15/42] Marked deprecated fields as such with JSDoc and added comment in 'photoswipe'. See https://github.com/dimsemenov/PhotoSwipe/issues/944 --- photoswipe/photoswipe.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/photoswipe/photoswipe.d.ts b/photoswipe/photoswipe.d.ts index 4916c2123f..16ce87a68c 100644 --- a/photoswipe/photoswipe.d.ts +++ b/photoswipe/photoswipe.d.ts @@ -269,12 +269,16 @@ declare module PhotoSwipe { mainClass?: string; /** - * Undocumented. + * NOTE: this property will be ignored in future versions of PhotoSwipe. + * + * @deprecated */ mainScrollEndFriction?: number; /** - * Undocumented. + * NOTE: this property will be ignored in future versions of PhotoSwipe. + * + * @deprecated */ panEndFriction?: number; From dbc8e087d693ac4cf766555dc23ea5bdca074109 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 14:16:27 -0700 Subject: [PATCH 16/42] Fixed tests/definitions for 'nouislider'. --- nouislider/nouislider-tests.ts | 15 +- nouislider/nouislider.d.ts | 345 +++++++++++++++++---------------- 2 files changed, 181 insertions(+), 179 deletions(-) diff --git a/nouislider/nouislider-tests.ts b/nouislider/nouislider-tests.ts index 837776dfa8..2739e609ce 100644 --- a/nouislider/nouislider-tests.ts +++ b/nouislider/nouislider-tests.ts @@ -49,17 +49,14 @@ noUiSlider.create(testHtmlElement, { min: 0, max: 10 }, - mode: 'steps', - density: 3, - filter: function(){return 1}, - format: wNumb({ - decimals: 2, - prefix: '$' - }), pips: { - mode: 'range', + mode: 'steps', density: 3, - values: [50, 552, 4651, 4952, 5000, 7080, 9000] + filter: function () { return 1 }, + format: wNumb({ + decimals: 2, + prefix: '$' + }), } }); diff --git a/nouislider/nouislider.d.ts b/nouislider/nouislider.d.ts index e382059fb3..b8d0702af9 100644 --- a/nouislider/nouislider.d.ts +++ b/nouislider/nouislider.d.ts @@ -1,170 +1,175 @@ -// Type definitions for nouislider v8.0.2 -// Project: https://github.com/leongersen/noUiSlider -// Definitions by: Patrick Davies -// Definitions: https://github.com/borisyankov/DefinitelyTyped -/// - -declare module noUiSlider { - interface Static { - /** - * To create a slider, call noUiSlider.create() with an element and your options. - */ - create(target: HTMLElement, options: Options): void; - } - - interface Options { - /** - * The start option sets the number of handles and their start positions, relative to range. - */ - start: number | number[] | number[][]; - /** - * The connect setting can be used to control the bar between the handles, - * or the edges of the slider. Use "lower" to connect to the lower side, - * or "upper" to connect to the upper side. Setting true sets the bar between the handles. - */ - range: Object; - /** - * noUiSlider offers several ways to handle user interaction. - * The range can be set to drag, and handles can move to taps. - * All these effects are optional, and can be enable by adding their keyword to the behaviour option. - * This option accepts a "-" separated list of "drag", "tap", "fixed", "snap" or "none". - */ - connect?: string | boolean; - /** - * When using two handles, the minimum distance between the handles can be set using the margin option. - * The margin value is relative to the value set in 'range'. - * This option is only available on standard linear sliders. - */ - margin?: number; - /** - * The limit option is the oposite of the margin option, - * limiting the maximum distance between two handles. - * As with the margin option, the limit option can only be used on linear sliders. - */ - limit?: number; - /** - * By default, the slider slides fluently. - * In order to make the handles jump between intervals, you can use this option. - * The step option is relative to the values provided to range. - */ - step?: number; - /** - * The orientation setting can be used to set the slider to "vertical" or "horizontal". - * Set dimensions! Vertical sliders don't assume a default height, so you'll need to set one. - * You can use any unit you want, including % or px. - */ - orientation?: string; - /** - * By default the sliders are top-to-bottom and left-to-right, - * but you can change this using the direction option, - * which decides where the upper side of the slider is. - */ - direction?: string; - /** - * Set the animate option to false to prevent the slider from animating to a new value with when calling .val(). - */ - animate?: boolean; - /** - * All values on the slider are part of a range. The range has a minimum and maximum value. - */ - behaviour?: string; - /** - * To format the slider output, noUiSlider offers a format option. - * Simply specify to and from functions to encode and decode the values. - * See manual formatting to the right for usage information. - * By default, noUiSlider will format output with 2 decimals. - */ - format?: Object | ((...args:any[]) => any); - - } - - interface PipsOptions { - /** - * The range mode uses the slider range to determine where the pips should be. A pip is generated for every percentage specified. - * - * Like range, the steps mode uses the slider range. In steps mode, a pip is generated for every step. - * The filter option can be used to filter the generated pips. - * The filter function must return 0 (no value), 1 (large value) or 2 (small value). - * - * In positions mode, pips are generated at percentage-based positions on the slider. Optionally, the stepped option can be set to true to match the pips to the slider steps. - * - * The count mode can be used to generate a fixed number of pips. As with positions mode, the stepped option can be used. - * - * The values mode is similar to positions, but it accepts values instead of percentages. The stepped option can be used for this mode. - * - */ - mode: string; - /** - * Range Mode: percentage for range mode - * Step Mode: step number for steps - * Positions Mode: percentage-based positions on the slider - * Count Mode: positions between pips - */ - density?: number; - /** - * Step Mode: The filter option can be used to filter the generated pips. - * The filter function must return 0 (no value), 1 (large value) or 2 (small value). - */ - filter?: (...args:any[]) => number; - /** - * format for step mode - * see noUiSlider format - */ - format?: Object; - /** - * - * values for positions and values mode - * number pips for count mode - */ - values?: number | number[]; - /** - * stepped option for positions, values and count mode - */ - stepped?: boolean; - } - - interface Callback { - /** - * Array for both one-handle and two-handle sliders. It contains the current slider values, - * with formatting applied. - */ - (values: any[], handle: number, unencoded: number): void - } - - - interface noUiSlider { - /** - * Bind event to the slider. - */ - on(eventName: string, callback: Callback): void; - /** - * Unbind event to the slider. - */ - off(eventName: string): void; - /** - * Destroy's the slider. - */ - destroy(): void; - - /** - * To get the current slider value. For one-handle sliders, calling .get() will return the value. - * For two-handle sliders, an array[value, value] will be returned. - */ - get(): number | number[]; - /** - * noUiSlider will keep your values within the slider range, which saves you a bunch of validation. - * If you have configured the slider to use one handle, you can change the current value by passing - * a number to the .set() method. If you have two handles, pass an array. One-handled sliders - * will also accept arrays. Within an array, you can set one position to null - * if you want to leave a handle unchanged. - */ - set(value: number | number[]): void; - } - - interface Instance extends HTMLElement { - noUiSlider: noUiSlider - } -} - -declare var noUiSlider: noUiSlider.Static; - +// Type definitions for nouislider v8.0.2 +// Project: https://github.com/leongersen/noUiSlider +// Definitions by: Patrick Davies +// Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + +declare module noUiSlider { + interface Static { + /** + * To create a slider, call noUiSlider.create() with an element and your options. + */ + create(target: HTMLElement, options: Options): void; + } + + interface Options { + /** + * The start option sets the number of handles and their start positions, relative to range. + */ + start: number | number[] | number[][]; + /** + * The connect setting can be used to control the bar between the handles, + * or the edges of the slider. Use "lower" to connect to the lower side, + * or "upper" to connect to the upper side. Setting true sets the bar between the handles. + */ + range: Object; + /** + * noUiSlider offers several ways to handle user interaction. + * The range can be set to drag, and handles can move to taps. + * All these effects are optional, and can be enable by adding their keyword to the behaviour option. + * This option accepts a "-" separated list of "drag", "tap", "fixed", "snap" or "none". + */ + connect?: string | boolean; + /** + * When using two handles, the minimum distance between the handles can be set using the margin option. + * The margin value is relative to the value set in 'range'. + * This option is only available on standard linear sliders. + */ + margin?: number; + /** + * The limit option is the oposite of the margin option, + * limiting the maximum distance between two handles. + * As with the margin option, the limit option can only be used on linear sliders. + */ + limit?: number; + /** + * By default, the slider slides fluently. + * In order to make the handles jump between intervals, you can use this option. + * The step option is relative to the values provided to range. + */ + step?: number; + /** + * The orientation setting can be used to set the slider to "vertical" or "horizontal". + * Set dimensions! Vertical sliders don't assume a default height, so you'll need to set one. + * You can use any unit you want, including % or px. + */ + orientation?: string; + /** + * By default the sliders are top-to-bottom and left-to-right, + * but you can change this using the direction option, + * which decides where the upper side of the slider is. + */ + direction?: string; + /** + * Set the animate option to false to prevent the slider from animating to a new value with when calling .val(). + */ + animate?: boolean; + /** + * All values on the slider are part of a range. The range has a minimum and maximum value. + */ + behaviour?: string; + /** + * To format the slider output, noUiSlider offers a format option. + * Simply specify to and from functions to encode and decode the values. + * See manual formatting to the right for usage information. + * By default, noUiSlider will format output with 2 decimals. + */ + format?: Object | ((...args:any[]) => any); + + /** + * Allows you to generate points along the slider. + */ + pips: PipsOptions; + } + + interface PipsOptions { + /** + * The 'range' mode uses the slider range to determine where the pips should be. A pip is generated for every percentage specified. + * + * The 'steps', like 'range', uses the slider range. In steps mode, a pip is generated for every step. + * The 'filter' option can be used to filter the generated pips from the 'steps' options' + * The filter function must return 0 (no value), 1 (large value) or 2 (small value). + * + * In 'positions' mode, pips are generated at percentage-based positions on the slider. + * Optionally, the stepped option can be set to true to match the pips to the slider steps. + * + * The 'count' mode can be used to generate a fixed number of pips. As with positions mode, the stepped option can be used. + * + * The 'values' mode is similar to positions, but it accepts values instead of percentages. The stepped option can be used for this mode. + * + */ + mode: string; // "range" | "steps" | "positions" | "count" | "values" + /** + * Range Mode: percentage for range mode + * Step Mode: step number for steps + * Positions Mode: percentage-based positions on the slider + * Count Mode: positions between pips + */ + density?: number; + /** + * Step Mode: The filter option can be used to filter the generated pips. + * The filter function must return 0 (no value), 1 (large value) or 2 (small value). + */ + filter?: (...args: any[]) => number; + /** + * format for step mode + * see noUiSlider format + */ + format?: Object; + /** + * + * values for positions and values mode + * number pips for count mode + */ + values?: number | number[]; + /** + * stepped option for positions, values and count mode + */ + stepped?: boolean; + } + + interface Callback { + /** + * Array for both one-handle and two-handle sliders. It contains the current slider values, + * with formatting applied. + */ + (values: any[], handle: number, unencoded: number): void + } + + + interface noUiSlider { + /** + * Bind event to the slider. + */ + on(eventName: string, callback: Callback): void; + /** + * Unbind event to the slider. + */ + off(eventName: string): void; + /** + * Destroy's the slider. + */ + destroy(): void; + + /** + * To get the current slider value. For one-handle sliders, calling .get() will return the value. + * For two-handle sliders, an array[value, value] will be returned. + */ + get(): number | number[]; + /** + * noUiSlider will keep your values within the slider range, which saves you a bunch of validation. + * If you have configured the slider to use one handle, you can change the current value by passing + * a number to the .set() method. If you have two handles, pass an array. One-handled sliders + * will also accept arrays. Within an array, you can set one position to null + * if you want to leave a handle unchanged. + */ + set(value: number | number[]): void; + } + + interface Instance extends HTMLElement { + noUiSlider: noUiSlider + } +} + +declare var noUiSlider: noUiSlider.Static; + From 0f0a9a25b705c077794dcadd5940165bf0284b4d Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 14:19:01 -0700 Subject: [PATCH 17/42] Use const enum for 'filter' result in 'nouislider'. --- nouislider/nouislider.d.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/nouislider/nouislider.d.ts b/nouislider/nouislider.d.ts index b8d0702af9..9b6a84902d 100644 --- a/nouislider/nouislider.d.ts +++ b/nouislider/nouislider.d.ts @@ -5,12 +5,10 @@ /// declare module noUiSlider { - interface Static { - /** - * To create a slider, call noUiSlider.create() with an element and your options. - */ - create(target: HTMLElement, options: Options): void; - } + /** + * To create a slider, call noUiSlider.create() with an element and your options. + */ + function create(target: HTMLElement, options: Options): void; interface Options { /** @@ -110,7 +108,7 @@ declare module noUiSlider { * Step Mode: The filter option can be used to filter the generated pips. * The filter function must return 0 (no value), 1 (large value) or 2 (small value). */ - filter?: (...args: any[]) => number; + filter?: (...args: any[]) => PipFilterResult; /** * format for step mode * see noUiSlider format @@ -128,6 +126,12 @@ declare module noUiSlider { stepped?: boolean; } + const enum PipFilterResult { + NoValue, + LargeValue, + SmallValue, + } + interface Callback { /** * Array for both one-handle and two-handle sliders. It contains the current slider values, @@ -170,6 +174,3 @@ declare module noUiSlider { noUiSlider: noUiSlider } } - -declare var noUiSlider: noUiSlider.Static; - From 6838547dc695db2882a8f1e9565b0c154d94ce1b Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 14:27:52 -0700 Subject: [PATCH 18/42] Fixed 'nodemailer' tests by adding 'service' property in 'nodemailer-smtp-transport'. --- .../nodemailer-smtp-transport.d.ts | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/nodemailer-smtp-transport/nodemailer-smtp-transport.d.ts b/nodemailer-smtp-transport/nodemailer-smtp-transport.d.ts index a12d66991b..3a4c626b0e 100644 --- a/nodemailer-smtp-transport/nodemailer-smtp-transport.d.ts +++ b/nodemailer-smtp-transport/nodemailer-smtp-transport.d.ts @@ -18,6 +18,40 @@ declare module "nodemailer-smtp-transport" { } export interface SmtpOptions { + /** + * Fills in certain SMTP configurations options (e.g. 'host', 'port', and 'secure') for + * well-known services. Possible values: + * - '1und1' + * - 'AOL' + * - 'DebugMail.io' + * - 'DynectEmail' + * - 'FastMail' + * - 'GandiMail' + * - 'Gmail' + * - 'Godaddy' + * - 'GodaddyAsia' + * - 'GodaddyEurope' + * - 'hot.ee' + * - 'Hotmail' + * - 'iCloud' + * - 'mail.ee' + * - 'Mail.ru' + * - 'Mailgun' + * - 'Mailjet' + * - 'Mandrill' + * - 'Naver' + * - 'Postmark' + * - 'QQ' + * - 'QQex' + * - 'SendCloud' + * - 'SendGrid' + * - 'SES' + * - 'Sparkpost' + * - 'Yahoo' + * - 'Yandex' + * - 'Zoho' + */ + service?: string; /** * is the port to connect to (defaults to 25 or 465) */ From 39907d8c4d6799d92fac0912f6453ae5c56cef25 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 14:33:07 -0700 Subject: [PATCH 19/42] Added missing options properties in 'node_redis'. --- node_redis/node_redis.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/node_redis/node_redis.d.ts b/node_redis/node_redis.d.ts index 8505556fb3..4328e299b9 100644 --- a/node_redis/node_redis.d.ts +++ b/node_redis/node_redis.d.ts @@ -17,6 +17,11 @@ declare module 'redis' { socket_nodelay?: boolean; no_ready_check?: boolean; enable_offline_queue?: boolean; + retry_max_delay?: number; + connect_timeout?: boolean; + max_attempts?: number; + auth_pass?: string; + family?: string; // "IPv4" | "IPv6" } interface Command { From 891e5f1f9615267fbdddaabe3abdf459f8fda002 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 14:40:08 -0700 Subject: [PATCH 20/42] Added indexer to 'InterpolationOptions' and fixed 'smart_count' type in 'node_polyglot'. --- node-polyglot/node-polyglot.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/node-polyglot/node-polyglot.d.ts b/node-polyglot/node-polyglot.d.ts index 0f5bd89229..7c29b745c7 100644 --- a/node-polyglot/node-polyglot.d.ts +++ b/node-polyglot/node-polyglot.d.ts @@ -6,8 +6,10 @@ declare module "node-polyglot" { module Polyglot { interface InterpolationOptions { - smart_count?: number; + smart_count?: number | { length: number }; _?: string; + + [interpolationKey: string]: any; } interface PolyglotOptions { From e7b7130b9587ba8579182d58d0170b65c5c880a4 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 14:49:10 -0700 Subject: [PATCH 21/42] Added 'extensions' to interface in 'mathjax'. --- mathjax/mathjax.d.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mathjax/mathjax.d.ts b/mathjax/mathjax.d.ts index 65c10e3ad4..d8b1cd0ef8 100644 --- a/mathjax/mathjax.d.ts +++ b/mathjax/mathjax.d.ts @@ -587,7 +587,7 @@ declare module jax { * These are found in the MathJax/jax directory. */ jax?:string[]; - /*A comma-separated list of extensions to load at startup. The default directory is MathJax/extensions. The + /*A list of extensions to load at startup. The default directory is MathJax/extensions. The * tex2jax and mml2jax preprocessors can be listed here, as well as a FontWarnings extension that you can use to * inform your user that mathematics fonts are available that they can download to improve their experience of * your site. @@ -1272,7 +1272,14 @@ declare module jax { * of a’s in MathJax’s equation buffer, the MAXBUFFER constant is used to limit the size of the string being * processed by MathJax. It is set to 5KB, which should be sufficient for any reasonable equation. */ - MAXBUFFER?:number; + MAXBUFFER?: number; + + /*A list of extensions to load at startup. The default directory is MathJax/extensions. The + * tex2jax and mml2jax preprocessors can be listed here, as well as a FontWarnings extension that you can use to + * inform your user that mathematics fonts are available that they can download to improve their experience of + * your site. + */ + extensions?: string[]; } export interface IEquationNumbers { From c94a7f9e18e6efec287b0e06f6e53430f1d24695 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 14:51:46 -0700 Subject: [PATCH 22/42] Fixed comments/types of properties in 'mathjax'. --- mathjax/mathjax.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mathjax/mathjax.d.ts b/mathjax/mathjax.d.ts index d8b1cd0ef8..3331688bb6 100644 --- a/mathjax/mathjax.d.ts +++ b/mathjax/mathjax.d.ts @@ -582,7 +582,7 @@ declare module jax { asciimath2jax?:IAsciimath2jaxPreprocessor; mml2jax?:IMML2jaxPreprocessor; tex2jax?:ITEX2jaxPreprocessor; - /*A comma-separated list of input and output jax to initialize at startup. Their main code is loaded only when + /*A list of input and output jax to initialize at startup. Their main code is loaded only when * they are actually used, so it is not inefficient to include jax that may not actually be used on the page. * These are found in the MathJax/jax directory. */ @@ -593,16 +593,16 @@ declare module jax { * your site. */ extensions?:string[]; - /*A comma-separated list of configuration files to load when MathJax starts up, e.g., to define local macros, + /*A list of configuration files to load when MathJax starts up, e.g., to define local macros, * etc., and there is a sample config file named config/local/local.js. The default directory is the * MathJax/config directory. The MMLorHTML.js configuration is one such configuration file, and there are a * number of other pre-defined configurations (see Using a configuration file for more details). */ config?:string[]; - /*A comma-separated list of CSS stylesheet files to be loaded when MathJax starts up. The default directory is + /*A list of CSS stylesheet files to be loaded when MathJax starts up. The default directory is * the MathJax/config directory. */ - styleSheets?:string; + styleSheets?:string[]; /*CSS styles to be defined dynamically at startup time. These are in the form selector:rules (see CSS Style * Objects for complete details). */ @@ -1274,7 +1274,7 @@ declare module jax { */ MAXBUFFER?: number; - /*A list of extensions to load at startup. The default directory is MathJax/extensions. The + /*A comma-separated list of extensions to load at startup. The default directory is MathJax/extensions. The * tex2jax and mml2jax preprocessors can be listed here, as well as a FontWarnings extension that you can use to * inform your user that mathematics fonts are available that they can download to improve their experience of * your site. From b2057ec97410f338dfae5f2dd8aee22d133420c8 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 14:53:34 -0700 Subject: [PATCH 23/42] Added 'mpContext' and 'mpMouse' to menu settings type in 'mathjax'. --- mathjax/mathjax.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mathjax/mathjax.d.ts b/mathjax/mathjax.d.ts index 3331688bb6..f49a8435bc 100644 --- a/mathjax/mathjax.d.ts +++ b/mathjax/mathjax.d.ts @@ -549,7 +549,10 @@ declare module jax { * from “Show Source” and put it into a page that uses MathJax’s MathML input jax and expect to get the same * results as the original TeX. (Without this, there may be some spacing differences.) */ - texHints?:boolean; + texHints?: boolean; + + mpContext?: boolean; + mpMouse?: boolean; } export interface IErrorSettings { From 85cafebc415e89825478aae0cef64ea026539f82 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 15:02:04 -0700 Subject: [PATCH 24/42] Adds missing properties of interface in 'jquerymobile'. --- jquerymobile/jquerymobile.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jquerymobile/jquerymobile.d.ts b/jquerymobile/jquerymobile.d.ts index f07c73fc34..393c3d9725 100644 --- a/jquerymobile/jquerymobile.d.ts +++ b/jquerymobile/jquerymobile.d.ts @@ -161,7 +161,7 @@ interface CheckboxRadioOptions { } interface CheckboxRadioEvents { - createp?: JQueryMobileEvent; + create?: JQueryMobileEvent; } interface SelectMenuOptions { @@ -184,7 +184,11 @@ interface SelectMenuEvents { } interface ListViewOptions { + autodividers?: boolean; + autodividersSelector?: (jq?: JQuery) => string; countTheme?: string; + defaults?: boolean; + disabled?: boolean; dividerTheme?: string; filter?: boolean; filterCallback?: Function; From ef1525d01ed85f67619fcaed491b66ec49320133 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 15:06:42 -0700 Subject: [PATCH 25/42] Fixed definitions/tests for 'jquery.gridster'. --- jquery.gridster/gridster-tests.ts | 2 +- jquery.gridster/gridster.d.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/jquery.gridster/gridster-tests.ts b/jquery.gridster/gridster-tests.ts index 72c90a6f08..80c71e5359 100644 --- a/jquery.gridster/gridster-tests.ts +++ b/jquery.gridster/gridster-tests.ts @@ -16,7 +16,7 @@ var options: GridsterOptions = { } }; -var gridster = $('.gridster ul').gridster(options).data('grister'); +let gridster: Gridster = $('.gridster ul').gridster(options).data('gridster'); gridster.add_widget('
  • The HTML of the widget...
  • ', 2, 1); gridster.remove_widget($('gridster li').eq(3).get(0)); var json = gridster.serialize(); diff --git a/jquery.gridster/gridster.d.ts b/jquery.gridster/gridster.d.ts index e003f0ebcc..abbb4c8e00 100644 --- a/jquery.gridster/gridster.d.ts +++ b/jquery.gridster/gridster.d.ts @@ -248,3 +248,7 @@ interface Gridster { **/ disable(): Gridster; } + +interface JQuery { + data(key: "gridster"): Gridster; +} \ No newline at end of file From 5dfb8d9e90e019cdc712efce11ef4f421697372c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 15:09:20 -0700 Subject: [PATCH 26/42] Reorder overloads for better error experience in 'jquery.fancytree'. --- jquery.fancytree/jquery.fancytree.d.ts | 48 +++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/jquery.fancytree/jquery.fancytree.d.ts b/jquery.fancytree/jquery.fancytree.d.ts index 34a9f14224..0167e80ed3 100644 --- a/jquery.fancytree/jquery.fancytree.d.ts +++ b/jquery.fancytree/jquery.fancytree.d.ts @@ -217,30 +217,6 @@ declare module Fancytree { //#endregion //#region Methods - /** - * Append (or insert) a single child node. - * - * @param child node to add - * @param insertBefore child node to insert this node before. If omitted, the new child is appended. - * @returns The child added. - */ - addChildren(child: Fancytree.NodeData, insertBefore?: FancytreeNode): FancytreeNode; - /** - * Append (or insert) a single child node. - * - * @param child node to add - * @param insertBefore key of the child node to insert this node before. If omitted, the new child is appended. - * @returns The child added. - */ - addChildren(child: Fancytree.NodeData, insertBefore?: string): FancytreeNode; - /** - * Append (or insert) a single child node. - * - * @param child node to add - * @param insertBefore index of the child node to insert this node before. If omitted, the new child is appended. - * @returns The child added. - */ - addChildren(child: Fancytree.NodeData, insertBefore?: number): FancytreeNode; /** * Append (or insert) a list of child nodes. * @@ -265,6 +241,30 @@ declare module Fancytree { * @returns The first child added. */ addChildren(children: Fancytree.NodeData[], insertBefore?: number): FancytreeNode; + /** + * Append (or insert) a single child node. + * + * @param child node to add + * @param insertBefore child node to insert this node before. If omitted, the new child is appended. + * @returns The child added. + */ + addChildren(child: Fancytree.NodeData, insertBefore?: FancytreeNode): FancytreeNode; + /** + * Append (or insert) a single child node. + * + * @param child node to add + * @param insertBefore key of the child node to insert this node before. If omitted, the new child is appended. + * @returns The child added. + */ + addChildren(child: Fancytree.NodeData, insertBefore?: string): FancytreeNode; + /** + * Append (or insert) a single child node. + * + * @param child node to add + * @param insertBefore index of the child node to insert this node before. If omitted, the new child is appended. + * @returns The child added. + */ + addChildren(child: Fancytree.NodeData, insertBefore?: number): FancytreeNode; /** Append or prepend a node, or append a child node. This a convenience function that calls addChildren() From b2b1359d8bd396e1b937771de131ec3d17a43515 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 15:11:50 -0700 Subject: [PATCH 27/42] Add 'icon' property to an interface in 'jquery.fancytree'. --- jquery.fancytree/jquery.fancytree.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/jquery.fancytree/jquery.fancytree.d.ts b/jquery.fancytree/jquery.fancytree.d.ts index 0167e80ed3..32b8d2479e 100644 --- a/jquery.fancytree/jquery.fancytree.d.ts +++ b/jquery.fancytree/jquery.fancytree.d.ts @@ -780,6 +780,7 @@ declare module Fancytree { interface NodeData { /** node text (may contain HTML tags) */ title: string; + icon?: string; /** unique key for this node (auto-generated if omitted) */ key?: string; /** (reserved) */ From de6783d45dc4dcf75779bc27f1deee7e23b459cd Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 15:14:04 -0700 Subject: [PATCH 28/42] Added 'ignoreUndefined' property for rename options interface in 'joi'. --- joi/joi.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/joi/joi.d.ts b/joi/joi.d.ts index b784ad23d5..d3cc138f07 100644 --- a/joi/joi.d.ts +++ b/joi/joi.d.ts @@ -33,6 +33,8 @@ declare module 'joi' { multiple?: boolean; // if true, allows renaming a key over an existing key. Defaults to false. override?: boolean; + // if true, skip renaming of a key if it's undefined. Defaults to false. + ignoreUndefined?: boolean; } export interface EmailOptions { From c134c51a8fe8bd324bd82ef7eca377b567c097b1 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 15:17:40 -0700 Subject: [PATCH 29/42] JSDoc - time to jump for 'joi'. --- joi/joi.d.ts | 86 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 64 insertions(+), 22 deletions(-) diff --git a/joi/joi.d.ts b/joi/joi.d.ts index d3cc138f07..8c97e12162 100644 --- a/joi/joi.d.ts +++ b/joi/joi.d.ts @@ -8,63 +8,105 @@ declare module 'joi' { export interface ValidationOptions { - // when true, stops validation on the first error, otherwise returns all the errors found. Defaults to true. + /** + * when true, stops validation on the first error, otherwise returns all the errors found. Defaults to true. + */ abortEarly?: boolean; - // when true, attempts to cast values to the required types (e.g. a string to a number). Defaults to true. + /** + * when true, attempts to cast values to the required types (e.g. a string to a number). Defaults to true. + */ convert?: boolean; - // when true, allows object to contain unknown keys which are ignored. Defaults to false. + /** + * when true, allows object to contain unknown keys which are ignored. Defaults to false. + */ allowUnknown?: boolean; - // when true, ignores unknown keys with a function value. Defaults to false. + /** + * when true, ignores unknown keys with a function value. Defaults to false. + */ skipFunctions?: boolean; - // when true, unknown keys are deleted (only when value is an object). Defaults to false. + /** + * when true, unknown keys are deleted (only when value is an object). Defaults to false. + */ stripUnknown?: boolean; - // overrides individual error messages. Defaults to no override ({}). + /** + * overrides individual error messages. Defaults to no override ({}). + */ language?: Object; - // sets the default presence requirements. Supported modes: 'optional', 'required', and 'forbidden'. Defaults to 'optional'. + /** + * sets the default presence requirements. Supported modes: 'optional', 'required', and 'forbidden'. Defaults to 'optional'. + */ presence?: string; - // provides an external data set to be used in references + /** + * provides an external data set to be used in references + */ context?: Object; } export interface RenameOptions { - // if true, does not delete the old key name, keeping both the new and old keys in place. Defaults to false. + /** + * if true, does not delete the old key name, keeping both the new and old keys in place. Defaults to false. + */ alias?: boolean; - // if true, allows renaming multiple keys to the same destination where the last rename wins. Defaults to false. + /** + * if true, allows renaming multiple keys to the same destination where the last rename wins. Defaults to false. + */ multiple?: boolean; - // if true, allows renaming a key over an existing key. Defaults to false. + /** + * if true, allows renaming a key over an existing key. Defaults to false. + */ override?: boolean; - // if true, skip renaming of a key if it's undefined. Defaults to false. + /** + * if true, skip renaming of a key if it's undefined. Defaults to false. + */ ignoreUndefined?: boolean; } export interface EmailOptions { - // Numerical threshold at which an email address is considered invalid + /** + * Numerical threshold at which an email address is considered invalid + */ errorLevel?: number | boolean; - // Specifies a list of acceptable TLDs. + /** + * Specifies a list of acceptable TLDs. + */ tldWhitelist?: string[] | Object; - // Number of atoms required for the domain. Be careful since some domains, such as io, directly allow email. + /** + * Number of atoms required for the domain. Be careful since some domains, such as io, directly allow email. + */ minDomainAtoms?: number; } export interface IpOptions { - // One or more IP address versions to validate against. Valid values: ipv4, ipv6, ipvfuture + /** + * One or more IP address versions to validate against. Valid values: ipv4, ipv6, ipvfuture + */ version ?: string | string[]; - // Used to determine if a CIDR is allowed or not. Valid values: optional, required, forbidden + /** + * Used to determine if a CIDR is allowed or not. Valid values: optional, required, forbidden + */ cidr?: string; } export interface UriOptions { - // Specifies one or more acceptable Schemes, should only include the scheme name. - // Can be an Array or String (strings are automatically escaped for use in a Regular Expression). + /** + * Specifies one or more acceptable Schemes, should only include the scheme name. + * Can be an Array or String (strings are automatically escaped for use in a Regular Expression). + */ scheme ?: string | RegExp | Array; } export interface WhenOptions { - // the required condition joi type. + /** + * the required condition joi type. + */ is: Schema; - // the alternative schema type if the condition is true. Required if otherwise is missing. + /** + * the alternative schema type if the condition is true. Required if otherwise is missing. + */ then?: Schema; - // the alternative schema type if the condition is false. Required if then is missing + /** + * the alternative schema type if the condition is false. Required if then is missing + */ otherwise?: Schema; } From 93767f845ccc4c814ed66a3c94dd84078ab93e9e Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 15:27:25 -0700 Subject: [PATCH 30/42] Added 'backlight' property to LCD options for 'johnny-five'. --- johnny-five/johnny-five.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/johnny-five/johnny-five.d.ts b/johnny-five/johnny-five.d.ts index 9dd1477eb4..e2c2c1c30a 100644 --- a/johnny-five/johnny-five.d.ts +++ b/johnny-five/johnny-five.d.ts @@ -251,10 +251,12 @@ declare module "johnny-five" { export interface LCDI2COption extends LCDGeneralOption{ controller: string; + backlight?: number; } export interface LCDParallelOption extends LCDGeneralOption{ pins: Array; + backlight?: number; } export class LCD{ From 985b3ce3a4c97dd249beaab20b2e6d1ec6fa8b39 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 15:45:46 -0700 Subject: [PATCH 31/42] Add 'metadataStore' property to 'breeze'. --- breeze/breeze.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/breeze/breeze.d.ts b/breeze/breeze.d.ts index 4821ed427e..139a306299 100644 --- a/breeze/breeze.d.ts +++ b/breeze/breeze.d.ts @@ -459,6 +459,7 @@ declare module breeze { interface EntityManagerProperties { serviceName?: string; dataService?: DataService; + metadataStore?: MetadataStore; queryOptions?: QueryOptions; saveOptions?: SaveOptions; validationOptions?: ValidationOptions; From 2ffc0452e5ffaf40b0ebee29094f39a87c5e3aac Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 16:27:21 -0700 Subject: [PATCH 32/42] Fixed definitions for 'js-data'. --- js-data/js-data.d.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/js-data/js-data.d.ts b/js-data/js-data.d.ts index bec41d331d..e17c4ae0d4 100644 --- a/js-data/js-data.d.ts +++ b/js-data/js-data.d.ts @@ -115,7 +115,17 @@ declare module JSData { } interface DSAdapterOperationConfiguration extends DSConfiguration { - adapter?: string + adapter?: string; + bypassCache?: boolean; + cacheResponse?: boolean; + findStrategy?: string; + findFallbackAdapters?: string[]; + strategy?: string; + fallbackAdapters?: string[]; + + params: { + [paramName: string]: string | number | boolean; + }; } interface DSSaveConfiguration extends DSAdapterOperationConfiguration { @@ -156,7 +166,8 @@ declare module JSData { digest():void; eject(id:string | number, options?:DSConfiguration):T; ejectAll(params:DSFilterParams, options?:DSConfiguration):Array; - filter(params:DSFilterParams, options?:DSConfiguration):Array; + filter(params: DSFilterParams, options?: DSConfiguration): Array; + filter(params: DSFilterParamsForAllowSimpleWhere, options?: DSConfiguration): Array; get(id:string | number, options?:DSConfiguration):T; getAll(ids?:Array):Array; hasChanges(id:string | number):boolean; @@ -184,6 +195,10 @@ declare module JSData { sort?: string | Array | Array>; } + interface DSFilterParamsForAllowSimpleWhere { + [key: string]: string | number; + } + interface IDSResourceLifecycleValidateEventHandlers { beforeValidate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; validate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; From 7ed5ae7715b98719e4fad15fc0fdaa1a72d2a494 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 17:36:47 -0700 Subject: [PATCH 33/42] Add indexer for 'node-azure'. --- node-azure/azure.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/node-azure/azure.d.ts b/node-azure/azure.d.ts index 7e52a8be3a..c7818d0b63 100644 --- a/node-azure/azure.d.ts +++ b/node-azure/azure.d.ts @@ -1627,6 +1627,7 @@ declare module "azure" { RowKey: string; Timestamp?: Date; etag?: string; + [property: string]: string | number | boolean | Date; } //#endregion //#region BlobService Interfaces From 58a1b6b8487a4532d528dd1d334694d59863562c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 17:44:51 -0700 Subject: [PATCH 34/42] Added index signatures to prototype objects in 'blocks'. --- blocks/blocks.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blocks/blocks.d.ts b/blocks/blocks.d.ts index ad492333e6..6e57ec762b 100644 --- a/blocks/blocks.d.ts +++ b/blocks/blocks.d.ts @@ -579,6 +579,8 @@ interface ViewPrototype { route?: any; url?: string }; + + [propertyName: string]: any; } ///////////////////////////////////////// @@ -643,6 +645,8 @@ interface ModelPrototype { destroy?: { url?: string }; update?: { url?: string }; }; + + [propertyName: string]: string | boolean | Object | Validator; } ///////////////////////////////////////// @@ -682,6 +686,7 @@ interface CollectionPrototype { destroy?: { url?: string }; update?: { url?: string }; }; + [propertyName: string]: any; } interface Extendable { From 8423202086f79d9f13609fb228eb26ee5e6756d0 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 18:23:07 -0700 Subject: [PATCH 35/42] Added what appears to be an undocumented but used property in 'ace'. --- ace/ace.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ace/ace.d.ts b/ace/ace.d.ts index f0668da3c4..bedcfee545 100644 --- a/ace/ace.d.ts +++ b/ace/ace.d.ts @@ -18,7 +18,9 @@ declare module AceAjax { bindKey:any; - exec:Function; + exec: Function; + + readOnly?: boolean; } export interface CommandManager { From 683a463333639e64a69dde18f8dba53f84aafd8b Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 18:28:42 -0700 Subject: [PATCH 36/42] Fixed types for 'globalization.dateToString' in 'cordova'. --- cordova/plugins/Globalization.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cordova/plugins/Globalization.d.ts b/cordova/plugins/Globalization.d.ts index bb9cd2f4ab..f49e2bf4b0 100644 --- a/cordova/plugins/Globalization.d.ts +++ b/cordova/plugins/Globalization.d.ts @@ -41,12 +41,17 @@ interface Globalization { * @param onError Called on error with a GlobalizationError object. * The error's expected code is GlobalizationError.FORMATTING_ERROR. * @param options Optional format parameters. Default {formatLength:'short', selector:'date and time'} + * - 'formatLength' can be "short", "medium", "long", or "full". + * - 'selector' can be "date", "time", or "date and time". */ dateToString( date: Date, onSuccess: (date: { value: string; }) => void, onError: (error: GlobalizationError) => void, - options?: { type?: string; item?: string; }): void; + options?: { + formatLength?: string; // "short" | "medium" | "long" | "full" + selector?: string; // "date" | "time" | "date and time" + }): void; /** * Parses a date formatted as a string, according to the client's user preferences * and calendar using the time zone of the client, and returns the corresponding date object. From 5f2a6b0dc360fdbd09a9b8e16ad3e6aad919837a Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 21 Aug 2015 18:37:40 -0700 Subject: [PATCH 37/42] Fixed tests, use proper interface, in 'peerjs'. --- peerjs/peerjs-tests.ts | 11 +++++++---- peerjs/peerjs.d.ts | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/peerjs/peerjs-tests.ts b/peerjs/peerjs-tests.ts index 3b99471c78..dee76d9e2f 100644 --- a/peerjs/peerjs-tests.ts +++ b/peerjs/peerjs-tests.ts @@ -4,8 +4,10 @@ var peerByOption: PeerJs.Peer = new Peer({ key: 'peerKey', debug: 3, - logFunction: ()=>{ - } +}); + +peerByOption.on("connection", dataConnection => { + var type: string = dataConnection.type; }); peerByOption.listAllPeers(function(items){ @@ -21,9 +23,10 @@ var peerByIdAndOption: PeerJs.Peer = new Peer( { key: 'peerKey', debug: 3, - logFunction: ()=>{ - } }); +peerByIdAndOption.on("call", mediaConnection => { + var isOpen: boolean = mediaConnection.open; +}); var id = peerByOption.id; var connections = peerByOption.connections; diff --git a/peerjs/peerjs.d.ts b/peerjs/peerjs.d.ts index b87d3bc872..7db935ffbf 100644 --- a/peerjs/peerjs.d.ts +++ b/peerjs/peerjs.d.ts @@ -78,7 +78,7 @@ declare module PeerJs{ * @param id The brokering ID of the remote peer (their peer.id). * @param options for specifying details about Peer Connection */ - connect(id: string, options?: PeerJs.PeerJSOption): PeerJs.DataConnection; + connect(id: string, options?: PeerJs.PeerConnectOption): PeerJs.DataConnection; /** * Connects to the remote peer specified by id and returns a data connection. * @param id The brokering ID of the remote peer (their peer.id). From 948a63a0adb839d35be91dc505ba0b4e004b247a Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 24 Aug 2015 12:23:29 -0700 Subject: [PATCH 38/42] Made the 'pips' property optional in 'nouislider'. --- nouislider/nouislider.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nouislider/nouislider.d.ts b/nouislider/nouislider.d.ts index 9b6a84902d..e632159818 100644 --- a/nouislider/nouislider.d.ts +++ b/nouislider/nouislider.d.ts @@ -77,7 +77,7 @@ declare module noUiSlider { /** * Allows you to generate points along the slider. */ - pips: PipsOptions; + pips?: PipsOptions; } interface PipsOptions { From a662c2649a7de0195e776a04065fd0bc57f1fa16 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 24 Aug 2015 12:23:57 -0700 Subject: [PATCH 39/42] Use 'let' instead of 'var' in definitions for 'parse'. --- parse/parse.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/parse/parse.d.ts b/parse/parse.d.ts index f5f7ad4a0b..eae08b1c4e 100644 --- a/parse/parse.d.ts +++ b/parse/parse.d.ts @@ -867,9 +867,7 @@ declare namespace Parse { * * import Buffer = require("buffer").Buffer; */ - let HTTPOptions: { - new (): HTTPOptions; - }; + var HTTPOptions: new () => HTTPOptions; interface HTTPOptions extends FunctionResponse { /** * The body of the request. From 1ba21f73e4104d567d64c03c89604e5960ae7f93 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 24 Aug 2015 16:03:03 -0700 Subject: [PATCH 40/42] 'BackboneStyleOptions' -> 'SuccessFailureOptions' in 'parse'. --- parse/parse.d.ts | 68 ++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/parse/parse.d.ts b/parse/parse.d.ts index eae08b1c4e..399204ce2a 100644 --- a/parse/parse.d.ts +++ b/parse/parse.d.ts @@ -23,7 +23,7 @@ declare namespace Parse { error?: Function; } - interface BackboneStyleOptions extends SuccessOption, ErrorOption { + interface SuccessFailureOptions extends SuccessOption, ErrorOption { } interface WaitOption { @@ -183,7 +183,7 @@ declare namespace Parse { constructor(name: string, data: any, type?: string); name(): string; url(): string; - save(options?: BackboneStyleOptions): Promise; + save(options?: SuccessFailureOptions): Promise; } @@ -217,7 +217,7 @@ declare namespace Parse { constructor(arg1?: any, arg2?: any); - current(options?: BackboneStyleOptions): GeoPoint; + current(options?: SuccessFailureOptions): GeoPoint; radiansTo(point: GeoPoint): number; kilometersTo(point: GeoPoint): number; milesTo(point: GeoPoint): number; @@ -316,8 +316,8 @@ declare namespace Parse { constructor(attributes?: string[], options?: any); static extend(className: string, protoProps?: any, classProps?: any): any; - static fetchAll(list: Object[], options: BackboneStyleOptions): Promise; - static fetchAllIfNeeded(list: Object[], options: BackboneStyleOptions): Promise; + static fetchAll(list: Object[], options: SuccessFailureOptions): Promise; + static fetchAllIfNeeded(list: Object[], options: SuccessFailureOptions): Promise; static destroyAll(list: Object[], options?: Object.DestroyAllOptions): Promise; static saveAll(list: Object[], options?: Object.SaveAllOptions): Promise; @@ -347,21 +347,21 @@ declare namespace Parse { remove(attr: string, item: any): any; save(options?: Object.SaveOptions, arg2?: any, arg3?: any): Promise; set(key: string, value: any, options?: Object.SetOptions): boolean; - setACL(acl: ACL, options?: BackboneStyleOptions): boolean; + setACL(acl: ACL, options?: SuccessFailureOptions): boolean; unset(attr: string, options?: any): any; - validate(attrs: any, options?: BackboneStyleOptions): boolean; + validate(attrs: any, options?: SuccessFailureOptions): boolean; } namespace Object { - interface DestroyOptions extends BackboneStyleOptions, WaitOption, UseMasterKeyOption { } + interface DestroyOptions extends SuccessFailureOptions, WaitOption, UseMasterKeyOption { } - interface DestroyAllOptions extends BackboneStyleOptions, UseMasterKeyOption { } + interface DestroyAllOptions extends SuccessFailureOptions, UseMasterKeyOption { } - interface FetchOptions extends BackboneStyleOptions, UseMasterKeyOption { } + interface FetchOptions extends SuccessFailureOptions, UseMasterKeyOption { } - interface SaveOptions extends BackboneStyleOptions, SilentOption, UseMasterKeyOption, WaitOption { } + interface SaveOptions extends SuccessFailureOptions, SilentOption, UseMasterKeyOption, WaitOption { } - interface SaveAllOptions extends BackboneStyleOptions, UseMasterKeyOption { } + interface SaveAllOptions extends SuccessFailureOptions, UseMasterKeyOption { } interface SetOptions extends ErrorOption, SilentOption { promise?: any; @@ -452,10 +452,10 @@ declare namespace Parse { at?: number; } - interface CreateOptions extends BackboneStyleOptions, WaitOption, SilentOption, UseMasterKeyOption { + interface CreateOptions extends SuccessFailureOptions, WaitOption, SilentOption, UseMasterKeyOption { } - interface FetchOptions extends BackboneStyleOptions, SilentOption, UseMasterKeyOption { } + interface FetchOptions extends SuccessFailureOptions, SilentOption, UseMasterKeyOption { } interface RemoveOptions extends SilentOption { } @@ -583,7 +583,7 @@ declare namespace Parse { doesNotExist(key: string): Query; doesNotMatchKeyInQuery(key: string, queryKey: string, query: Query): Query; doesNotMatchQuery(key: string, query: Query): Query; - each(callback: Function, options?: BackboneStyleOptions): Promise; + each(callback: Function, options?: SuccessFailureOptions): Promise; endsWith(key: string, suffix: string): Query; equalTo(key: string, value: any): Query; exists(key: string): Query; @@ -613,10 +613,10 @@ declare namespace Parse { } namespace Query { - interface CountOptions extends BackboneStyleOptions, UseMasterKeyOption { } - interface FindOptions extends BackboneStyleOptions, UseMasterKeyOption { } - interface FirstOptions extends BackboneStyleOptions, UseMasterKeyOption { } - interface GetOptions extends BackboneStyleOptions, UseMasterKeyOption { } + interface CountOptions extends SuccessFailureOptions, UseMasterKeyOption { } + interface FindOptions extends SuccessFailureOptions, UseMasterKeyOption { } + interface FirstOptions extends SuccessFailureOptions, UseMasterKeyOption { } + interface GetOptions extends SuccessFailureOptions, UseMasterKeyOption { } } /** @@ -639,7 +639,7 @@ declare namespace Parse { getRoles(): Relation; getUsers(): Relation; getName(): string; - setName(name: string, options?: BackboneStyleOptions): any; + setName(name: string, options?: SuccessFailureOptions): any; } /** @@ -692,27 +692,27 @@ declare namespace Parse { class User extends Object { static current(): User; - static signUp(username: string, password: string, attrs: any, options?: BackboneStyleOptions): Promise; - static logIn(username: string, password: string, options?: BackboneStyleOptions): Promise; + static signUp(username: string, password: string, attrs: any, options?: SuccessFailureOptions): Promise; + static logIn(username: string, password: string, options?: SuccessFailureOptions): Promise; static logOut(): Promise; static allowCustomUserClass(isAllowed: boolean): void; - static become(sessionToken: string, options?: BackboneStyleOptions): Promise; - static requestPasswordReset(email: string, options?: BackboneStyleOptions): Promise; + static become(sessionToken: string, options?: SuccessFailureOptions): Promise; + static requestPasswordReset(email: string, options?: SuccessFailureOptions): Promise; - signUp(attrs: any, options?: BackboneStyleOptions): Promise; - logIn(options?: BackboneStyleOptions): Promise; - fetch(options?: BackboneStyleOptions): Promise; + signUp(attrs: any, options?: SuccessFailureOptions): Promise; + logIn(options?: SuccessFailureOptions): Promise; + fetch(options?: SuccessFailureOptions): Promise; save(arg1: any, arg2: any, arg3: any): Promise; authenticated(): boolean; isCurrent(): boolean; getEmail(): string; - setEmail(email: string, options: BackboneStyleOptions): boolean; + setEmail(email: string, options: SuccessFailureOptions): boolean; getUsername(): string; - setUsername(username: string, options?: BackboneStyleOptions): boolean; + setUsername(username: string, options?: SuccessFailureOptions): boolean; - setPassword(password: string, options?: BackboneStyleOptions): boolean; + setPassword(password: string, options?: SuccessFailureOptions): boolean; getSessionToken(): string; } @@ -785,9 +785,9 @@ declare namespace Parse { function init(options?: any): void; function isLinked(user: User): boolean; - function link(user: User, permissions: any, options?: BackboneStyleOptions): void; - function logIn(permissions: any, options?: BackboneStyleOptions): void; - function unlink(user: User, options?: BackboneStyleOptions): void; + function link(user: User, permissions: any, options?: SuccessFailureOptions): void; + function logIn(permissions: any, options?: SuccessFailureOptions): void; + function unlink(user: User, options?: SuccessFailureOptions): void; } /** @@ -859,7 +859,7 @@ declare namespace Parse { function define(name: string, func?: (request: FunctionRequest, response: FunctionResponse) => void): void; function httpRequest(options: HTTPOptions): Promise; function job(name: string, func?: (request: JobRequest, status: JobStatus) => void): HttpResponse; - function run(name: string, data?: any, options?: BackboneStyleOptions): Promise; + function run(name: string, data?: any, options?: SuccessFailureOptions): Promise; function useMasterKey(): void; /** From 1d6c126e8ead25892ded5a32df2e813ffad06905 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 24 Aug 2015 18:06:19 -0700 Subject: [PATCH 41/42] Removed inappropriate overloads in 'jquery.gridster' and 'royalslider', fixed JQuery overload for 'data' in 'jquery'. --- jquery.gridster/gridster-tests.ts | 2 +- jquery.gridster/gridster.d.ts | 4 ---- jquery/jquery.d.ts | 12 ++++++------ royalslider/royalslider-tests.ts | 2 +- royalslider/royalslider.d.ts | 2 -- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/jquery.gridster/gridster-tests.ts b/jquery.gridster/gridster-tests.ts index 80c71e5359..3672c9555f 100644 --- a/jquery.gridster/gridster-tests.ts +++ b/jquery.gridster/gridster-tests.ts @@ -16,7 +16,7 @@ var options: GridsterOptions = { } }; -let gridster: Gridster = $('.gridster ul').gridster(options).data('gridster'); +var gridster: Gridster = $('.gridster ul').gridster(options).data('gridster'); gridster.add_widget('
  • The HTML of the widget...
  • ', 2, 1); gridster.remove_widget($('gridster li').eq(3).get(0)); var json = gridster.serialize(); diff --git a/jquery.gridster/gridster.d.ts b/jquery.gridster/gridster.d.ts index abbb4c8e00..e003f0ebcc 100644 --- a/jquery.gridster/gridster.d.ts +++ b/jquery.gridster/gridster.d.ts @@ -248,7 +248,3 @@ interface Gridster { **/ disable(): Gridster; } - -interface JQuery { - data(key: "gridster"): Gridster; -} \ No newline at end of file diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 3599c808fa..ad9e934551 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -1545,18 +1545,18 @@ interface JQuery { * @param value The new data value; it can be any Javascript type including Array or Object. */ data(key: string, value: any): JQuery; - /** - * Store arbitrary data associated with the matched elements. - * - * @param obj An object of key-value pairs of data to update. - */ - data(obj: { [key: string]: any; }): JQuery; /** * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. * * @param key Name of the data stored. */ data(key: string): any; + /** + * Store arbitrary data associated with the matched elements. + * + * @param obj An object of key-value pairs of data to update. + */ + data(obj: { [key: string]: any; }): JQuery; /** * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. */ diff --git a/royalslider/royalslider-tests.ts b/royalslider/royalslider-tests.ts index 88e44a6fba..4246ec90b3 100644 --- a/royalslider/royalslider-tests.ts +++ b/royalslider/royalslider-tests.ts @@ -100,7 +100,7 @@ jQuery(document).ready(function () { // Another example: $(".royalSlider").royalSlider('goTo', 3); // But it's recommended to get instance once if you have many calls: -var slider = $(".royalSlider").royalSlider().data('royalSlider'); +var slider: RoyalSlider.RoyalSlider = $(".royalSlider").royalSlider().data('royalSlider'); slider.goTo(3); // go to slide with id slider.next(); // next slide diff --git a/royalslider/royalslider.d.ts b/royalslider/royalslider.d.ts index 3f06b41b58..5dd7c2771f 100644 --- a/royalslider/royalslider.d.ts +++ b/royalslider/royalslider.d.ts @@ -493,6 +493,4 @@ interface JQuery { * @param options The options */ royalSlider(options?: RoyalSlider.RoyalSliderOptions): JQuery; - - data(key: "royalSlider"): RoyalSlider.RoyalSlider; } \ No newline at end of file From 50f7b715e91e0faa19a1f430f6acfcf018158161 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 25 Aug 2015 12:22:04 -0700 Subject: [PATCH 42/42] Add missing 'params' property to 'parse'. --- parse/parse.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/parse/parse.d.ts b/parse/parse.d.ts index 399204ce2a..13fa65842c 100644 --- a/parse/parse.d.ts +++ b/parse/parse.d.ts @@ -890,6 +890,10 @@ declare namespace Parse { *The method of the request (i.e GET, POST, etc). */ method?: string; + /** + * The query portion of the url. + */ + params?: any; /** * The url to send the request to. */