From 3bf516e434ed1894b9b646ac1aa3be1db40e6e61 Mon Sep 17 00:00:00 2001 From: damianog Date: Sat, 7 Sep 2013 20:24:58 +0200 Subject: [PATCH 001/537] Update node.d.ts headers return an object http://nodejs.org/api/http.html#http_message_headers --- node/node.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/node.d.ts b/node/node.d.ts index 8aa2f7beb..f6a321ee8 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -255,7 +255,7 @@ declare module "http" { export interface ServerRequest extends events.NodeEventEmitter, stream.ReadableStream { method: string; url: string; - headers: string; + headers: any; trailers: string; httpVersion: string; setEncoding(encoding?: string): void; From 64a51e86db17b9b82324cf67572f7cb5524857ac Mon Sep 17 00:00:00 2001 From: HowardRichards Date: Thu, 30 Jan 2014 14:10:37 +0000 Subject: [PATCH 002/537] Added additional definitions to Valerie Added ModelValidation types --- valerie/valerie-tests.ts | 12 +++- valerie/valerie.d.ts | 150 +++++++++++++++++++++++++++++++++------ 2 files changed, 139 insertions(+), 23 deletions(-) diff --git a/valerie/valerie-tests.ts b/valerie/valerie-tests.ts index bf9ce7880..22adc7a13 100644 --- a/valerie/valerie-tests.ts +++ b/valerie/valerie-tests.ts @@ -285,4 +285,14 @@ function RuleTests() { .rule(() => { return anyValue; }) .end(); -} \ No newline at end of file +} + +function ModelValidation() { + + var model = {}; + + var validatedModel = valerie.validatableModel(model) + .validateAll() + .end(); + +} diff --git a/valerie/valerie.d.ts b/valerie/valerie.d.ts index 847e0a7a0..1140d0a94 100644 --- a/valerie/valerie.d.ts +++ b/valerie/valerie.d.ts @@ -7,7 +7,10 @@ /** * - * Extensions to KO functions to provide validation + * Extensions to KO functions to provide validation + * + * Version 1.1 - added missing methods to ModelValidationState + * */ interface KnockoutObservable { // starts validation for observable @@ -23,7 +26,6 @@ interface KnockoutObservableArray { validate(validationOptions?: Valerie.ValidationOptions): Valerie.PropertyValidationState>; } - interface KnockoutObservableArrayFunctions { /** * Creates and sets a model validation state on a Knockout observable array.
@@ -198,8 +200,6 @@ interface KnockoutBindingHandlers { visibleWhenValid: KnockoutBindingHandler; } - - // // root valerie namespace - static methods // @@ -208,12 +208,10 @@ declare var valerie: Valerie.Static; // additional types for Valerie (all inside this namespace) declare module Valerie { - // // Static methods on valerie namespace // interface Static { - /** * Maps a source model to a destination model, including only applicable properties * @param {Object|Array} sourceModel the source model @@ -263,10 +261,128 @@ declare module Valerie { // ctor new: (model: any, options?: ModelValidationStateOptions) => ModelValidationState; - addValidationStates(validationStateOrStates: any): void; - model: any; options?: ModelValidationStateOptions + + // methods + + /** + * Adds validation states to this validation state.
+ * [fluent] + * @name valerie.ModelValidationState#addValidationStates + * @fluent + * @param {object|array.} validationStateOrStates the validation states to add + * @return {valerie.ModelValidationState} + */ + addValidationStates(validationStateOrStates: any): ModelValidationState; + + /** + * Sets the value or function used to determine if the model is applicable.
+ * [fluent] + * @name valerie.ModelValidationState#applicable + * @fluent + * @param {boolean|function} [valueOrFunction = true] the value or function to use + * @return {valerie.ModelValidationState} + */ + applicable(valueOrFunction: any): ModelValidationState; + + /** + * Clears the static summary of validation states that are in a failure state.
+ * [fluent] + * @name valerie.ModelValidationState#clearSummary + * @fluent + * @param {boolean} [clearSubModelSummaries = false] whether to clear the static summaries for sub-models + * @return {valerie.ModelValidationState} + */ + clearSummary(valueOrFunction: any): ModelValidationState; + + /** + * Includes any validation failures for this model in a validation summary.
+ * [fluent] + * @fluent + * @return {valerie.ModelValidationState} + */ + includeInSummary(): ModelValidationState; + + /** + * Sets the value or function used to determine the name of the model.
+ * [fluent] + * @fluent + * @param {string|function} valueOrFunction the value or function to use + * @return {valerie.ModelValidationState} + */ + name(valueOrFunction: any): ModelValidationState; + + /** + * Removes validation states.
+ * [fluent] + * @fluent + * @param {object|array.} validationStateOrStates the validation states to remove + * @return {valerie.ModelValidationState} + */ + removeValidationStates(validationStateOrStates: any): ModelValidationState; + + /** + * Stops validating the given sub-model by adding the validation state that belongs to it. + * @param {*} validatableSubModel the sub - model to start validating + * @return {valerie.ModelValidationState } + */ + startValidatingSubModel(validatableSubModel: any): ModelValidationState; + + /** + * Stops validating the given sub-model by removing the validation state that belongs to it. + * @param {*} validatableSubModel the sub-model to stop validating + * @return {valerie.ModelValidationState} + */ + stopValidatingSubModel(validatableSubModel: any): ModelValidationState; + + /** + * Updates the static summary of validation states that are in a failure state.
+ * [fluent] + * @fluent + * @param {boolean} [updateSubModelSummaries = false] whether to update the static summaries for sub-models + * @return {valerie.ModelValidationState} + */ + updateSummary(updateSubModelSummaries: boolean): ModelValidationState; + + /** + * Adds the validation states for all the descendant properties and sub-models that belong to the model.
+ * [fluent] + * @fluent + * @return {valerie.ModelValidationState} + */ + validateAll(): ModelValidationState; + + /** + * Adds the validation states for all the descendant properties that belong to the model.
+ * [fluent] + * @fluent + * @return {valerie.ModelValidationState} + */ + validateAllProperties(): ModelValidationState; + + /** + * Adds the validation states for all the child properties that belong to the model.
+ * [fluent] + * @fluent + * @return {valerie.ModelValidationState} + */ + validateChildProperties(): ModelValidationState; + + /** + * Adds the validation states for all the child properties and sub-models that belong to the model.
+ * [fluent] + * @fluent + * @return {valerie.ModelValidationState} + */ + validateChildPropertiesAndSubModels(): ModelValidationState; + + + /** + * Ends a chain of fluent method calls on this model validation state. + * @return {function} the model the validation state is for + */ + end(): any; } // Construction options for a model validation state. @@ -282,7 +398,6 @@ declare module Valerie { // PropertyValidationState // interface PropertyValidationState { - // properties: // the observable or computed the validation state is for @@ -310,12 +425,12 @@ declare module Valerie { during(earliest: () => Date, latest: Date, options?: ValidationOptions): PropertyValidationState; // dateFN + date during(earliest: Date, latest: () => Date, options?: ValidationOptions): PropertyValidationState; // date + dateFN during(earliest: () => Date, latest: () => Date, options?: ValidationOptions): PropertyValidationState; // dateFN + dateFN - earliest(earliest: Date, options?: ValidationOptions): PropertyValidationState; // date value + earliest(earliest: Date, options?: ValidationOptions): PropertyValidationState; // date value earliest(earliest: () => Date, options?: ValidationOptions): PropertyValidationState; // date function email(): PropertyValidationState; entryFormat(format: string): PropertyValidationState; excludeFromSummary(): PropertyValidationState; - expression(regularExpression: RegExp, options?: ValidationOptions): PropertyValidationState; // regex + expression(regularExpression: RegExp, options?: ValidationOptions): PropertyValidationState; // regex expression(regularExpressionString: string, options?: ValidationOptions): PropertyValidationState; // regex string float(options?: ValidationOptions): PropertyValidationState; integer(options?: ValidationOptions): PropertyValidationState; @@ -377,7 +492,6 @@ declare module Valerie { touched(): boolean; // get touched state touched(value: boolean): boolean; // set touched state result(): ValidationResult; - } interface ValidationResult { @@ -390,7 +504,6 @@ declare module Valerie { //TODO: not added static members/methods createFailedResult(message: string): ValidationResult; - } interface IRule { @@ -411,7 +524,7 @@ declare module Valerie { } interface ValidatableModel { - name: (value:string) => PropertyValidationState; + name: (value: string) => PropertyValidationState; // return original observableArray end: () => T; @@ -438,7 +551,6 @@ declare module Valerie { // A helper for parsing and formatting numeric values. interface NumericHelper { - // Adds thousands separators to the given numeric string. addThousandsSeparator(numericString: string): string; @@ -468,13 +580,10 @@ declare module Valerie { // Unformats a numeric string; removes currency signs, thousands separators and normalises decimal separators. unformat(numericString: string): string; - } - interface ValidationState { - - // Finds and returns the validation states + // Finds and returns the validation states findIn(model: any, includeSubModels?: boolean, recurse?: boolean, @@ -486,15 +595,12 @@ declare module Valerie { // nforms if the given model, observable or computed has a validation state. has(modelOrObservableOrComputed: any): boolean; - // Sets the validation state for the given model, observable or computed. setFor(modelOrObservableOrComputed: any, state: IValidationState): void; - } } declare module Valerie.Rules { - /* Todo: add classes in valerie.rules namespace From 0737d4dccb2f285c50b77da91dcf526e6fcf5347 Mon Sep 17 00:00:00 2001 From: HowardRichards Date: Wed, 16 Apr 2014 14:30:07 +0100 Subject: [PATCH 003/537] Added more static valerie namespace definitions --- valerie/valerie-tests.ts | 37 +++++++++++ valerie/valerie.d.ts | 128 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 160 insertions(+), 5 deletions(-) diff --git a/valerie/valerie-tests.ts b/valerie/valerie-tests.ts index 22adc7a13..b33932e29 100644 --- a/valerie/valerie-tests.ts +++ b/valerie/valerie-tests.ts @@ -296,3 +296,40 @@ function ModelValidation() { .end(); } + +function UtilsStaticTests() { + + var t1 = valerie.utils.asArray(1); + var t2 = valerie.utils.asArray([1,2]); + + var t3 = valerie.utils.asFunction(1); + var t4 = valerie.utils.asFunction(() => { return 1; }); + + var t5 = valerie.utils.isArray([1, 2]); + var t5 = valerie.utils.isArrayOrObject(1); + var t6 = valerie.utils.isFunction("x"); + var t7 = valerie.utils.isMissing(null); + var t8 = valerie.utils.isObject({}); + var t9 = valerie.utils.isString("test"); + + var opts: Valerie.ValidationOptions = {}; // all values are optional + var t10 = valerie.utils.mergeOptions(opts, opts); +} + +function ValidationResultStaticTests() { + + var t1 = valerie.ValidationResult.passedInstance; + + var t2 = valerie.ValidationResult.createFailedResult("message"); + +} + +function ValidationStateStaticTests() { + + var t1 = valerie.validationState.findIn({}); + var t2 = valerie.validationState.getFor({}); + var t3 = valerie.validationState.has({}); + + var state = {}; + var t4 = valerie.validationState.setFor({}, state); +} diff --git a/valerie/valerie.d.ts b/valerie/valerie.d.ts index 1140d0a94..1514f3a4d 100644 --- a/valerie/valerie.d.ts +++ b/valerie/valerie.d.ts @@ -3,13 +3,13 @@ // Definitions by: Howard Richards // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// + /** * * Extensions to KO functions to provide validation * - * Version 1.1 - added missing methods to ModelValidationState + * Version 1.2 - added more static methods to valerie object * */ interface KnockoutObservable { @@ -246,9 +246,78 @@ declare module Valerie { // (value should be observable or computed) validatableProperty(value: T, options?: ValidationOptions): PropertyValidationState; + // Validation result class + ValidationResult: ValidationResultStatic; + // additional namespaces for static methods: + converters: ConvertersStatic; + + /* + //TODO: additional namespaces/statics not yet used + dom: DomStatic; + formatting: FormattingStatic; + koBindingsHelper: KoBindingsHelperStatic; + koExtras: KoExtrasStatic; + rules: RulesStatic; + */ + + utils: UtilsStatic; + validationState: ValidationState; + + } + + interface ValidationResultStatic { + + passedInstance: ValidationResult; + + // static method to create validatio failed message + createFailedResult(message: string): ValidationResult; + } + + // Contains converters, always singletons. + interface ConvertersStatic { + + //TODO: other converters to be added + + passThrough: Valerie.IConverter; + } + + + interface UtilsStatic { + + // Creates a function that returns the given value as an array of one item, or simply returns the given value if it is already an array. + asArray(value: any): any[]; + + // Creates a function that returns the given value, or simply returns the given value if it is already a function + asFunction(value: T): () => T; + asFunction(fn: () => T): () => T; + + // Tests whether the given value is an array + isArray(value: any): boolean; + + // Tests whether the given value is an array or object. + isArrayOrObject(value: any): boolean; + + // Tests whether the given value is a function. + isFunction(value: any): boolean; + + // Tests whether the given value is "missing".undefined, null, an empty string or an empty array are considered to be "missing". + isMissing(value: any): boolean; + + // Tests whether the given value is an object. + isObject(value: any): boolean; + + // Tests whether the give value is a string. + isString(value: any): boolean; + + //Merges the given default options with the given options. + // - either parameter can be omitted and a clone of the other parameter will be returned + // - the merge is shallow + // - array properties are shallow cloned + mergeOptions(defaultOptions: ValidationOptions, options): ValidationOptions; + } // callback interface (see mapModel above) @@ -296,6 +365,53 @@ declare module Valerie { */ clearSummary(valueOrFunction: any): ModelValidationState; + /*** + * Gets whether the model has failed validation. + * @return {boolean} + */ + failed(): boolean; + + /*** + * Gets the validation states that belong to the model that are in a failure state. + * @return {Valerie.IValidationState[]} + */ + failedStates(): Valerie.IValidationState[]; + + /*** + * Gets the name of the model. + * @return {string} + */ + getName(): string; + + isApplicable(): boolean; + message(): string; + passed(): boolean; + + /*** + * Gets or sets whether the computation that updates the validation result has been paused. + * @param {boolean} [value = false] true if the computation should be paused, false if the computation should not be paused + * @return {boolean} true if computation is paused, false otherwise + */ + paused(value: boolean): boolean; + + pending(): boolean; + + pendingStates(): IValidationState[]; + + refresh(): void; + + result(): ValidationResult; + + summary(): summaryItem[] + + /*** + * Gets or sets whether the model has been 'touched' by user action + */ + touched(value: boolean): boolean; + + + validationStates(): IValidationState[]; + /** * Includes any validation failures for this model in a validation summary.
* [fluent] @@ -501,9 +617,6 @@ declare module Valerie { pending: boolean; //true if the activity hasn't yet completed message: string; //a message from the activity new: (state: any, message?: string) => ValidationResult; - - //TODO: not added static members/methods - createFailedResult(message: string): ValidationResult; } interface IRule { @@ -598,6 +711,11 @@ declare module Valerie { // Sets the validation state for the given model, observable or computed. setFor(modelOrObservableOrComputed: any, state: IValidationState): void; } + + interface summaryItem { + name: string; + message: string; + } } declare module Valerie.Rules { From d8ecb4d77d64a7d5520eeb9d93fdd3d517c99291 Mon Sep 17 00:00:00 2001 From: Gidon Date: Sun, 13 Jul 2014 18:27:15 +0300 Subject: [PATCH 004/537] Fixed typeahead signatures - Updated according to official documentation: see https://github.com/twitter/typeahead.js/blob/master/doc/jquery_typeahead.md - Added one more test (from official samples) --- typeahead/typeahead-tests.ts | 57 ++++++++++++++++++++++++++++++++---- typeahead/typeahead.d.ts | 29 ++++++++---------- 2 files changed, 64 insertions(+), 22 deletions(-) diff --git a/typeahead/typeahead-tests.ts b/typeahead/typeahead-tests.ts index 67fc8d31a..5ce51629d 100644 --- a/typeahead/typeahead-tests.ts +++ b/typeahead/typeahead-tests.ts @@ -8,7 +8,7 @@ declare var Hogan: string; // Countries // Prefetches data, stores it in localStorage, and searches it on the client -$('.example-countries .typeahead').typeahead({ +$('.example-countries .typeahead').typeahead(null, { name: 'countries', prefetch: '../data/countries.json', limit: 10 @@ -16,7 +16,7 @@ $('.example-countries .typeahead').typeahead({ // Open Source Projects by Twitter // Defines a custom template and template engine for rendering suggestions -$('.example-twitter-oss .typeahead').typeahead({ +$('.example-twitter-oss .typeahead').typeahead(null, { name: 'twitter-oss', prefetch: '../data/repos.json', template: [ @@ -29,7 +29,7 @@ $('.example-twitter-oss .typeahead').typeahead({ // Arabic Phrases // Hardcoded list showing Right - To - Left(RTL) support -$('.example-arabic .typeahead').typeahead({ +$('.example-arabic .typeahead').typeahead(null, { name: 'arabic', local: [ "الإنجليزية", @@ -47,7 +47,7 @@ $('.example-arabic .typeahead').typeahead({ // NBA and NHL Teams // Two datasets that are prefetched, stored, and searched on the client -$('.example-sports .typeahead').typeahead([ +$('.example-sports .typeahead').typeahead(null, [ { name: 'nba-teams', prefetch: '../data/nba.json', @@ -62,7 +62,7 @@ $('.example-sports .typeahead').typeahead([ // Best Picture Winners // Prefetches some data then relies on remote requests for suggestions when prefetched data is insufficient -$('.example-films .typeahead').typeahead([ +$('.example-films .typeahead').typeahead(null, [ { name: 'best-picture-winners', remote: '../data/films/queries/%QUERY.json', @@ -85,3 +85,50 @@ $('.example-countries .typeahead').typeahead({ prefetch: '../data/countries.json', limit: 10 }); + + +var substringMatcher = function (strs) { + return function findMatches(q, cb) { + var matches, substrRegex; + + // an array that will be populated with substring matches + matches = []; + + // regex used to determine if a string contains the substring `q` + substrRegex = new RegExp(q, 'i'); + + // iterate through the pool of strings and for any string that + // contains the substring `q`, add it to the `matches` array + $.each(strs, function (i, str) { + if (substrRegex.test(str)) { + // the typeahead jQuery plugin expects suggestions to a + // JavaScript object, refer to typeahead docs for more info + matches.push({ value: str }); + } + }); + + cb(matches); + }; +}; + +var states = ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', + 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', + 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', + 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', + 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', + 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', + 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', + 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', + 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming' +]; + +$('#the-basics .typeahead').typeahead({ + hint: true, + highlight: true, + minLength: 1 +}, + { + name: 'states', + displayKey: 'value', + source: substringMatcher(states) + }); \ No newline at end of file diff --git a/typeahead/typeahead.d.ts b/typeahead/typeahead.d.ts index f6f387986..3f4c61b1d 100644 --- a/typeahead/typeahead.d.ts +++ b/typeahead/typeahead.d.ts @@ -6,21 +6,6 @@ /// interface JQuery { - /** - * Turns an input[type="text"] element into a typeahead. - * - * @constructor - * @param dataset Single dataset - */ - typeahead(dataset: Twitter.Typeahead.Dataset): JQuery; - - /** - * Turns an input[type="text"] element into a typeahead. - * - * @constructor - * @param dataset Array of datasets - */ - typeahead(datasets: Twitter.Typeahead.Dataset[]): JQuery; /** * Destroys previously initialized typeaheads. This entails reverting @@ -57,9 +42,19 @@ interface JQuery { * * @constructor * @param options ('hint' or 'highlight' or 'minLength' all of which are optional) - * @param dataset Array of datasets + * @param datasets Array of datasets */ - typeahead(options: Twitter.Typeahead.Options, dataset: Twitter.Typeahead.Dataset): JQuery; + typeahead(options: Twitter.Typeahead.Options, datasets: Twitter.Typeahead.Dataset[]): JQuery; + + /** + * Accomodates specifying options such as hint and highlight. + * This is in correspondence to the examples mentioned in http://twitter.github.io/typeahead.js/examples/ + * + * @constructor + * @param options ('hint' or 'highlight' or 'minLength' all of which are optional) + * @param datasets One or more datasets passed in as arguments. + */ + typeahead(options: Twitter.Typeahead.Options, ... datasets: Twitter.Typeahead.Dataset[]): JQuery; } declare module Twitter.Typeahead { From 2cc58f14033679b5775c524c3a95f041fd90dc75 Mon Sep 17 00:00:00 2001 From: Gidon Date: Wed, 16 Jul 2014 16:58:46 +0300 Subject: [PATCH 005/537] Updated to typeahead 0.10.4 Updated from 0.9.3 to 0.10.4 API has changed quite a bit. Part of the functionality (prefetch etc) has been taken out from the core lib, and merged into a new lib called Bloodhound. Bloodhound still has to be ts-ed. --- typeahead/typeahead-tests.ts | 99 +++--------- typeahead/typeahead.d.ts | 283 ++++++++++++----------------------- 2 files changed, 116 insertions(+), 266 deletions(-) diff --git a/typeahead/typeahead-tests.ts b/typeahead/typeahead-tests.ts index 5ce51629d..835fbfb57 100644 --- a/typeahead/typeahead-tests.ts +++ b/typeahead/typeahead-tests.ts @@ -6,87 +6,6 @@ // declare var Hogan: string; -// Countries -// Prefetches data, stores it in localStorage, and searches it on the client -$('.example-countries .typeahead').typeahead(null, { - name: 'countries', - prefetch: '../data/countries.json', - limit: 10 -}); - -// Open Source Projects by Twitter -// Defines a custom template and template engine for rendering suggestions -$('.example-twitter-oss .typeahead').typeahead(null, { - name: 'twitter-oss', - prefetch: '../data/repos.json', - template: [ - '

{{language}}

', - '

{{name}}

', - '

{{description}}

' - ].join(''), - engine: Hogan -}); - -// Arabic Phrases -// Hardcoded list showing Right - To - Left(RTL) support -$('.example-arabic .typeahead').typeahead(null, { - name: 'arabic', - local: [ - "الإنجليزية", - "نعم", - "لا", - "مرحبا", - "کيف الحال؟", - "أهلا", - "مع السلامة", - "لا أتكلم العربية", - "لا أفهم", - "أنا جائع" - ] -}); - -// NBA and NHL Teams -// Two datasets that are prefetched, stored, and searched on the client -$('.example-sports .typeahead').typeahead(null, [ - { - name: 'nba-teams', - prefetch: '../data/nba.json', - header: '

NBA Teams

' - }, - { - name: 'nhl-teams', - prefetch: '../data/nhl.json', - header: '

NHL Teams

' - } -]); - -// Best Picture Winners -// Prefetches some data then relies on remote requests for suggestions when prefetched data is insufficient -$('.example-films .typeahead').typeahead(null, [ - { - name: 'best-picture-winners', - remote: '../data/films/queries/%QUERY.json', - prefetch: '../data/films/post_1960.json', - template: '

{{value}} – {{year}}

', - engine: Hogan - } -]); - -// Countries - Modified the first test here to add options -// Specifies options to display hint with a highlight and adds a minimum length restriction for search -// Prefetches data, stores it in localStorage, and searches it on the client -$('.example-countries .typeahead').typeahead({ - hint: true, - highlight: true, - minLength: 2 -}, -{ - name: 'countries', - prefetch: '../data/countries.json', - limit: 10 -}); - - var substringMatcher = function (strs) { return function findMatches(q, cb) { var matches, substrRegex; @@ -131,4 +50,20 @@ $('#the-basics .typeahead').typeahead({ name: 'states', displayKey: 'value', source: substringMatcher(states) - }); \ No newline at end of file + }); + + +// custom templates +$('#custom-templates .typeahead').typeahead(null, { + name: 'best-pictures', + displayKey: 'value', + source: bestPictures.ttAdapter(), + templates: { + empty: [ + '
', + 'unable to find any Best Picture winners that match the current query', + '
' + ].join('\n'), + suggestion: Handlebars.compile('

{{value}} – {{year}}

') + } +}); \ No newline at end of file diff --git a/typeahead/typeahead.d.ts b/typeahead/typeahead.d.ts index 3f4c61b1d..fe8584639 100644 --- a/typeahead/typeahead.d.ts +++ b/typeahead/typeahead.d.ts @@ -1,6 +1,6 @@ -// Type definitions for typeahead.js 0.9.3 +// Type definitions for typeahead.js 0.10.4 // Project: http://twitter.github.io/typeahead.js/ -// Definitions by: Ivaylo Gochkov +// Definitions by: Ivaylo Gochkov , Gidon Junge // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -17,22 +17,55 @@ interface JQuery { typeahead(methodName: 'destroy'): JQuery; /** - * Sets the current query of the typeahead. This is always preferable to - * using $("input.typeahead").val(query), which will result in unexpected - * behavior. To clear the query, simply set it to an empty string. - * - * @constructor - * @param methodName Method 'setQuery' - * @param query The query to be set - */ - typeahead(methodName: 'setQuery', query: string): JQuery; + * Opens the dropdown menu of typeahead. Note that being open does not mean that the menu is visible. + * The menu is only visible when it is open and has content. + * + * @constructor + * @param methodName Method 'open' + */ + typeahead(methodName: 'open'): JQuery; /** - * Accommodates the destroy and setQuery overloads. + * Closes the dropdown menu of typeahead. + * + * @constructor + * @param methodName Method 'close' + */ + typeahead(methodName: 'close'): JQuery; + + /** + * Returns the current value of the typeahead. + * The value is the text the user has entered into the input element. + * + * @constructor + * @param methodName Method 'val' + */ + typeahead(methodName: 'val'): string; + + /** + * Sets the value of the typeahead. This should be used in place of jQuery#val. * * @constructor - * @param methodName Method name ('destroy' or 'setQuery') - * @param query The query to be set in case method 'setQuery' is used. + * @param methodName Method 'val' + * @param query The value to be set + */ + typeahead(methodName: 'val', val: string): JQuery; + + /** + * Accommodates the val overload. + * + * @constructor + * @param methodName Method name ('val') + */ + typeahead(methodName: string): string; + + + /** + * Accommodates multiple overloads. + * + * @constructor + * @param methodName Method name + * @param query The query to be set in case method 'val' is used. */ typeahead(methodName: string, query: string): JQuery; @@ -66,188 +99,70 @@ declare module Twitter.Typeahead { */ interface Dataset { /** - * The string used to identify the dataset. Used by typeahead.js - * to cache intelligently. - */ - name: string; + * The backing data source for suggestions. + * Expected to be a function with the signature (query, cb). + * It is expected that the function will compute the suggestion set (i.e. an array of JavaScript objects) for query and then invoke cb with said set. + * cb can be invoked synchronously or asynchronously. + * + */ + source: (query: string, cb: (result: any) => void) => void; + /** - * The key used to access the value of the datum in the datum object. - * Defaults to value. + * The name of the dataset. + * This will be appended to tt-dataset- to form the class name of the containing DOM element. + * Must only consist of underscores, dashes, letters (a-z), and numbers. + * Defaults to a random number. */ - valueKey?: string; + name?: string; + /** - * The max number of suggestions from the dataset to display - * for a given query. Defaults to 5. - */ - limit?: number; + * For a given suggestion object, determines the string representation of it. + * This will be used when setting the value of the input control after a suggestion is selected. Can be either a key string or a function that transforms a suggestion object into a string. + * Defaults to value. + */ + displayKey?: string; + /** - * The template used to render suggestions. Can be a string or - * a precompiled template. If not provided, suggestions will render - * as their value contained in a

element (i.e.

value

). - */ - template?: any; - /** - * The template engine used to compile/render template if it is a - * string. Any engine can use used as long as it adheres to the - * expected API. Required if template is a string. - */ - engine?: string; - /** - * The header rendered before suggestions in the dropdown menu. - * Can be either a DOM element or HTML. - */ - header?: any; - /** - * The footer rendered after suggestions in the dropdown menu. - * Can be either a DOM element or HTML. - */ - footer?: any; - /** - * An array of datums or strings. - */ - local?: any[]; - /** - * Can be a URL to a JSON file containing an array of datums or, - * if more configurability is needed, a prefetch options object. - */ - prefetch?: any; - /** - * Can be a URL to fetch suggestions from when the data provided by - * local and prefetch is insufficient or, if more configurability is - * needed, a remote options object. - */ - remote?: any; + * A hash of templates to be used when rendering the dataset. + * Note a precompiled template is a function that takes a JavaScript object as its first argument and returns a HTML string. + */ + templates?: Templates; } - /** - * Prefetched data is fetched and processed on initialization. - * If the browser supports localStorage, the processed data will be cached - * there to prevent additional network requests on subsequent page loads. - */ - interface PrefetchOptions { - /** - * A URL to a JSON file containing an array of datums. Required. - */ - url: string; + + interface Templates { /** - * The time (in milliseconds) the prefetched data should be cached - * in localStorage. Defaults to 86400000 (1 day). - */ - ttl?: number; + * Rendered when 0 suggestions are available for the given query. + * Can be either a HTML string or a precompiled template. + * If it's a precompiled template, the passed in context will contain query + */ + empty?: string; /** - * A function that transforms the response body into an array of datums. - * - * @param parsedResponse Response body - */ - filter?: (parsedResponse: any) => Datum[]; + * Rendered at the bottom of the dataset. + * Can be either a HTML string or a precompiled template. + * If it's a precompiled template, the passed in context will contain query and isEmpty. + */ + footer?: string; + + /** + * Rendered at the top of the dataset. + * Can be either a HTML string or a precompiled template. + * If it's a precompiled template, the passed in context will contain query and isEmpty. + */ + header?: string; + + /** + * Used to render a single suggestion. + * If set, this has to be a precompiled template. + * The associated suggestion object will serve as the context. + * Defaults to the value of displayKey wrapped in a p tag i.e.

{{value}}

. + */ + suggestion?: string; + } - /** - * Remote data is only used when the data provided by local and prefetch - * is insufficient. In order to prevent an obscene number of requests - * being made to remote endpoint, typeahead.js rate-limits remote requests. - */ - interface RemoteOptions { - /** - * A URL to make requests to when the data provided by local and - * prefetch is insufficient. Required. - */ - url: string; - - /** - * The type of data you're expecting from the server. Defaults to json. - * @see http://api.jquery.com/jQuery.ajax/ for more info. - */ - dataType?: string; - - /** - * Determines whether or not the browser will cache responses. - * @see http://api.jquery.com/jQuery.ajax/ for more info. - */ - cache?: boolean; - - /** - * Sets a timeout for requests. - * @see http://api.jquery.com/jQuery.ajax/ for more info. - */ - timeout?: number; - - /** - * The pattern in url that will be replaced with the user's query - * when a request is made. Defaults to %QUERY. - */ - wildcard?: string; - - /** - * Overrides the request URL. If set, no wildcard substitution will - * be performed on url. - * - * @param url Replacement URL - * @param uriEncodedQuery Encoded query - * @returns A valid URL - */ - replace?: (url: string, uriEncodedQuery: string) => string; - - /** - * The function used for rate-limiting network requests. - * Can be either 'debounce' or 'throttle'. Defaults to 'debounce'. - */ - rateLimitFn?: string; - - /** - * The time interval in milliseconds that will be used by rateLimitFn. - * Defaults to 300. - */ - rateLimitWait?: number; - - /** - * The max number of parallel requests typeahead.js can have pending. - * Defaults to 6. - */ - maxParallelRequests?: number; - - /** - * A pre-request callback. Can be used to set custom headers. - * @see http://api.jquery.com/jQuery.ajax/ for more info. - */ - beforeSend?: (jqXhr: JQueryXHR, settings: JQueryAjaxSettings) => void; - - /** - * Transforms the response body into an array of datums. - * - * @param parsedResponse Response body - */ - filter?: (parsedResponse: any) => Datum[]; - } - - /** - * The individual units that compose datasets are called datums. - * The canonical form of a datum is an object with a value property and - * a tokens property. - * - * For ease of use, datums can also be represented as a string. - * Strings found in place of datum objects are implicitly converted - * to a datum object. - * - * When datums are rendered as suggestions, the datum object is the - * context passed to the template engine. This means if you include any - * arbitrary properties in datum objects, those properties will be - * available to the template used to render suggestions. - */ - interface Datum { - /** - * The string that represents the underlying value of the datum - */ - value: string; - - /** - * A collection of single-word strings that aid typeahead.js in - * matching datums with a given query. - */ - tokens: string[]; - } /** * When initializing a typeahead, there are a number of options you can configure. From 0421179b561d7cd227cbfd55b09b63ca9eeddca6 Mon Sep 17 00:00:00 2001 From: Gidon Date: Wed, 16 Jul 2014 17:04:51 +0300 Subject: [PATCH 006/537] Fixed Tests for Typeahead --- typeahead/typeahead-tests.ts | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/typeahead/typeahead-tests.ts b/typeahead/typeahead-tests.ts index 835fbfb57..aa8a400b6 100644 --- a/typeahead/typeahead-tests.ts +++ b/typeahead/typeahead-tests.ts @@ -6,9 +6,9 @@ // declare var Hogan: string; -var substringMatcher = function (strs) { - return function findMatches(q, cb) { - var matches, substrRegex; +var substringMatcher = function (strs: any) { + return function findMatches(q: any, cb: any) { + var matches: any, substrRegex: any; // an array that will be populated with substring matches matches = []; @@ -52,18 +52,3 @@ $('#the-basics .typeahead').typeahead({ source: substringMatcher(states) }); - -// custom templates -$('#custom-templates .typeahead').typeahead(null, { - name: 'best-pictures', - displayKey: 'value', - source: bestPictures.ttAdapter(), - templates: { - empty: [ - '
', - 'unable to find any Best Picture winners that match the current query', - '
' - ].join('\n'), - suggestion: Handlebars.compile('

{{value}} – {{year}}

') - } -}); \ No newline at end of file From 05ba8a69a5c48d95ec16d89bb900403300012a4e Mon Sep 17 00:00:00 2001 From: Gidon Date: Thu, 17 Jul 2014 15:43:06 +0300 Subject: [PATCH 007/537] Updated History JS Upgraded to version 1.8, which is now community supported. --- history/history.d.ts | 60 +++++++++++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/history/history.d.ts b/history/history.d.ts index a8a3c4004..07a31d011 100644 --- a/history/history.d.ts +++ b/history/history.d.ts @@ -1,13 +1,13 @@ -// Type definitions for History.js -// Project: https://github.com/balupton/History.js -// Definitions by: Boris Yankov +// Type definitions for History.js 1.8.0 +// Project: https://github.com/browserstate/history.js +// Definitions by: Boris Yankov , Gidon Junge // Definitions: https://github.com/borisyankov/DefinitelyTyped interface HistoryAdapter { - bind(element, event, callback); - trigger(element, event); - onDomLoad(callback); + bind(element: any, event: string, callback: () => void); + trigger(element: any, event: string); + onDomLoad(callback: () => void); } // Since History is defined in lib.d.ts as well @@ -17,15 +17,45 @@ interface HistoryAdapter { // var Historyjs: Historyjs = History; interface Historyjs { + enabled: boolean; - pushState(data, title, url); - replaceState(data, title, url); - getState(); - getHash(); + + pushState(data: any, title: string, url: string); + replaceState(data: any, title: string, url: string); + getState(): HistoryState; + getStateByIndex(index: number): HistoryState; + getCurrentIndex(): number; + getHash(): string; + Adapter: HistoryAdapter; - back(); - forward(); - go(X); - log(...messages: any[]); - debug(...messages: any[]); + + back(): void; + forward(): void; + go(x: Number): void; + + log(...messages: any[]): void; + debug(...messages: any[]): void; + + options: HistoryOptions; } + +interface HistoryState { + data?: any; + title?: string; + url: string; +} + +interface HistoryOptions { + hashChangeInterval?: number; + safariPollInterval?: number; + doubleCheckInterval?: number; + disableSuid?: boolean; + storeInterval?: number; + busyDelay?: number; + debug?: boolean; + initialTitle?: string; + html4Mode?: boolean; + delayInit?: number; + + +} \ No newline at end of file From 439b1fdf0469b7488988318be9dbee6c71fa8ab7 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Mon, 21 Jul 2014 18:11:26 -0700 Subject: [PATCH 008/537] rx.js renamed to rx. --- rx-lite.d.ts | 565 ++++++++++++++++++++++++++++++++++++++ rx.aggregates.d.ts | 61 ++++ rx.all.ts | 20 ++ rx.async-lite.d.ts | 65 +++++ rx.async-tests.ts | 88 ++++++ rx.async.d.ts | 43 +++ rx.backpressure-lite.d.ts | 49 ++++ rx.backpressure-tests.ts | 22 ++ rx.backpressure.d.ts | 11 + rx.binding-lite.d.ts | 72 +++++ rx.binding.d.ts | 11 + rx.coincidence-lite.d.ts | 34 +++ rx.coincidence.d.ts | 36 +++ rx.d.ts | 102 +++++++ rx.experimental.d.ts | 321 ++++++++++++++++++++++ rx.joinpatterns.d.ts | 60 ++++ rx.lite.d.ts | 50 ++++ rx.testing.d.ts | 62 +++++ rx.time-lite.d.ts | 62 +++++ rx.time.d.ts | 35 +++ rx.virtualtime.d.ts | 39 +++ 21 files changed, 1808 insertions(+) create mode 100644 rx-lite.d.ts create mode 100644 rx.aggregates.d.ts create mode 100644 rx.all.ts create mode 100644 rx.async-lite.d.ts create mode 100644 rx.async-tests.ts create mode 100644 rx.async.d.ts create mode 100644 rx.backpressure-lite.d.ts create mode 100644 rx.backpressure-tests.ts create mode 100644 rx.backpressure.d.ts create mode 100644 rx.binding-lite.d.ts create mode 100644 rx.binding.d.ts create mode 100644 rx.coincidence-lite.d.ts create mode 100644 rx.coincidence.d.ts create mode 100644 rx.d.ts create mode 100644 rx.experimental.d.ts create mode 100644 rx.joinpatterns.d.ts create mode 100644 rx.lite.d.ts create mode 100644 rx.testing.d.ts create mode 100644 rx.time-lite.d.ts create mode 100644 rx.time.d.ts create mode 100644 rx.virtualtime.d.ts diff --git a/rx-lite.d.ts b/rx-lite.d.ts new file mode 100644 index 000000000..c7a148137 --- /dev/null +++ b/rx-lite.d.ts @@ -0,0 +1,565 @@ +// DefinitelyTyped: partial + +// This file contains common part of defintions for rx.d.ts and rx.lite.d.ts +// Do not include the file separately. + +declare module Rx { + export module internals { + function isEqual(left: any, right: any): boolean; + function addRef(xs: Observable, r: { getDisposable(): IDisposable; }): Observable; + + // Priority Queue for Scheduling + export class PriorityQueue { + constructor(capacity: number); + + length: number; + + isHigherPriority(left: number, right: number): boolean; + percolate(index: number): void; + heapify(index: number): void; + peek(): ScheduledItem; + removeAt(index: number): void; + dequeue(): ScheduledItem; + enqueue(item: ScheduledItem): void; + remove(item: ScheduledItem): boolean; + + static count: number; + } + + export class ScheduledItem { + constructor(scheduler: IScheduler, state: any, action: (scheduler: IScheduler, state: any) => IDisposable, dueTime: TTime, comparer?: (x: TTime, y: TTime) => number); + + scheduler: IScheduler; + state: TTime; + action: (scheduler: IScheduler, state: any) => IDisposable; + dueTime: TTime; + comparer: (x: TTime, y: TTime) => number; + disposable: SingleAssignmentDisposable; + + invoke(): void; + compareTo(other: ScheduledItem): number; + isCancelled(): boolean; + invokeCore(): IDisposable; + } + } + + export module config { + export var Promise: { new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): IPromise; }; + } + + export module helpers { + function noop(): void; + function identity(value: T): T; + function defaultNow(): number; + function defaultComparer(left: any, right: any): boolean; + function defaultSubComparer(left: any, right: any): number; + function defaultKeySerializer(key: any): string; + function defaultError(err: any): void; + function isPromise(p: any): boolean; + function asArray(...args: T[]): T[]; + function not(value: any): boolean; + } + + export interface IDisposable { + dispose(): void; + } + + export class CompositeDisposable implements IDisposable { + constructor (...disposables: IDisposable[]); + constructor (disposables: IDisposable[]); + + isDisposed: boolean; + length: number; + + dispose(): void; + add(item: IDisposable): void; + remove(item: IDisposable): boolean; + clear(): void; + contains(item: IDisposable): boolean; + toArray(): IDisposable[]; + } + + export class Disposable implements IDisposable { + constructor(action: () => void); + + static create(action: () => void): IDisposable; + static empty: IDisposable; + + dispose(): void; + } + + // Single assignment + export class SingleAssignmentDisposable implements IDisposable { + constructor(); + + isDisposed: boolean; + current: IDisposable; + + dispose(): void ; + getDisposable(): IDisposable; + setDisposable(value: IDisposable): void ; + } + + // Multiple assignment disposable + export class SerialDisposable implements IDisposable { + constructor(); + + isDisposed: boolean; + + dispose(): void; + getDisposable(): IDisposable; + setDisposable(value: IDisposable): void; + } + + export class RefCountDisposable implements IDisposable { + constructor(disposable: IDisposable); + + dispose(): void; + + isDisposed: boolean; + getDisposable(): IDisposable; + } + + export interface IScheduler { + now(): number; + + schedule(action: () => void): IDisposable; + scheduleWithState(state: TState, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; + scheduleWithAbsolute(dueTime: number, action: () => void): IDisposable; + scheduleWithAbsoluteAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) =>IDisposable): IDisposable; + scheduleWithRelative(dueTime: number, action: () => void): IDisposable; + scheduleWithRelativeAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) =>IDisposable): IDisposable; + + scheduleRecursive(action: (action: () =>void ) =>void ): IDisposable; + scheduleRecursiveWithState(state: TState, action: (state: TState, action: (state: TState) =>void ) =>void ): IDisposable; + scheduleRecursiveWithAbsolute(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable; + scheduleRecursiveWithAbsoluteAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable; + scheduleRecursiveWithRelative(dueTime: number, action: (action: (dueTime: number) =>void ) =>void ): IDisposable; + scheduleRecursiveWithRelativeAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) =>void ) =>void ): IDisposable; + + schedulePeriodic(period: number, action: () => void): IDisposable; + schedulePeriodicWithState(state: TState, period: number, action: (state: TState) => TState): IDisposable; + } + + // Current Thread IScheduler + interface ICurrentThreadScheduler extends IScheduler { + scheduleRequired(): boolean; + } + + // Notifications + export class Notification { + accept(observer: IObserver): void; + accept(onNext: (value: T) => TResult, onError?: (exception: any) => TResult, onCompleted?: () => TResult): TResult; + toObservable(scheduler?: IScheduler): Observable; + hasValue: boolean; + equals(other: Notification): boolean; + kind: string; + value: T; + exception: any; + + static createOnNext(value: T): Notification; + static createOnError(exception: any): Notification; + static createOnCompleted(): Notification; + } + + /** + * Promise A+ + */ + export interface IPromise { + then(onFulfilled: (value: T) => IPromise, onRejected: (reason: any) => IPromise): IPromise; + then(onFulfilled: (value: T) => IPromise, onRejected?: (reason: any) => R): IPromise; + then(onFulfilled: (value: T) => R, onRejected: (reason: any) => IPromise): IPromise; + then(onFulfilled?: (value: T) => R, onRejected?: (reason: any) => R): IPromise; + } + + // Observer + export interface IObserver { + onNext(value: T): void; + onError(exception: any): void; + onCompleted(): void; + } + + export interface Observer extends IObserver { + toNotifier(): (notification: Notification) => void; + asObserver(): Observer; + } + + interface ObserverStatic { + create(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observer; + fromNotifier(handler: (notification: Notification) => void): Observer; + } + + export var Observer: ObserverStatic; + + export interface IObservable { + subscribe(observer: Observer): IDisposable; + subscribe(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): IDisposable; + } + + export interface Observable extends IObservable { + forEach(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): IDisposable; // alias for subscribe + toArray(): Observable; + + catch(handler: (exception: any) => Observable): Observable; + catchException(handler: (exception: any) => Observable): Observable; // alias for catch + catch(handler: (exception: any) => IPromise): Observable; + catchException(handler: (exception: any) => IPromise): Observable; // alias for catch + catch(second: Observable): Observable; + catchException(second: Observable): Observable; // alias for catch + combineLatest(second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; + combineLatest(second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; + combineLatest(second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; + combineLatest(souces: Observable[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; + combineLatest(souces: IPromise[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; + concat(...sources: Observable[]): Observable; + concat(...sources: IPromise[]): Observable; + concat(sources: Observable[]): Observable; + concat(sources: IPromise[]): Observable; + concatAll(): T; + concatObservable(): T; // alias for concatAll + concatMap(selector: (value: T, index: number) => Observable, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; // alias for selectConcat + concatMap(selector: (value: T, index: number) => IPromise, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; // alias for selectConcat + concatMap(selector: (value: T, index: number) => Observable): Observable; // alias for selectConcat + concatMap(selector: (value: T, index: number) => IPromise): Observable; // alias for selectConcat + concatMap(sequence: Observable): Observable; // alias for selectConcat + merge(maxConcurrent: number): T; + merge(other: Observable): Observable; + merge(other: IPromise): Observable; + mergeAll(): T; + mergeObservable(): T; // alias for mergeAll + skipUntil(other: Observable): Observable; + skipUntil(other: IPromise): Observable; + switch(): T; + switchLatest(): T; // alias for switch + takeUntil(other: Observable): Observable; + takeUntil(other: IPromise): Observable; + zip(second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; + zip(second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; + zip(second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + zip(second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + zip(second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + zip(second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + zip(second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + zip(second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + zip(second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + zip(second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + zip(second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + zip(second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + zip(second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + zip(second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + zip(second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; + zip(second: Observable[], resultSelector: (left: T, ...right: TOther[]) => TResult): Observable; + zip(second: IPromise[], resultSelector: (left: T, ...right: TOther[]) => TResult): Observable; + + asObservable(): Observable; + dematerialize(): Observable; + distinctUntilChanged(skipParameter: boolean, comparer: (x: T, y: T) => boolean): Observable; + distinctUntilChanged(keySelector?: (value: T) => TValue, comparer?: (x: TValue, y: TValue) => boolean): Observable; + do(observer: Observer): Observable; + doAction(observer: Observer): Observable; // alias for do + do(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable; + doAction(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable; // alias for do + finally(action: () => void): Observable; + finallyAction(action: () => void): Observable; // alias for finally + ignoreElements(): Observable; + materialize(): Observable>; + repeat(repeatCount?: number): Observable; + retry(retryCount?: number): Observable; + scan(seed: TAcc, accumulator: (acc: TAcc, value: T) => TAcc): Observable; + scan(accumulator: (acc: T, value: T) => T): Observable; + skipLast(count: number): Observable; + startWith(...values: T[]): Observable; + startWith(scheduler: IScheduler, ...values: T[]): Observable; + takeLast(count: number, scheduler?: IScheduler): Observable; + takeLastBuffer(count: number): Observable; + + select(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; + map(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; // alias for select + selectMany(selector: (value: T) => Observable, resultSelector: (item: T, other: TOther) => TResult): Observable; + selectMany(selector: (value: T) => IPromise, resultSelector: (item: T, other: TOther) => TResult): Observable; + selectMany(selector: (value: T) => Observable): Observable; + selectMany(selector: (value: T) => IPromise): Observable; + selectMany(other: Observable): Observable; + selectMany(other: IPromise): Observable; + flatMap(selector: (value: T) => Observable, resultSelector: (item: T, other: TOther) => TResult): Observable; // alias for selectMany + flatMap(selector: (value: T) => IPromise, resultSelector: (item: T, other: TOther) => TResult): Observable; // alias for selectMany + flatMap(selector: (value: T) => Observable): Observable; // alias for selectMany + flatMap(selector: (value: T) => IPromise): Observable; // alias for selectMany + flatMap(other: Observable): Observable; // alias for selectMany + flatMap(other: IPromise): Observable; // alias for selectMany + + selectConcat(selector: (value: T, index: number) => Observable, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; + selectConcat(selector: (value: T, index: number) => IPromise, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; + selectConcat(selector: (value: T, index: number) => Observable): Observable; + selectConcat(selector: (value: T, index: number) => IPromise): Observable; + selectConcat(sequence: Observable): Observable; + + /** + * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then + * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. + * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. + * @param [thisArg] Object to use as this when executing callback. + * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences + * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. + */ + selectSwitch(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; + /** + * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then + * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. + * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. + * @param [thisArg] Object to use as this when executing callback. + * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences + * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. + */ + flatMapLatest(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; // alias for selectSwitch + /** + * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then + * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. + * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. + * @param [thisArg] Object to use as this when executing callback. + * @since 2.2.28 + * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences + * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. + */ + switchMap(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; // alias for selectSwitch + + skip(count: number): Observable; + skipWhile(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; + take(count: number, scheduler?: IScheduler): Observable; + takeWhile(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; + where(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; + filter(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; // alias for where + + /** + * Converts an existing observable sequence to an ES6 Compatible Promise + * @example + * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); + * @param promiseCtor The constructor of the promise. + * @returns An ES6 compatible promise with the last value from the observable sequence. + */ + toPromise>(promiseCtor: { new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): TPromise; }): TPromise; + /** + * Converts an existing observable sequence to an ES6 Compatible Promise + * @example + * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); + * + * // With config + * Rx.config.Promise = RSVP.Promise; + * var promise = Rx.Observable.return(42).toPromise(); + * @param [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise. + * @returns An ES6 compatible promise with the last value from the observable sequence. + */ + toPromise(promiseCtor?: { new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): IPromise; }): IPromise; + + // Experimental Flattening + + /** + * Performs a exclusive waiting for the first to finish before subscribing to another observable. + * Observables that come in between subscriptions will be dropped on the floor. + * Can be applied on `Observable>` or `Observable>`. + * @since 2.2.28 + * @returns A exclusive observable with only the results that happen when subscribed. + */ + exclusive(): Observable; + + /** + * Performs a exclusive map waiting for the first to finish before subscribing to another observable. + * Observables that come in between subscriptions will be dropped on the floor. + * Can be applied on `Observable>` or `Observable>`. + * @since 2.2.28 + * @param selector Selector to invoke for every item in the current subscription. + * @param [thisArg] An optional context to invoke with the selector parameter. + * @returns {An exclusive observable with only the results that happen when subscribed. + */ + exclusiveMap(selector: (value: I, index: number, source: Observable) => R, thisArg?: any): Observable; + } + + interface ObservableStatic { + create(subscribe: (observer: Observer) => IDisposable): Observable; + create(subscribe: (observer: Observer) => () => void): Observable; + create(subscribe: (observer: Observer) => void): Observable; + createWithDisposable(subscribe: (observer: Observer) => IDisposable): Observable; + defer(observableFactory: () => Observable): Observable; + defer(observableFactory: () => IPromise): Observable; + empty(scheduler?: IScheduler): Observable; + fromArray(array: T[], scheduler?: IScheduler): Observable; + fromArray(array: { length: number;[index: number]: T; }, scheduler?: IScheduler): Observable; + + /** + * Converts an iterable into an Observable sequence + * + * @example + * var res = Rx.Observable.fromIterable(new Map()); + * var res = Rx.Observable.fromIterable(function* () { yield 42; }); + * var res = Rx.Observable.fromIterable(new Set(), Rx.Scheduler.timeout); + * @param generator Generator to convert from. + * @param [scheduler] Scheduler to run the enumeration of the input sequence on. + * @returns The observable sequence whose elements are pulled from the given generator sequence. + */ + fromItreable(generator: () => { next(): { done: boolean; value?: T; }; }, scheduler?: IScheduler): Observable; + + /** + * Converts an iterable into an Observable sequence + * + * @example + * var res = Rx.Observable.fromIterable(new Map()); + * var res = Rx.Observable.fromIterable(new Set(), Rx.Scheduler.timeout); + * @param iterable Iterable to convert from. + * @param [scheduler] Scheduler to run the enumeration of the input sequence on. + * @returns The observable sequence whose elements are pulled from the given generator sequence. + */ + fromItreable(iterable: {}, scheduler?: IScheduler): Observable; // todo: can't describe ES6 Iterable via TypeScript type system + generate(initialState: TState, condition: (state: TState) => boolean, iterate: (state: TState) => TState, resultSelector: (state: TState) => TResult, scheduler?: IScheduler): Observable; + never(): Observable; + + /** + * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. + * + * @example + * var res = Rx.Observable.of(1, 2, 3); + * @since 2.2.28 + * @returns The observable sequence whose elements are pulled from the given arguments. + */ + of(...values: T[]): Observable; + + /** + * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. + * @example + * var res = Rx.Observable.ofWithScheduler(Rx.Scheduler.timeout, 1, 2, 3); + * @since 2.2.28 + * @param [scheduler] A scheduler to use for scheduling the arguments. + * @returns The observable sequence whose elements are pulled from the given arguments. + */ + ofWithScheduler(scheduler?: IScheduler, ...values: T[]): Observable; + range(start: number, count: number, scheduler?: IScheduler): Observable; + repeat(value: T, repeatCount?: number, scheduler?: IScheduler): Observable; + return(value: T, scheduler?: IScheduler): Observable; + /** + * @since 2.2.28 + */ + just(value: T, scheduler?: IScheduler): Observable; // alias for return + returnValue(value: T, scheduler?: IScheduler): Observable; // alias for return + throw(exception: Error, scheduler?: IScheduler): Observable; + throw(exception: any, scheduler?: IScheduler): Observable; + throwException(exception: Error, scheduler?: IScheduler): Observable; // alias for throw + throwException(exception: any, scheduler?: IScheduler): Observable; // alias for throw + + catch(sources: Observable[]): Observable; + catch(sources: IPromise[]): Observable; + catchException(sources: Observable[]): Observable; // alias for catch + catchException(sources: IPromise[]): Observable; // alias for catch + catch(...sources: Observable[]): Observable; + catch(...sources: IPromise[]): Observable; + catchException(...sources: Observable[]): Observable; // alias for catch + catchException(...sources: IPromise[]): Observable; // alias for catch + + combineLatest(first: Observable, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; + combineLatest(first: IPromise, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; + combineLatest(first: Observable, second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; + combineLatest(first: IPromise, second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: Observable, second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: Observable, second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: IPromise, second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: IPromise, second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: IPromise, second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: IPromise, second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: IPromise, second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: IPromise, second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: IPromise, second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: IPromise, second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: IPromise, second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: IPromise, second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: IPromise, second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: IPromise, second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; + combineLatest(souces: Observable[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; + combineLatest(souces: IPromise[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; + + concat(...sources: Observable[]): Observable; + concat(...sources: IPromise[]): Observable; + concat(sources: Observable[]): Observable; + concat(sources: IPromise[]): Observable; + merge(...sources: Observable[]): Observable; + merge(...sources: IPromise[]): Observable; + merge(sources: Observable[]): Observable; + merge(sources: IPromise[]): Observable; + merge(scheduler: IScheduler, ...sources: Observable[]): Observable; + merge(scheduler: IScheduler, ...sources: IPromise[]): Observable; + merge(scheduler: IScheduler, sources: Observable[]): Observable; + merge(scheduler: IScheduler, sources: IPromise[]): Observable; + + zip(first: Observable, sources: Observable[], resultSelector: (item1: T1, ...right: T2[]) => TResult): Observable; + zip(first: Observable, sources: IPromise[], resultSelector: (item1: T1, ...right: T2[]) => TResult): Observable; + zip(source1: Observable, source2: Observable, resultSelector: (item1: T1, item2: T2) => TResult): Observable; + zip(source1: Observable, source2: IPromise, resultSelector: (item1: T1, item2: T2) => TResult): Observable; + zip(source1: Observable, source2: Observable, source3: Observable, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; + zip(source1: Observable, source2: Observable, source3: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; + zip(source1: Observable, source2: IPromise, source3: Observable, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; + zip(source1: Observable, source2: IPromise, source3: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; + zip(source1: Observable, source2: Observable, source3: Observable, source4: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; + zip(source1: Observable, source2: Observable, source3: Observable, source4: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; + zip(source1: Observable, source2: Observable, source3: IPromise, source4: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; + zip(source1: Observable, source2: Observable, source3: IPromise, source4: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; + zip(source1: Observable, source2: IPromise, source3: Observable, source4: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; + zip(source1: Observable, source2: IPromise, source3: Observable, source4: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; + zip(source1: Observable, source2: IPromise, source3: IPromise, source4: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; + zip(source1: Observable, source2: IPromise, source3: IPromise, source4: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; + zip(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5) => TResult): Observable; + zipArray(...sources: Observable[]): Observable; + zipArray(sources: Observable[]): Observable; + + /** + * Converts a Promise to an Observable sequence + * @param promise An ES6 Compliant promise. + * @returns An Observable sequence which wraps the existing promise success and failure. + */ + fromPromise(promise: IPromise): Observable; + } + + export var Observable: ObservableStatic; + + interface ISubject extends Observable, Observer, IDisposable { + hasObservers(): boolean; + } + + export interface Subject extends ISubject { + } + + interface SubjectStatic { + new (): Subject; + create(observer?: Observer, observable?: Observable): ISubject; + } + + export var Subject: SubjectStatic; + + export interface AsyncSubject extends Subject { + } + + interface AsyncSubjectStatic { + new (): AsyncSubject; + } + + export var AsyncSubject: AsyncSubjectStatic; +} diff --git a/rx.aggregates.d.ts b/rx.aggregates.d.ts new file mode 100644 index 000000000..001d1b993 --- /dev/null +++ b/rx.aggregates.d.ts @@ -0,0 +1,61 @@ +// Type definitions for RxJS-Aggregates v2.2.28 +// Project: http://rx.codeplex.com/ +// Definitions by: Carl de Billy , Igor Oleinikov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Rx { + export interface Observable { + finalValue(): Observable; + aggregate(accumulator: (acc: T, value: T) => T): Observable; + aggregate(seed: TAcc, accumulator: (acc: TAcc, value: T) => TAcc): Observable; + + reduce(accumulator: (acc: T, value: T) => T): Observable; + reduce(accumulator: (acc: TAcc, value: T) => TAcc, seed: TAcc): Observable; // TS0.9.5: won't work https://typescript.codeplex.com/discussions/471751 + + any(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; + some(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; // alias for any + + isEmpty(): Observable; + all(predicate?: (value: T) => boolean, thisArg?: any): Observable; + every(predicate?: (value: T) => boolean, thisArg?: any): Observable; // alias for all + contains(value: T): Observable; + contains(value: TOther, comparer: (value1: T, value2: TOther) => boolean): Observable; + count(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; + sum(keySelector?: (value: T, index: number, source: Observable) => number, thisArg?: any): Observable; + minBy(keySelector: (item: T) => TKey, comparer: (value1: TKey, value2: TKey) => number): Observable; + minBy(keySelector: (item: T) => number): Observable; + min(comparer?: (value1: T, value2: T) => number): Observable; + maxBy(keySelector: (item: T) => TKey, comparer: (value1: TKey, value2: TKey) => number): Observable; + maxBy(keySelector: (item: T) => number): Observable; + max(comparer?: (value1: T, value2: T) => number): Observable; + average(keySelector?: (value: T, index: number, source: Observable) => number, thisArg?: any): Observable; + + sequenceEqual(second: Observable, comparer: (value1: T, value2: TOther) => number): Observable; + sequenceEqual(second: IPromise, comparer: (value1: T, value2: TOther) => number): Observable; + sequenceEqual(second: Observable): Observable; + sequenceEqual(second: IPromise): Observable; + sequenceEqual(second: TOther[], comparer: (value1: T, value2: TOther) => number): Observable; + sequenceEqual(second: T[]): Observable; + + elementAt(index: number): Observable; + elementAtOrDefault(index: number, defaultValue?: T): Observable; + + single(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; + singleOrDefault(predicate?: (value: T, index: number, source: Observable) => boolean, defaultValue?: T, thisArg?: any): Observable; + + first(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; + firstOrDefault(predicate?: (value: T, index: number, source: Observable) => boolean, defaultValue?: T, thisArg?: any): Observable; + + last(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; + lastOrDefault(predicate?: (value: T, index: number, source: Observable) => boolean, defaultValue?: T, thisArg?: any): Observable; + + find(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; + findIndex(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; + } +} + +declare module "rx.aggregates" { + export = Rx; +} \ No newline at end of file diff --git a/rx.all.ts b/rx.all.ts new file mode 100644 index 000000000..c546477b8 --- /dev/null +++ b/rx.all.ts @@ -0,0 +1,20 @@ +// Type definitions for RxJS-All v2.2.28 +// Project: http://rx.codeplex.com/ +// Definitions by: Carl de Billy , Igor Oleinikov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +declare module "rx.all" { + export = Rx; +} \ No newline at end of file diff --git a/rx.async-lite.d.ts b/rx.async-lite.d.ts new file mode 100644 index 000000000..be13320c2 --- /dev/null +++ b/rx.async-lite.d.ts @@ -0,0 +1,65 @@ +// DefinitelyTyped: partial + +// This file contains common part of defintions for rx.async.d.ts and rx.lite.d.ts +// Do not include the file separately. + +/// + +declare module Rx { + interface ObservableStatic { + /** + * Invokes the asynchronous function, surfacing the result through an observable sequence. + * @param functionAsync Asynchronous function which returns a Promise to run. + * @returns An observable sequence exposing the function's result value, or an exception. + */ + startAsync(functionAsync: () => IPromise): Observable; + + fromCallback: { + // with single result callback without selector + (func: (callback: (result: TResult) => any) => any, scheduler?: IScheduler, context?: any): () => Observable; + (func: (arg1: T1, callback: (result: TResult) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: (result: TResult) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: (result: TResult) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; + // with any callback with selector + (func: (callback: Function) => any, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): () => Observable; + (func: (arg1: T1, callback: Function) => any, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: Function) => any, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1, arg2: T2, arg3: T3) => Observable; + // with any callback without selector + (func: (callback: Function) => any, scheduler?: IScheduler, context?: any): () => Observable; + (func: (arg1: T1, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; + // with any function with selector + (func: Function, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): (...args: any[]) => Observable; + // with any function without selector + (func: Function, scheduler?: IScheduler, context?: any): (...args: any[]) => Observable; + }; + + fromNodeCallback: { + // with single result callback without selector + (func: (callback: (err: any, result: T) => any) => any, scheduler?: IScheduler, context?: any): () => Observable; + (func: (arg1: T1, callback: (err: any, result: T) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: (err: any, result: T) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: T) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; + // with any callback with selector + (func: (callback: Function) => any, scheduler: IScheduler, context: any, selector: (results: TC[]) => TR): () => Observable; + (func: (arg1: T1, callback: Function) => any, scheduler: IScheduler, context: any, selector: (results: TC[]) => TR): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: Function) => any, scheduler: IScheduler, context: any, selector: (results: TC[]) => TR): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, scheduler: IScheduler, context: any, selector: (results: TC[]) => TR): (arg1: T1, arg2: T2, arg3: T3) => Observable; + // with any callback without selector + (func: (callback: Function) => any, scheduler?: IScheduler, context?: any): () => Observable; + (func: (arg1: T1, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; + // with any function with selector + (func: Function, scheduler: IScheduler, context: any, selector: (results: TC[]) => T): (...args: any[]) => Observable; + // with any function without selector + (func: Function, scheduler?: IScheduler, context?: any): (...args: any[]) => Observable; + }; + + fromEvent(element: NodeList, eventName: string, selector?: (arguments: any[]) => T): Observable; + fromEvent(element: Node, eventName: string, selector?: (arguments: any[]) => T): Observable; + fromEventPattern(addHandler: (handler: Function) => void, removeHandler: (handler: Function) => void, selector?: (arguments: any[])=>T): Observable; + } +} diff --git a/rx.async-tests.ts b/rx.async-tests.ts new file mode 100644 index 000000000..9c3bce516 --- /dev/null +++ b/rx.async-tests.ts @@ -0,0 +1,88 @@ +// Tests for RxJS-Async TypeScript definitions +// Tests by Igor Oleinikov + +/// + +module Rx.Tests.Async { + + var obsNum: Rx.Observable; + var obsStr: Rx.Observable; + var sch: Rx.IScheduler; + + function start() { + obsNum = Rx.Observable.start(()=> 10, sch, obsStr); + obsNum = Rx.Observable.start(()=> 10, sch); + obsNum = Rx.Observable.start(()=> 10); + } + + function toAsync() { + obsNum = Rx.Observable.toAsync(()=> 1, sch)(); + obsNum = Rx.Observable.toAsync((a1: number)=> a1)(1); + obsStr = Rx.Observable.toAsync((a1: string, a2: number)=> a1 + a2.toFixed(0))("", 1); + obsStr = Rx.Observable.toAsync((a1: string, a2: number, a3: Date)=> a1 + a2.toFixed(0) + a3.toDateString())("", 1, new Date()); + obsStr = Rx.Observable.toAsync((a1: string, a2: number, a3: Date, a4: boolean)=> a1 + a2.toFixed(0) + a3.toDateString() + (a4 ? 1 : 0))("", 1, new Date(), false); + } + + function fromCallback() { + // 0 arguments + var func0: (cb: (result: number)=> void)=> void; + obsNum = Rx.Observable.fromCallback(func0)(); + obsNum = Rx.Observable.fromCallback(func0, sch)(); + obsNum = Rx.Observable.fromCallback(func0, sch, obsStr)(); + obsNum = Rx.Observable.fromCallback(func0, sch, obsStr, (results: number[]) => results[0])(); + + // 1 argument + var func1: (a: string, cb: (result: number)=> void)=> number; + obsNum = Rx.Observable.fromCallback(func1)(""); + obsNum = Rx.Observable.fromCallback(func1, sch)(""); + obsNum = Rx.Observable.fromCallback(func1, sch, {})(""); + obsNum = Rx.Observable.fromCallback(func1, sch, {}, (results: number[]) => results[0])(""); + + // 2 arguments + var func2: (a: number, b: string, cb: (result: string) => number) => Date; + obsStr = Rx.Observable.fromCallback(func2)(1, ""); + obsStr = Rx.Observable.fromCallback(func2, sch)(1, ""); + obsStr = Rx.Observable.fromCallback(func2, sch, {})(1, ""); + obsStr = Rx.Observable.fromCallback(func2, sch, {}, (results: string[]) => results[0])(1, ""); + + // 3 arguments + var func3: (a: number, b: string, c: boolean, cb: (result: string) => number) => Date; + obsStr = Rx.Observable.fromCallback(func3)(1, "", true); + obsStr = Rx.Observable.fromCallback(func3, sch)(1, "", true); + obsStr = Rx.Observable.fromCallback(func3, sch, {})(1, "", true); + obsStr = Rx.Observable.fromCallback(func3, sch, {}, (results: string[]) => results[0])(1, "", true); + + // multiple results + var func0m: (cb: (result1: number, result2: number, result3: number) => void) => void; + obsNum = Rx.Observable.fromCallback(func0m, sch, obsStr, (results: number[]) => results[0])(); + var func1m: (a: string, cb: (result1: number, result2: number, result3: number) => void) => void; + obsNum = Rx.Observable.fromCallback(func1m, sch, obsStr, (results: number[]) => results[0])(""); + var func2m: (a: string, b: number, cb: (result1: string, result2: string, result3: string) => void) => void; + obsStr = Rx.Observable.fromCallback(func2m, sch, obsStr, (results: string[]) => results[0])("", 10); + } + + function toPromise() { + var promiseImpl: { + new(resolver: (resolvePromise: (value: T)=> void, rejectPromise: (reason: any)=> void)=> void): Rx.IPromise; + }; + + Rx.config.Promise = promiseImpl; + + var p: IPromise = obsNum.toPromise(promiseImpl); + + p = obsNum.toPromise(); + + p = p.then(x=> x); + p = p.then(x=> p); + p = p.then(undefined, reason=> 10); + p = p.then(undefined, reason=> p); + + var ps: IPromise = p.then(undefined, reason=> "error"); + ps = p.then(x=> ""); + ps = p.then(x=> ps); + } + + function startAsync() { + var o: Rx.Observable = Rx.Observable.startAsync(() => >null); + } +} \ No newline at end of file diff --git a/rx.async.d.ts b/rx.async.d.ts new file mode 100644 index 000000000..9370c828b --- /dev/null +++ b/rx.async.d.ts @@ -0,0 +1,43 @@ +// Type definitions for RxJS-Async v2.2.28 +// Project: http://rx.codeplex.com/ +// Definitions by: zoetrope , Igor Oleinikov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module Rx { + interface ObservableStatic { + start(func: () => T, scheduler?: IScheduler, context?: any): Observable; + + toAsync(func: () => TResult, scheduler?: IScheduler, context?: any): () => Observable; + toAsync(func: (arg1: T1) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; + toAsync(func: (arg1?: T1) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1) => Observable; + toAsync(func: (...args: T1[]) => TResult, scheduler?: IScheduler, context?: any): (...args: T1[]) => Observable; + toAsync(func: (arg1: T1, arg2: T2) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; + toAsync(func: (arg1: T1, arg2?: T2) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2) => Observable; + toAsync(func: (arg1?: T1, arg2?: T2) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2) => Observable; + toAsync(func: (arg1: T1, ...args: T2[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, ...args: T2[]) => Observable; + toAsync(func: (arg1?: T1, ...args: T2[]) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, ...args: T2[]) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3: T3) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3?: T3) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3?: T3) => Observable; + toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2, arg3?: T3) => Observable; + toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, arg3?: T3) => Observable; + toAsync(func: (arg1: T1, arg2: T2, ...args: T3[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, ...args: T3[]) => Observable; + toAsync(func: (arg1: T1, arg2?: T2, ...args: T3[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2, ...args: T3[]) => Observable; + toAsync(func: (arg1?: T1, arg2?: T2, ...args: T3[]) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, ...args: T3[]) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3: T3, arg4?: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3, arg4?: T4) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3?: T3, arg4?: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3?: T3, arg4?: T4) => Observable; + toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3, arg4?: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2, arg3?: T3, arg4?: T4) => Observable; + toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3, arg4?: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, arg3?: T3, arg4?: T4) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3, ...args: T4[]) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3?: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3?: T3, ...args: T4[]) => Observable; + toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable; + toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable; + } +} + +declare module "rx.async" { + export = Rx; +} \ No newline at end of file diff --git a/rx.backpressure-lite.d.ts b/rx.backpressure-lite.d.ts new file mode 100644 index 000000000..d1c244195 --- /dev/null +++ b/rx.backpressure-lite.d.ts @@ -0,0 +1,49 @@ +// DefinitelyTyped: partial + +// This file contains common part of defintions for rx.backpressure.d.ts and rx.lite.d.ts +// Do not include the file separately. + +/// + +declare module Rx { + export interface Observable { + /** + * Pauses the underlying observable sequence based upon the observable sequence which yields true/false. + * @example + * var pauser = new Rx.Subject(); + * var source = Rx.Observable.interval(100).pausable(pauser); + * @param pauser The observable sequence used to pause the underlying sequence. + * @returns The observable sequence which is paused based upon the pauser. + */ + pausable(pauser: Observable): Observable; + pausable(pauser?: ISubject): PausableObservable; + + /** + * Pauses the underlying observable sequence based upon the observable sequence which yields true/false, + * and yields the values that were buffered while paused. + * @example + * var pauser = new Rx.Subject(); + * var source = Rx.Observable.interval(100).pausableBuffered(pauser); + * @param pauser The observable sequence used to pause the underlying sequence. + * @returns The observable sequence which is paused based upon the pauser. + */ + pausableBuffered(pauser?: ISubject): PausableObservable; + + /** + * Attaches a controller to the observable sequence with the ability to queue. + * @example + * var source = Rx.Observable.interval(100).controlled(); + * source.request(3); // Reads 3 values + */ + controlled(enableQueue?: boolean): ControlledObservable; + } + + export interface ControlledObservable extends Observable { + request(numberOfItems?: number): IDisposable; + } + + export interface PausableObservable extends Observable { + pause(): void; + resume(): void; + } +} diff --git a/rx.backpressure-tests.ts b/rx.backpressure-tests.ts new file mode 100644 index 000000000..f036a1dc3 --- /dev/null +++ b/rx.backpressure-tests.ts @@ -0,0 +1,22 @@ +// Tests for RxJS-BackPressure TypeScript definitions +// Tests by Igor Oleinikov + +/// +/// + +function testPausable() { + var o: Rx.Observable; + + var pauser = new Rx.Subject(); + + var p = o.pausable(pauser); + p = o.pausableBuffered(pauser); +} + +function testControlled() { + var o: Rx.Observable; + var c = o.controlled(); + + var d: Rx.IDisposable = c.request(); + d = c.request(5); +} diff --git a/rx.backpressure.d.ts b/rx.backpressure.d.ts new file mode 100644 index 000000000..9c5e8abd5 --- /dev/null +++ b/rx.backpressure.d.ts @@ -0,0 +1,11 @@ +// Type definitions for RxJS-BackPressure v2.2.28 +// Project: http://rx.codeplex.com/ +// Definitions by: Igor Oleinikov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "rx.backpressure" { + export = Rx; +} \ No newline at end of file diff --git a/rx.binding-lite.d.ts b/rx.binding-lite.d.ts new file mode 100644 index 000000000..f896e260d --- /dev/null +++ b/rx.binding-lite.d.ts @@ -0,0 +1,72 @@ +// DefinitelyTyped: partial + +// This file contains common part of defintions for rx.binding.d.ts and rx.lite.d.ts +// Do not include the file separately. + +/// + +declare module Rx { + export interface BehaviorSubject extends Subject { + } + + interface BehaviorSubjectStatic { + new (initialValue: T): BehaviorSubject; + } + + export var BehaviorSubject: BehaviorSubjectStatic; + + export interface ReplaySubject extends Subject { + } + + interface ReplaySubjectStatic { + new (bufferSize?: number, window?: number, scheduler?: IScheduler): ReplaySubject; + } + + export var ReplaySubject: ReplaySubjectStatic; + + interface ConnectableObservable extends Observable { + connect(): IDisposable; + refCount(): Observable; + } + + interface ConnectableObservableStatic { + new (): ConnectableObservable; + } + + export var ConnectableObservable: ConnectableObservableStatic; + + export interface Observable { + multicast(subject: Observable): ConnectableObservable; + multicast(subjectSelector: () => ISubject, selector: (source: ConnectableObservable) => Observable): Observable; + publish(): ConnectableObservable; + publish(selector: (source: ConnectableObservable) => Observable): Observable; + /** + * Returns an observable sequence that shares a single subscription to the underlying sequence. + * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. + * + * @example + * var res = source.share(); + * + * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. + */ + share(): Observable; + publishLast(): ConnectableObservable; + publishLast(selector: (source: ConnectableObservable) => Observable): Observable; + publishValue(initialValue: T): ConnectableObservable; + publishValue(selector: (source: ConnectableObservable) => Observable, initialValue: T): Observable; + /** + * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue. + * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. + * + * @example + * var res = source.shareValue(42); + * + * @param initialValue Initial value received by observers upon subscription. + * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. + */ + shareValue(initialValue: T): Observable; + replay(selector?: boolean, bufferSize?: number, window?: number, scheduler?: IScheduler): ConnectableObservable; // hack to catch first omitted parameter + replay(selector: (source: ConnectableObservable) => Observable, bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; + shareReplay(bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; + } +} diff --git a/rx.binding.d.ts b/rx.binding.d.ts new file mode 100644 index 000000000..b93411a52 --- /dev/null +++ b/rx.binding.d.ts @@ -0,0 +1,11 @@ +// Type definitions for RxJS-Binding v2.2.28 +// Project: http://rx.codeplex.com/ +// Definitions by: Carl de Billy , Igor Oleinikov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "rx.binding" { + export = Rx; +} \ No newline at end of file diff --git a/rx.coincidence-lite.d.ts b/rx.coincidence-lite.d.ts new file mode 100644 index 000000000..801e42168 --- /dev/null +++ b/rx.coincidence-lite.d.ts @@ -0,0 +1,34 @@ +// DefinitelyTyped: partial + +// This file contains common part of defintions for rx.time.d.ts and rx.lite.d.ts +// Do not include the file separately. + +/// + +declare module Rx { + + interface Observable { + /** + * Returns a new observable that triggers on the second and subsequent triggerings of the input observable. + * The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair. + * The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs. + * @returns An observable that triggers on successive pairs of observations from the input observable as an array. + */ + pairwise(): Observable; + + /** + * Returns two observables which partition the observations of the source by the given function. + * The first will trigger observations for those values for which the predicate returns true. + * The second will trigger observations for those values where the predicate returns false. + * The predicate is executed once for each subscribed observer. + * Both also propagate all error observations arising from the source and each completes + * when the source completes. + * @param predicate + * The function to determine which output Observable will trigger a particular observation. + * @returns + * An array of observables. The first triggers when the predicate returns true, + * and the second triggers when the predicate returns false. + */ + partition(predicate: (value: T, index: number, source: Observable) => boolean, thisArg: any): Observable[]; + } +} diff --git a/rx.coincidence.d.ts b/rx.coincidence.d.ts new file mode 100644 index 000000000..87fa6a55b --- /dev/null +++ b/rx.coincidence.d.ts @@ -0,0 +1,36 @@ +// Type definitions for RxJS-Coincidence v2.2.28 +// Project: http://rx.codeplex.com/ +// Definitions by: Carl de Billy , Igor Oleinikov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module Rx { + + interface Observable { + join( + right: Observable, + leftDurationSelector: (leftItem: T) => Observable, + rightDurationSelector: (rightItem: TRight) => Observable, + resultSelector: (leftItem: T, rightItem: TRight) => TResult): Observable; + + groupJoin( + right: Observable, + leftDurationSelector: (leftItem: T) => Observable, + rightDurationSelector: (rightItem: TRight) => Observable, + resultSelector: (leftItem: T, rightItem: Observable) => TResult): Observable; + + window(windowOpenings: Observable): Observable>; + window(windowClosingSelector: () => Observable): Observable>; + window(windowOpenings: Observable, windowClosingSelector: () => Observable): Observable>; + + buffer(bufferOpenings: Observable): Observable; + buffer(bufferClosingSelector: () => Observable): Observable; + buffer(bufferOpenings: Observable, bufferClosingSelector: () => Observable): Observable; + } +} + +declare module "rx.coincidence" { + export = Rx; +} \ No newline at end of file diff --git a/rx.d.ts b/rx.d.ts new file mode 100644 index 000000000..1f26a94a9 --- /dev/null +++ b/rx.d.ts @@ -0,0 +1,102 @@ +// Type definitions for RxJS v2.2.28 +// Project: http://rx.codeplex.com/ +// Definitions by: gsino , Igor Oleinikov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Rx { + export interface IScheduler { + catch(handler: (exception: any) => boolean): IScheduler; + catchException(handler: (exception: any) => boolean): IScheduler; + } + + export class Scheduler implements IScheduler { + constructor( + now: () => number, + schedule: (state: any, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable, + scheduleRelative: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable, + scheduleAbsolute: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable); + + static normalize(timeSpan: number): number; + + static immediate: IScheduler; + static currentThread: ICurrentThreadScheduler; + static timeout: IScheduler; + + now(): number; + catch(handler: (exception: any) => boolean): IScheduler; + catchException(handler: (exception: any) => boolean): IScheduler; + + schedule(action: () => void): IDisposable; + scheduleWithState(state: TState, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; + scheduleWithAbsolute(dueTime: number, action: () => void): IDisposable; + scheduleWithAbsoluteAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; + scheduleWithRelative(dueTime: number, action: () => void): IDisposable; + scheduleWithRelativeAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; + + scheduleRecursive(action: (action: () => void) => void): IDisposable; + scheduleRecursiveWithState(state: TState, action: (state: TState, action: (state: TState) => void) => void): IDisposable; + scheduleRecursiveWithAbsolute(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable; + scheduleRecursiveWithAbsoluteAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable; + scheduleRecursiveWithRelative(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable; + scheduleRecursiveWithRelativeAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable; + + schedulePeriodic(period: number, action: () => void): IDisposable; + schedulePeriodicWithState(state: TState, period: number, action: (state: TState) => TState): IDisposable; + } + + // Observer + export interface Observer { + checked(): Observer; + } + + interface ObserverStatic { + /** + * Schedules the invocation of observer methods on the given scheduler. + * @param scheduler Scheduler to schedule observer messages on. + * @returns Observer whose messages are scheduled on the given scheduler. + */ + notifyOn(scheduler: IScheduler): Observer; + } + + export interface Observable { + observeOn(scheduler: IScheduler): Observable; + subscribeOn(scheduler: IScheduler): Observable; + + amb(rightSource: Observable): Observable; + amb(rightSource: IPromise): Observable; + onErrorResumeNext(second: Observable): Observable; + onErrorResumeNext(second: IPromise): Observable; + bufferWithCount(count: number, skip?: number): Observable; + windowWithCount(count: number, skip?: number): Observable>; + defaultIfEmpty(defaultValue?: T): Observable; + distinct(skipParameter: boolean, valueSerializer: (value: T) => string): Observable; + distinct(keySelector?: (value: T) => TKey, keySerializer?: (key: TKey) => string): Observable; + groupBy(keySelector: (value: T) => TKey, skipElementSelector?: boolean, keySerializer?: (key: TKey) => string): Observable>; + groupBy(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, keySerializer?: (key: TKey) => string): Observable>; + groupByUntil(keySelector: (value: T) => TKey, skipElementSelector: boolean, durationSelector: (group: GroupedObservable) => Observable, keySerializer?: (key: TKey) => string): Observable>; + groupByUntil(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, durationSelector: (group: GroupedObservable) => Observable, keySerializer?: (key: TKey) => string): Observable>; + } + + interface ObservableStatic { + using(resourceFactory: () => TResource, observableFactory: (resource: TResource) => Observable): Observable; + amb(...sources: Observable[]): Observable; + amb(...sources: IPromise[]): Observable; + amb(sources: Observable[]): Observable; + amb(sources: IPromise[]): Observable; + onErrorResumeNext(...sources: Observable[]): Observable; + onErrorResumeNext(...sources: IPromise[]): Observable; + onErrorResumeNext(sources: Observable[]): Observable; + onErrorResumeNext(sources: IPromise[]): Observable; + } + + interface GroupedObservable extends Observable { + key: TKey; + underlyingObservable: Observable; + } +} + +declare module "rx" { + export = Rx +} diff --git a/rx.experimental.d.ts b/rx.experimental.d.ts new file mode 100644 index 000000000..60aec86e1 --- /dev/null +++ b/rx.experimental.d.ts @@ -0,0 +1,321 @@ +// Type definitions for RxJS-Experimental v2.2.28 +// Project: https://github.com/Reactive-Extensions/RxJS/ +// Definitions by: Igor Oleinikov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Rx { + + interface Observable { + /** + * Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions. + * This operator allows for a fluent style of writing queries that use the same sequence multiple times. + * + * @param selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence. + * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. + */ + let(selector: (source: Observable) => Observable): Observable; + + /** + * Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions. + * This operator allows for a fluent style of writing queries that use the same sequence multiple times. + * + * @param selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence. + * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. + */ + letBind(selector: (source: Observable) => Observable): Observable; + + /** + * Repeats source as long as condition holds emulating a do while loop. + * @param condition The condition which determines if the source will be repeated. + * @returns An observable sequence which is repeated as long as the condition holds. + */ + doWhile(condition: () => boolean): Observable; + + /** + * Expands an observable sequence by recursively invoking selector. + * + * @param selector Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again. + * @param [scheduler] Scheduler on which to perform the expansion. If not provided, this defaults to the current thread scheduler. + * @returns An observable sequence containing all the elements produced by the recursive expansion. + */ + expand(selector: (item: T) => Observable, scheduler?: IScheduler): Observable; + + /** + * Runs two observable sequences in parallel and combines their last elemenets. + * + * @param second Second observable sequence or promise. + * @param resultSelector Result selector function to invoke with the last elements of both sequences. + * @returns An observable sequence with the result of calling the selector function with the last elements of both input sequences. + */ + forkJoin(second: Observable, resultSelector: (left: T, right: TSecond) => TResult): Observable; + forkJoin(second: IPromise, resultSelector: (left: T, right: TSecond) => TResult): Observable; + + /** + * Comonadic bind operator. + * @param selector A transform function to apply to each element. + * @param [scheduler] Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler. + * @returns An observable sequence which results from the comonadic bind operation. + */ + manySelect(selector: (item: Observable, index: number, source: Observable) => TResult, scheduler?: IScheduler): Observable; + } + + interface ObservableStatic { + /** + * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers (condition: () => boolean, thenSource: Observable, elseSource: Observable): Observable; + if(condition: () => boolean, thenSource: Observable, elseSource: IPromise): Observable; + if(condition: () => boolean, thenSource: IPromise, elseSource: Observable): Observable; + if(condition: () => boolean, thenSource: IPromise, elseSource: IPromise): Observable; + + /** + * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers (condition: () => boolean, thenSource: Observable, scheduler?: IScheduler): Observable; + if(condition: () => boolean, thenSource: IPromise, scheduler?: IScheduler): Observable; + + /** + * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers (condition: () => boolean, thenSource: Observable, elseSource: Observable): Observable; + ifThen(condition: () => boolean, thenSource: Observable, elseSource: IPromise): Observable; + ifThen(condition: () => boolean, thenSource: IPromise, elseSource: Observable): Observable; + ifThen(condition: () => boolean, thenSource: IPromise, elseSource: IPromise): Observable; + + /** + * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers (condition: () => boolean, thenSource: Observable, scheduler?: IScheduler): Observable; + ifThen(condition: () => boolean, thenSource: IPromise, scheduler?: IScheduler): Observable; + + /** + * Concatenates the observable sequences obtained by running the specified result selector for each element in source. + * There is an alias for this method called 'forIn' for browsers (sources: T[], resultSelector: (item: T) => Observable): Observable; + + /** + * Concatenates the observable sequences obtained by running the specified result selector for each element in source. + * There is an alias for this method called 'forIn' for browsers (sources: T[], resultSelector: (item: T) => Observable): Observable; + + /** + * Repeats source as long as condition holds emulating a while loop. + * There is an alias for this method called 'whileDo' for browsers (condition: () => boolean, source: Observable): Observable; + while(condition: () => boolean, source: IPromise): Observable; + + /** + * Repeats source as long as condition holds emulating a while loop. + * There is an alias for this method called 'whileDo' for browsers (condition: () => boolean, source: Observable): Observable; + whileDo(condition: () => boolean, source: IPromise): Observable; + + /** + * Uses selector to determine which source in sources to use. + * There is an alias 'switchCase' for browsers (selector: () => string, sources: { [key: string]: Observable; }, elseSource: Observable): Observable; + case(selector: () => string, sources: { [key: string]: IPromise; }, elseSource: Observable): Observable; + case(selector: () => string, sources: { [key: string]: Observable; }, elseSource: IPromise): Observable; + case(selector: () => string, sources: { [key: string]: IPromise; }, elseSource: IPromise): Observable; + + /** + * Uses selector to determine which source in sources to use. + * There is an alias 'switchCase' for browsers (selector: () => string, sources: { [key: string]: Observable; }, scheduler?: IScheduler): Observable; + case(selector: () => string, sources: { [key: string]: IPromise; }, scheduler?: IScheduler): Observable; + + /** + * Uses selector to determine which source in sources to use. + * There is an alias 'switchCase' for browsers (selector: () => number, sources: { [key: number]: Observable; }, elseSource: Observable): Observable; + case(selector: () => number, sources: { [key: number]: IPromise; }, elseSource: Observable): Observable; + case(selector: () => number, sources: { [key: number]: Observable; }, elseSource: IPromise): Observable; + case(selector: () => number, sources: { [key: number]: IPromise; }, elseSource: IPromise): Observable; + + /** + * Uses selector to determine which source in sources to use. + * There is an alias 'switchCase' for browsers (selector: () => number, sources: { [key: number]: Observable; }, scheduler?: IScheduler): Observable; + case(selector: () => number, sources: { [key: number]: IPromise; }, scheduler?: IScheduler): Observable; + + /** + * Uses selector to determine which source in sources to use. + * There is an alias 'switchCase' for browsers (selector: () => string, sources: { [key: string]: Observable; }, elseSource: Observable): Observable; + switchCase(selector: () => string, sources: { [key: string]: IPromise; }, elseSource: Observable): Observable; + switchCase(selector: () => string, sources: { [key: string]: Observable; }, elseSource: IPromise): Observable; + switchCase(selector: () => string, sources: { [key: string]: IPromise; }, elseSource: IPromise): Observable; + + /** + * Uses selector to determine which source in sources to use. + * There is an alias 'switchCase' for browsers (selector: () => string, sources: { [key: string]: Observable; }, scheduler?: IScheduler): Observable; + switchCase(selector: () => string, sources: { [key: string]: IPromise; }, scheduler?: IScheduler): Observable; + + /** + * Uses selector to determine which source in sources to use. + * There is an alias 'switchCase' for browsers (selector: () => number, sources: { [key: number]: Observable; }, elseSource: Observable): Observable; + switchCase(selector: () => number, sources: { [key: number]: IPromise; }, elseSource: Observable): Observable; + switchCase(selector: () => number, sources: { [key: number]: Observable; }, elseSource: IPromise): Observable; + switchCase(selector: () => number, sources: { [key: number]: IPromise; }, elseSource: IPromise): Observable; + + /** + * Uses selector to determine which source in sources to use. + * There is an alias 'switchCase' for browsers (selector: () => number, sources: { [key: number]: Observable; }, scheduler?: IScheduler): Observable; + switchCase(selector: () => number, sources: { [key: number]: IPromise; }, scheduler?: IScheduler): Observable; + + /** + * Runs all observable sequences in parallel and collect their last elements. + * + * @example + * res = Rx.Observable.forkJoin([obs1, obs2]); + * @param sources Array of source sequences or promises. + * @returns An observable sequence with an array collecting the last elements of all the input sequences. + */ + forkJoin(sources: Observable[]): Observable; + forkJoin(sources: IPromise[]): Observable; + + /** + * Runs all observable sequences in parallel and collect their last elements. + * + * @example + * res = Rx.Observable.forkJoin(obs1, obs2, ...); + * @param args Source sequences or promises. + * @returns An observable sequence with an array collecting the last elements of all the input sequences. + */ + forkJoin(...args: Observable[]): Observable; + forkJoin(...args: IPromise[]): Observable; + } +} + +declare module "rx.experimental" { + export = Rx; +} \ No newline at end of file diff --git a/rx.joinpatterns.d.ts b/rx.joinpatterns.d.ts new file mode 100644 index 000000000..929c66a6f --- /dev/null +++ b/rx.joinpatterns.d.ts @@ -0,0 +1,60 @@ +// Type definitions for RxJS-Join v2.2.28 +// Project: http://rx.codeplex.com/ +// Definitions by: Igor Oleinikov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Rx { + + interface Pattern1 { + and(other: Observable): Pattern2; + then(selector: (item1: T1) => TR): Plan; + } + interface Pattern2 { + and(other: Observable): Pattern3; + then(selector: (item1: T1, item2: T2) => TR): Plan; + } + interface Pattern3 { + and(other: Observable): Pattern4; + then(selector: (item1: T1, item2: T2, item3: T3) => TR): Plan; + } + interface Pattern4 { + and(other: Observable): Pattern5; + then(selector: (item1: T1, item2: T2, item3: T3, item4: T4) => TR): Plan; + } + interface Pattern5 { + and(other: Observable): Pattern6; + then(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5) => TR): Plan; + } + interface Pattern6 { + and(other: Observable): Pattern7; + then(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6) => TR): Plan; + } + interface Pattern7 { + and(other: Observable): Pattern8; + then(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6, item7: T7) => TR): Plan; + } + interface Pattern8 { + and(other: Observable): Pattern9; + then(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6, item7: T7, item8: T8) => TR): Plan; + } + interface Pattern9 { + then(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6, item7: T7, item8: T8, item9: T9) => TR): Plan; + } + + interface Plan { } + + interface Observable { + and(other: Observable): Pattern2; + then(selector: (item1: T) => TR): Plan; + } + + interface ObservableStatic { + when(plan: Plan): Observable; + } +} + +declare module "rx.joinpatterns" { + export = Rx; +} \ No newline at end of file diff --git a/rx.lite.d.ts b/rx.lite.d.ts new file mode 100644 index 000000000..046ef527d --- /dev/null +++ b/rx.lite.d.ts @@ -0,0 +1,50 @@ +// Type definitions for RxJS-Lite v2.2.28 +// Project: http://rx.codeplex.com/ +// Definitions by: gsino , Igor Oleinikov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// +/// +/// +/// +/// + +declare module Rx { + export class Scheduler implements IScheduler { + constructor( + now: () => number, + schedule: (state: any, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable, + scheduleRelative: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable, + scheduleAbsolute: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable); + + static normalize(timeSpan: number): number; + + static immediate: IScheduler; + static currentThread: ICurrentThreadScheduler; + static timeout: IScheduler; + + now(): number; + + schedule(action: () => void): IDisposable; + scheduleWithState(state: TState, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; + scheduleWithAbsolute(dueTime: number, action: () => void): IDisposable; + scheduleWithAbsoluteAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; + scheduleWithRelative(dueTime: number, action: () => void): IDisposable; + scheduleWithRelativeAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; + + scheduleRecursive(action: (action: () => void) => void): IDisposable; + scheduleRecursiveWithState(state: TState, action: (state: TState, action: (state: TState) => void) => void): IDisposable; + scheduleRecursiveWithAbsolute(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable; + scheduleRecursiveWithAbsoluteAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable; + scheduleRecursiveWithRelative(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable; + scheduleRecursiveWithRelativeAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable; + + schedulePeriodic(period: number, action: () => void): IDisposable; + schedulePeriodicWithState(state: TState, period: number, action: (state: TState) => TState): IDisposable; + } +} + +declare module "rx.lite" { + export = Rx; +} \ No newline at end of file diff --git a/rx.testing.d.ts b/rx.testing.d.ts new file mode 100644 index 000000000..0adc83e50 --- /dev/null +++ b/rx.testing.d.ts @@ -0,0 +1,62 @@ +// Type definitions for RxJS-Testing v2.2.28 +// Project: https://github.com/Reactive-Extensions/RxJS/ +// Definitions by: Igor Oleinikov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module Rx { + export class TestScheduler extends VirtualTimeScheduler { + constructor(); + + createColdObservable(...records: Recorded[]): Observable; + createHotObservable(...records: Recorded[]): Observable; + createObserver(): MockObserver; + + startWithTiming(create: () => Observable, createdAt: number, subscribedAt: number, disposedAt: number): MockObserver; + startWithDispose(create: () => Observable, disposedAt: number): MockObserver; + startWithCreate(create: () => Observable): MockObserver; + } + + export class Recorded { + constructor(time: number, value: any, equalityComparer?: (x: any, y: any) => boolean); + equals(other: Recorded): boolean; + toString(): string; + time: number; + value: any; + } + + export var ReactiveTest: { + created: number; + subscribed: number; + disposed: number; + + onNext(ticks: number, value: any): Recorded; + onNext(ticks: number, predicate: (value: any) => boolean): Recorded; + onError(ticks: number, exception: any): Recorded; + onError(ticks: number, predicate: (exception: any) => boolean): Recorded; + onCompleted(ticks: number): Recorded; + + subscribe(subscribeAt: number, unsubscribeAt?: number): Subscription; + }; + + export class Subscription { + constructor(subscribeAt: number, unsubscribeAt?: number); + equals(other: Subscription): boolean; + } + + export interface MockObserver extends Observer { + messages: Recorded[]; + } + + interface MockObserverStatic extends ObserverStatic { + new (scheduler: IScheduler): MockObserver; + } + + export var MockObserver: MockObserverStatic; +} + +declare module "rx.testing" { + export = Rx; +} \ No newline at end of file diff --git a/rx.time-lite.d.ts b/rx.time-lite.d.ts new file mode 100644 index 000000000..a5b102827 --- /dev/null +++ b/rx.time-lite.d.ts @@ -0,0 +1,62 @@ +// DefinitelyTyped: partial + +// This file contains common part of defintions for rx.time.d.ts and rx.lite.d.ts +// Do not include the file separately. + +/// + +declare module Rx { + export interface TimeInterval { + value: T; + interval: number; + } + + export interface Timestamp { + value: T; + timestamp: number; + } + + export interface Observable { + delay(dueTime: number, scheduler?: IScheduler): Observable; + throttle(dueTime: number, scheduler?: IScheduler): Observable; + timeInterval(scheduler?: IScheduler): Observable>; + timestamp(scheduler?: IScheduler): Observable>; + sample(interval: number, scheduler?: IScheduler): Observable; + sample(sampler: Observable, scheduler?: IScheduler): Observable; + timeout(dueTime: Date, other?: Observable, scheduler?: IScheduler): Observable; + timeout(dueTime: number, other?: Observable, scheduler?: IScheduler): Observable; + + delaySubscription(dueTime: number, scheduler?: IScheduler): Observable; + delayWithSelector(delayDurationSelector: (item: T) => number): Observable; + delayWithSelector(subscriptionDelay: number, delayDurationSelector: (item: T) => number): Observable; + + timeoutWithSelector(firstTimeout: Observable, timeoutdurationSelector?: (item: T) => Observable, other?: Observable): Observable; + throttleWithSelector(throttleDurationSelector: (item: T) => Observable): Observable; + + skipLastWithTime(duration: number, scheduler?: IScheduler): Observable; + takeLastWithTime(duration: number, timerScheduler?: IScheduler, loopScheduler?: IScheduler): Observable; + + takeLastBufferWithTime(duration: number, scheduler?: IScheduler): Observable; + takeWithTime(duration: number, scheduler?: IScheduler): Observable; + skipWithTime(duration: number, scheduler?: IScheduler): Observable; + + skipUntilWithTime(startTime: Date, scheduler?: IScheduler): Observable; + skipUntilWithTime(duration: number, scheduler?: IScheduler): Observable; + takeUntilWithTime(endTime: Date, scheduler?: IScheduler): Observable; + takeUntilWithTime(duration: number, scheduler?: IScheduler): Observable; + } + + interface ObservableStatic { + interval(period: number, scheduler?: IScheduler): Observable; + interval(dutTime: number, period: number, scheduler?: IScheduler): Observable; + timer(dueTime: number, period: number, scheduler: IScheduler): Observable; + timer(dueTime: number, scheduler: IScheduler): Observable; + generateWithRelativeTime( + initialState: TState, + condition: (state: TState) => boolean, + iterate: (state: TState) => TState, + resultSelector: (state: TState) => TResult, + timeSelector: (state: TState) => number, + scheduler?: IScheduler): Observable; + } +} diff --git a/rx.time.d.ts b/rx.time.d.ts new file mode 100644 index 000000000..6efd7d9cf --- /dev/null +++ b/rx.time.d.ts @@ -0,0 +1,35 @@ +// Type definitions for RxJS-Time v2.2.28 +// Project: http://rx.codeplex.com/ +// Definitions by: Carl de Billy , Igor Oleinikov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module Rx { + export interface Observable { + windowWithTime(timeSpan: number, timeShift: number, scheduler?: IScheduler): Observable>; + windowWithTime(timeSpan: number, scheduler?: IScheduler): Observable>; + windowWithTimeOrCount(timeSpan: number, count: number, scheduler?: IScheduler): Observable>; + bufferWithTime(timeSpan: number, timeShift: number, scheduler?: IScheduler): Observable; + bufferWithTime(timeSpan: number, scheduler?: IScheduler): Observable; + bufferWithTimeOrCount(timeSpan: number, count: number, scheduler?: IScheduler): Observable; + } + + interface ObservableStatic { + timer(dueTime: Date, period: number, scheduler: IScheduler): Observable; + timer(dueTime: Date, scheduler: IScheduler): Observable; + + generateWithAbsoluteTime( + initialState: TState, + condition: (state: TState) => boolean, + iterate: (state: TState) => TState, + resultSelector: (state: TState) => TResult, + timeSelector: (state: TState) => Date, + scheduler?: IScheduler): Observable; + } +} + +declare module "rx.time" { + export = Rx; +} \ No newline at end of file diff --git a/rx.virtualtime.d.ts b/rx.virtualtime.d.ts new file mode 100644 index 000000000..50a1bb39b --- /dev/null +++ b/rx.virtualtime.d.ts @@ -0,0 +1,39 @@ +// Type definitions for RxJS-VirtualTime v2.2.28 +// Project: http://rx.codeplex.com/ +// Definitions by: gsino , Igor Oleinikov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Rx { + // Virtual IScheduler + export /*abstract*/ class VirtualTimeScheduler extends Scheduler { + constructor(initialClock: TAbsolute, comparer: (first: TAbsolute, second: TAbsolute) => number); + + advanceBy(time: TRelative): void; + advanceTo(time: TAbsolute): void; + scheduleAbsolute(dueTime: TAbsolute, action: () => void): IDisposable; + scheduleAbsoluteWithState(state: TState, dueTime: TAbsolute, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; + scheduleRelative(dueTime: TRelative, action: () => void): IDisposable; + scheduleRelativeWithState(state: TState, dueTime: TRelative, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; + sleep(time: TRelative): void; + start(): IDisposable; + stop(): void; + + isEnabled: boolean; + + /* protected abstract */ add(from: TAbsolute, by: TRelative): TAbsolute; + /* protected abstract */ toDateTimeOffset(duetime: TAbsolute): number; + /* protected abstract */ toRelative(duetime: number): TRelative; + + /* protected */ getNext(): internals.ScheduledItem; + } + + export class HistoricalScheduler extends VirtualTimeScheduler { + constructor(initialClock: number, comparer: (first: number, second: number) => number); + } +} + +declare module "rx.virtualtime" { + export = Rx; +} \ No newline at end of file From 3854edf9c3d5172c6f5f70f783218543be6892fb Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 22 Jul 2014 10:03:38 -0700 Subject: [PATCH 009/537] Added few helpers functions. --- rx/rx-lite.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rx/rx-lite.d.ts b/rx/rx-lite.d.ts index c7a148137..eea3c55ce 100644 --- a/rx/rx-lite.d.ts +++ b/rx/rx-lite.d.ts @@ -49,6 +49,8 @@ declare module Rx { export module helpers { function noop(): void; + function notDefined(value: any): boolean; + function isScheduler(value: any): boolean; function identity(value: T): T; function defaultNow(): number; function defaultComparer(left: any, right: any): boolean; From f9155131802b5062676acf94164e1f3c04e3c6c2 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 22 Jul 2014 10:41:20 -0700 Subject: [PATCH 010/537] Removed rx files before merging. --- rx/rx-lite.d.ts | 567 ----------------------------------- rx/rx.aggregates.d.ts | 61 ---- rx/rx.all.ts | 20 -- rx/rx.async-lite.d.ts | 65 ---- rx/rx.async-tests.ts | 88 ------ rx/rx.async.d.ts | 43 --- rx/rx.backpressure-lite.d.ts | 49 --- rx/rx.backpressure-tests.ts | 22 -- rx/rx.backpressure.d.ts | 11 - rx/rx.binding-lite.d.ts | 72 ----- rx/rx.binding.d.ts | 11 - rx/rx.coincidence-lite.d.ts | 34 --- rx/rx.coincidence.d.ts | 36 --- rx/rx.d.ts | 102 ------- rx/rx.experimental.d.ts | 321 -------------------- rx/rx.joinpatterns.d.ts | 60 ---- rx/rx.lite.d.ts | 50 --- rx/rx.testing.d.ts | 62 ---- rx/rx.time-lite.d.ts | 62 ---- rx/rx.time.d.ts | 35 --- rx/rx.virtualtime.d.ts | 39 --- 21 files changed, 1810 deletions(-) delete mode 100644 rx/rx-lite.d.ts delete mode 100644 rx/rx.aggregates.d.ts delete mode 100644 rx/rx.all.ts delete mode 100644 rx/rx.async-lite.d.ts delete mode 100644 rx/rx.async-tests.ts delete mode 100644 rx/rx.async.d.ts delete mode 100644 rx/rx.backpressure-lite.d.ts delete mode 100644 rx/rx.backpressure-tests.ts delete mode 100644 rx/rx.backpressure.d.ts delete mode 100644 rx/rx.binding-lite.d.ts delete mode 100644 rx/rx.binding.d.ts delete mode 100644 rx/rx.coincidence-lite.d.ts delete mode 100644 rx/rx.coincidence.d.ts delete mode 100644 rx/rx.d.ts delete mode 100644 rx/rx.experimental.d.ts delete mode 100644 rx/rx.joinpatterns.d.ts delete mode 100644 rx/rx.lite.d.ts delete mode 100644 rx/rx.testing.d.ts delete mode 100644 rx/rx.time-lite.d.ts delete mode 100644 rx/rx.time.d.ts delete mode 100644 rx/rx.virtualtime.d.ts diff --git a/rx/rx-lite.d.ts b/rx/rx-lite.d.ts deleted file mode 100644 index eea3c55ce..000000000 --- a/rx/rx-lite.d.ts +++ /dev/null @@ -1,567 +0,0 @@ -// DefinitelyTyped: partial - -// This file contains common part of defintions for rx.d.ts and rx.lite.d.ts -// Do not include the file separately. - -declare module Rx { - export module internals { - function isEqual(left: any, right: any): boolean; - function addRef(xs: Observable, r: { getDisposable(): IDisposable; }): Observable; - - // Priority Queue for Scheduling - export class PriorityQueue { - constructor(capacity: number); - - length: number; - - isHigherPriority(left: number, right: number): boolean; - percolate(index: number): void; - heapify(index: number): void; - peek(): ScheduledItem; - removeAt(index: number): void; - dequeue(): ScheduledItem; - enqueue(item: ScheduledItem): void; - remove(item: ScheduledItem): boolean; - - static count: number; - } - - export class ScheduledItem { - constructor(scheduler: IScheduler, state: any, action: (scheduler: IScheduler, state: any) => IDisposable, dueTime: TTime, comparer?: (x: TTime, y: TTime) => number); - - scheduler: IScheduler; - state: TTime; - action: (scheduler: IScheduler, state: any) => IDisposable; - dueTime: TTime; - comparer: (x: TTime, y: TTime) => number; - disposable: SingleAssignmentDisposable; - - invoke(): void; - compareTo(other: ScheduledItem): number; - isCancelled(): boolean; - invokeCore(): IDisposable; - } - } - - export module config { - export var Promise: { new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): IPromise; }; - } - - export module helpers { - function noop(): void; - function notDefined(value: any): boolean; - function isScheduler(value: any): boolean; - function identity(value: T): T; - function defaultNow(): number; - function defaultComparer(left: any, right: any): boolean; - function defaultSubComparer(left: any, right: any): number; - function defaultKeySerializer(key: any): string; - function defaultError(err: any): void; - function isPromise(p: any): boolean; - function asArray(...args: T[]): T[]; - function not(value: any): boolean; - } - - export interface IDisposable { - dispose(): void; - } - - export class CompositeDisposable implements IDisposable { - constructor (...disposables: IDisposable[]); - constructor (disposables: IDisposable[]); - - isDisposed: boolean; - length: number; - - dispose(): void; - add(item: IDisposable): void; - remove(item: IDisposable): boolean; - clear(): void; - contains(item: IDisposable): boolean; - toArray(): IDisposable[]; - } - - export class Disposable implements IDisposable { - constructor(action: () => void); - - static create(action: () => void): IDisposable; - static empty: IDisposable; - - dispose(): void; - } - - // Single assignment - export class SingleAssignmentDisposable implements IDisposable { - constructor(); - - isDisposed: boolean; - current: IDisposable; - - dispose(): void ; - getDisposable(): IDisposable; - setDisposable(value: IDisposable): void ; - } - - // Multiple assignment disposable - export class SerialDisposable implements IDisposable { - constructor(); - - isDisposed: boolean; - - dispose(): void; - getDisposable(): IDisposable; - setDisposable(value: IDisposable): void; - } - - export class RefCountDisposable implements IDisposable { - constructor(disposable: IDisposable); - - dispose(): void; - - isDisposed: boolean; - getDisposable(): IDisposable; - } - - export interface IScheduler { - now(): number; - - schedule(action: () => void): IDisposable; - scheduleWithState(state: TState, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; - scheduleWithAbsolute(dueTime: number, action: () => void): IDisposable; - scheduleWithAbsoluteAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) =>IDisposable): IDisposable; - scheduleWithRelative(dueTime: number, action: () => void): IDisposable; - scheduleWithRelativeAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) =>IDisposable): IDisposable; - - scheduleRecursive(action: (action: () =>void ) =>void ): IDisposable; - scheduleRecursiveWithState(state: TState, action: (state: TState, action: (state: TState) =>void ) =>void ): IDisposable; - scheduleRecursiveWithAbsolute(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable; - scheduleRecursiveWithAbsoluteAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable; - scheduleRecursiveWithRelative(dueTime: number, action: (action: (dueTime: number) =>void ) =>void ): IDisposable; - scheduleRecursiveWithRelativeAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) =>void ) =>void ): IDisposable; - - schedulePeriodic(period: number, action: () => void): IDisposable; - schedulePeriodicWithState(state: TState, period: number, action: (state: TState) => TState): IDisposable; - } - - // Current Thread IScheduler - interface ICurrentThreadScheduler extends IScheduler { - scheduleRequired(): boolean; - } - - // Notifications - export class Notification { - accept(observer: IObserver): void; - accept(onNext: (value: T) => TResult, onError?: (exception: any) => TResult, onCompleted?: () => TResult): TResult; - toObservable(scheduler?: IScheduler): Observable; - hasValue: boolean; - equals(other: Notification): boolean; - kind: string; - value: T; - exception: any; - - static createOnNext(value: T): Notification; - static createOnError(exception: any): Notification; - static createOnCompleted(): Notification; - } - - /** - * Promise A+ - */ - export interface IPromise { - then(onFulfilled: (value: T) => IPromise, onRejected: (reason: any) => IPromise): IPromise; - then(onFulfilled: (value: T) => IPromise, onRejected?: (reason: any) => R): IPromise; - then(onFulfilled: (value: T) => R, onRejected: (reason: any) => IPromise): IPromise; - then(onFulfilled?: (value: T) => R, onRejected?: (reason: any) => R): IPromise; - } - - // Observer - export interface IObserver { - onNext(value: T): void; - onError(exception: any): void; - onCompleted(): void; - } - - export interface Observer extends IObserver { - toNotifier(): (notification: Notification) => void; - asObserver(): Observer; - } - - interface ObserverStatic { - create(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observer; - fromNotifier(handler: (notification: Notification) => void): Observer; - } - - export var Observer: ObserverStatic; - - export interface IObservable { - subscribe(observer: Observer): IDisposable; - subscribe(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): IDisposable; - } - - export interface Observable extends IObservable { - forEach(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): IDisposable; // alias for subscribe - toArray(): Observable; - - catch(handler: (exception: any) => Observable): Observable; - catchException(handler: (exception: any) => Observable): Observable; // alias for catch - catch(handler: (exception: any) => IPromise): Observable; - catchException(handler: (exception: any) => IPromise): Observable; // alias for catch - catch(second: Observable): Observable; - catchException(second: Observable): Observable; // alias for catch - combineLatest(second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; - combineLatest(souces: Observable[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; - combineLatest(souces: IPromise[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; - concat(...sources: Observable[]): Observable; - concat(...sources: IPromise[]): Observable; - concat(sources: Observable[]): Observable; - concat(sources: IPromise[]): Observable; - concatAll(): T; - concatObservable(): T; // alias for concatAll - concatMap(selector: (value: T, index: number) => Observable, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; // alias for selectConcat - concatMap(selector: (value: T, index: number) => IPromise, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; // alias for selectConcat - concatMap(selector: (value: T, index: number) => Observable): Observable; // alias for selectConcat - concatMap(selector: (value: T, index: number) => IPromise): Observable; // alias for selectConcat - concatMap(sequence: Observable): Observable; // alias for selectConcat - merge(maxConcurrent: number): T; - merge(other: Observable): Observable; - merge(other: IPromise): Observable; - mergeAll(): T; - mergeObservable(): T; // alias for mergeAll - skipUntil(other: Observable): Observable; - skipUntil(other: IPromise): Observable; - switch(): T; - switchLatest(): T; // alias for switch - takeUntil(other: Observable): Observable; - takeUntil(other: IPromise): Observable; - zip(second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - zip(second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - zip(second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - zip(second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - zip(second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - zip(second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - zip(second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; - zip(second: Observable[], resultSelector: (left: T, ...right: TOther[]) => TResult): Observable; - zip(second: IPromise[], resultSelector: (left: T, ...right: TOther[]) => TResult): Observable; - - asObservable(): Observable; - dematerialize(): Observable; - distinctUntilChanged(skipParameter: boolean, comparer: (x: T, y: T) => boolean): Observable; - distinctUntilChanged(keySelector?: (value: T) => TValue, comparer?: (x: TValue, y: TValue) => boolean): Observable; - do(observer: Observer): Observable; - doAction(observer: Observer): Observable; // alias for do - do(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable; - doAction(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable; // alias for do - finally(action: () => void): Observable; - finallyAction(action: () => void): Observable; // alias for finally - ignoreElements(): Observable; - materialize(): Observable>; - repeat(repeatCount?: number): Observable; - retry(retryCount?: number): Observable; - scan(seed: TAcc, accumulator: (acc: TAcc, value: T) => TAcc): Observable; - scan(accumulator: (acc: T, value: T) => T): Observable; - skipLast(count: number): Observable; - startWith(...values: T[]): Observable; - startWith(scheduler: IScheduler, ...values: T[]): Observable; - takeLast(count: number, scheduler?: IScheduler): Observable; - takeLastBuffer(count: number): Observable; - - select(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; - map(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; // alias for select - selectMany(selector: (value: T) => Observable, resultSelector: (item: T, other: TOther) => TResult): Observable; - selectMany(selector: (value: T) => IPromise, resultSelector: (item: T, other: TOther) => TResult): Observable; - selectMany(selector: (value: T) => Observable): Observable; - selectMany(selector: (value: T) => IPromise): Observable; - selectMany(other: Observable): Observable; - selectMany(other: IPromise): Observable; - flatMap(selector: (value: T) => Observable, resultSelector: (item: T, other: TOther) => TResult): Observable; // alias for selectMany - flatMap(selector: (value: T) => IPromise, resultSelector: (item: T, other: TOther) => TResult): Observable; // alias for selectMany - flatMap(selector: (value: T) => Observable): Observable; // alias for selectMany - flatMap(selector: (value: T) => IPromise): Observable; // alias for selectMany - flatMap(other: Observable): Observable; // alias for selectMany - flatMap(other: IPromise): Observable; // alias for selectMany - - selectConcat(selector: (value: T, index: number) => Observable, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; - selectConcat(selector: (value: T, index: number) => IPromise, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; - selectConcat(selector: (value: T, index: number) => Observable): Observable; - selectConcat(selector: (value: T, index: number) => IPromise): Observable; - selectConcat(sequence: Observable): Observable; - - /** - * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then - * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. - * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - * @param [thisArg] Object to use as this when executing callback. - * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences - * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. - */ - selectSwitch(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; - /** - * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then - * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. - * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - * @param [thisArg] Object to use as this when executing callback. - * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences - * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. - */ - flatMapLatest(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; // alias for selectSwitch - /** - * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then - * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. - * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - * @param [thisArg] Object to use as this when executing callback. - * @since 2.2.28 - * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences - * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. - */ - switchMap(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; // alias for selectSwitch - - skip(count: number): Observable; - skipWhile(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - take(count: number, scheduler?: IScheduler): Observable; - takeWhile(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - where(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - filter(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; // alias for where - - /** - * Converts an existing observable sequence to an ES6 Compatible Promise - * @example - * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); - * @param promiseCtor The constructor of the promise. - * @returns An ES6 compatible promise with the last value from the observable sequence. - */ - toPromise>(promiseCtor: { new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): TPromise; }): TPromise; - /** - * Converts an existing observable sequence to an ES6 Compatible Promise - * @example - * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); - * - * // With config - * Rx.config.Promise = RSVP.Promise; - * var promise = Rx.Observable.return(42).toPromise(); - * @param [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise. - * @returns An ES6 compatible promise with the last value from the observable sequence. - */ - toPromise(promiseCtor?: { new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): IPromise; }): IPromise; - - // Experimental Flattening - - /** - * Performs a exclusive waiting for the first to finish before subscribing to another observable. - * Observables that come in between subscriptions will be dropped on the floor. - * Can be applied on `Observable>` or `Observable>`. - * @since 2.2.28 - * @returns A exclusive observable with only the results that happen when subscribed. - */ - exclusive(): Observable; - - /** - * Performs a exclusive map waiting for the first to finish before subscribing to another observable. - * Observables that come in between subscriptions will be dropped on the floor. - * Can be applied on `Observable>` or `Observable>`. - * @since 2.2.28 - * @param selector Selector to invoke for every item in the current subscription. - * @param [thisArg] An optional context to invoke with the selector parameter. - * @returns {An exclusive observable with only the results that happen when subscribed. - */ - exclusiveMap(selector: (value: I, index: number, source: Observable) => R, thisArg?: any): Observable; - } - - interface ObservableStatic { - create(subscribe: (observer: Observer) => IDisposable): Observable; - create(subscribe: (observer: Observer) => () => void): Observable; - create(subscribe: (observer: Observer) => void): Observable; - createWithDisposable(subscribe: (observer: Observer) => IDisposable): Observable; - defer(observableFactory: () => Observable): Observable; - defer(observableFactory: () => IPromise): Observable; - empty(scheduler?: IScheduler): Observable; - fromArray(array: T[], scheduler?: IScheduler): Observable; - fromArray(array: { length: number;[index: number]: T; }, scheduler?: IScheduler): Observable; - - /** - * Converts an iterable into an Observable sequence - * - * @example - * var res = Rx.Observable.fromIterable(new Map()); - * var res = Rx.Observable.fromIterable(function* () { yield 42; }); - * var res = Rx.Observable.fromIterable(new Set(), Rx.Scheduler.timeout); - * @param generator Generator to convert from. - * @param [scheduler] Scheduler to run the enumeration of the input sequence on. - * @returns The observable sequence whose elements are pulled from the given generator sequence. - */ - fromItreable(generator: () => { next(): { done: boolean; value?: T; }; }, scheduler?: IScheduler): Observable; - - /** - * Converts an iterable into an Observable sequence - * - * @example - * var res = Rx.Observable.fromIterable(new Map()); - * var res = Rx.Observable.fromIterable(new Set(), Rx.Scheduler.timeout); - * @param iterable Iterable to convert from. - * @param [scheduler] Scheduler to run the enumeration of the input sequence on. - * @returns The observable sequence whose elements are pulled from the given generator sequence. - */ - fromItreable(iterable: {}, scheduler?: IScheduler): Observable; // todo: can't describe ES6 Iterable via TypeScript type system - generate(initialState: TState, condition: (state: TState) => boolean, iterate: (state: TState) => TState, resultSelector: (state: TState) => TResult, scheduler?: IScheduler): Observable; - never(): Observable; - - /** - * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. - * - * @example - * var res = Rx.Observable.of(1, 2, 3); - * @since 2.2.28 - * @returns The observable sequence whose elements are pulled from the given arguments. - */ - of(...values: T[]): Observable; - - /** - * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. - * @example - * var res = Rx.Observable.ofWithScheduler(Rx.Scheduler.timeout, 1, 2, 3); - * @since 2.2.28 - * @param [scheduler] A scheduler to use for scheduling the arguments. - * @returns The observable sequence whose elements are pulled from the given arguments. - */ - ofWithScheduler(scheduler?: IScheduler, ...values: T[]): Observable; - range(start: number, count: number, scheduler?: IScheduler): Observable; - repeat(value: T, repeatCount?: number, scheduler?: IScheduler): Observable; - return(value: T, scheduler?: IScheduler): Observable; - /** - * @since 2.2.28 - */ - just(value: T, scheduler?: IScheduler): Observable; // alias for return - returnValue(value: T, scheduler?: IScheduler): Observable; // alias for return - throw(exception: Error, scheduler?: IScheduler): Observable; - throw(exception: any, scheduler?: IScheduler): Observable; - throwException(exception: Error, scheduler?: IScheduler): Observable; // alias for throw - throwException(exception: any, scheduler?: IScheduler): Observable; // alias for throw - - catch(sources: Observable[]): Observable; - catch(sources: IPromise[]): Observable; - catchException(sources: Observable[]): Observable; // alias for catch - catchException(sources: IPromise[]): Observable; // alias for catch - catch(...sources: Observable[]): Observable; - catch(...sources: IPromise[]): Observable; - catchException(...sources: Observable[]): Observable; // alias for catch - catchException(...sources: IPromise[]): Observable; // alias for catch - - combineLatest(first: Observable, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; - combineLatest(souces: Observable[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; - combineLatest(souces: IPromise[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; - - concat(...sources: Observable[]): Observable; - concat(...sources: IPromise[]): Observable; - concat(sources: Observable[]): Observable; - concat(sources: IPromise[]): Observable; - merge(...sources: Observable[]): Observable; - merge(...sources: IPromise[]): Observable; - merge(sources: Observable[]): Observable; - merge(sources: IPromise[]): Observable; - merge(scheduler: IScheduler, ...sources: Observable[]): Observable; - merge(scheduler: IScheduler, ...sources: IPromise[]): Observable; - merge(scheduler: IScheduler, sources: Observable[]): Observable; - merge(scheduler: IScheduler, sources: IPromise[]): Observable; - - zip(first: Observable, sources: Observable[], resultSelector: (item1: T1, ...right: T2[]) => TResult): Observable; - zip(first: Observable, sources: IPromise[], resultSelector: (item1: T1, ...right: T2[]) => TResult): Observable; - zip(source1: Observable, source2: Observable, resultSelector: (item1: T1, item2: T2) => TResult): Observable; - zip(source1: Observable, source2: IPromise, resultSelector: (item1: T1, item2: T2) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: Observable, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: Observable, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: Observable, source4: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: Observable, source4: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: IPromise, source4: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: IPromise, source4: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: Observable, source4: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: Observable, source4: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: IPromise, source4: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: IPromise, source4: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5) => TResult): Observable; - zipArray(...sources: Observable[]): Observable; - zipArray(sources: Observable[]): Observable; - - /** - * Converts a Promise to an Observable sequence - * @param promise An ES6 Compliant promise. - * @returns An Observable sequence which wraps the existing promise success and failure. - */ - fromPromise(promise: IPromise): Observable; - } - - export var Observable: ObservableStatic; - - interface ISubject extends Observable, Observer, IDisposable { - hasObservers(): boolean; - } - - export interface Subject extends ISubject { - } - - interface SubjectStatic { - new (): Subject; - create(observer?: Observer, observable?: Observable): ISubject; - } - - export var Subject: SubjectStatic; - - export interface AsyncSubject extends Subject { - } - - interface AsyncSubjectStatic { - new (): AsyncSubject; - } - - export var AsyncSubject: AsyncSubjectStatic; -} diff --git a/rx/rx.aggregates.d.ts b/rx/rx.aggregates.d.ts deleted file mode 100644 index 001d1b993..000000000 --- a/rx/rx.aggregates.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Type definitions for RxJS-Aggregates v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: Carl de Billy , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module Rx { - export interface Observable { - finalValue(): Observable; - aggregate(accumulator: (acc: T, value: T) => T): Observable; - aggregate(seed: TAcc, accumulator: (acc: TAcc, value: T) => TAcc): Observable; - - reduce(accumulator: (acc: T, value: T) => T): Observable; - reduce(accumulator: (acc: TAcc, value: T) => TAcc, seed: TAcc): Observable; // TS0.9.5: won't work https://typescript.codeplex.com/discussions/471751 - - any(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - some(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; // alias for any - - isEmpty(): Observable; - all(predicate?: (value: T) => boolean, thisArg?: any): Observable; - every(predicate?: (value: T) => boolean, thisArg?: any): Observable; // alias for all - contains(value: T): Observable; - contains(value: TOther, comparer: (value1: T, value2: TOther) => boolean): Observable; - count(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - sum(keySelector?: (value: T, index: number, source: Observable) => number, thisArg?: any): Observable; - minBy(keySelector: (item: T) => TKey, comparer: (value1: TKey, value2: TKey) => number): Observable; - minBy(keySelector: (item: T) => number): Observable; - min(comparer?: (value1: T, value2: T) => number): Observable; - maxBy(keySelector: (item: T) => TKey, comparer: (value1: TKey, value2: TKey) => number): Observable; - maxBy(keySelector: (item: T) => number): Observable; - max(comparer?: (value1: T, value2: T) => number): Observable; - average(keySelector?: (value: T, index: number, source: Observable) => number, thisArg?: any): Observable; - - sequenceEqual(second: Observable, comparer: (value1: T, value2: TOther) => number): Observable; - sequenceEqual(second: IPromise, comparer: (value1: T, value2: TOther) => number): Observable; - sequenceEqual(second: Observable): Observable; - sequenceEqual(second: IPromise): Observable; - sequenceEqual(second: TOther[], comparer: (value1: T, value2: TOther) => number): Observable; - sequenceEqual(second: T[]): Observable; - - elementAt(index: number): Observable; - elementAtOrDefault(index: number, defaultValue?: T): Observable; - - single(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - singleOrDefault(predicate?: (value: T, index: number, source: Observable) => boolean, defaultValue?: T, thisArg?: any): Observable; - - first(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - firstOrDefault(predicate?: (value: T, index: number, source: Observable) => boolean, defaultValue?: T, thisArg?: any): Observable; - - last(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - lastOrDefault(predicate?: (value: T, index: number, source: Observable) => boolean, defaultValue?: T, thisArg?: any): Observable; - - find(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - findIndex(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - } -} - -declare module "rx.aggregates" { - export = Rx; -} \ No newline at end of file diff --git a/rx/rx.all.ts b/rx/rx.all.ts deleted file mode 100644 index c546477b8..000000000 --- a/rx/rx.all.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Type definitions for RxJS-All v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: Carl de Billy , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// - -declare module "rx.all" { - export = Rx; -} \ No newline at end of file diff --git a/rx/rx.async-lite.d.ts b/rx/rx.async-lite.d.ts deleted file mode 100644 index be13320c2..000000000 --- a/rx/rx.async-lite.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -// DefinitelyTyped: partial - -// This file contains common part of defintions for rx.async.d.ts and rx.lite.d.ts -// Do not include the file separately. - -/// - -declare module Rx { - interface ObservableStatic { - /** - * Invokes the asynchronous function, surfacing the result through an observable sequence. - * @param functionAsync Asynchronous function which returns a Promise to run. - * @returns An observable sequence exposing the function's result value, or an exception. - */ - startAsync(functionAsync: () => IPromise): Observable; - - fromCallback: { - // with single result callback without selector - (func: (callback: (result: TResult) => any) => any, scheduler?: IScheduler, context?: any): () => Observable; - (func: (arg1: T1, callback: (result: TResult) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: (result: TResult) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: (result: TResult) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; - // with any callback with selector - (func: (callback: Function) => any, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): () => Observable; - (func: (arg1: T1, callback: Function) => any, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: Function) => any, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1, arg2: T2, arg3: T3) => Observable; - // with any callback without selector - (func: (callback: Function) => any, scheduler?: IScheduler, context?: any): () => Observable; - (func: (arg1: T1, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; - // with any function with selector - (func: Function, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): (...args: any[]) => Observable; - // with any function without selector - (func: Function, scheduler?: IScheduler, context?: any): (...args: any[]) => Observable; - }; - - fromNodeCallback: { - // with single result callback without selector - (func: (callback: (err: any, result: T) => any) => any, scheduler?: IScheduler, context?: any): () => Observable; - (func: (arg1: T1, callback: (err: any, result: T) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: (err: any, result: T) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: T) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; - // with any callback with selector - (func: (callback: Function) => any, scheduler: IScheduler, context: any, selector: (results: TC[]) => TR): () => Observable; - (func: (arg1: T1, callback: Function) => any, scheduler: IScheduler, context: any, selector: (results: TC[]) => TR): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: Function) => any, scheduler: IScheduler, context: any, selector: (results: TC[]) => TR): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, scheduler: IScheduler, context: any, selector: (results: TC[]) => TR): (arg1: T1, arg2: T2, arg3: T3) => Observable; - // with any callback without selector - (func: (callback: Function) => any, scheduler?: IScheduler, context?: any): () => Observable; - (func: (arg1: T1, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; - // with any function with selector - (func: Function, scheduler: IScheduler, context: any, selector: (results: TC[]) => T): (...args: any[]) => Observable; - // with any function without selector - (func: Function, scheduler?: IScheduler, context?: any): (...args: any[]) => Observable; - }; - - fromEvent(element: NodeList, eventName: string, selector?: (arguments: any[]) => T): Observable; - fromEvent(element: Node, eventName: string, selector?: (arguments: any[]) => T): Observable; - fromEventPattern(addHandler: (handler: Function) => void, removeHandler: (handler: Function) => void, selector?: (arguments: any[])=>T): Observable; - } -} diff --git a/rx/rx.async-tests.ts b/rx/rx.async-tests.ts deleted file mode 100644 index 9c3bce516..000000000 --- a/rx/rx.async-tests.ts +++ /dev/null @@ -1,88 +0,0 @@ -// Tests for RxJS-Async TypeScript definitions -// Tests by Igor Oleinikov - -/// - -module Rx.Tests.Async { - - var obsNum: Rx.Observable; - var obsStr: Rx.Observable; - var sch: Rx.IScheduler; - - function start() { - obsNum = Rx.Observable.start(()=> 10, sch, obsStr); - obsNum = Rx.Observable.start(()=> 10, sch); - obsNum = Rx.Observable.start(()=> 10); - } - - function toAsync() { - obsNum = Rx.Observable.toAsync(()=> 1, sch)(); - obsNum = Rx.Observable.toAsync((a1: number)=> a1)(1); - obsStr = Rx.Observable.toAsync((a1: string, a2: number)=> a1 + a2.toFixed(0))("", 1); - obsStr = Rx.Observable.toAsync((a1: string, a2: number, a3: Date)=> a1 + a2.toFixed(0) + a3.toDateString())("", 1, new Date()); - obsStr = Rx.Observable.toAsync((a1: string, a2: number, a3: Date, a4: boolean)=> a1 + a2.toFixed(0) + a3.toDateString() + (a4 ? 1 : 0))("", 1, new Date(), false); - } - - function fromCallback() { - // 0 arguments - var func0: (cb: (result: number)=> void)=> void; - obsNum = Rx.Observable.fromCallback(func0)(); - obsNum = Rx.Observable.fromCallback(func0, sch)(); - obsNum = Rx.Observable.fromCallback(func0, sch, obsStr)(); - obsNum = Rx.Observable.fromCallback(func0, sch, obsStr, (results: number[]) => results[0])(); - - // 1 argument - var func1: (a: string, cb: (result: number)=> void)=> number; - obsNum = Rx.Observable.fromCallback(func1)(""); - obsNum = Rx.Observable.fromCallback(func1, sch)(""); - obsNum = Rx.Observable.fromCallback(func1, sch, {})(""); - obsNum = Rx.Observable.fromCallback(func1, sch, {}, (results: number[]) => results[0])(""); - - // 2 arguments - var func2: (a: number, b: string, cb: (result: string) => number) => Date; - obsStr = Rx.Observable.fromCallback(func2)(1, ""); - obsStr = Rx.Observable.fromCallback(func2, sch)(1, ""); - obsStr = Rx.Observable.fromCallback(func2, sch, {})(1, ""); - obsStr = Rx.Observable.fromCallback(func2, sch, {}, (results: string[]) => results[0])(1, ""); - - // 3 arguments - var func3: (a: number, b: string, c: boolean, cb: (result: string) => number) => Date; - obsStr = Rx.Observable.fromCallback(func3)(1, "", true); - obsStr = Rx.Observable.fromCallback(func3, sch)(1, "", true); - obsStr = Rx.Observable.fromCallback(func3, sch, {})(1, "", true); - obsStr = Rx.Observable.fromCallback(func3, sch, {}, (results: string[]) => results[0])(1, "", true); - - // multiple results - var func0m: (cb: (result1: number, result2: number, result3: number) => void) => void; - obsNum = Rx.Observable.fromCallback(func0m, sch, obsStr, (results: number[]) => results[0])(); - var func1m: (a: string, cb: (result1: number, result2: number, result3: number) => void) => void; - obsNum = Rx.Observable.fromCallback(func1m, sch, obsStr, (results: number[]) => results[0])(""); - var func2m: (a: string, b: number, cb: (result1: string, result2: string, result3: string) => void) => void; - obsStr = Rx.Observable.fromCallback(func2m, sch, obsStr, (results: string[]) => results[0])("", 10); - } - - function toPromise() { - var promiseImpl: { - new(resolver: (resolvePromise: (value: T)=> void, rejectPromise: (reason: any)=> void)=> void): Rx.IPromise; - }; - - Rx.config.Promise = promiseImpl; - - var p: IPromise = obsNum.toPromise(promiseImpl); - - p = obsNum.toPromise(); - - p = p.then(x=> x); - p = p.then(x=> p); - p = p.then(undefined, reason=> 10); - p = p.then(undefined, reason=> p); - - var ps: IPromise = p.then(undefined, reason=> "error"); - ps = p.then(x=> ""); - ps = p.then(x=> ps); - } - - function startAsync() { - var o: Rx.Observable = Rx.Observable.startAsync(() => >null); - } -} \ No newline at end of file diff --git a/rx/rx.async.d.ts b/rx/rx.async.d.ts deleted file mode 100644 index 9370c828b..000000000 --- a/rx/rx.async.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Type definitions for RxJS-Async v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: zoetrope , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// - -declare module Rx { - interface ObservableStatic { - start(func: () => T, scheduler?: IScheduler, context?: any): Observable; - - toAsync(func: () => TResult, scheduler?: IScheduler, context?: any): () => Observable; - toAsync(func: (arg1: T1) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; - toAsync(func: (arg1?: T1) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1) => Observable; - toAsync(func: (...args: T1[]) => TResult, scheduler?: IScheduler, context?: any): (...args: T1[]) => Observable; - toAsync(func: (arg1: T1, arg2: T2) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; - toAsync(func: (arg1: T1, arg2?: T2) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2) => Observable; - toAsync(func: (arg1: T1, ...args: T2[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, ...args: T2[]) => Observable; - toAsync(func: (arg1?: T1, ...args: T2[]) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, ...args: T2[]) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3: T3) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3?: T3) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3?: T3) => Observable; - toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2, arg3?: T3) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, arg3?: T3) => Observable; - toAsync(func: (arg1: T1, arg2: T2, ...args: T3[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, ...args: T3[]) => Observable; - toAsync(func: (arg1: T1, arg2?: T2, ...args: T3[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2, ...args: T3[]) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2, ...args: T3[]) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, ...args: T3[]) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3: T3, arg4?: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3, arg4?: T4) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3?: T3, arg4?: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3?: T3, arg4?: T4) => Observable; - toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3, arg4?: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2, arg3?: T3, arg4?: T4) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3, arg4?: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, arg3?: T3, arg4?: T4) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3, ...args: T4[]) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3?: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3?: T3, ...args: T4[]) => Observable; - toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable; - } -} - -declare module "rx.async" { - export = Rx; -} \ No newline at end of file diff --git a/rx/rx.backpressure-lite.d.ts b/rx/rx.backpressure-lite.d.ts deleted file mode 100644 index d1c244195..000000000 --- a/rx/rx.backpressure-lite.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -// DefinitelyTyped: partial - -// This file contains common part of defintions for rx.backpressure.d.ts and rx.lite.d.ts -// Do not include the file separately. - -/// - -declare module Rx { - export interface Observable { - /** - * Pauses the underlying observable sequence based upon the observable sequence which yields true/false. - * @example - * var pauser = new Rx.Subject(); - * var source = Rx.Observable.interval(100).pausable(pauser); - * @param pauser The observable sequence used to pause the underlying sequence. - * @returns The observable sequence which is paused based upon the pauser. - */ - pausable(pauser: Observable): Observable; - pausable(pauser?: ISubject): PausableObservable; - - /** - * Pauses the underlying observable sequence based upon the observable sequence which yields true/false, - * and yields the values that were buffered while paused. - * @example - * var pauser = new Rx.Subject(); - * var source = Rx.Observable.interval(100).pausableBuffered(pauser); - * @param pauser The observable sequence used to pause the underlying sequence. - * @returns The observable sequence which is paused based upon the pauser. - */ - pausableBuffered(pauser?: ISubject): PausableObservable; - - /** - * Attaches a controller to the observable sequence with the ability to queue. - * @example - * var source = Rx.Observable.interval(100).controlled(); - * source.request(3); // Reads 3 values - */ - controlled(enableQueue?: boolean): ControlledObservable; - } - - export interface ControlledObservable extends Observable { - request(numberOfItems?: number): IDisposable; - } - - export interface PausableObservable extends Observable { - pause(): void; - resume(): void; - } -} diff --git a/rx/rx.backpressure-tests.ts b/rx/rx.backpressure-tests.ts deleted file mode 100644 index f036a1dc3..000000000 --- a/rx/rx.backpressure-tests.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Tests for RxJS-BackPressure TypeScript definitions -// Tests by Igor Oleinikov - -/// -/// - -function testPausable() { - var o: Rx.Observable; - - var pauser = new Rx.Subject(); - - var p = o.pausable(pauser); - p = o.pausableBuffered(pauser); -} - -function testControlled() { - var o: Rx.Observable; - var c = o.controlled(); - - var d: Rx.IDisposable = c.request(); - d = c.request(5); -} diff --git a/rx/rx.backpressure.d.ts b/rx/rx.backpressure.d.ts deleted file mode 100644 index 9c5e8abd5..000000000 --- a/rx/rx.backpressure.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Type definitions for RxJS-BackPressure v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// - -declare module "rx.backpressure" { - export = Rx; -} \ No newline at end of file diff --git a/rx/rx.binding-lite.d.ts b/rx/rx.binding-lite.d.ts deleted file mode 100644 index f896e260d..000000000 --- a/rx/rx.binding-lite.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -// DefinitelyTyped: partial - -// This file contains common part of defintions for rx.binding.d.ts and rx.lite.d.ts -// Do not include the file separately. - -/// - -declare module Rx { - export interface BehaviorSubject extends Subject { - } - - interface BehaviorSubjectStatic { - new (initialValue: T): BehaviorSubject; - } - - export var BehaviorSubject: BehaviorSubjectStatic; - - export interface ReplaySubject extends Subject { - } - - interface ReplaySubjectStatic { - new (bufferSize?: number, window?: number, scheduler?: IScheduler): ReplaySubject; - } - - export var ReplaySubject: ReplaySubjectStatic; - - interface ConnectableObservable extends Observable { - connect(): IDisposable; - refCount(): Observable; - } - - interface ConnectableObservableStatic { - new (): ConnectableObservable; - } - - export var ConnectableObservable: ConnectableObservableStatic; - - export interface Observable { - multicast(subject: Observable): ConnectableObservable; - multicast(subjectSelector: () => ISubject, selector: (source: ConnectableObservable) => Observable): Observable; - publish(): ConnectableObservable; - publish(selector: (source: ConnectableObservable) => Observable): Observable; - /** - * Returns an observable sequence that shares a single subscription to the underlying sequence. - * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. - * - * @example - * var res = source.share(); - * - * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. - */ - share(): Observable; - publishLast(): ConnectableObservable; - publishLast(selector: (source: ConnectableObservable) => Observable): Observable; - publishValue(initialValue: T): ConnectableObservable; - publishValue(selector: (source: ConnectableObservable) => Observable, initialValue: T): Observable; - /** - * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue. - * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. - * - * @example - * var res = source.shareValue(42); - * - * @param initialValue Initial value received by observers upon subscription. - * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. - */ - shareValue(initialValue: T): Observable; - replay(selector?: boolean, bufferSize?: number, window?: number, scheduler?: IScheduler): ConnectableObservable; // hack to catch first omitted parameter - replay(selector: (source: ConnectableObservable) => Observable, bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; - shareReplay(bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; - } -} diff --git a/rx/rx.binding.d.ts b/rx/rx.binding.d.ts deleted file mode 100644 index b93411a52..000000000 --- a/rx/rx.binding.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Type definitions for RxJS-Binding v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: Carl de Billy , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// - -declare module "rx.binding" { - export = Rx; -} \ No newline at end of file diff --git a/rx/rx.coincidence-lite.d.ts b/rx/rx.coincidence-lite.d.ts deleted file mode 100644 index 801e42168..000000000 --- a/rx/rx.coincidence-lite.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -// DefinitelyTyped: partial - -// This file contains common part of defintions for rx.time.d.ts and rx.lite.d.ts -// Do not include the file separately. - -/// - -declare module Rx { - - interface Observable { - /** - * Returns a new observable that triggers on the second and subsequent triggerings of the input observable. - * The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair. - * The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs. - * @returns An observable that triggers on successive pairs of observations from the input observable as an array. - */ - pairwise(): Observable; - - /** - * Returns two observables which partition the observations of the source by the given function. - * The first will trigger observations for those values for which the predicate returns true. - * The second will trigger observations for those values where the predicate returns false. - * The predicate is executed once for each subscribed observer. - * Both also propagate all error observations arising from the source and each completes - * when the source completes. - * @param predicate - * The function to determine which output Observable will trigger a particular observation. - * @returns - * An array of observables. The first triggers when the predicate returns true, - * and the second triggers when the predicate returns false. - */ - partition(predicate: (value: T, index: number, source: Observable) => boolean, thisArg: any): Observable[]; - } -} diff --git a/rx/rx.coincidence.d.ts b/rx/rx.coincidence.d.ts deleted file mode 100644 index 87fa6a55b..000000000 --- a/rx/rx.coincidence.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Type definitions for RxJS-Coincidence v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: Carl de Billy , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// - -declare module Rx { - - interface Observable { - join( - right: Observable, - leftDurationSelector: (leftItem: T) => Observable, - rightDurationSelector: (rightItem: TRight) => Observable, - resultSelector: (leftItem: T, rightItem: TRight) => TResult): Observable; - - groupJoin( - right: Observable, - leftDurationSelector: (leftItem: T) => Observable, - rightDurationSelector: (rightItem: TRight) => Observable, - resultSelector: (leftItem: T, rightItem: Observable) => TResult): Observable; - - window(windowOpenings: Observable): Observable>; - window(windowClosingSelector: () => Observable): Observable>; - window(windowOpenings: Observable, windowClosingSelector: () => Observable): Observable>; - - buffer(bufferOpenings: Observable): Observable; - buffer(bufferClosingSelector: () => Observable): Observable; - buffer(bufferOpenings: Observable, bufferClosingSelector: () => Observable): Observable; - } -} - -declare module "rx.coincidence" { - export = Rx; -} \ No newline at end of file diff --git a/rx/rx.d.ts b/rx/rx.d.ts deleted file mode 100644 index 1f26a94a9..000000000 --- a/rx/rx.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -// Type definitions for RxJS v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: gsino , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module Rx { - export interface IScheduler { - catch(handler: (exception: any) => boolean): IScheduler; - catchException(handler: (exception: any) => boolean): IScheduler; - } - - export class Scheduler implements IScheduler { - constructor( - now: () => number, - schedule: (state: any, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable, - scheduleRelative: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable, - scheduleAbsolute: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable); - - static normalize(timeSpan: number): number; - - static immediate: IScheduler; - static currentThread: ICurrentThreadScheduler; - static timeout: IScheduler; - - now(): number; - catch(handler: (exception: any) => boolean): IScheduler; - catchException(handler: (exception: any) => boolean): IScheduler; - - schedule(action: () => void): IDisposable; - scheduleWithState(state: TState, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; - scheduleWithAbsolute(dueTime: number, action: () => void): IDisposable; - scheduleWithAbsoluteAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; - scheduleWithRelative(dueTime: number, action: () => void): IDisposable; - scheduleWithRelativeAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; - - scheduleRecursive(action: (action: () => void) => void): IDisposable; - scheduleRecursiveWithState(state: TState, action: (state: TState, action: (state: TState) => void) => void): IDisposable; - scheduleRecursiveWithAbsolute(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable; - scheduleRecursiveWithAbsoluteAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable; - scheduleRecursiveWithRelative(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable; - scheduleRecursiveWithRelativeAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable; - - schedulePeriodic(period: number, action: () => void): IDisposable; - schedulePeriodicWithState(state: TState, period: number, action: (state: TState) => TState): IDisposable; - } - - // Observer - export interface Observer { - checked(): Observer; - } - - interface ObserverStatic { - /** - * Schedules the invocation of observer methods on the given scheduler. - * @param scheduler Scheduler to schedule observer messages on. - * @returns Observer whose messages are scheduled on the given scheduler. - */ - notifyOn(scheduler: IScheduler): Observer; - } - - export interface Observable { - observeOn(scheduler: IScheduler): Observable; - subscribeOn(scheduler: IScheduler): Observable; - - amb(rightSource: Observable): Observable; - amb(rightSource: IPromise): Observable; - onErrorResumeNext(second: Observable): Observable; - onErrorResumeNext(second: IPromise): Observable; - bufferWithCount(count: number, skip?: number): Observable; - windowWithCount(count: number, skip?: number): Observable>; - defaultIfEmpty(defaultValue?: T): Observable; - distinct(skipParameter: boolean, valueSerializer: (value: T) => string): Observable; - distinct(keySelector?: (value: T) => TKey, keySerializer?: (key: TKey) => string): Observable; - groupBy(keySelector: (value: T) => TKey, skipElementSelector?: boolean, keySerializer?: (key: TKey) => string): Observable>; - groupBy(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, keySerializer?: (key: TKey) => string): Observable>; - groupByUntil(keySelector: (value: T) => TKey, skipElementSelector: boolean, durationSelector: (group: GroupedObservable) => Observable, keySerializer?: (key: TKey) => string): Observable>; - groupByUntil(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, durationSelector: (group: GroupedObservable) => Observable, keySerializer?: (key: TKey) => string): Observable>; - } - - interface ObservableStatic { - using(resourceFactory: () => TResource, observableFactory: (resource: TResource) => Observable): Observable; - amb(...sources: Observable[]): Observable; - amb(...sources: IPromise[]): Observable; - amb(sources: Observable[]): Observable; - amb(sources: IPromise[]): Observable; - onErrorResumeNext(...sources: Observable[]): Observable; - onErrorResumeNext(...sources: IPromise[]): Observable; - onErrorResumeNext(sources: Observable[]): Observable; - onErrorResumeNext(sources: IPromise[]): Observable; - } - - interface GroupedObservable extends Observable { - key: TKey; - underlyingObservable: Observable; - } -} - -declare module "rx" { - export = Rx -} diff --git a/rx/rx.experimental.d.ts b/rx/rx.experimental.d.ts deleted file mode 100644 index 60aec86e1..000000000 --- a/rx/rx.experimental.d.ts +++ /dev/null @@ -1,321 +0,0 @@ -// Type definitions for RxJS-Experimental v2.2.28 -// Project: https://github.com/Reactive-Extensions/RxJS/ -// Definitions by: Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module Rx { - - interface Observable { - /** - * Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions. - * This operator allows for a fluent style of writing queries that use the same sequence multiple times. - * - * @param selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence. - * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. - */ - let(selector: (source: Observable) => Observable): Observable; - - /** - * Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions. - * This operator allows for a fluent style of writing queries that use the same sequence multiple times. - * - * @param selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence. - * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. - */ - letBind(selector: (source: Observable) => Observable): Observable; - - /** - * Repeats source as long as condition holds emulating a do while loop. - * @param condition The condition which determines if the source will be repeated. - * @returns An observable sequence which is repeated as long as the condition holds. - */ - doWhile(condition: () => boolean): Observable; - - /** - * Expands an observable sequence by recursively invoking selector. - * - * @param selector Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again. - * @param [scheduler] Scheduler on which to perform the expansion. If not provided, this defaults to the current thread scheduler. - * @returns An observable sequence containing all the elements produced by the recursive expansion. - */ - expand(selector: (item: T) => Observable, scheduler?: IScheduler): Observable; - - /** - * Runs two observable sequences in parallel and combines their last elemenets. - * - * @param second Second observable sequence or promise. - * @param resultSelector Result selector function to invoke with the last elements of both sequences. - * @returns An observable sequence with the result of calling the selector function with the last elements of both input sequences. - */ - forkJoin(second: Observable, resultSelector: (left: T, right: TSecond) => TResult): Observable; - forkJoin(second: IPromise, resultSelector: (left: T, right: TSecond) => TResult): Observable; - - /** - * Comonadic bind operator. - * @param selector A transform function to apply to each element. - * @param [scheduler] Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler. - * @returns An observable sequence which results from the comonadic bind operation. - */ - manySelect(selector: (item: Observable, index: number, source: Observable) => TResult, scheduler?: IScheduler): Observable; - } - - interface ObservableStatic { - /** - * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers (condition: () => boolean, thenSource: Observable, elseSource: Observable): Observable; - if(condition: () => boolean, thenSource: Observable, elseSource: IPromise): Observable; - if(condition: () => boolean, thenSource: IPromise, elseSource: Observable): Observable; - if(condition: () => boolean, thenSource: IPromise, elseSource: IPromise): Observable; - - /** - * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers (condition: () => boolean, thenSource: Observable, scheduler?: IScheduler): Observable; - if(condition: () => boolean, thenSource: IPromise, scheduler?: IScheduler): Observable; - - /** - * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers (condition: () => boolean, thenSource: Observable, elseSource: Observable): Observable; - ifThen(condition: () => boolean, thenSource: Observable, elseSource: IPromise): Observable; - ifThen(condition: () => boolean, thenSource: IPromise, elseSource: Observable): Observable; - ifThen(condition: () => boolean, thenSource: IPromise, elseSource: IPromise): Observable; - - /** - * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers (condition: () => boolean, thenSource: Observable, scheduler?: IScheduler): Observable; - ifThen(condition: () => boolean, thenSource: IPromise, scheduler?: IScheduler): Observable; - - /** - * Concatenates the observable sequences obtained by running the specified result selector for each element in source. - * There is an alias for this method called 'forIn' for browsers (sources: T[], resultSelector: (item: T) => Observable): Observable; - - /** - * Concatenates the observable sequences obtained by running the specified result selector for each element in source. - * There is an alias for this method called 'forIn' for browsers (sources: T[], resultSelector: (item: T) => Observable): Observable; - - /** - * Repeats source as long as condition holds emulating a while loop. - * There is an alias for this method called 'whileDo' for browsers (condition: () => boolean, source: Observable): Observable; - while(condition: () => boolean, source: IPromise): Observable; - - /** - * Repeats source as long as condition holds emulating a while loop. - * There is an alias for this method called 'whileDo' for browsers (condition: () => boolean, source: Observable): Observable; - whileDo(condition: () => boolean, source: IPromise): Observable; - - /** - * Uses selector to determine which source in sources to use. - * There is an alias 'switchCase' for browsers (selector: () => string, sources: { [key: string]: Observable; }, elseSource: Observable): Observable; - case(selector: () => string, sources: { [key: string]: IPromise; }, elseSource: Observable): Observable; - case(selector: () => string, sources: { [key: string]: Observable; }, elseSource: IPromise): Observable; - case(selector: () => string, sources: { [key: string]: IPromise; }, elseSource: IPromise): Observable; - - /** - * Uses selector to determine which source in sources to use. - * There is an alias 'switchCase' for browsers (selector: () => string, sources: { [key: string]: Observable; }, scheduler?: IScheduler): Observable; - case(selector: () => string, sources: { [key: string]: IPromise; }, scheduler?: IScheduler): Observable; - - /** - * Uses selector to determine which source in sources to use. - * There is an alias 'switchCase' for browsers (selector: () => number, sources: { [key: number]: Observable; }, elseSource: Observable): Observable; - case(selector: () => number, sources: { [key: number]: IPromise; }, elseSource: Observable): Observable; - case(selector: () => number, sources: { [key: number]: Observable; }, elseSource: IPromise): Observable; - case(selector: () => number, sources: { [key: number]: IPromise; }, elseSource: IPromise): Observable; - - /** - * Uses selector to determine which source in sources to use. - * There is an alias 'switchCase' for browsers (selector: () => number, sources: { [key: number]: Observable; }, scheduler?: IScheduler): Observable; - case(selector: () => number, sources: { [key: number]: IPromise; }, scheduler?: IScheduler): Observable; - - /** - * Uses selector to determine which source in sources to use. - * There is an alias 'switchCase' for browsers (selector: () => string, sources: { [key: string]: Observable; }, elseSource: Observable): Observable; - switchCase(selector: () => string, sources: { [key: string]: IPromise; }, elseSource: Observable): Observable; - switchCase(selector: () => string, sources: { [key: string]: Observable; }, elseSource: IPromise): Observable; - switchCase(selector: () => string, sources: { [key: string]: IPromise; }, elseSource: IPromise): Observable; - - /** - * Uses selector to determine which source in sources to use. - * There is an alias 'switchCase' for browsers (selector: () => string, sources: { [key: string]: Observable; }, scheduler?: IScheduler): Observable; - switchCase(selector: () => string, sources: { [key: string]: IPromise; }, scheduler?: IScheduler): Observable; - - /** - * Uses selector to determine which source in sources to use. - * There is an alias 'switchCase' for browsers (selector: () => number, sources: { [key: number]: Observable; }, elseSource: Observable): Observable; - switchCase(selector: () => number, sources: { [key: number]: IPromise; }, elseSource: Observable): Observable; - switchCase(selector: () => number, sources: { [key: number]: Observable; }, elseSource: IPromise): Observable; - switchCase(selector: () => number, sources: { [key: number]: IPromise; }, elseSource: IPromise): Observable; - - /** - * Uses selector to determine which source in sources to use. - * There is an alias 'switchCase' for browsers (selector: () => number, sources: { [key: number]: Observable; }, scheduler?: IScheduler): Observable; - switchCase(selector: () => number, sources: { [key: number]: IPromise; }, scheduler?: IScheduler): Observable; - - /** - * Runs all observable sequences in parallel and collect their last elements. - * - * @example - * res = Rx.Observable.forkJoin([obs1, obs2]); - * @param sources Array of source sequences or promises. - * @returns An observable sequence with an array collecting the last elements of all the input sequences. - */ - forkJoin(sources: Observable[]): Observable; - forkJoin(sources: IPromise[]): Observable; - - /** - * Runs all observable sequences in parallel and collect their last elements. - * - * @example - * res = Rx.Observable.forkJoin(obs1, obs2, ...); - * @param args Source sequences or promises. - * @returns An observable sequence with an array collecting the last elements of all the input sequences. - */ - forkJoin(...args: Observable[]): Observable; - forkJoin(...args: IPromise[]): Observable; - } -} - -declare module "rx.experimental" { - export = Rx; -} \ No newline at end of file diff --git a/rx/rx.joinpatterns.d.ts b/rx/rx.joinpatterns.d.ts deleted file mode 100644 index 929c66a6f..000000000 --- a/rx/rx.joinpatterns.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -// Type definitions for RxJS-Join v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module Rx { - - interface Pattern1 { - and(other: Observable): Pattern2; - then(selector: (item1: T1) => TR): Plan; - } - interface Pattern2 { - and(other: Observable): Pattern3; - then(selector: (item1: T1, item2: T2) => TR): Plan; - } - interface Pattern3 { - and(other: Observable): Pattern4; - then(selector: (item1: T1, item2: T2, item3: T3) => TR): Plan; - } - interface Pattern4 { - and(other: Observable): Pattern5; - then(selector: (item1: T1, item2: T2, item3: T3, item4: T4) => TR): Plan; - } - interface Pattern5 { - and(other: Observable): Pattern6; - then(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5) => TR): Plan; - } - interface Pattern6 { - and(other: Observable): Pattern7; - then(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6) => TR): Plan; - } - interface Pattern7 { - and(other: Observable): Pattern8; - then(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6, item7: T7) => TR): Plan; - } - interface Pattern8 { - and(other: Observable): Pattern9; - then(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6, item7: T7, item8: T8) => TR): Plan; - } - interface Pattern9 { - then(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6, item7: T7, item8: T8, item9: T9) => TR): Plan; - } - - interface Plan { } - - interface Observable { - and(other: Observable): Pattern2; - then(selector: (item1: T) => TR): Plan; - } - - interface ObservableStatic { - when(plan: Plan): Observable; - } -} - -declare module "rx.joinpatterns" { - export = Rx; -} \ No newline at end of file diff --git a/rx/rx.lite.d.ts b/rx/rx.lite.d.ts deleted file mode 100644 index 046ef527d..000000000 --- a/rx/rx.lite.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -// Type definitions for RxJS-Lite v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: gsino , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// -/// -/// -/// -/// - -declare module Rx { - export class Scheduler implements IScheduler { - constructor( - now: () => number, - schedule: (state: any, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable, - scheduleRelative: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable, - scheduleAbsolute: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable); - - static normalize(timeSpan: number): number; - - static immediate: IScheduler; - static currentThread: ICurrentThreadScheduler; - static timeout: IScheduler; - - now(): number; - - schedule(action: () => void): IDisposable; - scheduleWithState(state: TState, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; - scheduleWithAbsolute(dueTime: number, action: () => void): IDisposable; - scheduleWithAbsoluteAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; - scheduleWithRelative(dueTime: number, action: () => void): IDisposable; - scheduleWithRelativeAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; - - scheduleRecursive(action: (action: () => void) => void): IDisposable; - scheduleRecursiveWithState(state: TState, action: (state: TState, action: (state: TState) => void) => void): IDisposable; - scheduleRecursiveWithAbsolute(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable; - scheduleRecursiveWithAbsoluteAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable; - scheduleRecursiveWithRelative(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable; - scheduleRecursiveWithRelativeAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable; - - schedulePeriodic(period: number, action: () => void): IDisposable; - schedulePeriodicWithState(state: TState, period: number, action: (state: TState) => TState): IDisposable; - } -} - -declare module "rx.lite" { - export = Rx; -} \ No newline at end of file diff --git a/rx/rx.testing.d.ts b/rx/rx.testing.d.ts deleted file mode 100644 index 0adc83e50..000000000 --- a/rx/rx.testing.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -// Type definitions for RxJS-Testing v2.2.28 -// Project: https://github.com/Reactive-Extensions/RxJS/ -// Definitions by: Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// - -declare module Rx { - export class TestScheduler extends VirtualTimeScheduler { - constructor(); - - createColdObservable(...records: Recorded[]): Observable; - createHotObservable(...records: Recorded[]): Observable; - createObserver(): MockObserver; - - startWithTiming(create: () => Observable, createdAt: number, subscribedAt: number, disposedAt: number): MockObserver; - startWithDispose(create: () => Observable, disposedAt: number): MockObserver; - startWithCreate(create: () => Observable): MockObserver; - } - - export class Recorded { - constructor(time: number, value: any, equalityComparer?: (x: any, y: any) => boolean); - equals(other: Recorded): boolean; - toString(): string; - time: number; - value: any; - } - - export var ReactiveTest: { - created: number; - subscribed: number; - disposed: number; - - onNext(ticks: number, value: any): Recorded; - onNext(ticks: number, predicate: (value: any) => boolean): Recorded; - onError(ticks: number, exception: any): Recorded; - onError(ticks: number, predicate: (exception: any) => boolean): Recorded; - onCompleted(ticks: number): Recorded; - - subscribe(subscribeAt: number, unsubscribeAt?: number): Subscription; - }; - - export class Subscription { - constructor(subscribeAt: number, unsubscribeAt?: number); - equals(other: Subscription): boolean; - } - - export interface MockObserver extends Observer { - messages: Recorded[]; - } - - interface MockObserverStatic extends ObserverStatic { - new (scheduler: IScheduler): MockObserver; - } - - export var MockObserver: MockObserverStatic; -} - -declare module "rx.testing" { - export = Rx; -} \ No newline at end of file diff --git a/rx/rx.time-lite.d.ts b/rx/rx.time-lite.d.ts deleted file mode 100644 index a5b102827..000000000 --- a/rx/rx.time-lite.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -// DefinitelyTyped: partial - -// This file contains common part of defintions for rx.time.d.ts and rx.lite.d.ts -// Do not include the file separately. - -/// - -declare module Rx { - export interface TimeInterval { - value: T; - interval: number; - } - - export interface Timestamp { - value: T; - timestamp: number; - } - - export interface Observable { - delay(dueTime: number, scheduler?: IScheduler): Observable; - throttle(dueTime: number, scheduler?: IScheduler): Observable; - timeInterval(scheduler?: IScheduler): Observable>; - timestamp(scheduler?: IScheduler): Observable>; - sample(interval: number, scheduler?: IScheduler): Observable; - sample(sampler: Observable, scheduler?: IScheduler): Observable; - timeout(dueTime: Date, other?: Observable, scheduler?: IScheduler): Observable; - timeout(dueTime: number, other?: Observable, scheduler?: IScheduler): Observable; - - delaySubscription(dueTime: number, scheduler?: IScheduler): Observable; - delayWithSelector(delayDurationSelector: (item: T) => number): Observable; - delayWithSelector(subscriptionDelay: number, delayDurationSelector: (item: T) => number): Observable; - - timeoutWithSelector(firstTimeout: Observable, timeoutdurationSelector?: (item: T) => Observable, other?: Observable): Observable; - throttleWithSelector(throttleDurationSelector: (item: T) => Observable): Observable; - - skipLastWithTime(duration: number, scheduler?: IScheduler): Observable; - takeLastWithTime(duration: number, timerScheduler?: IScheduler, loopScheduler?: IScheduler): Observable; - - takeLastBufferWithTime(duration: number, scheduler?: IScheduler): Observable; - takeWithTime(duration: number, scheduler?: IScheduler): Observable; - skipWithTime(duration: number, scheduler?: IScheduler): Observable; - - skipUntilWithTime(startTime: Date, scheduler?: IScheduler): Observable; - skipUntilWithTime(duration: number, scheduler?: IScheduler): Observable; - takeUntilWithTime(endTime: Date, scheduler?: IScheduler): Observable; - takeUntilWithTime(duration: number, scheduler?: IScheduler): Observable; - } - - interface ObservableStatic { - interval(period: number, scheduler?: IScheduler): Observable; - interval(dutTime: number, period: number, scheduler?: IScheduler): Observable; - timer(dueTime: number, period: number, scheduler: IScheduler): Observable; - timer(dueTime: number, scheduler: IScheduler): Observable; - generateWithRelativeTime( - initialState: TState, - condition: (state: TState) => boolean, - iterate: (state: TState) => TState, - resultSelector: (state: TState) => TResult, - timeSelector: (state: TState) => number, - scheduler?: IScheduler): Observable; - } -} diff --git a/rx/rx.time.d.ts b/rx/rx.time.d.ts deleted file mode 100644 index 6efd7d9cf..000000000 --- a/rx/rx.time.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Type definitions for RxJS-Time v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: Carl de Billy , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// - -declare module Rx { - export interface Observable { - windowWithTime(timeSpan: number, timeShift: number, scheduler?: IScheduler): Observable>; - windowWithTime(timeSpan: number, scheduler?: IScheduler): Observable>; - windowWithTimeOrCount(timeSpan: number, count: number, scheduler?: IScheduler): Observable>; - bufferWithTime(timeSpan: number, timeShift: number, scheduler?: IScheduler): Observable; - bufferWithTime(timeSpan: number, scheduler?: IScheduler): Observable; - bufferWithTimeOrCount(timeSpan: number, count: number, scheduler?: IScheduler): Observable; - } - - interface ObservableStatic { - timer(dueTime: Date, period: number, scheduler: IScheduler): Observable; - timer(dueTime: Date, scheduler: IScheduler): Observable; - - generateWithAbsoluteTime( - initialState: TState, - condition: (state: TState) => boolean, - iterate: (state: TState) => TState, - resultSelector: (state: TState) => TResult, - timeSelector: (state: TState) => Date, - scheduler?: IScheduler): Observable; - } -} - -declare module "rx.time" { - export = Rx; -} \ No newline at end of file diff --git a/rx/rx.virtualtime.d.ts b/rx/rx.virtualtime.d.ts deleted file mode 100644 index 50a1bb39b..000000000 --- a/rx/rx.virtualtime.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Type definitions for RxJS-VirtualTime v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: gsino , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module Rx { - // Virtual IScheduler - export /*abstract*/ class VirtualTimeScheduler extends Scheduler { - constructor(initialClock: TAbsolute, comparer: (first: TAbsolute, second: TAbsolute) => number); - - advanceBy(time: TRelative): void; - advanceTo(time: TAbsolute): void; - scheduleAbsolute(dueTime: TAbsolute, action: () => void): IDisposable; - scheduleAbsoluteWithState(state: TState, dueTime: TAbsolute, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; - scheduleRelative(dueTime: TRelative, action: () => void): IDisposable; - scheduleRelativeWithState(state: TState, dueTime: TRelative, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; - sleep(time: TRelative): void; - start(): IDisposable; - stop(): void; - - isEnabled: boolean; - - /* protected abstract */ add(from: TAbsolute, by: TRelative): TAbsolute; - /* protected abstract */ toDateTimeOffset(duetime: TAbsolute): number; - /* protected abstract */ toRelative(duetime: number): TRelative; - - /* protected */ getNext(): internals.ScheduledItem; - } - - export class HistoricalScheduler extends VirtualTimeScheduler { - constructor(initialClock: number, comparer: (first: number, second: number) => number); - } -} - -declare module "rx.virtualtime" { - export = Rx; -} \ No newline at end of file From 77615ebcf03c7da283edd182dc14704bc5f8385f Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 22 Jul 2014 10:03:38 -0700 Subject: [PATCH 011/537] Added few helpers functions. --- rx-lite.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rx-lite.d.ts b/rx-lite.d.ts index c7a148137..eea3c55ce 100644 --- a/rx-lite.d.ts +++ b/rx-lite.d.ts @@ -49,6 +49,8 @@ declare module Rx { export module helpers { function noop(): void; + function notDefined(value: any): boolean; + function isScheduler(value: any): boolean; function identity(value: T): T; function defaultNow(): number; function defaultComparer(left: any, right: any): boolean; From 68b8e0481ff91f731f75e4f48ac3d81226a1272a Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 22 Jul 2014 12:10:45 -0700 Subject: [PATCH 012/537] Added ObservableStatic.from definition. --- rx-lite.d.ts | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/rx-lite.d.ts b/rx-lite.d.ts index eea3c55ce..f33193af2 100644 --- a/rx-lite.d.ts +++ b/rx-lite.d.ts @@ -396,6 +396,50 @@ declare module Rx { defer(observableFactory: () => Observable): Observable; defer(observableFactory: () => IPromise): Observable; empty(scheduler?: IScheduler): Observable; + + /** + * This method creates a new Observable sequence from an array object. + * @param array An array-like or iterable object to convert to an Observable sequence. + * @param mapFn Map function to call on every element of the array. + * @param [thisArg] The context to use calling the mapFn if provided. + * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. + */ + from(array: T[], mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler); + /** + * This method creates a new Observable sequence from an array object. + * @param array An array-like or iterable object to convert to an Observable sequence. + * @param [mapFn] Map function to call on every element of the array. + * @param [thisArg] The context to use calling the mapFn if provided. + * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. + */ + from(array: T[], mapFn?: (value: T, index: number) => T, thisArg?: any, scheduler?: IScheduler); + + /** + * This method creates a new Observable sequence from an array-like object. + * @param array An array-like or iterable object to convert to an Observable sequence. + * @param mapFn Map function to call on every element of the array. + * @param [thisArg] The context to use calling the mapFn if provided. + * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. + */ + from(array: { length: number; [index: number]: T; }, mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler); + /** + * This method creates a new Observable sequence from an array-like object. + * @param array An array-like or iterable object to convert to an Observable sequence. + * @param [mapFn] Map function to call on every element of the array. + * @param [thisArg] The context to use calling the mapFn if provided. + * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. + */ + from(array: { length: number; [index: number]: T; }, mapFn?: (value: T, index: number) => T, thisArg?: any, scheduler?: IScheduler); + + /** + * This method creates a new Observable sequence from an array-like or iterable object. + * @param array An array-like or iterable object to convert to an Observable sequence. + * @param [mapFn] Map function to call on every element of the array. + * @param [thisArg] The context to use calling the mapFn if provided. + * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. + */ + from(iterable: any, mapFn?: (value: any, index: number) => T, thisArg?: any, scheduler?: IScheduler); + fromArray(array: T[], scheduler?: IScheduler): Observable; fromArray(array: { length: number;[index: number]: T; }, scheduler?: IScheduler): Observable; From 0f4537ae1cc2718cf670ef186dd71d17ab9e05b5 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 22 Jul 2014 12:50:51 -0700 Subject: [PATCH 013/537] Removed scheduler parameter from fromCallback and fromNodeCallback. --- rx.async-lite.d.ts | 56 +++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/rx.async-lite.d.ts b/rx.async-lite.d.ts index be13320c2..77dc23b57 100644 --- a/rx.async-lite.d.ts +++ b/rx.async-lite.d.ts @@ -16,46 +16,46 @@ declare module Rx { fromCallback: { // with single result callback without selector - (func: (callback: (result: TResult) => any) => any, scheduler?: IScheduler, context?: any): () => Observable; - (func: (arg1: T1, callback: (result: TResult) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: (result: TResult) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: (result: TResult) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; + (func: (callback: (result: TResult) => any) => any, context?: any): () => Observable; + (func: (arg1: T1, callback: (result: TResult) => any) => any, context?: any): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: (result: TResult) => any) => any, context?: any): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: (result: TResult) => any) => any, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; // with any callback with selector - (func: (callback: Function) => any, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): () => Observable; - (func: (arg1: T1, callback: Function) => any, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: Function) => any, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1, arg2: T2, arg3: T3) => Observable; + (func: (callback: Function) => any, context: any, selector: (args: TCallbackResult[]) => TResult): () => Observable; + (func: (arg1: T1, callback: Function) => any, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: Function) => any, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1, arg2: T2, arg3: T3) => Observable; // with any callback without selector - (func: (callback: Function) => any, scheduler?: IScheduler, context?: any): () => Observable; - (func: (arg1: T1, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; + (func: (callback: Function) => any, context?: any): () => Observable; + (func: (arg1: T1, callback: Function) => any, context?: any): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: Function) => any, context?: any): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; // with any function with selector - (func: Function, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): (...args: any[]) => Observable; + (func: Function, context: any, selector: (args: TCallbackResult[]) => TResult): (...args: any[]) => Observable; // with any function without selector - (func: Function, scheduler?: IScheduler, context?: any): (...args: any[]) => Observable; + (func: Function, context?: any): (...args: any[]) => Observable; }; fromNodeCallback: { // with single result callback without selector - (func: (callback: (err: any, result: T) => any) => any, scheduler?: IScheduler, context?: any): () => Observable; - (func: (arg1: T1, callback: (err: any, result: T) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: (err: any, result: T) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: T) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; + (func: (callback: (err: any, result: T) => any) => any, context?: any): () => Observable; + (func: (arg1: T1, callback: (err: any, result: T) => any) => any, context?: any): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: (err: any, result: T) => any) => any, context?: any): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: T) => any) => any, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; // with any callback with selector - (func: (callback: Function) => any, scheduler: IScheduler, context: any, selector: (results: TC[]) => TR): () => Observable; - (func: (arg1: T1, callback: Function) => any, scheduler: IScheduler, context: any, selector: (results: TC[]) => TR): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: Function) => any, scheduler: IScheduler, context: any, selector: (results: TC[]) => TR): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, scheduler: IScheduler, context: any, selector: (results: TC[]) => TR): (arg1: T1, arg2: T2, arg3: T3) => Observable; + (func: (callback: Function) => any, context: any, selector: (results: TC[]) => TR): () => Observable; + (func: (arg1: T1, callback: Function) => any, context: any, selector: (results: TC[]) => TR): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: Function) => any, context: any, selector: (results: TC[]) => TR): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, context: any, selector: (results: TC[]) => TR): (arg1: T1, arg2: T2, arg3: T3) => Observable; // with any callback without selector - (func: (callback: Function) => any, scheduler?: IScheduler, context?: any): () => Observable; - (func: (arg1: T1, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; + (func: (callback: Function) => any, context?: any): () => Observable; + (func: (arg1: T1, callback: Function) => any, context?: any): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: Function) => any, context?: any): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; // with any function with selector - (func: Function, scheduler: IScheduler, context: any, selector: (results: TC[]) => T): (...args: any[]) => Observable; + (func: Function, context: any, selector: (results: TC[]) => T): (...args: any[]) => Observable; // with any function without selector - (func: Function, scheduler?: IScheduler, context?: any): (...args: any[]) => Observable; + (func: Function, context?: any): (...args: any[]) => Observable; }; fromEvent(element: NodeList, eventName: string, selector?: (arguments: any[]) => T): Observable; From 4c9e9782a7618445da97362529608d38716cba60 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 22 Jul 2014 12:57:09 -0700 Subject: [PATCH 014/537] Exchanged parameters scheduler and context in ObservableStatic.start. --- rx.async.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rx.async.d.ts b/rx.async.d.ts index 9370c828b..fd85bcd7d 100644 --- a/rx.async.d.ts +++ b/rx.async.d.ts @@ -8,7 +8,7 @@ declare module Rx { interface ObservableStatic { - start(func: () => T, scheduler?: IScheduler, context?: any): Observable; + start(func: () => T, context?: any, scheduler?: IScheduler): Observable; toAsync(func: () => TResult, scheduler?: IScheduler, context?: any): () => Observable; toAsync(func: (arg1: T1) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; From 60a7a1e19bbe21efa50011c93cee170154e3faf9 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 22 Jul 2014 13:00:08 -0700 Subject: [PATCH 015/537] Exchanged parameters scheduler and context in ObservableStatic.toAsync. --- rx.async.d.ts | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/rx.async.d.ts b/rx.async.d.ts index fd85bcd7d..783f31d52 100644 --- a/rx.async.d.ts +++ b/rx.async.d.ts @@ -10,31 +10,31 @@ declare module Rx { interface ObservableStatic { start(func: () => T, context?: any, scheduler?: IScheduler): Observable; - toAsync(func: () => TResult, scheduler?: IScheduler, context?: any): () => Observable; - toAsync(func: (arg1: T1) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; - toAsync(func: (arg1?: T1) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1) => Observable; - toAsync(func: (...args: T1[]) => TResult, scheduler?: IScheduler, context?: any): (...args: T1[]) => Observable; - toAsync(func: (arg1: T1, arg2: T2) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; - toAsync(func: (arg1: T1, arg2?: T2) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2) => Observable; - toAsync(func: (arg1: T1, ...args: T2[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, ...args: T2[]) => Observable; - toAsync(func: (arg1?: T1, ...args: T2[]) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, ...args: T2[]) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3: T3) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3?: T3) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3?: T3) => Observable; - toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2, arg3?: T3) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, arg3?: T3) => Observable; - toAsync(func: (arg1: T1, arg2: T2, ...args: T3[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, ...args: T3[]) => Observable; - toAsync(func: (arg1: T1, arg2?: T2, ...args: T3[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2, ...args: T3[]) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2, ...args: T3[]) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, ...args: T3[]) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3: T3, arg4?: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3, arg4?: T4) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3?: T3, arg4?: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3?: T3, arg4?: T4) => Observable; - toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3, arg4?: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2, arg3?: T3, arg4?: T4) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3, arg4?: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, arg3?: T3, arg4?: T4) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3, ...args: T4[]) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3?: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3?: T3, ...args: T4[]) => Observable; - toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable; + toAsync(func: () => TResult, context?: any, scheduler?: IScheduler): () => Observable; + toAsync(func: (arg1: T1) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1) => Observable; + toAsync(func: (arg1?: T1) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1) => Observable; + toAsync(func: (...args: T1[]) => TResult, context?: any, scheduler?: IScheduler): (...args: T1[]) => Observable; + toAsync(func: (arg1: T1, arg2: T2) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2) => Observable; + toAsync(func: (arg1: T1, arg2?: T2) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2) => Observable; + toAsync(func: (arg1?: T1, arg2?: T2) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2) => Observable; + toAsync(func: (arg1: T1, ...args: T2[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, ...args: T2[]) => Observable; + toAsync(func: (arg1?: T1, ...args: T2[]) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, ...args: T2[]) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3: T3) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3: T3) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3?: T3) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3?: T3) => Observable; + toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2, arg3?: T3) => Observable; + toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2, arg3?: T3) => Observable; + toAsync(func: (arg1: T1, arg2: T2, ...args: T3[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, ...args: T3[]) => Observable; + toAsync(func: (arg1: T1, arg2?: T2, ...args: T3[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2, ...args: T3[]) => Observable; + toAsync(func: (arg1?: T1, arg2?: T2, ...args: T3[]) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2, ...args: T3[]) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3: T3, arg4?: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3: T3, arg4?: T4) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3?: T3, arg4?: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3?: T3, arg4?: T4) => Observable; + toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3, arg4?: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2, arg3?: T3, arg4?: T4) => Observable; + toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3, arg4?: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2, arg3?: T3, arg4?: T4) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3: T3, ...args: T4[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3: T3, ...args: T4[]) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3?: T3, ...args: T4[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3?: T3, ...args: T4[]) => Observable; + toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable; + toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable; } } From f3910a041c316523ef5e4fedb37f771c4f77a1dd Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 22 Jul 2014 13:19:13 -0700 Subject: [PATCH 016/537] Added return type annotation in ObservableStatic.from. --- rx-lite.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rx-lite.d.ts b/rx-lite.d.ts index f33193af2..4b5acb81d 100644 --- a/rx-lite.d.ts +++ b/rx-lite.d.ts @@ -404,7 +404,7 @@ declare module Rx { * @param [thisArg] The context to use calling the mapFn if provided. * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. */ - from(array: T[], mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler); + from(array: T[], mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler): Observable; /** * This method creates a new Observable sequence from an array object. * @param array An array-like or iterable object to convert to an Observable sequence. @@ -412,7 +412,7 @@ declare module Rx { * @param [thisArg] The context to use calling the mapFn if provided. * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. */ - from(array: T[], mapFn?: (value: T, index: number) => T, thisArg?: any, scheduler?: IScheduler); + from(array: T[], mapFn?: (value: T, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable; /** * This method creates a new Observable sequence from an array-like object. @@ -421,7 +421,7 @@ declare module Rx { * @param [thisArg] The context to use calling the mapFn if provided. * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. */ - from(array: { length: number; [index: number]: T; }, mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler); + from(array: { length: number;[index: number]: T; }, mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler): Observable; /** * This method creates a new Observable sequence from an array-like object. * @param array An array-like or iterable object to convert to an Observable sequence. @@ -429,7 +429,7 @@ declare module Rx { * @param [thisArg] The context to use calling the mapFn if provided. * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. */ - from(array: { length: number; [index: number]: T; }, mapFn?: (value: T, index: number) => T, thisArg?: any, scheduler?: IScheduler); + from(array: { length: number;[index: number]: T; }, mapFn?: (value: T, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable; /** * This method creates a new Observable sequence from an array-like or iterable object. @@ -438,7 +438,7 @@ declare module Rx { * @param [thisArg] The context to use calling the mapFn if provided. * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. */ - from(iterable: any, mapFn?: (value: any, index: number) => T, thisArg?: any, scheduler?: IScheduler); + from(iterable: any, mapFn?: (value: any, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable; fromArray(array: T[], scheduler?: IScheduler): Observable; fromArray(array: { length: number;[index: number]: T; }, scheduler?: IScheduler): Observable; From 8da4768d8f99c40d5c80fa818720f4fe7e5846ff Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 22 Jul 2014 14:41:11 -0700 Subject: [PATCH 017/537] Fixed rx.async-tests.ts. --- rx.async-tests.ts | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/rx.async-tests.ts b/rx.async-tests.ts index 9c3bce516..4f8c102c4 100644 --- a/rx.async-tests.ts +++ b/rx.async-tests.ts @@ -10,8 +10,8 @@ module Rx.Tests.Async { var sch: Rx.IScheduler; function start() { - obsNum = Rx.Observable.start(()=> 10, sch, obsStr); - obsNum = Rx.Observable.start(()=> 10, sch); + obsNum = Rx.Observable.start(()=> 10, obsStr, sch); + obsNum = Rx.Observable.start(() => 10, obsStr); obsNum = Rx.Observable.start(()=> 10); } @@ -27,38 +27,34 @@ module Rx.Tests.Async { // 0 arguments var func0: (cb: (result: number)=> void)=> void; obsNum = Rx.Observable.fromCallback(func0)(); - obsNum = Rx.Observable.fromCallback(func0, sch)(); - obsNum = Rx.Observable.fromCallback(func0, sch, obsStr)(); - obsNum = Rx.Observable.fromCallback(func0, sch, obsStr, (results: number[]) => results[0])(); + obsNum = Rx.Observable.fromCallback(func0, obsStr)(); + obsNum = Rx.Observable.fromCallback(func0, obsStr, (results: number[]) => results[0])(); // 1 argument var func1: (a: string, cb: (result: number)=> void)=> number; obsNum = Rx.Observable.fromCallback(func1)(""); - obsNum = Rx.Observable.fromCallback(func1, sch)(""); - obsNum = Rx.Observable.fromCallback(func1, sch, {})(""); - obsNum = Rx.Observable.fromCallback(func1, sch, {}, (results: number[]) => results[0])(""); + obsNum = Rx.Observable.fromCallback(func1, {})(""); + obsNum = Rx.Observable.fromCallback(func1, {}, (results: number[]) => results[0])(""); // 2 arguments var func2: (a: number, b: string, cb: (result: string) => number) => Date; obsStr = Rx.Observable.fromCallback(func2)(1, ""); - obsStr = Rx.Observable.fromCallback(func2, sch)(1, ""); - obsStr = Rx.Observable.fromCallback(func2, sch, {})(1, ""); - obsStr = Rx.Observable.fromCallback(func2, sch, {}, (results: string[]) => results[0])(1, ""); + obsStr = Rx.Observable.fromCallback(func2, {})(1, ""); + obsStr = Rx.Observable.fromCallback(func2, {}, (results: string[]) => results[0])(1, ""); // 3 arguments var func3: (a: number, b: string, c: boolean, cb: (result: string) => number) => Date; obsStr = Rx.Observable.fromCallback(func3)(1, "", true); - obsStr = Rx.Observable.fromCallback(func3, sch)(1, "", true); - obsStr = Rx.Observable.fromCallback(func3, sch, {})(1, "", true); - obsStr = Rx.Observable.fromCallback(func3, sch, {}, (results: string[]) => results[0])(1, "", true); + obsStr = Rx.Observable.fromCallback(func3, {})(1, "", true); + obsStr = Rx.Observable.fromCallback(func3, {}, (results: string[]) => results[0])(1, "", true); // multiple results var func0m: (cb: (result1: number, result2: number, result3: number) => void) => void; - obsNum = Rx.Observable.fromCallback(func0m, sch, obsStr, (results: number[]) => results[0])(); + obsNum = Rx.Observable.fromCallback(func0m, obsStr, (results: number[]) => results[0])(); var func1m: (a: string, cb: (result1: number, result2: number, result3: number) => void) => void; - obsNum = Rx.Observable.fromCallback(func1m, sch, obsStr, (results: number[]) => results[0])(""); + obsNum = Rx.Observable.fromCallback(func1m, obsStr, (results: number[]) => results[0])(""); var func2m: (a: string, b: number, cb: (result1: string, result2: string, result3: string) => void) => void; - obsStr = Rx.Observable.fromCallback(func2m, sch, obsStr, (results: string[]) => results[0])("", 10); + obsStr = Rx.Observable.fromCallback(func2m, obsStr, (results: string[]) => results[0])("", 10); } function toPromise() { From 1a61ce3145b040904fc9eeaf4889cde480b57b1b Mon Sep 17 00:00:00 2001 From: Gil Amran Date: Wed, 23 Jul 2014 17:26:15 +0300 Subject: [PATCH 018/537] Removed webgl.d.ts (Included in lib.d.ts) Added missing x and y properties Added missing semicolon --- pixi/pixi.d.ts | 735 ++++++++++++++++++++++++------------------------ pixi/webgl.d.ts | 227 --------------- 2 files changed, 368 insertions(+), 594 deletions(-) delete mode 100644 pixi/webgl.d.ts diff --git a/pixi/pixi.d.ts b/pixi/pixi.d.ts index d5daba948..c86c1bd47 100644 --- a/pixi/pixi.d.ts +++ b/pixi/pixi.d.ts @@ -3,435 +3,436 @@ // Definitions by: xperiments // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// declare module PIXI { - /* STATICS */ - export var gl:WebGLRenderingContext; - export var BaseTextureCache: {}; - export var texturesToUpdate: BaseTexture[]; - export var texturesToDestroy: BaseTexture[]; - export var TextureCache: {}; - export var FrameCache: {}; - export var blendModes:{ NORMAL:number; SCREEN:number; }; + /* STATICS */ + export var gl:WebGLRenderingContext; + export var BaseTextureCache: {}; + export var texturesToUpdate: BaseTexture[]; + export var texturesToDestroy: BaseTexture[]; + export var TextureCache: {}; + export var FrameCache: {}; + export var blendModes:{ NORMAL:number; SCREEN:number; }; - /* MODULE FUNCTIONS */ - export function autoDetectRenderer(width: number, height: number, view?: HTMLCanvasElement, transparent?: boolean, antialias?: boolean): IPixiRenderer; - export function FilterBlock( mask:Graphics ):void; - export function MaskFilter( graphics:Graphics ):void; + /* MODULE FUNCTIONS */ + export function autoDetectRenderer(width: number, height: number, view?: HTMLCanvasElement, transparent?: boolean, antialias?: boolean): IPixiRenderer; + export function FilterBlock( mask:Graphics ):void; + export function MaskFilter( graphics:Graphics ):void; - /* DEBUG METHODS */ + /* DEBUG METHODS */ - export function runList( x ):void; + export function runList( x ):void; - /*INTERFACES*/ + /*INTERFACES*/ - export interface IBasicCallback - { - ():void - } + export interface IBasicCallback + { + ():void + } - export interface IEvent - { - type: string; - content: any; - } + export interface IEvent + { + type: string; + content: any; + } - export interface IHitArea - { - contains(x: number, y: number):boolean; - } + export interface IHitArea + { + contains(x: number, y: number):boolean; + } - export interface IInteractionDataCallback - { - (interactionData: InteractionData):void - } + export interface IInteractionDataCallback + { + (interactionData: InteractionData):void + } - export interface IPixiRenderer - { - view: HTMLCanvasElement; - render(stage: Stage): void; - } + export interface IPixiRenderer + { + view: HTMLCanvasElement; + render(stage: Stage): void; + } - export interface IBitmapTextStyle - { - font?: string; - align?: string; - } + export interface IBitmapTextStyle + { + font?: string; + align?: string; + } - export interface ITextStyle - { - font?: string; - stroke?: string; - fill?: string; - align?: string; - strokeThickness?: number; - wordWrap?: boolean; - wordWrapWidth?:number; - } + export interface ITextStyle + { + font?: string; + stroke?: string; + fill?: string; + align?: string; + strokeThickness?: number; + wordWrap?: boolean; + wordWrapWidth?:number; + } - /* CLASES */ + /* CLASES */ - export class AssetLoader extends EventTarget - { - assetURLs: string[]; - onComplete: IBasicCallback; - onProgress: IBasicCallback; - constructor(assetURLs: string[], crossorigin?:boolean ); - load(): void; - } + export class AssetLoader extends EventTarget + { + assetURLs: string[]; + onComplete: IBasicCallback; + onProgress: IBasicCallback; + constructor(assetURLs: string[], crossorigin?:boolean ); + load(): void; + } - export class BaseTexture extends EventTarget - { - height: number; - width: number; - source: string; + export class BaseTexture extends EventTarget + { + height: number; + width: number; + source: string; - constructor(source: HTMLImageElement); - constructor(source: HTMLCanvasElement); - destroy():void; + constructor(source: HTMLImageElement); + constructor(source: HTMLCanvasElement); + destroy():void; - static fromImage(imageUrl: string, crossorigin?:boolean ): BaseTexture; - } + static fromImage(imageUrl: string, crossorigin?:boolean ): BaseTexture; + } - export class BitmapFontLoader extends EventTarget - { - baseUrl:string; - crossorigin:boolean; - texture:Texture; - url:string; - constructor(url: string, crossorigin?: boolean); - load():void; - } + export class BitmapFontLoader extends EventTarget + { + baseUrl:string; + crossorigin:boolean; + texture:Texture; + url:string; + constructor(url: string, crossorigin?: boolean); + load():void; + } - export class BitmapText extends DisplayObjectContainer - { - width:number; - height:number; - constructor(text: string, style: IBitmapTextStyle); - setStyle(style: IBitmapTextStyle): void; - setText(text: string): void; - } + export class BitmapText extends DisplayObjectContainer + { + width:number; + height:number; + constructor(text: string, style: IBitmapTextStyle); + setStyle(style: IBitmapTextStyle): void; + setText(text: string): void; + } - export class CanvasRenderer implements IPixiRenderer - { - context: CanvasRenderingContext2D; - height: number; - view: HTMLCanvasElement; - width: number; - constructor(width: number, height: number, view?: HTMLCanvasElement, transparent?: boolean); - render(stage: Stage): void; - resize(width: number, height: number):void; - } + export class CanvasRenderer implements IPixiRenderer + { + context: CanvasRenderingContext2D; + height: number; + view: HTMLCanvasElement; + width: number; + constructor(width: number, height: number, view?: HTMLCanvasElement, transparent?: boolean); + render(stage: Stage): void; + resize(width: number, height: number):void; + } - export class Circle implements IHitArea - { - x: number; - y: number; - radius: number; - constructor(x: number, y: number, radius: number); - clone(): Circle; - contains(x: number, y: number):boolean; - } + export class Circle implements IHitArea + { + x: number; + y: number; + radius: number; + constructor(x: number, y: number, radius: number); + clone(): Circle; + contains(x: number, y: number):boolean; + } - // TODO what is renderGroup - export class CustomRenderable extends DisplayObject - { - constructor(); - renderCanvas(renderer: CanvasRenderer): void; - initWebGL(renderer: WebGLRenderer): void; - renderWebGL(renderGroup: any, projectionMatrix: any): void; - } + // TODO what is renderGroup + export class CustomRenderable extends DisplayObject + { + constructor(); + renderCanvas(renderer: CanvasRenderer): void; + initWebGL(renderer: WebGLRenderer): void; + renderWebGL(renderGroup: any, projectionMatrix: any): void; + } - export class DisplayObject - { - alpha: number; - buttonMode: boolean; - filter:boolean; - hitArea: IHitArea; - parent: DisplayObjectContainer; - pivot: Point; - position: Point; - rotation: number; - renderable: boolean; - scale: Point; - stage: Stage; - visible: boolean; - worldAlpha: number; - constructor(); - static autoDetectRenderer(width: number, height: number, view?: HTMLCanvasElement, transparent?: boolean): IPixiRenderer; - click: IInteractionDataCallback; - mousedown: IInteractionDataCallback; - mouseout: IInteractionDataCallback; - mouseover: IInteractionDataCallback; - mouseup: IInteractionDataCallback; - mouseupoutside: IInteractionDataCallback; - mousemove: IInteractionDataCallback; - tap: IInteractionDataCallback; - touchend: IInteractionDataCallback; - touchendoutside: IInteractionDataCallback; - touchstart: IInteractionDataCallback; - touchmove: IInteractionDataCallback; + export class DisplayObject + { + x: number; + y: number; + alpha: number; + buttonMode: boolean; + filter:boolean; + hitArea: IHitArea; + parent: DisplayObjectContainer; + pivot: Point; + position: Point; + rotation: number; + renderable: boolean; + scale: Point; + stage: Stage; + visible: boolean; + worldAlpha: number; + constructor(); + static autoDetectRenderer(width: number, height: number, view?: HTMLCanvasElement, transparent?: boolean): IPixiRenderer; + click: IInteractionDataCallback; + mousedown: IInteractionDataCallback; + mouseout: IInteractionDataCallback; + mouseover: IInteractionDataCallback; + mouseup: IInteractionDataCallback; + mouseupoutside: IInteractionDataCallback; + mousemove: IInteractionDataCallback; + tap: IInteractionDataCallback; + touchend: IInteractionDataCallback; + touchendoutside: IInteractionDataCallback; + touchstart: IInteractionDataCallback; + touchmove: IInteractionDataCallback; - //deprecated - setInteractive(interactive: boolean): void; + //deprecated + setInteractive(interactive: boolean): void; - // getters setters - interactive:boolean; - mask:Graphics; - } + // getters setters + interactive:boolean; + mask:Graphics; + } - export class DisplayObjectContainer extends DisplayObject - { - children: DisplayObject[]; - constructor(); + export class DisplayObjectContainer extends DisplayObject + { + children: DisplayObject[]; + constructor(); - addChild(child: DisplayObject): void; - addChildAt(child: DisplayObject, index: number): void; - getChildAt(index:number):DisplayObject; - removeChild(child: DisplayObject): void; - swapChildren(child: DisplayObject, child2: DisplayObject): void; - } + addChild(child: DisplayObject): void; + addChildAt(child: DisplayObject, index: number): void; + getChildAt(index:number):DisplayObject; + removeChild(child: DisplayObject): void; + swapChildren(child: DisplayObject, child2: DisplayObject): void; + } - export class Ellipse implements IHitArea - { - x: number; - y: number; - width: number; - height: number; + export class Ellipse implements IHitArea + { + x: number; + y: number; + width: number; + height: number; - constructor(x: number, y: number, width: number, height: number); - clone(): Ellipse; - contains(x: number, y: number):boolean; - getBounds():Rectangle; - } + constructor(x: number, y: number, width: number, height: number); + clone(): Ellipse; + contains(x: number, y: number):boolean; + getBounds():Rectangle; + } - export class EventTarget - { - addEventListener(type: string, listener: (event: IEvent) => void ); - removeEventListener(type: string, listener: (event: IEvent) => void ); - dispatchEvent(event: IEvent); - } + export class EventTarget + { + addEventListener(type: string, listener: (event: IEvent) => void ); + removeEventListener(type: string, listener: (event: IEvent) => void ); + dispatchEvent(event: IEvent); + } - export class Graphics extends DisplayObjectContainer - { - lineWidth:number; - lineColor:string; - constructor(); + export class Graphics extends DisplayObjectContainer + { + lineWidth:number; + lineColor:string; + constructor(); - beginFill(color?: number, alpha?: number): void; - clear(): void; - drawCircle(x: number, y: number, radius: number): void; - drawElipse(x: number, y: number, width: number, height: number): void; - drawRect(x: number, y: number, width: number, height: number): void; - endFill(): void; - lineStyle(lineWidth?: number, color?: number, alpha?: number ): void; - lineTo(x: number, y: number): void; - moveTo(x: number, y: number): void; + beginFill(color?: number, alpha?: number): void; + clear(): void; + drawCircle(x: number, y: number, radius: number): void; + drawElipse(x: number, y: number, width: number, height: number): void; + drawRect(x: number, y: number, width: number, height: number): void; + endFill(): void; + lineStyle(lineWidth?: number, color?: number, alpha?: number ): void; + lineTo(x: number, y: number): void; + moveTo(x: number, y: number): void; - static POLY:number; - static RECT:number; - static CIRC:number; - static ELIP:number; - } + static POLY:number; + static RECT:number; + static CIRC:number; + static ELIP:number; + } - export class ImageLoader extends EventTarget - { - texture:Texture; - constructor(url: string, crossorigin?: boolean); - load(): void; - } + export class ImageLoader extends EventTarget + { + texture:Texture; + constructor(url: string, crossorigin?: boolean); + load(): void; + } - /* TODO determine type of originalEvent*/ - export class InteractionData - { - global: Point; - target: Sprite; - constructor(); - originalEvent:any; - getLocalPosition(displayObject: DisplayObject): Point; - } + /* TODO determine type of originalEvent*/ + export class InteractionData + { + global: Point; + target: Sprite; + constructor(); + originalEvent:any; + getLocalPosition(displayObject: DisplayObject): Point; + } - export class InteractionManager - { - mouse: InteractionData; - stage: Stage; - touchs:{ [id:string]:InteractionData }; - constructor(stage: Stage); - } + export class InteractionManager + { + mouse: InteractionData; + stage: Stage; + touchs:{ [id:string]:InteractionData }; + constructor(stage: Stage); + } - export class JsonLoader extends EventTarget - { - url:string; - crossorigin: boolean; - baseUrl:string; - loaded:boolean; - constructor(url: string, crossorigin?: boolean); - load(): void; - } + export class JsonLoader extends EventTarget + { + url:string; + crossorigin: boolean; + baseUrl:string; + loaded:boolean; + constructor(url: string, crossorigin?: boolean); + load(): void; + } - export class MovieClip extends Sprite - { - animationSpeed: number; - currentFrame:number; - loop: boolean; - playing: boolean; - textures: Texture[]; - constructor(textures: Texture[]); - onComplete:IBasicCallback; - gotoAndPlay(frameNumber: number): void; - gotoAndStop(frameNumber: number): void; - play(): void; - stop(): void; - } + export class MovieClip extends Sprite + { + animationSpeed: number; + currentFrame:number; + loop: boolean; + playing: boolean; + textures: Texture[]; + constructor(textures: Texture[]); + onComplete:IBasicCallback; + gotoAndPlay(frameNumber: number): void; + gotoAndStop(frameNumber: number): void; + play(): void; + stop(): void; + } - export class Point - { - x: number; - y: number; - constructor(x: number, y: number); - clone(): Point; - } + export class Point + { + x: number; + y: number; + constructor(x: number, y: number); + clone(): Point; + } - export class Polygon implements IHitArea - { - points: Point[]; + export class Polygon implements IHitArea + { + points: Point[]; - constructor(points: Point[]); - constructor(points: number[]); - constructor(...points: Point[]); - constructor(...points: number[]); + constructor(points: Point[]); + constructor(points: number[]); + constructor(...points: Point[]); + constructor(...points: number[]); - clone(): Polygon; - contains( x:number, y:number ):boolean; - } + clone(): Polygon; + contains( x:number, y:number ):boolean; + } - export class Rectangle implements IHitArea - { - x: number; - y: number; - width: number; - height: number; - constructor(x: number, y: number, width: number, height: number); - clone(): Rectangle; - contains(x: number, y: number):boolean - } + export class Rectangle implements IHitArea + { + x: number; + y: number; + width: number; + height: number; + constructor(x: number, y: number, width: number, height: number); + clone(): Rectangle; + contains(x: number, y: number):boolean; + } - export class RenderTexture extends Texture - { - constructor(width: number, height: number); - resize(width: number, height: number): void; - } + export class RenderTexture extends Texture + { + constructor(width: number, height: number); + resize(width: number, height: number): void; + } - export class Sprite extends DisplayObjectContainer - { - anchor: Point; - blendMode: number; - texture: Texture; + export class Sprite extends DisplayObjectContainer + { + anchor: Point; + blendMode: number; + texture: Texture; - //getters setters - height: number; - width: number; + //getters setters + height: number; + width: number; - constructor(texture: Texture); + constructor(texture: Texture); - static fromFrame(frameId: string): Sprite; - static fromImage(url: string): Sprite; - setTexture(texture: Texture): void; - } + static fromFrame(frameId: string): Sprite; + static fromImage(url: string): Sprite; + setTexture(texture: Texture): void; + } - /* TODO determine type of frames */ - export class SpriteSheetLoader extends EventTarget - { - url:string; - crossorigin:boolean; - baseUrl:string; - texture:Texture; - frames:Object; - constructor(url: string, crossorigin?: boolean); - load(); - } + /* TODO determine type of frames */ + export class SpriteSheetLoader extends EventTarget + { + url:string; + crossorigin:boolean; + baseUrl:string; + texture:Texture; + frames:Object; + constructor(url: string, crossorigin?: boolean); + load(); + } - export class Stage extends DisplayObjectContainer - { - interactive:boolean; - interactionManager:InteractionManager; - constructor(backgroundColor: number, interactive?: boolean); - getMousePosition(): Point; - setBackgroundColor(backgroundColor: number): void; - } + export class Stage extends DisplayObjectContainer + { + interactive:boolean; + interactionManager:InteractionManager; + constructor(backgroundColor: number, interactive?: boolean); + getMousePosition(): Point; + setBackgroundColor(backgroundColor: number): void; + } - export class Text extends Sprite - { - constructor(text: string, style: ITextStyle); - destroy(destroyTexture:boolean):void; - setText(text: string): void; - setStyle(style: ITextStyle): void; - } + export class Text extends Sprite + { + constructor(text: string, style: ITextStyle); + destroy(destroyTexture:boolean):void; + setText(text: string): void; + setStyle(style: ITextStyle): void; + } - export class Texture extends EventTarget - { - baseTexture: BaseTexture; - frame: Rectangle; - trim:Point; - render( displayObject:DisplayObject, position:Point, clear:boolean ):void; - constructor(baseTexture: BaseTexture, frame?: Rectangle); - destroy(destroyBase:boolean):void; - setFrame(frame: Rectangle): void; + export class Texture extends EventTarget + { + baseTexture: BaseTexture; + frame: Rectangle; + trim:Point; + render( displayObject:DisplayObject, position:Point, clear:boolean ):void; + constructor(baseTexture: BaseTexture, frame?: Rectangle); + destroy(destroyBase:boolean):void; + setFrame(frame: Rectangle): void; - static addTextureToCache(texture: Texture, id: string): void; - static fromCanvas(canvas: HTMLCanvasElement): Texture; - static fromFrame(frameId: string): Texture; - static fromImage(imageUrl: string, crossorigin?: boolean): Texture; - static removeTextureFromCache(id: any): Texture; - } + static addTextureToCache(texture: Texture, id: string): void; + static fromCanvas(canvas: HTMLCanvasElement): Texture; + static fromFrame(frameId: string): Texture; + static fromImage(imageUrl: string, crossorigin?: boolean): Texture; + static removeTextureFromCache(id: any): Texture; + } - export class TilingSprite extends DisplayObjectContainer - { - width:number; - height:number; - texture:Texture; - tilePosition: Point; - tileScale: Point; - constructor(texture: Texture, width: number, height: number); - setTexture( texture: Texture ):void; - } + export class TilingSprite extends DisplayObjectContainer + { + width:number; + height:number; + texture:Texture; + tilePosition: Point; + tileScale: Point; + constructor(texture: Texture, width: number, height: number); + setTexture( texture: Texture ):void; + } - export class WebGLBatch - { - constructor(webGLContext: WebGLRenderingContext); - clean():void; - restoreLostContext(gl:WebGLRenderingContext) - init(sprite: Sprite): void; - insertAfter(sprite: Sprite, previousSprite: Sprite): void; - insertBefore(sprite: Sprite, nextSprite: Sprite): void; - growBatch(): void; - merge(batch: WebGLBatch): void; - refresh(): void; - remove(sprite: Sprite): void; - render(): void; - split(sprite: Sprite): WebGLBatch; - update(): void; - } + export class WebGLBatch + { + constructor(webGLContext: WebGLRenderingContext); + clean():void; + restoreLostContext(gl:WebGLRenderingContext); + init(sprite: Sprite): void; + insertAfter(sprite: Sprite, previousSprite: Sprite): void; + insertBefore(sprite: Sprite, nextSprite: Sprite): void; + growBatch(): void; + merge(batch: WebGLBatch): void; + refresh(): void; + remove(sprite: Sprite): void; + render(): void; + split(sprite: Sprite): WebGLBatch; + update(): void; + } - /* Determine type of Object */ - export class WebGLRenderGroup - { - render(projection:Object):void; - } + /* Determine type of Object */ + export class WebGLRenderGroup + { + render(projection:Object):void; + } - export class WebGLRenderer implements IPixiRenderer - { - view: HTMLCanvasElement; - constructor(width: number, height: number, view?: HTMLCanvasElement, transparent?: boolean, antialias?:boolean ); - render(stage: Stage): void; - resize(width: number, height: number): void; - } + export class WebGLRenderer implements IPixiRenderer + { + view: HTMLCanvasElement; + constructor(width: number, height: number, view?: HTMLCanvasElement, transparent?: boolean, antialias?:boolean ); + render(stage: Stage): void; + resize(width: number, height: number): void; + } } @@ -440,7 +441,7 @@ declare function requestAnimFrame( animate: PIXI.IBasicCallback ); declare module PIXI.PolyK { - export function Triangulate( p:number[]):number[]; + export function Triangulate( p:number[]):number[]; } diff --git a/pixi/webgl.d.ts b/pixi/webgl.d.ts deleted file mode 100644 index ebf1204dc..000000000 --- a/pixi/webgl.d.ts +++ /dev/null @@ -1,227 +0,0 @@ -// Type definitions for WebGL -// Project: https://www.khronos.org/webgl/ -// Definitions by: xperiments -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -interface WebGLObject { - $__dummyprop__WebGLObject : any; -} - -interface WebGLBuffer extends WebGLObject { - $__dummyprop__WebGLBuffer : any; -} - -interface WebGLFramebuffer extends WebGLObject { - $__dummyprop__WebGLFramebuffer : any; -} - -interface WebGLProgram extends WebGLObject { - $__dummyprop__WebGLProgram : any; -} - -interface WebGLRenderbuffer extends WebGLObject { - $__dummyprop__WebGLRenderbuffer : any; -} - -interface WebGLShader extends WebGLObject { - $__dummyprop__WebGLShader : any; -} - -interface WebGLTexture extends WebGLObject { - $__dummyprop__WebGLTexture : any; -} - -interface WebGLUniformLocation { - $__dummyprop__WebGLUniformLocation : any; -} - -interface WebGLRenderingContext { - NUM_COMPRESSED_TEXTURE_FORMATS : number; - ACTIVE_UNIFORM_MAX_LENGTH : number; - INFO_LOG_LENGTH : number; - SHADER_SOURCE_LENGTH : number; - getContextAttributes() : WebGLContextAttributes; - isContextLost() : boolean; - getSupportedExtensions() : string[]; - getExtension(name : string) : any; - activeTexture(texture : number) : void; - attachShader(program : WebGLProgram, shader : WebGLShader) : void; - bindAttribLocation(program : WebGLProgram, index : number, name : string) : void; - bindBuffer(target : number, buffer : WebGLBuffer) : void; - bindFramebuffer(target : number, framebuffer : WebGLFramebuffer) : void; - bindRenderbuffer(target : number, renderbuffer : WebGLRenderbuffer) : void; - bindTexture(target : number, texture : WebGLTexture) : void; - blendColor(red : number, green : number, blue : number, alpha : number) : void; - blendEquation(mode : number) : void; - blendEquationSeparate(modeRGB : number, modeAlpha : number) : void; - blendFunc(sfactor : number, dfactor : number) : void; - blendFuncSeparate(srcRGB : number, dstRGB : number, srcAlpha : number, dstAlpha : number) : void; - bufferData(target : number, size : number, usage : number) : void; - bufferData(target : number, data : ArrayBufferView, usage : number) : void; - bufferData(target : number, data : ArrayBuffer, usage : number) : void; - bufferSubData(target : number, offset : number, data : ArrayBufferView) : void; - bufferSubData(target : number, offset : number, data : ArrayBuffer) : void; - checkFramebufferStatus(target : number) : number; - clear(mask : number) : void; - clearColor(red : number, green : number, blue : number, alpha : number) : void; - clearDepth(depth : number) : void; - clearStencil(s : number) : void; - colorMask(red : boolean, green : boolean, blue : boolean, alpha : boolean) : void; - compileShader(shader : WebGLShader) : void; - copyTexImage2D(target : number, level : number, internalformat : number, x : number, y : number, width : number, height : number, border : number) : void; - copyTexSubImage2D(target : number, level : number, xoffset : number, yoffset : number, x : number, y : number, width : number, height : number) : void; - createBuffer() : WebGLBuffer; - createFramebuffer() : WebGLFramebuffer; - createProgram() : WebGLProgram; - createRenderbuffer() : WebGLRenderbuffer; - createShader(type : number) : WebGLShader; - createTexture() : WebGLTexture; - cullFace(mode : number) : void; - deleteBuffer(buffer : WebGLBuffer) : void; - deleteFramebuffer(framebuffer : WebGLFramebuffer) : void; - deleteProgram(program : WebGLProgram) : void; - deleteRenderbuffer(renderbuffer : WebGLRenderbuffer) : void; - deleteShader(shader : WebGLShader) : void; - deleteTexture(texture : WebGLTexture) : void; - depthFunc(func : number) : void; - depthMask(flag : boolean) : void; - depthRange(zNear : number, zFar : number) : void; - detachShader(program : WebGLProgram, shader : WebGLShader) : void; - disable(cap : number) : void; - disableVertexAttribArray(index : number) : void; - drawArrays(mode : number, first : number, count : number) : void; - drawElements(mode : number, count : number, type : number, offset : number) : void; - enable(cap : number) : void; - enableVertexAttribArray(index : number) : void; - finish() : void; - flush() : void; - framebufferRenderbuffer(target : number, attachment : number, renderbuffertarget : number, renderbuffer : WebGLRenderbuffer) : void; - framebufferTexture2D(target : number, attachment : number, textarget : number, texture : WebGLTexture, level : number) : void; - frontFace(mode : number) : void; - generateMipmap(target : number) : void; - getActiveAttrib(program : WebGLProgram, index : number) : WebGLActiveInfo; - getActiveUniform(program : WebGLProgram, index : number) : WebGLActiveInfo; - getAttachedShaders(program : WebGLProgram) : WebGLShader[]; - getAttribLocation(program : WebGLProgram, name : string) : number; - getParameter(pname : number) : any; - getBufferParameter(target : number, pname : number) : any; - getError() : number; - getFramebufferAttachmentParameter(target : number, attachment : number, pname : number) : any; - getProgramParameter(program : WebGLProgram, pname : number) : any; - getProgramInfoLog(program : WebGLProgram) : string; - getRenderbufferParameter(target : number, pname : number) : any; - getShaderParameter(shader : WebGLShader, pname : number) : any; - getShaderInfoLog(shader : WebGLShader) : string; - getShaderSource(shader : WebGLShader) : string; - getTexParameter(target : number, pname : number) : any; - getUniform(program : WebGLProgram, location : WebGLUniformLocation) : any; - getUniformLocation(program : WebGLProgram, name : string) : WebGLUniformLocation; - getVertexAttrib(index : number, pname : number) : any; - getVertexAttribOffset(index : number, pname : number) : number; - hint(target : number, mode : number) : void; - isBuffer(buffer : WebGLBuffer) : boolean; - isEnabled(cap : number) : boolean; - isFramebuffer(framebuffer : WebGLFramebuffer) : boolean; - isProgram(program : WebGLProgram) : boolean; - isRenderbuffer(renderbuffer : WebGLRenderbuffer) : boolean; - isShader(shader : WebGLShader) : boolean; - isTexture(texture : WebGLTexture) : boolean; - lineWidth(width : number) : void; - linkProgram(program : WebGLProgram) : void; - pixelStorei(pname : number, param : number) : void; - polygonOffset(factor : number, units : number) : void; - readPixels(x : number, y : number, width : number, height : number, format : number, type : number, pixels : ArrayBufferView) : void; - renderbufferStorage(target : number, internalformat : number, width : number, height : number) : void; - sampleCoverage(value : number, invert : boolean) : void; - scissor(x : number, y : number, width : number, height : number) : void; - shaderSource(shader : WebGLShader, source : string) : void; - stencilFunc(func : number, ref : number, mask : number) : void; - stencilFuncSeparate(face : number, func : number, ref : number, mask : number) : void; - stencilMask(mask : number) : void; - stencilMaskSeparate(face : number, mask : number) : void; - stencilOp(fail : number, zfail : number, zpass : number) : void; - stencilOpSeparate(face : number, fail : number, zfail : number, zpass : number) : void; - texImage2D(target : number, level : number, internalformat : number, width : number, height : number, border : number, format : number, type : number, pixels : ArrayBufferView) : void; - texImage2D(target : number, level : number, internalformat : number, format : number, type : number, pixels : ImageData) : void; - texImage2D(target : number, level : number, internalformat : number, format : number, type : number, image : HTMLImageElement) : void; - texImage2D(target : number, level : number, internalformat : number, format : number, type : number, canvas : HTMLCanvasElement) : void; - texImage2D(target : number, level : number, internalformat : number, format : number, type : number, video : HTMLVideoElement) : void; - texParameterf(target : number, pname : number, param : number) : void; - texParameteri(target : number, pname : number, param : number) : void; - texSubImage2D(target : number, level : number, xoffset : number, yoffset : number, width : number, height : number, format : number, type : number, pixels : ArrayBufferView) : void; - texSubImage2D(target : number, level : number, xoffset : number, yoffset : number, format : number, type : number, pixels : ImageData) : void; - texSubImage2D(target : number, level : number, xoffset : number, yoffset : number, format : number, type : number, image : HTMLImageElement) : void; - texSubImage2D(target : number, level : number, xoffset : number, yoffset : number, format : number, type : number, canvas : HTMLCanvasElement) : void; - texSubImage2D(target : number, level : number, xoffset : number, yoffset : number, format : number, type : number, video : HTMLVideoElement) : void; - uniform1f(location : WebGLUniformLocation, x : number) : void; - uniform1fv(location : WebGLUniformLocation, v : Float32Array) : void; - uniform1fv(location : WebGLUniformLocation, v : number[]) : void; - uniform1i(location : WebGLUniformLocation, x : number) : void; - uniform1iv(location : WebGLUniformLocation, v : Int32Array) : void; - uniform1iv(location : WebGLUniformLocation, v : number[]) : void; - uniform2f(location : WebGLUniformLocation, x : number, y : number) : void; - uniform2fv(location : WebGLUniformLocation, v : Float32Array) : void; - uniform2fv(location : WebGLUniformLocation, v : number[]) : void; - uniform2i(location : WebGLUniformLocation, x : number, y : number) : void; - uniform2iv(location : WebGLUniformLocation, v : Int32Array) : void; - uniform2iv(location : WebGLUniformLocation, v : number[]) : void; - uniform3f(location : WebGLUniformLocation, x : number, y : number, z : number) : void; - uniform3fv(location : WebGLUniformLocation, v : Float32Array) : void; - uniform3fv(location : WebGLUniformLocation, v : number[]) : void; - uniform3i(location : WebGLUniformLocation, x : number, y : number, z : number) : void; - uniform3iv(location : WebGLUniformLocation, v : Int32Array) : void; - uniform3iv(location : WebGLUniformLocation, v : number[]) : void; - uniform4f(location : WebGLUniformLocation, x : number, y : number, z : number, w : number) : void; - uniform4fv(location : WebGLUniformLocation, v : Float32Array) : void; - uniform4fv(location : WebGLUniformLocation, v : number[]) : void; - uniform4i(location : WebGLUniformLocation, x : number, y : number, z : number, w : number) : void; - uniform4iv(location : WebGLUniformLocation, v : Int32Array) : void; - uniform4iv(location : WebGLUniformLocation, v : number[]) : void; - uniformMatrix2fv(location : WebGLUniformLocation, transpose : boolean, value : Float32Array) : void; - uniformMatrix2fv(location : WebGLUniformLocation, transpose : boolean, value : number[]) : void; - uniformMatrix3fv(location : WebGLUniformLocation, transpose : boolean, value : Float32Array) : void; - uniformMatrix3fv(location : WebGLUniformLocation, transpose : boolean, value : number[]) : void; - uniformMatrix4fv(location : WebGLUniformLocation, transpose : boolean, value : Float32Array) : void; - uniformMatrix4fv(location : WebGLUniformLocation, transpose : boolean, value : number[]) : void; - useProgram(program : WebGLProgram) : void; - validateProgram(program : WebGLProgram) : void; - vertexAttrib1f(indx : number, x : number) : void; - vertexAttrib1fv(indx : number, values : Float32Array) : void; - vertexAttrib1fv(indx : number, values : number[]) : void; - vertexAttrib2f(indx : number, x : number, y : number) : void; - vertexAttrib2fv(indx : number, values : Float32Array) : void; - vertexAttrib2fv(indx : number, values : number[]) : void; - vertexAttrib3f(indx : number, x : number, y : number, z : number) : void; - vertexAttrib3fv(indx : number, values : Float32Array) : void; - vertexAttrib3fv(indx : number, values : number[]) : void; - vertexAttrib4f(indx : number, x : number, y : number, z : number, w : number) : void; - vertexAttrib4fv(indx : number, values : Float32Array) : void; - vertexAttrib4fv(indx : number, values : number[]) : void; - vertexAttribPointer(indx : number, size : number, type : number, normalized : boolean, stride : number, offset : number) : void; - viewport(x : number, y : number, width : number, height : number) : void; -} - -interface WebGLContextEvent extends Event { - initWebGLContextEvent(typeArg : string, canBubbleArg : boolean, cancelableArg : boolean, statusMessageArg : string) : void; -} - -//Extend the window object with cross Browser callbacks so TS will not complain -//Also add the (non-standard) Canvas Element parameter for performance improvement -interface WindowAnimationTiming { - requestAnimationFrame(callback: FrameRequestCallback, canvas ?: HTMLCanvasElement): number; - //msRequestAnimationFrame(callback: FrameRequestCallback, canvas ?: HTMLCanvasElement): number; - mozRequestAnimationFrame(callback: FrameRequestCallback, canvas ?: HTMLCanvasElement): number; - webkitRequestAnimationFrame(callback: FrameRequestCallback, canvas ?: HTMLCanvasElement): number; - oRequestAnimationFrame(callback: FrameRequestCallback, canvas ?: HTMLCanvasElement): number; - - cancelRequestAnimationFrame(handle: number): void; - //msCancelRequestAnimationFrame(handle: number): void; - mozCancelRequestAnimationFrame(handle: number): void; - webkitCancelRequestAnimationFrame(handle: number): void; - oCancelRequestAnimationFrame(handle: number): void; -} - -//To make WebGL work -interface HTMLCanvasElement { - getContext(contextId: string, params : {}): WebGLRenderingContext; -} From f60c44af614ced02ab504f5e58f76ae703faa3ed Mon Sep 17 00:00:00 2001 From: Gil Amran Date: Sat, 26 Jul 2014 13:31:35 +0300 Subject: [PATCH 019/537] webgl removed also from tests --- pixi/pixi-tests.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/pixi/pixi-tests.ts b/pixi/pixi-tests.ts index de452f72e..6600bb121 100644 --- a/pixi/pixi-tests.ts +++ b/pixi/pixi-tests.ts @@ -1,5 +1,4 @@ /// -/// function PixiTests() { From b71fbf13305f974da5bcedaacd81262405876d1c Mon Sep 17 00:00:00 2001 From: Georgie Date: Thu, 31 Jul 2014 10:50:27 -0700 Subject: [PATCH 020/537] Complete DataTable, DataView --- .../google.visualization.d.ts | 103 +++++++++++++++++- 1 file changed, 97 insertions(+), 6 deletions(-) diff --git a/google.visualization/google.visualization.d.ts b/google.visualization/google.visualization.d.ts index f45f3f6a3..fb538d329 100644 --- a/google.visualization/google.visualization.d.ts +++ b/google.visualization/google.visualization.d.ts @@ -58,7 +58,7 @@ declare module google { setRefreshInterval(interval: number): void; setOption(key: string, value: any): void; setOptions(options: Object): void; - setView(view_spec: DataView): void; + setView(view_spec: string): void; } //#endregion @@ -71,17 +71,68 @@ declare module google { addColumn(descriptionObject: DataTableColumnDescription): number; addRow(cellObject: DataObjectCell): number; addRow(cellArray?: any[]): number; - addRows(count: number): number; - addRows(array: DataObjectCell[][]): number; - addRows(array: any[]): number; + addRows(numberOfEmptyRows: number): number; + addRows(rows: DataObjectCell[][]): number; + addRows(rows: any[][]): number; + clone(): DataTable; + getColumnId(columnIndex: number): String; + getColumnLabel(columnIndex: number): string; + getColumnPattern(columnIndex: number): string; + getColumnProperties(columnIndex: number): Properties; + getColumnProperty(columnIndex: number, name: string): any; + getColumnRange(columnIndex: number): { min: any; max: any }; + getColumnRole(columnIndex: string): string; + getColumnType(columnIndex: number): string; + getDistinctValues(columnIndex: number): any[]; getFilteredRows(filters: DataTableCellFilter[]): number[]; getFormattedValue(rowIndex: number, columnIndex: number): string; - getValue(rowIndex: number, columnIndex: number): any; getNumberOfColumns(): number; getNumberOfRows(): number; + getProperty(rowIndex: number, columnIndex: number, name: string): any; + getProperties(rowIndex: number, columnIndex: number): Properties; + getRowProperties(rowIndex: number): Properties; + getRowProperty(rowIndex: number, name: string): Properties; + getSortedRows(sortColumn: number): number[]; + getSortedRows(sortColumn: SortByColumn): number[]; + getSortedRows(sortColumns: number[]): number[]; + getSortedRows(sortColumns: SortByColumn[]): number[]; + getTableProperties(): Properties; + getTableProperty(name: string): any; + getValue(rowIndex: number, columnIndex: number): any; + insertColumn(columnIndex: number, type: string, label?: string, id?: string); + insertRows(rowIndex: number, numberOfEmptyRows: number); + insertRows(rowIndex: number, rows: DataObjectCell[][]); + insertRows(rowIndex: number, rows: any[][]); + removeColumn(columnIndex: number): void; + removeColumns(columnIndex: number, numberOfColumns: number): void; removeRow(rowIndex: number): void; removeRows(rowIndex: number, numberOfRows: number): void; + setCell(rowIndex: number, columnIndex: number, value?: any, formattedValue?: string, properties?: Properties): void; setColumnLabel(columnIndex: number, label: string): void; + setColumnProperty(columnIndex: number, name: string, value: any): void; + setColumnProperties(columnIndex: number, properties: Properties): void; + setFormattedValue(rowIndex: number, columnIndex: number, formattedValue: string): void; + setProperty(rowIndex: number, columnIndex: number, name: string, value: any): void; + setProperties(rowIndex: number, columnIndex: number, properties: Properties): void; + setRowProperty(rowIndex: number, name: string, value: any): void; + setRowProperties(rowIndex: number, properties: Properties): void; + setTableProperty(name: string, value: any): void; + setTableProperties(properties: Properties): void; + setValue(rowIndex: number, columnIndex: number, value: any); + sort(sortColumn: number): number[]; + sort(sortColumn: SortByColumn): number[]; + sort(sortColumns: number[]): number[]; + sort(sortColumns: SortByColumn[]): number[]; + toJSON(): string; + } + + export interface Properties { + [property: string]: any + } + + export interface SortByColumn { + column: number; + desc: boolean; } export interface DataTableColumnDescription { @@ -113,6 +164,9 @@ declare module google { export interface DataTableCellFilter { column: number; + value?: any; + minValue?: any; + maxValue?: any; } export interface DataObjectCell { @@ -139,7 +193,44 @@ declare module google { export class DataView { constructor(data: DataTable); constructor(data: DataView); - setColumns(columnIndexes: any[]): void; + + getColumnId(columnIndex: number): String; + getColumnLabel(columnIndex: number): string; + getColumnPattern(columnIndex: number): string; + getColumnProperty(columnIndex: number, name: string): any; + getColumnRange(columnIndex: number): { min: any; max: any }; + getColumnType(columnIndex: number): string; + getDistinctValues(columnIndex: number): any[]; + getFilteredRows(filters: DataTableCellFilter[]): number[]; + getFormattedValue(rowIndex: number, columnIndex: number): string; + getNumberOfColumns(): number; + getNumberOfRows(): number; + getProperty(rowIndex: number, columnIndex: number, name: string): any; + getProperties(rowIndex: number, columnIndex: number): Properties; + getRowProperty(rowIndex: number, name: string): Properties; + getSortedRows(sortColumn: number): number[]; + getSortedRows(sortColumn: SortByColumn): number[]; + getSortedRows(sortColumns: number[]): number[]; + getSortedRows(sortColumns: SortByColumn[]): number[]; + getTableProperty(name: string): any; + getValue(rowIndex: number, columnIndex: number): any; + getTableColumnIndex(viewColumnIndex: number): number; + getTableRowIndex(viewRowIndex: number): number; + getViewColumnIndex(tableColumnIndex: number): number; + getViewColumns(): number[]; + getViewRowIndex(tableRowIndex: number): number; + getViewRows(): number[]; + + hideColumns(columnIndexes: number[]): void; + hideRows(min: number, max: number): void; + hideRows(rowIndexes: number[]): void; + + setColumns(columnIndexes: number[]): void; + setRows(min: number, max: number): void; + setRows(rowIndexes: number[]); + + toDataTable(): DataTable; + toJSON(): string; } //#endregion From 9900804542bee0f8eb0ee99871dbaa7b860fd85f Mon Sep 17 00:00:00 2001 From: Georgie Date: Thu, 31 Jul 2014 11:04:51 -0700 Subject: [PATCH 021/537] Fixed setColumns, added void returns --- .../google.visualization.d.ts | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/google.visualization/google.visualization.d.ts b/google.visualization/google.visualization.d.ts index fb538d329..2657d8274 100644 --- a/google.visualization/google.visualization.d.ts +++ b/google.visualization/google.visualization.d.ts @@ -99,10 +99,10 @@ declare module google { getTableProperties(): Properties; getTableProperty(name: string): any; getValue(rowIndex: number, columnIndex: number): any; - insertColumn(columnIndex: number, type: string, label?: string, id?: string); - insertRows(rowIndex: number, numberOfEmptyRows: number); - insertRows(rowIndex: number, rows: DataObjectCell[][]); - insertRows(rowIndex: number, rows: any[][]); + insertColumn(columnIndex: number, type: string, label?: string, id?: string): void; + insertRows(rowIndex: number, numberOfEmptyRows: number): void; + insertRows(rowIndex: number, rows: DataObjectCell[][]): void; + insertRows(rowIndex: number, rows: any[][]): void; removeColumn(columnIndex: number): void; removeColumns(columnIndex: number, numberOfColumns: number): void; removeRow(rowIndex: number): void; @@ -118,7 +118,7 @@ declare module google { setRowProperties(rowIndex: number, properties: Properties): void; setTableProperty(name: string, value: any): void; setTableProperties(properties: Properties): void; - setValue(rowIndex: number, columnIndex: number, value: any); + setValue(rowIndex: number, columnIndex: number, value: any): void; sort(sortColumn: number): number[]; sort(sortColumn: SortByColumn): number[]; sort(sortColumns: number[]): number[]; @@ -226,13 +226,25 @@ declare module google { hideRows(rowIndexes: number[]): void; setColumns(columnIndexes: number[]): void; + setColumns(columnIndexes: ColumnSpec[]): void; + setColumns(columnIndexes: any[]): void; setRows(min: number, max: number): void; - setRows(rowIndexes: number[]); + setRows(rowIndexes: number[]): void; toDataTable(): DataTable; toJSON(): string; } + export interface ColumnSpec { + calc: (dataTable: DataTable, row: number) => any; + type: string; + label?: string; + id?: string; + sourceColumn?: number; + properties?: Properties; + role?: string; + } + //#endregion //#region GeoChart From 4241fd0e05217a833fba04ef34dafe3091fe83fb Mon Sep 17 00:00:00 2001 From: Dave Allen Date: Mon, 4 Aug 2014 10:21:06 -0700 Subject: [PATCH 022/537] Updated for Meteor 0.8.3 using new auto-generation script that parses the official Meteor api.js documentation file. Updated the test file accordingly. --- meteor/meteor-tests.ts | 84 +-- meteor/meteor.d.ts | 1137 +++++++++++++++++++--------------------- 2 files changed, 549 insertions(+), 672 deletions(-) diff --git a/meteor/meteor-tests.ts b/meteor/meteor-tests.ts index ca1973f63..bb7928b1e 100644 --- a/meteor/meteor-tests.ts +++ b/meteor/meteor-tests.ts @@ -1,4 +1,4 @@ -/// +/// /** * All code below was copied from the examples at http://docs.meteor.com/. @@ -10,16 +10,17 @@ /*********************************** Begin setup for tests ******************************/ // A developer must declare a var Template like this in a separate file to use this TypeScript type definition file -interface ITemplate { - adminDashboard: IMeteorViewModel; - chat: IMeteorViewModel; -} -declare var Template: ITemplate; +//interface ITemplate { +// adminDashboard: Meteor.Template; +// chat: Meteor.Template; +//} +//declare var Template: ITemplate; var Rooms = new Meteor.Collection('rooms'); var Messages = new Meteor.Collection('messages'); var Monkeys = new Meteor.Collection('monkeys'); +var check = function(str1, str2) {}; /********************************** End setup for tests *********************************/ @@ -203,7 +204,7 @@ Items.insert({list: groceriesId, name: "Persimmons"}); */ var Players = new Meteor.Collection('Players'); -Template.adminDashboard.events({ +Template['adminDashboard'].events({ 'click .givePoints': function () { Players.update(Session.get("currentPlayer"), {$inc: {score: 5}}); } @@ -223,7 +224,7 @@ Meteor.methods({ /** * From Collections, collection.remove section */ -Template.chat.events({ +Template['chat'].events({ 'click .remove': function () { Messages.remove(this._id); } @@ -282,16 +283,6 @@ topPosts.forEach(function (post) { count += 1; }); -/** - * From Collections, cursor.count section - */ -var frag = Meteor.render(function () { - var highScoring = Posts.find({score: {$gt: 10}}); - return "

There are " + highScoring.count() + " posts with " + - "scores greater than 10

"; -}); -document.body.appendChild(frag); - /** * From Collections, cursor.observeChanges section */ @@ -328,12 +319,6 @@ Session.set("currentRoomId", "home"); /** * From Sessions, Session.get section */ -Session.set("enemy", "Eastasia"); -var frag1 = Meteor.render(function () { - return "

We've always been at war with " + - Session.get("enemy") + "

"; -}); - // Page will say "We've always been at war with Eastasia" // DA: commented out since transpiler didn't like append() @@ -362,15 +347,6 @@ Meteor.users.deny({update: function () { return true; }}); /** * From Accounts, Meteor.loginWithExternalService section */ -Accounts.loginServiceConfiguration.remove({ - service: "weibo" -}); -Accounts.loginServiceConfiguration.insert({ - service: "weibo", - clientId: "1292962797", - secret: "75a730b58f5691de5522789070c319bc" -}); - Meteor.loginWithGithub({ requestPermissions: ['user', 'public_repo'] }, function (err) { @@ -434,52 +410,12 @@ Accounts.emailTemplates.enrollAccount.text = function (user, url) { /** * From Templates, Template.myTemplate.helpers section */ -Template.adminDashboard.helpers({ +Template['adminDashboard'].helpers({ foo: function () { return Session.get("foo"); } }); -/** - * From Templates, Template.myTemplate.preserve - */ -Template.adminDashboard.preserve({ - 'input[id]': function (node) { return node.id; } -}); - -/** - * From Templates, Meteor.render section - */ -var frag2 = Meteor.render(function () { - return "

There are " + Players.find({online: true}).count() + - " players online.

"; -}); -document.body.appendChild(frag2); - -Players.update({idleTime: {$gt: 30}}, {$set: {online: false}}); - -/** - * From Templates, Meteor.renderList section - */ -var frag3 = Meteor.renderList( - Posts.find({tags: "frontpage"}), - function(post) { - var style = Session.equals("selectedId", post._id) ? "selected" : ""; - // A real app would need to quote/sanitize post.name - return '
' + post.name + '
'; - }); -document.body.appendChild(frag3); - -var somePost = Posts.findOne({tags: "frontpage"}); -Session.set("selectedId", somePost._id); - -var eventTester = { - 'click p': function (event: IMeteorEvent) { - var paragraph = event.currentTarget; // always a P - var clickedElement = event.target; // could be the P or a child element - } -} - /** * From Match section */ diff --git a/meteor/meteor.d.ts b/meteor/meteor.d.ts index a321dc00e..b1611f51a 100644 --- a/meteor/meteor.d.ts +++ b/meteor/meteor.d.ts @@ -1,604 +1,545 @@ -// Type definitions for Meteor 0.6.5 -// Project: http://www.meteor.com/ -// Definitions by: Dave Allen -// Definitions: https://github.com/borisyankov/DefinitelyTyped - - -interface IMeteor { - - /******** - * Core * - ********/ - isClient: boolean; - isServer: boolean; - startup(func: Function): void; - absoluteUrl(path: string, - options: { - secure?: boolean; - replaceLocalhost?: boolean; - rootUrl?: string; - }): void; - settings: Object; - release: string; - - - /************************* - * Publish and Subscribe * - *************************/ - - /** - * Publish a record set. - * - * @param name Name of the attribute set. If null, the set has no name, and the record set is - * automatically sent to all connected clients. - * @param func Function called on the server each time a client subscribes. Inside the function, - * this is the publish handler object, described below. If the client passed arguments - * to subscribe, the function is called with the same arguments. - */ - publish(name: string, func: Function): any; - //Todo: Figure out a way to define this.userId, this.added, this.changed, etc that can be called from within publish - - /** - * Subscribe to a record set. Returns a handle that provides stop() and ready() methods. - * - * @param name Name of the subscription. Matches name of server's publish() call. - * @param arg1,arg2,arg3 Optional arguments passed to publisher function on server. - * @param callbacks Optional. May include onError and onReady callbacks. Can be Object or Function. If a function - * is passed instead of an object, it is interpreted as an onReady callback. - */ - subscribe(name: string, arg1?: any, arg2?: any, ars3?: any, arg4?: any, callbacks?: Object): IMeteorHandle; - - - /*********** - * Methods * - ***********/ - methods(methods: Object): void; - Error(error: number, reason?: string, details?: string): void; - // DA: Really should be defined like this: call(name: string, ...args?: any[], asyncCallback?: Function): void; - // But typescript does not allow Rest parameter (..args) to not be the last parameter defined - call(name: string, param1?: Object, param2?: Object, param3?: Object, param4?: Object, asyncCallback?: Function): void; - apply(name: string, options: any[], asyncCallback?: Function): void; - defer(callback: Function): void; - - - /********************* - * ServerConnections * - *********************/ - status(): { - connected: boolean; - status: string; - retryCount: number; - retryTime: number; - reason: string; - }; - reconnect(): void; - disconnect(): void; - - - /*************** - * Collections * - ***************/ - Collection(name: string, - options?: { - connection?: Object; - idGeneration?: string; - transform?: Function; - }): void; - - - /************ - * Accounts * - ************/ - user(): IMeteorUser; - userId(): string; - users: IMeteorUserCollection; - loggingIn(): boolean; - logout(callback?: Function): void; - loginWithPassword(user: Object, password: string, callback?: Function): void; - loginWithExternalService(options?: { - requestPermissions?: string[]; - requestOfflineToken?: boolean; - forceApprovalPrompt?: boolean; - }, - callback?: Function): void; - loginWithFacebook(options?: { - requestPermissions?: string[]; - requestOfflineToken?: boolean; - forceApprovalPrompt?: boolean; - }, - callback?: Function): void; - loginWithGithub(options?: { - requestPermissions?: string[]; - requestOfflineToken?: boolean; - forceApprovalPrompt?: boolean; - }, - callback?: Function): void; - loginWithGoogle(options?: { - requestPermissions?: string[]; - requestOfflineToken?: boolean; - forceApprovalPrompt?: boolean; - }, - callback?: Function): void; - loginWithMeetup(options?: { - requestPermissions?: string[]; - requestOfflineToken?: boolean; - forceApprovalPrompt?: boolean; - }, - callback?: Function): void; - loginWithTwitter(options?: { - requestPermissions?: string[]; - requestOfflineToken?: boolean; - forceApprovalPrompt?: boolean; - }, - callback?: Function): void; - loginWithWeibo(options?: { - requestPermissions?: string[]; - requestOfflineToken?: boolean; - forceApprovalPrompt?: boolean; - }, - callback?: Function): void; - - /************* - * Templates * - *************/ - render(htmlFunc: Function): DocumentFragment; - renderList(observable: IMeteorCursor, docFunc: Function, elseFunc?: Function): DocumentFragment; - - /********** - * Timers * - **********/ - setTimeout(func: Function, delay: number): void; - setInterval(func: Function, delay: number): void; - clearTimeout(id: number): void; - clearInterval(id: number): void; - - - /******************** Begin definitions for contributed packages from Atmosphere (or elsewhere) *******************/ - - /************************************************** - * For Paginated-Subscription contributed package * - **************************************************/ - subscribeWithPagination(collection: string, limit: number): IMeteorHandle; - Template(): void; - - /************************************************* - * For Router or Iron-Router contributed package * - *************************************************/ - Router: IMeteorRouter; - - /********************************* - * For Error contributed package * - *********************************/ - Errors: IMeteorErrors; - - /******************** End definitions for contributed packages from Atmosphere (or elsewhere) *********************/ - -} // End Meteor.someFunction definitions - - -/*************** - * Collections * - ***************/ -interface IMeteorCollection { - find(selector?, options?: Object): IMeteorCursor; - findOne(selector, options?: Object): any; - insert(doc: Object, callback?: Function): string; - update(selector, modifier, options?: Object, callback?: Function): void; - remove(selector, callback?: Function): void; - allow(options: Object): boolean; - deny(options: Object): boolean; - ObjectID(hexString?: string): Object; -} - -interface IMeteorCursor { - forEach(callback: Function): void; - map(callback: Function): void; - fetch(): any[]; - count(): number; - rewind(): void; - observe(callbacks: Object): void; - observeChanges(callbacks: Object): void; -} - - -/************* - * Templates * - *************/ - /** - * To use Meteor's Template.templateName.function, you must define an interface in a separate file with - * extension ".d.ts". Within the interface, every template name must have a property by that name that - * is of type IMeteorViewModel or IMeteorManager (choose either depending on your philosophical - * preference -- both work the same) - * e.g. file ".../client/views/view-model-types.d.ts": * - * interface ITemplate { - * postsList: IMeteorViewModel; - * comment: IMeteorViewModel; - * notifications: IMeteorViewModel; - * [your template name]: IMeteorViewModel; - * } - * declare var Template: ITemplate; + * Meteor definitions for TypeScript + * author - Olivier Refalo - orefalo@yahoo.com + * author - David Allen - dave@fullflavedave.com + * + * Thanks to Sam Hatoum for the base code for auto-generating this file + * + * supports Meteor 0.8.3 + * */ -interface IMeteorViewModel { - rendered(callback: Function): void; - created(callback: Function): void; - destroyed(callback: Function): void; - events(eventMap: {[eventName: string]: Function;}): void; - helpers(helpers: Object): void; - preserve(selector: Object): void; -} -interface IMeteorManager { - rendered(callback: Function): void; - created(callback: Function): void; - destroyed(callback: Function): void; - events(eventMap: {[eventType: string]: Function;}): void; - helpers(helpers: Object): any; - preserve(selector: Object): void; -} - -// DA: Currently not used, but I'd like to figure out a way to define the function signature -// for teh callbacks in IMeteorViewModel, IMeteorManager, and many other interfaces -interface IMeteorEvent { - type?: MeteorEventType.Value; - target?: Element; - currentTarget?: Element; - which?: number; - stopPropogation(): void; - stopImmediatePropogation(): void; - preventDefault(): void; - isPropogationStopped(): boolean; - isImmediatePropogationStopped(): boolean; - isDefaultPrevented(): boolean; -} - -declare module MeteorEventType { - export enum Value {'click', 'dblclick', 'focus', 'blur', 'change', - 'mouseenter', 'mouseleave', 'mousedown', 'mouseup', 'keydown', 'keypress', 'keyup', 'tap'} -} - -/*********** - * Session * - ***********/ -interface IMeteorSession { - set(key: string, value: Object): void; - setDefault(key: string, value: Object): void; - get(key: string): Object; - equals(key: string, value: any): void; -} - -interface IMeteorHandle { - loaded(): number; - limit(): number; - ready(): boolean; - loadNextPage(): void; -} - -/************************** - * Accounts and Passwords * - **************************/ -interface IMeteorUser { - _id?: string; - username?: string; - emails?: { - address: string; - verified: boolean; - }; - profile?: any; - services?: any; - createdAt?: number; -} - -interface IMeteorUserCollection { - find(selector?, options?: Object): IMeteorCursor; - findOne(selector, options?: Object): IMeteorUser; - insert(doc: IMeteorUser, callback?: Function): IMeteorUser; - update(selector, modifier, options?: Object, callback?: Function): void; - remove(selector, callback?: Function): void; - allow(options: Object): boolean; - deny(options: Object): boolean; - ObjectID(hexString?: string): Object; -} - -interface IMeteorAccounts { - config(options: { - sendVerificationEmail?: boolean; - forbidClientAccountCreation?: boolean; - }): void; - ui: { - config(options: { - requestPermissions?: Object; - requestOfflineToken?: Object; - passwordSignupFields?: string; - }); - }; - validateNewUser(func: Function): void; - onCreateUser(func: Function): void; - createUser(options: { - username?: string; - email?: string; - password?: string; - profile?: string; - }, - callback?: Function): void; - changePassword(oldPassword: string, newPassword: string, callback?: Function): void; - forgotPassword(options: { - email: string; - }, - callback?: Function): void; - resetPassword(token: string, newPassword: string, callback?: Function): void; - setPassword(userId: string, newPassword: string): void; - verifyEmail(token: string, callback?: Function): void; - sendResetPasswordEmail(userId: string, email?: string): void; - sendEnrollmentEmail(userId: string, email?: string): void; - sendVerificationEmail(userId: string, email?: string): void; - emailTemplates: { - from: string; - siteName: string; - resetPassword: IMeteorEmailValues; - enrollAccount: IMeteorEmailValues; - verifyEmail: IMeteorEmailValues; - }; - // DA: I didn't see the signature for this, but it appears in the examples - loginServiceConfiguration: { - remove(options: Object): void; - insert(options: Object): void; - }; -} - -interface IMeteorEmailValues { - subject?: Function; - text?: Function; -} - -interface IMeteorMatch { - test(value: any, pattern: any): boolean; - Any; - String; - Number; - Boolean; - undefined; - null; - Integer; - ObjectIncluding; - Object; - Optional(pattern: string); - OneOf(...args: string[]); - Where(condition: boolean); -} - -interface IExternalServiceParams { - options?: { - requestPermissions?: string[]; - requestOfflineToken?: boolean; - forceApprovalPrompt?: boolean; - }; - callback?: Function; -} - -/******** - * Deps * - ********/ -interface IMeteorDeps { - autorun(runFunc: Function): IMeteorComputationObject; - flush(): void; - nonreactive(func: Function): void; - active: boolean; - currentComputation: IMeteorComputationObject; - onInvalidate(callback: Function): void; - afterFlush(callback: Function): void; - - /** - * @constructor - */ - Computation(): void; - - /** - * @constructor - */ - Dependency(): void; -} - -interface IMeteorComputationObject { - stop(): void; - invalidate(): void; - onInvalidate(callback: Function): void; - stopped: boolean; - invalidated: boolean; - firstRun: boolean; -} - -interface IMeteorDependencyObject { - changed(): void; - depend(fromComputation?: IMeteorComputationObject): boolean; - hasDependents(): boolean; -} - -/********* - * EJSON * - *********/ -interface IMeteorEJSON { - parse(str: string): void; - stringify(val: any): string; - fromJSONValue(val): any; - toJSONValue(val): JSON; - equals(any: any): boolean; - clone(val: any): any; - newBinary(size: number): void; - isBinary(x: any): boolean; - addType(name: string, factory: Function): void; -} - -/**************** - * HTTP package * - ****************/ -interface IMeteorHTTP { - call(method: string, url: string, options: { - content?: string; - data?: Object; - query?: string; - params?: Object; - auth?: string; - headers?: Object; - timeout?: number; - followRedirects?: boolean; - }, asyncCallback?: Function): IMeteorHTTPResult; - get(url: string, options?: { - content?: string; - data?: Object; - query?: string; - params?: Object; - auth?: string; - headers?: Object; - timeout?: number; - followRedirects?: boolean; - }, asyncCallback?: Function): IMeteorHTTPResult; - post(url: string, options?: { - content?: string; - data?: Object; - query?: string; - params?: Object; - auth?: string; - headers?: Object; - timeout?: number; - followRedirects?: boolean; - }, asyncCallback?: Function): IMeteorHTTPResult; - put(url: string, options?: { - content?: string; - data?: Object; - query?: string; - params?: Object; - auth?: string; - headers?: Object; - timeout?: number; - followRedirects?: boolean; - }, asyncCallback?: Function): IMeteorHTTPResult; - del(url: string, options?: { - content?: string; - data?: Object; - query?: string; - params?: Object; - auth?: string; - headers?: Object; - timeout?: number; - followRedirects?: boolean; - }, asyncCallback?: Function): IMeteorHTTPResult; -} - -// DA: Currently not used -// I would like to figure out a way to specify this as type for options for IMeteorHTTP methods. -// Tests don't work if I simply specify this interface as the type. -interface IMeteorHTTPCallOptions { - content?: string; - data?: Object; - query?: string; - params?: Object; - auth?: string; - headers?: Object; - timeout?: number; - followRedirects?: boolean; -} - -interface IMeteorHTTPResult { - statusCode: number; - content: string; - data?: JSON; - headers: Object; -} - -/********* - * Email * - *********/ -interface IMeteorEmail { - send(options: { - from?: string; - to: any; - cc?: any; - bcc?: any; - replyTo?: any; - subject?: string; - text?: string; - html?: string; - headers?: Object; - }): void; -} - - -/********** - * Assets * - **********/ -interface IMeteorAssets { - getText(assetPath: string, asyncCallback?: Function): string; - getBinary(assetPath: string, asyncCallback?: Function): any; -} - -/******* - * DPP * - *******/ -interface IMeteorDPP { - connect(url: string): void; -} - -declare var Meteor: IMeteor; -declare var Collection: IMeteorCollection; -declare var Session: IMeteorSession; -declare var Deps: IMeteorDeps; -declare var Accounts: IMeteorAccounts; -declare var Match: IMeteorMatch; -declare function check(value: any, pattern: any): void; -declare var Computation: IMeteorComputationObject; -declare var Dependency: IMeteorDependencyObject; -declare var EJSON: IMeteorEJSON; -declare var HTTP: IMeteorHTTP; -declare var Email: IMeteorEmail; -declare var Assets: IMeteorAssets; -declare var DPP: IMeteorDPP; - -declare function changed(collection: string, id: string, fields, Object): void; - -/******************** Begin definitions for contributed packages from Atmosphere (or elsewhere) *********************/ - -/*************************************************** - * For Router and Iron-Router contributed packages * - ***************************************************/ -interface IMeteorRouter { - - // These are for Router - page(): void; - add(route: Object): void; - to(path: string, ...args: any[]): void; - filters(filtersMap: Object); - filter(filterName: string, options?: Object); - - // These are for Iron-Router - map(routeMap: Function): void; - path(route: string, params?: Object): void; - url(route: string): void; - routes: Object; - configure(options: IMeteorRouterConfig): void; -} - -// For Iron-Router -interface IMeteorRouterConfig { - layout: string; - notFoundTemplate: string; - loadingTemplate: string; - renderTemplates: Object; -} - -interface IMeteorErrors { - throw(message: string): void; - clear(): void; -} - -// For Router and Iron-Router contributed packages -declare var Router: IMeteorRouter; - -/******************** End definitions for contributed packages from Atmosphere (or elsewhere) ***********************/ +/// /** - * Todo: - * Define "this.function" functions. - * Define the signatures of callback functions and other functions. - ***/ + * These are the modules and interfaces that can't be automatically generated from the Meteor api.js file + */ +declare module Meteor { + interface EJSONObject extends Object {} + + interface LoginWithExternalServiceOptions { + requestPermissions?: string[]; + requestOfflineToken?: Boolean; + forceApprovalPrompt?: Boolean; + userEmail?: string; + } + + function loginWithMeteorDeveloperAccount(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + function loginWithFacebook(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + function loginWithGithub(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + function loginWithGoogle(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + function loginWithMeetup(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + function loginWithTwitter(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + function loginWithWeibo(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + interface UserEmail { + address:string; + verified:boolean; + } + + interface User { + _id?:string; + username?:string; + emails?:Meteor.UserEmail[]; + createdAt?: number; + profile?: any; + services?: any; + } + + interface SubscriptionHandle { + stop(): void; + ready(): boolean; + } + + interface CollectionFieldSpecifier { + [id: string]: Number; + } + + interface TemplateBase { + [templateName: string]: Meteor.Template; + } + + interface RenderedTemplate extends Object {} + + interface DataContext extends Object {} + + enum CollectionIdGenerationEnum { + STRING, + MONGO + } + + interface CollectionOptions { + connection: Object; + idGeneration: Meteor.CollectionIdGenerationEnum; + transform?: (document)=>any; + } + + function Collection(name:string, options?:Meteor.CollectionOptions) : void; + + interface Tinytest { + add(name:string, func:Function); + addAsync(name:string, func:Function); + } + + enum StatusEnum { + connected, + connecting, + failed, + waiting, + offline + } + + interface LiveQueryHandle { + stop(): void; + } + + interface EmailFields { + subject?: Function; + text?: Function; + } + + interface EmailTemplates { + from: string; + siteName: string; + resetPassword: Meteor.EmailFields; + enrollAccount: Meteor.EmailFields; + verifyEmail: Meteor.EmailFields; + } + + interface AccountsBase { + EmailTemplates: { + from: string; + siteName: string; + resetPassword: Meteor.EmailFields; + enrollAccount: Meteor.EmailFields; + verifyEmail: Meteor.EmailFields; + } + loginServicesConfigured(): boolean; + } + + interface MatchBase { + Any; + String; + Integer; + Boolean; + undefined; + null; + Object; + Optional(pattern):boolean; + ObjectIncluding(dico):boolean; + OneOf(...patterns); + Where(condition); + } + + interface AllowDenyOptions { + insert?: (userId:string, doc) => boolean; + update?: (userId, doc, fieldNames, modifier) => boolean; + remove?: (userId, doc) => boolean; + fetch?: string[]; + transform?: Function; + } + + interface Error { + error: number; + reason?: string; + details?: string; + } +} + +declare module Deps { + function Computation(): void; + function Dependency(): void; +} + +declare module Package { + function describe(metadata:PackageDescribeAPI); + function on_use(func:{(api:Api, where?:string[]):void}); + function on_use(func:{(api:Api, where?:string):void}); + function on_test(func:{(api:Api):void}) ; + function register_extension(extension:string, options:PackageRegisterExtensionOptions); + interface PackageRegisterExtensionOptions {(bundle:Bundle, source_path:string, serve_path:string, where?:string[]):void} + interface PackageDescribeAPI { + summary: string; + } + interface Api { + export(variable:string); + export(variables:string[]); + use(deps:string, where?:string[]); + use(deps:string, where?:string); + use(deps:string[], where?:string[]); + use(deps:string[], where?:string); + add_files(file:string, where?:string[]); + add_files(file:string, where?:string); + add_files(file:string[], where?:string[]); + add_files(file:string[], where?:string); + imply(package:string); + imply(packages:string[]); + } + interface BundleOptions { + type: string; + path: string; + data: any; + where: string[]; + } + interface Bundle { + add_resource(options:BundleOptions); + error(diagnostics:string); + } +} + +declare module Npm { + function require(module:string); + function depends(dependencies:{[id:string]:string}); +} + +declare module HTTP { + enum HTTPMethodEnum { + GET, + POST, + PUT, + DELETE + } + + interface HTTPRequest { + content?:string; + data?:any; + query?:string; + params?:{[id:string]:string}; + auth?:string; + headers?:{[id:string]:string}; + timeout?:number; + followRedirects?:boolean; + } + + interface HTTPResponse { + statusCode:number; + content:string; + // response is not always json + data:any; + headers:{[id:string]:string}; + } +} + +declare module Email { + interface EmailMessage { + from: string; + to: any; // string or string[] + cc?: any; // string or string[] + bcc?: any; // string or string[] + replyTo?: any; // string or string[] + subject: string; + text?: string; + html?: string; + headers?: {[id: string]: string}; + } +} + +declare module DDP { + interface DDPStatic { + subscribe(name, ...rest); + call(method:string, ...parameters):void; + apply(method:string, ...parameters):void; + methods(IMeteorMethodsDictionary); + status():DDPStatus; + reconnect(); + disconnect(); + onReconnect(); + } + + interface DDPStatus { + connected: boolean; + status: Meteor.StatusEnum; + retryCount: number; + //To turn this into an interval until the next reconnection, use retryTime - (new Date()).getTime() + retryTime?: number; + reason?: string; + } +} + +declare module Random { + function fraction():number; + function hexString(numberOfDigits:number):string; // @param numberOfDigits, @returns a random hex string of the given length + function choice(array:any[]):string; // @param array, @return a random element in array + function choice(str:string):string; // @param str, @return a random char in str +} + +/** + * These modules and interfaces are automatically generated from the Meteor api.js file + */ +declare module Meteor { + var isClient: boolean; + var isServer: boolean; + function startup(func: Function): void; + function absoluteUrl(path?, options?: { + secure?: Boolean; + replaceLocalhost?: Boolean; + rootUrl?: string; + }): string; + var settings: {[id:string]: any}; + var release: string; + function publish(name: string, func: Function): void; + function subscribe(name, ...args): SubscriptionHandle; + function methods(methods: Object): void; + function Error(error, reason?, details?): void; + function call(name: string, ...params): void; + function apply(name: string, params, options?: { + wait?: Boolean; + onResultReceived?: Function; + }, asyncCallback?): void; + function status(): Meteor.StatusEnum; + function reconnect(): void; + function disconnect(): void; + function onConnection(callback: Function): void; + function Collection(name: string, options?: { + connection?: Object; + idGeneration?: string; + transform?: Function; + }): void; + function user(): Meteor.User; + function userId(): string; + var users: Meteor.Collection; + function loggingIn(): boolean; + function logout(callback?: Function): void; + function logoutOtherClients(callback?: Function): void; + function loginWithPassword(user: any, password: string, callback?: Function): void; + function loginWithExternalService(options?: { + requestPermissions?: string[]; + requestOfflineToken?: Boolean; + forceApprovalPrompt?: Boolean; + userEmail?: string; + }, callback?: Function): void; + function setTimeout(func: Function, delay: Number): number; + function setInterval(func: Function, delay: Number): number; + function clearTimeout(id: Number): void; + function clearInterval(id: Number): void; + function EnvironmentVariable(): void; + function get(): string; + function withValue(value: any, func: Function): void; + function bindEnvironment(func: Function, onException: Function, _this: Object): Function; +} + +declare module Meteor { + interface EJSON { + parse(str: string): EJSON; + stringify(val: Meteor.EJSON, options?: { + indent?: any; // boolean, integer, or string + canonical?: Boolean; + }): string; + fromJSONValue(val: JSON): any; + toJSONValue(val: Meteor.EJSON): JSON; + equals(a: Meteor.EJSONObject, b: Meteor.EJSONObject, options?: { + keyOrderSensitive?: Boolean; + }): boolean; + clone(v:T): T; + newBinary(size: Number): any; + isBinary(): boolean; + addType(name: string, factory: Function): void; + } +} + +declare module DDP { + function connect(url: string): DDP.DDPStatic; +} + +declare module Meteor { + interface Collection { + find(selector?: any, options?: { + sort?: any; + skip?: Number; + limit?: Number; + fields?: Meteor.CollectionFieldSpecifier; + reactive?: Boolean; + transform?: Function; + }); + findOne(selector?: any, options?: { + sort?: any; + skip?: Number; + fields?: Meteor.CollectionFieldSpecifier; + reactive?: Boolean; + transform?: Function; + }); + insert(doc: Object, callback?: Function); + update(selector: any, modifier: any, options?: { + multi?: Boolean; + upsert?: Boolean; + }, callback?: Function): number; + upsert(selector: any, modifier: any, options?: { + multi?: Boolean; + }, callback?: Function): {numberAffected?: number; insertedId?: string;}; + remove(selector: any, callback?: Function): void; + allow(options: Meteor.AllowDenyOptions): boolean; + deny(options: Meteor.AllowDenyOptions): boolean; + ObjectID(hexString: string): Object; + } +} + +declare module Meteor { + interface Cursor { + count(): number; + fetch(): Array; + forEach(callback: Function, thisArg?): void; + map(callback: Function, thisArg?): void; + observe(callbacks: Object): Meteor.LiveQueryHandle; + observeChanges(callbacks: Object): Meteor.LiveQueryHandle; + } +} + +declare module Random { + function id(): string; +} + +declare module Deps { + function autorun(runFunc: Function): Deps.Computation; + function flush(): void; + function nonreactive(func: Function): void; + var active: boolean; + var currentComputation: Deps.Computation; + function onInvalidate(callback: Function): void; + function afterFlush(callback: Function): void; +} + +declare module Deps { + interface Computation { + stop(): void; + invalidate(): void; + onInvalidate(callback: Function): void; + stopped: boolean; + invalidated: boolean; + firstRun: boolean; + } +} + +declare module Deps { + interface Dependency { + changed(): void; + depend(fromComputation?): boolean; + hasDependents(): boolean; + } +} + +declare module Meteor { + interface Accounts extends Meteor.AccountsBase { + config(options: { + sendVerificationEmail?: Boolean; + forbidClientAccountCreation?: Boolean; + restrictCreationByEmailDomain?: any; // string or Function + loginExpirationInDays?: Number; + oauthSecretKey?: string; + }): void; + ui: { + config(options: { + requestPermissions?: Object; + requestOfflineToken?: Object; + forceApprovalPrompt?: Boolean; + passwordSignupFields?: string; + }); + } + validateNewUser(func: Function): void; + onCreateUser(func: Function): void; + validateLoginAttempt(func: Function); + onLogin(func: Function); + onLoginFailure(func: Function); + createUser(options: { + username?: string; + email?: string; + password?: string; + profile?: Object; + }, callback?: Function): string; + changePassword(oldPassword: string, newPassword: string, callback?: Function): void; + forgotPassword(options: { + email?: string; + }, callback?: Function): void; + resetPassword(token: string, newPassword: string, callback?: Function): void; + setPassword(userId: string, newPassword: string): void; + verifyEmail(token: string, callback?: Function): void; + sendResetPasswordEmail(userId: string, email?): void; + sendEnrollmentEmail(userId: string, email?): void; + sendVerificationEmail(userId: string, email?): void; + emailTemplates: Meteor.EmailTemplates; + } +} + +declare module Meteor { + interface Match extends Meteor.MatchBase { + test(value: any, pattern: any): boolean; + } +} + +declare module Meteor { + interface Session { + set(key: string, value: any): void; + setDefault(key: string, value: any): void; + get(key: string): any; + equals(key: string, value: any): boolean; + } +} + +declare module HTTP { + function call(method: string, url, options?: { + content?: string; + data?: Object; + query?: string; + params?: Object; + auth?: string; + headers?: Object; + timeout?: Number; + followRedirects?: Boolean; + }, asyncCallback?): HTTP.HTTPResponse; + function get(url, options?: { + }, asyncCallback?): HTTP.HTTPResponse; + function post(url, options?: { + }, asyncCallback?): HTTP.HTTPResponse; + function put(url, options?: { + }, asyncCallback?): HTTP.HTTPResponse; + function del(url, options?: { + }, asyncCallback?): HTTP.HTTPResponse; +} + +declare module Meteor { + interface Template { + rendered: Function; + created: Function; + destroyed: Function; + events(eventMap: {[id:string]: Function}): void; + helpers(helpers: Object): void; + } +} + +declare module Meteor { + interface UI { + registerHelper(name: string, func: Function): void; + body: Meteor.Template; + render(template): Meteor.RenderedTemplate; + renderWithData(template, data: Object): Meteor.RenderedTemplate; + insert(renderedTemplate: RenderedTemplate, parentNode, nextNode?): void; + remove(renderedTemplate: RenderedTemplate): void; + getElementData(el: HTMLElement): Meteor.DataContext; + } +} + +declare module Email { + function send(options: { + from?: string; + to?: any; // string or string[] + cc?: any; // string or string[] + bcc?: any; // string or string[] + replyTo?: any; // string or string[] + subject?: string; + text?: string; + html?: string; + headers?: Object; + }): void; +} + +declare module Assets { + function getText(assetPath: string, asyncCallback?): string; + function getBinary(assetPath: string, asyncCallback?): Meteor.EJSON; +} + +declare var Template: Meteor.TemplateBase; +declare var Session: Meteor.Session; +declare var Accounts: Meteor.Accounts; +declare var Match: Meteor.Match; +declare var EJSON: Meteor.EJSON; +declare var Tinytest: Meteor.Tinytest; From 8dc6096566de51d25504998ff02d2d818ed7d884 Mon Sep 17 00:00:00 2001 From: Dave Allen Date: Mon, 4 Aug 2014 10:23:39 -0700 Subject: [PATCH 023/537] Fixed test file reference to meteor def file. --- meteor/meteor-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meteor/meteor-tests.ts b/meteor/meteor-tests.ts index bb7928b1e..4dd6ed50b 100644 --- a/meteor/meteor-tests.ts +++ b/meteor/meteor-tests.ts @@ -1,4 +1,4 @@ -/// +/// /** * All code below was copied from the examples at http://docs.meteor.com/. From 6e0a9732855af34e0e299c97a267bb91d5968403 Mon Sep 17 00:00:00 2001 From: Dave Allen Date: Mon, 4 Aug 2014 10:25:39 -0700 Subject: [PATCH 024/537] Remove reference to lib.d.ts --- meteor/meteor.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/meteor/meteor.d.ts b/meteor/meteor.d.ts index b1611f51a..86b4a01e4 100644 --- a/meteor/meteor.d.ts +++ b/meteor/meteor.d.ts @@ -10,8 +10,6 @@ * */ -/// - /** * These are the modules and interfaces that can't be automatically generated from the Meteor api.js file */ From 86c0c56e6e3b28debedf3baf5cb5bf377b8e217a Mon Sep 17 00:00:00 2001 From: cristian-harja Date: Thu, 7 Aug 2014 18:24:18 +0300 Subject: [PATCH 025/537] missing Promise.nodeify() added --- q/Q.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/q/Q.d.ts b/q/Q.d.ts index 617bf0140..f567c5871 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -101,6 +101,11 @@ declare module Q { */ done(onFulfilled?: (value: T) => any, onRejected?: (reason: any) => any, onProgress?: (progress: any) => any): void; + /** + * If callback is a function, assumes it's a Node.js-style callback, and calls it as either callback(rejectionReason) when/if promise becomes rejected, or as callback(null, fulfillmentValue) when/if promise becomes fulfilled. If callback is not a function, simply returns promise. + */ + nodeify(callback: (reason: any, value: any) => void): void; + /** * Returns a promise to get the named property of an object. Essentially equivalent to * @@ -161,7 +166,7 @@ declare module Q { * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the result is always false. */ isPending(): boolean; - + valueOf(): any; /** From 5e202a9846bae747fe94bb945efefe137821320f Mon Sep 17 00:00:00 2001 From: VILIC VANE Date: Sun, 10 Aug 2014 21:34:48 +0800 Subject: [PATCH 026/537] add res.sendFile and mark res.sendfile as deprecated --- express/express.d.ts | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/express/express.d.ts b/express/express.d.ts index d9551e22b..439adc141 100644 --- a/express/express.d.ts +++ b/express/express.d.ts @@ -485,14 +485,18 @@ declare module "express" { * * Options: * - * - `maxAge` defaulting to 0 - * - `root` root directory for relative filenames + * - `maxAge` defaulting to 0 (can be string converted by `ms`) + * - `root` root directory for relative filenames + * - `headers` object of headers to serve with file + * - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them + * + * Other options are passed along to `send`. * * Examples: * - * The following example illustrates how `res.sendfile()` may + * The following example illustrates how `res.sendFile()` may * be used as an alternative for the `static()` middleware for - * dynamic situations. The code backing `res.sendfile()` is actually + * dynamic situations. The code backing `res.sendFile()` is actually * the same code, so HTTP cache support etc is identical. * * app.get('/user/:uid/photos/:file', function(req, res){ @@ -501,16 +505,35 @@ declare module "express" { * * req.user.mayViewFilesFrom(uid, function(yes){ * if (yes) { - * res.sendfile('/uploads/' + uid + '/' + file); + * res.sendFile('/uploads/' + uid + '/' + file); * } else { * res.send(403, 'Sorry! you cant see that.'); * } * }); * }); + * + * @api public + */ + sendFile(path: string): void; + sendFile(path: string, options: any): void; + sendFile(path: string, fn: Errback): void; + sendFile(path: string, options: any, fn: Errback): void; + + /** + * deprecated, use sendFile instead. */ sendfile(path: string): void; + /** + * deprecated, use sendFile instead. + */ sendfile(path: string, options: any): void; + /** + * deprecated, use sendFile instead. + */ sendfile(path: string, fn: Errback): void; + /** + * deprecated, use sendFile instead. + */ sendfile(path: string, options: any, fn: Errback): void; /** From e74fdd30bed040fa7eb63348de2b82ca6965a5c5 Mon Sep 17 00:00:00 2001 From: "Jason R. McNeil" Date: Wed, 6 Aug 2014 12:07:37 -0700 Subject: [PATCH 027/537] Add Builder support/options to xml2js --- xml2js/xml2js-tests.ts | 10 ++++++ xml2js/xml2js.d.ts | 77 +++++++++++++++++++++++++++++------------- 2 files changed, 63 insertions(+), 24 deletions(-) diff --git a/xml2js/xml2js-tests.ts b/xml2js/xml2js-tests.ts index 3e3fbb661..f2d9dc41e 100644 --- a/xml2js/xml2js-tests.ts +++ b/xml2js/xml2js-tests.ts @@ -5,3 +5,13 @@ import xml2js = require('xml2js'); xml2js.parseString("Hello xml2js!", (err: any, result: any) => { }); xml2js.parseString("Hello xml2js!", {trim: true}, (err: any, result: any) => { }); + +var builder = new xml2js.Builder({ + renderOpts: { + pretty: false + } +}); + +var outString = builder.buildObject({ + 'hello': 'xml2js!' +}); diff --git a/xml2js/xml2js.d.ts b/xml2js/xml2js.d.ts index 30aa64a87..f734e4ba0 100644 --- a/xml2js/xml2js.d.ts +++ b/xml2js/xml2js.d.ts @@ -1,6 +1,6 @@ // Type definitions for node-xml2js // Project: https://github.com/Leonidas-from-XIV/node-xml2js -// Definitions by: Michel Salib +// Definitions by: Michel Salib , Jason McNeil // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module 'xml2js' { @@ -8,29 +8,58 @@ declare module 'xml2js' { export = xml2js; module xml2js { - function parseString(xml:string, callback: (err: any, result:any) => void): void; - function parseString(xml:string, options: Options, callback: (err: any, result:any) => void): void; + function parseString(xml: string, callback: (err: any, result: any) => void): void; + function parseString(xml: string, options: Options, callback: (err: any, result: any) => void): void; - interface Options { - attrkey?: string; - charkey?: string; - explicitCharkey?: boolean; - trim?: boolean; - normalizeTags?: boolean; - normalize?: boolean; - explicitRoot?: boolean; - emptyTag?: any; - explicitArray?: boolean; - ignoreAttrs?: boolean; - mergeAttrs?: boolean; - validator?: Function; - xmlns?: boolean; - explicitChildren?: boolean; - charsAsChildren?: boolean; - async?: boolean; - strict?: boolean; - attrNameProcessors?: (name: string) => string; - tagNameProcessors?: (name: string) => string; - } + class Builder { + constructor(options?: BuilderOptions); + buildObject(rootObj: any): string; + } + + interface RenderOptions { + indent?: string; + newline?: string; + pretty?: boolean; + } + + interface XMLDeclarationOptions { + encoding?: string; + standalone?: boolean; + version?: string; + } + + interface BuilderOptions { + doctype?: any; + headless?: boolean; + indent?: string; + newline?: string; + pretty?: boolean; + renderOpts?: RenderOptions; + rootName?: string; + xmldec?: XMLDeclarationOptions; + } + + interface Options { + async?: boolean; + attrkey?: string; + attrNameProcessors?: (name: string) => string; + charkey?: string; + charsAsChildren?: boolean; + childkey?: string; + emptyTag?: any; + explicitArray?: boolean; + explicitCharkey?: boolean; + explicitChildren?: boolean; + explicitRoot?: boolean; + ignoreAttrs?: boolean; + mergeAttrs?: boolean; + normalize?: boolean; + normalizeTags?: boolean; + strict?: boolean; + tagNameProcessors?: (name: string) => string; + trim?: boolean; + validator?: Function; + xmlns?: boolean; + } } } From 03abed93e95d1a0cf1c825a5975ab3578b6fafe6 Mon Sep 17 00:00:00 2001 From: rsamec Date: Wed, 20 Aug 2014 09:30:19 +0200 Subject: [PATCH 028/537] business-rules-engine - new typings --- business-rules-engine/BasicValidators.d.ts | 107 ++++++++ business-rules-engine/Utils.d.ts | 10 + business-rules-engine/Validation.d.ts | 236 +++++++++++++++++ .../business-rules-engine-tests.ts | 31 +++ .../business-rules-engine.d.ts | 242 ++++++++++++++++++ 5 files changed, 626 insertions(+) create mode 100644 business-rules-engine/BasicValidators.d.ts create mode 100644 business-rules-engine/Utils.d.ts create mode 100644 business-rules-engine/Validation.d.ts create mode 100644 business-rules-engine/business-rules-engine-tests.ts create mode 100644 business-rules-engine/business-rules-engine.d.ts diff --git a/business-rules-engine/BasicValidators.d.ts b/business-rules-engine/BasicValidators.d.ts new file mode 100644 index 000000000..cc6193f68 --- /dev/null +++ b/business-rules-engine/BasicValidators.d.ts @@ -0,0 +1,107 @@ +/// +/// +/// +/// +/// +declare module Validators { + class LettersOnlyValidator implements Validation.IStringValidator { + public isAcceptable(s: string): boolean; + public tagName: string; + } + class ZipCodeValidator implements Validation.IStringValidator { + public isAcceptable(s: string): boolean; + public tagName: string; + } + class EmailValidator implements Validation.IStringValidator { + public isAcceptable(s: string): boolean; + public tagName: string; + } + class UrlValidator implements Validation.IStringValidator { + public isAcceptable(s: string): boolean; + public tagName: string; + } + class RequiredValidator implements Validation.IStringValidator { + public isAcceptable(s: string): boolean; + public tagName: string; + } + class DateValidator implements Validation.IStringValidator { + public isAcceptable(s: string): boolean; + public tagName: string; + } + class DateISOValidator implements Validation.IStringValidator { + public isAcceptable(s: string): boolean; + public tagName: string; + } + class NumberValidator implements Validation.IStringValidator { + public isAcceptable(s: string): boolean; + public tagName: string; + } + class DigitValidator implements Validation.IStringValidator { + public isAcceptable(s: string): boolean; + public tagName: string; + } + class SignedDigitValidator implements Validation.IStringValidator { + public isAcceptable(s: string): boolean; + public tagName: string; + } + class MinLengthValidator implements Validation.IStringValidator { + public MinLength: number; + constructor(MinLength?: number); + public isAcceptable(s: string): boolean; + public tagName: string; + } + class MaxLengthValidator implements Validation.IStringValidator { + public MaxLength: number; + constructor(MaxLength?: number); + public isAcceptable(s: string): boolean; + public tagName: string; + } + class RangeLengthValidator implements Validation.IStringValidator { + public RangeLength: number[]; + constructor(RangeLength?: number[]); + public isAcceptable(s: string): boolean; + public MinLength : number; + public MaxLength : number; + public tagName: string; + } + class MinValidator implements Validation.IPropertyValidator { + public Min: number; + constructor(Min?: number); + public isAcceptable(s: any): boolean; + public tagName: string; + } + class MaxValidator implements Validation.IPropertyValidator { + public Max: number; + constructor(Max?: number); + public isAcceptable(s: any): boolean; + public tagName: string; + } + class RangeValidator implements Validation.IPropertyValidator { + public Range: number[]; + constructor(Range?: number[]); + public isAcceptable(s: any): boolean; + public Min : number; + public Max : number; + public tagName: string; + } + class StepValidator implements Validation.IPropertyValidator { + public Step: string; + constructor(Step?: string); + public isAcceptable(s: any): boolean; + public tagName: string; + } + class PatternValidator implements Validation.IStringValidator { + public Pattern: string; + constructor(Pattern?: string); + public isAcceptable(s: string): boolean; + public tagName: string; + } + class ContainsValidator implements Validation.IAsyncPropertyValidator { + public Options: Q.Promise; + constructor(Options: Q.Promise); + public isAcceptable(s: string): Q.Promise; + public isAsync: boolean; + public tagName: string; + } +} +declare module "node-Validators" {export = Validators;} diff --git a/business-rules-engine/Utils.d.ts b/business-rules-engine/Utils.d.ts new file mode 100644 index 000000000..7d3df093b --- /dev/null +++ b/business-rules-engine/Utils.d.ts @@ -0,0 +1,10 @@ +/// +declare module Utils { + class StringFce { + static format(s: string, args: any): string; + } + class NumberFce { + static GetNegDigits(value: string): number; + } +} +declare module "node-Utils" {export = Utils;} diff --git a/business-rules-engine/Validation.d.ts b/business-rules-engine/Validation.d.ts new file mode 100644 index 000000000..c9fdccd5d --- /dev/null +++ b/business-rules-engine/Validation.d.ts @@ -0,0 +1,236 @@ +/// +/// +declare module Validation { + interface IErrorCustomMessage { + (config: any, args: any): string; + } + interface IPropertyValidator { + isAcceptable(s: any): boolean; + customMessage?: IErrorCustomMessage; + tagName?: string; + } + interface IStringValidator extends IPropertyValidator { + isAcceptable(s: string): boolean; + } + interface IAsyncPropertyValidator { + isAcceptable(s: any): Q.Promise; + customMessage?: IErrorCustomMessage; + isAsync: boolean; + tagName?: string; + } + interface IAsyncStringPropertyValidator extends IAsyncPropertyValidator { + isAcceptable(s: string): Q.Promise; + } + enum CompareOperator { + LessThan = 0, + LessThanEqual = 1, + Equal = 2, + NotEqual = 3, + GreaterThanEqual = 4, + GreaterThan = 5, + } + interface IError { + HasError: boolean; + ErrorMessage: string; + TranslateArgs?: IErrorTranslateArgs; + } + interface IErrorTranslateArgs { + TranslateId: string; + MessageArgs: any; + CustomMessage?: IErrorCustomMessage; + } + interface IOptional { + (): boolean; + } + interface IValidationFailure extends IError { + IsAsync: boolean; + Error: IError; + } + interface IValidationResult { + Name: string; + Add(validationResult: IValidationResult): void; + Remove(index: number): void; + Children: IValidationResult[]; + HasErrors: boolean; + HasErrorsDirty: boolean; + ErrorMessage: string; + ErrorCount: number; + Optional?: IOptional; + TranslateArgs?: IErrorTranslateArgs[]; + } + interface IValidate { + (args: IError): void; + } + interface IAsyncValidate { + (args: IError): Q.Promise; + } + interface IValidatorFce { + Name: string; + ValidationFce?: IValidate; + AsyncValidationFce?: IAsyncValidate; + } + interface IValidator { + Validate(context: any): IValidationFailure; + ValidateAsync(context: any): Q.Promise; + Error: IError; + } + interface IAbstractValidator { + RuleFor(prop: string, validator: IPropertyValidator): any; + ValidationFor(prop: string, validatorFce: IValidatorFce): any; + Validation(validatorFce: IValidatorFce): any; + ValidatorFor(prop: string, validator: IAbstractValidator): any; + CreateRule(name: string): IAbstractValidationRule; + CreateAbstractRule(name: string): IAbstractValidationRule; + CreateAbstractListRule(name: string): IAbstractValidationRule; + ForList: boolean; + } + interface IAbstractValidationRule { + Validate(context: T): IValidationResult; + ValidateAsync(context: T): Q.Promise; + ValidateAll(context: T): Q.Promise; + ValidateProperty(context: T, propName: string): void; + ValidationResult: IValidationResult; + Rules: { + [name: string]: IPropertyValidationRule; + }; + Validators: { + [name: string]: IValidator; + }; + Children: { + [name: string]: IAbstractValidationRule; + }; + } + interface IPropertyValidationRule { + Validators: { + [name: string]: any; + }; + Validate(context: IValidationContext): IValidationFailure[]; + ValidateAsync(context: IValidationContext): Q.Promise; + } + interface IValidationContext { + Value: string; + Key: string; + Data: T; + } + class Error implements IError { + public HasError: boolean; + public ErrorMessage: string; + constructor(); + } + class ValidationFailure implements IError { + public Error: IError; + public IsAsync: boolean; + constructor(Error: IError, IsAsync: boolean); + public HasError : boolean; + public ErrorMessage : string; + public TranslateArgs : IErrorTranslateArgs; + } + class ValidationResult implements IValidationResult { + public Name: string; + constructor(Name: string); + public IsDirty: boolean; + public Children : IValidationResult[]; + public Add(error: IValidationResult): void; + public Remove(index: number): void; + public Optional: IOptional; + public TranslateArgs: IErrorTranslateArgs[]; + public HasErrorsDirty : boolean; + public HasErrors : boolean; + public ErrorCount : number; + public ErrorMessage : string; + } + class CompositeValidationResult implements IValidationResult { + public Name: string; + public Children: IValidationResult[]; + constructor(Name: string); + public Optional: IOptional; + public AddFirst(error: IValidationResult): void; + public Add(error: IValidationResult): void; + public Remove(index: number): void; + public HasErrorsDirty : boolean; + public HasErrors : boolean; + public ErrorCount : number; + public ErrorMessage : string; + public TranslateArgs : IErrorTranslateArgs[]; + public LogErrors(headerMessage?: string): void; + public Errors : { + [name: string]: IValidationResult; + }; + private FlattenErros; + public SetDirty(): void; + public SetPristine(): void; + private SetDirtyEx(node, dirty); + private flattenErrors(node, errorCollection); + private traverse(node, indent); + } + class AbstractValidator implements IAbstractValidator { + public Validators: { + [name: string]: IPropertyValidator[]; + }; + public AbstractValidators: { + [name: string]: IAbstractValidator; + }; + public ValidationFunctions: { + [name: string]: IValidatorFce[]; + }; + public RuleFor(prop: string, validator: IPropertyValidator): void; + public ValidationFor(prop: string, fce: IValidatorFce): void; + public Validation(fce: IValidatorFce): void; + public ValidatorFor(prop: string, validator: IAbstractValidator, forList?: boolean): void; + public CreateAbstractRule(name: string): IAbstractValidationRule; + public CreateAbstractListRule(name: string): IAbstractValidationRule; + public CreateRule(name: string): IAbstractValidationRule; + public ForList: boolean; + } + class MessageLocalization { + static customMsg: string; + static defaultMessages: { + "required": string; + "remote": string; + "email": string; + "url": string; + "date": string; + "dateISO": string; + "number": string; + "digits": string; + "signedDigits": string; + "creditcard": string; + "equalTo": string; + "maxlength": string; + "minlength": string; + "rangelength": string; + "range": string; + "max": string; + "min": string; + "step": string; + "contains": string; + "mask": string; + "custom": string; + }; + static ValidationMessages: { + "required": string; + "remote": string; + "email": string; + "url": string; + "date": string; + "dateISO": string; + "number": string; + "digits": string; + "signedDigits": string; + "creditcard": string; + "equalTo": string; + "maxlength": string; + "minlength": string; + "rangelength": string; + "range": string; + "max": string; + "min": string; + "step": string; + "contains": string; + "mask": string; + "custom": string; + }; + static GetValidationMessage(validator: any): string; + } +} +export = Validation; diff --git a/business-rules-engine/business-rules-engine-tests.ts b/business-rules-engine/business-rules-engine-tests.ts new file mode 100644 index 000000000..fe9122a6c --- /dev/null +++ b/business-rules-engine/business-rules-engine-tests.ts @@ -0,0 +1,31 @@ +/// +/// +/// +/// +/// + +export interface IPerson{ + Checked:boolean; + FirstName:string; + LastName:string; + Email:string; +} + +//create custom composite validator +var personValidator = new Validation.AbstractValidator(); + +//create field validators +var required = new Validators.RequiredValidator(); +var email = new Validators.EmailValidator(); +var maxLength = new Validators.MaxLengthValidator(); +maxLength.MaxLength = 15; + + +personValidator.RuleFor("FirstName", required); +personValidator.RuleFor("FirstName", maxLength); + +personValidator.RuleFor("LastName", required); +personValidator.RuleFor("LastName", maxLength); + +personValidator.RuleFor("Email", required); +personValidator.RuleFor("Email", email); diff --git a/business-rules-engine/business-rules-engine.d.ts b/business-rules-engine/business-rules-engine.d.ts new file mode 100644 index 000000000..10f80e62b --- /dev/null +++ b/business-rules-engine/business-rules-engine.d.ts @@ -0,0 +1,242 @@ +// Type definitions for business-rules-engine - v1.0.20 +// Project: https://github.com/rsamec/form +// Definitions by: Roman Samec +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// Source: typings/business-rules-engine/Validation.d.ts +/// +/// +declare module Validation { + interface IErrorCustomMessage { + (config: any, args: any): string; + } + interface IPropertyValidator { + isAcceptable(s: any): boolean; + customMessage?: IErrorCustomMessage; + tagName?: string; + } + interface IStringValidator extends IPropertyValidator { + isAcceptable(s: string): boolean; + } + interface IAsyncPropertyValidator { + isAcceptable(s: any): Q.Promise; + customMessage?: IErrorCustomMessage; + isAsync: boolean; + tagName?: string; + } + interface IAsyncStringPropertyValidator extends IAsyncPropertyValidator { + isAcceptable(s: string): Q.Promise; + } + enum CompareOperator { + LessThan = 0, + LessThanEqual = 1, + Equal = 2, + NotEqual = 3, + GreaterThanEqual = 4, + GreaterThan = 5, + } + interface IError { + HasError: boolean; + ErrorMessage: string; + TranslateArgs?: IErrorTranslateArgs; + } + interface IErrorTranslateArgs { + TranslateId: string; + MessageArgs: any; + CustomMessage?: IErrorCustomMessage; + } + interface IOptional { + (): boolean; + } + interface IValidationFailure extends IError { + IsAsync: boolean; + Error: IError; + } + interface IValidationResult { + Name: string; + Add(validationResult: IValidationResult): void; + Remove(index: number): void; + Children: IValidationResult[]; + HasErrors: boolean; + HasErrorsDirty: boolean; + ErrorMessage: string; + ErrorCount: number; + Optional?: IOptional; + TranslateArgs?: IErrorTranslateArgs[]; + } + interface IValidate { + (args: IError): void; + } + interface IAsyncValidate { + (args: IError): Q.Promise; + } + interface IValidatorFce { + Name: string; + ValidationFce?: IValidate; + AsyncValidationFce?: IAsyncValidate; + } + interface IValidator { + Validate(context: any): IValidationFailure; + ValidateAsync(context: any): Q.Promise; + Error: IError; + } + interface IAbstractValidator { + RuleFor(prop: string, validator: IPropertyValidator): any; + ValidationFor(prop: string, validatorFce: IValidatorFce): any; + Validation(validatorFce: IValidatorFce): any; + ValidatorFor(prop: string, validator: IAbstractValidator): any; + CreateRule(name: string): IAbstractValidationRule; + CreateAbstractRule(name: string): IAbstractValidationRule; + CreateAbstractListRule(name: string): IAbstractValidationRule; + ForList: boolean; + } + interface IAbstractValidationRule { + Validate(context: T): IValidationResult; + ValidateAsync(context: T): Q.Promise; + ValidateAll(context: T): Q.Promise; + ValidateProperty(context: T, propName: string): void; + ValidationResult: IValidationResult; + Rules: { + [name: string]: IPropertyValidationRule; + }; + Validators: { + [name: string]: IValidator; + }; + Children: { + [name: string]: IAbstractValidationRule; + }; + } + interface IPropertyValidationRule { + Validators: { + [name: string]: any; + }; + Validate(context: IValidationContext): IValidationFailure[]; + ValidateAsync(context: IValidationContext): Q.Promise; + } + interface IValidationContext { + Value: string; + Key: string; + Data: T; + } + class Error implements IError { + public HasError: boolean; + public ErrorMessage: string; + constructor(); + } + class ValidationFailure implements IError { + public Error: IError; + public IsAsync: boolean; + constructor(Error: IError, IsAsync: boolean); + public HasError : boolean; + public ErrorMessage : string; + public TranslateArgs : IErrorTranslateArgs; + } + class ValidationResult implements IValidationResult { + public Name: string; + constructor(Name: string); + public IsDirty: boolean; + public Children : IValidationResult[]; + public Add(error: IValidationResult): void; + public Remove(index: number): void; + public Optional: IOptional; + public TranslateArgs: IErrorTranslateArgs[]; + public HasErrorsDirty : boolean; + public HasErrors : boolean; + public ErrorCount : number; + public ErrorMessage : string; + } + class CompositeValidationResult implements IValidationResult { + public Name: string; + public Children: IValidationResult[]; + constructor(Name: string); + public Optional: IOptional; + public AddFirst(error: IValidationResult): void; + public Add(error: IValidationResult): void; + public Remove(index: number): void; + public HasErrorsDirty : boolean; + public HasErrors : boolean; + public ErrorCount : number; + public ErrorMessage : string; + public TranslateArgs : IErrorTranslateArgs[]; + public LogErrors(headerMessage?: string): void; + public Errors : { + [name: string]: IValidationResult; + }; + private FlattenErros; + public SetDirty(): void; + public SetPristine(): void; + private SetDirtyEx(node, dirty); + private flattenErrors(node, errorCollection); + private traverse(node, indent); + } + class AbstractValidator implements IAbstractValidator { + public Validators: { + [name: string]: IPropertyValidator[]; + }; + public AbstractValidators: { + [name: string]: IAbstractValidator; + }; + public ValidationFunctions: { + [name: string]: IValidatorFce[]; + }; + public RuleFor(prop: string, validator: IPropertyValidator): void; + public ValidationFor(prop: string, fce: IValidatorFce): void; + public Validation(fce: IValidatorFce): void; + public ValidatorFor(prop: string, validator: IAbstractValidator, forList?: boolean): void; + public CreateAbstractRule(name: string): IAbstractValidationRule; + public CreateAbstractListRule(name: string): IAbstractValidationRule; + public CreateRule(name: string): IAbstractValidationRule; + public ForList: boolean; + } + class MessageLocalization { + static customMsg: string; + static defaultMessages: { + "required": string; + "remote": string; + "email": string; + "url": string; + "date": string; + "dateISO": string; + "number": string; + "digits": string; + "signedDigits": string; + "creditcard": string; + "equalTo": string; + "maxlength": string; + "minlength": string; + "rangelength": string; + "range": string; + "max": string; + "min": string; + "step": string; + "contains": string; + "mask": string; + "custom": string; + }; + static ValidationMessages: { + "required": string; + "remote": string; + "email": string; + "url": string; + "date": string; + "dateISO": string; + "number": string; + "digits": string; + "signedDigits": string; + "creditcard": string; + "equalTo": string; + "maxlength": string; + "minlength": string; + "rangelength": string; + "range": string; + "max": string; + "min": string; + "step": string; + "contains": string; + "mask": string; + "custom": string; + }; + static GetValidationMessage(validator: any): string; + } +} +declare module "<%= pkg.name %>" {export = Validation;} From 97cbf9597bb1cd72d8b91efc31a25f8a4047f374 Mon Sep 17 00:00:00 2001 From: rsamec Date: Wed, 20 Aug 2014 09:33:53 +0200 Subject: [PATCH 029/537] business-rules-engine - fix name at declare modules --- business-rules-engine/BasicValidators.d.ts | 2 +- business-rules-engine/Utils.d.ts | 2 +- business-rules-engine/Validation.d.ts | 2 +- business-rules-engine/business-rules-engine-tests.ts | 1 + business-rules-engine/business-rules-engine.d.ts | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/business-rules-engine/BasicValidators.d.ts b/business-rules-engine/BasicValidators.d.ts index cc6193f68..86a2c0baa 100644 --- a/business-rules-engine/BasicValidators.d.ts +++ b/business-rules-engine/BasicValidators.d.ts @@ -104,4 +104,4 @@ declare module Validators { public tagName: string; } } -declare module "node-Validators" {export = Validators;} +declare module "node-validators" {export = Validators;} diff --git a/business-rules-engine/Utils.d.ts b/business-rules-engine/Utils.d.ts index 7d3df093b..0f68cd1ba 100644 --- a/business-rules-engine/Utils.d.ts +++ b/business-rules-engine/Utils.d.ts @@ -7,4 +7,4 @@ declare module Utils { static GetNegDigits(value: string): number; } } -declare module "node-Utils" {export = Utils;} +declare module "node-utils" {export = Utils;} diff --git a/business-rules-engine/Validation.d.ts b/business-rules-engine/Validation.d.ts index c9fdccd5d..9a864e3e0 100644 --- a/business-rules-engine/Validation.d.ts +++ b/business-rules-engine/Validation.d.ts @@ -233,4 +233,4 @@ declare module Validation { static GetValidationMessage(validator: any): string; } } -export = Validation; +declare module "node-validation" {export = Validation;} diff --git a/business-rules-engine/business-rules-engine-tests.ts b/business-rules-engine/business-rules-engine-tests.ts index fe9122a6c..5695c3b7f 100644 --- a/business-rules-engine/business-rules-engine-tests.ts +++ b/business-rules-engine/business-rules-engine-tests.ts @@ -11,6 +11,7 @@ export interface IPerson{ Email:string; } + //create custom composite validator var personValidator = new Validation.AbstractValidator(); diff --git a/business-rules-engine/business-rules-engine.d.ts b/business-rules-engine/business-rules-engine.d.ts index 10f80e62b..efd516943 100644 --- a/business-rules-engine/business-rules-engine.d.ts +++ b/business-rules-engine/business-rules-engine.d.ts @@ -239,4 +239,4 @@ declare module Validation { static GetValidationMessage(validator: any): string; } } -declare module "<%= pkg.name %>" {export = Validation;} +declare module "business-rule-engine" {export = Validation;} From ecfdf2e7d3998b8c42434ab1f8e217a576617a1d Mon Sep 17 00:00:00 2001 From: rsamec Date: Wed, 20 Aug 2014 09:36:15 +0200 Subject: [PATCH 030/537] typings header added --- business-rules-engine/BasicValidators.d.ts | 5 +++++ business-rules-engine/Utils.d.ts | 5 +++++ business-rules-engine/Validation.d.ts | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/business-rules-engine/BasicValidators.d.ts b/business-rules-engine/BasicValidators.d.ts index 86a2c0baa..88e449825 100644 --- a/business-rules-engine/BasicValidators.d.ts +++ b/business-rules-engine/BasicValidators.d.ts @@ -1,3 +1,8 @@ +// Type definitions for business-rules-engine - v1.0.20 +// Project: https://github.com/rsamec/form +// Definitions by: Roman Samec +// Definitions: https://github.com/borisyankov/DefinitelyTyped + /// /// /// diff --git a/business-rules-engine/Utils.d.ts b/business-rules-engine/Utils.d.ts index 0f68cd1ba..bea120c63 100644 --- a/business-rules-engine/Utils.d.ts +++ b/business-rules-engine/Utils.d.ts @@ -1,3 +1,8 @@ +// Type definitions for business-rules-engine - v1.0.20 +// Project: https://github.com/rsamec/form +// Definitions by: Roman Samec +// Definitions: https://github.com/borisyankov/DefinitelyTyped + /// declare module Utils { class StringFce { diff --git a/business-rules-engine/Validation.d.ts b/business-rules-engine/Validation.d.ts index 9a864e3e0..114feb32e 100644 --- a/business-rules-engine/Validation.d.ts +++ b/business-rules-engine/Validation.d.ts @@ -1,3 +1,8 @@ +// Type definitions for business-rules-engine - v1.0.20 +// Project: https://github.com/rsamec/form +// Definitions by: Roman Samec +// Definitions: https://github.com/borisyankov/DefinitelyTyped + /// /// declare module Validation { From fde53d67c18bbce2c3b1ee8b3276ddfe27d0992b Mon Sep 17 00:00:00 2001 From: rsamec Date: Wed, 20 Aug 2014 12:48:20 +0200 Subject: [PATCH 031/537] retype q.d.ts to Q.d.ts --- business-rules-engine/BasicValidators.d.ts | 2 +- business-rules-engine/Validation.d.ts | 2 +- business-rules-engine/business-rules-engine.d.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/business-rules-engine/BasicValidators.d.ts b/business-rules-engine/BasicValidators.d.ts index 88e449825..8e7723d70 100644 --- a/business-rules-engine/BasicValidators.d.ts +++ b/business-rules-engine/BasicValidators.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped /// -/// +/// /// /// /// diff --git a/business-rules-engine/Validation.d.ts b/business-rules-engine/Validation.d.ts index 114feb32e..dfd6e786f 100644 --- a/business-rules-engine/Validation.d.ts +++ b/business-rules-engine/Validation.d.ts @@ -3,7 +3,7 @@ // Definitions by: Roman Samec // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// /// declare module Validation { interface IErrorCustomMessage { diff --git a/business-rules-engine/business-rules-engine.d.ts b/business-rules-engine/business-rules-engine.d.ts index efd516943..7c17714cc 100644 --- a/business-rules-engine/business-rules-engine.d.ts +++ b/business-rules-engine/business-rules-engine.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped // Source: typings/business-rules-engine/Validation.d.ts -/// +/// /// declare module Validation { interface IErrorCustomMessage { From 9456f1c5c149a9ebb54aac840ed32da59cdeafd2 Mon Sep 17 00:00:00 2001 From: fszlin Date: Wed, 20 Aug 2014 10:21:34 -0400 Subject: [PATCH 032/537] Add definition for parseObjectLiteral. --- knockout/knockout.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index b8db00e3c..66d2ddd94 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -525,6 +525,7 @@ interface KnockoutStatic { expressionRewriting: { bindingRewriteValidators: any; + parseObjectLiteral: { (objectLiteralString: string): any[] } }; ///////////////////////////////// From ae0cf5e7d20aa539400f543c35218c832be28ebb Mon Sep 17 00:00:00 2001 From: Ihor Kostiuk Date: Tue, 3 Jun 2014 23:36:11 +0300 Subject: [PATCH 033/537] chrome.desktopCapture and chrome.tabCapture --- chrome/chrome.d.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index 23ee0d916..6d4b5c9ee 100755 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -3,6 +3,8 @@ // Definitions by: Matthew Kimber , otiai10 // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + //////////////////// // Alarms //////////////////// @@ -537,6 +539,14 @@ declare module chrome.declarativeWebRequest { var onRequest: RequestedEvent; } +//////////////////// +// DesktopCapture +//////////////////// +declare module chrome.desktopCapture { + export function chooseDesktopMedia(sources: string[], targetTab?: chrome.tabs.Tab, callback?: (streamId: string) => void): void; + export function cancelChooseDesktopMedia(desktopMediaRequestId: number): void; +} + //////////////////// // Dev Tools - Inspected Window //////////////////// @@ -1745,6 +1755,27 @@ declare module chrome.socket { export function getNetworkList(callback: (result: NetworkInterface[]) => void): void; } +//////////////////// +// TabCapture +//////////////////// +declare module chrome.tabCapture { + interface CaptureInfo { + tabId: number; + status: string; + fullscreen: boolean; + } + + interface CaptureOptions { + audio?: boolean; + video?: boolean; + audioConstraints?: MediaTrackConstraints; + videoConstraints?: MediaTrackConstraints; + } + + export function capture(options: CaptureOptions, callback: (stream: LocalMediaStream) => void): void; + export function getCapturedTabs(callback: (result: CaptureInfo[]) => void): void; +} + //////////////////// // Tabs //////////////////// From 98232c522c138cff786e271462f578ce244e3086 Mon Sep 17 00:00:00 2001 From: Ihor Kostiuk Date: Wed, 20 Aug 2014 17:59:02 +0300 Subject: [PATCH 034/537] srcUrl in OnClickData based on description from http://dev.opera.com/extensions/contextMenus.html (link from chrome doc doesn't work https://developer.chrome.com/extensions/contextMenusInternal#type-OnClickData) --- chrome/chrome.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index 23ee0d916..1b28ede8e 100755 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -294,6 +294,7 @@ declare module chrome.contextMenus { pageUrl: string; linkUrl?: string; parentMenuItemId?: any; + srcUrl?: string; } interface CreateProperties { From 63d0061afb26fa84d0d7aa5c4f4ea08da9cf357c Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Thu, 21 Aug 2014 20:43:33 +0900 Subject: [PATCH 035/537] modify method signature --- node/node.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/node.d.ts b/node/node.d.ts index 282120dc6..be3813ade 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1110,7 +1110,7 @@ declare module "crypto" { setPrivateKey(public_key: string, encoding?: string): void; } export function getDiffieHellman(group_name: string): DiffieHellman; - export function pbkdf2(password: string, salt: string, iterations: number, keylen: number, callback: (err: Error, derivedKey: string) => any): void; + export function pbkdf2(password: string, salt: string, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void; export function pbkdf2Sync(password: string, salt: string, iterations: number, keylen: number) : Buffer; export function randomBytes(size: number): Buffer; export function randomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; From 0446dc4b625840653b894d10b4c9b0586709e167 Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Thu, 21 Aug 2014 20:44:04 +0900 Subject: [PATCH 036/537] add optional variable --- passport/passport.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/passport/passport.d.ts b/passport/passport.d.ts index 6d03093eb..977323140 100644 --- a/passport/passport.d.ts +++ b/passport/passport.d.ts @@ -8,6 +8,7 @@ declare module Express { export interface Request { session?: any; + authInfo?: any; // These declarations are merged into express's Request type login(user: any, done: (err: any) => void): void; From aa8615f8f29ee2ea8cd7969a41718331667b1be8 Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Thu, 21 Aug 2014 20:44:20 +0900 Subject: [PATCH 037/537] fix bug --- request/request-tests.ts | 3 ++- request/request.d.ts | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/request/request-tests.ts b/request/request-tests.ts index d422c3abc..986702c27 100644 --- a/request/request-tests.ts +++ b/request/request-tests.ts @@ -114,7 +114,8 @@ req = req.oauth(oauth); req = req.jar(jar); write = req.pipe(write); write = req.pipe(write, value); -req.write(); +req.pipe(req); +req.write(value); req.end(str); req.end(buffer); req.pause(); diff --git a/request/request.d.ts b/request/request.d.ts index e6a1d100e..5331fbd17 100644 --- a/request/request.d.ts +++ b/request/request.d.ts @@ -91,7 +91,7 @@ declare module 'request' { body: any; } - export interface Request { + export interface Request extends http.ClientRequest { getAgent(): http.Agent; //start(): void; //abort(): void; @@ -108,12 +108,8 @@ declare module 'request' { jar(jar: CookieJar): Request; pipe(dest: stream.Writable, opts?: any): stream.Writable; - write(): void; - end(chunk: string): void; - end(chunk: NodeBuffer): void; pause(): void; resume(): void; - abort(): void; destroy(): void; toJSON(): string; } From 19e6407072a93eea6adbe6548a575329b680ef38 Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Thu, 21 Aug 2014 21:09:38 +0900 Subject: [PATCH 038/537] modify exnteds interface --- request/request.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/request/request.d.ts b/request/request.d.ts index 5331fbd17..b204920a8 100644 --- a/request/request.d.ts +++ b/request/request.d.ts @@ -91,7 +91,7 @@ declare module 'request' { body: any; } - export interface Request extends http.ClientRequest { + export interface Request extends stream.Writable { getAgent(): http.Agent; //start(): void; //abort(): void; @@ -110,6 +110,7 @@ declare module 'request' { pipe(dest: stream.Writable, opts?: any): stream.Writable; pause(): void; resume(): void; + abort(): void; destroy(): void; toJSON(): string; } From 72bd7d59384da174d0f4d98ac575c306967a6b23 Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 21 Aug 2014 18:53:33 -0700 Subject: [PATCH 039/537] Added emit function to Dropzone See the docs for some [examples using emit](https://github.com/enyo/dropzone/wiki/FAQ#how-to-show-files-already-stored-on-server) I can't find any other usage so this covers the two events that I am aware of: `addedfile` and `thumbnail` --- dropzone/dropzone.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dropzone/dropzone.d.ts b/dropzone/dropzone.d.ts index 81596d88a..0c754fbd5 100644 --- a/dropzone/dropzone.d.ts +++ b/dropzone/dropzone.d.ts @@ -72,6 +72,8 @@ declare class Dropzone { getRejectedFiles(): DropzoneFile[]; getQueuedFiles(): DropzoneFile[]; getUploadingFiles(): DropzoneFile[]; + + emit(eventName: string, file: DropzoneFile, data?: string); } interface JQuery { From a38d60a3dd5d36a14f7d76f9d25f994b92595b77 Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Fri, 22 Aug 2014 12:37:27 +0900 Subject: [PATCH 040/537] add stream.Stream type --- node/node.d.ts | 4 ++++ request/request.d.ts | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index be3813ade..4140a8c4b 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1121,6 +1121,10 @@ declare module "crypto" { declare module "stream" { import events = require("events"); + export interface Stream extends events.EventEmitter { + pipe(destination: T, options?: { end?: boolean; }): T; + } + export interface ReadableOptions { highWaterMark?: number; encoding?: string; diff --git a/request/request.d.ts b/request/request.d.ts index b204920a8..fc03a7e19 100644 --- a/request/request.d.ts +++ b/request/request.d.ts @@ -91,7 +91,10 @@ declare module 'request' { body: any; } - export interface Request extends stream.Writable { + export interface Request extends stream.Stream { + readable: boolean; + writable: boolean; + getAgent(): http.Agent; //start(): void; //abort(): void; @@ -107,7 +110,14 @@ declare module 'request' { oauth(oauth: OAuthOptions): Request; jar(jar: CookieJar): Request; - pipe(dest: stream.Writable, opts?: any): stream.Writable; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding: string, cb?: Function): boolean; + write(str: string, encoding?: string, fd?: string): boolean; + end(): void; + end(chunk: Buffer, cb?: Function): void; + end(chunk: string, cb?: Function): void; + end(chunk: string, encoding: string, cb?: Function): void; pause(): void; resume(): void; abort(): void; From ee3b10e2b0ee836bd5679d1ffa5e86dc237067df Mon Sep 17 00:00:00 2001 From: Paulo Cesar Date: Fri, 22 Aug 2014 06:11:30 -0300 Subject: [PATCH 041/537] $id is a number on 1.3 --- angularjs/angular.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 34e2fe8bf..2f2c68bec 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -376,7 +376,7 @@ declare module ng { $root: IRootScopeService; this: IRootScopeService; - $id: string; + $id: number; // Hidden members $$isolateBindings: any; From de1c0be350cb8756df38cdfb39e746b0c3c67dea Mon Sep 17 00:00:00 2001 From: chriscamicas Date: Fri, 22 Aug 2014 11:36:02 +0200 Subject: [PATCH 042/537] Knockout 3.2 fix for ko.components According to the documentation ko.components is missing http://knockoutjs.com/documentation/component-registration.html --- knockout/knockout.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index b8db00e3c..a400ad0bf 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -544,6 +544,8 @@ interface KnockoutStatic { writeValue(element: HTMLElement, value: any): void; }; + + components: KnockoutComponents ; } interface KnockoutBindingProvider { From 6b2b14b81d71dea440a6b36ecf1ad2e69897c416 Mon Sep 17 00:00:00 2001 From: chriscamicas Date: Fri, 22 Aug 2014 11:37:42 +0200 Subject: [PATCH 043/537] remove trailing space --- knockout/knockout.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index a400ad0bf..d9e8cdac7 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -545,7 +545,7 @@ interface KnockoutStatic { writeValue(element: HTMLElement, value: any): void; }; - components: KnockoutComponents ; + components: KnockoutComponents; } interface KnockoutBindingProvider { From 1b247dd0c7223dbaa70d0f1cdacab0286d0481ec Mon Sep 17 00:00:00 2001 From: John Reilly Date: Fri, 22 Aug 2014 12:09:25 +0100 Subject: [PATCH 044/537] AngularJS: Genericised angular.copy and added JSDoc --- angularjs/angular-tests.ts | 31 +++++++++++++++++++++++++++++++ angularjs/angular.d.ts | 15 ++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts index 220a63dec..2e19760e8 100644 --- a/angularjs/angular-tests.ts +++ b/angularjs/angular-tests.ts @@ -569,3 +569,34 @@ angular.module('docsTabsExample', []) templateUrl: 'my-pane.html' }; }); + +interface copyExampleUser { + name?: string; + email?: string; + gender?: string; +} + +interface copyExampleScope { + + user: copyExampleUser; + master: copyExampleUser; + update: (copyExampleUser) => any; + reset: () => any; +} + +angular.module('copyExample', []) + .controller('ExampleController', ['$scope', function ($scope: copyExampleScope) { + $scope.master = { }; + + $scope.update = function (user) { + // Example with 1 argument + $scope.master = angular.copy(user); + }; + + $scope.reset = function () { + // Example with 2 arguments + angular.copy($scope.master, $scope.user); + }; + + $scope.reset(); + }]); \ No newline at end of file diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 2f2c68bec..0fc44d976 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -42,7 +42,20 @@ declare module ng { bootstrap(element: JQuery, modules?: any[]): auto.IInjectorService; bootstrap(element: Element, modules?: any[]): auto.IInjectorService; bootstrap(element: Document, modules?: any[]): auto.IInjectorService; - copy(source: any, destination?: any): any; + + /** + * Creates a deep copy of source, which should be an object or an array. + * + * - If no destination is supplied, a copy of the object or array is created. + * - If a destination is provided, all of its elements (for array) or properties (for objects) are deleted and then all elements/properties from the source are copied to it. + * - If source is not an object or array (inc. null and undefined), source is returned. + * - If source is identical to 'destination' an exception will be thrown. + * + * @param source The source that will be used to make a copy. Can be any type, including primitives, null, and undefined. + * @param destination Destination into which the source is copied. If provided, must be of the same type as source. + */ + copy(source: T, destination?: T): T; + element: IAugmentedJQueryStatic; equals(value1: any, value2: any): boolean; extend(destination: any, ...sources: any[]): any; From 639aa3c14d909e80315840b2015ce8eff341290a Mon Sep 17 00:00:00 2001 From: John Reilly Date: Fri, 22 Aug 2014 12:14:55 +0100 Subject: [PATCH 045/537] Made tests noImplicitAny compliant --- angularjs/angular-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts index 2e19760e8..0627f80be 100644 --- a/angularjs/angular-tests.ts +++ b/angularjs/angular-tests.ts @@ -580,7 +580,7 @@ interface copyExampleScope { user: copyExampleUser; master: copyExampleUser; - update: (copyExampleUser) => any; + update: (copyExampleUser: copyExampleUser) => any; reset: () => any; } From 042968c7351f7bc0ab69702c16d7fd5b6320bd7c Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Fri, 22 Aug 2014 20:19:14 +0900 Subject: [PATCH 046/537] add express-session type file --- express-session/express-session-tests.ts | 41 ++++++++++++++ express-session/express-session.d.ts | 71 ++++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 express-session/express-session-tests.ts create mode 100644 express-session/express-session.d.ts diff --git a/express-session/express-session-tests.ts b/express-session/express-session-tests.ts new file mode 100644 index 000000000..1e1f909b1 --- /dev/null +++ b/express-session/express-session-tests.ts @@ -0,0 +1,41 @@ +/// + +import express = require('express'); +import session = require('express-session'); + +var app = express(); + +app.use(session({ + secret: 'keyboard cat' +})); +app.use(session({ + secret: 'keyboard cat', + name: 'connect.sid', + store: new session.MemoryStore(), + cookie: { path: '/', httpOnly: true, secure: false, maxAge: null }, + genid: (req: express.Request): string => { return ''; }, + rolling: false, + resave: true, + proxy: true, + saveUninitialized: true, + unset: 'keep' +})); + + +interface MySession extends Express.Session { + views: number; +} +app.use(function(req, res, next) { + var sess = req.session; + if (sess.views) { + sess.views++ + res.setHeader('Content-Type', 'text/html') + res.write('

views: ' + sess.views + '

') + res.write('

expires in: ' + (sess.cookie.maxAge / 1000) + 's

') + res.end() + } else { + sess.views = 1 + res.end('welcome to the session demo. refresh!') + } +}); + diff --git a/express-session/express-session.d.ts b/express-session/express-session.d.ts new file mode 100644 index 000000000..672e3a1c2 --- /dev/null +++ b/express-session/express-session.d.ts @@ -0,0 +1,71 @@ +// Type definitions for express-session +// Project: https://www.npmjs.org/package/express-session +// Definitions by: Hiroki Horiuchi +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Express { + + export interface Request { + session?: Session; + } + + export interface Session { + regenerate: (callback: (err: any) => void) => void; + destroy: (callback: (err: any) => void) => void; + reload: (callback: (err: any) => void) => void; + save: (callback: (err: any) => void) => void; + touch: (callback: (err: any) => void) => void; + + cookie: SessionCookie; + } + export interface SessionCookie { + originalMaxAge: number; + path: string; + maxAge: number; + secure?: boolean; + httpOnly: boolean; + domain?: string; + expires: Date; + serialize: (name: string, value: string) => string; + } +} + +declare module "express-session" { + import express = require('express'); + + function session(options?: { + secret: string; + name?: string; + store?: session.Store; + cookie?: express.CookieOptions; + genid?: (req: express.Request) => string; + rolling?: boolean; + resave?: boolean; + proxy?: boolean; + saveUninitialized?: boolean; + unset?: string; + }): express.RequestHandler; + + module session { + export interface Store { + get: (sid: string, callback: (err: any, session: Express.Session) => void) => void; + set: (sid: string, session: Express.Session, callback: (err: any) => void) => void; + destroy: (sid: string, callback: (err: any) => void) => void; + length?: (callback: (err: any, length: number) => void) => void; + clear?: (callback: (err: any) => void) => void; + } + export class MemoryStore implements Store { + get: (sid: string, callback: (err: any, session: Express.Session) => void) => void; + set: (sid: string, session: Express.Session, callback: (err: any) => void) => void; + destroy: (sid: string, callback: (err: any) => void) => void; + all: (callback: (err: any, obj: { [sid: string]: Express.Session; }) => void) => void; + length: (callback: (err: any, length: number) => void) => void; + clear: (callback: (err: any) => void) => void; + } + } + + export = session; +} + From 432545c4d99dba86a5229bed0e500f66f43b1baa Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Fri, 22 Aug 2014 20:19:28 +0900 Subject: [PATCH 047/537] modify passport type file --- passport/passport-tests.ts | 3 +++ passport/passport.d.ts | 19 ++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/passport/passport-tests.ts b/passport/passport-tests.ts index 7542e2e0e..f579010a7 100644 --- a/passport/passport-tests.ts +++ b/passport/passport-tests.ts @@ -52,6 +52,9 @@ app.get('/logout', function(req, res) { res.redirect('/'); }); +app.post('/auth/token', passport.authenticate(['basic', 'oauth2-client-password'], { session: false })); + + function authSetting(): void { var authOption = { successRedirect: '/', diff --git a/passport/passport.d.ts b/passport/passport.d.ts index 977323140..6528c393d 100644 --- a/passport/passport.d.ts +++ b/passport/passport.d.ts @@ -7,7 +7,6 @@ declare module Express { export interface Request { - session?: any; authInfo?: any; // These declarations are merged into express's Request type @@ -36,7 +35,12 @@ declare module 'passport' { function authenticate(strategy: string, callback?: Function): express.Handler; function authenticate(strategy: string, options: Object, callback?: Function): express.Handler; - function authorize(strategy: string, options: Object, callback?: express.Handler): express.Handler; + function authenticate(strategies: string[], callback?: Function): express.Handler; + function authenticate(strategies: string[], options: Object, callback?: Function): express.Handler; + function authorize(strategy: string, callback?: Function): express.Handler; + function authorize(strategy: string, options: Object, callback?: Function): express.Handler; + function authorize(strategies: string[], callback?: Function): express.Handler; + function authorize(strategies: string[], options: Object, callback?: Function): express.Handler; function serializeUser(fn: (user: any, done: (err: any, id: any) => void) => void): void; function deserializeUser(fn: (id: any, done: (err: any, user: any) => void) => void): void; function transformAuthInfo(fn: (info: any, done: (err: any, info: any) => void) => void): void; @@ -49,9 +53,14 @@ declare module 'passport' { initialize(options?: { userProperty: string; }): express.Handler; session(options?: { pauseStream: boolean; }): express.Handler; - authenticate(strategy: string, callback2: (err: any, user: any, info: any) => void): express.Handler; - authenticate(strategy: string, options: Object, callback?: express.Handler): express.Handler; - authorize(strategy: string, options: Object, callback?: express.Handler): express.Handler; + authenticate(strategy: string, callback?: Function): express.Handler; + authenticate(strategy: string, options: Object, callback?: Function): express.Handler; + authenticate(strategies: string[], callback?: Function): express.Handler; + authenticate(strategies: string[], options: Object, callback?: Function): express.Handler; + authorize(strategy: string, callback?: Function): express.Handler; + authorize(strategy: string, options: Object, callback?: Function): express.Handler; + authorize(strategies: string[], callback?: Function): express.Handler; + authorize(strategies: string[], options: Object, callback?: Function): express.Handler; serializeUser(fn: (user: any, done: (err: any, id: any) => void) => void): void; deserializeUser(fn: (id: any, done: (err: any, user: any) => void) => void): void; transformAuthInfo(fn: (info: any, done: (err: any, info: any) => void) => void): void; From 2c47792b0c48d32266e58f680f46420ccf608c1f Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Fri, 22 Aug 2014 20:25:48 +0900 Subject: [PATCH 048/537] export SessionOptions interface --- express-session/express-session.d.ts | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/express-session/express-session.d.ts b/express-session/express-session.d.ts index 672e3a1c2..3f091289d 100644 --- a/express-session/express-session.d.ts +++ b/express-session/express-session.d.ts @@ -35,20 +35,22 @@ declare module Express { declare module "express-session" { import express = require('express'); - function session(options?: { - secret: string; - name?: string; - store?: session.Store; - cookie?: express.CookieOptions; - genid?: (req: express.Request) => string; - rolling?: boolean; - resave?: boolean; - proxy?: boolean; - saveUninitialized?: boolean; - unset?: string; - }): express.RequestHandler; + function session(options?: session.SessionOptions): express.RequestHandler; module session { + export interface SessionOptions { + secret: string; + name?: string; + store?: Store; + cookie?: express.CookieOptions; + genid?: (req: express.Request) => string; + rolling?: boolean; + resave?: boolean; + proxy?: boolean; + saveUninitialized?: boolean; + unset?: string; + } + export interface Store { get: (sid: string, callback: (err: any, session: Express.Session) => void) => void; set: (sid: string, session: Express.Session, callback: (err: any) => void) => void; From 17b7b270f56b37c1b2b9d1bb580915dd8c515527 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Fri, 22 Aug 2014 17:07:11 +0100 Subject: [PATCH 049/537] Tightened up the ILocationService typings a little --- angularjs/angular-tests.ts | 51 +++++++++++++++++++++++++++++- angularjs/angular.d.ts | 64 ++++++++++++++++++++++++++++++++------ 2 files changed, 105 insertions(+), 10 deletions(-) diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts index 0627f80be..4be1f536c 100644 --- a/angularjs/angular-tests.ts +++ b/angularjs/angular-tests.ts @@ -599,4 +599,53 @@ angular.module('copyExample', []) }; $scope.reset(); - }]); \ No newline at end of file + }]); + +module locationTests { + + var $location: ng.ILocationService; + + /* + * From https://docs.angularjs.org/api/ng/service/$location + */ + + // given url http://example.com/#/some/path?foo=bar&baz=xoxo + var searchObject = $location.search(); + // => {foo: 'bar', baz: 'xoxo'} + + + // set foo to 'yipee' + $location.search('foo', 'yipee'); + // => $location + + /* + * From: https://docs.angularjs.org/guide/$location + */ + + // in browser with HTML5 history support: + // open http://example.com/#!/a -> rewrite to http://example.com/a + // (replacing the http://example.com/#!/a history record) + $location.path() == '/a' + + $location.path('/foo'); + $location.absUrl() == 'http://example.com/foo' + + $location.search() == {} + $location.search({ a: 'b', c: true }); + $location.absUrl() == 'http://example.com/foo?a=b&c' + + $location.path('/new').search('x=y'); + $location.url() == 'new?x=y' + $location.absUrl() == 'http://example.com/new?x=y' + + // in browser without html5 history support: + // open http://example.com/new?x=y -> redirect to http://example.com/#!/new?x=y + // (again replacing the http://example.com/new?x=y history item) + $location.path() == '/new' + $location.search() == { x: 'y' } + + $location.path('/foo/bar'); + $location.path() == '/foo/bar' + $location.url() == '/foo/bar?x=y' + $location.absUrl() == 'http://example.com/#!/foo/bar?x=y' +} \ No newline at end of file diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 0fc44d976..b682fca84 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -557,25 +557,71 @@ declare module ng { assign(context: any, value: any): any; } - /////////////////////////////////////////////////////////////////////////// - // LocationService - // see http://docs.angularjs.org/api/ng.$location - // see http://docs.angularjs.org/api/ng.$locationProvider - // see http://docs.angularjs.org/guide/dev_guide.services.$location - /////////////////////////////////////////////////////////////////////////// + /** + * $location - $locationProvider - service in module ng + * see https://docs.angularjs.org/api/ng/service/$location + */ interface ILocationService { absUrl(): string; hash(): string; hash(newHash: string): ILocationService; host(): string; + + /** + * Return path of current url + */ path(): string; - path(newPath: string): ILocationService; + + /** + * Change path when called with parameter and return $location. + * Note: Path should always begin with forward slash (/), this method will add the forward slash if it is missing. + * + * @param path New path + */ + path(path: string): ILocationService; + port(): number; protocol(): string; replace(): ILocationService; + + /** + * Return search part (as object) of current url + */ search(): any; - search(parametersMap: any): ILocationService; - search(parameter: string, parameterValue: any): ILocationService; + + /** + * Change search part when called with parameter and return $location. + * + * @param search When called with a single argument the method acts as a setter, setting the search component of $location to the specified value. + * + * If the argument is a hash object containing an array of values, these values will be encoded as duplicate search parameters in the url. + */ + search(search: any): ILocationService; + + /** + * Change search part when called with parameter and return $location. + * + * @param search New search params + * @param paramValue If search is a string, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted. + */ + search(search: string, paramValue: string): ILocationService; + + /** + * Change search part when called with parameter and return $location. + * + * @param search New search params + * @param paramValue If paramValue is an array, it will override the property of the search component of $location specified via the first argument. + */ + search(search: string, paramValue: string[]): ILocationService; + + /** + * Change search part when called with parameter and return $location. + * + * @param search New search params + * @param paramValue If paramValue is true, the property specified via the first argument will be added with no value nor trailing equal sign. + */ + search(search: string, paramValue: boolean): ILocationService; + url(): string; url(url: string): ILocationService; } From 039152e617b8b254dbc151f76a584e871caad90c Mon Sep 17 00:00:00 2001 From: Daniel Mane Date: Fri, 22 Aug 2014 21:16:48 -0700 Subject: [PATCH 050/537] Implement generic typing for D3.Map and D3.Set --- d3/d3.d.ts | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 26577be0e..f4ef9f3ba 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -538,8 +538,10 @@ declare module D3 { functor(value: (p : R) => T): (p : R) => T; functor(value: T): (p : any) => T; - map(object?: any): Map; - set(array?: Array): Set; + map(): Map; + set(): Set; + map(object: {[key: string]: T; }): Map; + set(array: T[]): Set; dispatch(...types: Array): Dispatch; rebind(target: any, source: any, ...names: Array): any; requote(str: string): string; @@ -839,25 +841,25 @@ declare module D3 { entries(values: any[]): NestKeyValue[]; } - export interface Map { + export interface Map { has(key: string): boolean; - get(key: string): any; - set(key: string, value: T): T; + get(key: string): T; + set(key: string, value: T): T; remove(key: string): boolean; - keys(): Array; - values(): Array; - entries(): Array; - forEach(func: (key: string, value: any) => void ): void; + keys(): string[]; + values(): T[]; + entries(): any[][]; // Actually of form [key: string, val: T][], but this is inexpressible in Typescript + forEach(func: (key: string, value: T) => void ): void; empty(): boolean; size(): number; } - export interface Set { - has(value: any): boolean; - add(value: T): T; - remove(value: any): boolean; - values(): Array; - forEach(func: (value: any) => void ): void; + export interface Set { + has(value: T): boolean; + add(value: T): T; + remove(value: T): boolean; + values(): string[]; + forEach(func: (value: string) => void ): void; empty(): boolean; size(): number; } @@ -1237,7 +1239,7 @@ declare module D3 { source: GraphNode; target: GraphNode; } - + export interface GraphNodeForce { index?: number; x?: number; @@ -3370,5 +3372,5 @@ declare module D3 { declare var d3: D3.Base; declare module "d3" { - export = d3; + export = d3; } From aa05ededeeaf5595f7fa050f0cc76fedba9226e9 Mon Sep 17 00:00:00 2001 From: jonathantyates Date: Sat, 23 Aug 2014 00:42:29 -0400 Subject: [PATCH 051/537] Update restangular.d.ts Added service method from https://github.com/mgonto/restangular#decoupled-restangular-service --- restangular/restangular.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/restangular/restangular.d.ts b/restangular/restangular.d.ts index 9fd397bf5..a1a7e8a5e 100644 --- a/restangular/restangular.d.ts +++ b/restangular/restangular.d.ts @@ -93,6 +93,7 @@ declare module restangular { withConfig(configurer: (RestangularProvider: IProvider) => any): IService; restangularizeElement(parent: any, element: any, route: string, collection?: any, reqParams?: any): IElement; restangularizeCollection(parent: any, element: any, route: string): ICollection; + service(route: string, parent: any): IService; stripRestangular(element: any): any; } From bb52146cfb2f0d7375b6c0ab1bcbea838d897863 Mon Sep 17 00:00:00 2001 From: Daniel Mane Date: Fri, 22 Aug 2014 22:29:16 -0700 Subject: [PATCH 052/537] [refactor] Switch from Array notation to type[] syntactic sugar. This is more idiomatic. Exactly the same semantics as before, per section 3.6.4 of the Typescript Lang Specification --- d3/d3.d.ts | 230 ++++++++++++++++++++++++++--------------------------- 1 file changed, 115 insertions(+), 115 deletions(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index f4ef9f3ba..a451a0de5 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -417,7 +417,7 @@ declare module D3 { /* * The array of built-in interpolator factories */ - interpolators: Array; + interpolators: Transition.InterpolateFactory[]; /** * Layouts */ @@ -525,11 +525,11 @@ declare module D3 { /** * gets the mouse position relative to a specified container. */ - mouse(container: any): Array; + mouse(container: any): number[]; /** * gets the touch positions relative to a specified container. */ - touches(container: any): Array>; + touches(container: any): number[][]; /** * If the specified value is a function, returns the specified value. @@ -542,8 +542,8 @@ declare module D3 { set(): Set; map(object: {[key: string]: T; }): Map; set(array: T[]): Set; - dispatch(...types: Array): Dispatch; - rebind(target: any, source: any, ...names: Array): any; + dispatch(...types: string[]): Dispatch; + rebind(target: any, source: any, ...names: any[]): any; requote(str: string): string; timer: { (funct: () => boolean, delay?: number, mark?: number): void; @@ -1134,11 +1134,11 @@ declare module D3 { /** * Runs the tree layout */ - nodes(root: GraphNode): Array; + nodes(root: GraphNode): GraphNode[]; /** * Given the specified array of nodes, such as those returned by nodes, returns an array of objects representing the links from parent to child for each node */ - links(nodes: Array): Array; + links(nodes: GraphNode[]): GraphLink[]; /** * If separation is specified, uses the specified function to compute separation between neighboring nodes. If separation is not specified, returns the current separation function */ @@ -1159,11 +1159,11 @@ declare module D3 { /** * Gets the available layout size */ - (): Array; + (): number[]; /** * Sets the available layout size */ - (size: Array): TreeLayout; + (size: number[]): TreeLayout; }; /** * Gets or sets the available node size @@ -1172,11 +1172,11 @@ declare module D3 { /** * Gets the available node size */ - (): Array; + (): number[]; /** * Sets the available node size */ - (size: Array): TreeLayout; + (size: number[]): TreeLayout; }; } @@ -1323,13 +1323,13 @@ declare module D3 { } export interface BundleLayout{ - (links: Array): Array>; + (links: GraphLink[]): GraphNode[][]; } export interface ChordLayout { matrix: { - (): Array>; - (matrix: Array>): ChordLayout; + (): number[][]; + (matrix: number[][]): ChordLayout; } padding: { (): number; @@ -1347,8 +1347,8 @@ declare module D3 { (): (a: number, b: number) => number; (comparator: (a: number, b: number) => number): ChordLayout; } - chords(): Array; - groups(): Array; + chords(): GraphLink[]; + groups(): ArcDescriptor[]; } export interface ClusterLayout{ @@ -1357,18 +1357,18 @@ declare module D3 { (comparator: (a: GraphNode, b: GraphNode) => number): ClusterLayout; } children: { - (): (d: any, i?: number) => Array; - (children: (d: any, i?: number) => Array): ClusterLayout; + (): (d: any, i?: number) => GraphNode[]; + (children: (d: any, i?: number) => GraphNode[]): ClusterLayout; } - nodes(root: GraphNode): Array; - links(nodes: Array): Array; + nodes(root: GraphNode): GraphNode[]; + links(nodes: GraphNode[]): GraphLink[]; seperation: { (): (a: GraphNode, b: GraphNode) => number; (seperation: (a: GraphNode, b: GraphNode) => number): ClusterLayout; } size: { - (): Array; - (size: Array): ClusterLayout; + (): number[]; + (size: number[]): ClusterLayout; } value: { (): (node: GraphNode) => number; @@ -1382,11 +1382,11 @@ declare module D3 { (comparator: (a: GraphNode, b: GraphNode) => number): HierarchyLayout; } children: { - (): (d: any, i?: number) => Array; - (children: (d: any, i?: number) => Array): HierarchyLayout; + (): (d: any, i?: number) => GraphNode[]; + (children: (d: any, i?: number) => GraphNode[]): HierarchyLayout; } - nodes(root: GraphNode): Array; - links(nodes: Array): Array; + nodes(root: GraphNode): GraphNode[]; + links(nodes: GraphNode[]): GraphLink[]; value: { (): (node: GraphNode) => number; (value: (node: GraphNode) => number): HierarchyLayout; @@ -1401,21 +1401,21 @@ declare module D3 { } export interface HistogramLayout { - (values: Array, index?: number): Array; + (values: any[], index?: number): Bin[]; value: { (): (value: any) => any; (accessor: (value: any) => any): HistogramLayout } range: { - (): (value: any, index: number) => Array; - (range: (value: any, index: number) => Array): HistogramLayout; - (range: Array): HistogramLayout; + (): (value: any, index: number) => number[]; + (range: (value: any, index: number) => number[]): HistogramLayout; + (range: number[]): HistogramLayout; } bins: { - (): (range: Array, index: number) => Array; - (bins: (range: Array, index: number) => Array): HistogramLayout; + (): (range: any[], index: number) => number[]; + (bins: (range: any[], index: number) => number[]): HistogramLayout; (bins: number): HistogramLayout; - (bins: Array): HistogramLayout; + (bins: number[]): HistogramLayout; } frequency: { (): boolean; @@ -1429,18 +1429,18 @@ declare module D3 { (comparator: (a: GraphNode, b: GraphNode) => number): PackLayout; } children: { - (): (d: any, i?: number) => Array; - (children: (d: any, i?: number) => Array): PackLayout; + (): (d: any, i?: number) => GraphNode[]; + (children: (d: any, i?: number) => GraphNode[]): PackLayout; } - nodes(root: GraphNode): Array; - links(nodes: Array): Array; + nodes(root: GraphNode): GraphNode[]; + links(nodes: GraphNode[]): GraphLink[]; value: { (): (node: GraphNode) => number; (value: (node: GraphNode) => number): PackLayout; } size: { - (): Array; - (size: Array): PackLayout; + (): number[]; + (size: number[]): PackLayout; } padding: { (): number; @@ -1454,18 +1454,18 @@ declare module D3 { (comparator: (a: GraphNode, b: GraphNode) => number): PackLayout; } children: { - (): (d: any, i?: number) => Array; - (children: (d: any, i?: number) => Array): PackLayout; + (): (d: any, i?: number) => GraphNode[]; + (children: (d: any, i?: number) => GraphNode[]): PackLayout; } - nodes(root: GraphNode): Array; - links(nodes: Array): Array; + nodes(root: GraphNode): GraphNode[]; + links(nodes: GraphNode[]): GraphLink[]; value: { (): (node: GraphNode) => number; (value: (node: GraphNode) => number): PackLayout; } size: { - (): Array; - (size: Array): PackLayout; + (): number[]; + (size: number[]): PackLayout; } } @@ -1475,18 +1475,18 @@ declare module D3 { (comparator: (a: GraphNode, b: GraphNode) => number): TreeMapLayout; } children: { - (): (d: any, i?: number) => Array; - (children: (d: any, i?: number) => Array): TreeMapLayout; + (): (d: any, i?: number) => GraphNode[]; + (children: (d: any, i?: number) => GraphNode[]): TreeMapLayout; } - nodes(root: GraphNode): Array; - links(nodes: Array): Array; + nodes(root: GraphNode): GraphNode[]; + links(nodes: GraphNode[]): GraphLink[]; value: { (): (node: GraphNode) => number; (value: (node: GraphNode) => number): TreeMapLayout; } size: { - (): Array; - (size: Array): TreeMapLayout; + (): number[]; + (size: number[]): TreeMapLayout; } padding: { (): number; @@ -1648,7 +1648,7 @@ declare module D3 { /** * The array of supported symbol types. */ - symbolTypes: Array; + symbolTypes: string[]; } export interface Symbol { @@ -2463,9 +2463,9 @@ declare module D3 { export interface Diagonal { (datum: any, index?: number): string; projection: { - (): (datum: any, index?: number) => Array; - (proj: (datum: any) => Array): Diagonal; - (proj: (datum: any, index: number) => Array): Diagonal; + (): (datum: any, index?: number) => number[]; + (proj: (datum: any) => number[]): Diagonal; + (proj: (datum: any, index: number) => number[]): Diagonal; }; source: { (): (datum: any, index?: number) => any; @@ -2842,19 +2842,19 @@ declare module D3 { /** * compute the latitude-longitude bounding box for a given feature. */ - bounds(feature: any): Array>; + bounds(feature: any): number[][]; /** * compute the spherical centroid of a given feature. */ - centroid(feature: any): Array; + centroid(feature: any): number[]; /** * compute the great-arc distance between two points. */ - distance(a: Array, b: Array): number; + distance(a: number[], b: number[]): number; /** * interpolate between two points along a great arc. */ - interpolate(a: Array, b: Array): (t: number) => Array; + interpolate(a: number[], b: number[]): (t: number) => number[]; /** * compute the length of a line string or the circumference of a polygon. */ @@ -2967,7 +2967,7 @@ declare module D3 { /** * */ - rotation(rotation: Array): Rotation; + rotation(rotation: number[]): Rotation; } export interface Path { @@ -3041,11 +3041,11 @@ declare module D3 { } export interface Circle { - (...args: Array): GeoJSON; + (...args: any[]): GeoJSON; origin: { - (): Array; - (origin: Array): Circle; - (origin: (...args: Array) => Array): Circle; + (): number[]; + (origin: number[]): Circle; + (origin: (...args: any[]) => number[]): Circle; } angle: { (): number; @@ -3059,31 +3059,31 @@ declare module D3 { export interface Graticule{ (): GeoJSON; - lines(): Array; + lines(): GeoJSON[]; outline(): GeoJSON; extent: { - (): Array>; - (extent: Array>): Graticule; + (): number[][]; + (extent: number[][]): Graticule; } minorExtent: { - (): Array>; - (extent: Array>): Graticule; + (): number[][]; + (extent: number[][]): Graticule; } majorExtent: { - (): Array>; - (extent: Array>): Graticule; + (): number[][]; + (extent: number[][]): Graticule; } step: { - (): Array>; - (extent: Array>): Graticule; + (): number[][]; + (extent: number[][]): Graticule; } minorStep: { - (): Array>; - (extent: Array>): Graticule; + (): number[][]; + (extent: number[][]): Graticule; } majorStep: { - (): Array>; - (extent: Array>): Graticule; + (): number[][]; + (extent: number[][]): Graticule; } precision: { (): number; @@ -3109,33 +3109,33 @@ declare module D3 { } export interface GeoJSON { - coordinates: Array>; + coordinates: number[][]; type: string; } export interface RawProjection { - (lambda: number, phi: number): Array; - invert?(x: number, y: number): Array; + (lambda: number, phi: number): number[]; + invert?(x: number, y: number): number[]; } export interface Projection { - (coordinates: Array): Array; - invert?(point: Array): Array; + (coordinates: number[]): number[]; + invert?(point: number[]): number[]; rotate: { - (): Array; - (rotation: Array): Projection; + (): number[]; + (rotation: number[]): Projection; }; center: { - (): Array; - (location: Array): Projection; + (): number[]; + (location: number[]): Projection; }; parallels: { - (): Array; - (location: Array): Projection; + (): number[]; + (location: number[]): Projection; }; translate: { - (): Array; - (point: Array): Projection; + (): number[]; + (point: number[]): Projection; }; scale: { (): number; @@ -3146,8 +3146,8 @@ declare module D3 { (angle: number): Projection; }; clipExtent: { - (): Array>; - (extent: Array>): Projection; + (): number[][]; + (extent: number[][]): Projection; }; precision: { (): number; @@ -3166,8 +3166,8 @@ declare module D3 { } export interface Rotation extends Array { - (location: Array): Rotation; - invert(location: Array): Rotation; + (location: number[]): Rotation; + invert(location: number[]): Rotation; } export interface ProjectionMutator { @@ -3182,11 +3182,11 @@ declare module D3 { /** * compute the Voronoi diagram for the specified points. */ - voronoi(vertices: Array): Array; + voronoi(vertices: Vertice[]): Polygon[]; /** * compute the Delaunay triangulation for the specified points. */ - delaunay(vertices?: Array): Array; + delaunay(vertices?: Vertice[]): Polygon[]; /** * constructs a quadtree for an array of points. */ @@ -3194,21 +3194,21 @@ declare module D3 { /** * Constructs a new quadtree for the specified array of points. */ - quadtree(points: Array, x1: number, y1: number, x2: number, y2: number): Quadtree; + quadtree(points: Point[], x1: number, y1: number, x2: number, y2: number): Quadtree; /** * Constructs a new quadtree for the specified array of points. */ - quadtree(points: Array, width: number, height: number): Quadtree; + quadtree(points: Point[], width: number, height: number): Quadtree; /** * Returns the input array of vertices with additional methods attached */ - polygon(vertices:Array): Polygon; + polygon(vertices:Vertice[]): Polygon; /** * creates a new hull layout with the default settings. */ hull(): Hull; - hull(vertices:Array): Array; + hull(vertices:Vertice[]): Vertice[]; } export interface Vertice extends Array { @@ -3226,7 +3226,7 @@ declare module D3 { /** * Returns a two-element array representing the centroid of this polygon. */ - centroid(): Array; + centroid(): number[]; /** * Clips the subject polygon against this polygon */ @@ -3241,11 +3241,11 @@ declare module D3 { /** * Constructs a new quadtree for the specified array of points. */ - (points: Array, x1: number, y1: number, x2: number, y2: number): Quadtree; + (points: Point[], x1: number, y1: number, x2: number, y2: number): Quadtree; /** * Constructs a new quadtree for the specified array of points. */ - (points: Array, width: number, height: number): Quadtree; + (points: Point[], width: number, height: number): Quadtree; x: { (): (d: any) => any; @@ -3257,10 +3257,10 @@ declare module D3 { (accesor: (d: any) => any): QuadtreeFactory; } - size(): Array; - size(size: Array): QuadtreeFactory; - extent(): Array>; - extent(points: Array>): QuadtreeFactory; + size(): number[]; + size(size: number[]): QuadtreeFactory; + extent(): number[][]; + extent(points: number[][]): QuadtreeFactory; } export interface Quadtree { @@ -3280,15 +3280,15 @@ declare module D3 { /** * Compute the Voronoi diagram for the specified data. */ - (data: Array): Array; + (data: T[]): Polygon[]; /** * Compute the graph links for the Voronoi diagram for the specified data. */ - links(data: Array): Array; + links(data: T[]): Layout.GraphLink[]; /** * Compute the triangles for the Voronoi diagram for the specified data. */ - triangles(data: Array): Array>; + triangles(data: T[]): number[][]; x: { /** * Get the x-coordinate accessor. @@ -3333,30 +3333,30 @@ declare module D3 { /** * Get the clip extent. */ - (): Array>; + (): number[][]; /** * Set the clip extent. * * @param extent The new clip extent. */ - (extent: Array>): Voronoi; + (extent: number[][]): Voronoi; } size: { /** * Get the size. */ - (): Array; + (): number[]; /** * Set the size, equivalent to a clip extent starting from (0,0). * * @param size The new size. */ - (size: Array): Voronoi; + (size: number[]): Voronoi; } } export interface Hull { - (vertices: Array): Array; + (vertices: Vertice[]): Vertice[]; x: { (): (d: any) => any; (accesor: (d: any) => any): any; From d9aaf6bd95900a6e1083190cdab3f2e2ef069df6 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 23 Aug 2014 15:05:38 +0900 Subject: [PATCH 053/537] resolve duplicate for #2676 --- express/express.d.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/express/express.d.ts b/express/express.d.ts index 7f12a9f81..d5d48308f 100644 --- a/express/express.d.ts +++ b/express/express.d.ts @@ -3,7 +3,7 @@ // Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped -/* =================== USAGE =================== +/* =================== USAGE =================== import express = require('express'); var app = express(); @@ -522,11 +522,6 @@ declare module "express" { /** * deprecated, use sendFile instead. */ - sendFile(path: string): void; - sendFile(path: string, options: any): void; - sendFile(path: string, fn: Errback): void; - sendFile(path: string, options: any, fn: Errback): void; - sendfile(path: string): void; /** * deprecated, use sendFile instead. @@ -1073,4 +1068,3 @@ declare module "express" { export = e; } - From 95a310df643f240a5ad1ce7abb39625b9e57a993 Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Sat, 23 Aug 2014 23:23:49 +0900 Subject: [PATCH 054/537] modify unittest error --- passport/passport-tests.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/passport/passport-tests.ts b/passport/passport-tests.ts index f579010a7..423d925b4 100644 --- a/passport/passport-tests.ts +++ b/passport/passport-tests.ts @@ -1,5 +1,6 @@ /// /// +/// import express = require('express'); import passport = require('passport'); @@ -37,7 +38,7 @@ app.post('/login', function(req, res, next) { passport.authenticate('local', function(err: any, user: { username: string; }, info: { message: string; }) { if (err) { return next(err) } if (!user) { - req.session.error = info.message; + req.session['error'] = info.message; return res.redirect('/login') } req.logIn(user, function(err) { From da2bb07e037a61e6ead149ae89063b00892f6929 Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Sun, 24 Aug 2014 00:11:05 +0900 Subject: [PATCH 055/537] modify unit test --- express-session/express-session.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/express-session/express-session.d.ts b/express-session/express-session.d.ts index 3f091289d..5e32e3b7e 100644 --- a/express-session/express-session.d.ts +++ b/express-session/express-session.d.ts @@ -12,6 +12,8 @@ declare module Express { } export interface Session { + [key: string]: any; + regenerate: (callback: (err: any) => void) => void; destroy: (callback: (err: any) => void) => void; reload: (callback: (err: any) => void) => void; From 21a0b97dd79c83f8797895f3bf26bfafed76a5bc Mon Sep 17 00:00:00 2001 From: Adrien Bustany Date: Sat, 23 Aug 2014 22:56:47 +0200 Subject: [PATCH 056/537] Leaflet: Allow using as an AMD module --- leaflet/leaflet.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index a1276cbe9..f094f4734 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -4173,3 +4173,6 @@ declare var L_NO_TOUCH: boolean; */ declare var L_DISABLE_3D: boolean; +declare module "leaflet" { + export = L; +} From 215537df6712aed82c4ba6e1a59e7a0c6bf83a2f Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Sun, 24 Aug 2014 22:12:05 +0900 Subject: [PATCH 057/537] append contributors for express-session --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 99864cf67..c327952ab 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -79,6 +79,7 @@ All definitions files include a header with the author and editors, so at some p * [expect.js](https://github.com/LearnBoost/expect.js) (by [Teppei Sato](https://github.com/teppeis)) * [expectations](https://github.com/spmason/expectations) (by [vvakame](https://github.com/vvakame)) * [Express](http://expressjs.com/) (by [Boris Yankov](https://github.com/borisyankov)) +* [express-session](https://www.npmjs.org/package/express-session) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) * [Ext JS](http://www.sencha.com/products/extjs/) (by [Brian Kotek](https://github.com/brian428)) * [Fabric.js](http://fabricjs.com/) (by [Oliver Klemencic](https://github.com/oklemencic/)) * [Fancybox](http://fancybox.net/) (by [Boris Yankov](https://github.com/borisyankov)) From 28428d34bee80c815d226353664a62d97b56ffe0 Mon Sep 17 00:00:00 2001 From: satoru kimura Date: Fri, 22 Aug 2014 14:02:08 +0900 Subject: [PATCH 058/537] Rearranged the order of the methods and properties in this definition, to be consistent with the original JS code. --- threejs/three.d.ts | 1945 ++++++++++++++++++++++++-------------------- 1 file changed, 1041 insertions(+), 904 deletions(-) diff --git a/threejs/three.d.ts b/threejs/three.d.ts index 2eb17c19b..fa6208990 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -8,33 +8,7 @@ interface WebGLRenderingContext {} declare module THREE { export var REVISION: string; - // custom blending equations - // (numbers start from 100 not to clash with other - // mappings to OpenGL constants defined in Texture.js) - export enum BlendingEquation { } - export var AddEquation: BlendingEquation; - export var SubtractEquation: BlendingEquation; - export var ReverseSubtractEquation: BlendingEquation; - - // custom blending destination factors - export enum BlendingDstFactor { } - export var ZeroFactor: BlendingDstFactor; - export var OneFactor: BlendingDstFactor; - export var SrcColorFactor: BlendingDstFactor; - export var OneMinusSrcColorFactor: BlendingDstFactor; - export var SrcAlphaFactor: BlendingDstFactor; - export var OneMinusSrcAlphaFactor: BlendingDstFactor; - export var DstAlphaFactor: BlendingDstFactor; - export var OneMinusDstAlphaFactor: BlendingDstFactor; - - // custom blending source factors - export enum BlendingSrcFactor { } - export var DstColorFactor: BlendingSrcFactor; - export var OneMinusDstColorFactor: BlendingSrcFactor; - export var SrcAlphaSaturateFactor: BlendingSrcFactor; - // GL STATE CONSTANTS - export enum CullFace { } export var CullFaceNone: CullFace; export var CullFaceBack: CullFace; @@ -45,6 +19,12 @@ declare module THREE { export var FrontFaceDirectionCW: FrontFaceDirection; export var FrontFaceDirectionCCW: FrontFaceDirection; + // Shadowing Type + export enum ShadowMapType { } + export var BasicShadowMap: ShadowMapType; + export var PCFShadowMap: ShadowMapType; + export var PCFSoftShadowMap: ShadowMapType; + // MATERIAL CONSTANTS // side @@ -74,11 +54,30 @@ declare module THREE { export var MultiplyBlending: Blending; export var CustomBlending: Blending; - // Shadowing Type - export enum ShadowMapType { } - export var BasicShadowMap: ShadowMapType; - export var PCFShadowMap: ShadowMapType; - export var PCFSoftShadowMap: ShadowMapType; + // custom blending equations + // (numbers start from 100 not to clash with other + // mappings to OpenGL constants defined in Texture.js) + export enum BlendingEquation { } + export var AddEquation: BlendingEquation; + export var SubtractEquation: BlendingEquation; + export var ReverseSubtractEquation: BlendingEquation; + + // custom blending destination factors + export enum BlendingDstFactor { } + export var ZeroFactor: BlendingDstFactor; + export var OneFactor: BlendingDstFactor; + export var SrcColorFactor: BlendingDstFactor; + export var OneMinusSrcColorFactor: BlendingDstFactor; + export var SrcAlphaFactor: BlendingDstFactor; + export var OneMinusSrcAlphaFactor: BlendingDstFactor; + export var DstAlphaFactor: BlendingDstFactor; + export var OneMinusDstAlphaFactor: BlendingDstFactor; + + // custom blending src factors + export enum BlendingSrcFactor { } + export var DstColorFactor: BlendingSrcFactor; + export var OneMinusDstColorFactor: BlendingSrcFactor; + export var SrcAlphaSaturateFactor: BlendingSrcFactor; // TEXTURE CONSTANTS // Operations @@ -94,9 +93,7 @@ declare module THREE { } export var UVMapping: MappingConstructor; export var CubeReflectionMapping: MappingConstructor; - export var CubeRefractionMapping: MappingConstructor; export var SphericalReflectionMapping: MappingConstructor; - export var SphericalRefractionMapping: MappingConstructor; // Wrapping modes export enum Wrapping { } @@ -125,7 +122,6 @@ declare module THREE { // Pixel types export enum PixelType { } - export var UnsignedShort4444Type: PixelType; export var UnsignedShort5551Type: PixelType; export var UnsignedShort565Type: PixelType; @@ -145,6 +141,7 @@ declare module THREE { export var RGBA_S3TC_DXT3_Format: CompressedPixelFormat; export var RGBA_S3TC_DXT5_Format: CompressedPixelFormat; + // Cameras //////////////////////////////////////////////////////////////////////////////////////// /** @@ -171,6 +168,7 @@ declare module THREE { * @param vector point to look at */ lookAt(vector: Vector3): void; + clone(camera?: Camera): Camera; } @@ -335,9 +333,9 @@ declare module THREE { // Core /////////////////////////////////////////////////////////////////////////////////////////////// export class BufferAttribute { - constructor(array: any, itemSize: number); + constructor(array: any, itemSize: number); // array parameter should be TypedArray. - array: any; + array: number[]; itemSize: number; length: number; @@ -352,47 +350,47 @@ declare module THREE { // deprecated export class Int8Attribute extends BufferAttribute{ - constructor(data: any[], itemSize: number); + constructor(data: any, itemSize: number); } // deprecated export class Uint8Attribute extends BufferAttribute { - constructor(data: any[], itemSize: number); + constructor(data: any, itemSize: number); } // deprecated export class Uint8ClampedAttribute extends BufferAttribute { - constructor(data: any[], itemSize: number); + constructor(data: any, itemSize: number); } // deprecated export class Int16Attribute extends BufferAttribute { - constructor(data: any[], itemSize: number); + constructor(data: any, itemSize: number); } // deprecated export class Uint16Attribute extends BufferAttribute { - constructor(data: any[], itemSize: number); + constructor(data: any, itemSize: number); } // deprecated export class Int32Attribute extends BufferAttribute { - constructor(data: any[], itemSize: number); + constructor(data: any, itemSize: number); } // deprecated export class Uint32Attribute extends BufferAttribute { - constructor(data: any[], itemSize: number); + constructor(data: any, itemSize: number); } // deprecated export class Float32Attribute extends BufferAttribute { - constructor(data: any[], itemSize: number); + constructor(data: any, itemSize: number); } // deprecated export class Float64Attribute extends BufferAttribute { - constructor(data: any[], itemSize: number); + constructor(data: any, itemSize: number); } /** @@ -412,7 +410,6 @@ declare module THREE { * Unique number of this buffergeometry instance */ id: number; - uuid: string; name: string; attributes: BufferAttribute[]; @@ -445,6 +442,9 @@ declare module THREE { */ computeBoundingSphere(): void; + // deprecated + computeFaceNormals(): void; + /** * Computes vertex normals by averaging face normals. */ @@ -635,23 +635,21 @@ declare module THREE { */ c: number; - // properties inherits from Face /////////////////////////////////// - /** * Face normal. */ normal: Vector3; - /** - * Face color. - */ - color: Color; - /** * Array of 4 vertex normals. */ vertexNormals: Vector3[]; + /** + * Face color. + */ + color: Color; + /** * Array of 4 vertex normals. */ @@ -716,6 +714,8 @@ declare module THREE { */ id: number; + uuid: string; + /** * Name for this geometry. Default is an empty string. */ @@ -735,13 +735,6 @@ declare module THREE { */ colors: Color[]; - /** - * Array of vertex normals, matching number and order of vertices. - * Normal vectors are nessecary for lighting - * To signal an update in this array, Geometry.normalsNeedUpdate needs to be set to true. - */ -// normals: Vector3[]; - /** * Array of triangles or/and quads. * The array of faces describe how each vertex in the model is connected with each other. @@ -749,13 +742,6 @@ declare module THREE { */ faces: Face3[]; - /** - * Array of face UV layers. - * Each UV layer is an array of UV matching order and number of faces. - * To signal an update in this array, Geometry.uvsNeedUpdate needs to be set to true. - */ -// faceUvs: Vector2[][]; - /** * Array of face UV layers. * Each UV layer is an array of UV matching order and number of vertices in faces. @@ -901,6 +887,8 @@ declare module THREE { */ computeTangents(): void; + computeLineDistances(): void; + /** * Computes bounding box of the geometry, updating {@link Geometry.boundingBox} attribute. */ @@ -920,6 +908,8 @@ declare module THREE { */ mergeVertices(): number; + makeGroups(usesFaceMaterial: boolean, maxVerticesInGroup: number): void; + /** * Creates a new clone of the Geometry. */ @@ -931,10 +921,6 @@ declare module THREE { */ dispose(): void; - computeLineDistances(): void; - - makeGroups(usesFaceMaterial: boolean, maxVerticesInGroup: number): void; - // EventDispatcher mixins addEventListener(type: string, listener: (event: any) => void ): void; @@ -1063,8 +1049,9 @@ declare module THREE { /** * Order of axis for Euler angles. */ + // deprecated eulerOrder: string; - // eulerOrder:EulerOrder; + /** * This updates the position, rotation and scale with the matrix. @@ -1091,6 +1078,13 @@ declare module THREE { */ setRotationFromQuaternion( q: Quaternion ): void; + /** + * Rotate an object along an axis in object space. The axis is assumed to be normalized. + * @param axis A normalized vector in object space. + * @param angle The angle in radians. + */ + rotateOnAxis(axis: Vector3, angle: number): Object3D; + /** * * @param angle @@ -1109,6 +1103,12 @@ declare module THREE { */ rotateZ(angle: number): Object3D; + /** + * @param axis A normalized vector in object space. + * @param distance The distance to translate. + */ + translateOnAxis(axis: Vector3, distance: number): Object3D; + /** * * @param distance @@ -1187,10 +1187,10 @@ declare module THREE { * @param name String to match to the children's Object3d.name property. * @param recursive Boolean whether to search through the children's children. Default is false. */ - getObjectByName(name: string, recursive: boolean): Object3D; + getObjectByName(name: string, recursive?: boolean): Object3D; - getChildByName( name: string, recursive: boolean ): Object3D; + getChildByName( name: string, recursive?: boolean ): Object3D; /** * Updates local transform. @@ -1209,20 +1209,6 @@ declare module THREE { */ clone(object?: Object3D, recursive?: boolean): Object3D; - /** - * @param axis A normalized vector in object space. - * @param distance The distance to translate. - */ - translateOnAxis(axis: Vector3, distance: number): Object3D; - - /** - * Rotate an object along an axis in object space. The axis is assumed to be normalized. - * @param axis A normalized vector in object space. - * @param angle The angle in radians. - */ - rotateOnAxis(axis: Vector3, angle: number): Object3D; - - // EventDispatcher mixins addEventListener(type: string, listener: (event: any) => void ): void; hasEventListener(type: string, listener: (event: any) => void): void; @@ -1279,6 +1265,7 @@ declare module THREE { export class Raycaster { constructor(origin?: Vector3, direction?: Vector3, near?: number, far?: number); + ray: Ray; near: number; far: number; @@ -1324,15 +1311,15 @@ declare module THREE { export class AreaLight extends Light{ constructor(hex: number, intensity?: number); - position: Vector3; - right: Vector3; normal: Vector3; - quadraticAttenuation: number; - height: number; - linearAttenuation: number; - width: number; + right: Vector3; intensity: number; + width: number; + height: number; constantAttenuation: number; + linearAttenuation: number; + quadraticAttenuation: number; + } /** @@ -1350,12 +1337,6 @@ declare module THREE { constructor(hex?: number, intensity?: number); - /** - * Direction of the light is normalized vector from position to (0,0,0). - * Default — new THREE.Vector3(). - */ - position: Vector3; - /** * Target used for shadow camera orientation. */ @@ -1516,7 +1497,6 @@ declare module THREE { export class HemisphereLight extends Light { constructor(skyColorHex?: number, groundColorHex?: number, intensity?: number); - position: Vector3; groundColor: Color; intensity: number; @@ -1534,12 +1514,6 @@ declare module THREE { export class PointLight extends Light { constructor(hex?: number, intensity?: number, distance?: number); - /** - * Light's position. - * Default — new THREE.Vector3(). - */ - position: Vector3; - /* * Light's intensity. * Default - 1.0. @@ -1573,12 +1547,6 @@ declare module THREE { export class SpotLight extends Light { constructor(hex?: number, intensity?: number, distance?: number, angle?: number, exponent?: number); - /** - * Light's position. - * Default — new THREE.Vector3(). - */ - position: Vector3; - /** * Spotlight focus points at target.position. * Default position — (0,0,0). @@ -1668,11 +1636,11 @@ declare module THREE { * Default — 512. */ shadowMapHeight: number; - shadowMatrix: Matrix4; + shadowMap: RenderTarget; shadowMapSize: Vector2; shadowCamera: Camera; - shadowMap: RenderTarget; + shadowMatrix: Matrix4; clone(): SpotLight; } @@ -1734,12 +1702,12 @@ declare module THREE { */ crossOrigin: string; - needsTangents(materials: Material[]): boolean; - updateProgress(progress: Progress): void; - createMaterial(m: Material, texturePath: string): boolean; - initMaterials(materials: Material[], texturePath: string): Material[]; - extractUrlBase(url: string): string; addStatusElement(): HTMLElement; + updateProgress(progress: Progress): void; + extractUrlBase(url: string): string; + initMaterials(materials: Material[], texturePath: string): Material[]; + needsTangents(materials: Material[]): boolean; + createMaterial(m: Material, texturePath: string): boolean; static Handlers:LoaderHandler; } @@ -1756,17 +1724,8 @@ declare module THREE { load(url: string, onLoad: (bufferGeometry: BufferGeometry) => void, onProgress?: (event: any) => void, onError?: (event: any) => void): void; setCrossOrigin(crossOrigin: string): void; parse(json: any): BufferGeometry; - } - /* - * GeometryLoader class is experimental, and it is not yet included in the compiled source code. - * - export class GeometryLoader { - - } - */ - export class Cache{ constructor(); @@ -1777,12 +1736,22 @@ declare module THREE { remove(key: string): void; clear(): void; } + + /* + * GeometryLoader class is experimental, and it is not yet included in the compiled source code. + * + export class GeometryLoader { + + } + */ + /** * A loader for loading an image. * Unlike other loaders, this one emits events instead of using predefined callbacks. So if you're interested in getting notified when things happen, you need to add listeners to the object. */ export class ImageLoader { constructor(manager?: LoadingManager); + crossOrigin: string; /** @@ -1790,15 +1759,16 @@ declare module THREE { * @param url */ load(url: string, onLoad?: (image: HTMLImageElement) => void, onProgress?: (event: any) => void, onError?: (event: any) => void): HTMLImageElement; + setCrossOrigin(crossOrigin: string): void; } - /** * A loader for loading objects in JSON format. */ export class JSONLoader extends Loader { constructor(showStatus?: boolean); + withCredentials: boolean; /** @@ -1807,12 +1777,13 @@ declare module THREE { * @param texturePath If not specified, textures will be assumed to be in the same folder as the Javascript model file. */ load(url: string, callback: (geometry: JSonLoaderResultGeometry, materials: Material[]) => void , texturePath?: string): void; - parse(json:string, texturePath:string): any; + loadAjaxJSON(context: JSONLoader, url: string, callback: (geometry: Geometry, materials: Material[]) => void , texturePath?: string, callbackProgress?: (progress: Progress) => void ): void; + parse(json:string, texturePath:string): any; } - export class JSonLoaderResultGeometry extends Geometry { + export interface JSonLoaderResultGeometry extends Geometry { animation: AnimationData; } @@ -1883,16 +1854,34 @@ declare module THREE { export class XHRLoader { constructor(manager?: LoadingManager); - cache: Cache; - crossOrigin: string; responseType: string; + crossOrigin: string; load(url: string, onLoad?: (responseText: string) => void, onProgress?: (event: any) => void, onError?: (event: any) => void): void; - setCrossOrigin(crossOrigin: string): void; setResponseType(responseType: string): void; + setCrossOrigin(crossOrigin: string): void; } // Materials ////////////////////////////////////////////////////////////////////////////////// + export interface MaterialParameters { + name?: string; + side?: Side; + opacity?: number; + transparent?: boolean; + blending?: Blending; + blendSrc?: BlendingDstFactor; + blendDst?: BlendingSrcFactor; + blendEquation?: BlendingEquation; + depthTest?: boolean; + depthWrite?: boolean; + polygonOffset?: boolean; + polygonOffsetFactor?: number; + polygonOffsetUnits?: number; + alphaTest?: number; + overdraw?: number; + visible?: boolean; + needsUpdate?: boolean; + } /** * Materials describe the appearance of objects. They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer. @@ -1905,11 +1894,19 @@ declare module THREE { */ id: number; + uuid: string; + /** * Material name. Default is an empty string. */ name: string; + /** + * Defines which of the face sides will be rendered - front, back or both. + * Default is THREE.FrontSide. Other options are THREE.BackSide and THREE.DoubleSide. + */ + side: Side; + /** * Opacity. Default is 1. */ @@ -1982,23 +1979,15 @@ declare module THREE { */ visible: boolean; - /** - * Defines which of the face sides will be rendered - front, back or both. - * Default is THREE.FrontSide. Other options are THREE.BackSide and THREE.DoubleSide. - */ - side: Side; - /** * Specifies that the material needs to be updated, WebGL wise. Set it to true if you made changes that need to be reflected in WebGL. * This property is automatically set to true when instancing a new material. */ needsUpdate: boolean; - clone(material?:Material): Material; - - dispose(): void; setValues(values: Object): void; - + clone(material?:Material): Material; + dispose(): void; // EventDispatcher mixins addEventListener(type: string, listener: (event: any) => void ): void; @@ -2007,7 +1996,7 @@ declare module THREE { dispatchEvent(event: { type: string; target: any; }): void; } - export interface LineBasicMaterialParameters { + export interface LineBasicMaterialParameters extends MaterialParameters { color?: number; linewidth?: number; linecap?: string; @@ -2017,8 +2006,8 @@ declare module THREE { } export class LineBasicMaterial extends Material { - constructor(parameters?: LineBasicMaterialParameters); + color: Color; linewidth: number; linecap: string; @@ -2029,86 +2018,87 @@ declare module THREE { clone(): LineBasicMaterial; } - export interface LineDashedMaterialParameters { - scale?: number; + export interface LineDashedMaterialParameters extends MaterialParameters { color?: number; - vertexColors?: boolean; - dashSize?: number; - fog?: boolean; - gapSize?: number; linewidth?: number; + scale?: number; + dashSize?: number; + gapSize?: number; + vertexColors?: Colors; + fog?: boolean; } export class LineDashedMaterial extends Material { constructor(parameters?: LineDashedMaterialParameters); - scale: number; + color: Color; - vertexColors: boolean; - dashSize: number; - fog: boolean; - gapSize: number; linewidth: number; + scale: number; + dashSize: number; + gapSize: number; + vertexColors: Colors; + fog: boolean; clone(): LineDashedMaterial; } - /** * parameters is an object with one or more properties defining the material's appearance. */ - export interface MeshBasicMaterialParameters { + export interface MeshBasicMaterialParameters extends MaterialParameters{ color?: number; - wireframe?: boolean; - wireframeLinewidth?: number; - wireframeLinecap?: string; - wireframeLinejoin?: string; - shading?: Shading; - vertexColors?: Colors; - fog?: boolean; + map?: Texture; lightMap?: Texture; specularMap?: Texture; alphaMap?: Texture; envMap?: Texture; - skinning?: boolean; - morphTargets?: boolean; - map?: Texture; combine?: Combine; reflectivity?: number; refractionRatio?: number; + fog?: boolean; + shading?: Shading; + wireframe?: boolean; + wireframeLinewidth?: number; + wireframeLinecap?: string; + wireframeLinejoin?: string; + vertexColors?: Colors; + skinning?: boolean; + morphTargets?: boolean; } export class MeshBasicMaterial extends Material { constructor(parameters?: MeshBasicMaterialParameters); color: Color; - wireframe: boolean; - wireframeLinewidth: number; - wireframeLinecap: string; - wireframeLinejoin: string; - shading: Shading; - vertexColors: Colors; - fog: boolean; + map: Texture; lightMap: Texture; specularMap: Texture; alphaMap: Texture; envMap: Texture; - skinning: boolean; - morphTargets: boolean; - map: Texture; combine: Combine; reflectivity: number; refractionRatio: number; + fog: boolean; + shading: Shading; + wireframe: boolean; + wireframeLinewidth: number; + wireframeLinecap: string; + wireframeLinejoin: string; + vertexColors: Colors; + skinning: boolean; + morphTargets: boolean; clone(): MeshBasicMaterial; } - export interface MeshDepthMaterialParameters { + export interface MeshDepthMaterialParameters extends MaterialParameters{ wireframe?: boolean; wireframeLinewidth?: number; } export class MeshDepthMaterial extends Material { constructor(parameters?: MeshDepthMaterialParameters); + wireframe: boolean; wireframeLinewidth: number; @@ -2124,30 +2114,30 @@ declare module THREE { clone(): MeshFaceMaterial; } - export interface MeshLambertMaterialParameters { + export interface MeshLambertMaterialParameters extends MaterialParameters{ color?: number; ambient?: number; emissive?: number; + wrapAround?: boolean; + wrapRGB?: Vector3; + map?: Texture; + lightMap?: Texture; + specularMap?: Texture; + alphaMap?: Texture; + envMap?: Texture; + combine?: Combine; + reflectivity?: number; + refractionRatio?: number; + fog?: boolean; shading?: Shading; wireframe?: boolean; wireframeLinewidth?: number; wireframeLinecap?: string; wireframeLinejoin?: string; vertexColors?: Colors; - fog?: boolean; - map?: Texture; - lightMap?: Texture; - specularMap?: Texture; - alphaMap?: Texture; - envMap?: Texture; - reflectivity?: number; - refractionRatio?: number; - combine?: Combine; skinning?: boolean; morphTargets?: boolean; - wrapRGB?: Vector3; morphNormals?: boolean; - wrapAround?: boolean; } export class MeshLambertMaterial extends Material { @@ -2155,119 +2145,119 @@ declare module THREE { color: Color; ambient: Color; emissive: Color; + wrapAround: boolean; + wrapRGB: Vector3; + map: Texture; + lightMap: Texture; + specularMap: Texture; + alphaMap: Texture; + envMap: Texture; + combine: Combine; + reflectivity: number; + refractionRatio: number; + fog: boolean; shading: Shading; wireframe: boolean; wireframeLinewidth: number; wireframeLinecap: string; wireframeLinejoin: string; vertexColors: Colors; - fog: boolean; - map: Texture; - lightMap: Texture; - specularMap: Texture; - alphaMap: Texture; - envMap: Texture; - reflectivity: number; - refractionRatio: number; - combine: Combine; skinning: boolean; morphTargets: boolean; - wrapRGB: Vector3; morphNormals: boolean; - wrapAround: boolean; clone(): MeshLambertMaterial; } - export interface MeshNormalMaterialParameters { - morphTargets?: boolean; + export interface MeshNormalMaterialParameters extends MaterialParameters{ shading?: Shading; wireframe?: boolean; wireframeLinewidth?: number; + morphTargets?: boolean; } export class MeshNormalMaterial extends Material { constructor(parameters?: MeshNormalMaterialParameters); - morphTargets: boolean; + shading: Shading; wireframe: boolean; wireframeLinewidth: number; + morphTargets: boolean; clone(): MeshNormalMaterial; } - export interface MeshPhongMaterialParameters { + export interface MeshPhongMaterialParameters extends MaterialParameters{ color?: number; // diffuse ambient?: number; emissive?: number; specular?: number; shininess?: number; + metal?: boolean; + wrapAround?: boolean; + wrapRGB?: Vector3; + map?: Texture; + lightMap?: Texture; + bumpMap?: Texture; + bumpScale?: number; + normalMap?: Texture; + normalScale?: Vector2; + specularMap?: Texture; + alphaMap?: Texture; + envMap?: Texture; + combine?: Combine; + reflectivity?: number; + refractionRatio?: number; + fog?: boolean; shading?: Shading; wireframe?: boolean; wireframeLinewidth?: number; wireframeLinecap?: string; wireframeLinejoin?: string; vertexColors?: Colors; - fog?: boolean; - map?: Texture; - lightMap?: Texture; - specularMap?: Texture; - alphaMap?: Texture; - envMap?: Texture; - reflectivity?: number; - refractionRatio?: number; - combine?: Combine; skinning?: boolean; morphTargets?: boolean; - normalScale?: Vector2; morphNormals?: boolean; - metal?: boolean; - bumpScale?: number; - wrapAround?: boolean; - perPixel?: boolean; - normalMap?: Texture; - bumpMap?: Texture; - wrapRGB?: Vector3; } export class MeshPhongMaterial extends Material { constructor(parameters?: MeshPhongMaterialParameters); + color: Color; // diffuse ambient: Color; emissive: Color; specular: Color; shininess: number; + metal: boolean; + wrapAround: boolean; + wrapRGB: Vector3; + map: Texture; + lightMap: Texture; + bumpMap: Texture; + bumpScale: number; + normalMap: Texture; + normalScale: Vector2; + specularMap: Texture; + alphaMap: Texture; + envMap: Texture; + combine: Combine; + reflectivity: number; + refractionRatio: number; + fog: boolean; shading: Shading; wireframe: boolean; wireframeLinewidth: number; wireframeLinecap: string; wireframeLinejoin: string; vertexColors: Colors; - fog: boolean; - map: Texture; - lightMap: Texture; - specularMap: Texture; - alphaMap: Texture; - envMap: Texture; - reflectivity: number; - refractionRatio: number; - combine: Combine; skinning: boolean; morphTargets: boolean; - normalScale: Vector2; morphNormals: boolean; - metal: boolean; - bumpScale: number; - wrapAround: boolean; - - normalMap: Texture; - bumpMap: Texture; - wrapRGB: Vector3; clone(): MeshPhongMaterial; } - export interface PointCloudMaterialParameters { + export interface PointCloudMaterialParameters extends MaterialParameters{ color?: number; map?: Texture; size?: number; @@ -2277,7 +2267,6 @@ declare module THREE { } export class PointCloudMaterial extends Material { - constructor(parameters?: PointCloudMaterialParameters); color: Color; @@ -2305,75 +2294,47 @@ declare module THREE { } - export interface ShaderMaterialParameters { + export interface ShaderMaterialParameters extends MaterialParameters{ + defines?: any; uniforms?: any; - fragmentShader?: string; - vertexShader?: string; - morphTargets?: boolean; - lights?: boolean; - morphNormals?: boolean; - wireframe?: boolean; - vertexColors?: Colors; - skinning?: boolean; - fog?: boolean; attributes?: any; + vertexShader?: string; + fragmentShader?: string; shading?: Shading; linewidth?: number; + wireframe?: boolean; wireframeLinewidth?: number; - defines?: any; + fog?: boolean; + lights?: boolean; + vertexColors?: Colors; + skinning?: boolean; + morphTargets?: boolean; + morphNormals?: boolean; } export class ShaderMaterial extends Material { constructor(parameters?: ShaderMaterialParameters); + defines: any; uniforms: any; - fragmentShader: string; - vertexShader: string; - morphTargets: boolean; - lights: boolean; - morphNormals: boolean; - wireframe: boolean; - vertexColors: Colors; - skinning: boolean; - fog: boolean; attributes: any; + vertexShader: string; + fragmentShader: string; shading: Shading; linewidth: number; + wireframe: boolean; wireframeLinewidth: number; - defines: any; + fog: boolean; + lights: boolean; + vertexColors: Colors; + skinning: boolean; + morphTargets: boolean; + morphNormals: boolean; clone(): ShaderMaterial; } - export interface SpriteMaterialParameters { - map?: Texture; - uvScale?: Vector2; - sizeAttenuation?: boolean; - color?: number; - uvOffset?: Vector2; - fog?: boolean; - useScreenCoordinates?: boolean; - scaleByViewport?: boolean; - alignment?: Vector2; - } - - export class SpriteMaterial extends Material { - constructor(parameters?: SpriteMaterialParameters); - - map: Texture; - uvScale: Vector2; - sizeAttenuation: boolean; - color: Color; - uvOffset: Vector2; - fog: boolean; - useScreenCoordinates: boolean; - scaleByViewport: boolean; - alignment: Vector2; - - clone(): SpriteMaterial; - } - - export interface SpriteCanvasMaterialParameters { + export interface SpriteCanvasMaterialParameters extends MaterialParameters{ color?: number; } @@ -2387,67 +2348,87 @@ declare module THREE { clone(): SpriteCanvasMaterial; } + export interface SpriteMaterialParameters extends MaterialParameters{ + color?: number; + map?: Texture; + rotation?: number; + fog?: boolean; + } + + export class SpriteMaterial extends Material { + constructor(parameters?: SpriteMaterialParameters); + + color: Color; + map: Texture; + rotation: number; + fog: boolean; + + clone(): SpriteMaterial; + } + // Math ////////////////////////////////////////////////////////////////////////////////// export class Box2 { constructor(min?: Vector2, max?: Vector2); + max: Vector2; min: Vector2; set(min: Vector2, max: Vector2): Box2; - expandByPoint(point: Vector2): Box2; - clampPoint(point: Vector2, optionalTarget?: Vector2): Vector2; - isIntersectionBox(box: Box2): boolean; setFromPoints(points: Vector2[]): Box2; - size(optionalTarget?: Vector2): Vector2; - union(box: Box2): Box2; - getParameter(point: Vector2): Vector2; - expandByScalar(scalar: number): Box2; - intersect(box: Box2): Box2; - containsBox(box: Box2): boolean; - translate(offset: Vector2): Box2; - empty(): boolean; - clone(): Box2; - equals(box: Box2): boolean; - expandByVector(vector: Vector2): Box2; + setFromCenterAndSize(center: Vector2, size: number): Box2; copy(box: Box2): Box2; makeEmpty(): Box2; + empty(): boolean; center(optionalTarget?: Vector2): Vector2; - distanceToPoint(point: Vector2): number; + size(optionalTarget?: Vector2): Vector2; + expandByPoint(point: Vector2): Box2; + expandByVector(vector: Vector2): Box2; + expandByScalar(scalar: number): Box2; containsPoint(point: Vector2): boolean; - setFromCenterAndSize(center: Vector2, size: number): Box2; + containsBox(box: Box2): boolean; + getParameter(point: Vector2): Vector2; + isIntersectionBox(box: Box2): boolean; + clampPoint(point: Vector2, optionalTarget?: Vector2): Vector2; + distanceToPoint(point: Vector2): number; + intersect(box: Box2): Box2; + union(box: Box2): Box2; + translate(offset: Vector2): Box2; + equals(box: Box2): boolean; + clone(): Box2; } export class Box3 { constructor(min?: Vector3, max?: Vector3); + max: Vector3; min: Vector3; set(min: Vector3, max: Vector3): Box3; - applyMatrix4(matrix: Matrix4): Box3; - expandByPoint(point: Vector3): Box3; - clampPoint(point: Vector3, optionalTarget?: Vector3): Vector3; - isIntersectionBox(box: Box3): boolean; setFromPoints(points: Vector3[]): Box3; - size(optionalTarget?: Vector3): Vector3; - union(box: Box3): Box3; - getParameter(point: Vector3): Vector3; - expandByScalar(scalar: number): Box3; - intersect(box: Box3): Box3; - containsBox(box: Box3): boolean; - translate(offset: Vector3): Box3; - empty(): boolean; - clone(): Box3; - equals(box: Box3): boolean; - expandByVector(vector: Vector3): Box3; - copy(box: Box3): Box3; - makeEmpty(): Box3; - center(optionalTarget?: Vector3): Vector3; - getBoundingSphere(): Sphere; - distanceToPoint(point: Vector3): number; - containsPoint(point: Vector3): boolean; setFromCenterAndSize(center: Vector3, size: number): Box3; setFromObject(object: Object3D): Box3; + copy(box: Box3): Box3; + makeEmpty(): Box3; + empty(): boolean; + center(optionalTarget?: Vector3): Vector3; + size(optionalTarget?: Vector3): Vector3; + expandByPoint(point: Vector3): Box3; + expandByVector(vector: Vector3): Box3; + expandByScalar(scalar: number): Box3; + containsPoint(point: Vector3): boolean; + containsBox(box: Box3): boolean; + getParameter(point: Vector3): Vector3; + isIntersectionBox(box: Box3): boolean; + clampPoint(point: Vector3, optionalTarget?: Vector3): Vector3; + distanceToPoint(point: Vector3): number; + getBoundingSphere(): Sphere; + intersect(box: Box3): Box3; + union(box: Box3): Box3; + applyMatrix4(matrix: Matrix4): Box3; + translate(offset: Vector3): Box3; + equals(box: Box3): boolean; + clone(): Box3; } export interface HSL { @@ -2488,6 +2469,31 @@ declare module THREE { set(color: Color): Color; set(color: number): Color; set(color: string): Color; + setHex(hex: number): Color; + + /** + * Sets this color from RGB values. + * @param r Red channel value between 0 and 1. + * @param g Green channel value between 0 and 1. + * @param b Blue channel value between 0 and 1. + */ + setRGB(r: number, g: number, b: number): Color; + + /** + * Sets this color from HSL values. + * Based on MochiKit implementation by Bob Ippolito. + * + * @param h Hue channel value between 0 and 1. + * @param s Saturation value channel between 0 and 1. + * @param l Value channel value between 0 and 1. + */ + setHSL(h: number, s: number, l: number): Color; + + /** + * Sets this color from a CSS context style string. + * @param contextStyle Color in CSS context style format. + */ + setStyle(style: string): Color; /** * Copies given color. @@ -2517,14 +2523,6 @@ declare module THREE { */ convertLinearToGamma(): Color; - /** - * Sets this color from RGB values. - * @param r Red channel value between 0 and 1. - * @param g Green channel value between 0 and 1. - * @param b Blue channel value between 0 and 1. - */ - setRGB(r: number, g: number, b: number): Color; - /** * Returns the hexadecimal value of this color. */ @@ -2535,13 +2533,7 @@ declare module THREE { */ getHexString(): string; - setHex(hex: number): Color; - - /** - * Sets this color from a CSS context style string. - * @param contextStyle Color in CSS context style format. - */ - setStyle(style: string): Color; + getHSL(): HSL; /** * Returns the value of this color in CSS context style. @@ -2549,18 +2541,6 @@ declare module THREE { */ getStyle(): string; - /** - * Sets this color from HSL values. - * Based on MochiKit implementation by Bob Ippolito. - * - * @param h Hue channel value between 0 and 1. - * @param s Saturation value channel between 0 and 1. - * @param l Value channel value between 0 and 1. - */ - setHSL(h: number, s: number, l: number): Color; - - getHSL(): HSL; - offsetHSL(h: number, s: number, l: number): Color; add(color: Color): Color; @@ -2570,6 +2550,8 @@ declare module THREE { multiplyScalar(s: number): Color; lerp(color: Color, alpha: number): Color; equals(color: Color): boolean; + fromArray(rgb: number[]): Color; + toArray(): number[]; /** * Clones this color. @@ -2737,12 +2719,14 @@ declare module THREE { set(x: number, y: number, z: number, order?: string): Euler; copy(euler: Euler): Euler; - setFromRotationMatrix(m: Matrix4, order: string): Euler; - setFromQuaternion(q:Quaternion, order: string): Euler; + setFromRotationMatrix(m: Matrix4, order?: string): Euler; + setFromQuaternion(q:Quaternion, order?: string, update?: boolean): Euler; reorder(newOrder: string): Euler; + equals(euler: Euler): boolean; fromArray(xyzo: any[]): Euler; toArray(): any[]; - equals(euler: Euler): boolean; + onChange: () => void; + clone(): Euler; } @@ -2757,13 +2741,15 @@ declare module THREE { */ planes: Plane[]; - setFromMatrix(m: Matrix4): Frustum; - intersectsObject(object: Object3D): boolean; - clone(): Frustum; set(p0?: number, p1?: number, p2?: number, p3?: number, p4?: number, p5?: number): Frustum; copy(frustum: Frustum): Frustum; - containsPoint(point: Vector3): boolean; + setFromMatrix(m: Matrix4): Frustum; + intersectsObject(object: Object3D): boolean; intersectsSphere(sphere: Sphere): boolean; + intersectsBox(box: Box3): boolean; + containsPoint(point: Vector3): boolean; + clone(): Frustum; + } export class Line3 { @@ -2773,19 +2759,21 @@ declare module THREE { set(start?: Vector3, end?: Vector3): Line3; copy(line: Line3): Line3; - clone(): Line3; - equals(line: Line3): boolean; - distance(): number; - distanceSq(): number; - applyMatrix4(matrix: Matrix4): Line3; - at(t: number, optionalTarget?: Vector3): Vector3; center(optionalTarget?: Vector3): Vector3; delta(optionalTarget?: Vector3): Vector3; - closestPointToPoint(point: Vector3, clampToLine?: boolean, optionalTarget?: Vector3): Vector3; + distanceSq(): number; + distance(): number; + at(t: number, optionalTarget?: Vector3): Vector3; closestPointToPointParameter(point: Vector3, clampToLine?: boolean): number; + closestPointToPoint(point: Vector3, clampToLine?: boolean, optionalTarget?: Vector3): Vector3; + applyMatrix4(matrix: Matrix4): Line3; + equals(line: Line3): boolean; + clone(): Line3; } interface Math { + generateUUID(): string; + /** * Clamps the x to be between a and b. * @@ -2814,6 +2802,10 @@ declare module THREE { */ mapLinear(x: number, a1: number, a2: number, b1: number, b2: number): number; + smoothstep(x: number, min: number, max: number): number; + + smootherstep(x: number, min: number, max: number): number; + /** * Random float from 0 to 1 with 16 bits of randomness. * Standard Math.random() creates repetitive patterns when applied over larger space. @@ -2844,9 +2836,7 @@ declare module THREE { radToDeg(radians: number): number; - smoothstep(x: number, min: number, max: number): number; - - smootherstep(x: number, min: number, max: number): number; + isPowerOfTwo(value: number): boolean; } /** @@ -2874,8 +2864,6 @@ declare module THREE { */ copy(m: Matrix): Matrix; - multiplyVector3Array(a: number[]): number[]; - /** * multiplyScalar(s:number):T; */ @@ -2918,29 +2906,29 @@ declare module THREE { */ elements: Float32Array; + set(n11: number, n12: number, n13: number, n21: number, n22: number, n23: number, n31: number, n32: number, n33: number): Matrix3; + identity(): Matrix3; + copy(m: Matrix3): Matrix3; + applyToVector3Array(array: number[], offset?: number, length?: number): number[]; + multiplyScalar(s: number): Matrix3; + determinant(): number; + getInverse(matrix: Matrix3, throwOnInvertible?: boolean): Matrix3; + getInverse(matrix: Matrix4, throwOnInvertible?: boolean): Matrix3; + /** * Transposes this matrix in place. */ transpose(): Matrix3; + flattenToArrayOffset(array: number[], offset: number): number[]; + getNormalMatrix(m: Matrix4): Matrix3; /** * Transposes this matrix into the supplied array r, and returns itself. */ transposeIntoArray(r: number[]): number[]; - - determinant(): number; - set(n11: number, n12: number, n13: number, n21: number, n22: number, n23: number, n31: number, n32: number, n33: number): Matrix3; - multiplyScalar(s: number): Matrix3; - // DEPRECATED - multiplyVector3Array(a: number[]): number[]; - applyToVector3Array(array: number[], offset?: number, length?: number): number[]; - flattenToArrayOffset(array: number[], offset: number): number[]; - getNormalMatrix(m: Matrix4): Matrix3; - getInverse(matrix: Matrix3, throwOnInvertible?: boolean): Matrix3; - getInverse(matrix: Matrix4, throwOnInvertible?: boolean): Matrix3; - copy(m: Matrix3): Matrix3; + fromArray(array: number[]): Matrix3; + toArray(): number[]; clone(): Matrix3; - identity(): Matrix3; } /** @@ -2992,7 +2980,8 @@ declare module THREE { * Copies the rotation component of the supplied matrix m into this matrix rotation component. */ extractRotation(m: Matrix4): Matrix4; - + makeRotationFromEuler(euler: Euler): Matrix4; + makeRotationFromQuaternion(q: Quaternion): Matrix4; /** * Constructs a rotation matrix, looking from eye towards center with defined up vector. */ @@ -3018,6 +3007,7 @@ declare module THREE { * Multiplies this matrix by s. */ multiplyScalar(s: number): Matrix4; + applyToVector3Array(array: number[], offset?: number, length?: number): number[]; /** * Computes determinant of this matrix. @@ -3046,25 +3036,12 @@ declare module THREE { */ getInverse(m: Matrix4, throwOnInvertible?: boolean): Matrix4; - makeRotationFromEuler(euler: Euler): Matrix4; - makeRotationFromQuaternion(q: Quaternion): Matrix4; - /** * Multiplies the columns of this matrix by vector v. */ scale(v: Vector3): Matrix4; - /** - * Sets this matrix to the transformation composed of translation, rotation and scale. - */ - compose(translation: Vector3, rotation: Quaternion, scale: Vector3): Matrix4; - - /** - * Decomposes this matrix into the translation, rotation and scale components. - * If parameters are not passed, new instances will be created. - */ - decompose(translation?: Vector3, rotation?: Quaternion, scale?: Vector3): Object[]; // [Vector3, Quaternion, Vector3] - + getMaxScaleOnAxis(): number; /** * Sets this matrix as translation transform. */ @@ -3105,6 +3082,17 @@ declare module THREE { */ makeScale(x: number, y: number, z: number): Matrix4; + /** + * Sets this matrix to the transformation composed of translation, rotation and scale. + */ + compose(translation: Vector3, rotation: Quaternion, scale: Vector3): Matrix4; + + /** + * Decomposes this matrix into the translation, rotation and scale components. + * If parameters are not passed, new instances will be created. + */ + decompose(translation?: Vector3, rotation?: Quaternion, scale?: Vector3): Object[]; // [Vector3, Quaternion, Vector3] + /** * Creates a frustum matrix. */ @@ -3119,17 +3107,12 @@ declare module THREE { * Creates an orthographic projection matrix. */ makeOrthographic(left: number, right: number, top: number, bottom: number, near: number, far: number): Matrix4; - + fromArray(array: number[]): Matrix4; + toArray(): number[]; /** * Clones this matrix. */ clone(): Matrix4; - - // DEPRECATED - multiplyVector3Array(a: number[]): number[]; - applyToVector3Array(array: number[], offset?: number, length?: number): number[]; - - getMaxScaleOnAxis(): number; } export class Plane { @@ -3138,24 +3121,24 @@ declare module THREE { normal: Vector3; constant: number; - normalize(): Plane; set(normal: Vector3, constant: number): Plane; + setComponents(x: number, y: number, z: number, w: number): Plane; + setFromNormalAndCoplanarPoint(normal: Vector3, point: Vector3): Plane; + setFromCoplanarPoints(a: Vector3, b: Vector3, c: Vector3): Plane; copy(plane: Plane): Plane; - applyMatrix4(matrix: Matrix4, optionalNormalMatrix?: Matrix3): Plane; + normalize(): Plane; + negate(): Plane; + distanceToPoint(point: Vector3): number; + distanceToSphere(sphere: Sphere): number; + projectPoint(point: Vector3, optionalTarget?: Vector3): Vector3; orthoPoint(point: Vector3, optionalTarget?: Vector3): Vector3; isIntersectionLine(line: Line3): boolean; intersectLine(line: Line3, optionalTarget?: Vector3): Vector3; - setFromNormalAndCoplanarPoint(normal: Vector3, point: Vector3): Plane; - clone(): Plane; - distanceToPoint(point: Vector3): number; - equals(plane: Plane): boolean; - setComponents(x: number, y: number, z: number, w: number): Plane; - distanceToSphere(sphere: Sphere): number; - setFromCoplanarPoints(a: Vector3, b: Vector3, c: Vector3): Plane; - projectPoint(point: Vector3, optionalTarget?: Vector3): Vector3; - negate(): Plane; - translate(offset: Vector3): Plane; coplanarPoint(optionalTarget?: boolean): Vector3; + applyMatrix4(matrix: Matrix4, optionalNormalMatrix?: Matrix3): Plane; + translate(offset: Vector3): Plane; + equals(plane: Plane): boolean; + clone(): Plane; } /** @@ -3207,11 +3190,16 @@ declare module THREE { * Sets this quaternion from rotation component of m. Adapted from http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm. */ setFromRotationMatrix(m: Matrix4): Quaternion; - + setFromUnitVectors(vFrom: Vector3, vTo: Vector4): Quaternion; /** * Inverts this quaternion. */ inverse(): Quaternion; + + conjugate(): Quaternion; + dot(v: Vector3): number; + lengthSq(): number; + /** * Computes length of this quaternion. */ @@ -3237,6 +3225,11 @@ declare module THREE { * Deprecated. Use Vector3.applyQuaternion instead */ multiplyVector3(vector: Vector3): Vector3; + slerp(qb: Quaternion, t: number): Quaternion; + equals(v: Quaternion): boolean; + fromArray(n: number[]): Quaternion; + toArray(): number[]; + onChange: () => void; /** * Clones this quaternion. @@ -3247,20 +3240,6 @@ declare module THREE { * Adapted from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/. */ static slerp(qa: Quaternion, qb: Quaternion, qm: Quaternion, t: number): Quaternion; - - slerp(qb: Quaternion, t: number): Quaternion; - - toArray(): number[]; - - equals(v: Quaternion): boolean; - - dot(v: Vector3): number; - - lengthSq(): number; - - fromArray(n: number[]): Quaternion; - - conjugate(): Quaternion; } export class Ray { @@ -3269,25 +3248,24 @@ declare module THREE { origin: Vector3; direction: Vector3; - applyMatrix4(matrix4: Matrix4): Ray; - at(t: number, optionalTarget?: Vector3): Vector3; - clone(): Ray; - closestPointToPoint(point: Vector3, optionalTarget?: Vector3): Vector3; - copy(ray: Ray): Ray; - distanceSqToSegment(v0: Vector3, v1: Vector3, optionalPointOnRay?: Vector3, optionalPointOnSegment?: Vector3): number; - distanceToPlane(plane: Plane): number; - distanceToPoint(point: Vector3): number; - equals(ray: Ray): boolean; - intersectBox(box: Box3, optionalTarget?: Vector3): Vector3; - intersectPlane(plane: Plane, optionalTarget?: Vector3): Vector3; - intersectSphere(sphere: Sphere, optionalTarget?: Vector3): Vector3; - intersectTriangle(a: Vector3, b: Vector3, c: Vector3, backfaceCulling: boolean, optionalTarget?: Vector3): Vector3; - isIntersectionBox(box: Box3): boolean; - isIntersectionPlane(plane: Plane): boolean; - isIntersectionSphere(sphere: Sphere): boolean; - - recast(t: number): Ray; set(origin: Vector3, direction: Vector3): Ray; + copy(ray: Ray): Ray; + at(t: number, optionalTarget?: Vector3): Vector3; + recast(t: number): Ray; + closestPointToPoint(point: Vector3, optionalTarget?: Vector3): Vector3; + distanceToPoint(point: Vector3): number; + distanceSqToSegment(v0: Vector3, v1: Vector3, optionalPointOnRay?: Vector3, optionalPointOnSegment?: Vector3): number; + isIntersectionSphere(sphere: Sphere): boolean; + intersectSphere(sphere: Sphere, optionalTarget?: Vector3): Vector3; + isIntersectionPlane(plane: Plane): boolean; + distanceToPlane(plane: Plane): number; + intersectPlane(plane: Plane, optionalTarget?: Vector3): Vector3; + isIntersectionBox(box: Box3): boolean; + intersectBox(box: Box3, optionalTarget?: Vector3): Vector3; + intersectTriangle(a: Vector3, b: Vector3, c: Vector3, backfaceCulling: boolean, optionalTarget?: Vector3): Vector3; + applyMatrix4(matrix4: Matrix4): Ray; + equals(ray: Ray): boolean; + clone(): Ray; } export class Sphere { @@ -3297,18 +3275,19 @@ declare module THREE { radius: number; set(center: Vector3, radius: number): Sphere; - applyMatrix4(matrix: Matrix4): Sphere; - clampPoint(point: Vector3, optionalTarget?: Vector3): Vector3; - translate(offset: Vector3): Sphere; - clone(): Sphere; - equals(sphere: Sphere): boolean; setFromPoints(points: Vector3[], optionalCenter?: Vector3): Sphere; - distanceToPoint(point: Vector3): number; - getBoundingBox(optionalTarget?: Box3): Box3; - containsPoint(point: Vector3): boolean; copy(sphere: Sphere): Sphere; - intersectsSphere(sphere: Sphere): boolean; empty(): boolean; + containsPoint(point: Vector3): boolean; + distanceToPoint(point: Vector3): number; + intersectsSphere(sphere: Sphere): boolean; + clampPoint(point: Vector3, optionalTarget?: Vector3): Vector3; + getBoundingBox(optionalTarget?: Box3): Box3; + applyMatrix4(matrix: Matrix4): Sphere; + translate(offset: Vector3): Sphere; + equals(sphere: Sphere): boolean; + + clone(): Sphere; } export interface SplineControlPoint { @@ -3371,17 +3350,17 @@ declare module THREE { b: Vector3; c: Vector3; - setFromPointsAndIndices(points: Vector3[], i0: number, i1: number, i2: number): Triangle; set(a: Vector3, b: Vector3, c: Vector3): Triangle; - normal(optionalTarget?: Vector3): Vector3; - barycoordFromPoint(point: Vector3, optionalTarget?: Vector3): Vector3; - clone(): Triangle; + setFromPointsAndIndices(points: Vector3[], i0: number, i1: number, i2: number): Triangle; + copy(triangle: Triangle): Triangle; area(): number; midpoint(optionalTarget?: Vector3): Vector3; - equals(triangle: Triangle): boolean; + normal(optionalTarget?: Vector3): Vector3; plane(optionalTarget?: Vector3): Plane; + barycoordFromPoint(point: Vector3, optionalTarget?: Vector3): Vector3; containsPoint(point: Vector3): boolean; - copy(triangle: Triangle): Triangle; + equals(triangle: Triangle): boolean; + clone(): Triangle; static normal(a: Vector3, b: Vector3, c: Vector3, optionalTarget?: Vector3): Vector3; static barycoordFromPoint(point: Vector3, a: Vector3, b: Vector3, c: Vector3, optionalTarget: Vector3): Vector3; @@ -3516,6 +3495,26 @@ declare module THREE { */ set(x: number, y: number): Vector2; + /** + * Sets X component of this vector. + */ + setX(x: number): Vector2; + + /** + * Sets Y component of this vector. + */ + setY(y: number): Vector2; + + /** + * Sets a component of this vector. + */ + setComponent(index: number, value: number): void; + + /** + * Gets a component of this vector. + */ + getComponent(index: number): number; + /** * Copies value of v to this vector. */ @@ -3530,6 +3529,7 @@ declare module THREE { * Sets this vector to a + b. */ addVectors(a: Vector2, b: Vector2): Vector2; + addScalar(s: number): Vector2; /** * Subtracts v from this vector. @@ -3541,24 +3541,34 @@ declare module THREE { */ subVectors(a: Vector2, b: Vector2): Vector2; + multiply(v: Vector2): Vector2; /** * Multiplies this vector by scalar s. */ multiplyScalar(s: number): Vector2; + divide(v: Vector2): Vector2; /** * Divides this vector by scalar s. * Set vector to ( 0, 0 ) if s == 0. */ divideScalar(s: number): Vector2; + min(v: Vector2): Vector2; + + max(v: Vector2): Vector2; + clamp(min: Vector2, max: Vector2): Vector2; + clampScalar(min: number, max: number): Vector2; + floor(): Vector2; + ceil(): Vector2; + round(): Vector2; + roundToZero(): Vector2; + /** * Inverts this vector. */ negate(): Vector2; - - /** * Computes dot product of this vector and v. */ @@ -3594,53 +3604,18 @@ declare module THREE { */ setLength(l: number): Vector2; + lerp(v: Vector2, alpha: number): Vector2; /** * Checks for strict equality of this vector and v. */ equals(v: Vector2): boolean; + fromArray(xy: number[]): Vector2; + toArray(): number[]; /** * Clones this vector. */ clone(): Vector2; - - clamp(min: Vector2, max: Vector2): Vector2; - clampScalar(min: number, max: number): Vector2; - floor(): Vector2; - ceil(): Vector2; - round(): Vector2; - roundToZero(): Vector2; - lerp(v: Vector2, alpha: number): Vector2; - - /** - * Sets a component of this vector. - */ - setComponent(index: number, value: number): void; - - addScalar(s: number): Vector2; - - /** - * Gets a component of this vector. - */ - getComponent(index: number): number; - - fromArray(xy: number[]): Vector2; - - toArray(): number[]; - - min(v: Vector2): Vector2; - - max(v: Vector2): Vector2; - - /** - * Sets X component of this vector. - */ - setX(x: number): Vector2; - - /** - * Sets Y component of this vector. - */ - setY(y: number): Vector2; } /** @@ -3684,6 +3659,9 @@ declare module THREE { */ setZ(z: number): Vector3; + setComponent(index: number, value: number): void; + getComponent(index: number): number; + /** * Copies value of v to this vector. */ @@ -3693,6 +3671,7 @@ declare module THREE { * Adds v to this vector. */ add(a: Object): Vector3; + addScalar(s: number): Vector3; /** * Sets this vector to a + b. @@ -3709,16 +3688,34 @@ declare module THREE { */ subVectors(a: Vector3, b: Vector3): Vector3; + multiply(v: Vector3): Vector3; /** * Multiplies this vector by scalar s. */ multiplyScalar(s: number): Vector3; + multiplyVectors(a: Vector3, b: Vector3): Vector3; + applyEuler(euler: Euler): Vector3; + applyAxisAngle(axis: Vector3, angle: number): Vector3; + applyMatrix3(m: Matrix3): Vector3; + applyMatrix4(m: Matrix4): Vector3; + applyProjection(m: Matrix4): Vector3; + applyQuaternion(q: Quaternion): Vector3; + transformDirection(m: Matrix4): Vector3; + divide(v: Vector3): Vector3; /** * Divides this vector by scalar s. * Set vector to ( 0, 0, 0 ) if s == 0. */ divideScalar(s: number): Vector3; + min(v: Vector3): Vector3; + max(v: Vector3): Vector3; + clamp(min: Vector3, max: Vector3): Vector3; + clampScalar(min: number, max: number): Vector3; + floor(): Vector3; + ceil(): Vector3; + round(): Vector3; + roundToZero(): Vector3; /** * Inverts this vector. @@ -3751,20 +3748,11 @@ declare module THREE { */ normalize(): Vector3; - /** - * Computes distance of this vector to v. - */ - distanceTo(v: Vector3): number; - - /** - * Computes squared distance of this vector to v. - */ - distanceToSquared(v: Vector3): number; - /** * Normalizes this vector and multiplies it by l. */ setLength(l: number): Vector3; + lerp(v: Vector3, alpha: number): Vector3; /** * Sets this vector to cross product of itself and v. @@ -3775,46 +3763,36 @@ declare module THREE { * Sets this vector to cross product of a and b. */ crossVectors(a: Vector3, b: Vector3): Vector3; + projectOnVector(v: Vector3): Vector3; + projectOnPlane(planeNormal: Vector3): Vector3; + reflect(vector: Vector3): Vector3; + angleTo(v: Vector3): number; + + /** + * Computes distance of this vector to v. + */ + distanceTo(v: Vector3): number; + + /** + * Computes squared distance of this vector to v. + */ + distanceToSquared(v: Vector3): number; setFromMatrixPosition(m: Matrix4): Vector3; setFromMatrixScale(m: Matrix4): Vector3; + setFromMatrixColumn(index: number, matrix: Matrix4): Vector3; + /** * Checks for strict equality of this vector and v. */ equals(v: Vector3): boolean; + fromArray(xyz: number[]): Vector3; + toArray(): number[]; + /** * Clones this vector. */ clone(): Vector3; - clamp(min: Vector3, max: Vector3): Vector3; - clampScalar(min: number, max: number): Vector3; - floor(): Vector3; - ceil(): Vector3; - round(): Vector3; - roundToZero(): Vector3; - applyMatrix3(m: Matrix3): Vector3; - applyMatrix4(m: Matrix4): Vector3; - projectOnPlane(planeNormal: Vector3): Vector3; - projectOnVector(v: Vector3): Vector3; - addScalar(s: number): Vector3; - divide(v: Vector3): Vector3; - min(v: Vector3): Vector3; - max(v: Vector3): Vector3; - setComponent(index: number, value: number): void; - transformDirection(m: Matrix4): Vector3; - multiplyVectors(a: Vector3, b: Vector3): Vector3; - getComponent(index: number): number; - applyAxisAngle(axis: Vector3, angle: number): Vector3; - lerp(v: Vector3, alpha: number): Vector3; - angleTo(v: Vector3): number; - setFromMatrixColumn(index: number, matrix: Matrix4): Vector3; - reflect(vector: Vector3): Vector3; - fromArray(xyz: number[]): Vector3; - multiply(v: Vector3): Vector3; - applyProjection(m: Matrix4): Vector3; - toArray(): number[]; - applyEuler(euler: Euler): Vector3; - applyQuaternion(q: Quaternion): Vector3; } /** @@ -3833,6 +3811,30 @@ declare module THREE { * Sets value of this vector. */ set(x: number, y: number, z: number, w: number): Vector4; + + /** + * Sets X component of this vector. + */ + setX(x: number): Vector4; + + /** + * Sets Y component of this vector. + */ + setY(y: number): Vector4; + + /** + * Sets Z component of this vector. + */ + setZ(z: number): Vector4; + + /** + * Sets w component of this vector. + */ + setW(w: number): Vector4; + + setComponent(index: number, value: number): void; + getComponent(index: number): number; + /** * Copies value of v to this vector. */ @@ -3842,6 +3844,7 @@ declare module THREE { * Adds v to this vector. */ add(v: Vector4): Vector4; + addScalar(s: number): Vector4; /** * Sets this vector to a + b. @@ -3862,12 +3865,35 @@ declare module THREE { * Multiplies this vector by scalar s. */ multiplyScalar(s: number): Vector4; + applyMatrix4(m: Matrix4): Vector4; /** * Divides this vector by scalar s. * Set vector to ( 0, 0, 0 ) if s == 0. */ divideScalar(s: number): Vector4; + + /** + * http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm + * @param q is assumed to be normalized + */ + setAxisAngleFromQuaternion(q: Quaternion): Vector4; + + /** + * http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm + * @param m assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + */ + setAxisAngleFromRotationMatrix(m: Matrix3): Vector4; + + min(v: Vector4): Vector4; + max(v: Vector4): Vector4; + clamp(min: Vector4, max: Vector4): Vector4; + clampScalar(min: number, max: number): Vector4; + floor(): Vector4; + ceil(): Vector4; + round(): Vector4; + roundToZero(): Vector4; + /** * Inverts this vector. */ @@ -3887,6 +3913,7 @@ declare module THREE { * Computes length of this vector. */ length(): number; + lengthManhattan(): number; /** * Normalizes this vector. @@ -3901,62 +3928,19 @@ declare module THREE { * Linearly interpolate between this vector and v with alpha factor. */ lerp(v: Vector4, alpha: number): Vector4; - /** - * Clones this vector. - */ - clone(): Vector4; - clamp(min: Vector4, max: Vector4): Vector4; - clampScalar(min: number, max: number): Vector4; - floor(): Vector4; - ceil(): Vector4; - round(): Vector4; - roundToZero(): Vector4; - applyMatrix4(m: Matrix4): Vector4; - min(v: Vector4): Vector4; - max(v: Vector4): Vector4; - addScalar(s: number): Vector4; /** * Checks for strict equality of this vector and v. */ equals(v: Vector4): boolean; - /** - * http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm - * @param m assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) - */ - setAxisAngleFromRotationMatrix(m: Matrix3): Vector4; - - /** - * http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm - * @param q is assumed to be normalized - */ - setAxisAngleFromQuaternion(q: Quaternion): Vector4; - - getComponent(index: number): number; - setComponent(index: number, value: number): void; fromArray(xyzw: number[]): number[]; toArray(): number[]; - lengthManhattan(): number; - /** - * Sets X component of this vector. - */ - setX(x: number): Vector4; /** - * Sets Y component of this vector. + * Clones this vector. */ - setY(y: number): Vector4; - - /** - * Sets Z component of this vector. - */ - setZ(z: number): Vector4; - - /** - * Sets w component of this vector. - */ - setW(w: number): Vector4; + clone(): Vector4; } // Objects ////////////////////////////////////////////////////////////////////////////////// @@ -3970,7 +3954,7 @@ declare module THREE { accumulatedPosWeight: number; accumulatedSclWeight: number; - update(forceUpdate?: boolean): void; + updateMatrixWorld(forceUpdate?: boolean): void; } export class Line extends Object3D { @@ -3980,6 +3964,7 @@ declare module THREE { constructor(geometry?: BufferGeometry, material?: LineDashedMaterial, type?: number); constructor(geometry?: BufferGeometry, material?: LineBasicMaterial, type?: number); constructor(geometry?: BufferGeometry, material?: ShaderMaterial, type?: number); + geometry: Geometry; material: LineBasicMaterial; type: LineType; @@ -3996,11 +3981,12 @@ declare module THREE { constructor(); objects: any[]; + addLevel(object: Object3D, distance?: number): void; getObjectForDistance(distance: number): Object3D; raycast(raycaster: Raycaster, intersects: any): void; update(camera: Camera): void; - clone(): LOD; + clone(object?: LOD): LOD; } export class Mesh extends Object3D { @@ -4010,8 +3996,8 @@ declare module THREE { geometry: Geometry; material: Material; - getMorphTargetIndexByName(name: string): number; updateMorphTargets(): void; + getMorphTargetIndexByName(name: string): number; raycast(raycaster: Raycaster, intersects: any): void; clone(object?: Mesh): Mesh; } @@ -4025,24 +4011,25 @@ declare module THREE { constructor(geometry?: Geometry, material?: MeshPhongMaterial); constructor(geometry?: Geometry, material?: ShaderMaterial); - directionBackwards: boolean; - direction: number; - endKeyframe: number; - mirroredLoop: boolean; - startKeyframe: number; - lastKeyframe: number; - length: number; - time: number; duration: number; // milliseconds + mirroredLoop: boolean; + time: number; + lastKeyframe: number; currentKeyframe: number; + direction: number; + directionBackwards: boolean; + + startKeyframe: number; + endKeyframe: number; + length: number; - setDirectionForward(): void; - playAnimation(label: string, fps: number): void; setFrameRange(start: number, end: number): void; + setDirectionForward(): void; setDirectionBackward(): void; parseAnimations(): void; - updateAnimation(delta: number): void; setAnimationLabel(label: string, start: number, end: number): void; + playAnimation(label: string, fps: number): void; + updateAnimation(delta: number): void; interpolateTargets( a: number, b: number, t: number ): void; clone(object?: MorphAnimMesh): MorphAnimMesh; } @@ -4072,7 +4059,6 @@ declare module THREE { * An instance of Material, defining the object's appearance. Default is a ParticleBasicMaterial with randomised colour. */ material: Material; - sortParticles: boolean; raycast(raycaster: Raycaster, intersects: any): void; @@ -4081,9 +4067,15 @@ declare module THREE { export class Skeleton { constructor(bones: Bone[], boneInverses?: Matrix4[], useVertexTexture?: boolean); - bones: Bone[]; + useVertexTexture: boolean; + identityMatrix: Matrix4; + bones: Bone[]; + boneTextureWidth: number; + boneTextureHeight: number; boneMatrices: Float32Array; + boneTexture: DataTexture; + boneInverses: Matrix4[]; calculateInverses(bone: Bone): void; pose(): void; @@ -4126,8 +4118,8 @@ declare module THREE { export interface Renderer { render(scene: Scene, camera: Camera): void; - setSize(width:number, height:number, updateStyle?:boolean): void; - domElement: HTMLCanvasElement; + setSize(width:number, height:number, updateStyle?:boolean): void; + domElement: HTMLCanvasElement; } export interface CanvasRendererParameters { @@ -4138,26 +4130,31 @@ declare module THREE { export class CanvasRenderer implements Renderer { constructor(parameters?: CanvasRendererParameters); - info: { render: { vertices: number; faces: number; }; }; domElement: HTMLCanvasElement; devicePixelRatio: number; autoClear: boolean; sortObjects: boolean; sortElements: boolean; + info: { render: { vertices: number; faces: number; }; }; - getMaxAnisotropy(): number; - render(scene: Scene, camera: Camera): void; - clear(): void; + supportsVertexTextures(): void; + setFaceCulling(): void; + setSize(width: number, height: number, updateStyle?: boolean): void; + setViewport(x: number, y: number, width: number, height: number): void; + setScissor(): void; + enableScissorTest(): void; setClearColor(color: Color, opacity?: number): void; setClearColor(color: string, opacity?: number): void; setClearColor(color: number, opacity?: number): void; - setFaceCulling(): void; - supportsVertexTextures(): void; - setSize(width: number, height: number, updateStyle?: boolean): void; setClearColorHex(hex: number, alpha?: number): void; getClearColor(): Color; getClearAlpha(): number; - setViewport(x: number, y: number, width: number, height: number): void; + getMaxAnisotropy(): number; + clear(): void; + clearColor(): void; + clearDepth(): void; + clearStencil(): void; + render(scene: Scene, camera: Camera): void; } export interface RendererPlugin { @@ -4240,6 +4237,8 @@ declare module THREE { //context:WebGLRenderingContext; context: any; + devicePixelRatio: number; + /** * Defines whether the renderer should automatically clear its output before rendering. */ @@ -4351,7 +4350,6 @@ declare module THREE { }; shadowMapPlugin: ShadowMapPlugin; - devicePixelRatio: number; /** * Return the WebGL context. @@ -4365,6 +4363,8 @@ declare module THREE { supportsFloatTextures(): boolean; supportsStandardDerivatives(): boolean; supportsCompressedTextureS3TC(): boolean; + getMaxAnisotropy(): number; + getPrecision(): string; /** * Resizes the output canvas to (width, height), and also sets the viewport to fit that size, starting in (0, 0). @@ -4393,6 +4393,17 @@ declare module THREE { setClearColor(color: string, alpha?: number): void; setClearColor(color: number, alpha?: number): void; + /** + * Sets the clear color, using hex for the color and alpha for the opacity. + * + * @example + * // Creates a renderer with black background + * var renderer = new THREE.WebGLRenderer(); + * renderer.setSize(200, 100); + * renderer.setClearColorHex(0x000000, 1); + */ + setClearColorHex(hex: number, alpha: number): void; + /** * Returns a THREE.Color instance with the current clear color. */ @@ -4412,6 +4423,7 @@ declare module THREE { clearColor(): void; clearDepth(): void; clearStencil(): void; + clearTarget(renderTarget:WebGLRenderTarget, color: boolean, depth: boolean, stencil: boolean): void; /** * Initialises the postprocessing plugin, and adds it to the renderPluginsPost array. @@ -4453,26 +4465,12 @@ declare module THREE { * @param frontFace "ccw" or "cw */ setFaceCulling(cullFace?: CullFace, frontFace?: FrontFaceDirection): void; + setMaterialFaces(material: Material): void; setDepthTest(depthTest: boolean): void; setDepthWrite(depthWrite: boolean): void; setBlending(blending: Blending, blendEquation: BlendingEquation, blendSrc: BlendingSrcFactor, blendDst: BlendingDstFactor): void; setTexture(texture: Texture, slot: number): void; setRenderTarget(renderTarget: RenderTarget): void; - getMaxAnisotropy(): number; - getPrecision(): string; - setMaterialFaces(material: Material): void; - clearTarget(renderTarget:WebGLRenderTarget, color: boolean, depth: boolean, stencil: boolean): void; - - /** - * Sets the clear color, using hex for the color and alpha for the opacity. - * - * @example - * // Creates a renderer with black background - * var renderer = new THREE.WebGLRenderer(); - * renderer.setSize(200, 100); - * renderer.setClearColorHex(0x000000, 1); - */ - setClearColorHex(hex: number, alpha: number): void; } export interface RenderTarget { @@ -4492,6 +4490,7 @@ declare module THREE { export class WebGLRenderTarget implements RenderTarget { constructor(width: number, height: number, options?: WebGLRenderTargetOptions); + width: number; height: number; wrapS: Wrapping; @@ -4506,6 +4505,8 @@ declare module THREE { depthBuffer: boolean; stencilBuffer: boolean; generateMipmaps: boolean; + shareDepthFrom: any; + clone(): WebGLRenderTarget; dispose(): void; @@ -4519,134 +4520,132 @@ declare module THREE { export class WebGLRenderTargetCube extends WebGLRenderTarget { constructor(width: number, height: number, options?: WebGLRenderTargetOptions); + activeCubeFace: number; // PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5 } // Renderers / Renderables ///////////////////////////////////////////////////////////////////// - export class RenderableFace { constructor(); - color: Color; - material: Material; - uvs: Vector2[][]; + id: number; v1: RenderableVertex; v2: RenderableVertex; v3: RenderableVertex; normalModel: Vector3; - vertexNormalsLength: number; - z: number; vertexNormalsModel: Vector3[]; + vertexNormalsLength: number; + color: Color; + material: Material; + uvs: Vector2[][]; + z: number; + } export class RenderableLine { constructor(); + id: number; v1: RenderableVertex; v2: RenderableVertex; - z: number; + vertexColors: Color[]; material: Material; + z: number; } export class RenderableObject { constructor(); + id: number; object: Object; z: number; - id: number; } export class RenderableSprite { constructor(); + id: number; + object: Object; + x: number; + y: number; + z: number; + rotation: number; scale: Vector2; material: Material; - object: Object; - y: number; - x: number; - rotation: number; - z: number; } export class RenderableVertex { constructor(); - visible: boolean; - positionScreen: Vector4; + position: Vector3; positionWorld: Vector3; + positionScreen: Vector4; + visible: boolean; copy(vertex: RenderableVertex): void; } - // Renderers / Shaders ///////////////////////////////////////////////////////////////////// // Renderers / Shaders ///////////////////////////////////////////////////////////////////// export interface ShaderChunk { [name: string]: string; - fog_pars_fragment: string; - fog_fragment: string; - envmap_pars_fragment: string; - envmap_fragment: string; - envmap_pars_vertex: string; - worldpos_vertex: string; - envmap_vertex: string; - map_particle_pars_fragment: string; - map_particle_fragment: string; - map_pars_vertex: string; - map_pars_fragment: string; - map_vertex: string; - map_fragment: string; - lightmap_pars_fragment: string; - lightmap_pars_vertex: string; - lightmap_fragment: string; - lightmap_vertex: string; + + alphamap_fragment: string; + alphamap_pars_fragment: string; + alphatest_fragment: string; bumpmap_pars_fragment: string; - normalmap_pars_fragment: string; - specularmap_pars_fragment: string; - specularmap_fragment: string; - lights_lambert_pars_vertex: string; - lights_lambert_vertex: string; - lights_phong_pars_vertex: string; - lights_phong_vertex: string; - lights_phong_pars_fragment: string; - lights_phong_fragment: string; - color_pars_fragment: string; color_fragment: string; + color_pars_fragment: string; color_pars_vertex: string; color_vertex: string; - skinning_pars_vertex: string; - skinbase_vertex: string; - skinning_vertex: string; + default_vertex: string; + defaultnormal_vertex: string; + envmap_fragment: string; + envmap_pars_fragment: string; + envmap_pars_vertex: string; + envmap_vertex: string; + fog_fragment: string; + fog_pars_fragment: string; + + lightmap_fragment: string; + lightmap_pars_fragment: string; + lightmap_pars_vertex: string; + lightmap_vertex: string; + lights_lambert_pars_vertex: string; + lights_lambert_vertex: string; + lights_phong_fragment: string; + lights_phong_pars_fragment: string; + lights_phong_pars_vertex: string; + lights_phong_vertex: string; + linear_to_gamma_fragment: string; + logdepthbuf_fragment: string; + logdepthbuf_pars_fragment: string; + logdepthbuf_pars_vertex: string; + logdepthbuf_vertex: string; + map_fragment: string; + map_pars_fragment: string; + map_pars_vertex: string; + map_particle_fragment: string; + map_particle_pars_fragment: string; + map_vertex: string; + morphnormal_vertex: string; morphtarget_pars_vertex: string; morphtarget_vertex: string; - default_vertex: string; - morphnormal_vertex: string; - skinnormal_vertex: string; - defaultnormal_vertex: string; - shadowmap_pars_fragment: string; + normalmap_pars_fragment: string; shadowmap_fragment: string; + shadowmap_pars_fragment: string; shadowmap_pars_vertex: string; shadowmap_vertex: string; - alphatest_fragment: string; - linear_to_gamma_fragment: string; + skinbase_vertex: string; + skinning_pars_vertex: string; + skinning_vertex: string; + skinnormal_vertex: string; + specularmap_fragment: string; + specularmap_pars_fragment: string; + worldpos_vertex: string; } export var ShaderChunk: ShaderChunk; - export var UniformsUtils: { - merge(uniforms: any[]): any; - clone(uniforms_src: any): any; - }; - - export var UniformsLib: { - common: any; - bump: any; - normalmap: any; - fog: any; - lights: any; - particle: any; - shadowmap: any; - }; - export interface Shader { uniforms: any; vertexShader: string; @@ -4659,15 +4658,28 @@ declare module THREE { lambert: Shader; phong: Shader; particle_basic: Shader; - depth: Shader; dashed: Shader; + depth: Shader; normal: Shader; normalmap: Shader; cube: Shader; depthRGBA: Shader; }; + export var UniformsLib: { + common: any; + bump: any; + normalmap: any; + fog: any; + lights: any; + particle: any; + shadowmap: any; + }; + export var UniformsUtils: { + merge(uniforms: any[]): any; + clone(uniforms_src: any): any; + }; // Renderers / WebGL ///////////////////////////////////////////////////////////////////// export class WebGLProgram{ @@ -4719,6 +4731,7 @@ declare module THREE { */ export class FogExp2 implements IFog { constructor(hex: number, density?: number); + name: string; color: Color; @@ -4746,13 +4759,12 @@ declare module THREE { * If not null, it will force everything in the scene to be rendered with that material. Default is null. */ overrideMaterial: Material; + autoUpdate: boolean; /** * Default is false. */ matrixAutoUpdate: boolean; - - autoUpdate: boolean; } // Textures ///////////////////////////////////////////////////////////////////// @@ -4769,7 +4781,11 @@ declare module THREE { magFilter?: TextureFilter, minFilter?: TextureFilter, anisotropy?: number - ); + ); + + image: { width: number; height: number; }; + mipmaps: ImageData[]; + generateMipmaps: boolean; clone(): CompressedTexture; } @@ -4785,7 +4801,7 @@ declare module THREE { format?: PixelFormat, type?: TextureDataType, anisotropy?: number - ); + ); images: any[]; @@ -4805,7 +4821,9 @@ declare module THREE { magFilter: TextureFilter, minFilter: TextureFilter, anisotropy?: number - ); + ); + + image: { data: ImageData; width: number; height: number; }; clone(): DataTexture; } @@ -4856,33 +4874,33 @@ declare module THREE { anisotropy?: number ); + id: number; + uuid: string; + name: string; image: any; // HTMLImageElement or ImageData ; + mipmaps: ImageData[]; mapping: Mapping; wrapS: Wrapping; wrapT: Wrapping; magFilter: TextureFilter; minFilter: TextureFilter; + anisotropy: number; format: PixelFormat; type: TextureDataType; - anisotropy: number; - needsUpdate: boolean; - repeat: Vector2; offset: Vector2; - name: string; + repeat: Vector2; generateMipmaps: boolean; - flipY: boolean; - mipmaps: ImageData[]; - unpackAlignment: number; premultiplyAlpha: boolean; + flipY: boolean; + unpackAlignment: number; + needsUpdate: boolean; onUpdate: () => void; - id: number; - - clone(): Texture; - dispose(): void; - static DEFAULT_IMAGE: any; static DEFAULT_MAPPING: any; + clone(): Texture; + update(): void; + dispose(): void; // EventDispatcher mixins addEventListener(type: string, listener: (event: any) => void ): void; @@ -4900,23 +4918,23 @@ declare module THREE { } export var FontUtils: { - - divisions: number; - style: string; - weight: string; - face: string; faces: { [weight: string]: { [style: string]: Face3; }; }; + face: string; + weight: string; + style: string; size: number; + divisions: number; + getFace(): Face3; + loadFace(data: TypefaceData): TypefaceData; drawText(text: string): { paths: Path[]; offset: number; }; + extractGlyphPoints(c: string, face: Face3, scale: number, offset: number, path: Path): { offset: number; path: Path; }; + + generateShapes(text: string, parameters?: { size?: number; curveSegments?: number; font?: string; weight?: string; style?: string; }): Shape[]; Triangulate: { (contour: Vector2[], indices: boolean): Vector2[]; area(contour: Vector2[]): number; }; - extractGlyphPoints(c: string, face: Face3, scale: number, offset: number, path: Path): { offset: number; path: Path; }; - generateShapes(text: string, parameters?: { size?: number; curveSegments?: number; font?: string; weight?: string; style?: string; }): Shape[]; - loadFace(data: TypefaceData): TypefaceData; - getFace(): Face3; }; export var GeometryUtils: { @@ -4933,16 +4951,16 @@ declare module THREE { export var ImageUtils: { crossOrigin: string; - generateDataTexture(width: number, height: number, color: Color): DataTexture; loadTexture(url: string, mapping?: Mapping, onLoad?: (texture: Texture) => void, onError?: (message: string) => void): Texture; - loadTextureCube(array: string[], mapping?: Mapping, onLoad?: () => void , onError?: (message: string) => void ): Texture; + loadTextureCube(array: string[], mapping?: Mapping, onLoad?: (texture: Texture) => void , onError?: (message: string) => void ): Texture; getNormalMap(image: HTMLImageElement, depth?: number): HTMLCanvasElement; + generateDataTexture(width: number, height: number, color: Color): DataTexture; }; export var SceneUtils: { createMultiMaterialObject(geometry: Geometry, materials: Material[]): Object3D; - attach(child: Object3D, scene: Scene, parent: Object3D): void; detach(child: Object3D, parent: Object3D, scene: Scene): void; + attach(child: Object3D, scene: Scene, parent: Object3D): void; }; // Extras / Animation ///////////////////////////////////////////////////////////////////// @@ -4979,6 +4997,7 @@ declare module THREE { loop: boolean; weight: number; keyTypes: string[]; + interpolationType: number; play(startTime?: number, weight?: number): void; stop(): void; @@ -5002,21 +5021,6 @@ declare module THREE { update(deltaTimeMS: number): void; }; - export class MorphAnimation { - constructor(mesh: Mesh); - - mesh: Mesh; - frames: number; - currentTime: number; - duration: number; - loop: boolean; - isPlaying: boolean; - - play(): void; - pause(): void; - update(deltaTimeMS: number): void; - } - export class KeyFrameAnimation { constructor(data: any); @@ -5036,102 +5040,20 @@ declare module THREE { getPrevKeyWith(type: string, h: number, key: number): KeyFrame; } - // Extras / Curves ///////////////////////////////////////////////////////////////////// - export class ArcCurve extends EllipseCurve { - constructor(aX: number, aY: number, aRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean ); + export class MorphAnimation { + constructor(mesh: Mesh); + + mesh: Mesh; + frames: number; + currentTime: number; + duration: number; + loop: boolean; + isPlaying: boolean; + + play(): void; + pause(): void; + update(deltaTimeMS: number): void; } - export class ClosedSplineCurve3 extends Curve { - constructor( points:Vector3[] ); - - points:Vector3[]; - - getPoint(t: number): Vector3; - } - export class CubicBezierCurve extends Curve { - constructor( v0: Vector2, v1: Vector2, v2: Vector2, v3: Vector2 ); - - v0: Vector2; - v1: Vector2; - v2: Vector2; - v3: Vector2; - - getPoint(t: number): Vector2; - } - export class CubicBezierCurve3 extends Curve { - constructor( v0: Vector3, v1: Vector3, v2: Vector3, v3: Vector3 ); - - v0: Vector3; - v1: Vector3; - v2: Vector3; - v3: Vector3; - - getPoint(t: number): Vector3; - } - export class EllipseCurve extends Curve { - constructor( aX: number, aY: number, xRadius: number, yRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean ); - - aX: number; - aY: number; - xRadius: number; - yRadius: number; - aStartAngle: number; - aEndAngle: number; - aClockwise: boolean; - - getPoint(t: number): Vector2; - } - export class LineCurve extends Curve { - constructor( v1: Vector2, v2: Vector2 ); - - v1: Vector2; - v2: Vector2; - - getPoint(t: number): Vector2; - getPointAt(u: number): Vector2; - getTangent(t: number): Vector2; - } - export class LineCurve3 extends Curve { - constructor( v1: Vector3, v2: Vector3 ); - - v1: Vector3; - v2: Vector3; - - getPoint(t: number): Vector3; - } - export class QuadraticBezierCurve extends Curve { - constructor( v0: Vector2, v1: Vector2, v2: Vector2 ); - - v0: Vector2; - v1: Vector2; - v2: Vector2; - - getPoint(t: number): Vector2; - getTangent(t: number): Vector2; - } - export class QuadraticBezierCurve3 extends Curve { - constructor( v0: Vector3, v1: Vector3, v2: Vector3 ); - - v0: Vector3; - v1: Vector3; - v2: Vector3; - - getPoint(t: number): Vector3; - } - export class SplineCurve extends Curve { - constructor( points: Vector2[] ); - - points:Vector2[]; - - getPoint(t: number): Vector2; - } - export class SplineCurve3 extends Curve { - constructor( points: Vector3[] ); - - points:Vector3[]; - - getPoint(t: number): Vector3; - } - // Extras / Core ///////////////////////////////////////////////////////////////////// @@ -5140,8 +5062,6 @@ declare module THREE { * class Curve<T extends Vector> */ export class Curve { - needsUpdate: boolean; - /** * Returns a vector for point t of the curve where t is between 0 and 1 * getPoint(t: number): T; @@ -5223,29 +5143,31 @@ declare module THREE { bends: Path[]; autoClose: boolean; - getWrapPoints(oldPts: Vector2[], path: Path): Vector2[]; - createPointsGeometry(divisions: number): Geometry; - addWrapPath(bendpath: Path): void; - createGeometry(points: Vector2[]): Geometry; add(curve: Curve): void; - getTransformedSpacedPoints(segments: number, bends?: Path[]): Vector2[]; - createSpacedPointsGeometry(divisions: number): Geometry; - closePath(): void; - getBoundingBox(): BoundingBox; - getCurveLengths(): number; - getTransformedPoints(segments: number, bends?: Path): Vector2[]; checkConnection(): boolean; + closePath(): void; + getPoint(t: number): Vector; + getLength(): number; + getCurveLengths(): number; + getBoundingBox(): BoundingBox; + createPointsGeometry(divisions: number): Geometry; + createSpacedPointsGeometry(divisions: number): Geometry; + createGeometry(points: Vector2[]): Geometry; + addWrapPath(bendpath: Path): void; + getTransformedPoints(segments: number, bends?: Path): Vector2[]; + getTransformedSpacedPoints(segments: number, bends?: Path[]): Vector2[]; + getWrapPoints(oldPts: Vector2[], path: Path): Vector2[]; } export class Gyroscope extends Object3D { constructor(); - scaleWorld: Vector3; translationWorld: Vector3; - quaternionWorld: Quaternion; translationObject: Vector3; - scaleObject: Vector3; + quaternionWorld: Quaternion; quaternionObject: Quaternion; + scaleWorld: Vector3; + scaleObject: Vector3; updateMatrixWorld(force?: boolean): void; } @@ -5283,6 +5205,8 @@ declare module THREE { absarc(aX: number, aY: number, aRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean): void; ellipse(aX: number, aY: number, xRadius: number, yRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean): void; absellipse(aX: number, aY: number, xRadius: number, yRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean): void; + getSpacedPoints(divisions?: number, closedPath?: boolean): Vector[]; + getPoints(divisions?: number, closedPath?: boolean): Vector[]; toShapes(): Shape[]; } @@ -5294,22 +5218,120 @@ declare module THREE { holes: Path[]; + extrude(options?: any): ExtrudeGeometry; makeGeometry(options?: any): ShapeGeometry; + getPointsHoles(divisions: number): Vector2[][]; + getSpacedPointsHoles(divisions: number): Vector2[][]; extractAllPoints(divisions: number): { shape: Vector2[]; holes: Vector2[][]; }; - extrude(options?: any): ExtrudeGeometry; extractPoints(divisions: number): Vector2[]; extractAllSpacedPoints(divisions: Vector2): { shape: Vector2[]; holes: Vector2[][]; }; - getPointsHoles(divisions: number): Vector2[][]; - getSpacedPointsHoles(divisions: number): Vector2[][]; + } + // Extras / Curves ///////////////////////////////////////////////////////////////////// + export class ArcCurve extends EllipseCurve { + constructor(aX: number, aY: number, aRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean ); + } + export class ClosedSplineCurve3 extends Curve { + constructor( points?:Vector3[] ); + + points:Vector3[]; + + getPoint(t: number): Vector3; + } + + export class CubicBezierCurve extends Curve { + constructor( v0: Vector2, v1: Vector2, v2: Vector2, v3: Vector2 ); + + v0: Vector2; + v1: Vector2; + v2: Vector2; + v3: Vector2; + + getPoint(t: number): Vector2; + getTangent(t: number): Vector2; + } + export class CubicBezierCurve3 extends Curve { + constructor( v0: Vector3, v1: Vector3, v2: Vector3, v3: Vector3 ); + + v0: Vector3; + v1: Vector3; + v2: Vector3; + v3: Vector3; + + getPoint(t: number): Vector3; + } + export class EllipseCurve extends Curve { + constructor( aX: number, aY: number, xRadius: number, yRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean ); + + aX: number; + aY: number; + xRadius: number; + yRadius: number; + aStartAngle: number; + aEndAngle: number; + aClockwise: boolean; + + getPoint(t: number): Vector2; + } + export class LineCurve extends Curve { + constructor( v1: Vector2, v2: Vector2 ); + + v1: Vector2; + v2: Vector2; + + getPoint(t: number): Vector2; + getPointAt(u: number): Vector2; + getTangent(t: number): Vector2; + } + export class LineCurve3 extends Curve { + constructor( v1: Vector3, v2: Vector3 ); + + v1: Vector3; + v2: Vector3; + + getPoint(t: number): Vector3; + } + export class QuadraticBezierCurve extends Curve { + constructor( v0: Vector2, v1: Vector2, v2: Vector2 ); + + v0: Vector2; + v1: Vector2; + v2: Vector2; + + getPoint(t: number): Vector2; + getTangent(t: number): Vector2; + } + export class QuadraticBezierCurve3 extends Curve { + constructor( v0: Vector3, v1: Vector3, v2: Vector3 ); + + v0: Vector3; + v1: Vector3; + v2: Vector3; + + getPoint(t: number): Vector3; + } + export class SplineCurve extends Curve { + constructor( points?: Vector2[] ); + + points:Vector2[]; + + getPoint(t: number): Vector2; + } + export class SplineCurve3 extends Curve { + constructor( points?: Vector3[] ); + + points:Vector3[]; + + getPoint(t: number): Vector3; + } // Extras / Geomerties ///////////////////////////////////////////////////////////////////// /** @@ -5325,10 +5347,33 @@ declare module THREE { * @param depthSegments — Number of segmented faces along the depth of the sides. */ constructor(width: number, height: number, depth: number, widthSegments?: number, heightSegments?: number, depthSegments?: number); + + parameters: { + width: number; + height: number; + depth: number; + widthSegments: number; + heightSegments: number; + depthSegments: number; + }; + widthSegments: number; + heightSegments: number; + depthSegments: number; } export class CircleGeometry extends Geometry { constructor(radius?: number, segments?: number, thetaStart?: number, thetaLength?: number); + + parameters: { + radius: number; + segments: number; + thetaStart: number; + thetaLength: number; + }; + radius: number; + segments: number; + thetaStart: number; + thetaLength: number; } export class CubeGeometry extends BoxGeometry { @@ -5344,6 +5389,21 @@ declare module THREE { * @param openEnded - A Boolean indicating whether or not to cap the ends of the cylinder. */ constructor(radiusTop?: number, radiusBottom?: number, height?: number, radiusSegments?: number, heightSegments?: number, openEnded?: boolean); + + parameters: { + radiusTop: number; + radiusBottom: number; + height: number; + radialSegments: number; + heightSegments: number; + openEnded: boolean; + }; + radiusTop: number; + radiusBottom: number; + height: number; + radialSegments: number; + heightSegments: number; + openEnded: boolean; } export class ExtrudeGeometry extends Geometry { @@ -5356,14 +5416,29 @@ declare module THREE { export class IcosahedronGeometry extends PolyhedronGeometry { constructor(radius: number, detail: number); + + parameters: { + radius: number; + detail: number; + }; + radius: number; + detail: number; } export class LatheGeometry extends Geometry { - constructor(points: Vector3[], steps?: number, angle?: number); + constructor(points: Vector3[], segments?: number, phiStart?: number, phiLength?: number); + } export class OctahedronGeometry extends PolyhedronGeometry { constructor(radius: number, detail: number); + + parameters: { + radius: number; + detail: number; + }; + radius: number; + detail: number; } export class ParametricGeometry extends Geometry { @@ -5372,6 +5447,17 @@ declare module THREE { export class PlaneGeometry extends Geometry { constructor(width: number, height: number, widthSegments?: number, heightSegments?: number); + + parameters: { + width: number; + height: number; + widthSegments: number; + heightSegments: number; + }; + width: number; + height: number; + widthSegments: number; + heightSegments: number; } export class PolyhedronGeometry extends Geometry { @@ -5381,6 +5467,7 @@ declare module THREE { export class RingGeometry extends Geometry { constructor(innerRadius?: number, outerRadius?: number, thetaSegments?: number, phiSegments?: number, thetaStart?: number, thetaLength?: number); } + export class ShapeGeometry extends Geometry { constructor(shape: Shape, options?: any); constructor(shapes: Shape[], options?: any); @@ -5397,14 +5484,31 @@ declare module THREE { * The geometry is created by sweeping and calculating vertexes around the Y axis (horizontal sweep) and the Z axis (vertical sweep). Thus, incomplete spheres (akin to 'sphere slices') can be created through the use of different values of phiStart, phiLength, thetaStart and thetaLength, in order to define the points in which we start (or end) calculating those vertices. * * @param radius — sphere radius. Default is 50. - * @param segmentsWidth — number of horizontal segments. Minimum value is 3, and the default is 8. - * @param segmentsHeight — number of vertical segments. Minimum value is 2, and the default is 6. + * @param widthSegments — number of horizontal segments. Minimum value is 3, and the default is 8. + * @param heightSegments — number of vertical segments. Minimum value is 2, and the default is 6. * @param phiStart — specify horizontal starting angle. Default is 0. * @param phiLength — specify horizontal sweep angle size. Default is Math.PI * 2. * @param thetaStart — specify vertical starting angle. Default is 0. * @param thetaLength — specify vertical sweep angle size. Default is Math.PI. */ constructor(radius: number, widthSegments?: number, heightSegments?: number, phiStart?: number, phiLength?: number, thetaStart?: number, thetaLength?: number); + + parameters: { + radius: number; + widthSegments: number; + heightSegments: number; + phiStart: number; + phiLength: number; + thetaStart: number; + thetaLength: number; + }; + radius: number; + widthSegments: number; + heightSegments: number; + phiStart: number; + phiLength: number; + thetaStart: number; + thetaLength: number; } export class TetrahedronGeometry extends PolyhedronGeometry { @@ -5429,19 +5533,56 @@ declare module THREE { export class TorusGeometry extends Geometry { constructor(radius?: number, tube?: number, radialSegments?: number, tubularSegments?: number, arc?: number); + + parameters: { + radius: number; + tube: number; + radialSegments: number; + tubularSegments: number; + arc: number; + }; + radius: number; + tube: number; + radialSegments: number; + tubularSegments: number; + arc: number; } export class TorusKnotGeometry extends Geometry { constructor(radius?: number, tube?: number, radialSegments?: number, tubularSegments?: number, p?: number, q?: number, heightScale?: number); + + parameters: { + radius: number; + tube: number; + radialSegments: number; + tubularSegments: number; + p: number; + q: number; + heightScale: number; + }; + radius: number; + tube: number; + radialSegments: number; + tubularSegments: number; + p: number; + q: number; + heightScale: number; } export class TubeGeometry extends Geometry { constructor(path: Path, segments?: number, radius?: number, radiusSegments?: number, closed?: boolean); + parameters: { + path: Path; + segments: number; + radius: number; + radialSegments: number; + closed: boolean; + }; path: Path; segments: number; radius: number; - radiusSegments: number; + radialSegments: number; closed: boolean; tangents: Vector3[]; normals: Vector3[]; @@ -5458,29 +5599,26 @@ declare module THREE { line: Line; cone: Mesh; - setColor(hex: number): void; - setLength(length: number): void; setDirection(dir: Vector3): void; + setLength(length: number): void; + setColor(hex: number): void; } export class AxisHelper extends Line { - constructor(size: number); + constructor(size?: number); } export class BoundingBoxHelper extends Mesh { - constructor(object: Object3D, hex: number); + constructor(object: Object3D, hex?: number); object: Object3D; - vertices: Vector3[]; + box: Box3[]; update(): void; } export class BoxHelper extends Line { - constructor(object: Object3D); - - object: Object3D; - box: Box3; + constructor(object?: Object3D); update(object?: Object3D): void; } @@ -5488,35 +5626,33 @@ declare module THREE { export class CameraHelper extends Line { constructor(camera: Camera); - pointMap: { [id: string]: number[]; }; camera: Camera; + pointMap: { [id: string]: number[]; }; update(): void; } export class DirectionalLightHelper extends Object3D { - constructor(light: Light, size: number); + constructor(light: Light, size?: number); - lightPlane: Line; light: Light; + lightPlane: Line; targetLine: Line; - update(): void; dispose(): void; + update(): void; } export class EdgesHelper extends Line { constructor(object: Object3D, hex?: number); - matrixAutoUpdate: boolean; - matrixWorld: Matrix4; } export class FaceNormalsHelper extends Line { constructor(object: Object3D, size?: number, hex?: number, linewidth?: number); + object: Object3D; size: number; - matrixAutoUpdate: boolean; normalMatrix: Matrix3; update(object?: Object3D): void; @@ -5525,23 +5661,28 @@ declare module THREE { export class GridHelper extends Line { constructor(size: number, step: number); + color1: Color; + color2: Color; + setColors(colorCenterLine: number, colorGrid: number): void; } export class HemisphereLightHelper extends Object3D { constructor(light: Light, sphereSize: number, arrowLength: number, domeSize: number); - lightSphere: Mesh; light: Light; + colors: Color[]; + lightSphere: Mesh; + dispose(): void; update(): void; } export class PointLightHelper extends Object3D { constructor(light: Light, sphereSize: number); - lightSphere: Mesh; light: Light; + dispose(): void; update(): void; } @@ -5550,8 +5691,7 @@ declare module THREE { bones: Bone[]; root: Object3D; - matrixWorld: Matrix4; - matrixAutoUpdate: boolean; + getBoneList(object: Object3D): Bone[]; update(): void; } @@ -5559,18 +5699,18 @@ declare module THREE { export class SpotLightHelper extends Object3D { constructor(light: Light, sphereSize: number, arrowLength: number); - lightSphere: Mesh; light: Light; - lightCone: Mesh; + cone: Mesh; + dispose(): void; update(): void; } export class VertexNormalsHelper extends Line { constructor(object: Object3D, size?: number, hex?: number, linewidth?: number); + object: Object3D; size: number; - matrixAutoUpdate: boolean; normalMatrix: Matrix3; update(object?: Object3D): void; @@ -5579,8 +5719,8 @@ declare module THREE { export class VertexTangentsHelper extends Line { constructor(object: Object3D, size?: number, hex?: number, linewidth?: number); + object: Object3D; size: number; - matrixAutoUpdate: boolean; update(object?: Object3D): void; } @@ -5588,8 +5728,6 @@ declare module THREE { export class WireframeHelper extends Line { constructor(object: Object3D, hex?: number); - matrixAutoUpdate: boolean; - matrixWorld: Matrix4; } // Extras / Objects ///////////////////////////////////////////////////////////////////// @@ -5650,19 +5788,19 @@ declare module THREE { animationsMap: { [name: string]: MorphBlendMeshAnimation; }; animationsList: MorphBlendMeshAnimation[]; - setAnimationWeight(name: string, weight: number): void; - setAnimationFPS(name: string, fps: number): void; createAnimation(name: string, start: number, end: number, fps: number): void; - playAnimation(name: string): void; - update(delta: number): void; autoCreateAnimations(fps: number): void; - setAnimationDuration(name: string, duration: number): void; setAnimationDirectionForward(name: string): void; - getAnimationDuration(name: string): number; - getAnimationTime(name: string): number; setAnimationDirectionBackward(name: string): void; + setAnimationFPS(name: string, fps: number): void; + setAnimationDuration(name: string, duration: number): void; + setAnimationWeight(name: string, weight: number): void; setAnimationTime(name: string, time: number): void; + getAnimationTime(name: string): number; + getAnimationDuration(name: string): number; + playAnimation(name: string): void; stopAnimation(name: string): void; + update(delta: number): void; } // Extras / Renderers / Plugins ///////////////////////////////////////////////////////////////////// @@ -5674,8 +5812,8 @@ declare module THREE { renderTarget: RenderTarget; init(renderer: Renderer): void; - update(scene: Scene, camera: Camera): void; render(scene: Scene, camera: Camera): void; + update(scene: Scene, camera: Camera): void; } export class LensFlarePlugin implements RendererPlugin { @@ -5689,9 +5827,8 @@ declare module THREE { constructor(); init(renderer: Renderer): void; - - update(scene: Scene, camera: Camera): void; render(scene: Scene, camera: Camera): void; + update(scene: Scene, camera: Camera): void; } export class SpritePlugin implements RendererPlugin { From 867cede314770e5ebf2f3db1c973ba255db70f79 Mon Sep 17 00:00:00 2001 From: satoru kimura Date: Mon, 25 Aug 2014 02:05:22 +0900 Subject: [PATCH 059/537] Modified the test code. --- threejs/tests/canvas/canvas_camera_orthographic.ts | 4 ++-- threejs/tests/canvas/canvas_geometry_cube.ts | 6 +++--- threejs/tests/canvas/canvas_materials.ts | 8 ++++---- threejs/three.d.ts | 2 ++ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/threejs/tests/canvas/canvas_camera_orthographic.ts b/threejs/tests/canvas/canvas_camera_orthographic.ts index 0674e6fa4..7391d978b 100644 --- a/threejs/tests/canvas/canvas_camera_orthographic.ts +++ b/threejs/tests/canvas/canvas_camera_orthographic.ts @@ -55,12 +55,12 @@ // Cubes - var geometry = new THREE.BoxGeometry(50, 50, 50); + var geometry2 = new THREE.BoxGeometry(50, 50, 50); var material2 = new THREE.MeshLambertMaterial({ color: 0xffffff, shading: THREE.FlatShading, overdraw: 0.5 }); for (var i = 0; i < 100; i++) { - var cube = new THREE.Mesh(geometry, material2); + var cube = new THREE.Mesh(geometry2, material2); cube.scale.y = Math.floor(Math.random() * 2 + 1); diff --git a/threejs/tests/canvas/canvas_geometry_cube.ts b/threejs/tests/canvas/canvas_geometry_cube.ts index bf5f9ae99..c8f6b377c 100644 --- a/threejs/tests/canvas/canvas_geometry_cube.ts +++ b/threejs/tests/canvas/canvas_geometry_cube.ts @@ -61,12 +61,12 @@ // Plane - var geometry = new THREE.PlaneGeometry(200, 200); - geometry.applyMatrix(new THREE.Matrix4().makeRotationX(- Math.PI / 2)); + var geometry2 = new THREE.PlaneGeometry(200, 200); + geometry2.applyMatrix(new THREE.Matrix4().makeRotationX(- Math.PI / 2)); var material = new THREE.MeshBasicMaterial({ color: 0xe0e0e0, overdraw: 0.5 }); - plane = new THREE.Mesh(geometry, material); + plane = new THREE.Mesh(geometry2, material); scene.add(plane); renderer = new THREE.CanvasRenderer(); diff --git a/threejs/tests/canvas/canvas_materials.ts b/threejs/tests/canvas/canvas_materials.ts index a39a780ca..0d8f8a631 100644 --- a/threejs/tests/canvas/canvas_materials.ts +++ b/threejs/tests/canvas/canvas_materials.ts @@ -50,7 +50,7 @@ // Spheres - var geometry = new THREE.SphereGeometry(100, 14, 7); + var geometry2 = new THREE.SphereGeometry(100, 14, 7); materials = [ @@ -66,9 +66,9 @@ ]; - for (var i = 0, l = geometry.faces.length; i < l; i++) { + for (var i = 0, l = geometry2.faces.length; i < l; i++) { - var face = geometry.faces[i]; + var face = geometry2.faces[i]; if (Math.random() > 0.5) face.materialIndex = Math.floor(Math.random() * materials.length); } @@ -79,7 +79,7 @@ for (var i = 0, l = materials.length; i < l; i++) { - var sphere = new THREE.Mesh(geometry, materials[i]); + var sphere = new THREE.Mesh(geometry2, materials[i]); sphere.position.x = (i % 5) * 200 - 400; sphere.position.z = Math.floor(i / 5) * 200 - 200; diff --git a/threejs/three.d.ts b/threejs/three.d.ts index fa6208990..3bace7645 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -93,7 +93,9 @@ declare module THREE { } export var UVMapping: MappingConstructor; export var CubeReflectionMapping: MappingConstructor; + export var CubeRefractionMapping: MappingConstructor; export var SphericalReflectionMapping: MappingConstructor; + export var SphericalRefractionMapping: MappingConstructor; // Wrapping modes export enum Wrapping { } From 36f1e022bb01d627eb23319f9ea525d2d8ffe4d9 Mon Sep 17 00:00:00 2001 From: vvakame Date: Mon, 25 Aug 2014 10:50:47 +0900 Subject: [PATCH 060/537] improve slickgrid definition --- slickgrid/SlickGrid.d.ts | 2 +- slickgrid/slick.rowselectionmodel.d.ts | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 slickgrid/slick.rowselectionmodel.d.ts diff --git a/slickgrid/SlickGrid.d.ts b/slickgrid/SlickGrid.d.ts index d8a365d94..7301ecb1a 100644 --- a/slickgrid/SlickGrid.d.ts +++ b/slickgrid/SlickGrid.d.ts @@ -1186,7 +1186,7 @@ declare module Slick { // #region Editors public getEditorLock(): EditorLock; - public getEditController(): Editors.Editor; + public getEditController(): { commitCurrentEdit():boolean; cancelCurrentEdit():boolean; }; // #endregion Editors } diff --git a/slickgrid/slick.rowselectionmodel.d.ts b/slickgrid/slick.rowselectionmodel.d.ts new file mode 100644 index 000000000..c2543abfc --- /dev/null +++ b/slickgrid/slick.rowselectionmodel.d.ts @@ -0,0 +1,20 @@ +// Type definitions for SlickGrid RowSelectionModel Plugin 2.1.0 +// Project: https://github.com/mleibman/SlickGrid +// Definitions by: Derek Cicerone +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Slick { + class RowSelectionModel extends SelectionModel { + constructor(options?:{selectActiveRow:boolean;}); + + getSelectedRows():number[]; + + setSelectedRows(rows:number[]):void; + + getSelectedRanges():number[]; + + setSelectedRanges(ranges:number[]):void; + } +} From 79cc15e42db4b28764105e52ddc96869be68a1b7 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Date: Mon, 25 Aug 2014 03:27:14 -0300 Subject: [PATCH 061/537] augmented scope, fix implicit any tests --- .../angular-ui-bootstrap-tests.ts | 6 ++-- .../angular-ui-bootstrap.d.ts | 32 +++++++++++++++++-- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts index 8ed8be859..608591b58 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts @@ -118,7 +118,7 @@ testApp.config(( }); testApp.controller('TestCtrl', ( - $scope: ng.IScope, + $scope: ng.ui.bootstrap.IModalScope, $log: ng.ILogService, $modal: ng.ui.bootstrap.IModalService, $modalStack: ng.ui.bootstrap.IModalStackService, @@ -147,9 +147,9 @@ testApp.controller('TestCtrl', ( $log.log('modal opened'); }); - modalInstance.result.then(closeResult=> { + modalInstance.result.then((closeResult:any)=> { $log.log('modal closed', closeResult); - }, dismissResult=> { + }, (dismissResult:any)=> { $log.log('modal dismissed', dismissResult); }); diff --git a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts index 2d792d1b1..ad90dc9db 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular UI Bootstrap 0.10.0 +// Type definitions for Angular UI Bootstrap 0.11.0 // Project: https://github.com/angular-ui/bootstrap // Definitions by: Brian Surowiec // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -198,6 +198,22 @@ declare module ng.ui.bootstrap { opened: ng.IPromise; } + interface IModalScope extends ng.IScope { + /** + * Those methods make it easy to close a modal window without a need to create a dedicated controller + */ + + /** + * Dismiss the dialog without assigning a value to the promise output + */ + $dismiss(reason?: any): void; + + /** + * Close the dialog resolving the promise to the given value + */ + $close(result?: any): void; + } + interface IModalSettings { /** * a path to a template representing modal's content @@ -211,9 +227,9 @@ declare module ng.ui.bootstrap { /** * a scope instance to be used for the modal's content (actually the $modal service is going to create a child scope of a provided scope). - * Defaults to `$rootScope` + * Defaults to `$rootScope`. */ - scope?: any; + scope?: IModalScope; /** * a controller for a modal instance - it can initialize scope used by modal. @@ -246,6 +262,16 @@ declare module ng.ui.bootstrap { * additional CSS class(es) to be added to a modal window template */ windowClass?: string; + + /** + * optional size of modal window. Allowed values: 'sm' (small) or 'lg' (large). Requires Bootstrap 3.1.0 or later + */ + size?: string; + + /** + * a path to a template overriding modal's window template + */ + windowTemplateUrl?: string; } interface IModalStackService { From 5d61f02af8e08fe84b0c004693674a3103dde9ed Mon Sep 17 00:00:00 2001 From: Jakub Olek Date: Tue, 10 Jun 2014 20:26:51 +0200 Subject: [PATCH 062/537] Working on hapi.d.ts --- CONTRIBUTORS.md | 1 + hapi/hapi-tests.ts | 18 ++ hapi/hapi.d.ts | 430 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 449 insertions(+) create mode 100644 hapi/hapi-tests.ts create mode 100644 hapi/hapi.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index bb0933af5..e122304b6 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -117,6 +117,7 @@ All definitions files include a header with the author and editors, so at some p * [Google Translate API](https://developers.google.com/translate/) (by [Frank M](https://github.com/sgtfrankieboy)) * [Google Url Shortener](https://developers.google.com/url-shortener/) (by [Frank M](https://github.com/sgtfrankieboy)) * [Hammer.js](http://eightmedia.github.com/hammer.js/) (by [Boris Yankov](https://github.com/borisyankov)) +* [Hapi](http://github.com/spumko/hapi) (by [Hakubo](http://github.com/hakubo)) * [Handlebars](http://handlebarsjs.com/) (by [Boris Yankov](https://github.com/borisyankov)) * [HashMap](https://github.com/flesler/hashmap) (by [Rafał Wrzeszcz](https://wrzasq.pl)) * [HashSet](http://www.timdown.co.uk/jshashtable/jshashset.html) (by [Sergey Gerasimov](https://github.com/gerich-home)) diff --git a/hapi/hapi-tests.ts b/hapi/hapi-tests.ts new file mode 100644 index 000000000..6617387d8 --- /dev/null +++ b/hapi/hapi-tests.ts @@ -0,0 +1,18 @@ +/// + +import Hapi = require('hapi'); + +// Create a server with a host and port +var server = Hapi.createServer('localhost', 8000); + +// Add the route +server.route({ + method: 'GET', + path: '/hello', + handler: function (request, reply) { + reply('hello world'); + } +}); + +// Start the server +server.start(); diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts new file mode 100644 index 000000000..0914a5367 --- /dev/null +++ b/hapi/hapi.d.ts @@ -0,0 +1,430 @@ +// Type definitions for hapi +// Project: http://github.com/spumko/hapi +// Definitions by: Hakubo +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Hapi { + export interface ServerOptions { + app?: any; + cache?: string; + cache?: { + engine: any; + }; + cors?: boolean; + cors?: { + origin?: Array; + isOriginExposed?: boolean; + matchOrigin?: boolean; + maxAge?: number; + headers?: Array; + additionalHeaders?: Array; + methods?: Array; + additionalMethods?: Array; + exposedHeaders?: Array; + additionalExposedHeaders?: Array; + credentials?: boolean; + }; + security?: boolean; + security?: { + hsts?: boolean; + hsts?: { + maxAge: number; + includeSubdomains: boolean; + }; + xframe?: boolean; + xframe?: string; + xframe?: { + rule: string; + source: any; + }; + xss?: boolean; + noOpen?: boolean; + noSniff?: boolean; + }; + debug?: { + request: Array; + }; + files?: { + relativeTo: string; + etagsCacheMaxSize: number; + }; + json?: { + replacer?: Function; + replacer?: Array; + space?: number; + }; + labels?: Array; + load?: { + maxHeapUsedBytes?: number; + maxRssBytes?: number; + maxEventLoopDelay?: number; + sampleInterval?: number; + }; + location?: string; + payload?: { + maxBytes: number; + uploads: string; + }; + plugins?: any; + router?: { + isCaseSensitive?: boolean; + stripTrailingSlash?: boolean; + }; + state?: { + cookies: { + parse?: boolean; + failAction?: string; + clearInvalid?: boolean; + strictHeader?: boolean; + } + }; + timeout?: { + server?: boolean; + server?: number; + client?: boolean; + client?: number; + socket?: boolean; + socket?: number; + }; + tls?: any; //This should be Node.tls + maxSockets?: number; + validation?: any; + views?: ServerView; + } + + export class Pack { + require(name: string, options: {}, callback: Function): void; + } + + interface ServerView { + engines: { + module: string; + compile: (template: string, options: any): (context: any, options: any); + compile: (template: string, options: any, callback: (err: any, compiled: (context: any, options: any, callback: (err: any, rendered: boolean)))): void; + }; + defaultExtension: string; + path?: string; + partialsPath?: string; + helpersPath?: string; + basePath: string; + layout?: boolean; + layoutPath?: string; + layoutKeyword?: string; + encoding?: string; + isCached?: boolean; + allowAbsolutePaths?: boolean; + allowInsecureAccess?: boolean; + compileOptions?: any; + runtimeOptions?: any; + contentType?: string; + compileMode?: string; + } + + interface RouteOptions { + path: string; + method: string; + vhost?: string; + vhost?: Array; + handler: string; + handler: (); + handler: { + file: string; + file: (request: Request); + file: { + path: string; + filename?: string; + mode?: boolean; + mode?: string; + lookupCompressed: boolean; + }; + directory: { + path: string; + path: Array; + path: (request: Request): string; + path: (request: Request): Array; + index?: boolean; + listing?: boolean; + showHidden?: boolean; + redirectToSlash?: boolean; + lookupCompressed?: boolean; + defaultExtension?: string; + }; + proxy?: { + host?: string; + port?: number; + protocol?: string; + uri?: string; + passThrough?: boolean; + rejectUnauthorized?: boolean; + xforward?: boolean; + redirects?: boolean; + redirects?: number; + timeout?: number; + + mapUri?: (request: Request, callback: (err: any, uri: string, headers: {[key: string]: string}): void): void; + onResponse: ( + err: any, + res: any,//Node Response + req: any,//Node Request + reply: (): void, + settings: any, + ttl: number + ); + ttl: number; + }; + view: string; + view: { + template: string; + context: { + payload: any; + params: any; + query: any; + pre: any; + } + }; + config: { + handler: any; + bind: any; + app: any; + plugins: { + [name: string]: any; + }; + pre: Array<()>; + validate: { + headers: any; + params: any; + query: any; + payload: any; + errorFields?: any; + failAction?: string; + failAction?: (source: string, error: any, next: ()); + }; + payload: { + output: { + data: any; + stream: any; + file: any; + }; + parse?: any; + allow?: string; + allow?: Array; + override?: string; + maxBytes?: number; + uploads?: number; + failAction?: string; + }; + response: { + schema: any; + sample: number; + failAction: string; + }; + cache: { + privacy: string; + expiresIn: number; + expiresAt: number; + }; + auth: string; + auth: boolean; + auth: { + mode: string; + strategies: Array; + payload?: boolean; + payload?: string; + tos?: boolean; + tos?: string; + scope?: string; + scope?: Array; + entity: string; + }; + cors?: boolean; + jsonp?: string; + description?: string; + notes?: string; + notes?: Array; + tags?: Array; + } + }; + } + + export class Server { + app: any; + methods: Array; + info: { + port: number; + host?: string; + protocol?: string; + uri?: string; + }; + listener: any;// Node Http server + load: { + eventLoopDelay: number; + heapUsed: number; + rss: number; + }; + pack: Pack; + plugins: { + [pluginName: string]: any; + }; + + + start(callback?: ()): void; + stop(options?: {timeout: number;}, callback?: ()): void; + route(options: RouteOptions): void; + route(routes: Array): void; + table(host?: string): Array; + log(tags: string, data?: string, timestamp?: number): void; + log(tags: Array, data?: string, timestamp?: number): void; + log(tags: string, data?: any, timestamp?: number): void; + log(tags: Array, data?: any, timestamp?: number): void; + state(name: string, options?: { + ttl: number; + isSecure: boolean; + isHttpOnly: boolean; + path: string; + domain: string; + autoValue: (request: Request, next: (err: any, value: any): void): void; + encoding?: string; + sign: any; + password: string; + iron: any; + }); + views: (options: ServerView): void; + cache: (name: string, options: { + expiresIn: number; + expiresAt: number; + staleIn: number; + staleTimeout: number; + cache: string; + }): void; + + auth: { + scheme: (name: string, scheme: { + name: string; + scheme: (server: Server, options: any): (authenticate: any, payload: any, response: any); + }); + strategy: any; + }; + ext: (event: any, method: string, options?: any): void; + method: (method: Array<{name: string; fn: (); options: any}>): void; + method: (name: string, fn: (), options: any): void; + inject: (options: any, callback: any): void; + handler: (name: string, method: (name: string, options: any): void): void; + } + + export interface Request { + app: any; + auth: { + isAuthenticated: boolean; + credentials: Object; + artifacts: Object; + session: Object + }; + domain: any; + headers: Object; + id: number; + info: { + received: number; + remoteAddress: string; + remotePort: number; + referrer: string; + host: string; + }; + method: string; + mime?: string; + params: any; + path: string; + payload: any; + plugins: Object; + pre: Object; + response: Object; + responses: Object; + query: Object; + raw: { + req: any; //http.ClientRequest + res: any; //http.ClientResponse + }; + route: string; + server: Server; + session: any; + state: Object; + url: Object; + + setUrl? (url: string): void; + setMethod? (method: string): void; + log (tags: string, data?: string, timestamp?: number): void; + log (tags: string, data?: Object, timestamp?: number): void; + log (tags: string[], data?: string, timestamp?: number): void; + log (tags: string[], data?: Object, timestamp?: number): void; + getLog(): string[]; + getLog(tag: string): string[]; + getLog(tags: string[]): string[]; + tail(name?: string): Function; + } + + export interface Response { + statusCode: number; + headers: Object; + source: any; + variety: string; + app: any; + plugins: Object; + settings: { + encoding: string; + charset: string; + location: string; + ttl: number; + stringify: any; + passThrough: boolean; + } + + code (statusCode: number): void; + header (name: string, value: string, options?: { + append: boolean; + separator: string; + override: boolean; + }): void; + type (mimeType: string): void; + bytes (length: number): void; + vary (header: string): void; + location (location: string): void; + created (location: string): void; + redirect (location: string): void; + encoding (encoding: string): void; + charset (charset: string): void; + ttl (ttl: number): void; + state (name: string, value: string, options?: any): void; + unstate (name: string): void; + + replacer (method: Function): void; + replacer (method: Array): void; + spaces (count: number): void; + + temporary (isTemporary: boolean): void; + permanent (isPermanent: boolean): void; + rewritable (isRewritable: boolean): void; + } + + export module reply { + function file(path: string, options: { + filePath: string; + options: { + filename: string; + mode: string + } + }): void; + + function view(template: string, context?: Object, options?: Object): Response; + function close(options?: Object): void; + function proxy(options: Object): void; + + export function reply(result: any): any; + } + + export function createServer (host: string, port: number, options?: ServerOptions): Server; +} + +declare module "hapi" { + export = Hapi; +} From 60bc96cefb2304db0d2f3ad198696157fab065ae Mon Sep 17 00:00:00 2001 From: Jakub Olek Date: Tue, 10 Jun 2014 21:42:36 +0200 Subject: [PATCH 063/537] I have no idea how to do union types for properties and how to use node modules --- hapi/hapi-tests.ts | 10 +- hapi/hapi.d.ts | 394 ++++++++++++++++++++++++--------------------- 2 files changed, 219 insertions(+), 185 deletions(-) diff --git a/hapi/hapi-tests.ts b/hapi/hapi-tests.ts index 6617387d8..fcc870af6 100644 --- a/hapi/hapi-tests.ts +++ b/hapi/hapi-tests.ts @@ -9,10 +9,18 @@ var server = Hapi.createServer('localhost', 8000); server.route({ method: 'GET', path: '/hello', - handler: function (request, reply) { + handler: function (request: Hapi.Request, reply: Function) { reply('hello world'); } }); +server.route([{ + method: 'GET', + path: '/hello2', + handler: function (request: Hapi.Request, reply: Function) { + reply('hello world2'); + } +}]); + // Start the server server.start(); diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index 0914a5367..cf2d966a0 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -8,41 +8,44 @@ declare module Hapi { export interface ServerOptions { app?: any; - cache?: string; - cache?: { - engine: any; - }; - cors?: boolean; - cors?: { - origin?: Array; - isOriginExposed?: boolean; - matchOrigin?: boolean; - maxAge?: number; - headers?: Array; - additionalHeaders?: Array; - methods?: Array; - additionalMethods?: Array; - exposedHeaders?: Array; - additionalExposedHeaders?: Array; - credentials?: boolean; - }; - security?: boolean; - security?: { - hsts?: boolean; - hsts?: { - maxAge: number; - includeSubdomains: boolean; - }; - xframe?: boolean; - xframe?: string; - xframe?: { - rule: string; - source: any; - }; - xss?: boolean; - noOpen?: boolean; - noSniff?: boolean; - }; +// cache?: string; +// cache?: { +// engine: any; +// }; + cache?: any; +// cors?: boolean; +// cors?: { +// origin?: Array; +// isOriginExposed?: boolean; +// matchOrigin?: boolean; +// maxAge?: number; +// headers?: Array; +// additionalHeaders?: Array; +// methods?: Array; +// additionalMethods?: Array; +// exposedHeaders?: Array; +// additionalExposedHeaders?: Array; +// credentials?: boolean; +// }; + cors?: any; +// security?: boolean; +// security?: { +// hsts?: boolean; +// hsts?: { +// maxAge: number; +// includeSubdomains: boolean; +// }; +// xframe?: boolean; +// xframe?: string; +// xframe?: { +// rule: string; +// source: any; +// }; +// xss?: boolean; +// noOpen?: boolean; +// noSniff?: boolean; +// }; + security?: any; debug?: { request: Array; }; @@ -51,8 +54,9 @@ declare module Hapi { etagsCacheMaxSize: number; }; json?: { - replacer?: Function; - replacer?: Array; +// replacer?: () => void; +// replacer?: Array<() => void>; + replacer?: any; space?: number; }; labels?: Array; @@ -81,12 +85,15 @@ declare module Hapi { } }; timeout?: { - server?: boolean; - server?: number; - client?: boolean; - client?: number; - socket?: boolean; - socket?: number; +// server?: boolean; +// server?: number; + server?: any; +// client?: boolean; +// client?: number; + client?: any; +// socket?: boolean; +// socket?: number; + socket?: any; }; tls?: any; //This should be Node.tls maxSockets?: number; @@ -98,11 +105,29 @@ declare module Hapi { require(name: string, options: {}, callback: Function): void; } - interface ServerView { + export interface ServerView { engines: { module: string; - compile: (template: string, options: any): (context: any, options: any); - compile: (template: string, options: any, callback: (err: any, compiled: (context: any, options: any, callback: (err: any, rendered: boolean)))): void; +// compile: ( +// template: string, +// options: any +// ) => void; +// compile: ( +// template: string, +// options: any, +// callback: ( +// err: any, +// compiled: ( +// context: any, +// options: any, +// callback: ( +// err: any, +// rendered: boolean +// ) => void +// ) => void +// ) => void +// ) => void; + compile: any; }; defaultExtension: string; path?: string; @@ -122,135 +147,137 @@ declare module Hapi { compileMode?: string; } - interface RouteOptions { + export interface RouteOptions { path: string; method: string; - vhost?: string; - vhost?: Array; - handler: string; - handler: (); - handler: { - file: string; - file: (request: Request); - file: { - path: string; - filename?: string; - mode?: boolean; - mode?: string; - lookupCompressed: boolean; - }; - directory: { - path: string; - path: Array; - path: (request: Request): string; - path: (request: Request): Array; - index?: boolean; - listing?: boolean; - showHidden?: boolean; - redirectToSlash?: boolean; - lookupCompressed?: boolean; - defaultExtension?: string; - }; - proxy?: { - host?: string; - port?: number; - protocol?: string; - uri?: string; - passThrough?: boolean; - rejectUnauthorized?: boolean; - xforward?: boolean; - redirects?: boolean; - redirects?: number; - timeout?: number; - - mapUri?: (request: Request, callback: (err: any, uri: string, headers: {[key: string]: string}): void): void; - onResponse: ( - err: any, - res: any,//Node Response - req: any,//Node Request - reply: (): void, - settings: any, - ttl: number - ); - ttl: number; - }; - view: string; - view: { - template: string; - context: { - payload: any; - params: any; - query: any; - pre: any; - } - }; - config: { - handler: any; - bind: any; - app: any; - plugins: { - [name: string]: any; - }; - pre: Array<()>; - validate: { - headers: any; - params: any; - query: any; - payload: any; - errorFields?: any; - failAction?: string; - failAction?: (source: string, error: any, next: ()); - }; - payload: { - output: { - data: any; - stream: any; - file: any; - }; - parse?: any; - allow?: string; - allow?: Array; - override?: string; - maxBytes?: number; - uploads?: number; - failAction?: string; - }; - response: { - schema: any; - sample: number; - failAction: string; - }; - cache: { - privacy: string; - expiresIn: number; - expiresAt: number; - }; - auth: string; - auth: boolean; - auth: { - mode: string; - strategies: Array; - payload?: boolean; - payload?: string; - tos?: boolean; - tos?: string; - scope?: string; - scope?: Array; - entity: string; - }; - cors?: boolean; - jsonp?: string; - description?: string; - notes?: string; - notes?: Array; - tags?: Array; - } - }; +// vhost?: string; +// vhost?: Array; + vhost?: any; +// handler: string; +// handler: (request: Request, reply: Function) => void; +// handler: { +// file: string; +// file: (request: Request) => void; +// file: { +// path: string; +// filename?: string; +// mode?: boolean; +// mode?: string; +// lookupCompressed: boolean; +// }; +// directory: { +// path: string; +// path: Array; +// path: (request: Request) => string; +// path: (request: Request) => Array; +// index?: boolean; +// listing?: boolean; +// showHidden?: boolean; +// redirectToSlash?: boolean; +// lookupCompressed?: boolean; +// defaultExtension?: string; +// }; +// proxy?: { +// host?: string; +// port?: number; +// protocol?: string; +// uri?: string; +// passThrough?: boolean; +// rejectUnauthorized?: boolean; +// xforward?: boolean; +// redirects?: boolean; +// redirects?: number; +// timeout?: number; +// +// mapUri?: (request: Request, callback: (err: any, uri: string, headers: {[key: string]: string}) => void) => void; +// onResponse: ( +// err: any, +// res: any,//Node Response +// req: any,//Node Request +// reply: () => void, +// settings: any, +// ttl: number +// ) => void; +// ttl: number; +// }; +// view: string; +// view: { +// template: string; +// context: { +// payload: any; +// params: any; +// query: any; +// pre: any; +// } +// }; +// config: { +// handler: any; +// bind: any; +// app: any; +// plugins: { +// [name: string]: any; +// }; +// pre: Array<() => void>; +// validate: { +// headers: any; +// params: any; +// query: any; +// payload: any; +// errorFields?: any; +// failAction?: string; +// failAction?: (source: string, error: any, next: () => void) => void; +// }; +// payload: { +// output: { +// data: any; +// stream: any; +// file: any; +// }; +// parse?: any; +// allow?: string; +// allow?: Array; +// override?: string; +// maxBytes?: number; +// uploads?: number; +// failAction?: string; +// }; +// response: { +// schema: any; +// sample: number; +// failAction: string; +// }; +// cache: { +// privacy: string; +// expiresIn: number; +// expiresAt: number; +// }; +// auth: string; +// auth: boolean; +// auth: { +// mode: string; +// strategies: Array; +// payload?: boolean; +// payload?: string; +// tos?: boolean; +// tos?: string; +// scope?: string; +// scope?: Array; +// entity: string; +// }; +// cors?: boolean; +// jsonp?: string; +// description?: string; +// notes?: string; +// notes?: Array; +// tags?: Array; +// } +// }; + handler: any; } export class Server { app: any; - methods: Array; + methods: Array<() => void>; info: { port: number; host?: string; @@ -268,9 +295,8 @@ declare module Hapi { [pluginName: string]: any; }; - - start(callback?: ()): void; - stop(options?: {timeout: number;}, callback?: ()): void; + start(callback?: () => void): void; + stop(options?: {timeout: number;}, callback?: () => void): void; route(options: RouteOptions): void; route(routes: Array): void; table(host?: string): Array; @@ -284,14 +310,14 @@ declare module Hapi { isHttpOnly: boolean; path: string; domain: string; - autoValue: (request: Request, next: (err: any, value: any): void): void; + autoValue: (request: Request, next: (err: any, value: any) => void) => void; encoding?: string; sign: any; password: string; iron: any; - }); - views: (options: ServerView): void; - cache: (name: string, options: { + }): void; + views(options: ServerView): void; + cache(name: string, options: { expiresIn: number; expiresAt: number; staleIn: number; @@ -300,17 +326,17 @@ declare module Hapi { }): void; auth: { - scheme: (name: string, scheme: { + scheme(name: string, scheme: { name: string; - scheme: (server: Server, options: any): (authenticate: any, payload: any, response: any); - }); + scheme: (server: Server, options: any) => (authenticate: any, payload: any, response: any) => void; + }): void; strategy: any; }; - ext: (event: any, method: string, options?: any): void; - method: (method: Array<{name: string; fn: (); options: any}>): void; - method: (name: string, fn: (), options: any): void; - inject: (options: any, callback: any): void; - handler: (name: string, method: (name: string, options: any): void): void; + ext(event: any, method: string, options?: any): void; + method(method: Array<{name: string; fn: () => void; options: any}>): void; + method(name: string, fn: () => void, options: any): void; + inject(options: any, callback: any): void; + handler(name: string, method: (name: string, options: any) => void): void; } export interface Request { From cc4e279c3712229f24bd534f0748c67bb55bfa75 Mon Sep 17 00:00:00 2001 From: Jakub Olek Date: Wed, 11 Jun 2014 22:18:55 +0200 Subject: [PATCH 064/537] Fixes for createServer --- hapi/hapi.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index cf2d966a0..68b366d6d 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -107,7 +107,8 @@ declare module Hapi { export interface ServerView { engines: { - module: string; + [extension: string]: string; + module?: string; // compile: ( // template: string, // options: any @@ -127,13 +128,13 @@ declare module Hapi { // ) => void // ) => void // ) => void; - compile: any; + compile?: any; }; - defaultExtension: string; + defaultExtension?: string; path?: string; partialsPath?: string; helpersPath?: string; - basePath: string; + basePath?: string; layout?: boolean; layoutPath?: string; layoutKeyword?: string; From af20aff6bf56fab94b8169d155263a69a3d03a3a Mon Sep 17 00:00:00 2001 From: Jakub Olek Date: Fri, 22 Aug 2014 17:16:59 +0200 Subject: [PATCH 065/537] Fixes for ember --- ember/ember.d.ts | 1090 +++++++++++++++++++++++----------------------- 1 file changed, 545 insertions(+), 545 deletions(-) diff --git a/ember/ember.d.ts b/ember/ember.d.ts index 2a0b35e42..e50185fd5 100644 --- a/ember/ember.d.ts +++ b/ember/ember.d.ts @@ -38,10 +38,10 @@ declare module EmberTesting { } interface Function { - observes(...string): Function; - observesBefore(...string): Function; - on(...string): Function; - property(...string): Function; + observes(...args: string[]): Function; + observesBefore(...args: string[]): Function; + on(...args: string[]): Function; + property(...args: string[]): Function; } interface String { @@ -50,9 +50,9 @@ interface String { classify(): string; dasherize(): string; decamelize(): string; - fmt(...string): string; + fmt(...args: string[]): string; htmlSafe(): typeof Handlebars.SafeString; - loc(...string): string; + loc(...args: string[]): string; underscore(): string; w(): string[]; } @@ -70,14 +70,14 @@ interface Array { clear(): any[]; compact(): any[]; contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number); - enumerableContentDidChange(start: number, removing: Ember.Enumerable, adding: number); - enumerableContentDidChange(start: number, removing: number, adding: Ember.Enumerable); - enumerableContentDidChange(start: number, removing: Ember.Enumerable, adding: Ember.Enumerable); - enumerableContentDidChange(removing: number, adding: number); - enumerableContentDidChange(removing: Ember.Enumerable, adding: number); - enumerableContentDidChange(removing: number, adding: Ember.Enumerable); - enumerableContentDidChange(removing: Ember.Enumerable, adding: Ember.Enumerable); + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Ember.Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Ember.Enumerable): any; + enumerableContentDidChange(start: number, removing: Ember.Enumerable, adding: Ember.Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Ember.Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Ember.Enumerable): any; + enumerableContentDidChange(removing: Ember.Enumerable, adding: Ember.Enumerable): any; enumerableContentWillChange(removing: number, adding: number): any[]; enumerableContentWillChange(removing: Ember.Enumerable, adding: number): any[]; enumerableContentWillChange(removing: number, adding: Ember.Enumerable): any[]; @@ -93,15 +93,15 @@ interface Array { getEach(key: string): any[]; indexOf(object: any, startAt: number): number; insertAt(idx: number, object: any): any[]; - invoke(methodName: string, ...any): any[]; + invoke(methodName: string, ...args: any[]): any[]; lastIndexOf(object: any, startAt: number): number; mapBy(key: string): any[]; nextObject(index: number, previousObject: any, context: any): any; objectAt(idx: number): any; - objectsAt(...number): any[]; + objectsAt(...args: number[]): any[]; popObject(): any; pushObject(obj: any): any; - pushObjects(...any): any[]; + pushObjects(...args: any[]): any[]; reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; reject: ItemIndexEnumerableCallbackTarget; rejectBy(key: string, value?: string): any[]; @@ -136,7 +136,7 @@ interface Array { decrementProperty(keyName: string, decrement?: number): number; endPropertyChanges(): any[]; get(keyName: string): any; - getProperties(...string): {}; + getProperties(...args: string[]): {}; getProperties(keys: string[]): {}; getWithDefault(keyName: string, defaultValue: any): any; hasObserverFor(key: string): boolean; @@ -157,13 +157,13 @@ interface ApplicationCreateArguments { customEvents?: {}; rootElement?: string; /** - Basic logging of successful transitions. - **/ - LOG_TRANSITIONS?: boolean; + Basic logging of successful transitions. + **/ + LOG_TRANSITIONS?: boolean; /** - Detailed logging of all routing steps. - **/ - LOG_TRANSITIONS_INTERNAL?: boolean; + Detailed logging of all routing steps. + **/ + LOG_TRANSITIONS_INTERNAL?: boolean; } interface ApplicationInitializerArguments { @@ -177,21 +177,21 @@ interface ApplicationInitializerFunction { interface CoreObjectArguments { /** - An overridable method called when objects are instantiated. By default, does nothing unless it is - overridden during class definition. NOTE: If you do override init for a framework class like Ember.View - or Ember.ArrayController, be sure to call this._super() in your init declaration! If you don't, Ember - may not have an opportunity to do important setup work, and you'll see strange behavior in your application. - **/ - init?: Function; + An overridable method called when objects are instantiated. By default, does nothing unless it is + overridden during class definition. NOTE: If you do override init for a framework class like Ember.View + or Ember.ArrayController, be sure to call this._super() in your init declaration! If you don't, Ember + may not have an opportunity to do important setup work, and you'll see strange behavior in your application. + **/ + init?: Function; /** - Override to implement teardown. - **/ - willDestroy?: Function; + Override to implement teardown. + **/ + willDestroy?: Function; } interface EnumerableConfigurationOptions { - willChange? ; - didChange? ; + willChange?: boolean ; + didChange?: boolean ; } interface ItemIndexEnumerableCallbackTarget { @@ -238,123 +238,123 @@ interface ModifyObserver { declare module Ember { /** - Alias for jQuery. - **/ + Alias for jQuery. + **/ // ReSharper disable once DuplicatingLocalDeclaration var $: JQueryStatic; /** - Creates an Ember.NativeArray from an Array like object. Does not modify the original object. - Ember.A is not needed if Ember.EXTEND_PROTOTYPES is true (the default value). However, it is - recommended that you use Ember.A when creating addons for ember or when you can not garentee - that Ember.EXTEND_PROTOTYPES will be true. - **/ + Creates an Ember.NativeArray from an Array like object. Does not modify the original object. + Ember.A is not needed if Ember.EXTEND_PROTOTYPES is true (the default value). However, it is + recommended that you use Ember.A when creating addons for ember or when you can not garentee + that Ember.EXTEND_PROTOTYPES will be true. + **/ function A(arr?: any[]): NativeArray; /** - An instance of Ember.Application is the starting point for every Ember application. It helps to - instantiate, initialize and coordinate the many objects that make up your app. - **/ + An instance of Ember.Application is the starting point for every Ember application. It helps to + instantiate, initialize and coordinate the many objects that make up your app. + **/ class Application extends Namespace { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; static initializer(arguments?: ApplicationInitializerArguments): void; /** - Call advanceReadiness after any asynchronous setup logic has completed. - Each call to deferReadiness must be matched by a call to advanceReadiness - or the application will never become ready and routing will not begin. - **/ - advanceReadiness(): void; + Call advanceReadiness after any asynchronous setup logic has completed. + Each call to deferReadiness must be matched by a call to advanceReadiness + or the application will never become ready and routing will not begin. + **/ + advanceReadiness(): void; /** - Use this to defer readiness until some condition is true. + Use this to defer readiness until some condition is true. - This allows you to perform asynchronous setup logic and defer - booting your application until the setup has finished. + This allows you to perform asynchronous setup logic and defer + booting your application until the setup has finished. - However, if the setup requires a loading UI, it might be better - to use the router for this purpose. - */ - deferReadiness(): void; + However, if the setup requires a loading UI, it might be better + to use the router for this purpose. + */ + deferReadiness(): void; /** - defines an injection or typeInjection - **/ - inject(factoryNameOrType: string, property: string, injectionName: string): void; + defines an injection or typeInjection + **/ + inject(factoryNameOrType: string, property: string, injectionName: string): void; /** - This injects the test helpers into the window's scope. If a function of the - same name has already been defined it will be cached (so that it can be reset - if the helper is removed with `unregisterHelper` or `removeTestHelpers`). - Any callbacks registered with `onInjectHelpers` will be called once the - helpers have been injected. - **/ - injectTestHelpers(): void; + This injects the test helpers into the window's scope. If a function of the + same name has already been defined it will be cached (so that it can be reset + if the helper is removed with `unregisterHelper` or `removeTestHelpers`). + Any callbacks registered with `onInjectHelpers` will be called once the + helpers have been injected. + **/ + injectTestHelpers(): void; /** - registers a factory for later injection - @param fullName type:name (e.g., 'model:user') - @param factory (e.g., App.Person) - **/ - register(fullName: string, factory: Function, options?: {}): void; + registers a factory for later injection + @param fullName type:name (e.g., 'model:user') + @param factory (e.g., App.Person) + **/ + register(fullName: string, factory: Function, options?: {}): void; /** - This removes all helpers that have been registered, and resets and functions - that were overridden by the helpers. - **/ - removeTestHelpers(): void; + This removes all helpers that have been registered, and resets and functions + that were overridden by the helpers. + **/ + removeTestHelpers(): void; /** - Reset the application. This is typically used only in tests. - **/ - reset(): void; + Reset the application. This is typically used only in tests. + **/ + reset(): void; /** - This hook defers the readiness of the application, so that you can start - the app when your tests are ready to run. It also sets the router's - location to 'none', so that the window's location will not be modified - (preventing both accidental leaking of state between tests and interference - with your testing framework). - **/ - setupForTesting(): void; + This hook defers the readiness of the application, so that you can start + the app when your tests are ready to run. It also sets the router's + location to 'none', so that the window's location will not be modified + (preventing both accidental leaking of state between tests and interference + with your testing framework). + **/ + setupForTesting(): void; /** - The DOM events for which the event dispatcher should listen. - */ + The DOM events for which the event dispatcher should listen. + */ customEvents: {}; /** - The Ember.EventDispatcher responsible for delegating events to this application's views. - **/ + The Ember.EventDispatcher responsible for delegating events to this application's views. + **/ eventDispatcher: EventDispatcher; /** - Set this to provide an alternate class to Ember.DefaultResolver - **/ + Set this to provide an alternate class to Ember.DefaultResolver + **/ resolver: DefaultResolver; /** - The root DOM element of the Application. This can be specified as an - element or a jQuery-compatible selector string. + The root DOM element of the Application. This can be specified as an + element or a jQuery-compatible selector string. - This is the element that will be passed to the Application's, eventDispatcher, - which sets up the listeners for event delegation. Every view in your application - should be a child of the element you specify here. - **/ + This is the element that will be passed to the Application's, eventDispatcher, + which sets up the listeners for event delegation. Every view in your application + should be a child of the element you specify here. + **/ rootElement: HTMLElement; /** - Called when the Application has become ready. - The call will be delayed until the DOM has become ready. - **/ + Called when the Application has become ready. + The call will be delayed until the DOM has become ready. + **/ ready: Function; /** - Application's router. - **/ + Application's router. + **/ Router: Router; } /** - This module implements Observer-friendly Array-like behavior. This mixin is picked up by the - Array class as well as other controllers, etc. that want to appear to be arrays. - **/ + This module implements Observer-friendly Array-like behavior. This mixin is picked up by the + Array class as well as other controllers, etc. that want to appear to be arrays. + **/ class Array implements Enumerable { addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; @@ -365,14 +365,14 @@ declare module Ember { someProperty(key: string, value?: string): boolean; compact(): any[]; contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number); - enumerableContentDidChange(start: number, removing: Enumerable, adding: number); - enumerableContentDidChange(start: number, removing: number, adding: Enumerable); - enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable); - enumerableContentDidChange(removing: number, adding: number); - enumerableContentDidChange(removing: Enumerable, adding: number); - enumerableContentDidChange(removing: number, adding: Enumerable); - enumerableContentDidChange(removing: Enumerable, adding: Enumerable); + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Enumerable): any; + enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; enumerableContentWillChange(removing: number, adding: number): Enumerable; enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; @@ -387,13 +387,13 @@ declare module Ember { forEach(callback: Function, target?: any): any; getEach(key: string): any[]; indexOf(object: any, startAt: number): number; - invoke(methodName: string, ...any): any[]; + invoke(methodName: string, ...args: any[]): any[]; lastIndexOf(object: any, startAt: number): number; map: ItemIndexEnumerableCallbackTarget; mapBy(key: string): any[]; nextObject(index: number, previousObject: any, context: any): any; objectAt(idx: number): any; - objectsAt(...number): any[]; + objectsAt(...args: number[]): any[]; reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; reject: ItemIndexEnumerableCallbackTarget; rejectBy(key: string, value?: string): any[]; @@ -405,30 +405,30 @@ declare module Ember { toArray(): any[]; uniq(): Enumerable; without(value: any): Enumerable; - '@each': EachProxy; + '@each': EachProxy; Boolean: boolean; - '[]': any[]; + '[]': any[]; firstObject: any; hasEnumerableObservers: boolean; lastObject: any; length: number; } /** - Provides a way for you to publish a collection of objects so that you can easily bind to the - collection from a Handlebars #each helper, an Ember.CollectionView, or other controllers. - **/ + Provides a way for you to publish a collection of objects so that you can easily bind to the + collection from a Handlebars #each helper, an Ember.CollectionView, or other controllers. + **/ class ArrayController extends ArrayProxy implements SortableMixin, ControllerMixin { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -438,37 +438,37 @@ declare module Ember { sortAscending: boolean; sortFunction: Comparable; sortProperties: any[]; - replaceRoute(name: string, ...any); - transitionToRoute(name: string, ...any); + replaceRoute(name: string, ...args: any[]): void; + transitionToRoute(name: string, ...args: any[]): void; controllers: {}; needs: string[]; target: any; } /** - Array polyfills to support ES5 features in older browsers. - **/ + Array polyfills to support ES5 features in older browsers. + **/ var ArrayPolyfills: { map: typeof Array.prototype.map; forEach: typeof Array.prototype.forEach; indexOf: typeof Array.prototype.indexOf; }; /** - An ArrayProxy wraps any other object that implements Ember.Array and/or Ember.MutableArray, - forwarding all requests. This makes it very useful for a number of binding use cases or other cases - where being able to swap out the underlying array is useful. - **/ + An ArrayProxy wraps any other object that implements Ember.Array and/or Ember.MutableArray, + forwarding all requests. This makes it very useful for a number of binding use cases or other cases + where being able to swap out the underlying array is useful. + **/ class ArrayProxy extends Object implements MutableArray { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -482,14 +482,14 @@ declare module Ember { clear(): any[]; compact(): any[]; contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number); - enumerableContentDidChange(start: number, removing: Enumerable, adding: number); - enumerableContentDidChange(start: number, removing: number, adding: Enumerable); - enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable); - enumerableContentDidChange(removing: number, adding: number); - enumerableContentDidChange(removing: Enumerable, adding: number); - enumerableContentDidChange(removing: number, adding: Enumerable); - enumerableContentDidChange(removing: Enumerable, adding: Enumerable); + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Enumerable): any; + enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; enumerableContentWillChange(removing: number, adding: number): any[]; enumerableContentWillChange(removing: Enumerable, adding: number): any[]; enumerableContentWillChange(removing: number, adding: Enumerable): any[]; @@ -505,24 +505,24 @@ declare module Ember { getEach(key: string): any[]; indexOf(object: any, startAt: number): number; insertAt(idx: number, object: any): any[]; - invoke(methodName: string, ...any): any[]; + invoke(methodName: string, ...args: any[]): any[]; lastIndexOf(object: any, startAt: number): number; map: ItemIndexEnumerableCallbackTarget; mapBy(key: string): any[]; nextObject(index: number, previousObject: any, context: any): any; objectAt(idx: number): any; objectAtContent(idx: number): any; - objectsAt(...number): any[]; + objectsAt(...args: number[]): any[]; popObject(): any; pushObject(obj: any): any; - pushObjects(...any): any[]; + pushObjects(...args: any[]): any[]; reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; reject: ItemIndexEnumerableCallbackTarget; rejectBy(key: string, value?: string): any[]; removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; removeAt(start: number, len: number): any; removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - replace(idx: number, amt: number, objects: any[]); + replace(idx: number, amt: number, objects: any[]): any; replaceContent(idx: number, amt: number, objects: any[]): void; reverseObjects(): any[]; setEach(key: string, value?: any): any; @@ -535,8 +535,8 @@ declare module Ember { unshiftObject(object: any): any; unshiftObjects(objects: any[]): any[]; without(value: any): any[]; - '[]': any[]; - '@each': EachProxy; + '[]': any[]; + '@each': EachProxy; Boolean: boolean; firstObject: any; hasEnumerableObservers: boolean; @@ -549,9 +549,9 @@ declare module Ember { } var BOOTED: boolean; /** - Connects the properties of two objects so that whenever the value of one property changes, - the other property will be changed also. - **/ + Connects the properties of two objects so that whenever the value of one property changes, + the other property will be changed also. + **/ class Binding { constructor(toPath: string, fromPath: string); connect(obj: any): Binding; @@ -567,45 +567,45 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; triggerAction(opts: {}): boolean; } /** - The internal class used to create text inputs when the {{input}} helper is used - with type of checkbox. See Handlebars.helpers.input for usage details. - **/ + The internal class used to create text inputs when the {{input}} helper is used + with type of checkbox. See Handlebars.helpers.input for usage details. + **/ class Checkbox extends View { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; } /** - An Ember.View descendent responsible for managing a collection (an array or array-like object) - by maintaining a child view object and associated DOM representation for each item in the array - and ensuring that child views and their associated rendered HTML are updated when items in the - array are added, removed, or replaced. - **/ + An Ember.View descendent responsible for managing a collection (an array or array-like object) + by maintaining a child view object and associated DOM representation for each item in the array + and ensuring that child views and their associated rendered HTML are updated when items in the + array are added, removed, or replaced. + **/ class CollectionView extends ContainerView { arrayDidChange(content: any[], start: number, removed: number, added: number): void; arrayWillChange(content: any[], start: number, removed: number): void; @@ -618,29 +618,29 @@ declare module Ember { itemViewClass: View; } /** - Implements some standard methods for comparing objects. Add this mixin to any class - you create that can compare its instances. - **/ + Implements some standard methods for comparing objects. Add this mixin to any class + you create that can compare its instances. + **/ class Comparable { compare(a: any, b: any): number; } /** - A view that is completely isolated. Property access in its templates go to the view object - and actions are targeted at the view object. There is no access to the surrounding context or - outer controller; all contextual information is passed in. - **/ + A view that is completely isolated. Property access in its templates go to the view object + and actions are targeted at the view object. There is no access to the surrounding context or + outer controller; all contextual information is passed in. + **/ class Component extends View { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -648,16 +648,16 @@ declare module Ember { targetObject: Controller; } /** - A computed property transforms an objects function into a property. - By default the function backing the computed property will only be called once and the result - will be cached. You can specify various properties that your computed property is dependent on. - This will force the cached result to be recomputed if the dependencies are modified. - **/ + A computed property transforms an objects function into a property. + By default the function backing the computed property will only be called once and the result + will be cached. You can specify various properties that your computed property is dependent on. + This will force the cached result to be recomputed if the dependencies are modified. + **/ class ComputedProperty { cacheable(aFlag?: boolean): ComputedProperty; get(keyName: string): any; meta(meta: {}): ComputedProperty; - property(...string): ComputedProperty; + property(...args: string[]): ComputedProperty; readOnly(): ComputedProperty; set(keyName: string, newValue: any, oldValue: string): any; // ReSharper disable UsingOfReservedWord @@ -676,11 +676,11 @@ declare module Ember { child(): Container; set(object: {}, key: string, value: any): void; /** - registers a factory for later injection - @param fullName type:name (e.g., 'model:user') - @param factory (e.g., App.Person) - **/ - register(fullName: string, factory: Function, options?: {}): void; + registers a factory for later injection + @param fullName type:name (e.g., 'model:user') + @param factory (e.g., App.Person) + **/ + register(fullName: string, factory: Function, options?: {}): void; unregister(fullName: string): void; resolve(fullName: string): Function; describe(fullName: string): string; @@ -697,42 +697,42 @@ declare module Ember { reset(): void; } /** - An Ember.View subclass that implements Ember.MutableArray allowing programatic - management of its child views. - **/ + An Ember.View subclass that implements Ember.MutableArray allowing programatic + management of its child views. + **/ class ContainerView extends View { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; } class Controller extends Object { } /** - Additional methods for the ControllerMixin. - **/ + Additional methods for the ControllerMixin. + **/ class ControllerMixin { - replaceRoute(name: string, ...any): void; - transitionToRoute(name: string, ...any): void; + replaceRoute(name: string, ...args: any[]): void; + transitionToRoute(name: string, ...args: any[]): void; controllers: {}; needs: string[]; target: any; } /** - Implements some standard methods for copying an object. Add this mixin to any object you - create that can create a copy of itself. This mixin is added automatically to the built-in array. - You should generally implement the copy() method to return a copy of the receiver. - Note that frozenCopy() will only work if you also implement Ember.Freezable. - **/ + Implements some standard methods for copying an object. Add this mixin to any object you + create that can create a copy of itself. This mixin is added automatically to the built-in array. + You should generally implement the copy() method to return a copy of the receiver. + Note that frozenCopy() will only work if you also implement Ember.Freezable. + **/ class Copyable { copy(deep: boolean): Copyable; frozenCopy(): Copyable; @@ -741,64 +741,64 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; /** - Destroys an object by setting the isDestroyed flag and removing its metadata, which effectively - destroys observers and bindings. If you try to set a property on a destroyed object, an exception - will be raised. Note that destruction is scheduled for the end of the run loop and does not - happen immediately. It will set an isDestroying flag immediately. - **/ - destroy(): CoreObject; + Destroys an object by setting the isDestroyed flag and removing its metadata, which effectively + destroys observers and bindings. If you try to set a property on a destroyed object, an exception + will be raised. Note that destruction is scheduled for the end of the run loop and does not + happen immediately. It will set an isDestroying flag immediately. + **/ + destroy(): CoreObject; init(): void; /** - Returns a string representation which attempts to provide more information than Javascript's toString - typically does, in a generic way for all Ember objects (e.g., ""). - **/ - toString(): string; + Returns a string representation which attempts to provide more information than Javascript's toString + typically does, in a generic way for all Ember objects (e.g., ""). + **/ + toString(): string; willDestroy(): void; /** - Defines the properties that will be concatenated from the superclass (instead of overridden). - **/ + Defines the properties that will be concatenated from the superclass (instead of overridden). + **/ concatenatedProperties: any[]; /** - Destroyed object property flag. If this property is true the observers and bindings were - already removed by the effect of calling the destroy() method. - **/ + Destroyed object property flag. If this property is true the observers and bindings were + already removed by the effect of calling the destroy() method. + **/ isDestroyed: boolean; /** - Destruction scheduled flag. The destroy() method has been called. The object stays intact - until the end of the run loop at which point the isDestroyed flag is set. - **/ + Destruction scheduled flag. The destroy() method has been called. The object stays intact + until the end of the run loop at which point the isDestroyed flag is set. + **/ isDestroying: boolean; } /** - An abstract class that exists to give view-like behavior to both Ember's main view class Ember.View - and other classes like Ember._SimpleMetamorphView that don't need the fully functionaltiy of Ember.View. - Unless you have specific needs for CoreView, you will use Ember.View in your applications. - **/ + An abstract class that exists to give view-like behavior to both Ember's main view class Ember.View + and other classes like Ember._SimpleMetamorphView that don't need the fully functionaltiy of Ember.View. + Unless you have specific needs for CoreView, you will use Ember.View in your applications. + **/ class CoreView extends Object { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -815,12 +815,12 @@ declare module Ember { } function DEFAULT_GETTER_FUNCTION(name: string): Function; /** - The DefaultResolver defines the default lookup rules to resolve container lookups before consulting - the container for registered items: - templates are looked up on Ember.TEMPLATES - other names are looked up on the application after converting the name. - For example, controller:post looks up App.PostController by default. - **/ + The DefaultResolver defines the default lookup rules to resolve container lookups before consulting + the container for registered items: + templates are looked up on Ember.TEMPLATES + other names are looked up on the application after converting the name. + For example, controller:post looks up App.PostController by default. + **/ class DefaultResolver { resolve(fullName: string): {}; namespace: Application; @@ -836,42 +836,42 @@ declare module Ember { then(resolve: Function, reject: Function): void; } /** - Objects of this type can implement an interface to respond to requests to get and set. - The default implementation handles simple properties. - You generally won't need to create or subclass this directly. - **/ + Objects of this type can implement an interface to respond to requests to get and set. + The default implementation handles simple properties. + You generally won't need to create or subclass this directly. + **/ class Descriptor { } var EMPTY_META: {}; // TODO: define interface var ENV: {}; var EXTEND_PROTOTYPES: boolean; /** - This is the object instance returned when you get the @each property on an array. It uses - the unknownProperty handler to automatically create EachArray instances for property names. - **/ + This is the object instance returned when you get the @each property on an array. It uses + the unknownProperty handler to automatically create EachArray instances for property names. + **/ class EachProxy extends Object { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; unknownProperty(keyName: string, value: any): any[]; } /** - This mixin defines the common interface implemented by enumerable objects in Ember. Most of these - methods follow the standard Array iteration API defined up to JavaScript 1.8 (excluding language-specific - features that cannot be emulated in older versions of JavaScript). - This mixin is applied automatically to the Array class on page load, so you can use any of these methods - on simple arrays. If Array already implements one of these methods, the mixin will not override them. - **/ + This mixin defines the common interface implemented by enumerable objects in Ember. Most of these + methods follow the standard Array iteration API defined up to JavaScript 1.8 (excluding language-specific + features that cannot be emulated in older versions of JavaScript). + This mixin is applied automatically to the Array class on page load, so you can use any of these methods + on simple arrays. If Array already implements one of these methods, the mixin will not override them. + **/ class Enumerable { addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; any(callback: Function, target?: any): boolean; @@ -879,14 +879,14 @@ declare module Ember { someProperty(key: string, value?: string): boolean; compact(): any[]; contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number); - enumerableContentDidChange(start: number, removing: Enumerable, adding: number); - enumerableContentDidChange(start: number, removing: number, adding: Enumerable); - enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable); - enumerableContentDidChange(removing: number, adding: number); - enumerableContentDidChange(removing: Enumerable, adding: number); - enumerableContentDidChange(removing: number, adding: Enumerable); - enumerableContentDidChange(removing: Enumerable, adding: Enumerable); + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Enumerable): any; + enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; enumerableContentWillChange(removing: number, adding: number): Enumerable; enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; @@ -900,7 +900,7 @@ declare module Ember { findBy(key: string, value?: string): any; forEach(callback: Function, target?: any): any; getEach(key: string): any[]; - invoke(methodName: string, ...any): any[]; + invoke(methodName: string, ...args: any[]): any[]; map: ItemIndexEnumerableCallbackTarget; mapBy(key: string): any[]; nextObject(index: number, previousObject: any, context: any): any; @@ -913,48 +913,48 @@ declare module Ember { toArray(): any[]; uniq(): Enumerable; without(value: any): Enumerable; - '[]': any[]; + '[]': any[]; firstObject: any; hasEnumerableObservers: boolean; lastObject: any; } var EnumerableUtils: {}; // TODO: define interface /** - A subclass of the JavaScript Error object for use in Ember. - **/ + A subclass of the JavaScript Error object for use in Ember. + **/ // ReSharper disable once DuplicatingLocalDeclaration var Error: typeof Error; /** - Handles delegating browser events to their corresponding Ember.Views. For example, when you click on - a view, Ember.EventDispatcher ensures that that view's mouseDown method gets called. - **/ + Handles delegating browser events to their corresponding Ember.Views. For example, when you click on + a view, Ember.EventDispatcher ensures that that view's mouseDown method gets called. + **/ class EventDispatcher extends Object { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; events: {}; } /** - This mixin allows for Ember objects to subscribe to and emit events. - You can also chain multiple event subscriptions. - **/ + This mixin allows for Ember objects to subscribe to and emit events. + You can also chain multiple event subscriptions. + **/ class Evented { has(name: string): boolean; off(name: string, target: any, method: Function): Evented; on(name: string, target: any, method: Function): Evented; one(name: string, target: any, method: Function): Evented; - trigger(name: string, ...string): void; + trigger(name: string, ...args: string[]): void; } var FROZEN_ERROR: string; class Freezable { @@ -996,32 +996,32 @@ declare module Ember { class Compiler { } class JavaScriptCompiler { } function registerHelper(name: string, fn: Function, inverse?: boolean): void; - function registerPartial(name: string, str): void; - function K(); - function createFrame(object); + function registerPartial(name: string, str: any): void; + function K(): any; + function createFrame(objec: any): any; function Exception(message: string): void; class SafeString { constructor(str: string); static toString(): string; } - function parse(string: string); - function print(ast); - var logger; - function log(level, str): void; - function compile(environment, options?, context?, asObject?); + function parse(string: string): any; + function print(ast: any): void; + var logger: typeof Ember.Logger; + function log(level: string, str: string): void; + function compile(environment: any, options?: any, context?: any, asObject?: any): any; } class HashLocation extends Object { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1030,14 +1030,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1046,7 +1046,7 @@ declare module Ember { var IS_BINDING: RegExp; class Instrumentation { getProperties(obj: any, list: any[]): {}; - getProperties(obj: any, ...string): {}; + getProperties(obj: any, ...args: string[]): {}; instrument(name: string, payload: any, callback: Function, binding: any): void; reset(): void; subscribe(pattern: string, object: any): void; @@ -1060,14 +1060,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1094,11 +1094,11 @@ declare module Ember { } var Logger: { assert(param: any): void; - debug(...any): void; - error(...any): void; - info(...any): void; - log(...any): void; - warn(...any): void; + debug(...args: any[]): void; + error(...args: any[]): void; + info(...args: any[]): void; + log(...args: any[]): void; + warn(...args: any[]): void; }; function MANDATORY_SETTER_FUNCTION(value: string): void; var META_KEY: string; @@ -1119,9 +1119,9 @@ declare module Ember { class Mixin { apply(obj: any): any; /** - Creates an instance of the class. - @param arguments A hash containing values with which to initialize the newly instantiated object. - **/ + Creates an instance of the class. + @param arguments A hash containing values with which to initialize the newly instantiated object. + **/ static create(arguments?: {}): T; detect(obj: any): boolean; reopen(arguments?: {}): T; @@ -1137,14 +1137,14 @@ declare module Ember { clear(): any[]; compact(): any[]; contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number); - enumerableContentDidChange(start: number, removing: Enumerable, adding: number); - enumerableContentDidChange(start: number, removing: number, adding: Enumerable); - enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable); - enumerableContentDidChange(removing: number, adding: number); - enumerableContentDidChange(removing: Enumerable, adding: number); - enumerableContentDidChange(removing: number, adding: Enumerable); - enumerableContentDidChange(removing: Enumerable, adding: Enumerable); + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Enumerable): any; + enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; enumerableContentWillChange(removing: number, adding: number): Enumerable; enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; @@ -1160,23 +1160,23 @@ declare module Ember { getEach(key: string): any[]; indexOf(object: any, startAt: number): number; insertAt(idx: number, object: any): any[]; - invoke(methodName: string, ...any): any[]; + invoke(methodName: string, ...args: any[]): any[]; lastIndexOf(object: any, startAt: number): number; map: ItemIndexEnumerableCallbackTarget; mapBy(key: string): any[]; nextObject(index: number, previousObject: any, context: any): any; objectAt(idx: number): any; - objectsAt(...number): any[]; + objectsAt(...args: number[]): any[]; popObject(): any; pushObject(obj: any): any; - pushObjects(...any): any[]; + pushObjects(...args: any[]): any[]; reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; reject: ItemIndexEnumerableCallbackTarget; rejectBy(key: string, value?: string): any[]; removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; removeAt(start: number, len: number): any; removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - replace(idx: number, amt: number, objects: any[]); + replace(idx: number, amt: number, objects: any[]): any; reverseObjects(): any[]; setEach(key: string, value?: any): any; setObjects(objects: any[]): any[]; @@ -1188,8 +1188,8 @@ declare module Ember { unshiftObject(object: any): any; unshiftObjects(objects: any[]): any[]; without(value: any): Enumerable; - '[]': any[]; - '@each': EachProxy; + '[]': any[]; + '@each': EachProxy; Boolean: boolean; firstObject: any; hasEnumerableObservers: boolean; @@ -1209,14 +1209,14 @@ declare module Ember { someProperty(key: string, value?: string): boolean; compact(): any[]; contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number); - enumerableContentDidChange(start: number, removing: Enumerable, adding: number); - enumerableContentDidChange(start: number, removing: number, adding: Enumerable); - enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable); - enumerableContentDidChange(removing: number, adding: number); - enumerableContentDidChange(removing: Enumerable, adding: number); - enumerableContentDidChange(removing: number, adding: Enumerable); - enumerableContentDidChange(removing: Enumerable, adding: Enumerable); + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Enumerable): any; + enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; enumerableContentWillChange(removing: number, adding: number): Enumerable; enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; @@ -1230,7 +1230,7 @@ declare module Ember { findBy(key: string, value?: string): any; forEach(callback: Function, target?: any): any; getEach(key: string): any[]; - invoke(methodName: string, ...any): any[]; + invoke(methodName: string, ...args: any[]): any[]; map: ItemIndexEnumerableCallbackTarget; mapBy(key: string): any[]; nextObject(index: number, previousObject: any, context: any): any; @@ -1245,7 +1245,7 @@ declare module Ember { toArray(): any[]; uniq(): Enumerable; without(value: any): Enumerable; - '[]': any[]; + '[]': any[]; firstObject: any; hasEnumerableObservers: boolean; lastObject: any; @@ -1255,14 +1255,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1280,14 +1280,14 @@ declare module Ember { clear(): any[]; compact(): any[]; contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number); - enumerableContentDidChange(start: number, removing: Enumerable, adding: number); - enumerableContentDidChange(start: number, removing: number, adding: Enumerable); - enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable); - enumerableContentDidChange(removing: number, adding: number); - enumerableContentDidChange(removing: Enumerable, adding: number); - enumerableContentDidChange(removing: number, adding: Enumerable); - enumerableContentDidChange(removing: Enumerable, adding: Enumerable); + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Enumerable): any; + enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; enumerableContentWillChange(removing: number, adding: number): any[]; enumerableContentWillChange(removing: Enumerable, adding: number): any[]; enumerableContentWillChange(removing: number, adding: Enumerable): any[]; @@ -1303,23 +1303,23 @@ declare module Ember { getEach(key: string): any[]; indexOf(object: any, startAt: number): number; insertAt(idx: number, object: any): any[]; - invoke(methodName: string, ...any): any[]; + invoke(methodName: string, ...args: any[]): any[]; lastIndexOf(object: any, startAt: number): number; map: ItemIndexEnumerableCallbackTarget; mapBy(key: string): any[]; nextObject(index: number, previousObject: any, context: any): any; objectAt(idx: number): any; - objectsAt(...number): any[]; + objectsAt(...args: number[]): any[]; popObject(): any; pushObject(obj: any): any; - pushObjects(...any): any[]; + pushObjects(...args: any[]): any[]; reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; reject: ItemIndexEnumerableCallbackTarget; rejectBy(key: string, value?: string): any[]; removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; removeAt(start: number, len: number): any; removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - replace(idx: number, amt: number, objects: any[]); + replace(idx: number, amt: number, objects: any[]): any; reverseObjects(): any[]; setEach(key: string, value?: any): any; setObjects(objects: any[]): any[]; @@ -1331,8 +1331,8 @@ declare module Ember { unshiftObject(object: any): any; unshiftObjects(objects: any[]): any[]; without(value: any): any[]; - '[]': any[]; - '@each': EachProxy; + '[]': any[]; + '@each': EachProxy; Boolean: boolean; firstObject: any; hasEnumerableObservers: boolean; @@ -1348,7 +1348,7 @@ declare module Ember { decrementProperty(keyName: string, decrement?: number): number; endPropertyChanges(): any[]; get(keyName: string): any; - getProperties(...string): {}; + getProperties(...args: string[]): {}; getProperties(keys: string[]): {}; getWithDefault(keyName: string, defaultValue: any): any; hasObserverFor(key: string): boolean; @@ -1368,14 +1368,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1383,40 +1383,40 @@ declare module Ember { var ORDER_DEFINITION: string[]; class Object extends CoreObject implements Observable { /** - Creates a subclass of the Object class. - **/ + Creates a subclass of the Object class. + **/ static extend(arguments?: CoreObjectArguments): T; /** - Creates an instance of the class. - @param arguments A hash containing values with which to initialize the newly instantiated object. - **/ + Creates an instance of the class. + @param arguments A hash containing values with which to initialize the newly instantiated object. + **/ static create(arguments?: {}): T; /** - Equivalent to doing extend(arguments).create(). If possible use the normal create method instead. - **/ + Equivalent to doing extend(arguments).create(). If possible use the normal create method instead. + **/ static createWithMixins(arguments?: {}): T; static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; /** - Augments a constructor's prototype with additional properties and functions. - To add functions and properties to the constructor itself, see reopenClass. - **/ + Augments a constructor's prototype with additional properties and functions. + To add functions and properties to the constructor itself, see reopenClass. + **/ static reopen(arguments?: {}): T; /** - Augments a constructor's own properties and functions. - To add functions and properties to instances of a constructor by extending the - constructor's prototype see reopen. - **/ + Augments a constructor's own properties and functions. + To add functions and properties to instances of a constructor by extending the + constructor's prototype see reopen. + **/ static reopenClass(arguments?: {}): T; static isClass: boolean; static isMethod: boolean; @@ -1426,7 +1426,7 @@ declare module Ember { decrementProperty(keyName: string, decrement?: number): number; endPropertyChanges(): Observable; get(keyName: string): any; - getProperties(...string): {}; + getProperties(...args: string[]): {}; getProperties(keys: string[]): {}; getWithDefault(keyName: string, defaultValue: any): any; hasObserverFor(key: string): boolean; @@ -1441,8 +1441,8 @@ declare module Ember { toggleProperty(keyName: string): any; } class ObjectController extends ObjectProxy implements ControllerMixin { - replaceRoute(name: string, ...any): void; - transitionToRoute(name: string, ...any): void; + replaceRoute(name: string, ...args: any[]): void; + transitionToRoute(name: string, ...args: any[]): void; controllers: Object; needs: string[]; target: any; @@ -1451,20 +1451,20 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; /** - The object whose properties will be forwarded. - **/ + The object whose properties will be forwarded. + **/ content: Object; } class Observable { @@ -1474,7 +1474,7 @@ declare module Ember { decrementProperty(keyName: string, decrement?: number): number; endPropertyChanges(): Observable; get(keyName: string): any; - getProperties(...string): {}; + getProperties(...args: string[]): {}; getProperties(keys: string[]): {}; getWithDefault(keyName: string, defaultValue: any): any; hasObserverFor(key: string): boolean; @@ -1528,14 +1528,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1551,26 +1551,26 @@ declare module Ember { render(name: string, options?: RenderOptions): void; renderTemplate(controller: Controller, model: {}): void; // ReSharper disable once InconsistentNaming - replaceWith(name: string, ...Object): void; - send(name: string, ...any): void; + replaceWith(name: string, ...object: any[]): void; + send(name: string, ...args: any[]): void; serialize(model: {}, params: string[]): string; setupController(controller: Controller, model: {}): void; // ReSharper disable once InconsistentNaming - transitionTo(name: string, ...Object): void; + transitionTo(name: string, ...object: any[]): void; actions: ActionsHash; } class Router extends Object { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1587,14 +1587,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1613,14 +1613,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1634,14 +1634,14 @@ declare module Ember { someProperty(key: string, value?: string): boolean; compact(): any[]; contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number); - enumerableContentDidChange(start: number, removing: Enumerable, adding: number); - enumerableContentDidChange(start: number, removing: number, adding: Enumerable); - enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable); - enumerableContentDidChange(removing: number, adding: number); - enumerableContentDidChange(removing: Enumerable, adding: number); - enumerableContentDidChange(removing: number, adding: Enumerable); - enumerableContentDidChange(removing: Enumerable, adding: Enumerable); + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Enumerable): any; + enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; enumerableContentWillChange(removing: number, adding: number): Set; enumerableContentWillChange(removing: Enumerable, adding: number): Set; enumerableContentWillChange(removing: number, adding: Enumerable): Set; @@ -1655,7 +1655,7 @@ declare module Ember { findBy(key: string, value?: string): any; forEach(callback: Function, target?: any): any; getEach(key: string): any[]; - invoke(methodName: string, ...any): any[]; + invoke(methodName: string, ...args: any[]): any[]; map: ItemIndexEnumerableCallbackTarget; mapBy(key: string): any[]; nextObject(index: number, previousObject: any, context: any): any; @@ -1670,7 +1670,7 @@ declare module Ember { toArray(): any[]; uniq(): Set; without(value: any): Set; - '[]': any[]; + '[]': any[]; firstObject: any; hasEnumerableObservers: boolean; lastObject: any; @@ -1679,13 +1679,13 @@ declare module Ember { freeze(): Set; isFrozen: boolean; add(obj: any): Set; - addEach(...any): Set; + addEach(...args: any[]): Set; clear(): Set; isEqual(obj: Set): boolean; pop(): any; push(obj: any): Set; remove(obj: any): Set; - removeEach(...any): Set; + removeEach(...args: any[]): Set; shift(): any; unshift(obj: any): Set; length: number; @@ -1699,14 +1699,14 @@ declare module Ember { someProperty(key: string, value?: string): boolean; compact(): any[]; contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number); - enumerableContentDidChange(start: number, removing: Enumerable, adding: number); - enumerableContentDidChange(start: number, removing: number, adding: Enumerable); - enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable); - enumerableContentDidChange(removing: number, adding: number); - enumerableContentDidChange(removing: Enumerable, adding: number); - enumerableContentDidChange(removing: number, adding: Enumerable); - enumerableContentDidChange(removing: Enumerable, adding: Enumerable); + enumerableContentDidChange(start: number, removing: number, adding: number): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; + enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; + enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; + enumerableContentDidChange(removing: number, adding: number): any; + enumerableContentDidChange(removing: Enumerable, adding: number): any; + enumerableContentDidChange(removing: number, adding: Enumerable): any; + enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; enumerableContentWillChange(removing: number, adding: number): Enumerable; enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; @@ -1720,7 +1720,7 @@ declare module Ember { findBy(key: string, value?: string): any; forEach(callback: Function, target?: any): any; getEach(key: string): any[]; - invoke(methodName: string, ...any): any[]; + invoke(methodName: string, ...args: any[]): any[]; map: ItemIndexEnumerableCallbackTarget; mapBy(key: string): any[]; nextObject(index: number, previousObject: any, context: any): any; @@ -1735,7 +1735,7 @@ declare module Ember { toArray(): any[]; uniq(): Enumerable; without(value: any): Enumerable; - '[]': any[]; + '[]': any[]; arrangedContent: any; firstObject: any; hasEnumerableObservers: boolean; @@ -1748,14 +1748,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1763,7 +1763,7 @@ declare module Ember { off(name: string, target: any, method: Function): State; on(name: string, target: any, method: Function): State; one(name: string, target: any, method: Function): State; - trigger(name: string, ...string): void; + trigger(name: string, ...args: string[]): void; getPathsCache(stateManager: {}, path: string): {}; init(): void; setPathsCache(stateManager: {}, path: string, transitions: any): void; @@ -1781,14 +1781,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1804,7 +1804,7 @@ declare module Ember { stateMetaFor(state: State): {}; transitionTo(path: string, context: any): void; triggerSetupContext(transitions: TransitionsHash): void; - unhandledEvent(manager: StateManager, event: string); + unhandledEvent(manager: StateManager, event: string): any; currentPath: string; currentState: State; errorOnUnhandledEvents: boolean; @@ -1816,9 +1816,9 @@ declare module Ember { function classify(str: string): string; function dasherize(str: string): string; function decamelize(str: string): string; - function fmt(...string): string; + function fmt(...args: string[]): string; function htmlSafe(str: string): void; // TODO: @returns Handlebars.SafeStringStatic; - function loc(...string): string; + function loc(...args: string[]): string; function underscore(str: string): string; function w(str: string): string[]; } @@ -1848,14 +1848,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1872,14 +1872,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1911,14 +1911,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1983,8 +1983,8 @@ declare module Ember { function addListener(obj: any, eventName: string, func: Function, method: string, once?: boolean): void; var addObserver: ModifyObserver; /** - Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead. - **/ + Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead. + **/ var alias: typeof deprecateFunc; function aliasMethod(methodName: string): Descriptor; var anyUnprocessedMixins: boolean; @@ -2001,8 +2001,8 @@ declare module Ember { var computed: { (callback: Function): ComputedProperty; alias(dependentKey: string): ComputedProperty; - and(...string): ComputedProperty; - any(...string): ComputedProperty; + and(...args: string[]): ComputedProperty; + any(...args: string[]): ComputedProperty; bool(dependentKey: string): ComputedProperty; defaultTo(defaultPath: string): ComputedProperty; empty(dependentKey: string): ComputedProperty; @@ -2011,13 +2011,13 @@ declare module Ember { gte(dependentKey: string, value: number): ComputedProperty; lt(dependentKey: string, value: number): ComputedProperty; lte(dependentKey: string, value: number): ComputedProperty; - map(...string): ComputedProperty; + map(...args: string[]): ComputedProperty; match(dependentKey: string, regexp: RegExp): ComputedProperty; none(dependentKey: string): ComputedProperty; not(dependentKey: string): ComputedProperty; notEmpty(dependentKey: string): ComputedProperty; oneWay(dependentKey: string): ComputedProperty; - or(...string): ComputedProperty; + or(...args: string[]): ComputedProperty; }; // ReSharper disable DuplicatingLocalDeclaration var config: {}; @@ -2025,9 +2025,9 @@ declare module Ember { function controllerFor(container: Container, controllerName: string, lookupOptions?: {}): Controller; function copy(obj: any, deep: boolean): any; /** - Creates an instance of the CoreObject class. - @param arguments A hash containing values with which to initialize the newly instantiated object. - **/ + Creates an instance of the CoreObject class. + @param arguments A hash containing values with which to initialize the newly instantiated object. + **/ function create(arguments?: {}): CoreObject; function debug(message: string): void; function defineProperty(obj: any, keyName: string, desc: {}): void; @@ -2035,8 +2035,8 @@ declare module Ember { function deprecateFunc(message: string, func: Function): Function; function destroy(obj: any): void; /** - Ember.empty is deprecated. Please use Ember.isEmpty instead. - **/ + Ember.empty is deprecated. Please use Ember.isEmpty instead. + **/ // ReSharper disable once DuplicatingLocalDeclaration var empty: typeof deprecateFunc; function endPropertyChanges(): void; @@ -2049,15 +2049,15 @@ declare module Ember { function get(obj: any, keyName: string): any; function getMeta(obj: any, property: string): any; /** - getPath is deprecated since get now supports paths. - **/ + getPath is deprecated since get now supports paths. + **/ var getPath: typeof deprecateFunc; function getWithDefault(root: string, key: string, defaultValue: any): any; function guidFor(obj: any): string; function handleErrors(func: Function, context: any): any; function hasListeners(context: any, name: string): boolean; function hasOwnProperty(prop: string): boolean; - function immediateObserver(func: Function, ...propertyNames): Function; + function immediateObserver(func: Function, ...propertyNames: any[]): Function; var imports: {}; function inspect(obj: any): string; function instrument(name: string, payload: any, callback: Function, binding: any): void; @@ -2079,13 +2079,13 @@ declare module Ember { function merge(original: any, updates: any): any; function meta(obj: any, writable?: boolean): {}; function metaPath(obj: any, path: string, writable?: boolean): any; - function mixin(obj: any, ...any): any; + function mixin(obj: any, ...args: any[]): any; /** - Ember.none is deprecated. Please use Ember.isNone instead. - **/ + Ember.none is deprecated. Please use Ember.isNone instead. + **/ var none: typeof deprecateFunc; function normalizeTuple(target: any, path: string): any[]; - function observer(func: Function, ...string): Function; + function observer(func: Function, ...args: string[]): Function; function observersFor(obj: any, path: string): any[]; function onLoad(name: string, callback: Function): void; function oneWay(obj: any, to: string, from: string): Binding; @@ -2119,18 +2119,18 @@ declare module Ember { debounce(target: any, method: Function, ...args: any[]): void; debounce(target: any, method: string, ...args: any[]): void; end(): void; - join(target: any, method: Function, ...any): any; - join(target: any, method: string, ...any): any; + join(target: any, method: Function, ...args: any[]): any; + join(target: any, method: string, ...args: any[]): any; later(target: any, method: Function, ...args: any[]): string; later(target: any, method: string, ...args: any[]): string; - next(target: any, method: Function, ...any): number; - next(target: any, method: string, ...any): number; - once(target: any, method: Function, ...any): number; - once(target: any, method: string, ...any): number; - schedule(queue: string, target: any, method: Function, ...any): void; - schedule(queue: string, target: any, method: string, ...any): void; - scheduleOnce(queue: string, target: any, method: Function, ...any): void; - scheduleOnce(queue: string, target: any, method: string, ...any): void; + next(target: any, method: Function, ...args: any[]): number; + next(target: any, method: string, ...args: any[]): number; + once(target: any, method: Function, ...args: any[]): number; + once(target: any, method: string, ...args: any[]): number; + schedule(queue: string, target: any, method: Function, ...args: any[]): void; + schedule(queue: string, target: any, method: string, ...args: any[]): void; + scheduleOnce(queue: string, target: any, method: Function, ...args: any[]): void; + scheduleOnce(queue: string, target: any, method: string, ...args: any[]): void; sync(): void; throttle(target: any, method: Function, ...args: any[]): void; throttle(target: any, method: string, ...args: any[]): void; @@ -2141,8 +2141,8 @@ declare module Ember { function set(obj: any, keyName: string, value: any): any; function setMeta(obj: any, property: string, value: any): void; /** - setPath is deprecated since set now supports paths. - **/ + setPath is deprecated since set now supports paths. + **/ var setPath: typeof deprecateFunc; function setProperties(self: any, hash: {}): any; function subscribe(pattern: string, object: any): void; @@ -2153,8 +2153,8 @@ declare module Ember { function tryInvoke(obj: any, methodName: string, args?: any[]): any; function trySet(obj: any, path: string, value: any): void; /** - trySetPath has been renamed to trySet. - **/ + trySetPath has been renamed to trySet. + **/ var trySetPath: typeof deprecateFunc; function typeOf(item: any): string; function unwatch(obj: any, keyPath: string): void; @@ -2174,8 +2174,8 @@ declare module Ember { // ReSharper disable DuplicatingLocalDeclaration declare module Em { /** - Alias for jQuery. - **/ + Alias for jQuery. + **/ var $: typeof Ember.$; var A: typeof Ember.A; class Application extends Ember.Application { } From 0f37f4b288dcf9de3e1f5f7e4c8a9d1678b576c8 Mon Sep 17 00:00:00 2001 From: Jakub Olek Date: Mon, 25 Aug 2014 14:35:04 +0200 Subject: [PATCH 066/537] remove changes that are not really changes --- ember/ember.d.ts | 774 +++++++++++++++++++++++------------------------ 1 file changed, 387 insertions(+), 387 deletions(-) diff --git a/ember/ember.d.ts b/ember/ember.d.ts index e50185fd5..9ee334738 100644 --- a/ember/ember.d.ts +++ b/ember/ember.d.ts @@ -157,13 +157,13 @@ interface ApplicationCreateArguments { customEvents?: {}; rootElement?: string; /** - Basic logging of successful transitions. - **/ - LOG_TRANSITIONS?: boolean; + Basic logging of successful transitions. + **/ + LOG_TRANSITIONS?: boolean; /** - Detailed logging of all routing steps. - **/ - LOG_TRANSITIONS_INTERNAL?: boolean; + Detailed logging of all routing steps. + **/ + LOG_TRANSITIONS_INTERNAL?: boolean; } interface ApplicationInitializerArguments { @@ -177,16 +177,16 @@ interface ApplicationInitializerFunction { interface CoreObjectArguments { /** - An overridable method called when objects are instantiated. By default, does nothing unless it is - overridden during class definition. NOTE: If you do override init for a framework class like Ember.View - or Ember.ArrayController, be sure to call this._super() in your init declaration! If you don't, Ember - may not have an opportunity to do important setup work, and you'll see strange behavior in your application. - **/ - init?: Function; + An overridable method called when objects are instantiated. By default, does nothing unless it is + overridden during class definition. NOTE: If you do override init for a framework class like Ember.View + or Ember.ArrayController, be sure to call this._super() in your init declaration! If you don't, Ember + may not have an opportunity to do important setup work, and you'll see strange behavior in your application. + **/ + init?: Function; /** - Override to implement teardown. - **/ - willDestroy?: Function; + Override to implement teardown. + **/ + willDestroy?: Function; } interface EnumerableConfigurationOptions { @@ -238,123 +238,123 @@ interface ModifyObserver { declare module Ember { /** - Alias for jQuery. - **/ + Alias for jQuery. + **/ // ReSharper disable once DuplicatingLocalDeclaration var $: JQueryStatic; /** - Creates an Ember.NativeArray from an Array like object. Does not modify the original object. - Ember.A is not needed if Ember.EXTEND_PROTOTYPES is true (the default value). However, it is - recommended that you use Ember.A when creating addons for ember or when you can not garentee - that Ember.EXTEND_PROTOTYPES will be true. - **/ + Creates an Ember.NativeArray from an Array like object. Does not modify the original object. + Ember.A is not needed if Ember.EXTEND_PROTOTYPES is true (the default value). However, it is + recommended that you use Ember.A when creating addons for ember or when you can not garentee + that Ember.EXTEND_PROTOTYPES will be true. + **/ function A(arr?: any[]): NativeArray; /** - An instance of Ember.Application is the starting point for every Ember application. It helps to - instantiate, initialize and coordinate the many objects that make up your app. - **/ + An instance of Ember.Application is the starting point for every Ember application. It helps to + instantiate, initialize and coordinate the many objects that make up your app. + **/ class Application extends Namespace { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; static initializer(arguments?: ApplicationInitializerArguments): void; /** - Call advanceReadiness after any asynchronous setup logic has completed. - Each call to deferReadiness must be matched by a call to advanceReadiness - or the application will never become ready and routing will not begin. - **/ - advanceReadiness(): void; + Call advanceReadiness after any asynchronous setup logic has completed. + Each call to deferReadiness must be matched by a call to advanceReadiness + or the application will never become ready and routing will not begin. + **/ + advanceReadiness(): void; /** - Use this to defer readiness until some condition is true. + Use this to defer readiness until some condition is true. - This allows you to perform asynchronous setup logic and defer - booting your application until the setup has finished. + This allows you to perform asynchronous setup logic and defer + booting your application until the setup has finished. - However, if the setup requires a loading UI, it might be better - to use the router for this purpose. - */ - deferReadiness(): void; + However, if the setup requires a loading UI, it might be better + to use the router for this purpose. + */ + deferReadiness(): void; /** - defines an injection or typeInjection - **/ - inject(factoryNameOrType: string, property: string, injectionName: string): void; + defines an injection or typeInjection + **/ + inject(factoryNameOrType: string, property: string, injectionName: string): void; /** - This injects the test helpers into the window's scope. If a function of the - same name has already been defined it will be cached (so that it can be reset - if the helper is removed with `unregisterHelper` or `removeTestHelpers`). - Any callbacks registered with `onInjectHelpers` will be called once the - helpers have been injected. - **/ - injectTestHelpers(): void; + This injects the test helpers into the window's scope. If a function of the + same name has already been defined it will be cached (so that it can be reset + if the helper is removed with `unregisterHelper` or `removeTestHelpers`). + Any callbacks registered with `onInjectHelpers` will be called once the + helpers have been injected. + **/ + injectTestHelpers(): void; /** - registers a factory for later injection - @param fullName type:name (e.g., 'model:user') - @param factory (e.g., App.Person) - **/ - register(fullName: string, factory: Function, options?: {}): void; + registers a factory for later injection + @param fullName type:name (e.g., 'model:user') + @param factory (e.g., App.Person) + **/ + register(fullName: string, factory: Function, options?: {}): void; /** - This removes all helpers that have been registered, and resets and functions - that were overridden by the helpers. - **/ - removeTestHelpers(): void; + This removes all helpers that have been registered, and resets and functions + that were overridden by the helpers. + **/ + removeTestHelpers(): void; /** - Reset the application. This is typically used only in tests. - **/ - reset(): void; + Reset the application. This is typically used only in tests. + **/ + reset(): void; /** - This hook defers the readiness of the application, so that you can start - the app when your tests are ready to run. It also sets the router's - location to 'none', so that the window's location will not be modified - (preventing both accidental leaking of state between tests and interference - with your testing framework). - **/ - setupForTesting(): void; + This hook defers the readiness of the application, so that you can start + the app when your tests are ready to run. It also sets the router's + location to 'none', so that the window's location will not be modified + (preventing both accidental leaking of state between tests and interference + with your testing framework). + **/ + setupForTesting(): void; /** - The DOM events for which the event dispatcher should listen. - */ + The DOM events for which the event dispatcher should listen. + */ customEvents: {}; /** - The Ember.EventDispatcher responsible for delegating events to this application's views. - **/ + The Ember.EventDispatcher responsible for delegating events to this application's views. + **/ eventDispatcher: EventDispatcher; /** - Set this to provide an alternate class to Ember.DefaultResolver - **/ + Set this to provide an alternate class to Ember.DefaultResolver + **/ resolver: DefaultResolver; /** - The root DOM element of the Application. This can be specified as an - element or a jQuery-compatible selector string. + The root DOM element of the Application. This can be specified as an + element or a jQuery-compatible selector string. - This is the element that will be passed to the Application's, eventDispatcher, - which sets up the listeners for event delegation. Every view in your application - should be a child of the element you specify here. - **/ + This is the element that will be passed to the Application's, eventDispatcher, + which sets up the listeners for event delegation. Every view in your application + should be a child of the element you specify here. + **/ rootElement: HTMLElement; /** - Called when the Application has become ready. - The call will be delayed until the DOM has become ready. - **/ + Called when the Application has become ready. + The call will be delayed until the DOM has become ready. + **/ ready: Function; /** - Application's router. - **/ + Application's router. + **/ Router: Router; } /** - This module implements Observer-friendly Array-like behavior. This mixin is picked up by the - Array class as well as other controllers, etc. that want to appear to be arrays. - **/ + This module implements Observer-friendly Array-like behavior. This mixin is picked up by the + Array class as well as other controllers, etc. that want to appear to be arrays. + **/ class Array implements Enumerable { addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; @@ -414,21 +414,21 @@ declare module Ember { length: number; } /** - Provides a way for you to publish a collection of objects so that you can easily bind to the - collection from a Handlebars #each helper, an Ember.CollectionView, or other controllers. - **/ + Provides a way for you to publish a collection of objects so that you can easily bind to the + collection from a Handlebars #each helper, an Ember.CollectionView, or other controllers. + **/ class ArrayController extends ArrayProxy implements SortableMixin, ControllerMixin { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -445,30 +445,30 @@ declare module Ember { target: any; } /** - Array polyfills to support ES5 features in older browsers. - **/ + Array polyfills to support ES5 features in older browsers. + **/ var ArrayPolyfills: { map: typeof Array.prototype.map; forEach: typeof Array.prototype.forEach; indexOf: typeof Array.prototype.indexOf; }; /** - An ArrayProxy wraps any other object that implements Ember.Array and/or Ember.MutableArray, - forwarding all requests. This makes it very useful for a number of binding use cases or other cases - where being able to swap out the underlying array is useful. - **/ + An ArrayProxy wraps any other object that implements Ember.Array and/or Ember.MutableArray, + forwarding all requests. This makes it very useful for a number of binding use cases or other cases + where being able to swap out the underlying array is useful. + **/ class ArrayProxy extends Object implements MutableArray { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -549,9 +549,9 @@ declare module Ember { } var BOOTED: boolean; /** - Connects the properties of two objects so that whenever the value of one property changes, - the other property will be changed also. - **/ + Connects the properties of two objects so that whenever the value of one property changes, + the other property will be changed also. + **/ class Binding { constructor(toPath: string, fromPath: string); connect(obj: any): Binding; @@ -567,45 +567,45 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; triggerAction(opts: {}): boolean; } /** - The internal class used to create text inputs when the {{input}} helper is used - with type of checkbox. See Handlebars.helpers.input for usage details. - **/ + The internal class used to create text inputs when the {{input}} helper is used + with type of checkbox. See Handlebars.helpers.input for usage details. + **/ class Checkbox extends View { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; } /** - An Ember.View descendent responsible for managing a collection (an array or array-like object) - by maintaining a child view object and associated DOM representation for each item in the array - and ensuring that child views and their associated rendered HTML are updated when items in the - array are added, removed, or replaced. - **/ + An Ember.View descendent responsible for managing a collection (an array or array-like object) + by maintaining a child view object and associated DOM representation for each item in the array + and ensuring that child views and their associated rendered HTML are updated when items in the + array are added, removed, or replaced. + **/ class CollectionView extends ContainerView { arrayDidChange(content: any[], start: number, removed: number, added: number): void; arrayWillChange(content: any[], start: number, removed: number): void; @@ -618,29 +618,29 @@ declare module Ember { itemViewClass: View; } /** - Implements some standard methods for comparing objects. Add this mixin to any class - you create that can compare its instances. - **/ + Implements some standard methods for comparing objects. Add this mixin to any class + you create that can compare its instances. + **/ class Comparable { compare(a: any, b: any): number; } /** - A view that is completely isolated. Property access in its templates go to the view object - and actions are targeted at the view object. There is no access to the surrounding context or - outer controller; all contextual information is passed in. - **/ + A view that is completely isolated. Property access in its templates go to the view object + and actions are targeted at the view object. There is no access to the surrounding context or + outer controller; all contextual information is passed in. + **/ class Component extends View { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -648,11 +648,11 @@ declare module Ember { targetObject: Controller; } /** - A computed property transforms an objects function into a property. - By default the function backing the computed property will only be called once and the result - will be cached. You can specify various properties that your computed property is dependent on. - This will force the cached result to be recomputed if the dependencies are modified. - **/ + A computed property transforms an objects function into a property. + By default the function backing the computed property will only be called once and the result + will be cached. You can specify various properties that your computed property is dependent on. + This will force the cached result to be recomputed if the dependencies are modified. + **/ class ComputedProperty { cacheable(aFlag?: boolean): ComputedProperty; get(keyName: string): any; @@ -676,11 +676,11 @@ declare module Ember { child(): Container; set(object: {}, key: string, value: any): void; /** - registers a factory for later injection - @param fullName type:name (e.g., 'model:user') - @param factory (e.g., App.Person) - **/ - register(fullName: string, factory: Function, options?: {}): void; + registers a factory for later injection + @param fullName type:name (e.g., 'model:user') + @param factory (e.g., App.Person) + **/ + register(fullName: string, factory: Function, options?: {}): void; unregister(fullName: string): void; resolve(fullName: string): Function; describe(fullName: string): string; @@ -697,29 +697,29 @@ declare module Ember { reset(): void; } /** - An Ember.View subclass that implements Ember.MutableArray allowing programatic - management of its child views. - **/ + An Ember.View subclass that implements Ember.MutableArray allowing programatic + management of its child views. + **/ class ContainerView extends View { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; } class Controller extends Object { } /** - Additional methods for the ControllerMixin. - **/ + Additional methods for the ControllerMixin. + **/ class ControllerMixin { replaceRoute(name: string, ...args: any[]): void; transitionToRoute(name: string, ...args: any[]): void; @@ -728,11 +728,11 @@ declare module Ember { target: any; } /** - Implements some standard methods for copying an object. Add this mixin to any object you - create that can create a copy of itself. This mixin is added automatically to the built-in array. - You should generally implement the copy() method to return a copy of the receiver. - Note that frozenCopy() will only work if you also implement Ember.Freezable. - **/ + Implements some standard methods for copying an object. Add this mixin to any object you + create that can create a copy of itself. This mixin is added automatically to the built-in array. + You should generally implement the copy() method to return a copy of the receiver. + Note that frozenCopy() will only work if you also implement Ember.Freezable. + **/ class Copyable { copy(deep: boolean): Copyable; frozenCopy(): Copyable; @@ -741,64 +741,64 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; /** - Destroys an object by setting the isDestroyed flag and removing its metadata, which effectively - destroys observers and bindings. If you try to set a property on a destroyed object, an exception - will be raised. Note that destruction is scheduled for the end of the run loop and does not - happen immediately. It will set an isDestroying flag immediately. - **/ - destroy(): CoreObject; + Destroys an object by setting the isDestroyed flag and removing its metadata, which effectively + destroys observers and bindings. If you try to set a property on a destroyed object, an exception + will be raised. Note that destruction is scheduled for the end of the run loop and does not + happen immediately. It will set an isDestroying flag immediately. + **/ + destroy(): CoreObject; init(): void; /** - Returns a string representation which attempts to provide more information than Javascript's toString - typically does, in a generic way for all Ember objects (e.g., ""). - **/ - toString(): string; + Returns a string representation which attempts to provide more information than Javascript's toString + typically does, in a generic way for all Ember objects (e.g., ""). + **/ + toString(): string; willDestroy(): void; /** - Defines the properties that will be concatenated from the superclass (instead of overridden). - **/ + Defines the properties that will be concatenated from the superclass (instead of overridden). + **/ concatenatedProperties: any[]; /** - Destroyed object property flag. If this property is true the observers and bindings were - already removed by the effect of calling the destroy() method. - **/ + Destroyed object property flag. If this property is true the observers and bindings were + already removed by the effect of calling the destroy() method. + **/ isDestroyed: boolean; /** - Destruction scheduled flag. The destroy() method has been called. The object stays intact - until the end of the run loop at which point the isDestroyed flag is set. - **/ + Destruction scheduled flag. The destroy() method has been called. The object stays intact + until the end of the run loop at which point the isDestroyed flag is set. + **/ isDestroying: boolean; } /** - An abstract class that exists to give view-like behavior to both Ember's main view class Ember.View - and other classes like Ember._SimpleMetamorphView that don't need the fully functionaltiy of Ember.View. - Unless you have specific needs for CoreView, you will use Ember.View in your applications. - **/ + An abstract class that exists to give view-like behavior to both Ember's main view class Ember.View + and other classes like Ember._SimpleMetamorphView that don't need the fully functionaltiy of Ember.View. + Unless you have specific needs for CoreView, you will use Ember.View in your applications. + **/ class CoreView extends Object { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -815,12 +815,12 @@ declare module Ember { } function DEFAULT_GETTER_FUNCTION(name: string): Function; /** - The DefaultResolver defines the default lookup rules to resolve container lookups before consulting - the container for registered items: - templates are looked up on Ember.TEMPLATES - other names are looked up on the application after converting the name. - For example, controller:post looks up App.PostController by default. - **/ + The DefaultResolver defines the default lookup rules to resolve container lookups before consulting + the container for registered items: + templates are looked up on Ember.TEMPLATES + other names are looked up on the application after converting the name. + For example, controller:post looks up App.PostController by default. + **/ class DefaultResolver { resolve(fullName: string): {}; namespace: Application; @@ -836,42 +836,42 @@ declare module Ember { then(resolve: Function, reject: Function): void; } /** - Objects of this type can implement an interface to respond to requests to get and set. - The default implementation handles simple properties. - You generally won't need to create or subclass this directly. - **/ + Objects of this type can implement an interface to respond to requests to get and set. + The default implementation handles simple properties. + You generally won't need to create or subclass this directly. + **/ class Descriptor { } var EMPTY_META: {}; // TODO: define interface var ENV: {}; var EXTEND_PROTOTYPES: boolean; /** - This is the object instance returned when you get the @each property on an array. It uses - the unknownProperty handler to automatically create EachArray instances for property names. - **/ + This is the object instance returned when you get the @each property on an array. It uses + the unknownProperty handler to automatically create EachArray instances for property names. + **/ class EachProxy extends Object { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; unknownProperty(keyName: string, value: any): any[]; } /** - This mixin defines the common interface implemented by enumerable objects in Ember. Most of these - methods follow the standard Array iteration API defined up to JavaScript 1.8 (excluding language-specific - features that cannot be emulated in older versions of JavaScript). - This mixin is applied automatically to the Array class on page load, so you can use any of these methods - on simple arrays. If Array already implements one of these methods, the mixin will not override them. - **/ + This mixin defines the common interface implemented by enumerable objects in Ember. Most of these + methods follow the standard Array iteration API defined up to JavaScript 1.8 (excluding language-specific + features that cannot be emulated in older versions of JavaScript). + This mixin is applied automatically to the Array class on page load, so you can use any of these methods + on simple arrays. If Array already implements one of these methods, the mixin will not override them. + **/ class Enumerable { addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; any(callback: Function, target?: any): boolean; @@ -920,35 +920,35 @@ declare module Ember { } var EnumerableUtils: {}; // TODO: define interface /** - A subclass of the JavaScript Error object for use in Ember. - **/ + A subclass of the JavaScript Error object for use in Ember. + **/ // ReSharper disable once DuplicatingLocalDeclaration var Error: typeof Error; /** - Handles delegating browser events to their corresponding Ember.Views. For example, when you click on - a view, Ember.EventDispatcher ensures that that view's mouseDown method gets called. - **/ + Handles delegating browser events to their corresponding Ember.Views. For example, when you click on + a view, Ember.EventDispatcher ensures that that view's mouseDown method gets called. + **/ class EventDispatcher extends Object { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; events: {}; } /** - This mixin allows for Ember objects to subscribe to and emit events. - You can also chain multiple event subscriptions. - **/ + This mixin allows for Ember objects to subscribe to and emit events. + You can also chain multiple event subscriptions. + **/ class Evented { has(name: string): boolean; off(name: string, target: any, method: Function): Evented; @@ -1014,14 +1014,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1030,14 +1030,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1060,14 +1060,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1119,9 +1119,9 @@ declare module Ember { class Mixin { apply(obj: any): any; /** - Creates an instance of the class. - @param arguments A hash containing values with which to initialize the newly instantiated object. - **/ + Creates an instance of the class. + @param arguments A hash containing values with which to initialize the newly instantiated object. + **/ static create(arguments?: {}): T; detect(obj: any): boolean; reopen(arguments?: {}): T; @@ -1188,8 +1188,8 @@ declare module Ember { unshiftObject(object: any): any; unshiftObjects(objects: any[]): any[]; without(value: any): Enumerable; - '[]': any[]; - '@each': EachProxy; + '[]': any[]; + '@each': EachProxy; Boolean: boolean; firstObject: any; hasEnumerableObservers: boolean; @@ -1255,14 +1255,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1331,8 +1331,8 @@ declare module Ember { unshiftObject(object: any): any; unshiftObjects(objects: any[]): any[]; without(value: any): any[]; - '[]': any[]; - '@each': EachProxy; + '[]': any[]; + '@each': EachProxy; Boolean: boolean; firstObject: any; hasEnumerableObservers: boolean; @@ -1368,14 +1368,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1383,40 +1383,40 @@ declare module Ember { var ORDER_DEFINITION: string[]; class Object extends CoreObject implements Observable { /** - Creates a subclass of the Object class. - **/ + Creates a subclass of the Object class. + **/ static extend(arguments?: CoreObjectArguments): T; /** - Creates an instance of the class. - @param arguments A hash containing values with which to initialize the newly instantiated object. - **/ + Creates an instance of the class. + @param arguments A hash containing values with which to initialize the newly instantiated object. + **/ static create(arguments?: {}): T; /** - Equivalent to doing extend(arguments).create(). If possible use the normal create method instead. - **/ + Equivalent to doing extend(arguments).create(). If possible use the normal create method instead. + **/ static createWithMixins(arguments?: {}): T; static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; /** - Augments a constructor's prototype with additional properties and functions. - To add functions and properties to the constructor itself, see reopenClass. - **/ + Augments a constructor's prototype with additional properties and functions. + To add functions and properties to the constructor itself, see reopenClass. + **/ static reopen(arguments?: {}): T; /** - Augments a constructor's own properties and functions. - To add functions and properties to instances of a constructor by extending the - constructor's prototype see reopen. - **/ + Augments a constructor's own properties and functions. + To add functions and properties to instances of a constructor by extending the + constructor's prototype see reopen. + **/ static reopenClass(arguments?: {}): T; static isClass: boolean; static isMethod: boolean; @@ -1451,20 +1451,20 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; /** - The object whose properties will be forwarded. - **/ + The object whose properties will be forwarded. + **/ content: Object; } class Observable { @@ -1528,14 +1528,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1563,14 +1563,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1587,14 +1587,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1613,14 +1613,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1670,7 +1670,7 @@ declare module Ember { toArray(): any[]; uniq(): Set; without(value: any): Set; - '[]': any[]; + '[]': any[]; firstObject: any; hasEnumerableObservers: boolean; lastObject: any; @@ -1735,7 +1735,7 @@ declare module Ember { toArray(): any[]; uniq(): Enumerable; without(value: any): Enumerable; - '[]': any[]; + '[]': any[]; arrangedContent: any; firstObject: any; hasEnumerableObservers: boolean; @@ -1748,14 +1748,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1781,14 +1781,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1848,14 +1848,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1872,14 +1872,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1911,14 +1911,14 @@ declare module Ember { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ static eachComputedProperty(callback: Function, binding: {}): void; /** - Returns the original hash that was passed to meta(). - @param key property name - **/ + Returns the original hash that was passed to meta(). + @param key property name + **/ static metaForProperty(key: string): {}; static isClass: boolean; static isMethod: boolean; @@ -1983,8 +1983,8 @@ declare module Ember { function addListener(obj: any, eventName: string, func: Function, method: string, once?: boolean): void; var addObserver: ModifyObserver; /** - Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead. - **/ + Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead. + **/ var alias: typeof deprecateFunc; function aliasMethod(methodName: string): Descriptor; var anyUnprocessedMixins: boolean; @@ -2025,9 +2025,9 @@ declare module Ember { function controllerFor(container: Container, controllerName: string, lookupOptions?: {}): Controller; function copy(obj: any, deep: boolean): any; /** - Creates an instance of the CoreObject class. - @param arguments A hash containing values with which to initialize the newly instantiated object. - **/ + Creates an instance of the CoreObject class. + @param arguments A hash containing values with which to initialize the newly instantiated object. + **/ function create(arguments?: {}): CoreObject; function debug(message: string): void; function defineProperty(obj: any, keyName: string, desc: {}): void; @@ -2035,8 +2035,8 @@ declare module Ember { function deprecateFunc(message: string, func: Function): Function; function destroy(obj: any): void; /** - Ember.empty is deprecated. Please use Ember.isEmpty instead. - **/ + Ember.empty is deprecated. Please use Ember.isEmpty instead. + **/ // ReSharper disable once DuplicatingLocalDeclaration var empty: typeof deprecateFunc; function endPropertyChanges(): void; @@ -2049,8 +2049,8 @@ declare module Ember { function get(obj: any, keyName: string): any; function getMeta(obj: any, property: string): any; /** - getPath is deprecated since get now supports paths. - **/ + getPath is deprecated since get now supports paths. + **/ var getPath: typeof deprecateFunc; function getWithDefault(root: string, key: string, defaultValue: any): any; function guidFor(obj: any): string; @@ -2079,10 +2079,10 @@ declare module Ember { function merge(original: any, updates: any): any; function meta(obj: any, writable?: boolean): {}; function metaPath(obj: any, path: string, writable?: boolean): any; - function mixin(obj: any, ...args: any[]): any; + function mixin(obj: any, ...any[]): any; /** - Ember.none is deprecated. Please use Ember.isNone instead. - **/ + Ember.none is deprecated. Please use Ember.isNone instead. + **/ var none: typeof deprecateFunc; function normalizeTuple(target: any, path: string): any[]; function observer(func: Function, ...args: string[]): Function; @@ -2141,8 +2141,8 @@ declare module Ember { function set(obj: any, keyName: string, value: any): any; function setMeta(obj: any, property: string, value: any): void; /** - setPath is deprecated since set now supports paths. - **/ + setPath is deprecated since set now supports paths. + **/ var setPath: typeof deprecateFunc; function setProperties(self: any, hash: {}): any; function subscribe(pattern: string, object: any): void; @@ -2153,8 +2153,8 @@ declare module Ember { function tryInvoke(obj: any, methodName: string, args?: any[]): any; function trySet(obj: any, path: string, value: any): void; /** - trySetPath has been renamed to trySet. - **/ + trySetPath has been renamed to trySet. + **/ var trySetPath: typeof deprecateFunc; function typeOf(item: any): string; function unwatch(obj: any, keyPath: string): void; @@ -2174,8 +2174,8 @@ declare module Ember { // ReSharper disable DuplicatingLocalDeclaration declare module Em { /** - Alias for jQuery. - **/ + Alias for jQuery. + **/ var $: typeof Ember.$; var A: typeof Ember.A; class Application extends Ember.Application { } From dc699cf64643e8637cfc8d9b24595616c1cc2411 Mon Sep 17 00:00:00 2001 From: Jakub Olek Date: Mon, 25 Aug 2014 14:37:52 +0200 Subject: [PATCH 067/537] missing Transition property --- ember/ember.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ember/ember.d.ts b/ember/ember.d.ts index 9ee334738..19b1b49dd 100644 --- a/ember/ember.d.ts +++ b/ember/ember.d.ts @@ -11,12 +11,15 @@ declare var Handlebars: HandlebarsStatic; declare module EmberStates { interface Transition { + abort(): void; addInitialStates(): void; matchContextsToStates(contexts: any[]): void; normalize(manager: Ember.StateManager, contexts: any[]): void; removeUnchangedContexts(manager: Ember.StateManager): void; + retry(): void; sendEvents(eventName: string, sendRecursiveArguments: boolean, isUnhandledPass: boolean): void; sendRecursively(event: string, currentState: Ember.State, isUnhandledPass: boolean): void; + targetName: string; } } From 6e20551e4835bb046c88cd0e23d94e1bf2de749c Mon Sep 17 00:00:00 2001 From: Steven Date: Mon, 25 Aug 2014 18:52:25 -0700 Subject: [PATCH 068/537] Added more emit() overloads --- dropzone/dropzone.d.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dropzone/dropzone.d.ts b/dropzone/dropzone.d.ts index 0c754fbd5..5dca7e169 100644 --- a/dropzone/dropzone.d.ts +++ b/dropzone/dropzone.d.ts @@ -73,7 +73,21 @@ declare class Dropzone { getQueuedFiles(): DropzoneFile[]; getUploadingFiles(): DropzoneFile[]; - emit(eventName: string, file: DropzoneFile, data?: string); + emit(eventName: string, file: DropzoneFile, str?: string); + emit(eventName: "thumbnail", file: DropzoneFile, path: string); + emit(eventName: "addedfile", file: DropzoneFile); + emit(eventName: "removedfile", file: DropzoneFile); + emit(eventName: "processing", file: DropzoneFile); + emit(eventName: "canceled", file: DropzoneFile); + emit(eventName: "complete", file: DropzoneFile); + + emit(eventName: string, e: Event); + emit(eventName: "drop", e: Event); + emit(eventName: "dragstart", e: Event); + emit(eventName: "dragend", e: Event); + emit(eventName: "dragenter", e: Event); + emit(eventName: "dragover", e: Event); + emit(eventName: "dragleave", e: Event); } interface JQuery { From 101e436092dde7fcbc9035d79b118e8d10ac32e9 Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Tue, 26 Aug 2014 14:06:08 +0900 Subject: [PATCH 069/537] Add HttpHeader type --- chrome/chrome.d.ts | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index e7e58dbbc..df655e2b8 100755 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -2230,13 +2230,19 @@ declare module chrome.webRequest { username: string; password: string; } - + + interface HttpHeader { + name: string; + value?: string; + binaryValue?: ArrayBuffer; + } + interface BlockingResponse { cancel?: boolean; redirectUrl?: string; - responseHeaders?: Object; + responseHeaders?: HttpHeader[]; authCredentials?: AuthCredentials; - requestHeaders?: Object; + requestHeaders?: HttpHeader[]; } interface RequestFilter { @@ -2256,7 +2262,7 @@ declare module chrome.webRequest { ip?: string; statusLine?: string; frameId: number; - responseHeaders?: Object; + responseHeaders?: HttpHeader[]; parentFrameId: number; fromCache: boolean; url: string; @@ -2275,7 +2281,7 @@ declare module chrome.webRequest { statusLine?: string; frameId: number; requestId: string; - responseHeaders: Object; + responseHeaders?: HttpHeader[]; type: string; method: string; } @@ -2285,7 +2291,7 @@ declare module chrome.webRequest { ip?: string; statusLine?: string; frameId: number; - responseHeaders?: Object; + responseHeaders?: HttpHeader[]; parentFrameId: number; fromCache: boolean; url: string; @@ -2307,7 +2313,7 @@ declare module chrome.webRequest { statusLine?: string; frameId: number; challenger: Challenger; - responseHeaders: Object; + responseHeaders?: HttpHeader[]; isProxy: boolean; realm?: string; parentFrameId: number; @@ -2326,7 +2332,7 @@ declare module chrome.webRequest { timeStamp: number; frameId: number; requestId: number; - requestHeaders?: Object; + requestHeaders?: HttpHeader[]; type: string; method: string; } @@ -2350,7 +2356,7 @@ declare module chrome.webRequest { ip?: string; statusLine?: string; frameId: number; - responseHeaders?: Object; + responseHeaders?: HttpHeader[]; parentFrameId: number; fromCache: boolean; url: string; @@ -2368,7 +2374,7 @@ declare module chrome.webRequest { timeStamp: number; frameId: number; requestId: string; - requestHeaders: Object; + requestHeaders?: HttpHeader[]; type: string; method: string; } From d51f7f601a1d4f166d32b08c615600a37d49c7ba Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Tue, 26 Aug 2014 15:01:51 +0900 Subject: [PATCH 070/537] Add length property --- zepto/zepto.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zepto/zepto.d.ts b/zepto/zepto.d.ts index 3608ade9f..ba75e7556 100644 --- a/zepto/zepto.d.ts +++ b/zepto/zepto.d.ts @@ -1106,7 +1106,12 @@ interface ZeptoCollection { * @return **/ size(): number; - + + /** + * Get the number of elements in this collection. + **/ + length: number; + /** * Extract the subset of this array, starting at start index. If end is specified, extract up to but not including end index. * @param start From 76e60effef77c57d860160772752b27d6644630d Mon Sep 17 00:00:00 2001 From: Jakub Olek Date: Tue, 26 Aug 2014 11:51:35 +0200 Subject: [PATCH 071/537] args should have a name --- ember/ember.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ember/ember.d.ts b/ember/ember.d.ts index 19b1b49dd..878d8a49c 100644 --- a/ember/ember.d.ts +++ b/ember/ember.d.ts @@ -2082,7 +2082,7 @@ declare module Ember { function merge(original: any, updates: any): any; function meta(obj: any, writable?: boolean): {}; function metaPath(obj: any, path: string, writable?: boolean): any; - function mixin(obj: any, ...any[]): any; + function mixin(obj: any, ...args: any[]): any; /** Ember.none is deprecated. Please use Ember.isNone instead. **/ From 45aa8fbb7c49d02b92900d4427cc3da5c96cc8ce Mon Sep 17 00:00:00 2001 From: Igor Kriklivets Date: Tue, 26 Aug 2014 14:55:21 +0400 Subject: [PATCH 072/537] Defs for all DevExtreme products version 14.1 --- devextreme/dx.chartjs-tests.ts | 26 + devextreme/dx.chartjs.d.ts | 1861 +++++++++++++++++++++++++++++++ devextreme/dx.phonejs-tests.ts | 258 +++++ devextreme/dx.phonejs.d.ts | 1502 +++++++++++++++++++++++++ devextreme/dx.webappjs-tests.ts | 93 ++ devextreme/dx.webappjs.d.ts | 1597 ++++++++++++++++++++++++++ 6 files changed, 5337 insertions(+) create mode 100644 devextreme/dx.chartjs-tests.ts create mode 100644 devextreme/dx.chartjs.d.ts create mode 100644 devextreme/dx.phonejs-tests.ts create mode 100644 devextreme/dx.phonejs.d.ts create mode 100644 devextreme/dx.webappjs-tests.ts create mode 100644 devextreme/dx.webappjs.d.ts diff --git a/devextreme/dx.chartjs-tests.ts b/devextreme/dx.chartjs-tests.ts new file mode 100644 index 000000000..70c53a602 --- /dev/null +++ b/devextreme/dx.chartjs-tests.ts @@ -0,0 +1,26 @@ +/// + +module Test { + $("
").appendTo(document.body).dxChart({ + size: { + width: 600, + height: 400 + }, + title: { + text: 'Chart in jQuery mode', + font: { color: 'rgb(0, 128, 128)!important' } + }, + argumentAxis: { + categories: ['January', 'February', 'March', 'April', 'May', 'June'] + }, + dataSource: [ + { arg: 'January', v1: 10, v2: 20, v3: 24 }, + { arg: 'February', v1: 5, v2: 35, v3: 43 }, + { arg: 'March', v1: 50, v2: 10, v3: 80 }, + { arg: 'April', v1: 9, v2: 79, v3: 39 }, + { arg: 'May', v1: 100, v2: 42, v3: 22 }, + { arg: 'June', v1: 95, v2: 11, v3: 41 } + ], + series: [{ valueField: 'v1' }, { valueField: 'v2' }, { valueField: 'v3' }] + }); +} \ No newline at end of file diff --git a/devextreme/dx.chartjs.d.ts b/devextreme/dx.chartjs.d.ts new file mode 100644 index 000000000..0559c098a --- /dev/null +++ b/devextreme/dx.chartjs.d.ts @@ -0,0 +1,1861 @@ +// Type definitions for ChartJS +// Project: http://js.devexpress.com/WebDevelopment/Charts/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module DevExpress { +export function abstract(): void; + export var rtlEnabled: boolean; + export var hardwareBackButton: JQueryCallback; + interface Endpoint { + local?: string; + production: string; + } + class EndpointSelector { + constructor(config: { [key: string]: Endpoint }); + urlFor(key: string): string; + } + export interface ActionOptions { + context?: Object; + component?: any; + beforeExecute? (e:ActionExecuteArgs): void; + afterExecute? (e:ActionExecuteArgs): void; + } + export interface ActionExecuteArgs { + action: any; + args: any[]; + context: any; + component: any; + cancel: boolean; + handled: boolean; + } + export class Action { + constructor(action?: any, config?: ActionOptions); + execute(): any; + } + export interface IDevice { + deviceType?: string; + platform?: string; + version?: Array; + phone?: boolean; + tablet?: boolean; + android?: boolean; + ios?: boolean; + win8?: boolean; + tizen?: boolean; + generic?: boolean; + } + export module devices { + export function orientation(): string; + export var orientationChanged: JQueryCallback; + export function real(): IDevice; + export function current(deviceOrName: string): IDevice; + export function current(deviceOrName: IDevice): IDevice; + } + export function registerComponent(name: string, componentClass: any): void; + export interface ComponentOptions { + disabled?: boolean; + } + export class Component { + constructor(element: Element, options?: ComponentOptions); + constructor(element: JQuery, options?: ComponentOptions); + disposing: JQueryCallback; + optionChanged: JQueryCallback; + instance(): Component; + beginUpdate(): void; + endUpdate(): void; + option(): any; + option(options: string): any; + option(options: string): T; + option(options: string, value: any): void; + option(options: { [key: string]: any }): void; + option(options?: any): any; + } + export interface DOMComponentOptions extends ComponentOptions { + rtlEnabled?: boolean; + } + export class DOMComponent extends Component { + constructor(element: HTMLElement, options?: DOMComponentOptions); + static defaultOptions(rule: { + device: any; + options: { [key: string]: any }; + }): void; + } +} +declare module DevExpress.data { +export interface DataError extends Error { + httpStatus?: number; + errorDetails?: any; + } + export interface ErrorHandler { (e: DataError): void; } + export interface EntityOptions { key: any; keyType: any; } + export interface Getter { (obj: any, options?: any): any; } + export interface Setter { (obj: any, value: any, options?: any): void; } + export interface QueryOptions { + errorHandler?: ErrorHandler; + requireTotalCount?: boolean; + } + export interface ODataQueryOptions extends QueryOptions { + adapter?: any; + } + interface IQuery { + enumerate(): JQueryPromise>; + count(): JQueryPromise; + slice(skip: number, take?: number): IQuery; + sortBy(field: string): IQuery; + sortBy(field: Getter): IQuery; + sortBy(field: { field: string; desc?: boolean }): IQuery; + sortBy(field: { field: Getter; desc?: boolean }): IQuery; + thenBy(field: string): IQuery; + thenBy(field: Getter): IQuery; + thenBy(field: { field: string; desc?: boolean }): IQuery; + thenBy(field: { field: Getter; desc?: boolean }): IQuery; + filter(field: string, operator: string, value: any): IQuery; + filter(field: string, value: any): IQuery; + filter(criteria: any[]): IQuery; + select(field: string): IQuery; + select(field: string[]): IQuery; + select(...field: string[]): IQuery; + select(field: Getter): IQuery; + select(field: Getter[]): IQuery; + select(...field: Getter[]): IQuery; + groupBy(field: string[]): IQuery; + groupBy(field: Getter[]): IQuery; + groupBy(field: { field: string; desc?: boolean }[]): IQuery; + groupBy(field: { field: Getter; desc?: boolean }[]): IQuery; + sum(getter?: string): JQueryPromise; + min(getter?: string): JQueryPromise; + max(getter?: string): JQueryPromise; + avg(getter?: string): JQueryPromise; + aggregate(step: number): JQueryPromise; + aggregate(seed: number, step: (accumulator: any, current: any) => any, finalize?: (accumulator: any) => any): JQueryPromise; + } + export interface ArrayQuery extends IQuery { + toArray(): Array; + } + export interface RemoteQuery extends IQuery { /*todo: exec() ? */ } + export function base64_encode(input: string): string; + export function base64_encode(input: any[]): string; + export function query(items?: any[]): IQuery; + export var queryImpl: { + remote: (url: string, queryOptions: QueryOptions) => RemoteQuery; + array: (iter: Array, queryOptions: QueryOptions) => ArrayQuery; + }; + export class Guid { + constructor(value?: string); + constructor(value?: any); + toString(): string; + valueOf(): string; + toJSON(): string; + } + export class EdmLiteral { + constructor(value: any); + valueOf(): any; + } + export module utils { + export function normalizeSortingInfo(info: string): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: string[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: Getter): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: Getter[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { field: string; dir?: string }): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { field: string; dir?: string }[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { field: string; desc?: boolean }): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { field: string; desc?: boolean }[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { selector: string; dir?: string }): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { selector: string; dir?: string }[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { selector: string; desc?: boolean }): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { selector: string; desc?: boolean }[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeBinaryCriterion(criteria: Array): Array; + export function keysEqual(key1: any, key2: any): boolean; + export function keysEqual(keyExpr: any, key1: any, key2: any): boolean; + export function toComparable(value: Date, caseSensitive?: boolean): number; + export function toComparable(value: Guid, caseSensitive?: boolean): string; + export function toComparable(value: string, caseSensitive?: boolean): string; + export function compileGetter(): Getter; + export function compileGetter(expr: any[]): Getter; + export function compileGetter(expr: string): Getter; + export function compileGetter(expr: "this"): Getter; + export function compileGetter(expr: Getter): Getter; + export function compileSetter(expr: string): Setter; + export module odata { + export function sendRequest(request: JQueryXHR, requestOptions?: JQueryAjaxSettings): any; + export function serializePropName(propName: EdmLiteral): string; + export function serializePropName(propName: string): string; + export function serializeValue(value: Date): string; + export function serializeValue(value: Guid): string; + export function serializeValue(value: string): string; + export function serializeValue(value: "string"): string; + export function serializeValue(value: EdmLiteral): string; + export function serializeKey(key: any): string; + export function serializeKey(key: Date): string; + export function serializeKey(key: Guid): string; + export function serializeKey(key: string): string; + export function serializeKey(key: "string"): string; + export function serializeKey(key: EdmLiteral): string; + export var keyConverters: { + String(value: any): string; + Guid(value: any): Guid; + Int32(value: any): number; + Int64(value: any): EdmLiteral; + }; + } + } + export module queryAdapters { + export function odata(queryOptions: ODataQueryOptions): RemoteQuery; + } +export interface DataSourceOptions { + map? (item: any): any; + postProcess? (result: any[]): any; + pageSize: number; + paginate: boolean; + } + export class DataSource { + public changed: JQueryCallback; + public loadError: JQueryCallback; + public loadingChanged: JQueryCallback; + constructor(options?: Store); + constructor(options?: string); + constructor(options?: Array); + constructor(options?: { store: Store }); + constructor(options?: CustomStoreOptions); + constructor(options?: { store: Array }); + constructor(options?: { store: { type: string } }); + constructor(options?: { load(options?: LoadOptions): JQueryXHR; }); + constructor(options?: { load(options?: LoadOptions): Array; }); + constructor(options?: { load(options?: LoadOptions): JQueryPromise; }); + constructor(options?: DataSourceOptions); + loadOptions(): { [key: string]: any }; + items(): Array; + store(): data.Store; + isLastPage(): boolean; + pageIndex(newIndex?: number): number; + sort(expr: any[]): any[]; + group(expr: any[]): any[]; + filter(expr: any[]): any[]; + select(expr: string[]): string[]; + searchValue(value?: string): string; + searchOperation(op?: string): string; + searchExpr(selector: string): string; + key(): any; + isLoaded(): boolean; + isLoading(): boolean; + totalCount(): number; + load(): JQueryPromise; + dispose(): void; + } +export interface StoreOptions { + key?: any; + errorHandler?: ErrorHandler; + loaded?: (result: Array) => void; + loading?: (loadOptions: LoadOptions) => void; + modified?: () => void; + modifying?: () => void; + inserted?: (values: Object, key: any) => void; + inserting?: (values: Object) => void; + updated?: (key: any, values: Object) => void; + updating?: (key: any, values: Object) => void; + removed?: (key: any) => void; + removing?: (key: any) => void; + } + export interface LoadOptions extends QueryOptions { + skip?: number; + take?: number; + sort?: any; + select?: any; + filter?: any; + group?: any; + expand?: any; + } + export class Store { + loaded: JQueryCallback; + loading: JQueryCallback; + modified: JQueryCallback; + modifying: JQueryCallback; + inserted: JQueryCallback; + inserting: JQueryCallback; + updated: JQueryCallback; + updating: JQueryCallback; + removed: JQueryCallback; + removing: JQueryCallback; + constructor(options?: StoreOptions); + key(): any; + keyOf(obj: any): any; + load(options?: LoadOptions): JQueryPromise; + createQuery(options?: QueryOptions): IQuery; + totalCount(options?: { + filter?: any[]; + group?: string[]; + }): JQueryPromise; + byKey(key: any, extraOptions?: { + expand?: string[] + }): JQueryPromise; + remove(key: any): JQueryPromise; + insert(values: any): JQueryPromise; + update(key: any, values: any): JQueryPromise; + } + export interface CustomStoreOptions extends StoreOptions { + load? (options?: LoadOptions): any; + byKey? (key: any): any; + insert? (values: any): any; + update? (key: any, values: any): any; + remove? (key: any): any; + totalCount? (options?: { + filter?: any[]; + group?: string[]; + }): any; + } + export class CustomStore extends Store { + constructor(options?: CustomStoreOptions); + } + export interface ArrayStoreOptions extends StoreOptions { + data?: Array + } + export class ArrayStore extends Store { + constructor(options?: Array); + constructor(options?: ArrayStoreOptions); + } + export interface LocalStoreOptions extends ArrayStoreOptions { + name: string; + } + export class LocalStore extends ArrayStore { + constructor(options?: string); + constructor(options?: LocalStoreOptions); + clear(): void; + } + export interface ODataStoreOptions extends StoreOptions { + url?: string; + name?: string; + keyType?: string; + jsonp?: boolean; + withCredentials?: boolean; + } + export class ODataStore extends Store { + constructor(options?: ODataStoreOptions); + } + export interface ODataContextOptions { + url: string; + jsonp?: boolean; + withCredentials?: boolean; + errorHandler?: ErrorHandler; + beforeSend?: () => any; + entities?: { + [entityAlias: string]: ODataStoreOptions; + }; + } + export class ODataContext { + constructor(options?: ODataContextOptions); + get(operationName: string, params: { [key: string]: any }): JQueryPromise>; + invoke(operationName: string, params: { [key: string]: any }, httpMethod?: string): JQueryPromise>; + objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; }; + } +} +declare module DevExpress.ui { + interface ViewportOptions { + allowPan?: boolean; + allowZoom?: boolean; + } + export interface ITemplate { + compile(html: string): any; + render(template: JQuery, data: any): any; + render(template: any, data: any): any; + } + class Template { + constructor(element: HTMLElement); + constructor(element: JQueryStatic); + render(container: HTMLElement): any; + render(container: JQueryStatic): any; + dispose(): void; + } + interface TemplateStatic { + new (element: HTMLElement): Template; + new (element: JQueryStatic): Template; + } + class TemplateProvider { + constructor(); + getTemplateClass(widget: any): TemplateStatic; + getDefaultTemplate(widget: any): void; supportDefaultTemplate(): boolean; + } + export function initViewport(options: ViewportOptions): void; + interface NotifyOptions { + message: string; + type?: string; + displayTime?: number; + hiddenAction: () => any; + } + export function notyfy(options: any): void; + export function notify(message: string, type?: string, displayTime?: number): void; + export module dialog { + interface Dialog { + show(): JQueryPromise; + hide(value?: any): void; + } + interface DialogButton { + text: string; + icon: string; + clickAction: () => any; + } + interface DialogOptions { + message: string; + title?: string; + } + export function custom(options: DialogOptions): Dialog; + export function custom(message: string, title?: string): Dialog; + export function alert(options: DialogOptions): JQueryPromise; + export function alert(message: string, title?: string): JQueryPromise; + export function confirm(options: DialogOptions): JQueryPromise; + export function confirm(message: string, title?: string): JQueryPromise; + } +export interface CollectionContainerWidgetOptions extends WidgetOptions { + items?: Array; + itemTemplate?: any; + itemRender?: Function; + itemClickAction?: any; + itemRenderedAction?: any; + noDataText?: string; + dataSource?: data.DataSource; + selectedIndex?: number; + itemSelectAction?: any; + itemHoldAction?: any; + itemHoldTimeout?: number; + } + export class CollectionContainerWidget extends Widget { + constructor(element: Element, options?: CollectionContainerWidgetOptions); + constructor(element: JQuery, options?: CollectionContainerWidgetOptions); + } +export interface WidgetOptions extends ComponentOptions { + contentReadyAction?: any; + width?: any; + height?: any; + visible?: boolean; + activeStateEnabled?: boolean; + } + export class Widget extends Component { + constructor(element: Element, options?: WidgetOptions); + constructor(element: JQuery, options?: WidgetOptions); + init(): void; + repaint(): void; + addTemplate(template: ITemplate): void; + } +export interface dxEditorOptions extends WidgetOptions { + value?: any; + valueChangeAction?: any; + } + export class dxEditor extends Widget { + constructor(element: Element, options?: dxEditorOptions); + constructor(element: JQuery, options?: dxEditorOptions); + } +} +declare module DevExpress.viz { +export class Chart extends Component { + constructor(element: Element, options?: viz.charts.ChartOptions); + constructor(element: JQuery, options?: viz.charts.ChartOptions); + clearSelection(): void; + getSeries(): viz.charts.series.Series; + hidiTooltip(): void; + render(options: viz.charts.RenderOptions): void; + render(): void; + zoomArgument(minArg: any, maxArg: any): void; + getSeriesByPos(seriesIndex: number): viz.charts.series.Series; + getSeriesByName(seriesName: string): viz.charts.series.Series; + getAllSeries(): Array; + instance(): Chart; + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + svg(): string; + getSize(): { width: number; height: number }; + } + export class PieChart extends Component { + constructor(element: Element, options?: viz.charts.PieOptions); + constructor(element: JQuery, options?: viz.charts.PieOptions); + clearSelection(): void; + getSeries(): viz.charts.series.PieSeries; + hidiTooltip(): void; + render(options: viz.charts.RenderOptions): void; + render(): void; + instance(): PieChart; + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + svg(): string; + getSize(): { width: number; height: number }; + } + export class RangeSelector extends Component { + constructor(element: Element, options?: viz.rangeSelector.RangeSelectorOptions); + constructor(element: JQuery, options?: viz.rangeSelector.RangeSelectorOptions); + getSelectedRange: () => viz.rangeSelector.SelectedRange; + setSelectedRange: (selectedRange: viz.rangeSelector.SelectedRange) => void; + render(): RangeSelector; + instance(): RangeSelector; + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + svg(): string; + } + export class CircularGauge extends Component { + constructor(element: Element, options?: viz.gauges.CircularGaugeOptions); + constructor(element: JQuery, options?: viz.gauges.CircularGaugeOptions); + value(): number; + value(val: number): CircularGauge; + subvalues(): Array; + subvalues(values: Array): CircularGauge; + render(): CircularGauge; + instance(): CircularGauge; + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + svg(): string; + } + export class LinearGauge extends Component { + constructor(element: Element, options?: viz.gauges.LinearGaugeOptions); + constructor(element: JQuery, options?: viz.gauges.LinearGaugeOptions); + value(): number; + value(val: number): LinearGauge; + subvalues(): Array; + subvalues(values: Array): LinearGauge; + render(): LinearGauge; + instance(): LinearGauge; + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + svg(): string; + } + export class BarGauge extends Component { + constructor(element: Element, options?: viz.gauges.BarGaugeOptions); + constructor(element: JQuery, options?: viz.gauges.BarGaugeOptions); + values(): Array; + values(vals: Array): BarGauge; + render(): BarGauge; + instance(): BarGauge; + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + svg(): string; + } + export class Sparkline extends Component { + constructor(element: Element, options?: viz.sparklines.SparklineOptions); + constructor(element: JQuery, options?: viz.sparklines.SparklineOptions); + render(): Sparkline; + instance(): Sparkline; + svg(): string; + } + export class Bullet extends Component { + constructor(element: Element, options?: viz.sparklines.BulletOptions); + constructor(element: JQuery, options?: viz.sparklines.BulletOptions); + render(): Bullet; + instance(): Bullet; + svg(): string; + } + export class Map extends Component { + constructor(element: Element, options?: viz.map.VectorMapOptions); + constructor(element: JQuery, options?: viz.map.VectorMapOptions); + render(): Map; + instance(): Map; + getAreas(): Array; + getMarkers(): Array; + clearAreaSelection(): Map; + clearMarkerSelection(): Map; + clearSelection(): Map; + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + svg(): string; + center(): Array; + center(center: Array): Map; + zoomFactor(): number; + zoomFactor(zoomFactor: number): Map; + viewport(): Array; + viewport(viewport: Array): Map; + convertCoordinates(x: number, y: number): Array; + } +} +declare module DevExpress.viz.charts { +interface z_BaseLegendOptions { + backgroundColor?: string; + hoverMode?: string; + customizeText?: (arg: { + seriesName: string; + seriesNumber: number; + seriesColor: string; + }) => string; + verticalAlignment?: string; + horizontalAlignment?: string; + itemTextPosition?: string; + equalColumnWidth?: boolean; + font?: viz.common.FontOptions; + visible?: boolean; + margin?: any; + markerSize?: number; + border?: { + visible?: boolean; + width?: number; + color?: string; + cornerRadius?: number; + opacity?: number; + dashStyle?: string; + }; + paddingLeftRight?: number; + paddingTopBottom?: number; + columnsCount?: number; + rowsCount?: number; + columnItemSpacing?: number; + rowItemSpacing?: number; + orientation?: string; + } + interface z_BaseTooltipCustomizeArgument { + value?: any; + valueText: string; + originalValue: string; + argument: any; + argumentText: string; + originalArgument: any; + percent?: any; + percentText?: string; + seriesName: string; + } + interface z_BaseTooltipOptions extends common.BaseTooltipOptions { + customizeText?: (arg: z_BaseTooltipCustomizeArgument) => string; + customizeTooltip?: (arg: z_BaseTooltipCustomizeArgument) => common.CustomizeTooltipResult; + format?: string; + argumentFormat?: string; + precision?: number; + argumentPrecision?: number; + percentPrecision?: number; + } + interface z_ChartTooltipCustomizeArgument extends z_BaseTooltipCustomizeArgument{ + closeValueText?: string; + highValueText?: string; + lowValueText?: string; + openValueText?: string; + originalCloseValue?: any; + originalHighValue?: any; + originalLowValue?: any; + originalOpenValue?: any; + closeValue?: any; + highValue?: any; + lowValue?: any; + openValue?: any; + reductionValue?: any; + reductionValueText?: string; + originalMinValue?: any; + rangeValue1?: any; + rangeValue1Text?: string; + rangeValue2?: any; + rangeValue2Text?: string; + point: series.Point; + } + interface z_ChartTooltipOptions extends z_BaseTooltipOptions { + customizeText?: (arg: z_ChartTooltipCustomizeArgument) => string; + customizeTooltip?: (arg: z_ChartTooltipCustomizeArgument) => common.CustomizeTooltipResult; + shared?: boolean; + } + interface z_BaseChartOptions extends ComponentOptions { + incidentOccured?: () => void; + done?: () => void; + tooltipShown?: () => void; + tooltipHidden?: () => void; + pointSelectionMode?: string; + redrawOnResize?: boolean; + tooltip?: z_BaseTooltipOptions; + loadingIndicator?: common.LoadingIndicatorOptions; + margin?: { + left?: number; + top?: number; + right?: number; + bottom?: number; + }; + size?: { + width?: number; + height?: number; + }; + title?: { + horizontalAlignment?: string; + verticalAlignment?: string; + font?: viz.common.FontOptions; + text?: string; + placeholderSize?: number; + margin?: any; + }; + dataSource?: any; + palette?: any; legend?: z_BaseLegendOptions; + theme?: string; + animation?: { + enabled?: boolean; + duration?: number; + easing?: string; + maxPointCountSupported?: number; + asyncSeriesRendering?: boolean; + asyncTrackersRendering?: boolean; + trackerRenderingDelay?: number; + }; + pathModified?: boolean; + } + export interface CommonPaneSettings { + backgroundColor?: string; + border?: { + color?: string; + bottom?: boolean; + left?: boolean; + right?: boolean; + top?: boolean; + dashStyle?: string; + visible?: boolean; + width?: number; + opacity?: number; + }; + } + export interface PaneSettings extends CommonPaneSettings { + name: string; + } + export interface ChartLegendOptions extends z_BaseLegendOptions { + hoverMode?: string; + position?: string; + } + interface z_CommonAxisLabelSettings { + alignment?: string; + font?: viz.common.FontOptions; + indentFromAxis?: number; + overlappingBehavior?: { + mode?: string; + rotationAngle?: number; + staggeringSpacing?: number; + }; + rotationAngle?: number; + staggered?: boolean; + staggeringSpacing?: number; + } + interface z_BaseConstantLineLabel { + visible?: boolean; + position?: string; + font?: viz.common.FontOptions; + } + interface ConstantLineAxisLabel extends z_BaseConstantLineLabel { + horizontalAlignment?: string; + verticalAlignment?: string; + } + export interface ConstantLineLabel extends ConstantLineAxisLabel { + text?: string; + } + export interface CommonConstantLineStyle { + paddingLeftRight?: number; + paddingTopBottom?: number; + width?: number; + dashStyle?: string; + color?: string; + label?: z_BaseConstantLineLabel; + } + export interface ConstantLineOptions extends CommonConstantLineStyle{ + value?: any; + label?: ConstantLineLabel; + } + interface z_AxisConstantLineStyle extends CommonConstantLineStyle { + label?: ConstantLineAxisLabel; + } + interface z_StripStyle { + label?: { + font?: viz.common.FontOptions; + horizontalAlignment?: string; + verticalAlignment?: string; + }; + paddingLeftRight?: number; + paddingTopBottom?: number; + } + export interface CommonAxisSettings { + color?: string; + discreteAxisDivisionMode?: string; + grid?: { + color?: string; + opacity?: string; + visible?: boolean; + width?: number; + } + inverted?: boolean; + label?: z_CommonAxisLabelSettings; + maxValueMargin?: number; + minValueMargin?: number; + opacity?: number; + placeholderSize?: number; + setTicksAtUnitBeginning?: boolean; + stripStyle?: z_StripStyle + constantLineStyle?: CommonConstantLineStyle; + tick?: { + color?: string; + opacity?: number; + visible?: boolean; + }; + title?: { + font?: viz.common.FontOptions; + margin?: number; + text?: string; + }; + valueMarginsEnabled?: boolean; + visible?: boolean; + width?: number; + } + export interface StripOptions extends z_StripStyle{ + color?: string; + endValue: any; + startValue: any; + label?: { + font?: viz.common.FontOptions; + horizontalAlignment?: string; + verticalAlignment?: string; + text?: string; + }; + } + interface z_AxisLabelSettings extends z_CommonAxisLabelSettings{ + customizeText: (arg: { + value: any; + valueText: string; + }) => string; + } + export interface ArgumentAxisOptions extends CommonAxisSettings { + argumentType?: string; + axisDivisionFactor?: number; + categories?: Array; + hoverMode?: string; + label?: z_AxisLabelSettings; + max?: number; + min?: number; + tickInterval?: any; + position?: string; + constantLineStyle?: z_AxisConstantLineStyle; + strips?: Array; + constantLines?: Array; + type?: string; + } + export interface ValueAxisOptions extends CommonAxisSettings { + valueType?: string; + axisDivisionFactor?: number; + categories?: Array; + hoverMode?: string; + max?: number; + min?: number; + tickInterval?: any; position?: string; + strips?: Array; + constantLines?: Array; + constantLineStyle?: z_AxisConstantLineStyle; + type?: string; + name?: string; + label?: z_AxisLabelSettings; + } + interface z_CrosshairLine { + color?: string; + width?: number; + dashStyle?: string; + opacity?: number; + } + interface z_CrosshairOptions extends z_CrosshairLine { + enabled?: boolean; + verticalLine?: z_CrosshairLine; + horizontalLine?: z_CrosshairLine; + } + export interface ChartOptions extends z_BaseChartOptions { + needAggregate?: boolean; + defaultPane?: string; + adjustOnZoom?: boolean; + rotated?: boolean; + synchronizeMultiAxes?: boolean; + equalBarWidth?: { + spacing?: number; + width?: number; + }; + adaptiveLayout?: { + width?: number; + height?: number; + keepLabels?: boolean; + }; + customizePoint?: (arg: { + index: number; + argument: any; + seriesName: string; + tag: any; + value?: any; + rangeValue1?: any; + rangeValue2?: any; + }) => series.BasePointOptions; + customizeLabel?: (arg: { + index: number; + argument: any; + seriesName: string; + tag: any; + value?: any; + ramgeValue1?: any; + rangeValue2?: any; + }) => series.z_BaseLabelOptions; + commonPaneSettings?: CommonPaneSettings; + panes?: Array; + containerBackgroundColor?: string; + seriesTemplate?: { + nameField?: string; + customizeSeries?: (valueFromNameField: string) => viz.charts.series.SeriesOptions; + }; + crosshair?: z_CrosshairOptions; + seriesSelectionMode?: string; + tooltip?: z_ChartTooltipOptions; + dataPrepareSettings?: { + checkTypeForAllData?: boolean; + convertToAxisDataType?: boolean; + sortingMethod?: any; + }; + useAggregation?: boolean; + argumentAxisClick?: (axis: any, argument: any, event: JQueryMouseEventObject) => void; + legend?: ChartLegendOptions; + argumentAxis?: ArgumentAxisOptions; + valueAxis?: Array; + commonAxisSettings?: CommonAxisSettings; + series?: Array; + commonSeriesSettings?: viz.charts.series.commonSeriesSettings; + seriesClick?: (series: viz.charts.series.Series, event: JQueryMouseEventObject) => void; + seriesHover?: (series: viz.charts.series.Series) => void; + seriesSelected?: (series: viz.charts.series.Series) => void; + seriesHoverChanged?: (series: viz.charts.series.Series) => void; + pointClick?: (point: viz.charts.series.Point, event: JQueryMouseEventObject) => void; + legendClick?: (obj: any, event: JQueryMouseEventObject) => void; pointHover?: (point: viz.charts.series.Point) => void; + pointSelected?: (point: viz.charts.series.Point) => void; + seriesSelectionChanged?: (series: viz.charts.series.Series) => void; + pointSelectionChanged?: (point: viz.charts.series.Point) => void; + pointHoverChanged?: (point: viz.charts.series.Point) => void; + drawn?: (arg:viz.Chart) => void; + minBubbleSize?: number; + maxBubbleSize?: number; + } + export interface PieOptions extends z_BaseChartOptions { + pointClick?: (point: viz.charts.series.PiePoint, event: JQueryMouseEventObject) => void; + legendClick?: (point: viz.charts.series.PiePoint, event: JQueryMouseEventObject) => void; + pointHover?: (point: viz.charts.series.PiePoint) => void; + pointSelected?: (point: viz.charts.series.PiePoint) => void; + pointSelectionChanged?: (point: viz.charts.series.PiePoint) => void; + pointHoverChanged?: (point: viz.charts.series.PiePoint) => void; + series?: viz.charts.series.PieSeriesOptions; + drawn?: (arg:viz.PieChart) => void; + } + export interface RenderOptions { + force?: boolean; + animate?: boolean; + asyncSeriesRendering?: boolean; + } +} +declare module DevExpress.viz.charts.series { +export interface z_BasePointStyle { + color?: string; + border?: { + visible?: boolean; + width?: number; + color?: string; + }; + size?: number; + } + interface BasePointOptions extends z_BasePointStyle { + hoverMode?: string; + selectionMode?: string; + visible?: boolean; + symbol?: string; + image?: any; + hoverStyle?: z_BasePointStyle; + selectionStyle?: z_BasePointStyle; + } + interface z_BaseSeriesOptions { + argumentField?: string; + hoverMode?: string; + maxLabelCount?: number; + label?: z_BaseLabelOptions; + selectionMode?: string; + showInLegend?: boolean; + tagField?: string; + visible?: boolean; + } + interface z_BaseLabelOptions { + visible?: boolean; + alignment?: string; + rotationAngle?: number; + format?: string; + precision?: number; + argumentFormat?: string; + argumentPrecision?: number; + precission?: number; + percentPrecision?: number; + font?: viz.common.FontOptions; + backgroundColor?: string; + border?: { + visible?: boolean; + width?: number; + color?: string; + dashStyle?: string; + }; + connector?: { + visible?: boolean; + width?: number; + color?: string; + } + } + interface z_BaseChartSeriesLabelOptions extends z_BaseLabelOptions { + horizontalOffset?: number; + verticalOffset?: number; + customizeText?: (arg: { + originalValue: any; + value: any; + valueText: string; + originalArgument: any; + argument: any; + argumentText: string; + seriesName: string; + }) => string; + } + interface z_BaseSeriesStyle { + color?: string; + } + export interface ScatterSeriesOptions extends z_BaseSeriesOptions, z_BaseSeriesStyle { + selectionStyle?: z_BaseSeriesStyle; + hoverStyle?: z_BaseSeriesStyle; + valueField?: string; + point?: BasePointOptions; + axis?: string; + pane?: string; + } + export interface LineSeriesStyle extends z_BaseSeriesStyle { + dashStyle?: string; + width?: number; + } + export interface LineSeriesOptions extends LineSeriesStyle, z_BaseSeriesOptions { + selectionStyle?: LineSeriesStyle; + hoverStyle?: LineSeriesStyle; + valueField?: string; + point?: BasePointOptions; + pane?: string; + } + export interface AreaSeriesStyle extends z_BaseSeriesStyle { + hatching?: { + direction?: string; + width?: number; + step?: number; + opacity?: number + }; + border?: { + visible?: boolean; + width?: number; + color?: string; + dashStyle?: string; + }; + } + export interface AreaSeriesOptions extends AreaSeriesStyle, z_BaseSeriesOptions { + selectionStyle?: AreaSeriesStyle; + hoverStyle?: AreaSeriesStyle; + valueField?: string; + point?: BasePointOptions; + pane?: string; + axis?: string; + } + export interface BarSeriesLabel extends z_BaseChartSeriesLabelOptions { + position?: string; + showForZeroValues?: boolean; + } + export interface BarSeriesStyle extends AreaSeriesStyle { } + interface z_BaseBarSeriesOptions extends z_BaseSeriesOptions, BarSeriesStyle { + minBarSize?: number; + cornerRadius?: number; + label?: BarSeriesLabel; + selectionStyle?: BarSeriesStyle; + hoverStyle?: BarSeriesStyle; + pane?: string; + axis?: string; + } + export interface BarSeriesOptions extends z_BaseBarSeriesOptions { + valueField?: string; + } + export interface OHLCSeriesStyle extends z_BaseSeriesStyle{ + width?: number; + } + interface z_BaseOHLCSeries extends z_BaseSeriesOptions{ + openValueField?: string; + highValueField?: string; + lowValueField?: string; + closeValueField?: string; + reduction?: { + color?: string; + level?: string; + }; + pane?: string; + axis?: string; + } + export interface CandleStickSeriesOptions extends z_BaseOHLCSeries, OHLCSeriesStyle { + innerColor?: string; + selectionStyle?: OHLCSeriesStyle; + hoverStyle?: OHLCSeriesStyle; + } + export interface StockSeriesOptions extends z_BaseOHLCSeries, OHLCSeriesStyle { + selectionStyle?: OHLCSeriesStyle; + hoverStyle?: OHLCSeriesStyle; + } + export interface FullStackedAreaSeriesOptions extends z_BaseSeriesOptions, AreaSeriesOptions { + valueField?: string; + selectionStyle?: AreaSeriesStyle; + hoverStyle?: AreaSeriesStyle; + point?: BasePointOptions; + } + export interface FullStackedBarSeriesOptions extends BarSeriesOptions { + stack?: string; + } + export interface FullStackedLineSeriesOptions extends LineSeriesOptions{ + point?: BasePointOptions; + } + interface z_BaseRangeSeriesOptions extends z_BaseSeriesOptions { + rangeValue1Field?: string; + rangeValue2Field?: string; + pane?: string; + axis?: string; + } + export interface RangeAreaSeriesOptions extends z_BaseSeriesOptions, AreaSeriesStyle { + selectionStyle?: AreaSeriesStyle; + hoverStyle?: AreaSeriesStyle; + point?: BasePointOptions; + } + export interface RangeBarSeriesOptions extends z_BaseBarSeriesOptions { + rangeValue1Field?: string; + rangeValue2Field?: string; + pane?: string; + axis?: string; + } + export interface SplineSeriesOptions extends LineSeriesOptions {} + export interface SplineAreaSeries extends AreaSeriesOptions { } + export interface StackedLineSeries extends LineSeriesOptions { } + export interface StackedAreaSeries extends AreaSeriesOptions { } + export interface StackedBasrSeriesOptions extends BarSeriesOptions { + stack?: string; + } + export interface BubbleSeriesStyle extends AreaSeriesStyle { } + export interface BubbleSeriesOptions extends z_BaseBarSeriesOptions, BubbleSeriesStyle { + selectionStyle?: LineSeriesStyle; + hoverStyle?: LineSeriesStyle; + valueField?: string; + pane?: string; + sizeField?: string; + } + export interface StepLineSeries extends LineSeriesOptions { } + export interface StepAreaSeries extends AreaSeriesOptions { } + export interface PieSeriesStyle extends AreaSeriesStyle { } + interface PieSeriesLabelOptions extends z_BaseLabelOptions { + customizeText: (arg: { + value: any; + valueText: string; + originalValue: any; + argument: any; + argumentText: string; + originalArgument: any; + percent: any; + percentText: string; + seriesName: string; + }) => string; + radialOffset?: number; + } + export interface PieSeriesOptions extends z_BaseSeriesOptions, PieSeriesStyle{ + valueField?: string; + minSegmentSize?: string; + selectionStyle?: PieSeriesStyle; + hoverStyle?: PieSeriesStyle; + segmentsDirection?: string; + startAngle?: number; + type?: string; + label?: PieSeriesLabelOptions; + smallValuesGrouping?: valuesGrouping; + } + interface valuesGrouping{ + mode?: string; + topCount?: number; + threshold?: number; + groupName?: string; + } + interface AllSeriesStyleOptions extends z_BaseSeriesStyle, AreaSeriesStyle, LineSeriesStyle { } + interface z_AllLabelsOptions extends z_BaseChartSeriesLabelOptions, BarSeriesLabel { } + export interface CommonSeriesOptions extends z_BaseSeriesOptions, z_BaseBarSeriesOptions, z_BaseRangeSeriesOptions, z_BaseOHLCSeries, AllSeriesStyleOptions, BubbleSeriesOptions { + selectionStyle?: AllSeriesStyleOptions; + hoverStyle?: AllSeriesStyleOptions; + label?: z_AllLabelsOptions; + valueField?: string; + } + export interface SeriesOptions extends CommonSeriesOptions { + tag?: any; + name?: string; + type?: string; + } + export interface commonSeriesSettings extends CommonSeriesOptions { + area?: AreaSeriesOptions; + bar?: BarSeriesOptions; + candlestick?: CandleStickSeriesOptions; + fullstackedarea?: FullStackedAreaSeriesOptions; + fullstackedbar?: FullStackedBarSeriesOptions; + fullstackedline?: FullStackedLineSeriesOptions; + line?: LineSeriesOptions; + rangearea?: RangeAreaSeriesOptions; + rangebar?: RangeBarSeriesOptions; + scatter?: ScatterSeriesOptions; + spline?: SplineSeriesOptions; + splinearea?: SplineAreaSeries; + stackedarea?: StackedAreaSeries; + stackedbar?: StackedBasrSeriesOptions; + stackedline?: StackedLineSeries; + steparea?: StepAreaSeries; + stepline?: StepLineSeries; + stock?: StockSeriesOptions; + bubble?: BubbleSeriesOptions; + } + class z_BasePoint { + fullState: number; + originalArgument: any; + originalValue: any; + tag: any; + clearSelection(): void; + select(): void; + hideTootip(): void; + isSelected(): boolean; + isHovered(): boolean; + getColor(): string; + } + export class Point extends z_BasePoint{ + series: Series; + } + export class PiePoint extends z_BasePoint { + percent: any; + series: PieSeries; + isVisible():boolean; + hide(): void; + show(): void; + } + export class Series { + axis: string; + fullState: number; + name: string; + pane: string; + tag: any; + type: string; + clearSelection (): void; + deselectPoint (point:Point) : void; + getAllPoints () : Array + getPointByArg(pointArg: any): Point; + getPointByPos(positionIndex: number): Point; + select () : void; + selectPoint (point:Point) : void; + isSelected (): boolean; + isHovered(): boolean; + isVisible(): boolean; + show(): void; + hode(): void; + } + export class PieSeries { + fullState: number; + type: string; + clearSelection(): void; + deselectPoint(point:PiePoint): void; + getAllPoints(): Array + getPointByArg(pointArg: any): PiePoint; + getPointByPos(positionIndex: number): PiePoint; + select(): void; + selectPoint(point: PiePoint): void; + isSelected(): boolean; + isHovered(): boolean; + } +} +declare module DevExpress.viz.common { +export interface FontOptions { + color?: string; + family?: string; + opacity?: number; + size?: number; + weight?: number; + } + export interface tickIntervalObject { + years?: number; + quarters?: number; + months?: number; + days?: number; + hours?: number; + minutes?: number; + seconds?: number; + milliseconds?: number; + } + export interface LoadingIndicatorOptions { + backgroundColor?: string; + text?: string; + font?: FontOptions; + } + export interface CustomizeTooltipResult { + color?: string; + text?:string; + } + export interface BaseTooltipOptions { + enabled?: boolean; + color?: string; + border?: { + dashStyle?: string; + color?: string; + opacity?: number; + visible?: boolean; + width?: number; + }; + font?: FontOptions; + arrowLength?: number; + paddingLeftRight?: number; + paddingTopBottom?: number; + opacity?: number; + chadow?: { + color?: string; + opacity?: number; + offsetX?: number; + offsetY?: number; + blur?: number; + } + } +} +declare module DevExpress.viz.gauges { +interface CustomizeTextArgument { + value: number; + valueText: string; + color: string; + } + interface z_textOptions { + format?: string; + precision?: number; + customizeText?: (arg: CustomizeTextArgument) => string; + font?: viz.common.FontOptions; + } + interface z_textOptionsWithIndent extends z_textOptions { + indent?: number; + } + interface z_GaugeTooltipOptions extends common.BaseTooltipOptions { + format?: string; + precision?: number; + customizeText?: (arg: CustomizeTextArgument) => string; + customizeTooltip?: (arg: CustomizeTextArgument) => common.CustomizeTooltipResult; + } + interface z_BaseGaugeOptions { + size?: { + width?: number; + height?: number; + }; + margin?: { + left?: number; + right?: number; + top?: number; + bottom?: number; + }; + theme?: string; + loadingIndicator?: common.LoadingIndicatorOptions; + containerBackgroundColor?: string; + animation?: { + enabled?: boolean; + duration?: number; + easing?: string; + }; + redrawOnResize?: boolean; + title?: { + position?: string; + text?: string; + font?: viz.common.FontOptions; + }; + subtitle?: { + text?: string; + font?: viz.common.FontOptions; + }; + tooltip?: z_GaugeTooltipOptions; + value?: number; + subvalues?: Array; + pathModified?: boolean; + } + interface z_BaseRangeContainer { + offset?: number; + backgroundColor?: string; + ranges?: Array<{ + startValue?: number; + endValue?: number; + color?: string; + }> + } + interface z_BaseScale { + startValue?: number; + endValue?: number; + hideFirstTick?: boolean; + hideLastTick?: boolean; + hideFirstLabel?: boolean; + hideLastLabel?: boolean; + majorTick?: { + color?: string; + length?: number; + width?: number; + customTickValues?: Array; + useTicksAutoArrangement?: boolean; + tickInterval?: number; + showCalculatedTicks?: boolean; + visible?: boolean; + }; + minorTick?: { + color?: string; + length?: number; + width?: number; + customTickValues?: Array; + tickInterval?: number; + showCalculatedTicks?: boolean; + visible?: boolean; + }; + label?: z_textOptions; + } + interface z_BaseValueIndicator { + color?: string; + baseValue?: number; + size?: number; + backgroundColor?: string; + text?: z_textOptionsWithIndent; + } + interface z_BaseSubValueIndicator { + type?: string; + length?: number; + width?: number; + color?: string; + arrowLength?: number; + text?: z_textOptions; + palette?: Array + } + export interface CircularGaugeRangeContainer extends z_BaseRangeContainer { + width?: number; + orientation?: string; + } + export interface CircularGaugeScale extends z_BaseScale{ + orientation: string; + label: { + format?: string; + precision?: number; + customizeText?: (arg:CustomizeTextArgument) => string; + font?: viz.common.FontOptions; + indentFromTick?: number; + } + } + export interface CircularGaugeValueIndicator extends z_BaseValueIndicator { + type?: string; + offset?: number; + indentFromCenter?: number; + width?: number; + secondColor?: string; + secondFraction?: number; + spindleSize?: number; + spindleGapSize?: number; + } + export interface CircularGaugeSubValueIndicator extends z_BaseSubValueIndicator { + offset?: number; + } + export interface CircularGaugeOptions extends z_BaseGaugeOptions{ + rangeContainer?: CircularGaugeRangeContainer; + geometry?: { + startAngle?: number; + endAngle?: number; + }; + scale?: CircularGaugeScale; + valueIndicator?: CircularGaugeValueIndicator; + spindle?: { + visible?: boolean; + size?: number; + gapSize?: number; + color?: string; + }; + drawn?: (arg:viz.CircularGauge) => void; + } + export interface LinearGaugeScale extends z_BaseScale { + verticalOrientation?: string; + horizontalOrientation?: string; + label?: { + format?: string; + precision?: number; + customizeText?: (arg:CustomizeTextArgument) => string; + font?: viz.common.FontOptions; + indentFromTick?: number; + } + } + export interface LinearGaugeRangeContainer extends z_BaseRangeContainer { + width?: { + start?: number; + end?: number; + }; + verticalOrientation?: string; + horizontalOrientation?: string; + } + export interface LinearGaugeValueIndicator extends z_BaseValueIndicator { + offset?: number; + horizontalOrientation?: string; + verticalOrientation?: string; + length?: number; + width?: number; + } + export interface LinearGaugeSubValueIndicator extends z_BaseSubValueIndicator { + offset?: number; + horizontalOrientation?: string; + verticalOrientation?: string; + } + export interface LinearGaugeOptions extends z_BaseGaugeOptions { + geometry?: { + orientation?: string; + }; + scale?: LinearGaugeScale; + valueIndicator?: LinearGaugeValueIndicator; + drawn?: (arg:viz.LinearGauge) => void; + } + export interface BarGaugeOptions { + size?: { + width?: number; + height?: number; + }; + theme?: string; + loadingIndicator?: common.LoadingIndicatorOptions; + animationEnabled?: boolean; + animationDuration?: number; + animation?: { + enabled?: boolean; + duration?: number; + easing?: string; + }; + redrawOnResize?: boolean; + title?: { + position?: string; + text?: string; + font?: viz.common.FontOptions; + }; + subtitle?: { + text?: string; + font?: viz.common.FontOptions; + }; + tooltip?: z_GaugeTooltipOptions; + geometry?: { + startAngle?: number; + endAngle?: number; + }; + label?: { + visible?: boolean; + indent?: number; + connectorWidth?: number; + connectorColor?: string; + format?: string; + precision?: number; + customizeText?: (arg:CustomizeTextArgument) => string; + font?: viz.common.FontOptions; + }; + startValue?: number; + endValue?: number; + baseValue?: number; + values?: Array; + drawn?: (arg:viz.BarGauge) => void; + pathModified?: boolean; + } +} +declare module DevExpress.viz.map { +interface TooltipOptions extends common.BaseTooltipOptions { + customizeText?: (arg: Proxy) => string; + customizeTooltip?: (arg: Proxy) => common.CustomizeTooltipResult; + borderColor?: string; + } + export interface VectorMapOptions { + size?: { + width?: number; + height?: number; + }; + theme?: string; + background?: { + borderColor?: string; + color?: string; + }; + loadingIndicator?: common.LoadingIndicatorOptions; + mapData?: any; + areaSettings?: { + borderColor?: string; + color?: string; + hoveredBorderColor?: string; + hoveredColor?: string; + selectedBorderColor?: string; + selectedColor?: string; + hoverEnabled?: boolean; + selectionMode?: string; + palette?: any; + paletteSize?: number; + customize?: (arg: any) => AreaOptions; + click?: (arg: AreaProxy, event: JQueryMouseEventObject) => void; + selectionChanged?: (arg: AreaProxy) => void; + }; + markers?: any; + markerSettings?: { + size?: number; + minSize?: number; + maxSize?: number; + borderColor?: string; + color?: string; + hoveredBorderColor?: string; + hoveredColor?: string; + selectedBorderColor?: string; + selectedColor?: string; + font?: common.FontOptions; + hoverEnabled?: boolean; + selectionMode?: string; + customize?: (arg: any) => MarkerOptions; + click?: (arg: MarkerProxy, event: JQueryMouseEventObject) => void; + selectionChanged?: (arg: MarkerProxy) => void; + }; + controlBar?: { + enabled?: boolean; + borderColor?: string; + color?: string; + }; + tooltip?: TooltipOptions; + bounds?: Array; + center?: Array; + zoomFactor?: number; + click?: (event: JQueryMouseEventObject) => void; + centerChanged?: (arg: Array) => void; + zoomFactorChanged?: (arg: number) => void; + drawn?: (arg: viz.Map) => void; + pathModified?: boolean; + } + export interface AreaOptions { + borderColor?: string; + color?: string; + hoveredBorderColor?: string; + hoveredColor?: string; + selectedBorderColor?: string; + selectedColor?: string; + paletteIndex?: number; + isSelected?: boolean; + } + export interface MarkerOptions { + borderColor?: string; + color?: string; + hoveredBorderColor?: string; + hoveredColor?: string; + selectedBorderColor?: string; + selectedColor?: string; + isSelected?: boolean; + } + export interface Proxy { + type: string; + attribute(name: string): any; + selected(state: boolean): void; + selected(): boolean; + } + export interface AreaProxy extends Proxy { + } + export interface MarkerProxy extends Proxy { + coordinates(): Array; + } +} +declare module DevExpress.viz.rangeSelector { +export interface SelectedRange { + startValue: any; endValue: any; + } + interface CustomizeTextArgument { + value: any; + valueText: string; + } + export interface RangeSelectorOptions { + background?: { + color?: string; + image?: { + location?: string; + url?: string; + } + visible?: boolean; + }; + loadingIndicator?: common.LoadingIndicatorOptions; + behavior?: { + allowSlidersSwap?: boolean; + animationEnabled?: boolean; + callSelectedRangeChanged?: string; + manualRangeSelectionEnabled?: boolean; + moveSelectedRangeByClick?: boolean; + snapToTicks?: boolean; + }; + chart?: { + bottomIndent?: number; + equalBarWidth?: { + spacing?: number; + width?: number; + }; + dataPrepareSettings?: { + checkTypeForAllData?: boolean; + convertToAxisDataType?: boolean; + sortingMethod?: any; }; + useAggregation?: boolean; + series?: Array; + commonSeriesSettings?: viz.charts.series.commonSeriesSettings; + topIndent?: number; + valueAxis?: { + max?: any; min?: any; inverted?: boolean; + valueType?: string; + type?: string; + logarithmBase?: number; + }; + } + containerBackgroundColor?: string; + dataSource?: Array<{}>; + dataSourceField?: string; + margin?: { + left?: number; + top?: number; + right?: number; + bottom?: number; + }; + redrawOnResize?: boolean; + scale?: { + startValue?: any; endValue?: any; + label?: { + customizeText?: (arg: CustomizeTextArgument) => string; + font?: viz.common.FontOptions; + format?: string; + precision?: number; + topIndent?: number; + visible?: boolean; + }; + majorTickInterval?: any; marker?: { + label?: { + customizeText?: (arg: CustomizeTextArgument) => string; + format?: string; + }; + separatorHeight?: number; + textLeftIndent?: number; + textTopIndent?: number; + topIndent?: number; + visible?: boolean; + }; + maxRange?: any; minorTickCount?: number; + placeHolderHeight?: number; + setTicksAtUnitBeginning?: boolean; + showCustomBoundaryTicks?: boolean; + showMinorTicks?: boolean; + tick?: { + color?: string; + opacity?: number; + width?: number; + }; + minorTickInterval?: any; useTicksAutoArrangement?: boolean; + valueType?: string; + type?: string; + logarithmBase?: number; + } + selectedRange?: SelectedRange; + selectedRangeChaged?: (startValue: any, endValue: any) => void; + shutter?: { + color?: string; + opacity?: string; + } + size?: { + width?: number; + height?: number; + }; + sliderHandle?: { + color?: string; + opacity?: number; + width?: string; + }; + sliderMarker?: { + color?: string; + customizeText?: (arg: CustomizeTextArgument) => string; + font?: viz.common.FontOptions; + format?: string; + invalidRangeColor?: string; + padding?: number; + placeHolderSize?: { + height?: number; + width?: { + left?: number; + right?: number; + } + precission?: number; + visible?: boolean; + } + }; + theme?: string; + drawn?: (arg:viz.RangeSelector) => void; + pathModified?: boolean; + } +} +declare module DevExpress.viz.sparklines { +interface z_SparklineTooltipFormatObject { + firstValue?: string; + lastValue?: string; + maxValue?: string; + minValue?: string; + originalFirstValue?: any; + originalLastValue?: any; + originalMaxValue?: any; + originalMinValue?: any; + } + interface SparklineTooltipOptions extends common.BaseTooltipOptions { + customizeText?: (arg: z_SparklineTooltipFormatObject) => string; + customizeTooltip?: (arg: z_SparklineTooltipFormatObject) => common.CustomizeTooltipResult; + allowContainerResizing?: boolean; + horizontalAlignment?: string; + verticalAlignment?: string; + format?: string; + precision?: number; + } + interface z_BaseSparklineSettings { + theme?: string; + size?: { + width?: number; + height?: number; + }; + tooltip?: SparklineTooltipOptions; + pathModified?: boolean; + } + interface SparklineOptions extends z_BaseSparklineSettings { + dataSource?: Array; + argumentField?: string; + valueField?: string; + type?: string; + lineColor?: string; + lineWidth?: number; + showFirstLast?: boolean; + showMinMax?: boolean; + minColor?: string; + maxColor?: string; + firstLastColor?: string; + barPositiveColor?: string; + barNegativeColor?: string; + winColor?: string; + lossColor?: string; + pointSymbol?: string; + pointSize?: number; + pointColor?: string; + winlossThreshold?: number; + drawn?: (arg:viz.Sparkline) => void; + ignoreEmptyPoints?: boolean; + } + interface z_BulletTooltipFormatObject { + originalValue?: any; + originalTarget?: any; + value?: string; + target?: string; + } + interface BulletTooltipOptions extends SparklineTooltipOptions { + customizeText?: (arg: z_BulletTooltipFormatObject) => string; + customizeTooltip?: (arg: z_BulletTooltipFormatObject) => common.CustomizeTooltipResult; + } + interface BulletOptions extends z_BaseSparklineSettings{ + value?: number; + target?: number; + endScaleValue?: number; + color?: string; + targetColor?: string; + targetWidth?: number; + targetVisible?: boolean; + tooltip?: BulletTooltipOptions; + drawn?: (arg:viz.Bullet) => void; + } +} +interface JQuery { +dxChart(options?: DevExpress.viz.charts.ChartOptions): JQuery; + dxChart(method: string, param1?:any, param2?:any): any; + dxPieChart(options?: DevExpress.viz.charts.PieOptions): JQuery; + dxPieChart(method: string, param1?: any, param2?: any): any; + dxRangeSelector(options?: DevExpress.viz.rangeSelector.RangeSelectorOptions): JQuery; + dxRangeSelector(method: string, param1?: any, param2?: any): any; + dxCircularGauge(options?: DevExpress.viz.gauges.CircularGaugeOptions): JQuery; + dxCircularGauge(method: string, param1?: any, param2?: any): any; + dxLinearGauge(options?: DevExpress.viz.gauges.LinearGaugeOptions): JQuery; + dxLinearGauge(method: string, param1?: any, param2?: any): any; + dxBarGauge(options?: DevExpress.viz.gauges.BarGaugeOptions): JQuery; + dxBarGauge(method: string, param1?: any, param2?: any): any; + dxSparkline(options?: DevExpress.viz.sparklines.SparklineOptions): JQuery; + dxSparkline(method: string, param1?: any, param2?: any): any; + dxBullet(options?: DevExpress.viz.sparklines.BulletOptions): JQuery; + dxBullet(method: string, param1?: any, param2?: any): any; + dxVectorMap(options?: DevExpress.viz.map.VectorMapOptions): JQuery; + dxVectorMap(method: string, param1?: any, param2?: any): any; +} \ No newline at end of file diff --git a/devextreme/dx.phonejs-tests.ts b/devextreme/dx.phonejs-tests.ts new file mode 100644 index 000000000..478e1ce2f --- /dev/null +++ b/devextreme/dx.phonejs-tests.ts @@ -0,0 +1,258 @@ +/// + +module Test { + var url = "http://some-json-service.net/data.json"; + var dsFromUrl = new DevExpress.data.DataSource(url); + + var dsFromObject = new DevExpress.data.DataSource({ + load: function (loadOptions?: DevExpress.data.LoadOptions) { + return $.ajax(url); + } + }); + + var application:DevExpress.framework.html.HtmlApplication = new DevExpress.framework.html.HtmlApplication({ + namespace: "global", + defaultLayout: "slideout", + navigation: [ + { id: "first", title: "Home", action: "#home" }, + { id: "second", title: "About", action: "#about" } + ] + }); + application.router.register(":view/:id", { view: "home", id: undefined }); + application.navigate(); + + $("div").appendTo(document.body).dxMap({ + location: [40.749825, -73.987963], + zoom: 13, + provider: "googleStatic", + controls: true, + routes: [ + { + weight: 4, + opacity: 0.75, + color: "red", + mode: "walking", + locations: [ + [40.737102, -73.990318], + [40.749825, -73.987963], + [40.75, -73.98], + [40.755823, -73.986397] + ] + } + ] + }); + $("div").appendTo(document.body).dxTabs({ + itemClickAction: function (e: any) { + console.log(e.itemData.text); + }, + items: [ + { text: "user" }, + { text: "analytics" }, + { text: "customers" }, + { text: "search" }, + { text: "favorites" } + ] + }); + + $("div").appendTo(document.body).dxList({ + scrollByContent: true, + items: ["item1", "item2", "item3"], + itemHoldAction: function (e: any) { console.log("itemHold"); }, + itemClickAction: function (e: any) { console.log("itemClick"); }, + itemSwipeAction: function (e: any) { console.log("itemSwipe " + e.direction); } + }); + $("div").appendTo(document.body).dxToast({ + type: 'error', + message: 'Sample error message' + }); + $("div").appendTo(document.body).dxPopup({ + closeButton: true, + title: "Popup title" + }); + $("div").appendTo(document.body).dxPivot({ + items: [ + { title: "all", text: "all" }, + { title: "unread", text: "unread" }, + { title: "favorites", text: "favorites" } + ], + itemSelectAction: function (e: Object) { console.log("itemSelectAction"); } + }); + $("div").appendTo(document.body).dxLookup({ + items: [ + { id: 1, caption: "red" }, + { id: 3, caption: "blue" }, + { id: 6, caption: "white" }, + { id: 2, caption: "green" }, + { id: 4, caption: "yellow" }, + { id: 5, caption: "orange" }, + { id: 7, caption: "purple" } + ], + valueExpr: 'id', + displayExpr: 'caption', + itemRender: function (item: any) { + return "Text is: " + item.caption; + } + }); + $("div").appendTo(document.body).dxSlider({ + min: 50, + value: 75, + max: 100, + disabled: false + }); + $("div").appendTo(document.body).dxNavBar({ + items: [ + { text: "user", icon: "user" }, + { text: "find", icon: "find", disabled: false }, + { text: "favorites", icon: "favorites" }, + { text: "about", icon: "info" }, + { text: "home", icon: "home" }, + { text: "URI", icon: "tips" } + ], + itemClickAction: function (e: any) { console.log(e.itemData.text); } + }); + $("div").appendTo(document.body).dxSwitch({ + value: false, + onText: 'LongName', + offText: 'Short', + width: "100%", + visible: true + }); + $("div").appendTo(document.body).dxButton({ + text: "Click me", + icon: 'add', + clickAction: function () { console.log("clicked"); } + }); + $("div").appendTo(document.body).dxOverlay({ + visible: false, + closeOnOutsideClick: true, + contentReadyAction: function () { + $("#hideButton").dxButton({ + text: "Hide", + clickAction: function () { $("#overlay").data("dxOverlay").option("visible", false); } + }); + } + }); + $("div").appendTo(document.body).dxDateBox({ + value: new Date(), + format: "datetime" + }); + $("div").appendTo(document.body).dxPopover({ + width: '300', + height: 'auto', + visible: true, + target: '.dx-button' + }); + $("div").appendTo(document.body).dxTextBox({ + value: "Text", + placeholder: "Placeholder", + mode: "email", + maxLength: 20, + readOnly: false, + changeAction: function (e:Object) { console.log("value changed"); }, + valueUpdateAction: function (e:Object) { console.log("value updated"); } + }); + $("div").appendTo(document.body).dxToolbar({ + items: [ + { align: 'left', widget: 'button', options: { type: 'back', text: 'Back', clickAction: function (e:Object) { console.log("back clicked"); } } }, + { align: 'center', widget: 'button', options: { text: 'button', clickAction: function (e:Object) { console.log("button clicked"); } } }, + { align: 'center', widget: 'button', options: { icon: 'plus', text: 'add', clickAction: function (e:Object) { console.log("plus clicked"); } } }, + { align: 'right', widget: 'button', options: { icon: 'find', clickAction: function (e:Object) { console.log("find clicked"); } }, useMenu: false }, + { text: 'Products', isMenu: true } + ] + }); + $("div").appendTo(document.body).dxTileView({ + items: [ + { text: "item1", widthRatio: 1.7, heightRatio: 1.7 }, + { text: "item2", widthRatio: 0.2, heightRatio: 0.2 }, + { text: "item3", widthRatio: 2, heightRatio: 2 } + ], + listHeight: 500, + itemRender: function (item: any) { return "Text is: " + item.text; }, + itemClickAction: function () { console.log("itemClick"); }, + baseItemWidth: 100, + baseItemHeight: 100, + itemMargin: 20 + }); + $("div").appendTo(document.body).dxPanorama({ + title: "my panorama", + items: [ + { header: "first", text: "first item" }, + { text: "second item" }, + { text: "third" }, + { text: "fourth" } + ], + selectedIndex: 0, + backgroundImage: { width: 89, height: 50 }, + itemSelectAction: function () { console.log("item selected"); } + }); + $("div").appendTo(document.body).dxCheckBox({ + checked: false, + disabled: false, + clickAction: function (e:Object) { console.log("clicked"); } + }); + $("div").appendTo(document.body).dxTextArea({ + value: 'Disabled', + disabled: true, + placeholder: "Placeholder" + }); + $("div").appendTo(document.body).dxLoadPanel({ + message: 'Please wait ...', + showIndicator: true, + visible: true + }); + $("div").appendTo(document.body).dxNumberBox({ + value: 100, + min: 0, + max: 200 + }); + $("div").appendTo(document.body).dxSelectBox({ + value: 2, + dataSource: new DevExpress.data.DataSource([1, 2, 2, 3]) + }); + $("div").appendTo(document.body).dxScrollable({ + useNative: false, + startAction: function (e:Object) { console.log("start"); }, + endAction: function (e:Object) { console.log("end"); } + }); + $("div").appendTo(document.body).dxRadioGroup({ + items: [{ text: "0" }, { text: "1" }, { text: "2" }], + name: "Sample", + selectedIndex: -1 + }); + $("div").appendTo(document.body).dxScrollView({ + pullDownAction: function (e:Object) { console.log("pulling down"); }, + reachBottomAction: function (e:Object) { console.log("bottom reached"); }, + disabled: false + }); + $("div").appendTo(document.body).dxActionSheet({ + title: 'Select action', + items: [ + { text: "Reply", clickAction: function () { console.log("Reply"); } }, + { text: "Forward", clickAction: function () { console.log("Forward"); } }, + { text: "Delete", clickAction: function () { console.log("Delete"); }, type: "danger" }, + { text: "Save Image", clickAction: function () { console.log("Save Image"); }, disabled: true } + ], + showTitle: true, + disabled: false, + target: '#button' + }); + $("div").appendTo(document.body).dxRangeSlider({ + start: 30, + end: 70, + min: 0, + max: 100, + step: 1 + }); + $("div").appendTo(document.body).dxAutocomplete({ + value: "Ivan", + dataSource: new DevExpress.data.DataSource(["Ivan", "Svyatoslav", "Alexander", "Nikolay", "Dmitry", "Afanasiy", "John", "Nash", "Stacy", "Izabella", "Margarita", "Anna"]), + placeholder: "Type name, please", + maxItemsCount: 3, + minSearchLength: 2, + searchTimeout: 1000 + }); + $("div").appendTo(document.body).dxDropDownMenu({ + items: ["Item 1", "Item 2", "Item 3"], + itemTemplate: 'itemWithIcon' + }); +} \ No newline at end of file diff --git a/devextreme/dx.phonejs.d.ts b/devextreme/dx.phonejs.d.ts new file mode 100644 index 000000000..dd97faebb --- /dev/null +++ b/devextreme/dx.phonejs.d.ts @@ -0,0 +1,1502 @@ +// Type definitions for PhoneJS +// Project: http://js.devexpress.com/MobileDevelopment/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module DevExpress { +export function abstract(): void; + export var rtlEnabled: boolean; + export var hardwareBackButton: JQueryCallback; + interface Endpoint { + local?: string; + production: string; + } + class EndpointSelector { + constructor(config: { [key: string]: Endpoint }); + urlFor(key: string): string; + } + export interface ActionOptions { + context?: Object; + component?: any; + beforeExecute? (e:ActionExecuteArgs): void; + afterExecute? (e:ActionExecuteArgs): void; + } + export interface ActionExecuteArgs { + action: any; + args: any[]; + context: any; + component: any; + cancel: boolean; + handled: boolean; + } + export class Action { + constructor(action?: any, config?: ActionOptions); + execute(): any; + } + export interface IDevice { + deviceType?: string; + platform?: string; + version?: Array; + phone?: boolean; + tablet?: boolean; + android?: boolean; + ios?: boolean; + win8?: boolean; + tizen?: boolean; + generic?: boolean; + } + export module devices { + export function orientation(): string; + export var orientationChanged: JQueryCallback; + export function real(): IDevice; + export function current(deviceOrName: string): IDevice; + export function current(deviceOrName: IDevice): IDevice; + } + export function registerComponent(name: string, componentClass: any): void; + export interface ComponentOptions { + disabled?: boolean; + } + export class Component { + constructor(element: Element, options?: ComponentOptions); + constructor(element: JQuery, options?: ComponentOptions); + disposing: JQueryCallback; + optionChanged: JQueryCallback; + instance(): Component; + beginUpdate(): void; + endUpdate(): void; + option(): any; + option(options: string): any; + option(options: string): T; + option(options: string, value: any): void; + option(options: { [key: string]: any }): void; + option(options?: any): any; + } + export interface DOMComponentOptions extends ComponentOptions { + rtlEnabled?: boolean; + } + export class DOMComponent extends Component { + constructor(element: HTMLElement, options?: DOMComponentOptions); + static defaultOptions(rule: { + device: any; + options: { [key: string]: any }; + }): void; + } +} +declare module DevExpress.data { +export interface DataError extends Error { + httpStatus?: number; + errorDetails?: any; + } + export interface ErrorHandler { (e: DataError): void; } + export interface EntityOptions { key: any; keyType: any; } + export interface Getter { (obj: any, options?: any): any; } + export interface Setter { (obj: any, value: any, options?: any): void; } + export interface QueryOptions { + errorHandler?: ErrorHandler; + requireTotalCount?: boolean; + } + export interface ODataQueryOptions extends QueryOptions { + adapter?: any; + } + interface IQuery { + enumerate(): JQueryPromise>; + count(): JQueryPromise; + slice(skip: number, take?: number): IQuery; + sortBy(field: string): IQuery; + sortBy(field: Getter): IQuery; + sortBy(field: { field: string; desc?: boolean }): IQuery; + sortBy(field: { field: Getter; desc?: boolean }): IQuery; + thenBy(field: string): IQuery; + thenBy(field: Getter): IQuery; + thenBy(field: { field: string; desc?: boolean }): IQuery; + thenBy(field: { field: Getter; desc?: boolean }): IQuery; + filter(field: string, operator: string, value: any): IQuery; + filter(field: string, value: any): IQuery; + filter(criteria: any[]): IQuery; + select(field: string): IQuery; + select(field: string[]): IQuery; + select(...field: string[]): IQuery; + select(field: Getter): IQuery; + select(field: Getter[]): IQuery; + select(...field: Getter[]): IQuery; + groupBy(field: string[]): IQuery; + groupBy(field: Getter[]): IQuery; + groupBy(field: { field: string; desc?: boolean }[]): IQuery; + groupBy(field: { field: Getter; desc?: boolean }[]): IQuery; + sum(getter?: string): JQueryPromise; + min(getter?: string): JQueryPromise; + max(getter?: string): JQueryPromise; + avg(getter?: string): JQueryPromise; + aggregate(step: number): JQueryPromise; + aggregate(seed: number, step: (accumulator: any, current: any) => any, finalize?: (accumulator: any) => any): JQueryPromise; + } + export interface ArrayQuery extends IQuery { + toArray(): Array; + } + export interface RemoteQuery extends IQuery { /*todo: exec() ? */ } + export function base64_encode(input: string): string; + export function base64_encode(input: any[]): string; + export function query(items?: any[]): IQuery; + export var queryImpl: { + remote: (url: string, queryOptions: QueryOptions) => RemoteQuery; + array: (iter: Array, queryOptions: QueryOptions) => ArrayQuery; + }; + export class Guid { + constructor(value?: string); + constructor(value?: any); + toString(): string; + valueOf(): string; + toJSON(): string; + } + export class EdmLiteral { + constructor(value: any); + valueOf(): any; + } + export module utils { + export function normalizeSortingInfo(info: string): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: string[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: Getter): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: Getter[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { field: string; dir?: string }): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { field: string; dir?: string }[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { field: string; desc?: boolean }): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { field: string; desc?: boolean }[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { selector: string; dir?: string }): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { selector: string; dir?: string }[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { selector: string; desc?: boolean }): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { selector: string; desc?: boolean }[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeBinaryCriterion(criteria: Array): Array; + export function keysEqual(key1: any, key2: any): boolean; + export function keysEqual(keyExpr: any, key1: any, key2: any): boolean; + export function toComparable(value: Date, caseSensitive?: boolean): number; + export function toComparable(value: Guid, caseSensitive?: boolean): string; + export function toComparable(value: string, caseSensitive?: boolean): string; + export function compileGetter(): Getter; + export function compileGetter(expr: any[]): Getter; + export function compileGetter(expr: string): Getter; + export function compileGetter(expr: "this"): Getter; + export function compileGetter(expr: Getter): Getter; + export function compileSetter(expr: string): Setter; + export module odata { + export function sendRequest(request: JQueryXHR, requestOptions?: JQueryAjaxSettings): any; + export function serializePropName(propName: EdmLiteral): string; + export function serializePropName(propName: string): string; + export function serializeValue(value: Date): string; + export function serializeValue(value: Guid): string; + export function serializeValue(value: string): string; + export function serializeValue(value: "string"): string; + export function serializeValue(value: EdmLiteral): string; + export function serializeKey(key: any): string; + export function serializeKey(key: Date): string; + export function serializeKey(key: Guid): string; + export function serializeKey(key: string): string; + export function serializeKey(key: "string"): string; + export function serializeKey(key: EdmLiteral): string; + export var keyConverters: { + String(value: any): string; + Guid(value: any): Guid; + Int32(value: any): number; + Int64(value: any): EdmLiteral; + }; + } + } + export module queryAdapters { + export function odata(queryOptions: ODataQueryOptions): RemoteQuery; + } +export interface DataSourceOptions { + map? (item: any): any; + postProcess? (result: any[]): any; + pageSize: number; + paginate: boolean; + } + export class DataSource { + public changed: JQueryCallback; + public loadError: JQueryCallback; + public loadingChanged: JQueryCallback; + constructor(options?: Store); + constructor(options?: string); + constructor(options?: Array); + constructor(options?: { store: Store }); + constructor(options?: CustomStoreOptions); + constructor(options?: { store: Array }); + constructor(options?: { store: { type: string } }); + constructor(options?: { load(options?: LoadOptions): JQueryXHR; }); + constructor(options?: { load(options?: LoadOptions): Array; }); + constructor(options?: { load(options?: LoadOptions): JQueryPromise; }); + constructor(options?: DataSourceOptions); + loadOptions(): { [key: string]: any }; + items(): Array; + store(): data.Store; + isLastPage(): boolean; + pageIndex(newIndex?: number): number; + sort(expr: any[]): any[]; + group(expr: any[]): any[]; + filter(expr: any[]): any[]; + select(expr: string[]): string[]; + searchValue(value?: string): string; + searchOperation(op?: string): string; + searchExpr(selector: string): string; + key(): any; + isLoaded(): boolean; + isLoading(): boolean; + totalCount(): number; + load(): JQueryPromise; + dispose(): void; + } +export interface StoreOptions { + key?: any; + errorHandler?: ErrorHandler; + loaded?: (result: Array) => void; + loading?: (loadOptions: LoadOptions) => void; + modified?: () => void; + modifying?: () => void; + inserted?: (values: Object, key: any) => void; + inserting?: (values: Object) => void; + updated?: (key: any, values: Object) => void; + updating?: (key: any, values: Object) => void; + removed?: (key: any) => void; + removing?: (key: any) => void; + } + export interface LoadOptions extends QueryOptions { + skip?: number; + take?: number; + sort?: any; + select?: any; + filter?: any; + group?: any; + expand?: any; + } + export class Store { + loaded: JQueryCallback; + loading: JQueryCallback; + modified: JQueryCallback; + modifying: JQueryCallback; + inserted: JQueryCallback; + inserting: JQueryCallback; + updated: JQueryCallback; + updating: JQueryCallback; + removed: JQueryCallback; + removing: JQueryCallback; + constructor(options?: StoreOptions); + key(): any; + keyOf(obj: any): any; + load(options?: LoadOptions): JQueryPromise; + createQuery(options?: QueryOptions): IQuery; + totalCount(options?: { + filter?: any[]; + group?: string[]; + }): JQueryPromise; + byKey(key: any, extraOptions?: { + expand?: string[] + }): JQueryPromise; + remove(key: any): JQueryPromise; + insert(values: any): JQueryPromise; + update(key: any, values: any): JQueryPromise; + } + export interface CustomStoreOptions extends StoreOptions { + load? (options?: LoadOptions): any; + byKey? (key: any): any; + insert? (values: any): any; + update? (key: any, values: any): any; + remove? (key: any): any; + totalCount? (options?: { + filter?: any[]; + group?: string[]; + }): any; + } + export class CustomStore extends Store { + constructor(options?: CustomStoreOptions); + } + export interface ArrayStoreOptions extends StoreOptions { + data?: Array + } + export class ArrayStore extends Store { + constructor(options?: Array); + constructor(options?: ArrayStoreOptions); + } + export interface LocalStoreOptions extends ArrayStoreOptions { + name: string; + } + export class LocalStore extends ArrayStore { + constructor(options?: string); + constructor(options?: LocalStoreOptions); + clear(): void; + } + export interface ODataStoreOptions extends StoreOptions { + url?: string; + name?: string; + keyType?: string; + jsonp?: boolean; + withCredentials?: boolean; + } + export class ODataStore extends Store { + constructor(options?: ODataStoreOptions); + } + export interface ODataContextOptions { + url: string; + jsonp?: boolean; + withCredentials?: boolean; + errorHandler?: ErrorHandler; + beforeSend?: () => any; + entities?: { + [entityAlias: string]: ODataStoreOptions; + }; + } + export class ODataContext { + constructor(options?: ODataContextOptions); + get(operationName: string, params: { [key: string]: any }): JQueryPromise>; + invoke(operationName: string, params: { [key: string]: any }, httpMethod?: string): JQueryPromise>; + objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; }; + } +} +declare module DevExpress.framework { +export interface dxViewOptions { + name: string; + title?: string; + layout?: string; + } + export class dxView extends Component { + constructor(options?: dxViewOptions); + } + export interface dxLayoutOptions { + name: string; + controller: string; + } + export class dxLayout extends Component { + constructor(options?: dxLayoutOptions); + } + export interface dxViewPlaceholderOptions { + viewName: string; + } + export class dxViewPlaceholder extends Component { + constructor(options?: dxLayoutOptions); + } + export interface dxTransitionOptions { + name: string; + type: string; + } + export class dxTransition extends Component { + constructor(options?: dxLayoutOptions); + } + export interface dxContentPlaceholderOptions { + name: string; + transition: string; + } + export class dxContentPlaceholder extends Component { + constructor(options?: dxLayoutOptions); + } + export interface dxContentOptions { + targetPlaceholder: string; + } + export class dxContent extends Component { + constructor(options?: dxLayoutOptions); + } + export interface dxCommandOptions extends ComponentOptions { + id: string; + action?: any; + icon?: string; + title?: string; + iconSrc?: string; + visible?: boolean; + } + export class dxCommand extends Component { + public beforeExecute: JQueryCallback; + public afterExecute: JQueryCallback; + constructor(element: JQuery, options?: dxCommandOptions); + constructor(element: Element, options?: dxCommandOptions); + execute(): void; + } + export class dxCommandContainer extends Component { + constructor(options: ComponentOptions); + constructor(element: JQuery, options?: ComponentOptions); + constructor(element: Element, options?: ComponentOptions); + } + export interface CommandMap { + [containerId: string]: { commands: any[]; defaults?: any; } + } + export class CommandMapping { + constructor(); + static defaultMapping: CommandMap; + mapCommands(containerId: string, commandMappings: any[]): CommandMapping; + unmapCommands(containerId: string, commandIds: string[]): void; + getCommandMappingForContainer(commandId: string, containerId: string): any; + load(config: CommandMap): CommandMapping; + } + interface IViewCache { + viewRemoved: JQueryCallback; + setView(key: string, viewInfo: any): void; + removeView(key: string): any; + hasView(viewInfo: any): boolean; + getView(key: string): any; + clear(): void; + } + export class ViewCache implements IViewCache { + viewRemoved: JQueryCallback; + constructor(); + setView(key: string, viewInfo: any): void; + removeView(key: string): any; + hasView(viewInfo: any): boolean; + getView(key: string): any; + clear(): void; + } + export class NullViewCache implements IViewCache { + viewRemoved: JQueryCallback; + constructor(); + setView(key: string, viewInfo: any): void; + removeView(key: string): any; + hasView(viewInfo: any): boolean; + getView(key: string): any; + clear(): void; + } + export class CapacityViewCacheDecorator implements IViewCache { + viewRemoved: JQueryCallback; + constructor(options: { + size: number; + viewCache: IViewCache; + }); + setView(key: string, viewInfo: any): void; + removeView(key: string): any; + hasView(viewInfo: any): boolean; + getView(key: string): any; + clear(): void; + } + export class ConditionalViewCacheDecorator implements IViewCache { + viewRemoved: JQueryCallback; + constructor(options: { + filter: (key: string, viewInfo: any) => boolean; + viewCache: IViewCache; + }); + setView(key: string, viewInfo: any): void; + removeView(key: string): any; + hasView(viewInfo: any): boolean; + getView(key: string): any; + clear(): void; + } + export class HistoryDependentViewCacheDecorator implements IViewCache { + viewRemoved: JQueryCallback; + constructor(options: { + navigationManager: StackBasedNavigationManager; + viewCache: IViewCache; + }); + setView(key: string, viewInfo: any): void; + removeView(key: string): any; + hasView(viewInfo: any): boolean; + getView(key: string): any; + clear(): void; + } + export interface IStorage { + getItem(key: string): any; + setItem(key: string, value: any): void; + removeItem(key: string): void; + } + export class MemoryKeyValueStorage implements IStorage { + constructor(); + getItem(key: string): any; + setItem(key: string, value: any): void; + removeItem(key: string): void; + } + export interface StateManagerOptions { + storage?: IStorage; + stateSources?: any[]; + } + export class StateManager { + public storage: IStorage; + public stateSources: any[]; + constructor(options?: StateManagerOptions); + addStateSource(stateSource: any): void; + removeStateSource(stateSource: any): void; + saveState(): void; + restoreState(): void; + clearState(): void; + } + export class Route { + constructor(pattern: string, defaults?: any, constraints?: any); + parse(url: string): any; + format(routeValues: any): string; + formatSegment(value: any): string; + parseSegment(): any; + } + export class MvcRouter { + constructor(); + register(pattern: string, defaults?: any, constraints?: any): void; + parse(uri: string): any; + format(obj: any): string; + } + interface BrowserAdapterOptions { + window: Window; + } + export class DefaultBrowserAdapter { + constructor(options?: BrowserAdapterOptions); + replaceState(uri: string): void; + pushState(uri: string): void; + createRootPage(): void; + getWindowName(): string; + setWindowName(windowName: string): void; + back(): void; + getHash(): string; + isRootPage(): boolean; + } + export class OldBrowserAdapter extends DefaultBrowserAdapter { } + export class HistorylessBrowserAdapter extends DefaultBrowserAdapter { } + export interface INavigationDevice { + init: Function; + setUri(uri: string): void; + getUri(): string; + back(): void; + } + export class StackBasedNavigationDevice extends HistoryBasedNavigationDevice implements INavigationDevice { + uriChanged: JQueryCallback; + constructor(options?: BrowserAdapterOptions); + } + export class HistoryBasedNavigationDevice implements INavigationDevice { + backInitiated: JQueryCallback; + init: Function; + setUri(uri: string): void; + getUri(): string; + back(): void; + } + export class NavigationStack { + public items: any[]; + public currentIndex: number; + public itemsRemoved: JQueryCallback; + constructor(); + currentItem(): any; + back(uri: string): void; + forward(): void; + navigate(uri: any, replaceCurrent?: boolean): any; + getPreviousItem(): any; + canBack(): boolean; + clear(): void; + } + export interface NavigationManagerOptions { + stateStorageKey?: string; + navigationDevice?: INavigationDevice; + keepPositionInStack?: boolean; + } + export interface INavigationManager { + navigating: JQueryCallback; + navigated: JQueryCallback; + navigatingBack: JQueryCallback; + navigationCanceled: JQueryCallback; + itemRemoved: JQueryCallback; + navigate(uri: any, options?: { + root?: boolean; + target?: string; + direction?: string; + }): void; + back(): void; + back(alternate: any): void; + canBack(): boolean; + rootUri(): string; + currentItem(): any; + previousItem(): any; + saveState(): void; + removeState(): void; + restoreState(): void; + } + export class StackBasedNavigationManager extends HistoryBasedNavigationManager { + init(): JQueryPromise; + public currentStack: NavigationStack; + public navigationStacks: { + [key: string]: NavigationStack + }; + public navigating: JQueryCallback; + public navigated: JQueryCallback; + public navigatingBack: JQueryCallback; + public navigationCanceled: JQueryCallback; + public itemRemoved: JQueryCallback; + constructor(options?: NavigationManagerOptions); + navigate(uri: any, options?: { + root?: boolean; + target?: string; + direction?: string; + }): void; + currentIndex(): number; + getItemByIndex(index: number): any; + clearHistory(): void; + } + export class HistoryBasedNavigationManager implements INavigationManager { + navigating: JQueryCallback; + navigated: JQueryCallback; + navigatingBack: JQueryCallback; + navigationCanceled: JQueryCallback; + itemRemoved: JQueryCallback; + constructor(options?: NavigationManagerOptions); + navigate(uri: any, options?: { + root?: boolean; + target?: string; + direction?: string; + }): void; + back(): void; + back(alternate: any): void; + canBack(): boolean; + rootUri(): string; + currentItem(): any; + previousItem(): any; + saveState(): void; + removeState(): void; + restoreState(): void; + } + export module utils { + export function mergeCommands(destination: any, source: any): dxCommand[]; + } + export interface ApplicationOptions { + router?: MvcRouter; + ns?: Object; + namespace?: Object; + viewCache?: IViewCache; + viewCacheSize?: number; + disableViewCache?: boolean; + useViewTitleAsBackText?: boolean; + stateManager?: StateManager; + navigationManager?: StackBasedNavigationManager; + navigation?: dxCommandOptions[]; + commandMapping?: CommandMap; + } + export class Application { + public router: MvcRouter; + public namespace: any; + public components: any[]; + public viewCache: IViewCache; + public stateManager: StateManager; + public commandMapping: CommandMap; + public navigation: dxCommand[]; + public navigationManager: StackBasedNavigationManager; + public beforeViewSetup: JQueryCallback; + public afterViewSetup: JQueryCallback; + public viewShowing: JQueryCallback; + public viewShown: JQueryCallback; + public viewHidden: JQueryCallback; + public viewDisposing: JQueryCallback; + public viewDisposed: JQueryCallback; + public navigating: JQueryCallback; + public navigatingBack: JQueryCallback; + constructor(options?: ApplicationOptions); + init(): any; + navigate(uri?: any, options?: { + root?: boolean; + target?: string; + direction?: string; + }): void; + back(): void; + canBack(): boolean; + saveState(): void; + clearState(): void; + restoreState(): void; + } + export function createActionExecutors(app: Application): { + [key: string]: { execute(e: any): void; } + }; +} +declare module DevExpress.framework.html { +export interface ILayoutController { + viewReleased: JQueryCallback; + init(options: InitLayoutControllerOptions): void; + activate(): void; + deactivate(): void; + showView(viewInfo: any, direction?: string): JQueryPromise; + } + export interface ILayoutControllerRegistration extends IDevice { + name: string; + controller: ILayoutController; + root?: boolean; + } + export var layoutControllers: Array; + export var layoutSets: Object; + export interface InitLayoutControllerOptions { + $viewPort?: JQuery; + $hiddenBag?: JQuery; + navigationManager?: framework.StackBasedNavigationManager; + } + export class DefaultLayoutController implements ILayoutController { + public viewReleased: JQueryCallback; + constructor(options?: { layoutTemplateName: string }); + init(options: InitLayoutControllerOptions): void; + activate(): void; + deactivate(): void; + showView(viewInfo: any, direction?: string): JQueryPromise; + } + export interface CommandManagerOptions { + globalCommands?: framework.dxCommand[]; + commandMapping?: framework.CommandMapping; + } + export class CommandManager { + public globalCommands: framework.dxCommand[]; + public commandMapping: framework.CommandMapping; + constructor(options?: CommandManagerOptions); + layoutCommands($markup: JQuery, extraCommands?: any): void; } + export interface ITemplateEngine { + applyTemplate(template: string, model: any): void; + applyTemplate(template: Element, model: any): void; + applyTemplate(template: JQuery, model: any): void; + } + export class KnockoutJSTemplateEngine implements ITemplateEngine { + constructor(); + applyTemplate(template: string, model: any): void; + applyTemplate(template: Element, model: any): void; + applyTemplate(template: JQuery, model: any): void; + } + export interface TransitionExecutorOptions { + type?: string; + source?: JQuery; + destination?: JQuery; + } + export class TransitionExecutor { + public container: JQuery; + constructor(container: JQuery, options: TransitionExecutorOptions); + finalize(): void; + exec(): JQueryPromise; + static create(container: JQuery, options: TransitionExecutorOptions): TransitionExecutor; + } + export interface ViewEngineOptions { + $root?: JQuery; + device?: IDevice; + commandManager?: CommandManager; + templateEngine?: ITemplateEngine; + dataOptionsAttributeName?: string; + } + export class ViewEngineBase { + public $root: JQuery; + public device: IDevice; + public commandManager: CommandManager; + public templateEngine: ITemplateEngine; + public dataOptionsAttributeName: string; + public viewSelecting: JQueryCallback; + public modelFromViewDataExtended: JQueryCallback; + constructor(options?: ViewEngineOptions); + init(): JQueryPromise; + findViewTemplate(viewName: string): JQuery; + afterViewSetup(viewInfo: any): void; + } + export class ViewEngine extends ViewEngineBase { + public layoutSelecting: JQueryCallback; + constructor(options?: ViewEngineOptions); + init(): JQueryPromise; + findLayoutTemplate(layoutName: string): JQuery; + } + export interface HtmlApplicationOptions extends framework.ApplicationOptions { + commandManager?: CommandManager; + templateEngine?: ITemplateEngine; + navigateToRootViewMode?: string; + layoutControllers?: Array + device?: IDevice; + layoutSet?: Array; + } + export class HtmlApplication extends framework.Application { + public viewEngine: ViewEngineBase; + public viewRendered: JQueryCallback; + public resolveLayoutController: JQueryCallback; + constructor(options?: HtmlApplicationOptions); + init(): any; + viewPort(): JQuery; + } +} +declare module DevExpress.ui { + interface ViewportOptions { + allowPan?: boolean; + allowZoom?: boolean; + } + export interface ITemplate { + compile(html: string): any; + render(template: JQuery, data: any): any; + render(template: any, data: any): any; + } + class Template { + constructor(element: HTMLElement); + constructor(element: JQueryStatic); + render(container: HTMLElement): any; + render(container: JQueryStatic): any; + dispose(): void; + } + interface TemplateStatic { + new (element: HTMLElement): Template; + new (element: JQueryStatic): Template; + } + class TemplateProvider { + constructor(); + getTemplateClass(widget: any): TemplateStatic; + getDefaultTemplate(widget: any): void; supportDefaultTemplate(): boolean; + } + export function initViewport(options: ViewportOptions): void; + interface NotifyOptions { + message: string; + type?: string; + displayTime?: number; + hiddenAction: () => any; + } + export function notyfy(options: any): void; + export function notify(message: string, type?: string, displayTime?: number): void; + export module dialog { + interface Dialog { + show(): JQueryPromise; + hide(value?: any): void; + } + interface DialogButton { + text: string; + icon: string; + clickAction: () => any; + } + interface DialogOptions { + message: string; + title?: string; + } + export function custom(options: DialogOptions): Dialog; + export function custom(message: string, title?: string): Dialog; + export function alert(options: DialogOptions): JQueryPromise; + export function alert(message: string, title?: string): JQueryPromise; + export function confirm(options: DialogOptions): JQueryPromise; + export function confirm(message: string, title?: string): JQueryPromise; + } +export interface CollectionContainerWidgetOptions extends WidgetOptions { + items?: Array; + itemTemplate?: any; + itemRender?: Function; + itemClickAction?: any; + itemRenderedAction?: any; + noDataText?: string; + dataSource?: data.DataSource; + selectedIndex?: number; + itemSelectAction?: any; + itemHoldAction?: any; + itemHoldTimeout?: number; + } + export class CollectionContainerWidget extends Widget { + constructor(element: Element, options?: CollectionContainerWidgetOptions); + constructor(element: JQuery, options?: CollectionContainerWidgetOptions); + } +export interface WidgetOptions extends ComponentOptions { + contentReadyAction?: any; + width?: any; + height?: any; + visible?: boolean; + activeStateEnabled?: boolean; + } + export class Widget extends Component { + constructor(element: Element, options?: WidgetOptions); + constructor(element: JQuery, options?: WidgetOptions); + init(): void; + repaint(): void; + addTemplate(template: ITemplate): void; + } +export interface dxEditorOptions extends WidgetOptions { + value?: any; + valueChangeAction?: any; + } + export class dxEditor extends Widget { + constructor(element: Element, options?: dxEditorOptions); + constructor(element: JQuery, options?: dxEditorOptions); + } +export interface dxAutocompleteOptions extends dxDropDownEditorOptions { + minSearchLength?: number; + searchTimeout?: number; + placeholder?: string; + filterOperator?: string; + displayExpr?: string; + searchMode?: string; + dataSource?: data.DataSource; + items?: Array; + itemRender?: Function; + itemTemplate?: any; + } + export class dxAutocomplete extends dxDropDownEditor { + constructor(element: Element, options?: dxAutocompleteOptions); + constructor(element: JQuery, options?: dxAutocompleteOptions); + } +export interface dxButtonOptions extends WidgetOptions { + type?: string; + text?: string; + icon?: string; + iconSrc?: string; + } + export class dxButton extends Widget { + constructor(element: Element, options?: dxButtonOptions); + constructor(element: JQuery, options?: dxButtonOptions); + } +export interface dxCheckBoxOptions extends dxEditorOptions { } + export class dxCheckBox extends dxEditor { + constructor(element: Element, options?: dxCheckBoxOptions); + constructor(element: JQuery, options?: dxCheckBoxOptions); + } +export interface dxCalendarOptions extends dxEditorOptions { + value?: Date; + min?: Date; + max?: Date; + firstDayOfWeek?: number; + } + export class dxCalendar extends dxEditor { + constructor(element: Element, options?: dxEditorOptions); + constructor(element: JQuery, options?: dxEditorOptions); + } +export interface dxDateBoxOptions extends dxTextEditorOptions { + format?: string; + useNativePicker?: boolean; + value?: Date; + type?: string; + min?: Date; + max?: Date; + useCalendar?: boolean; + formatString?: string; + closeOnValueChange?: boolean; + calendarOptions?: Object; + } + export class dxDateBox extends dxTextEditor { + constructor(element: Element, options?: dxDateBoxOptions); + constructor(element: JQuery, options?: dxDateBoxOptions); + } +export interface dxTextEditorOptions extends dxEditorOptions { + valueChangeEvent?: string; + placeholder?: string; + readOnly?: boolean; + focusInAction?: any; + focusOutAction?: any; + keyDownAction?: any; + keyPressAction?: any; + keyUpAction?: any; + changeAction?: any; + enterKeyAction?: any; + copyAction?: any; + pasteAction?: any; + cutAction?: any; + inputAction?: any; + showClearButton?: boolean; + mode?: string; + } + export class dxTextEditor extends dxEditor { + constructor(element: Element, options?: dxTextEditorOptions); + constructor(element: JQuery, options?: dxTextEditorOptions); + focus(): void; + blur(): void; + } +export interface dxListOptions extends CollectionContainerWidgetOptions { + pullRefreshEnabled?: boolean; + autoPagingEnabled?: boolean; + scrollingEnabled?: boolean; + showScrollbar?: boolean; + useNativeScrolling?: boolean; + grouped?: boolean; + editEnabled?: boolean; + showNextButton?: boolean; + groupTemplate?: string; + pullingDownText?: string; + pulledDownText?: string; + refreshingText?: string; + pageLoadingText?: string; + scrollAction?: any; + pullRefreshAction?: any; + pageLoadingAction?: any; + itemHoldAction?: any; + itemSwipeAction?: any; + itemHoldTimeout?: number; + groupRender? (groupData: any, groupIndex: number, groupElement: Element): any; + editConfig?: { + itemTemplate?: any; + itemRenderer? (itemData: any, itemIndex: number, itemElement: Element): any; + menuType?: string; + menuItems?: any[]; + deleteEnabled?: boolean; + deleteMode?: string; + selectionEnabled?: boolean; + selectionMode?: string; + selectionType?: string; + reorderEnabled?: boolean; + } + itemDeleteAction?: any; + selectedItems?: any[]; + itemSelectAction?: any; + itemUnselectAction?: any; + itemReorderAction?: any; + nextButtonText?: string; + selectionMode?: string; + } + export class dxList extends CollectionContainerWidget { + constructor(element: Element, options?: dxListOptions); + constructor(element: JQuery, options?: dxListOptions); + update(): JQueryPromise; + updateDimensions(): JQueryPromise; + refresh(): JQueryPromise; + reload(): JQueryPromise; + deleteItem(itemElement: JQuery): JQueryPromise; + deleteItem(itemElement: Element): JQueryPromise; + clearSelectedItems() : void; + isItemSelected(itemElement: JQuery): boolean; + isItemSelected(itemElement: Element): boolean; + selectItem(itemElement: JQuery): void; + selectItem(itemElement: Element): void; + unselectItem(itemElement: JQuery): void; + unselectItem(itemElement: Element): void; + reorderItem(itemElement: JQuery, toItemElement: JQuery): JQueryPromise; + reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; + getSelectedItems(): number[]; + clientHeight(): number; + scrollHeight(): number; + scrollBy(distance: number): void; + scrollTo(targetLocation: number): void; + scrollTop(): number; + } +export interface dxLoadPanelOptions extends dxOverlayOptions { + message?: string; + width?: number; + height?: number; + delay?: number; + showPane?: boolean; + showIndicator?: boolean; + indicatorSrc?: string; + } + export class dxLoadPanel extends dxOverlay { + constructor(element: Element, options?: dxLoadPanelOptions); + constructor(element: JQuery, options?: dxLoadPanelOptions); + hide(): void; + show(): void; + toggle(showing: boolean): void; + } +export interface dxLookupOptions extends dxEditorOptions { + dataSource?: data.DataSource; + displayValue?: string; + title?: string; + titleTemplate?: any; + valueExpr?: string; + displayExpr?: string; + placeholder?: string; + searchPlaceholder?: string; + searchEnabled?: boolean; + searchTimeout?: number; + minFilterLength?: number; + fullScreen?: boolean; + itemTemplate?: any; + itemRender?: Function; + showCancelButton?: boolean; + showClearButton?: boolean; + showDoneButton?: boolean; + showNextButton?: boolean; + doneButtonText?: string; + cancelButtonText?: string; + clearButtonText?: string; + nextButtonText?: string; + grouped?: boolean; + groupRender?: Function; + groupTemplate?: string; + pullingDownText?: string; + pulledDownText?: string; + refreshingText?: string; + pageLoadingText?: string; + noDataText?: string; + scrollAction?: any; + shading?: boolean; + closeOnOutsideClick?: boolean; + position?: any; + animation?: any; + shownAction?: any; + hiddenAction?: any; + popupWidth?: any; + popupHeight?: any; + autoPagingEnabled?: boolean; + useNativeScrolling?: boolean; + usePopover?: boolean; + openAction?: any; + closeAction?: any; + } + export class dxLookup extends dxEditor { + constructor(element: Element, options?: dxLookupOptions); + constructor(element: JQuery, options?: dxLookupOptions); + close(): void; + open(): void; + } +export interface dxMapOptions extends WidgetOptions { + location?: any; + width?: number; + height?: number; + zoom?: number; + mapType?: string; + provider?: string; + markers?: Array; + routes?: Array; + key?: string; + controls?: any; + mapReadyAction?: any; + autoAdjust?: boolean; + center?: any; + markerAddedAction?: any; + markerRemovedAction?: any; + markerIconSrc?: string; + routeAddedAction?: any; + routeRemovedAction?: any; + type?: string; + } + export class dxMap extends Widget { + constructor(element: Element, options?: dxMapOptions); + constructor(element: JQuery, options?: dxMapOptions); + addMarker(markerOptions: any, callback: Function): JQueryPromise; + removeMarker(marker: any): void; + addRoute(routeOptions: any, callback: Function): JQueryPromise; + removeRoute(route: any): void; + } +export interface dxNavBarOptions extends dxTabsOptions { } + export class dxNavBar extends dxTabs { + constructor(element: Element, options?: dxNavBarOptions); + constructor(element: JQuery, options?: dxNavBarOptions); + } +export interface dxNumberBoxOptions extends dxTextEditorOptions { + min?: number; + max?: number; + value?: number; + step?: number; + showSpinButtons?: boolean; + } + export class dxNumberBox extends dxTextEditor { + constructor(element: Element, options?: dxNumberBoxOptions); + constructor(element: JQuery, options?: dxNumberBoxOptions); + } +export interface dxOverlayOptions extends WidgetOptions { + activeStateEnabled?: boolean; + shading?: boolean; + closeOnOutsideClick?: boolean; + position?: any; + animation?: any; + showingAction?: any; + shownAction?: any; + hidingAction?: any; + hiddenAction?: any; + deferRendering?: boolean; + targetContainer?: any; + contentTemplate?: any; + } + export class dxOverlay extends Widget { + constructor(element: Element, options?: dxOverlayOptions); + constructor(element: JQuery, options?: dxOverlayOptions); + content(): JQuery; + hide(): void; + show(): void; + toggle(showing: boolean): void; + } +export interface dxPopupOptions extends dxOverlayOptions { + title?: string; + showTitle?: boolean; + fullScreen?: boolean; + cancelButton?: any; + doneButton?: any; + clearButton?: any; + titleTemplate?: any; + dragEnabled?: boolean; + } + export class dxPopup extends dxOverlay { + constructor(element: Element, options?: dxPopupOptions); + constructor(element: JQuery, options?: dxPopupOptions); + } +export interface dxPopoverOptions extends dxPopupOptions { + target?: any; + } + export class dxPopover extends dxPopup { + constructor(element: Element, options?: dxPopoverOptions); + constructor(element: JQuery, options?: dxPopoverOptions); + } +export interface dxTooltipOptions extends dxPopoverOptions { + target?: any; + } + export class dxTooltip extends dxPopover { + constructor(element: Element, options?: dxTooltipOptions); + constructor(element: JQuery, options?: dxTooltipOptions); + } +export interface dxRadioGroupOptions extends CollectionContainerWidgetOptions { + layout?: string; + name?: string; + value?: Object; + valueExpr?: string; + } + export class dxRadioGroup extends CollectionContainerWidget { + constructor(element: Element, options?: dxRadioGroupOptions); + constructor(element: JQuery, options?: dxRadioGroupOptions); + } +export interface dxRangeSliderOptions extends dxSliderOptions { + start?: number; + end?: number; + } + export class dxRangeSlider extends dxSlider { + constructor(element: Element, options?: dxRangeSliderOptions); + constructor(element: JQuery, options?: dxRangeSliderOptions); + } +export interface dxScrollableOptions extends ComponentOptions { + startAction?: any; + scrollAction?: any; + endAction?: any; + stopAction?: any; + inertiaAction?: any; + bounceAction?: any; + updateAction?: any; + bounceEnabled?: boolean; + direction?: string; + showScrollbar?: boolean; + useNative?: boolean; + } + export class dxScrollable extends Component { + constructor(element: Element, options?: dxScrollableOptions); + constructor(element: JQuery, options?: dxScrollableOptions); + update(): void; + content(): JQuery; + clientHeight(): number; + scrollHeight(): number; + clientWidth(): number; + scrollWidth(): number; + scrollLeft(): number; + scrollTop(): number; + scrollOffset(): Object; + scrollBy(distance: number): void; + scrollBy(distance: Object): void; + scrollTo(targetLocation: number): void; + scrollTo(targetLocation: Object): void; + } +export interface dxScrollViewOptions extends dxScrollableOptions { + pullingDownText?: string; + pulledDownText?: string; + refreshingText?: string; + reachBottomText?: string; + pullDownAction?: any; + reachBottomAction?: any; + } + export class dxScrollView extends dxScrollable { + constructor(element: Element, options?: dxScrollViewOptions); + constructor(element: JQuery, options?: dxScrollViewOptions); + release(preventReachBottom: boolean): JQueryPromise; + toggleLoading(showOrHide: boolean): void; + refresh(): void; + } +export interface dxSelectBoxOptions extends dxAutocompleteOptions { + fieldTemplate?: any; + displayValue?: string; + multiSelectEnabled?: boolean; + values?: any[]; + openAction?: any; + closeAction?: any; + } + export class dxSelectBox extends dxAutocomplete { + constructor(element: Element, options?: dxSelectBoxOptions); + constructor(element: JQuery, options?: dxSelectBoxOptions); + } +export interface dxSliderOptions extends dxEditorOptions { + min?: number; + max?: number; + step?: number; + showRange?: boolean; + label?: { + visible: boolean; + format?: any; + position?: string; + } + tooltip?: { + enabled?: boolean; + format?: any; + position?: string; + showMode?: string; + } + } + export class dxSlider extends dxEditor { + constructor(element: Element, options?: dxSliderOptions); + constructor(element: JQuery, options?: dxSliderOptions); + } +export interface dxTabsOptions extends CollectionContainerWidgetOptions { } + export class dxTabs extends CollectionContainerWidget { + constructor(element: Element, options?: dxTabsOptions); + constructor(element: JQuery, options?: dxTabsOptions); + } +export interface dxTextAreaOptions extends dxTextEditorOptions { + cols?: number; + rows?: number; + } + export class dxTextArea extends dxTextEditor { + constructor(element: Element, options?: dxTextAreaOptions); + constructor(element: JQuery, options?: dxTextAreaOptions); + } +export interface dxTextBoxOptions extends dxTextEditorOptions { + maxLength?: any; + } + export class dxTextBox extends dxTextEditor { + constructor(element: Element, options?: dxTextBoxOptions); + constructor(element: JQuery, options?: dxTextBoxOptions); + } +export interface dxToastOptions extends dxOverlayOptions { + message?: string; + type?: string; + displayTime?: number; + } + export class dxToast extends dxOverlay { + constructor(element: Element, options?: dxToastOptions); + constructor(element: JQuery, options?: dxToastOptions); + } +export interface dxToolbarOptions extends CollectionContainerWidgetOptions { + menuItemRender?: Function; + menuItemTemplate?: any; + submenuType?: string; + renderAs?: string; + } + export class dxToolbar extends CollectionContainerWidget { + constructor(element: Element, options?: dxToolbarOptions); + constructor(element: JQuery, options?: dxToolbarOptions); + } +export interface dxDropDownEditorOptions extends dxTextBoxOptions { + closeAction?: any; + openAction?: any; + } + export class dxDropDownEditor extends dxTextBox { + constructor(element: Element, options?: dxDropDownEditorOptions); + constructor(element: JQuery, options?: dxDropDownEditorOptions); + } +export interface dxLoadIndicatorOptions extends WidgetOptions { + indicatorSrc?: string; + } + export class dxLoadIndicator extends Widget { + constructor(element: Element, options?: dxLoadIndicatorOptions); + constructor(element: JQuery, options?: dxLoadIndicatorOptions); + } +export interface dxMultiViewOptions extends CollectionContainerWidgetOptions { + loop?: boolean; + swipeEnabled?: boolean; + animationEnabled?: boolean; + selectedIndex?: number; + } + export class dxMultiView extends CollectionContainerWidget { + constructor(element: Element, options?: dxMultiViewOptions); + constructor(element: JQuery, options?: dxMultiViewOptions); + } +export interface dxGalleryOptions extends CollectionContainerWidgetOptions { + activeStateEnabled?: boolean; + animationDuration?: number; + loop?: boolean; + swipeEnabled?: boolean; + indicatorEnabled?: boolean; + showIndicator?: boolean; + selectedIndex?: number; + slideshowDelay?: number; + showNavButtons?: boolean; + } + export class dxGallery extends CollectionContainerWidget { + constructor(element: Element, options?: dxGalleryOptions); + constructor(element: JQuery, options?: dxGalleryOptions); + goToItem(itemIndex?: number, animation?: boolean): JQueryPromise; + prevItem(animation?: boolean): JQueryPromise; + nextItem(animation?: boolean): JQueryPromise; + } +export interface dxActionSheetOptions extends CollectionContainerWidgetOptions { + usePopover?: boolean; + target?: any; + title?: string; + showTitle?: boolean; + cancelText?: string; + noDataText?: string; + cancelClickAction?: any; + showCancelButton?: boolean; + } + export class dxActionSheet extends CollectionContainerWidget { + constructor(element: Element, options?: dxActionSheetOptions); + constructor(element: JQuery, options?: dxActionSheetOptions); + toggle(): void; + show(): void; + hide(): void; + } +export interface dxDropDownMenuOptions extends WidgetOptions { + items?: Array; + itemClickAction?: any; + dataSource?: data.DataSource; + itemTemplate?: any; + itemRender?: Function; + buttonText?: string; + buttonIcon?: string; + buttonIconSrc?: string; + buttonClickAction?: any; + usePopover?: boolean; + } + export class dxDropDownMenu extends Widget { + constructor(element: Element, options?: dxDropDownMenuOptions); + constructor(element: JQuery, options?: dxDropDownMenuOptions); + } +export interface dxPanoramaOptions extends CollectionContainerWidgetOptions { + title?: string; + backgroundImage?: any; + } + export class dxPanorama extends CollectionContainerWidget { + constructor(element: Element, options?: dxPanoramaOptions); + constructor(element: JQuery, options?: dxPanoramaOptions); + } +export interface dxPivotOptions extends CollectionContainerWidgetOptions { } + export class dxPivot extends CollectionContainerWidget { + constructor(element: Element, options?: dxPivotOptions); + constructor(element: JQuery, options?: dxPivotOptions); + } +export interface dxSwitchOptions extends dxEditorOptions { + onText?: string; + offText?: string; + } + export class dxSwitch extends dxEditor { + constructor(element: Element, options?: dxSwitchOptions); + constructor(element: JQuery, options?: dxSwitchOptions); + } +export interface dxTileViewOptions extends CollectionContainerWidgetOptions { + bounceEnabled?: boolean; + showScrollbar?: boolean; + listHeight?: number; + baseItemWidth?: number; + baseItemHeight?: number; + itemMargin?: number; + } + export class dxTileView extends CollectionContainerWidget { + constructor(element: Element, options?: dxTileViewOptions); + constructor(element: JQuery, options?: dxTileViewOptions); + } +export interface dxSlideOutOptions extends CollectionContainerWidgetOptions { + activeStateEnabled?: boolean; + menuItemRender? (itemData: any, itemIndex: number, itemElement: Element): any; + menuItemTemplate?: any; + swipeEnabled?: boolean; + menuVisible?: boolean; + menuGrouped?: boolean; + menuGroupRender? (groupData: any, groupIndex: number, groupElement: Element): any; + menuGroupTemplate?: any; + } + export class dxSlideOut extends CollectionContainerWidget { + constructor(element: Element, options?: dxSlideOutOptions); + constructor(element: JQuery, options?: dxSlideOutOptions); + showMenu(): JQueryPromise; + hideMenu(): JQueryPromise; + toggleMenuVisibility(showing?: boolean): JQueryPromise; + } +} +interface JQuery { +dxAutocomplete(options?: DevExpress.ui.dxAutocompleteOptions): JQuery; +dxButton(options?: DevExpress.ui.dxButtonOptions): JQuery; +dxCheckBox(options?: DevExpress.ui.dxCheckBoxOptions): JQuery; +dxCalendar(options?: DevExpress.ui.dxCalendarOptions): JQuery; +dxDateBox(options?: DevExpress.ui.dxDateBoxOptions): JQuery; +dxTextEditor(options?: DevExpress.ui.dxTextEditorOptions): JQuery; +dxList(options?: DevExpress.ui.dxListOptions): JQuery; +dxLoadPanel(options?: DevExpress.ui.dxLoadPanelOptions): JQuery; +dxLookup(options?: DevExpress.ui.dxLookupOptions): JQuery; +dxMap(options?: DevExpress.ui.dxMapOptions): JQuery; +dxNavBar(options?: DevExpress.ui.dxNavBarOptions): JQuery; +dxNumberBox(options?: DevExpress.ui.dxNumberBoxOptions): JQuery; +dxOverlay(options?: DevExpress.ui.dxOverlayOptions): JQuery; +dxPopup(options?: DevExpress.ui.dxPopupOptions): JQuery; +dxPopover(options?: DevExpress.ui.dxPopoverOptions): JQuery; +dxTooltip(options?: DevExpress.ui.dxTooltipOptions): JQuery; +dxRadioGroup(options?: DevExpress.ui.dxRadioGroupOptions): JQuery; +dxRangeSlider(options?: DevExpress.ui.dxRangeSliderOptions): JQuery; +dxScrollable(options?: DevExpress.ui.dxScrollableOptions): JQuery; +dxScrollView(options?: DevExpress.ui.dxScrollViewOptions): JQuery; +dxSelectBox(options?: DevExpress.ui.dxSelectBoxOptions): JQuery; +dxSlider(options?: DevExpress.ui.dxSliderOptions): JQuery; +dxTabs(options?: DevExpress.ui.dxTabsOptions): JQuery; +dxTextArea(options?: DevExpress.ui.dxTextAreaOptions): JQuery; +dxTextBox(options?: DevExpress.ui.dxTextBoxOptions): JQuery; +dxToast(options?: DevExpress.ui.dxToastOptions): JQuery; +dxToolbar(options?: DevExpress.ui.dxToolbarOptions): JQuery; +dxDropDownEditor(options?: DevExpress.ui.dxDropDownEditorOptions): JQuery; +dxLoadIndicator(options?: DevExpress.ui.dxLoadIndicatorOptions): JQuery; +dxMultiView(options?: DevExpress.ui.dxMultiViewOptions): JQuery; +dxGallery(options?: DevExpress.ui.dxGalleryOptions): JQuery; +dxActionSheet(options?: DevExpress.ui.dxActionSheetOptions): JQuery; +dxDropDownMenu(options?: DevExpress.ui.dxDropDownMenuOptions): JQuery; +dxPanorama(options?: DevExpress.ui.dxPanoramaOptions): JQuery; +dxPivot(options?: DevExpress.ui.dxPivotOptions): JQuery; +dxSwitch(options?: DevExpress.ui.dxSwitchOptions): JQuery; +dxTileView(options?: DevExpress.ui.dxTileViewOptions): JQuery; +dxSlideOut(options?: DevExpress.ui.dxSlideOutOptions): JQuery; +} \ No newline at end of file diff --git a/devextreme/dx.webappjs-tests.ts b/devextreme/dx.webappjs-tests.ts new file mode 100644 index 000000000..14b249e35 --- /dev/null +++ b/devextreme/dx.webappjs-tests.ts @@ -0,0 +1,93 @@ +/// + +module Test { + $('
').appendTo(document.body) + .dxDataGrid({ + allowColumnResizing: true, + allowColumnReordering: true, + cellClick: (clickedCell: Object) => { }, + rowClick: (clickedRow: Object) => { }, + columnChooser: { + enabled: true, + height: 180, + width: 400, + emptyPanelText: 'A place to hide the columns' + }, + columnAutoWidth: true, + columns: [ + 'author', 'title', 'year', 'genre', 'format', + { dataField: 'price', visible: false }, + { dataField: 'length', visible: false } + ], + dataSource: new DevExpress.data.DataSource({ + store: { + type: 'array', + data: [ + { id: 1, title: "The Catcher in the Rye", author: "J. D. Salinger", year: 1951, genre: "Bildungsroman", format: "paperback" }, + { id: 2, title: "The Hitchhiker's Guide to the Galaxy", author: "D. Adams", year: 1979, genre: "Comedy, sci-fi", format: "hardcover" }, + { id: 3, title: "Fahrenheit 451", author: "R. Bradbury", year: 1953, genre: "Dystopian novel", format: "paperback" }, + { id: 4, title: "Nineteen Eighty-Four", author: "G. Orwell", year: 1949, genre: "Dystopian novel, political fiction", format: "hardcover" }, + { id: 5, title: "Crime and Punishment", author: "F. Dostoyevsky", year: 1866, genre: "Philosophical novel", format: "paperback" } + ], + key: "id" + } + }), + customizeColumns: (columns: Array) => { }, + dataErrorOccurred: (error: Error) => { }, + disabled: false, + editing: { + editMode: 'batch', + editEnabled: true, + insertEnabled: true, + removeEnabled: true + }, + filterRow: { + visible: true, + showOperationChooser: false + }, + groupPanel: { + visible: true + }, + grouping: { + autoExpandAll: false + }, + height: () => { + return 200; + }, + hoverStateEnabled: true, + loadPanel: { + height: 150, + width: 400, + text: 'Data is loading...' + }, + noDataText: "It isn't the data you're looking for", + pager: { + showPageSizeSelector: true, + allowedPageSizes: [3, 5, 8] + }, + paging: { + pageSize: 8, + pageIndex: 19 + }, + rowAlternationEnabled: true, + rowPrepared: (rowElement: JQuery, rowInfo: Object) => { }, + rtlEnabled: false, + scrolling: { mode: 'infinite' }, + searchPanel: { + visible: true, + width: 250 + }, + selectedRowKeys: [1, 2, 4], + selection: { + mode: 'multiple', + allowSelectAll: false + }, + showColumnHeaders: true, + showColumnLines: true, + showRowLines: true, + sorting: { mode: 'multiple' }, + visible: true, + width: () => { return 400; }, + wordWrapEnabled: true + }); +} \ No newline at end of file diff --git a/devextreme/dx.webappjs.d.ts b/devextreme/dx.webappjs.d.ts new file mode 100644 index 000000000..956b1cbef --- /dev/null +++ b/devextreme/dx.webappjs.d.ts @@ -0,0 +1,1597 @@ +// Type definitions for WebAppJS +// Project: http://js.devexpress.com/WebDevelopment/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module DevExpress { +export function abstract(): void; + export var rtlEnabled: boolean; + export var hardwareBackButton: JQueryCallback; + interface Endpoint { + local?: string; + production: string; + } + class EndpointSelector { + constructor(config: { [key: string]: Endpoint }); + urlFor(key: string): string; + } + export interface ActionOptions { + context?: Object; + component?: any; + beforeExecute? (e:ActionExecuteArgs): void; + afterExecute? (e:ActionExecuteArgs): void; + } + export interface ActionExecuteArgs { + action: any; + args: any[]; + context: any; + component: any; + cancel: boolean; + handled: boolean; + } + export class Action { + constructor(action?: any, config?: ActionOptions); + execute(): any; + } + export interface IDevice { + deviceType?: string; + platform?: string; + version?: Array; + phone?: boolean; + tablet?: boolean; + android?: boolean; + ios?: boolean; + win8?: boolean; + tizen?: boolean; + generic?: boolean; + } + export module devices { + export function orientation(): string; + export var orientationChanged: JQueryCallback; + export function real(): IDevice; + export function current(deviceOrName: string): IDevice; + export function current(deviceOrName: IDevice): IDevice; + } + export function registerComponent(name: string, componentClass: any): void; + export interface ComponentOptions { + disabled?: boolean; + } + export class Component { + constructor(element: Element, options?: ComponentOptions); + constructor(element: JQuery, options?: ComponentOptions); + disposing: JQueryCallback; + optionChanged: JQueryCallback; + instance(): Component; + beginUpdate(): void; + endUpdate(): void; + option(): any; + option(options: string): any; + option(options: string): T; + option(options: string, value: any): void; + option(options: { [key: string]: any }): void; + option(options?: any): any; + } + export interface DOMComponentOptions extends ComponentOptions { + rtlEnabled?: boolean; + } + export class DOMComponent extends Component { + constructor(element: HTMLElement, options?: DOMComponentOptions); + static defaultOptions(rule: { + device: any; + options: { [key: string]: any }; + }): void; + } +} +declare module DevExpress.data { +export interface DataError extends Error { + httpStatus?: number; + errorDetails?: any; + } + export interface ErrorHandler { (e: DataError): void; } + export interface EntityOptions { key: any; keyType: any; } + export interface Getter { (obj: any, options?: any): any; } + export interface Setter { (obj: any, value: any, options?: any): void; } + export interface QueryOptions { + errorHandler?: ErrorHandler; + requireTotalCount?: boolean; + } + export interface ODataQueryOptions extends QueryOptions { + adapter?: any; + } + interface IQuery { + enumerate(): JQueryPromise>; + count(): JQueryPromise; + slice(skip: number, take?: number): IQuery; + sortBy(field: string): IQuery; + sortBy(field: Getter): IQuery; + sortBy(field: { field: string; desc?: boolean }): IQuery; + sortBy(field: { field: Getter; desc?: boolean }): IQuery; + thenBy(field: string): IQuery; + thenBy(field: Getter): IQuery; + thenBy(field: { field: string; desc?: boolean }): IQuery; + thenBy(field: { field: Getter; desc?: boolean }): IQuery; + filter(field: string, operator: string, value: any): IQuery; + filter(field: string, value: any): IQuery; + filter(criteria: any[]): IQuery; + select(field: string): IQuery; + select(field: string[]): IQuery; + select(...field: string[]): IQuery; + select(field: Getter): IQuery; + select(field: Getter[]): IQuery; + select(...field: Getter[]): IQuery; + groupBy(field: string[]): IQuery; + groupBy(field: Getter[]): IQuery; + groupBy(field: { field: string; desc?: boolean }[]): IQuery; + groupBy(field: { field: Getter; desc?: boolean }[]): IQuery; + sum(getter?: string): JQueryPromise; + min(getter?: string): JQueryPromise; + max(getter?: string): JQueryPromise; + avg(getter?: string): JQueryPromise; + aggregate(step: number): JQueryPromise; + aggregate(seed: number, step: (accumulator: any, current: any) => any, finalize?: (accumulator: any) => any): JQueryPromise; + } + export interface ArrayQuery extends IQuery { + toArray(): Array; + } + export interface RemoteQuery extends IQuery { /*todo: exec() ? */ } + export function base64_encode(input: string): string; + export function base64_encode(input: any[]): string; + export function query(items?: any[]): IQuery; + export var queryImpl: { + remote: (url: string, queryOptions: QueryOptions) => RemoteQuery; + array: (iter: Array, queryOptions: QueryOptions) => ArrayQuery; + }; + export class Guid { + constructor(value?: string); + constructor(value?: any); + toString(): string; + valueOf(): string; + toJSON(): string; + } + export class EdmLiteral { + constructor(value: any); + valueOf(): any; + } + export module utils { + export function normalizeSortingInfo(info: string): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: string[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: Getter): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: Getter[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { field: string; dir?: string }): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { field: string; dir?: string }[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { field: string; desc?: boolean }): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { field: string; desc?: boolean }[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { selector: string; dir?: string }): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { selector: string; dir?: string }[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { selector: string; desc?: boolean }): Array<{ selector: string; desc?: boolean }>; + export function normalizeSortingInfo(info: { selector: string; desc?: boolean }[]): Array<{ selector: string; desc?: boolean }>; + export function normalizeBinaryCriterion(criteria: Array): Array; + export function keysEqual(key1: any, key2: any): boolean; + export function keysEqual(keyExpr: any, key1: any, key2: any): boolean; + export function toComparable(value: Date, caseSensitive?: boolean): number; + export function toComparable(value: Guid, caseSensitive?: boolean): string; + export function toComparable(value: string, caseSensitive?: boolean): string; + export function compileGetter(): Getter; + export function compileGetter(expr: any[]): Getter; + export function compileGetter(expr: string): Getter; + export function compileGetter(expr: "this"): Getter; + export function compileGetter(expr: Getter): Getter; + export function compileSetter(expr: string): Setter; + export module odata { + export function sendRequest(request: JQueryXHR, requestOptions?: JQueryAjaxSettings): any; + export function serializePropName(propName: EdmLiteral): string; + export function serializePropName(propName: string): string; + export function serializeValue(value: Date): string; + export function serializeValue(value: Guid): string; + export function serializeValue(value: string): string; + export function serializeValue(value: "string"): string; + export function serializeValue(value: EdmLiteral): string; + export function serializeKey(key: any): string; + export function serializeKey(key: Date): string; + export function serializeKey(key: Guid): string; + export function serializeKey(key: string): string; + export function serializeKey(key: "string"): string; + export function serializeKey(key: EdmLiteral): string; + export var keyConverters: { + String(value: any): string; + Guid(value: any): Guid; + Int32(value: any): number; + Int64(value: any): EdmLiteral; + }; + } + } + export module queryAdapters { + export function odata(queryOptions: ODataQueryOptions): RemoteQuery; + } +export interface DataSourceOptions { + map? (item: any): any; + postProcess? (result: any[]): any; + pageSize: number; + paginate: boolean; + } + export class DataSource { + public changed: JQueryCallback; + public loadError: JQueryCallback; + public loadingChanged: JQueryCallback; + constructor(options?: Store); + constructor(options?: string); + constructor(options?: Array); + constructor(options?: { store: Store }); + constructor(options?: CustomStoreOptions); + constructor(options?: { store: Array }); + constructor(options?: { store: { type: string } }); + constructor(options?: { load(options?: LoadOptions): JQueryXHR; }); + constructor(options?: { load(options?: LoadOptions): Array; }); + constructor(options?: { load(options?: LoadOptions): JQueryPromise; }); + constructor(options?: DataSourceOptions); + loadOptions(): { [key: string]: any }; + items(): Array; + store(): data.Store; + isLastPage(): boolean; + pageIndex(newIndex?: number): number; + sort(expr: any[]): any[]; + group(expr: any[]): any[]; + filter(expr: any[]): any[]; + select(expr: string[]): string[]; + searchValue(value?: string): string; + searchOperation(op?: string): string; + searchExpr(selector: string): string; + key(): any; + isLoaded(): boolean; + isLoading(): boolean; + totalCount(): number; + load(): JQueryPromise; + dispose(): void; + } +export interface StoreOptions { + key?: any; + errorHandler?: ErrorHandler; + loaded?: (result: Array) => void; + loading?: (loadOptions: LoadOptions) => void; + modified?: () => void; + modifying?: () => void; + inserted?: (values: Object, key: any) => void; + inserting?: (values: Object) => void; + updated?: (key: any, values: Object) => void; + updating?: (key: any, values: Object) => void; + removed?: (key: any) => void; + removing?: (key: any) => void; + } + export interface LoadOptions extends QueryOptions { + skip?: number; + take?: number; + sort?: any; + select?: any; + filter?: any; + group?: any; + expand?: any; + } + export class Store { + loaded: JQueryCallback; + loading: JQueryCallback; + modified: JQueryCallback; + modifying: JQueryCallback; + inserted: JQueryCallback; + inserting: JQueryCallback; + updated: JQueryCallback; + updating: JQueryCallback; + removed: JQueryCallback; + removing: JQueryCallback; + constructor(options?: StoreOptions); + key(): any; + keyOf(obj: any): any; + load(options?: LoadOptions): JQueryPromise; + createQuery(options?: QueryOptions): IQuery; + totalCount(options?: { + filter?: any[]; + group?: string[]; + }): JQueryPromise; + byKey(key: any, extraOptions?: { + expand?: string[] + }): JQueryPromise; + remove(key: any): JQueryPromise; + insert(values: any): JQueryPromise; + update(key: any, values: any): JQueryPromise; + } + export interface CustomStoreOptions extends StoreOptions { + load? (options?: LoadOptions): any; + byKey? (key: any): any; + insert? (values: any): any; + update? (key: any, values: any): any; + remove? (key: any): any; + totalCount? (options?: { + filter?: any[]; + group?: string[]; + }): any; + } + export class CustomStore extends Store { + constructor(options?: CustomStoreOptions); + } + export interface ArrayStoreOptions extends StoreOptions { + data?: Array + } + export class ArrayStore extends Store { + constructor(options?: Array); + constructor(options?: ArrayStoreOptions); + } + export interface LocalStoreOptions extends ArrayStoreOptions { + name: string; + } + export class LocalStore extends ArrayStore { + constructor(options?: string); + constructor(options?: LocalStoreOptions); + clear(): void; + } + export interface ODataStoreOptions extends StoreOptions { + url?: string; + name?: string; + keyType?: string; + jsonp?: boolean; + withCredentials?: boolean; + } + export class ODataStore extends Store { + constructor(options?: ODataStoreOptions); + } + export interface ODataContextOptions { + url: string; + jsonp?: boolean; + withCredentials?: boolean; + errorHandler?: ErrorHandler; + beforeSend?: () => any; + entities?: { + [entityAlias: string]: ODataStoreOptions; + }; + } + export class ODataContext { + constructor(options?: ODataContextOptions); + get(operationName: string, params: { [key: string]: any }): JQueryPromise>; + invoke(operationName: string, params: { [key: string]: any }, httpMethod?: string): JQueryPromise>; + objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; }; + } +} +declare module DevExpress.framework { +export interface dxViewOptions { + name: string; + title?: string; + layout?: string; + } + export class dxView extends Component { + constructor(options?: dxViewOptions); + } + export interface dxLayoutOptions { + name: string; + controller: string; + } + export class dxLayout extends Component { + constructor(options?: dxLayoutOptions); + } + export interface dxViewPlaceholderOptions { + viewName: string; + } + export class dxViewPlaceholder extends Component { + constructor(options?: dxLayoutOptions); + } + export interface dxTransitionOptions { + name: string; + type: string; + } + export class dxTransition extends Component { + constructor(options?: dxLayoutOptions); + } + export interface dxContentPlaceholderOptions { + name: string; + transition: string; + } + export class dxContentPlaceholder extends Component { + constructor(options?: dxLayoutOptions); + } + export interface dxContentOptions { + targetPlaceholder: string; + } + export class dxContent extends Component { + constructor(options?: dxLayoutOptions); + } + export interface dxCommandOptions extends ComponentOptions { + id: string; + action?: any; + icon?: string; + title?: string; + iconSrc?: string; + visible?: boolean; + } + export class dxCommand extends Component { + public beforeExecute: JQueryCallback; + public afterExecute: JQueryCallback; + constructor(element: JQuery, options?: dxCommandOptions); + constructor(element: Element, options?: dxCommandOptions); + execute(): void; + } + export class dxCommandContainer extends Component { + constructor(options: ComponentOptions); + constructor(element: JQuery, options?: ComponentOptions); + constructor(element: Element, options?: ComponentOptions); + } + export interface CommandMap { + [containerId: string]: { commands: any[]; defaults?: any; } + } + export class CommandMapping { + constructor(); + static defaultMapping: CommandMap; + mapCommands(containerId: string, commandMappings: any[]): CommandMapping; + unmapCommands(containerId: string, commandIds: string[]): void; + getCommandMappingForContainer(commandId: string, containerId: string): any; + load(config: CommandMap): CommandMapping; + } + interface IViewCache { + viewRemoved: JQueryCallback; + setView(key: string, viewInfo: any): void; + removeView(key: string): any; + hasView(viewInfo: any): boolean; + getView(key: string): any; + clear(): void; + } + export class ViewCache implements IViewCache { + viewRemoved: JQueryCallback; + constructor(); + setView(key: string, viewInfo: any): void; + removeView(key: string): any; + hasView(viewInfo: any): boolean; + getView(key: string): any; + clear(): void; + } + export class NullViewCache implements IViewCache { + viewRemoved: JQueryCallback; + constructor(); + setView(key: string, viewInfo: any): void; + removeView(key: string): any; + hasView(viewInfo: any): boolean; + getView(key: string): any; + clear(): void; + } + export class CapacityViewCacheDecorator implements IViewCache { + viewRemoved: JQueryCallback; + constructor(options: { + size: number; + viewCache: IViewCache; + }); + setView(key: string, viewInfo: any): void; + removeView(key: string): any; + hasView(viewInfo: any): boolean; + getView(key: string): any; + clear(): void; + } + export class ConditionalViewCacheDecorator implements IViewCache { + viewRemoved: JQueryCallback; + constructor(options: { + filter: (key: string, viewInfo: any) => boolean; + viewCache: IViewCache; + }); + setView(key: string, viewInfo: any): void; + removeView(key: string): any; + hasView(viewInfo: any): boolean; + getView(key: string): any; + clear(): void; + } + export class HistoryDependentViewCacheDecorator implements IViewCache { + viewRemoved: JQueryCallback; + constructor(options: { + navigationManager: StackBasedNavigationManager; + viewCache: IViewCache; + }); + setView(key: string, viewInfo: any): void; + removeView(key: string): any; + hasView(viewInfo: any): boolean; + getView(key: string): any; + clear(): void; + } + export interface IStorage { + getItem(key: string): any; + setItem(key: string, value: any): void; + removeItem(key: string): void; + } + export class MemoryKeyValueStorage implements IStorage { + constructor(); + getItem(key: string): any; + setItem(key: string, value: any): void; + removeItem(key: string): void; + } + export interface StateManagerOptions { + storage?: IStorage; + stateSources?: any[]; + } + export class StateManager { + public storage: IStorage; + public stateSources: any[]; + constructor(options?: StateManagerOptions); + addStateSource(stateSource: any): void; + removeStateSource(stateSource: any): void; + saveState(): void; + restoreState(): void; + clearState(): void; + } + export class Route { + constructor(pattern: string, defaults?: any, constraints?: any); + parse(url: string): any; + format(routeValues: any): string; + formatSegment(value: any): string; + parseSegment(): any; + } + export class MvcRouter { + constructor(); + register(pattern: string, defaults?: any, constraints?: any): void; + parse(uri: string): any; + format(obj: any): string; + } + interface BrowserAdapterOptions { + window: Window; + } + export class DefaultBrowserAdapter { + constructor(options?: BrowserAdapterOptions); + replaceState(uri: string): void; + pushState(uri: string): void; + createRootPage(): void; + getWindowName(): string; + setWindowName(windowName: string): void; + back(): void; + getHash(): string; + isRootPage(): boolean; + } + export class OldBrowserAdapter extends DefaultBrowserAdapter { } + export class HistorylessBrowserAdapter extends DefaultBrowserAdapter { } + export interface INavigationDevice { + init: Function; + setUri(uri: string): void; + getUri(): string; + back(): void; + } + export class StackBasedNavigationDevice extends HistoryBasedNavigationDevice implements INavigationDevice { + uriChanged: JQueryCallback; + constructor(options?: BrowserAdapterOptions); + } + export class HistoryBasedNavigationDevice implements INavigationDevice { + backInitiated: JQueryCallback; + init: Function; + setUri(uri: string): void; + getUri(): string; + back(): void; + } + export class NavigationStack { + public items: any[]; + public currentIndex: number; + public itemsRemoved: JQueryCallback; + constructor(); + currentItem(): any; + back(uri: string): void; + forward(): void; + navigate(uri: any, replaceCurrent?: boolean): any; + getPreviousItem(): any; + canBack(): boolean; + clear(): void; + } + export interface NavigationManagerOptions { + stateStorageKey?: string; + navigationDevice?: INavigationDevice; + keepPositionInStack?: boolean; + } + export interface INavigationManager { + navigating: JQueryCallback; + navigated: JQueryCallback; + navigatingBack: JQueryCallback; + navigationCanceled: JQueryCallback; + itemRemoved: JQueryCallback; + navigate(uri: any, options?: { + root?: boolean; + target?: string; + direction?: string; + }): void; + back(): void; + back(alternate: any): void; + canBack(): boolean; + rootUri(): string; + currentItem(): any; + previousItem(): any; + saveState(): void; + removeState(): void; + restoreState(): void; + } + export class StackBasedNavigationManager extends HistoryBasedNavigationManager { + init(): JQueryPromise; + public currentStack: NavigationStack; + public navigationStacks: { + [key: string]: NavigationStack + }; + public navigating: JQueryCallback; + public navigated: JQueryCallback; + public navigatingBack: JQueryCallback; + public navigationCanceled: JQueryCallback; + public itemRemoved: JQueryCallback; + constructor(options?: NavigationManagerOptions); + navigate(uri: any, options?: { + root?: boolean; + target?: string; + direction?: string; + }): void; + currentIndex(): number; + getItemByIndex(index: number): any; + clearHistory(): void; + } + export class HistoryBasedNavigationManager implements INavigationManager { + navigating: JQueryCallback; + navigated: JQueryCallback; + navigatingBack: JQueryCallback; + navigationCanceled: JQueryCallback; + itemRemoved: JQueryCallback; + constructor(options?: NavigationManagerOptions); + navigate(uri: any, options?: { + root?: boolean; + target?: string; + direction?: string; + }): void; + back(): void; + back(alternate: any): void; + canBack(): boolean; + rootUri(): string; + currentItem(): any; + previousItem(): any; + saveState(): void; + removeState(): void; + restoreState(): void; + } + export module utils { + export function mergeCommands(destination: any, source: any): dxCommand[]; + } + export interface ApplicationOptions { + router?: MvcRouter; + ns?: Object; + namespace?: Object; + viewCache?: IViewCache; + viewCacheSize?: number; + disableViewCache?: boolean; + useViewTitleAsBackText?: boolean; + stateManager?: StateManager; + navigationManager?: StackBasedNavigationManager; + navigation?: dxCommandOptions[]; + commandMapping?: CommandMap; + } + export class Application { + public router: MvcRouter; + public namespace: any; + public components: any[]; + public viewCache: IViewCache; + public stateManager: StateManager; + public commandMapping: CommandMap; + public navigation: dxCommand[]; + public navigationManager: StackBasedNavigationManager; + public beforeViewSetup: JQueryCallback; + public afterViewSetup: JQueryCallback; + public viewShowing: JQueryCallback; + public viewShown: JQueryCallback; + public viewHidden: JQueryCallback; + public viewDisposing: JQueryCallback; + public viewDisposed: JQueryCallback; + public navigating: JQueryCallback; + public navigatingBack: JQueryCallback; + constructor(options?: ApplicationOptions); + init(): any; + navigate(uri?: any, options?: { + root?: boolean; + target?: string; + direction?: string; + }): void; + back(): void; + canBack(): boolean; + saveState(): void; + clearState(): void; + restoreState(): void; + } + export function createActionExecutors(app: Application): { + [key: string]: { execute(e: any): void; } + }; +} +declare module DevExpress.framework.html { +export interface ILayoutController { + viewReleased: JQueryCallback; + init(options: InitLayoutControllerOptions): void; + activate(): void; + deactivate(): void; + showView(viewInfo: any, direction?: string): JQueryPromise; + } + export interface ILayoutControllerRegistration extends IDevice { + name: string; + controller: ILayoutController; + root?: boolean; + } + export var layoutControllers: Array; + export var layoutSets: Object; + export interface InitLayoutControllerOptions { + $viewPort?: JQuery; + $hiddenBag?: JQuery; + navigationManager?: framework.StackBasedNavigationManager; + } + export class DefaultLayoutController implements ILayoutController { + public viewReleased: JQueryCallback; + constructor(options?: { layoutTemplateName: string }); + init(options: InitLayoutControllerOptions): void; + activate(): void; + deactivate(): void; + showView(viewInfo: any, direction?: string): JQueryPromise; + } + export interface CommandManagerOptions { + globalCommands?: framework.dxCommand[]; + commandMapping?: framework.CommandMapping; + } + export class CommandManager { + public globalCommands: framework.dxCommand[]; + public commandMapping: framework.CommandMapping; + constructor(options?: CommandManagerOptions); + layoutCommands($markup: JQuery, extraCommands?: any): void; } + export interface ITemplateEngine { + applyTemplate(template: string, model: any): void; + applyTemplate(template: Element, model: any): void; + applyTemplate(template: JQuery, model: any): void; + } + export class KnockoutJSTemplateEngine implements ITemplateEngine { + constructor(); + applyTemplate(template: string, model: any): void; + applyTemplate(template: Element, model: any): void; + applyTemplate(template: JQuery, model: any): void; + } + export interface TransitionExecutorOptions { + type?: string; + source?: JQuery; + destination?: JQuery; + } + export class TransitionExecutor { + public container: JQuery; + constructor(container: JQuery, options: TransitionExecutorOptions); + finalize(): void; + exec(): JQueryPromise; + static create(container: JQuery, options: TransitionExecutorOptions): TransitionExecutor; + } + export interface ViewEngineOptions { + $root?: JQuery; + device?: IDevice; + commandManager?: CommandManager; + templateEngine?: ITemplateEngine; + dataOptionsAttributeName?: string; + } + export class ViewEngineBase { + public $root: JQuery; + public device: IDevice; + public commandManager: CommandManager; + public templateEngine: ITemplateEngine; + public dataOptionsAttributeName: string; + public viewSelecting: JQueryCallback; + public modelFromViewDataExtended: JQueryCallback; + constructor(options?: ViewEngineOptions); + init(): JQueryPromise; + findViewTemplate(viewName: string): JQuery; + afterViewSetup(viewInfo: any): void; + } + export class ViewEngine extends ViewEngineBase { + public layoutSelecting: JQueryCallback; + constructor(options?: ViewEngineOptions); + init(): JQueryPromise; + findLayoutTemplate(layoutName: string): JQuery; + } + export interface HtmlApplicationOptions extends framework.ApplicationOptions { + commandManager?: CommandManager; + templateEngine?: ITemplateEngine; + navigateToRootViewMode?: string; + layoutControllers?: Array + device?: IDevice; + layoutSet?: Array; + } + export class HtmlApplication extends framework.Application { + public viewEngine: ViewEngineBase; + public viewRendered: JQueryCallback; + public resolveLayoutController: JQueryCallback; + constructor(options?: HtmlApplicationOptions); + init(): any; + viewPort(): JQuery; + } +} +declare module DevExpress.ui { + interface ViewportOptions { + allowPan?: boolean; + allowZoom?: boolean; + } + export interface ITemplate { + compile(html: string): any; + render(template: JQuery, data: any): any; + render(template: any, data: any): any; + } + class Template { + constructor(element: HTMLElement); + constructor(element: JQueryStatic); + render(container: HTMLElement): any; + render(container: JQueryStatic): any; + dispose(): void; + } + interface TemplateStatic { + new (element: HTMLElement): Template; + new (element: JQueryStatic): Template; + } + class TemplateProvider { + constructor(); + getTemplateClass(widget: any): TemplateStatic; + getDefaultTemplate(widget: any): void; supportDefaultTemplate(): boolean; + } + export function initViewport(options: ViewportOptions): void; + interface NotifyOptions { + message: string; + type?: string; + displayTime?: number; + hiddenAction: () => any; + } + export function notyfy(options: any): void; + export function notify(message: string, type?: string, displayTime?: number): void; + export module dialog { + interface Dialog { + show(): JQueryPromise; + hide(value?: any): void; + } + interface DialogButton { + text: string; + icon: string; + clickAction: () => any; + } + interface DialogOptions { + message: string; + title?: string; + } + export function custom(options: DialogOptions): Dialog; + export function custom(message: string, title?: string): Dialog; + export function alert(options: DialogOptions): JQueryPromise; + export function alert(message: string, title?: string): JQueryPromise; + export function confirm(options: DialogOptions): JQueryPromise; + export function confirm(message: string, title?: string): JQueryPromise; + } +export interface CollectionContainerWidgetOptions extends WidgetOptions { + items?: Array; + itemTemplate?: any; + itemRender?: Function; + itemClickAction?: any; + itemRenderedAction?: any; + noDataText?: string; + dataSource?: data.DataSource; + selectedIndex?: number; + itemSelectAction?: any; + itemHoldAction?: any; + itemHoldTimeout?: number; + } + export class CollectionContainerWidget extends Widget { + constructor(element: Element, options?: CollectionContainerWidgetOptions); + constructor(element: JQuery, options?: CollectionContainerWidgetOptions); + } +export interface WidgetOptions extends ComponentOptions { + contentReadyAction?: any; + width?: any; + height?: any; + visible?: boolean; + activeStateEnabled?: boolean; + } + export class Widget extends Component { + constructor(element: Element, options?: WidgetOptions); + constructor(element: JQuery, options?: WidgetOptions); + init(): void; + repaint(): void; + addTemplate(template: ITemplate): void; + } +export interface dxEditorOptions extends WidgetOptions { + value?: any; + valueChangeAction?: any; + } + export class dxEditor extends Widget { + constructor(element: Element, options?: dxEditorOptions); + constructor(element: JQuery, options?: dxEditorOptions); + } +export interface dxAutocompleteOptions extends dxDropDownEditorOptions { + minSearchLength?: number; + searchTimeout?: number; + placeholder?: string; + filterOperator?: string; + displayExpr?: string; + searchMode?: string; + dataSource?: data.DataSource; + items?: Array; + itemRender?: Function; + itemTemplate?: any; + } + export class dxAutocomplete extends dxDropDownEditor { + constructor(element: Element, options?: dxAutocompleteOptions); + constructor(element: JQuery, options?: dxAutocompleteOptions); + } +export interface dxButtonOptions extends WidgetOptions { + type?: string; + text?: string; + icon?: string; + iconSrc?: string; + } + export class dxButton extends Widget { + constructor(element: Element, options?: dxButtonOptions); + constructor(element: JQuery, options?: dxButtonOptions); + } +export interface dxCheckBoxOptions extends dxEditorOptions { } + export class dxCheckBox extends dxEditor { + constructor(element: Element, options?: dxCheckBoxOptions); + constructor(element: JQuery, options?: dxCheckBoxOptions); + } +export interface dxCalendarOptions extends dxEditorOptions { + value?: Date; + min?: Date; + max?: Date; + firstDayOfWeek?: number; + } + export class dxCalendar extends dxEditor { + constructor(element: Element, options?: dxEditorOptions); + constructor(element: JQuery, options?: dxEditorOptions); + } +export interface dxDateBoxOptions extends dxTextEditorOptions { + format?: string; + useNativePicker?: boolean; + value?: Date; + type?: string; + min?: Date; + max?: Date; + useCalendar?: boolean; + formatString?: string; + closeOnValueChange?: boolean; + calendarOptions?: Object; + } + export class dxDateBox extends dxTextEditor { + constructor(element: Element, options?: dxDateBoxOptions); + constructor(element: JQuery, options?: dxDateBoxOptions); + } +export interface dxTextEditorOptions extends dxEditorOptions { + valueChangeEvent?: string; + placeholder?: string; + readOnly?: boolean; + focusInAction?: any; + focusOutAction?: any; + keyDownAction?: any; + keyPressAction?: any; + keyUpAction?: any; + changeAction?: any; + enterKeyAction?: any; + copyAction?: any; + pasteAction?: any; + cutAction?: any; + inputAction?: any; + showClearButton?: boolean; + mode?: string; + } + export class dxTextEditor extends dxEditor { + constructor(element: Element, options?: dxTextEditorOptions); + constructor(element: JQuery, options?: dxTextEditorOptions); + focus(): void; + blur(): void; + } +export interface dxListOptions extends CollectionContainerWidgetOptions { + pullRefreshEnabled?: boolean; + autoPagingEnabled?: boolean; + scrollingEnabled?: boolean; + showScrollbar?: boolean; + useNativeScrolling?: boolean; + grouped?: boolean; + editEnabled?: boolean; + showNextButton?: boolean; + groupTemplate?: string; + pullingDownText?: string; + pulledDownText?: string; + refreshingText?: string; + pageLoadingText?: string; + scrollAction?: any; + pullRefreshAction?: any; + pageLoadingAction?: any; + itemHoldAction?: any; + itemSwipeAction?: any; + itemHoldTimeout?: number; + groupRender? (groupData: any, groupIndex: number, groupElement: Element): any; + editConfig?: { + itemTemplate?: any; + itemRenderer? (itemData: any, itemIndex: number, itemElement: Element): any; + menuType?: string; + menuItems?: any[]; + deleteEnabled?: boolean; + deleteMode?: string; + selectionEnabled?: boolean; + selectionMode?: string; + selectionType?: string; + reorderEnabled?: boolean; + } + itemDeleteAction?: any; + selectedItems?: any[]; + itemSelectAction?: any; + itemUnselectAction?: any; + itemReorderAction?: any; + nextButtonText?: string; + selectionMode?: string; + } + export class dxList extends CollectionContainerWidget { + constructor(element: Element, options?: dxListOptions); + constructor(element: JQuery, options?: dxListOptions); + update(): JQueryPromise; + updateDimensions(): JQueryPromise; + refresh(): JQueryPromise; + reload(): JQueryPromise; + deleteItem(itemElement: JQuery): JQueryPromise; + deleteItem(itemElement: Element): JQueryPromise; + clearSelectedItems() : void; + isItemSelected(itemElement: JQuery): boolean; + isItemSelected(itemElement: Element): boolean; + selectItem(itemElement: JQuery): void; + selectItem(itemElement: Element): void; + unselectItem(itemElement: JQuery): void; + unselectItem(itemElement: Element): void; + reorderItem(itemElement: JQuery, toItemElement: JQuery): JQueryPromise; + reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; + getSelectedItems(): number[]; + clientHeight(): number; + scrollHeight(): number; + scrollBy(distance: number): void; + scrollTo(targetLocation: number): void; + scrollTop(): number; + } +export interface dxLoadPanelOptions extends dxOverlayOptions { + message?: string; + width?: number; + height?: number; + delay?: number; + showPane?: boolean; + showIndicator?: boolean; + indicatorSrc?: string; + } + export class dxLoadPanel extends dxOverlay { + constructor(element: Element, options?: dxLoadPanelOptions); + constructor(element: JQuery, options?: dxLoadPanelOptions); + hide(): void; + show(): void; + toggle(showing: boolean): void; + } +export interface dxLookupOptions extends dxEditorOptions { + dataSource?: data.DataSource; + displayValue?: string; + title?: string; + titleTemplate?: any; + valueExpr?: string; + displayExpr?: string; + placeholder?: string; + searchPlaceholder?: string; + searchEnabled?: boolean; + searchTimeout?: number; + minFilterLength?: number; + fullScreen?: boolean; + itemTemplate?: any; + itemRender?: Function; + showCancelButton?: boolean; + showClearButton?: boolean; + showDoneButton?: boolean; + showNextButton?: boolean; + doneButtonText?: string; + cancelButtonText?: string; + clearButtonText?: string; + nextButtonText?: string; + grouped?: boolean; + groupRender?: Function; + groupTemplate?: string; + pullingDownText?: string; + pulledDownText?: string; + refreshingText?: string; + pageLoadingText?: string; + noDataText?: string; + scrollAction?: any; + shading?: boolean; + closeOnOutsideClick?: boolean; + position?: any; + animation?: any; + shownAction?: any; + hiddenAction?: any; + popupWidth?: any; + popupHeight?: any; + autoPagingEnabled?: boolean; + useNativeScrolling?: boolean; + usePopover?: boolean; + openAction?: any; + closeAction?: any; + } + export class dxLookup extends dxEditor { + constructor(element: Element, options?: dxLookupOptions); + constructor(element: JQuery, options?: dxLookupOptions); + close(): void; + open(): void; + } +export interface dxMapOptions extends WidgetOptions { + location?: any; + width?: number; + height?: number; + zoom?: number; + mapType?: string; + provider?: string; + markers?: Array; + routes?: Array; + key?: string; + controls?: any; + mapReadyAction?: any; + autoAdjust?: boolean; + center?: any; + markerAddedAction?: any; + markerRemovedAction?: any; + markerIconSrc?: string; + routeAddedAction?: any; + routeRemovedAction?: any; + type?: string; + } + export class dxMap extends Widget { + constructor(element: Element, options?: dxMapOptions); + constructor(element: JQuery, options?: dxMapOptions); + addMarker(markerOptions: any, callback: Function): JQueryPromise; + removeMarker(marker: any): void; + addRoute(routeOptions: any, callback: Function): JQueryPromise; + removeRoute(route: any): void; + } +export interface dxNavBarOptions extends dxTabsOptions { } + export class dxNavBar extends dxTabs { + constructor(element: Element, options?: dxNavBarOptions); + constructor(element: JQuery, options?: dxNavBarOptions); + } +export interface dxNumberBoxOptions extends dxTextEditorOptions { + min?: number; + max?: number; + value?: number; + step?: number; + showSpinButtons?: boolean; + } + export class dxNumberBox extends dxTextEditor { + constructor(element: Element, options?: dxNumberBoxOptions); + constructor(element: JQuery, options?: dxNumberBoxOptions); + } +export interface dxOverlayOptions extends WidgetOptions { + activeStateEnabled?: boolean; + shading?: boolean; + closeOnOutsideClick?: boolean; + position?: any; + animation?: any; + showingAction?: any; + shownAction?: any; + hidingAction?: any; + hiddenAction?: any; + deferRendering?: boolean; + targetContainer?: any; + contentTemplate?: any; + } + export class dxOverlay extends Widget { + constructor(element: Element, options?: dxOverlayOptions); + constructor(element: JQuery, options?: dxOverlayOptions); + content(): JQuery; + hide(): void; + show(): void; + toggle(showing: boolean): void; + } +export interface dxPopupOptions extends dxOverlayOptions { + title?: string; + showTitle?: boolean; + fullScreen?: boolean; + cancelButton?: any; + doneButton?: any; + clearButton?: any; + titleTemplate?: any; + dragEnabled?: boolean; + } + export class dxPopup extends dxOverlay { + constructor(element: Element, options?: dxPopupOptions); + constructor(element: JQuery, options?: dxPopupOptions); + } +export interface dxPopoverOptions extends dxPopupOptions { + target?: any; + } + export class dxPopover extends dxPopup { + constructor(element: Element, options?: dxPopoverOptions); + constructor(element: JQuery, options?: dxPopoverOptions); + } +export interface dxTooltipOptions extends dxPopoverOptions { + target?: any; + } + export class dxTooltip extends dxPopover { + constructor(element: Element, options?: dxTooltipOptions); + constructor(element: JQuery, options?: dxTooltipOptions); + } +export interface dxRadioGroupOptions extends CollectionContainerWidgetOptions { + layout?: string; + name?: string; + value?: Object; + valueExpr?: string; + } + export class dxRadioGroup extends CollectionContainerWidget { + constructor(element: Element, options?: dxRadioGroupOptions); + constructor(element: JQuery, options?: dxRadioGroupOptions); + } +export interface dxRangeSliderOptions extends dxSliderOptions { + start?: number; + end?: number; + } + export class dxRangeSlider extends dxSlider { + constructor(element: Element, options?: dxRangeSliderOptions); + constructor(element: JQuery, options?: dxRangeSliderOptions); + } +export interface dxScrollableOptions extends ComponentOptions { + startAction?: any; + scrollAction?: any; + endAction?: any; + stopAction?: any; + inertiaAction?: any; + bounceAction?: any; + updateAction?: any; + bounceEnabled?: boolean; + direction?: string; + showScrollbar?: boolean; + useNative?: boolean; + } + export class dxScrollable extends Component { + constructor(element: Element, options?: dxScrollableOptions); + constructor(element: JQuery, options?: dxScrollableOptions); + update(): void; + content(): JQuery; + clientHeight(): number; + scrollHeight(): number; + clientWidth(): number; + scrollWidth(): number; + scrollLeft(): number; + scrollTop(): number; + scrollOffset(): Object; + scrollBy(distance: number): void; + scrollBy(distance: Object): void; + scrollTo(targetLocation: number): void; + scrollTo(targetLocation: Object): void; + } +export interface dxScrollViewOptions extends dxScrollableOptions { + pullingDownText?: string; + pulledDownText?: string; + refreshingText?: string; + reachBottomText?: string; + pullDownAction?: any; + reachBottomAction?: any; + } + export class dxScrollView extends dxScrollable { + constructor(element: Element, options?: dxScrollViewOptions); + constructor(element: JQuery, options?: dxScrollViewOptions); + release(preventReachBottom: boolean): JQueryPromise; + toggleLoading(showOrHide: boolean): void; + refresh(): void; + } +export interface dxSelectBoxOptions extends dxAutocompleteOptions { + fieldTemplate?: any; + displayValue?: string; + multiSelectEnabled?: boolean; + values?: any[]; + openAction?: any; + closeAction?: any; + } + export class dxSelectBox extends dxAutocomplete { + constructor(element: Element, options?: dxSelectBoxOptions); + constructor(element: JQuery, options?: dxSelectBoxOptions); + } +export interface dxSliderOptions extends dxEditorOptions { + min?: number; + max?: number; + step?: number; + showRange?: boolean; + label?: { + visible: boolean; + format?: any; + position?: string; + } + tooltip?: { + enabled?: boolean; + format?: any; + position?: string; + showMode?: string; + } + } + export class dxSlider extends dxEditor { + constructor(element: Element, options?: dxSliderOptions); + constructor(element: JQuery, options?: dxSliderOptions); + } +export interface dxTabsOptions extends CollectionContainerWidgetOptions { } + export class dxTabs extends CollectionContainerWidget { + constructor(element: Element, options?: dxTabsOptions); + constructor(element: JQuery, options?: dxTabsOptions); + } +export interface dxTextAreaOptions extends dxTextEditorOptions { + cols?: number; + rows?: number; + } + export class dxTextArea extends dxTextEditor { + constructor(element: Element, options?: dxTextAreaOptions); + constructor(element: JQuery, options?: dxTextAreaOptions); + } +export interface dxTextBoxOptions extends dxTextEditorOptions { + maxLength?: any; + } + export class dxTextBox extends dxTextEditor { + constructor(element: Element, options?: dxTextBoxOptions); + constructor(element: JQuery, options?: dxTextBoxOptions); + } +export interface dxToastOptions extends dxOverlayOptions { + message?: string; + type?: string; + displayTime?: number; + } + export class dxToast extends dxOverlay { + constructor(element: Element, options?: dxToastOptions); + constructor(element: JQuery, options?: dxToastOptions); + } +export interface dxToolbarOptions extends CollectionContainerWidgetOptions { + menuItemRender?: Function; + menuItemTemplate?: any; + submenuType?: string; + renderAs?: string; + } + export class dxToolbar extends CollectionContainerWidget { + constructor(element: Element, options?: dxToolbarOptions); + constructor(element: JQuery, options?: dxToolbarOptions); + } +export interface dxDropDownEditorOptions extends dxTextBoxOptions { + closeAction?: any; + openAction?: any; + } + export class dxDropDownEditor extends dxTextBox { + constructor(element: Element, options?: dxDropDownEditorOptions); + constructor(element: JQuery, options?: dxDropDownEditorOptions); + } +export interface dxLoadIndicatorOptions extends WidgetOptions { + indicatorSrc?: string; + } + export class dxLoadIndicator extends Widget { + constructor(element: Element, options?: dxLoadIndicatorOptions); + constructor(element: JQuery, options?: dxLoadIndicatorOptions); + } +export interface dxMultiViewOptions extends CollectionContainerWidgetOptions { + loop?: boolean; + swipeEnabled?: boolean; + animationEnabled?: boolean; + selectedIndex?: number; + } + export class dxMultiView extends CollectionContainerWidget { + constructor(element: Element, options?: dxMultiViewOptions); + constructor(element: JQuery, options?: dxMultiViewOptions); + } +export interface dxGalleryOptions extends CollectionContainerWidgetOptions { + activeStateEnabled?: boolean; + animationDuration?: number; + loop?: boolean; + swipeEnabled?: boolean; + indicatorEnabled?: boolean; + showIndicator?: boolean; + selectedIndex?: number; + slideshowDelay?: number; + showNavButtons?: boolean; + } + export class dxGallery extends CollectionContainerWidget { + constructor(element: Element, options?: dxGalleryOptions); + constructor(element: JQuery, options?: dxGalleryOptions); + goToItem(itemIndex?: number, animation?: boolean): JQueryPromise; + prevItem(animation?: boolean): JQueryPromise; + nextItem(animation?: boolean): JQueryPromise; + } +export interface dxDataGridFilterDescriptions { + '='?: string; + '<>'?: string; + '<'?: string; + '<='?: string; + '>'?: string; + '>='?: string; + 'startswith'?: string; + 'contains'?: string; + 'notcontains'?: string; + 'endswith'?: string; + } + export interface dxDataGridColumn { + allowSorting?: boolean; + allowFiltering?: boolean; + allowHiding?: boolean; + allowEditing?: boolean; + allowGrouping?: boolean; + allowReordering?: boolean; + allowResizing?: boolean; + visible?: boolean; + dataField?: string; + dataType?: string; + calculateCellValue?: (rowData: {}) => any; + calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string) => Array; + caption?: string; + width?: any; cssClass?: string; + trueText?: string; + falseText?: string; + sortOrder?: string; + sortIndex?: number; + groupIndex?: number; + alignment?: string; + format?: string; + precision?: number; + customizeText?: (options: { value: any; valueText: string }) => string; + filterOperations?: dxDataGridFilterDescriptions; + selectedFilterOperation?: string; + cellTemplate?: any; headerCellTemplate?: any; editCellTemplate?: any; groupCellTemplate?: any; lookup?: { + dataSource?: any; valueExpr?: any; displayExpr?: any; }; + } + export interface dxDataGridOptions extends ui.WidgetOptions { + dataSource?: any; + dataErrorOccurred?: (errorObject: {}) => void; + showColumnHeaders?: boolean; + columnAutoWidth?: boolean; + noDataText?: string; + wordWrapEnabled?: boolean; + showColumnLines?: boolean; + showRowLines?: boolean; + rowAlternationEnabled?: boolean; + allowColumnReordering?: boolean; + allowColumnResizing?: boolean; + hoverStateEnabled?: boolean; + selectedItems?: Array; + columnChooser?: { + enabled?: boolean; + width?: number; + height?: number; + title?: string; + emptyPanelText?: string; + }; + selection?: { + mode?: string; + allowSelectAll?: boolean; + }; + sorting?: { + mode?: string; + ascendingText?: string; + descendingText?: string; + clearText?: string; + }; + searchPanel?: { + visible?: boolean; + width?: number; + placeholder?: string; + highlightSearchText?: boolean; + }; + grouping?: { + autoExpandAll?: boolean; + allowCollapsing?: boolean; + groupContinuesMessage?: string; + groupContinuedMessage?: string; + }; + groupPanel?: { + visible?: boolean; + emptyPanelText?: string; + allowColumnDragging?: boolean; + }; + filterRow?: { + visible?: boolean; + showOperationChooser?: boolean; + showAllText?: string; + resetOperationText?: string; + operationDescriptions?: dxDataGridFilterDescriptions; + }; + paging?: { + enabled?: boolean; + pageSize?: number; + pageIndex?: number; + }; + pager?: { + visible?: any; showPageSizeSelector?: boolean; + allowedPageSizes?: Array; + }; + editing?: { + editMode?: string; + insertEnabled?: boolean; + editEnabled?: boolean; + removeEnabled?: boolean; + texts?: { + editRow?: string; + saveRowChanges?: string; + cancelRowChanges?: string; + deleteRow?: string; + recoverRow?: string; + undeleteRow?: string; + confirmDeleteMessage?: string; + confirmDeleteTitle?: string; + } + }; + scrolling?: { + mode?: string; + preloadEnabled?: boolean; + useNativeScrolling?: boolean; + }; + loadPanel?: { + enabled?: boolean; + text?: string; + width?: number; + height?: number; + }; + stateStoring?: { + enabled?: boolean; + storageKey?: string; + type?: string; + customLoad?: () => any; + customSave?: (state: {}) => void; + }; + rowTemplate?: any; columns?: Array; + selectionChanged?: (options: {}) => void; + customizeColumns?: (columns: Array) => void; + rowClick?: (data: {}) => void; + cellClick?: (clickedCell: {}) => void; + cellHoverChanged?: (hoveredCell: {}) => void; + } + export class dxDataGrid extends Widget { + constructor(element: Element, options?: dxDataGridOptions); + constructor(element: JQuery, options?: dxDataGridOptions); + showColumnChooser: () => void; + hideColumnChooser: () => void; + beginCustomLoading: (messageText?: string) => void; + endCustomLoading: () => void; + startSelectionWithCheckboxes: () => void; + stopSelectionWithCheckboxes: () => void; + selectAll: () => void; + clearSelection: () => void; + getSelectedRowKeys: () => Array; + getSelectedRowsData: () => Array; + selectRows: (keys: Array) => void; + searchByText: (text: string) => void; + insertRow: () => void; + editRow: (rowIndex: number) => void; + editCell: (rowIndex: number, columnIndex: number) => void; + removeRow: (rowIndex: number) => void; + saveEditData: () => void; + undeleteRow: (rowIndex: number) => void; + cancelEditData: () => void; + refresh: () => void; + filter: (expr: any) => void; + clearFilter: () => void; + keyOf: (data: {}) => any; + byKey: (key: any) => {}; + getDataByKeys: (rowKeys: Array) => Array<{}>; + pageIndex: (value: number) => number; + totalCount: () => number; + closeEditCell: () => void; + collapseAll: (groupIndex?: number) => void; + expandAll: (groupIndex?: number) => void; + addColumn: (options: any) => void; + columnOption: (columnIndex: number, optionName?: string, optionValue?: any) => {}; + isScrollbarVisible: () => boolean; + getTopVisibleRowData: () => {}; + } +} +interface JQuery { +dxAutocomplete(options?: DevExpress.ui.dxAutocompleteOptions): JQuery; +dxButton(options?: DevExpress.ui.dxButtonOptions): JQuery; +dxCheckBox(options?: DevExpress.ui.dxCheckBoxOptions): JQuery; +dxCalendar(options?: DevExpress.ui.dxCalendarOptions): JQuery; +dxDateBox(options?: DevExpress.ui.dxDateBoxOptions): JQuery; +dxTextEditor(options?: DevExpress.ui.dxTextEditorOptions): JQuery; +dxList(options?: DevExpress.ui.dxListOptions): JQuery; +dxLoadPanel(options?: DevExpress.ui.dxLoadPanelOptions): JQuery; +dxLookup(options?: DevExpress.ui.dxLookupOptions): JQuery; +dxMap(options?: DevExpress.ui.dxMapOptions): JQuery; +dxNavBar(options?: DevExpress.ui.dxNavBarOptions): JQuery; +dxNumberBox(options?: DevExpress.ui.dxNumberBoxOptions): JQuery; +dxOverlay(options?: DevExpress.ui.dxOverlayOptions): JQuery; +dxPopup(options?: DevExpress.ui.dxPopupOptions): JQuery; +dxPopover(options?: DevExpress.ui.dxPopoverOptions): JQuery; +dxTooltip(options?: DevExpress.ui.dxTooltipOptions): JQuery; +dxRadioGroup(options?: DevExpress.ui.dxRadioGroupOptions): JQuery; +dxRangeSlider(options?: DevExpress.ui.dxRangeSliderOptions): JQuery; +dxScrollable(options?: DevExpress.ui.dxScrollableOptions): JQuery; +dxScrollView(options?: DevExpress.ui.dxScrollViewOptions): JQuery; +dxSelectBox(options?: DevExpress.ui.dxSelectBoxOptions): JQuery; +dxSlider(options?: DevExpress.ui.dxSliderOptions): JQuery; +dxTabs(options?: DevExpress.ui.dxTabsOptions): JQuery; +dxTextArea(options?: DevExpress.ui.dxTextAreaOptions): JQuery; +dxTextBox(options?: DevExpress.ui.dxTextBoxOptions): JQuery; +dxToast(options?: DevExpress.ui.dxToastOptions): JQuery; +dxToolbar(options?: DevExpress.ui.dxToolbarOptions): JQuery; +dxDropDownEditor(options?: DevExpress.ui.dxDropDownEditorOptions): JQuery; +dxLoadIndicator(options?: DevExpress.ui.dxLoadIndicatorOptions): JQuery; +dxMultiView(options?: DevExpress.ui.dxMultiViewOptions): JQuery; +dxGallery(options?: DevExpress.ui.dxGalleryOptions): JQuery; +dxDataGrid(options?: DevExpress.ui.dxDataGridOptions): JQuery; +} \ No newline at end of file From b57a5b10723c02624b877cdaf80d0011f54db1a4 Mon Sep 17 00:00:00 2001 From: Jon Stelly Date: Tue, 26 Aug 2014 08:23:55 -0500 Subject: [PATCH 073/537] Restangular: add generic overloads for get(), getAll() and post() --- restangular/restangular-tests.ts | 4 ++++ restangular/restangular.d.ts | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/restangular/restangular-tests.ts b/restangular/restangular-tests.ts index 9d5aa9fb4..3cfeb8c68 100644 --- a/restangular/restangular-tests.ts +++ b/restangular/restangular-tests.ts @@ -74,9 +74,13 @@ myApp.controller('TestCtrl', ( baseAccounts.post(newAccount); Restangular.allUrl('googlers', 'http://www.google.com/').getList(); + Restangular.allUrl('googlers', 'http://www.google.com/').getList(); Restangular.oneUrl('googlers', 'http://www.google.com/1').get(); + Restangular.oneUrl('googlers', 'http://www.google.com/1').get(); Restangular.one('accounts', 123).one('buildings', 456).get(); + Restangular.one('accounts', 123).one('buildings', 456).get(); Restangular.one('accounts', 123).getList('buildings'); + Restangular.one('accounts', 123).getList('buildings'); baseAccounts.getList().then(function (accounts) { var firstAccount = accounts[0]; diff --git a/restangular/restangular.d.ts b/restangular/restangular.d.ts index a1a7e8a5e..8b8fd9d2f 100644 --- a/restangular/restangular.d.ts +++ b/restangular/restangular.d.ts @@ -99,10 +99,14 @@ declare module restangular { interface IElement extends IService { get(queryParams?: any, headers?: any): IPromise; + get(queryParams?: any, headers?: any): IPromise; getList(subElement?: any, queryParams?: any, headers?: any): ICollectionPromise; + getList(subElement?: any, queryParams?: any, headers?: any): ICollectionPromise; put(queryParams?: any, headers?: any): IPromise; post(subElement: any, elementToPost: any, queryParams?: any, headers?: any): IPromise; + post(subElement: any, elementToPost: T, queryParams?: any, headers?: any): IPromise; post(elementToPost: any, queryParams?: any, headers?: any): IPromise; + post(elementToPost: T, queryParams?: any, headers?: any): IPromise; remove(queryParams?: any, headers?: any): IPromise; head(queryParams?: any, headers?: any): IPromise; trace(queryParams?: any, headers?: any): IPromise; @@ -114,7 +118,9 @@ declare module restangular { interface ICollection extends IService { getList(queryParams?: any, headers?: any): ICollectionPromise; + getList(queryParams?: any, headers?: any): ICollectionPromise; post(elementToPost: any, queryParams?: any, headers?: any): IPromise; + post(elementToPost: T, queryParams?: any, headers?: any): IPromise; head(queryParams?: any, headers?: any): IPromise; trace(queryParams?: any, headers?: any): IPromise; options(queryParams?: any, headers?: any): IPromise; From a32e2bc73114a8ce10d383208272efa2a4a325bc Mon Sep 17 00:00:00 2001 From: Jon Stelly Date: Tue, 26 Aug 2014 08:33:27 -0500 Subject: [PATCH 074/537] Restangular: fix test compilation --- restangular/restangular-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/restangular/restangular-tests.ts b/restangular/restangular-tests.ts index 3cfeb8c68..11d7a086d 100644 --- a/restangular/restangular-tests.ts +++ b/restangular/restangular-tests.ts @@ -22,7 +22,7 @@ myApp.config((RestangularProvider: restangular.IProvider) => { RestangularProvider.setRequestInterceptor(function (element, operation, route, url) { }); - RestangularProvider.addElementTransformer('accounts', false, function (elem) { + RestangularProvider.addElementTransformer('accounts', false, function (elem: any) { elem.accountName = 'Changed'; return elem; }); @@ -108,7 +108,7 @@ myApp.controller('TestCtrl', ( console.log("There was an error saving"); }); - firstAccount.getList("users", {query: "params"}).then(function(users) { + firstAccount.getList("users", {query: "params"}).then(function(users: any) { users.post({userName: 'unknown'}); users.customGET("messages", {param: "myParam"}); @@ -155,7 +155,7 @@ myApp.controller('TestCtrl', ( configurer.setRequestInterceptor(function (element, operation, route, url) { }); - configurer.addElementTransformer('accounts', false, function (elem) { + configurer.addElementTransformer('accounts', false, function (elem: any) { elem.accountName = 'Changed'; return elem; }); From 6165bb68de9ff765ba01cfc3e3042ccd279c2ef8 Mon Sep 17 00:00:00 2001 From: Adriaan Groenenboom Date: Tue, 26 Aug 2014 21:41:47 +0200 Subject: [PATCH 075/537] Add definition for SIPml --- sipml/sipml.d.ts | 150 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 sipml/sipml.d.ts diff --git a/sipml/sipml.d.ts b/sipml/sipml.d.ts new file mode 100644 index 000000000..265f7650a --- /dev/null +++ b/sipml/sipml.d.ts @@ -0,0 +1,150 @@ +// Type definitions for SIPml5 +// Project: http://sipml5.org/ +// Docgen: http://sipml5.org/docgen/symbols/SIPml.html +// Definitions by: Chookies (A. Groenenboom): https://github.com/chookies +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 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: any, listener: any); + public removeEventListener(type: any); + } + + class Session { + 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); + } + + export module Session { + interface Configuration { + audio_remote?: HTMLAudioElement; + bandwidth?: Object; + expires?: number; + from?: string; + sip_caps?: Object[]; + sip_headers?: Object[]; + video_local?: HTMLVideoElement; + video_remote?: HTMLVideoElement; + video_size?: Object; + } + + class Call extends Session { + 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; + } + + class Event extends SIPml.Event { + public session: Session; + + public getTransferDestinationFriendlyName(): string; + } + + class Message { + 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); + } + + class Registration extends Session { + public register(configuration?: Session.Configuration); + public unregister(configuration?: Session.Configuration); + } + + class Subscribe extends Session { + public subscribe(to: string, configuration?: Session.Configuration): number; + public unsubscribe(configuration?: Session.Configuration): number; + } + } + + class Stack extends EventTarget { + public constructor(configuration?: Stack.Configuration); + public setConfiguration(configuration: Stack.Configuration); + public newSession(type: string, configuration: Stack.Configuration); + public start(): number; + public stop(timeout: number): number; + } + + export module Stack { + interface Configuration { + bandwidth?: Object; + display_name?: string; + enable_click2call?: boolean; + enable_early_ims?: boolean; + enable_media_stream_cache?: boolean; + enable_rtcweb_breaker?: boolean; + events_listener?: Object; + ice_servers?: Object[]; + impi?: string; + impu?: string; + outbound_proxy_url?: string; + password?: string; + realm?: string; + sip_headers?: Object[]; + video_size?: Object; + 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); + + 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); + + function setWebRtcType(type: string); +} From b785da8c10866a34eb5e8ac9b1140f7953922183 Mon Sep 17 00:00:00 2001 From: Adriaan Groenenboom Date: Tue, 26 Aug 2014 22:44:50 +0200 Subject: [PATCH 076/537] Added passing test file for SIPml, improved definition Updated contributors file --- CONTRIBUTORS.md | 1 + sipml/sipml-test.ts | 169 ++++++++++++++++++++++++++++++++++++++++++++ sipml/sipml.d.ts | 27 ++++--- 3 files changed, 183 insertions(+), 14 deletions(-) create mode 100644 sipml/sipml-test.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index bb0933af5..18470668f 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -320,6 +320,7 @@ All definitions files include a header with the author and editors, so at some p * [SignalR](http://www.asp.net/signalr) (by [Boris Yankov](https://github.com/borisyankov)) * [simple-cw-node](https://github.com/astronaughts/simple-cw-node) (by [vvakame](https://github.com/vvakame)) * [Sinon](http://sinonjs.org/) (by [William Sears](https://github.com/mrbigdog2u)) +* [SIPml](http://sipml5.org/) (by [Adriaan Groenenboom](https://github.com/chookies)) * [sjcl](http://crypto.stanford.edu/sjcl/) (by [Eugene Chernyshov](https://github.com/Evgenus)) * [SlickGrid](https://github.com/mleibman/SlickGrid) (by [Josh Baldwin](https://github.com/jbaldwin)) * [smoothie](https://github.com/joewalnes/smoothie) (by [Mike H. Hawley](https://github.com/mikehhawley) and [Drew Noakes](https://drewnoakes.com)) diff --git a/sipml/sipml-test.ts b/sipml/sipml-test.ts new file mode 100644 index 000000000..5fed26fc6 --- /dev/null +++ b/sipml/sipml-test.ts @@ -0,0 +1,169 @@ +/// + +/* Code borrowed from http://sipml5.org/docgen/index.html?svn=224 */ + +var acceptMessage = (e: any)=> { + e.newSession.accept(); // e.newSession.reject(); to reject the message + console.info('SMS-content = ' + e.getContentString() + ' and SMS-content-type = ' + e.getContentType()); +}; +var acceptCall = (e:any)=> { + e.newSession.accept(); // e.newSession.reject() to reject the call +}; + + /* Initialize the engine */ +var readyCallback = (e:any)=> { + createSipStack(); // see next section +}; +var errorCallback = (e:any)=> { + console.error('Failed to initialize the engine: ' + e.message); +} +SIPml.init(readyCallback, errorCallback); + +/* Create a SIP stack */ +var sipStack: SIPml.Stack; +var eventsListener = (e:any)=> { + if(e.type == 'started'){ + login(); + } + else if(e.type == 'i_new_message'){ // incoming new SIP MESSAGE (SMS-like) + acceptMessage(e); + } + else if(e.type == 'i_new_call'){ // incoming audio/video call + acceptCall(e); + } +} + +function createSipStack(){ + sipStack = new SIPml.Stack('blaat'); + sipStack = new SIPml.Stack({ + realm: 'example.org', // mandatory: domain name + impi: 'bob', // mandatory: authorization name (IMS Private Identity) + impu: 'sip:bob@example.org', // mandatory: valid SIP Uri (IMS Public Identity) + password: 'mysecret', // optional + display_name: 'Bob legend', // optional + websocket_proxy_url: 'wss://sipml5.org:10062', // optional + outbound_proxy_url: 'udp://example.org:5060', // optional + enable_rtcweb_breaker: false, // optional + events_listener: { events: '*', listener: eventsListener }, // optional: '*' means all events + sip_headers: [ // optional + { name: 'User-Agent', value: 'IM-client/OMA1.0 sipML5-v1.0.0.0' }, + { name: 'Organization', value: 'Doubango Telecom' } + ] + } + ); +} +sipStack.start(); + +/* Register/login */ +var registerSession: SIPml.Session.Registration; +var eventsListener = (e:any)=>{ + console.info('session event = ' + e.type); + if(e.type == 'connected' && e.session == registerSession){ + makeCall(); + sendMessage(); + publishPresence(); + subscribePresence('johndoe'); // watch johndoe's presence status change + } +} +var login = ()=>{ + registerSession = sipStack.newSession('register', { + events_listener: { events: '*', listener: eventsListener } // optional: '*' means all events + }); + registerSession.register(); +} + +/* Making/receiving audio/video call */ +var callSession: SIPml.Session.Call; +var eventsListener = (e:any)=>{ + console.info('session event = ' + e.type); +} +var makeCall = ()=>{ + callSession = sipStack.newSession('call-audiovideo', { + video_local: document.getElementById('video-local'), + video_remote: document.getElementById('video-remote'), + audio_remote: document.getElementById('audio-remote'), + events_listener: { events: '*', listener: eventsListener } // optional: '*' means all events + }); + callSession.call('johndoe'); +} +var acceptCall = (e:any)=>{ + e.newSession.accept(); // e.newSession.reject() to reject the call +} + +/* Send/receive SIP MESSAGE (SMS-like) */ +var messageSession: SIPml.Session.Message; +var eventsListener = (e:any)=>{ + console.info('session event = ' + e.type); +} +var sendMessage = ()=>{ + messageSession = sipStack.newSession('message', { + events_listener: { events: '*', listener: eventsListener } // optional: '*' means all events + }); + messageSession.send('johndoe', 'Pêche à la moule', 'text/plain;charset=utf-8'); +} + +/* Publish presence status */ +var publishSession: SIPml.Session.Publish; +var eventsListener = (e:any)=>{ + console.info('session event = ' + e.type); +} +var publishPresence = ()=>{ + publishSession = sipStack.newSession('publish', { + events_listener: { events: '*', listener: eventsListener } // optional: '*' means all events + }); + var contentType = 'application/pidf+xml'; + var content = '\n' + + '\n' + + '\n' + + '\n'+ + ' open\n' + + ' away\n' + + '\n' + + 'tel:+33600000000\n' + + 'Bonjour de Paris :)\n' + + '\n' + + ''; + + // send the PUBLISH request + publishSession.publish(content, contentType,{ + expires: 200, + sip_caps: [ + { name: '+g.oma.sip-im' }, + { name: '+sip.ice' }, + { name: 'language', value: '\"en,fr\"' } + ], + sip_headers: [ + { name: 'Event', value: 'presence' }, + { name: 'Organization', value: 'Doubango Telecom' } + ] + }); +} + +/* Subscribe for presence status */ +var subscribeSession: SIPml.Session.Subscribe; +var eventsListener = (e:any)=>{ + console.info('session event = ' + e.type); + if(e.type == 'i_notify'){ + console.info('NOTIFY content = ' + e.getContentString()); + console.info('NOTIFY content-type = ' + e.getContentType()); + } +} +var subscribePresence = (to:string)=>{ + subscribeSession = sipStack.newSession('subscribe', { + expires: 200, + events_listener: { events: '*', listener: eventsListener }, + sip_headers: [ + { name: 'Event', value: 'presence' }, // only notify for 'presence' events + { name: 'Accept', value: 'application/pidf+xml' } // supported content types (COMMA-sparated) + ], + sip_caps: [ + { name: '+g.oma.sip-im', value: null }, + { name: '+audio', value: null }, + { name: 'language', value: '\"en,fr\"' } + ] + }); + // start watching for entity's presence status (You may track event type 'connected' to be sure that the request has been accepted by the server) + subscribeSession.subscribe(to); +} diff --git a/sipml/sipml.d.ts b/sipml/sipml.d.ts index 265f7650a..a4fe32784 100644 --- a/sipml/sipml.d.ts +++ b/sipml/sipml.d.ts @@ -1,7 +1,6 @@ // Type definitions for SIPml5 // Project: http://sipml5.org/ -// Docgen: http://sipml5.org/docgen/symbols/SIPml.html -// Definitions by: Chookies (A. Groenenboom): https://github.com/chookies +// Definitions by: A. Groenenboom // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module SIPml { @@ -16,8 +15,8 @@ declare module SIPml { } class EventTarget { - public addEventListener(type: any, listener: any); - public removeEventListener(type: any); + public addEventListener(type: any, listener: Function): void; + public removeEventListener(type: any): void; } class Session { @@ -26,7 +25,7 @@ declare module SIPml { public getRemoteFriendlyName(): string; public getRemoteUri(): string; public reject(configuration?: Session.Configuration): number; - public setConfiguration(configuration?: Session.Configuration); + public setConfiguration(configuration?: Session.Configuration): void; } export module Session { @@ -60,19 +59,19 @@ declare module SIPml { public getTransferDestinationFriendlyName(): string; } - class Message { + 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); + public unpublish(configuration?: Session.Configuration): void; } class Registration extends Session { - public register(configuration?: Session.Configuration); - public unregister(configuration?: Session.Configuration); + public register(configuration?: Session.Configuration): void; + public unregister(configuration?: Session.Configuration): void; } class Subscribe extends Session { @@ -83,8 +82,8 @@ declare module SIPml { class Stack extends EventTarget { public constructor(configuration?: Stack.Configuration); - public setConfiguration(configuration: Stack.Configuration); - public newSession(type: string, configuration: Stack.Configuration); + public setConfiguration(configuration: Stack.Configuration): number; + public newSession(type: string, configuration: Stack.Configuration): any; public start(): number; public stop(timeout: number): number; } @@ -126,7 +125,7 @@ declare module SIPml { function haveMediaStream(): boolean; - function init(readyCallback?: (e:any) => any, errorCallback?: (e:any) => any); + function init(readyCallback?: (e:any) => any, errorCallback?: (e:any) => any): boolean; function isInitialized(): boolean; @@ -144,7 +143,7 @@ declare module SIPml { function isWebSocketSupported(): boolean; - function setDebugLevel(level: string); + function setDebugLevel(level: string): void; - function setWebRtcType(type: string); + function setWebRtcType(type: string): boolean; } From 2f71e51796b16d18a48fb1718fb01aecb1a4db63 Mon Sep 17 00:00:00 2001 From: yutopp Date: Wed, 27 Aug 2014 20:19:47 +0900 Subject: [PATCH 077/537] Update three.d.ts https://github.com/mrdoob/three.js/blob/master/src/objects/SkinnedMesh.js#L83 --- threejs/three.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/threejs/three.d.ts b/threejs/three.d.ts index 2eb17c19b..cddaf7b0f 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -4108,6 +4108,8 @@ declare module THREE { normalizeSkinWeights(): void; updateMatrixWorld(force?: boolean): void; clone(object?: SkinnedMesh): SkinnedMesh; + + skeleton: Skeleton; } export class Sprite extends Object3D { From b3d24088bc00d1fef9ea028e3af472c8002b9b67 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Wed, 27 Aug 2014 14:10:09 +0100 Subject: [PATCH 078/537] AngularJS: JSDoc --- angularjs/angular.d.ts | 238 +++++++++++++++++++++++++++++++++++------ 1 file changed, 206 insertions(+), 32 deletions(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index b682fca84..97cb279ed 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -20,7 +20,7 @@ declare module ng { // not directly implemented, but ensures that constructed class implements $get interface IServiceProviderClass { - new(...args: any[]): IServiceProvider; + new (...args: any[]): IServiceProvider; } interface IServiceProviderFactory { @@ -38,10 +38,115 @@ declare module ng { /////////////////////////////////////////////////////////////////////////// interface IAngularStatic { bind(context: any, fn: Function, ...args: any[]): Function; - bootstrap(element: string, modules?: any[]): auto.IInjectorService; - bootstrap(element: JQuery, modules?: any[]): auto.IInjectorService; - bootstrap(element: Element, modules?: any[]): auto.IInjectorService; - bootstrap(element: Document, modules?: any[]): auto.IInjectorService; + + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + */ + bootstrap(element: string, modules?: string): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + */ + bootstrap(element: string, modules?: Function): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + */ + bootstrap(element: string, modules?: string[]): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + */ + bootstrap(element: JQuery, modules?: string): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + */ + bootstrap(element: JQuery, modules?: Function): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + */ + bootstrap(element: JQuery, modules?: string[]): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + */ + bootstrap(element: Element, modules?: string): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + */ + bootstrap(element: Element, modules?: Function): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + */ + bootstrap(element: Element, modules?: string[]): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + */ + bootstrap(element: Document, modules?: string): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + */ + bootstrap(element: Document, modules?: Function): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + */ + bootstrap(element: Document, modules?: string[]): auto.IInjectorService; /** * Creates a deep copy of source, which should be an object or an array. @@ -56,6 +161,11 @@ declare module ng { */ copy(source: T, destination?: T): T; + /** + * Wraps a raw DOM element or HTML string as a jQuery element. + * + * If jQuery is available, angular.element is an alias for the jQuery function. If jQuery is not available, angular.element delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite." + */ element: IAugmentedJQueryStatic; equals(value1: any, value2: any): boolean; extend(destination: any, ...sources: any[]): any; @@ -177,8 +287,20 @@ declare module ng { * @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation). */ controller(name: string, inlineAnnotatedConstructor: any[]): IModule; - controller(object : Object): IModule; + controller(object: Object): IModule; + /** + * Register a new directive with the compiler. + * + * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind) + * @param directiveFactory An injectable directive factory function. + */ directive(name: string, directiveFactory: IDirectiveFactory): IModule; + /** + * Register a new directive with the compiler. + * + * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind) + * @param directiveFactory An injectable directive factory function. + */ directive(name: string, inlineAnnotatedFunction: any[]): IModule; directive(object: Object): IModule; /** @@ -258,7 +380,7 @@ declare module ng { // The observer function will be invoked once during the next $digest // following compilation. The observer is then invoked whenever the // interpolated value changes. - $observe(name: string, fn:(value?:any)=>any): Function; + $observe(name: string, fn: (value?: any) => any): Function; // A map of DOM element attribute names to the normalized name. This is needed // to do reverse lookup from normalized name back to actual name. @@ -346,10 +468,10 @@ declare module ng { (): void; } - /////////////////////////////////////////////////////////////////////////// - // Scope and RootScope - // see https://docs.angularjs.org/api/ng/type/$rootScope.Scope and http://docs.angularjs.org/api/ng.$rootScope - /////////////////////////////////////////////////////////////////////////// + /** + * $rootScope - $rootScopeProvider - service in module ng + * see https://docs.angularjs.org/api/ng/type/$rootScope.Scope and https://docs.angularjs.org/api/ng/service/$rootScope + */ interface IRootScopeService { $apply(): any; $apply(exp: string): any; @@ -371,6 +493,14 @@ declare module ng { // Defaults to false by the implementation checking strategy $new(isolate?: boolean): IScope; + /** + * Listens on events of a given type. See $emit for discussion of event life cycle. + * + * The event listener function format is: function(event, args...). + * + * @param name Event name to listen on. + * @param listener Function to call when the event is emitted. + */ $on(name: string, listener: (event: IAngularEvent, ...args: any[]) => any): Function; $watch(watchExpression: string, listener?: string, objectEquality?: boolean): Function; @@ -382,7 +512,7 @@ declare module ng { $watchCollection(watchExpression: (scope: IScope) => any, listener: (newValue: any, oldValue: any, scope: IScope) => any): Function; $watchGroup(watchExpressions: any[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function; - $watchGroup(watchExpressions: {(scope: IScope) : any}[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function; + $watchGroup(watchExpressions: { (scope: IScope): any }[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function; $parent: IScope; @@ -401,14 +531,30 @@ declare module ng { } interface IAngularEvent { + /** + * the scope on which the event was $emit-ed or $broadcast-ed. + */ targetScope: IScope; + /** + * the scope that is currently handling the event. Once the event propagates through the scope hierarchy, this property is set to null. + */ currentScope: IScope; + /** + * name of the event. + */ name: string; - preventDefault: Function; - defaultPrevented: boolean; - - // Available only events that were $emit-ted + /** + * calling stopPropagation function will cancel further event propagation (available only for events that were $emit-ed). + */ stopPropagation?: Function; + /** + * calling preventDefault sets defaultPrevented flag to true. + */ + preventDefault: Function; + /** + * true if preventDefault was called. + */ + defaultPrevented: boolean; } /////////////////////////////////////////////////////////////////////////// @@ -641,7 +787,7 @@ declare module ng { // DocumentService // see http://docs.angularjs.org/api/ng.$document /////////////////////////////////////////////////////////////////////////// - interface IDocumentService extends IAugmentedJQuery {} + interface IDocumentService extends IAugmentedJQuery { } /////////////////////////////////////////////////////////////////////////// // ExceptionHandlerService @@ -655,7 +801,7 @@ declare module ng { // RootElementService // see http://docs.angularjs.org/api/ng.$rootElement /////////////////////////////////////////////////////////////////////////// - interface IRootElementService extends JQuery {} + interface IRootElementService extends JQuery { } /** * $q - service in module ng @@ -712,22 +858,50 @@ declare module ng { } interface IPromise { + /** + * Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected. + * + * This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method. + */ then(successCallback: (promiseValue: T) => IHttpPromise, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise; + /** + * Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected. + * + * This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method. + */ then(successCallback: (promiseValue: T) => IPromise, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise; + /** + * Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected. + * + * This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method. + */ then(successCallback: (promiseValue: T) => TResult, errorCallback?: (reason: any) => TResult, notifyCallback?: (state: any) => any): IPromise; - + /** + * Shorthand for promise.then(null, errorCallback) + */ catch(onRejected: (reason: any) => IHttpPromise): IPromise; + /** + * Shorthand for promise.then(null, errorCallback) + */ catch(onRejected: (reason: any) => IPromise): IPromise; + /** + * Shorthand for promise.then(null, errorCallback) + */ catch(onRejected: (reason: any) => TResult): IPromise; - finally(finallyCallback: ()=>any):IPromise; + /** + * Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information. + * + * Because finally is a reserved word in JavaScript and reserved keywords are not supported as property names by ES3, you'll need to invoke the method like promise['finally'](callback) to make your code IE8 and Android 2.x compatible. + */ + finally(finallyCallback: () => any): IPromise; } interface IDeferred { resolve(value?: T): void; reject(reason?: any): void; - notify(state?:any): void; + notify(state?: any): void; promise: IPromise; } @@ -756,7 +930,7 @@ declare module ng { // Methods bellow are not documented info(): any; - get (cacheId: string): ICacheObject; + get(cacheId: string): ICacheObject; } interface ICacheObject { @@ -768,7 +942,7 @@ declare module ng { //capacity: number; }; put(key: string, value?: any): void; - get (key: string): any; + get(key: string): any; remove(key: string): void; removeAll(): void; destroy(): void; @@ -1046,7 +1220,7 @@ declare module ng { // TemplateCacheService // see http://docs.angularjs.org/api/ng.$templateCache /////////////////////////////////////////////////////////////////////////// - interface ITemplateCacheService extends ICacheObject {} + interface ITemplateCacheService extends ICacheObject { } /////////////////////////////////////////////////////////////////////////// // SCEService @@ -1118,7 +1292,7 @@ declare module ng { instanceAttributes: IAttributes, controller: any, transclude: ITranscludeFunction - ): void; + ): void; } interface IDirectivePrePost { @@ -1131,7 +1305,7 @@ declare module ng { templateElement: IAugmentedJQuery, templateAttributes: IAttributes, transclude: ITranscludeFunction - ): IDirectivePrePost; + ): IDirectivePrePost; } interface IDirective { @@ -1151,12 +1325,12 @@ declare module ng { transclude?: any; } - /////////////////////////////////////////////////////////////////////////// - // angular.element - // when calling angular.element, angular returns a jQuery object, - // augmented with additional methods like e.g. scope. - // see: http://docs.angularjs.org/api/angular.element - /////////////////////////////////////////////////////////////////////////// + /** + * angular.element + * when calling angular.element, angular returns a jQuery object, + * augmented with additional methods like e.g. scope. + * see: http://docs.angularjs.org/api/angular.element + */ interface IAugmentedJQueryStatic extends JQueryStatic { (selector: string, context?: any): IAugmentedJQuery; (element: Element): IAugmentedJQuery; From 7dbb5b99ecef094b18c4051ef3b6c872e3acb22e Mon Sep 17 00:00:00 2001 From: John Reilly Date: Wed, 27 Aug 2014 14:12:40 +0100 Subject: [PATCH 079/537] AngularJS: JSDoc --- angularjs/angular.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 97cb279ed..084bea034 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -787,7 +787,7 @@ declare module ng { // DocumentService // see http://docs.angularjs.org/api/ng.$document /////////////////////////////////////////////////////////////////////////// - interface IDocumentService extends IAugmentedJQuery { } + interface IDocumentService extends IAugmentedJQuery {} /////////////////////////////////////////////////////////////////////////// // ExceptionHandlerService @@ -801,7 +801,7 @@ declare module ng { // RootElementService // see http://docs.angularjs.org/api/ng.$rootElement /////////////////////////////////////////////////////////////////////////// - interface IRootElementService extends JQuery { } + interface IRootElementService extends JQuery {} /** * $q - service in module ng @@ -1220,7 +1220,7 @@ declare module ng { // TemplateCacheService // see http://docs.angularjs.org/api/ng.$templateCache /////////////////////////////////////////////////////////////////////////// - interface ITemplateCacheService extends ICacheObject { } + interface ITemplateCacheService extends ICacheObject {} /////////////////////////////////////////////////////////////////////////// // SCEService From 508ec64e8e1f693c83fb3b6981045efdb66f24c7 Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Wed, 27 Aug 2014 20:28:18 +0100 Subject: [PATCH 080/537] Update smoothie charts definitions to version 1.25 of library. --- smoothie/smoothie.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/smoothie/smoothie.d.ts b/smoothie/smoothie.d.ts index 18f0cc0a5..714590f84 100644 --- a/smoothie/smoothie.d.ts +++ b/smoothie/smoothie.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Smoothie Charts 1.21 +// Type definitions for Smoothie Charts 1.25 // Project: https://github.com/joewalnes/smoothie // Definitions by: Drew Noakes , Mike H. Hawley // Definitions: https://github.com/borisyankov/DefinitelyTyped/smoothie @@ -41,6 +41,11 @@ declare module "smoothie" */ constructor(options?: ITimeSeriesOptions); + /** + * Clears all data and state from this TimeSeries object. + */ + clear(): void; + /** * Recalculate the min/max values for this TimeSeries object. * From c3df7fb18e89a0ba36c2457cef735f8e877cbd5a Mon Sep 17 00:00:00 2001 From: Brandon Luong Date: Wed, 27 Aug 2014 23:18:44 -0700 Subject: [PATCH 081/537] update stacklayout x y --- d3/d3.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index a451a0de5..e2bf337e4 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -1102,6 +1102,8 @@ declare module D3 { (layers: T[], index?: number): T[]; values(accessor?: (d: any) => any): StackLayout; offset(offset: string): StackLayout; + x(accessor: (d: any, i: number) => any): StackLayout; + y(accessor: (d: any, i: number) => any): StackLayout; } export interface TreeLayout { From 6375ea80400923fbfb7d1382b1d0d59efbea43e6 Mon Sep 17 00:00:00 2001 From: Biegal Date: Thu, 28 Aug 2014 20:51:56 +0200 Subject: [PATCH 082/537] Definitions for angular-spinner directive --- angular-spinner/angular-spinner-tests.ts | 12 +++++++++++ angular-spinner/angular-spinner.d.ts | 26 ++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 angular-spinner/angular-spinner-tests.ts create mode 100644 angular-spinner/angular-spinner.d.ts diff --git a/angular-spinner/angular-spinner-tests.ts b/angular-spinner/angular-spinner-tests.ts new file mode 100644 index 000000000..cb50a9c37 --- /dev/null +++ b/angular-spinner/angular-spinner-tests.ts @@ -0,0 +1,12 @@ +/// + +var myApp = angular.module('testModule'); + +module AngularSpinnerTest { + var app = angular.module("angularSpinnerTest", ["angular-spinner"]); + + app.config(['usSpinnerService', function(usSpinnerService: ISpinnerService) { + usSpinnerService.spin('key1'); + usSpinnerService.stop('key2'); + }]); +} diff --git a/angular-spinner/angular-spinner.d.ts b/angular-spinner/angular-spinner.d.ts new file mode 100644 index 000000000..99784d38f --- /dev/null +++ b/angular-spinner/angular-spinner.d.ts @@ -0,0 +1,26 @@ +// Type definitions for angular-spinner.js 0.5.1 +// Project: https://github.com/urish/angular-spinner +// Definitions by: Marcin Biegała +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +/** +* SpinnerService +* see https://github.com/urish/angular-spinner +*/ +interface ISpinnerService { + /** + * Start selected spinner + * + * @param spinner key + */ + spin(key: string): void; + + /** + * Stop selected spinner + * + * @param spinner key + */ + stop(key: string): void; +} From f462e9936494db8159755bb9361081c3686570b0 Mon Sep 17 00:00:00 2001 From: Kensuke Matsuzaki Date: Sun, 24 Aug 2014 16:35:57 +0900 Subject: [PATCH 083/537] Add emscripten --- CONTRIBUTORS.md | 1 + emscripten/emscripten-tests.ts | 69 ++++++++++++ emscripten/emscripten.d.ts | 185 +++++++++++++++++++++++++++++++++ 3 files changed, 255 insertions(+) create mode 100644 emscripten/emscripten-tests.ts create mode 100644 emscripten/emscripten.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 10ebf956d..93214257a 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -73,6 +73,7 @@ All definitions files include a header with the author and editors, so at some p * [Elm](http://elm-lang.org) (by [Dénes Harmath](https://github.com/thSoft)) * [ember.js](http://emberjs.com/) (by [Boris Yankov](https://github.com/borisyankov)) * [emissary](https://github.com/atom/emissary) (by [vvakame](https://github.com/vvakame)) +* [Emscripten](http://kripken.github.io/emscripten-site/) (by [Kensuke MATSUZAKI](https://github.com/zakki)) * [EpicEditor](http://epiceditor.com/) (by [Boris Yankov](https://github.com/borisyankov)) * [ES6-Promises](https://github.com/jakearchibald/ES6-Promises) (by [François de Campredon](https://github.com/fdecampredon/)) * [Esprima](http://esprima.org/) (by [Teppei Sato](https://github.com/teppeis)) diff --git a/emscripten/emscripten-tests.ts b/emscripten/emscripten-tests.ts new file mode 100644 index 000000000..2f3a2b09c --- /dev/null +++ b/emscripten/emscripten-tests.ts @@ -0,0 +1,69 @@ +/// + + +/// Module +function ModuleTest(): void { + Module.print = function(text) { alert('stdout: ' + text) }; + + var int_sqrt = Module.cwrap('int_sqrt', 'number', ['number']) + int_sqrt(12) + int_sqrt(28) + + var myTypedArray = new Uint8Array(10); + var buf = Module._malloc(myTypedArray.length*myTypedArray.BYTES_PER_ELEMENT); + Module.HEAPU8.set(myTypedArray, buf); + Module.ccall('my_function', 'number', ['number'], [buf]); + Module._free(buf); +} + +/// FS +function FSTest(): void { + FS.mkdir('/working'); + FS.mount(NODEFS, { root: '.' }, '/working'); + + function myAppStartup(): void { + FS.mkdir('/data'); + FS.mount(IDBFS, {}, '/data'); + + FS.syncfs(true, function (err) { + // handle callback + }); + } + + function myAppShutdown() { + FS.syncfs(function (err) { + // handle callback + }); + } + + var id = FS.makedev(64, 0); + FS.registerDevice(id, {}); + FS.mkdev('/dummy', id); + + FS.writeFile('file', 'foobar'); + FS.symlink('file', 'link'); + + FS.writeFile('/foobar.txt', 'Hello, world'); + FS.unlink('/foobar.txt'); + + FS.writeFile('file', 'foobar'); + FS.symlink('file', 'link'); + + FS.writeFile('forbidden', 'can\'t touch this'); + FS.chmod('forbidden', 0000); + + FS.writeFile('file', 'foobar'); + FS.truncate('file', 3); + + var stream = FS.open('abinaryfile', 'r'); + var buf = new Uint8Array(4); + FS.read(stream, buf, 0, 4, 0); + FS.close(stream); + + var data = new Uint8Array(32); + var stream = FS.open('dummy', 'w+'); + FS.write(stream, data, 0, data.length, 0); + FS.close(stream); + + var lookup = FS.lookupPath("path", { parent: true }); +} diff --git a/emscripten/emscripten.d.ts b/emscripten/emscripten.d.ts new file mode 100644 index 000000000..547f10c76 --- /dev/null +++ b/emscripten/emscripten.d.ts @@ -0,0 +1,185 @@ +// Type definitions for Emscripten +// Project: http://kripken.github.io/emscripten-site/index.html +// Definitions by: Kensuke Matsuzaki +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module Emscripten { + interface FileSystemType { + } +} + +declare module Module { + function print(str: string): void; + function printErr(str: string): void; + var arguments: string[]; + var preInit: { (): void }[]; + var preRun: { (): void }[]; + var postRun: { (): void }[]; + var noExitRuntime: boolean; + + var Runtime: any; + + function ccall(ident: string, returnType: string, argTypes: string[], args: any[]): any; + function cwrap(ident: string, returnType: string, argTypes: string[]): any; + + function setValue(ptr: number, value: any, type: string, noSafe: boolean): void; + function getValue(ptr: number, type: string, noSafe: boolean): any; + + var ALLOC_NORMAL: number; + var ALLOC_STACK: number; + var ALLOC_STATIC: number; + var ALLOC_DYNAMIC: number; + var ALLOC_NONE: number; + + function allocate(slab: any, types: string, allocator: number, ptr: number): number; + function allocate(slab: any, types: string[], allocator: number, ptr: number): number; + + function Pointer_stringify(ptr: number, length?: number): string; + function UTF16ToString(ptr: number): string; + function stringToUTF16(str: string, outPtr: number): void; + function UTF32ToString(ptr: number): string; + function stringToUTF32(str: string, outPtr: number): void; + + // USE_TYPED_ARRAYS == 1 + var HEAP: Int32Array; + var IHEAP: Int32Array; + var FHEAP: Float64Array; + + // USE_TYPED_ARRAYS == 2 + var HEAP8: Int8Array; + var HEAP16: Int16Array; + var HEAP32: Int32Array; + var HEAPU8: Uint8Array; + var HEAPU16: Uint16Array; + var HEAPU32: Uint32Array; + var HEAPF32: Float32Array; + var HEAPF64: Float64Array; + + var TOTAL_STACK: number; + var TOTAL_MEMORY: number; + var FAST_MEMORY: number; + + function addOnPreRun(cb: () => any): void; + function addOnInit(cb: () => any): void; + function addOnPreMain(cb: () => any): void; + function addOnExit(cb: () => any): void; + function addOnPostRun(cb: () => any): void; + + // Tools + function intArrayFromString(stringy: string, dontAddNull?: boolean, length?: number): number[]; + function intArrayToString(array: number[]): string; + function writeStringToMemory(str: string, buffer: number, dontAddNull: boolean): void; + function writeArrayToMemory(array: number[], buffer: number): void; + function writeAsciiToMemory(str: string, buffer: number, dontAddNull: boolean): void; + + function addRunDependency(id: any): void; + function removeRunDependency(id: any): void; + + + var preloadedImages: any; + var preloadedAudios: any; + + function _malloc(size: number): number; + function _free(ptr: number): void; +} + +declare module FS { + interface Lookup { + path: string; + node: FSNode; + } + + interface FSStream {} + interface FSNode {} + interface ErrnoError {} + + var ignorePermissions: boolean; + var trackingDelegate: any; + var tracking: any; + var genericErrors: any; + + // + // paths + // + function lookupPath(path: string, opts: any): Lookup; + function getPath(node: FSNode): string; + + // + // nodes + // + function isFile(mode: number): boolean; + function isDir(mode: number): boolean; + function isLink(mode: number): boolean; + function isChrdev(mode: number): boolean; + function isBlkdev(mode: number): boolean; + function isFIFO(mode: number): boolean; + function isSocket(mode: number): boolean; + + // + // devices + // + function major(dev: number): number; + function minor(dev: number): number; + function makedev(ma: number, mi: number): number; + function registerDevice(dev: number, ops: any): void; + + // + // core + // + function syncfs(populate: boolean, callback: (e: any) => any): void; + function syncfs( callback: (e: any) => any, populate?: boolean): void; + function mount(type: Emscripten.FileSystemType, opts: any, mountpoint: string): any; + function unmount(mountpoint: string): void; + + function mkdir(path: string, mode?: number): any; + function mkdev(path: string, mode?: number, dev?: number): any; + function symlink(oldpath: string, newpath: string): any; + function rename(old_path: string, new_path: string): void; + function rmdir(path: string): void; + function readdir(path: string): any; + function unlink(path: string): void; + function readlink(path: string): string; + function stat(path: string, dontFollow?: boolean): any; + function lstat(path: string): any; + function chmod(path: string, mode: number, dontFollow?: boolean): void; + function lchmod(path: string, mode: number): void; + function fchmod(fd: number, mode: number): void; + function chown(path: string, uid: number, gid: number, dontFollow?: boolean): void; + function lchown(path: string, uid: number, gid: number): void; + function fchown(fd: number, uid: number, gid: number): void; + function truncate(path: string, len: number): void; + function ftruncate(fd: number, len: number): void; + function utime(path: string, atime: number, mtime: number): void; + function open(path: string, flags: string, mode?: number, fd_start?: number, fd_end?: number): FSStream; + function close(stream: FSStream): void; + function llseek(stream: FSStream, offset: number, whence: number): any; + function read(stream: FSStream, buffer: ArrayBufferView, offset: number, length: number, position?: number): number; + function write(stream: FSStream, buffer: ArrayBufferView, offset: number, length: number, position?: number, canOwn?: boolean): number; + function allocate(stream: FSStream, offset: number, length: number): void; + function mmap(stream: FSStream, buffer: ArrayBufferView, offset: number, length: number, position: number, prot: number, flags: number): any; + function ioctl(stream: FSStream, cmd: any, arg: any): any; + function readFile(path: string, opts?: {encoding: string; flags: string}): any; + function writeFile(path: string, data: ArrayBufferView, opts?: {encoding: string; flags: string}): void; + function writeFile(path: string, data: string, opts?: {encoding: string; flags: string}): void; + + // + // module-level FS code + // + function cwd(): string; + function chdir(path: string): void; + function init(input: () => number, output: (c: number) => any, error: (c: number) => any): void; + + function createLazyFile(parent: string, name: string, url: string, canRead: boolean, canWrite: boolean): FSNode; + function createLazyFile(parent: FSNode, name: string, url: string, canRead: boolean, canWrite: boolean): FSNode; + + function createPreloadedFile(parent: string, name: string, url: string, canRead: boolean, canWrite: boolean, onload?: ()=> void, onerror?: ()=>void, dontCreateFile?:boolean, canOwn?: boolean): void; + function createPreloadedFile(parent: FSNode, name: string, url: string, canRead: boolean, canWrite: boolean, onload?: ()=> void, onerror?: ()=>void, dontCreateFile?:boolean, canOwn?: boolean): void; +} + +declare var MEMFS: Emscripten.FileSystemType; +declare var NODEFS: Emscripten.FileSystemType; +declare var IDBFS: Emscripten.FileSystemType; + +interface Math { + imul(a: number, b: number): number; +} From 173f4b08417bc987585e8c4d326e0d504365428b Mon Sep 17 00:00:00 2001 From: Kon P Date: Thu, 28 Aug 2014 22:02:03 -0700 Subject: [PATCH 084/537] updated bootboxjs and tests --- bootbox/bootbox-tests.ts | 94 +++++++++++++++++++--------------------- bootbox/bootbox.d.ts | 81 ++++++++++++++++++++-------------- 2 files changed, 92 insertions(+), 83 deletions(-) diff --git a/bootbox/bootbox-tests.ts b/bootbox/bootbox-tests.ts index 66922ab2e..189c26209 100644 --- a/bootbox/bootbox-tests.ts +++ b/bootbox/bootbox-tests.ts @@ -2,73 +2,67 @@ /// bootbox.alert("Are we ok?"); -bootbox.alert("Are we ok with Test button?", "Test"); -bootbox.alert("Are we ok with callback?", function() { +bootbox.alert("Are we ok with callback?", function () { console.log("Callback called!"); }); -bootbox.alert("Are we ok with callback and custom button?", "Test", function() { - console.log("Callback called!"); +bootbox.alert({ + message: "Are we ok with callback and custom button?", + callback: function () { + console.log("Callback called!"); + } }); -bootbox.confirm("Click ok to pass test", function(result) { - console.log(result); -}); +bootbox.confirm("Click ok to pass test"); -bootbox.confirm("Click cancel to pass test", function(result) { +bootbox.confirm("Click cancel to pass test", function (result) { console.log(!result); }); - -bootbox.confirm("Click confirm to pass test", "Cancel?", "Confirm?", function(result) { - console.log(result); -}); - -bootbox.confirm("Click cancel to pass test", "Cancel?", "Confirm?", function(result) { - console.log(!result); +bootbox.confirm({ + message: "Click confirm to pass test", + callback: function (result) { + console.log(result); + } }); bootbox.prompt("Are we ok?"); - -bootbox.prompt("Enter 'ok' to pass test", function(result) { +bootbox.prompt("Enter 'ok' to pass test", function (result) { console.log(result); }); - -bootbox.prompt("Enter 'ok' to pass test", "Cancel?", "Confirm?", function(result) { - console.log(result); +bootbox.prompt({ + message: "Enter 'ok' to pass test", callback: function (result) { + console.log(result); + } }); -bootbox.prompt("Keep default value and click ok", "Cancel?", "Confirm?", function(result) { - console.log(result); -}, "Test Value"); - bootbox.dialog("Test Dialog"); -var handler = { - label: "OK", - class: "MyClass", + + +bootbox.dialog("Test Dialog", function (result) { + return result; +}); + +bootbox.dialog({ + message: "Test Dialog", + callback: function (result) { } +}); + +var bdo: BootboxDialogOptions; +var sampleButton: BootboxButton = { + label: 'ButtonLabelToUse', callback: function () { - console.log("Test Dialog"); + return 'callback of button click' + }, + className: 'additionalButtonClassName' +}; + +bdo = { + message: '', + className: 'callName', + buttons: { + 'ButtonTextLabel': sampleButton } }; -var option = { - header: "header", - headerCloseButton: true -}; +bootbox.dialog(bdo); -bootbox.dialog("Test Dialog", handler); -bootbox.dialog("Test Dialog", [handler], option); - -bootbox.hideAll(); -bootbox.animate(false); -bootbox.backdrop("backdrop"); -bootbox.classes("myClass"); - -var icons: BootboxIcons = { - OK: "OK Icon", - CANCEL: "Cancel Icon", - CONFIRM: "Confirm Icon" -}; -bootbox.setIcons(icons); - -bootbox.setLocale("en"); - -bootbox.addLocale("klingon", { OK: "luq", CANCEL: "qIl", CONFIRM: "Confirm" }); \ No newline at end of file +bootbox.hideAll(); \ No newline at end of file diff --git a/bootbox/bootbox.d.ts b/bootbox/bootbox.d.ts index 17732b603..fd0ce06d8 100644 --- a/bootbox/bootbox.d.ts +++ b/bootbox/bootbox.d.ts @@ -1,48 +1,63 @@ -// Type definitions for Bootbox 3.0.0 +// Type definitions for Bootbox 4.0.0 // Project: https://github.com/makeusabrew/bootbox -// Definitions by: Vincent Bortone +// Definitions by: Kon Pik // Definitions: https://github.com/borisyankov/DefinitelyTyped -interface BootboxLocale { - OK: string; - CANCEL: string; - CONFIRM: string; + +interface BootboxAlertOptions { + message: string; + callback?: () => any; } -interface BootboxIcons { - OK: any; - CANCEL: any; - CONFIRM: any; +interface BootboxConfirmOptions { + message: string; + callback?: (result: boolean) => any; } -interface BootboxHandler { - label: string; - class: string; - callback: (result?: any) => void; +interface BootboxPromptOptions { + message: string; + callback?: (result: string) => any; } -interface BootboxOption { - header: string; - headerCloseButton: boolean; +interface BootboxButton { + label?: string; + className?: string; + callback?: () => any; +} + +interface BootboxDialogOptions { + message: any; // String | Element + title?: any; // String | Element + callback?: (result: boolean) => any; + show?: boolean; + onEscape?: () => any; + backdrop?: boolean; + closeButton?: boolean; + animate?: boolean; + className?: string; + buttons?: Object; // complex object where each key is of type BootboxButton +} + +interface BootboxDefaultOptions { + locale?: string; + show?: boolean; + backdrop?: boolean; + closeButton: boolean; + animate?: boolean; + className?: string; } interface BootboxStatic { - alert(message: string, callback: () => void): void; - alert(message: string, customButtonText?: string, callback?: () => void): void; - confirm(message: string, callback: (result: boolean) => void): void; - confirm(message: string, cancelButtonText?: string, confirmButtonText?: string, callback?: (result: boolean) => void): void; - prompt(message: string, callback: (result: string) => void, defaultValue?: string): void; - prompt(message: string, cancelButtonText?: string, confirmButtonText?: string, callback?: (result: string) => void, defaultValue?: string): void; - dialog(message: string, handlers: BootboxHandler[], options?: any): void; - dialog(message: string, handler: BootboxHandler): void; - dialog(message: string): void; + alert(message: string, callback?: () => void): void; + alert(options: BootboxAlertOptions): void; + confirm(message: string, callback?: (result: boolean) => void): void; + confirm(options: BootboxConfirmOptions): void; + prompt(message: string, callback?: (result: string) => void): void; + prompt(options: BootboxPromptOptions): void; + dialog(message: string, callback?: (result: string) => void): void; + dialog(options: BootboxDialogOptions): void; + setDefaults(options): void; hideAll(): void; - animate(shouldAnimate: boolean): void; - backdrop(backdropValue: string): void; - classes(customCssClasses: string): void; - setIcons(icons: BootboxIcons): void; - setLocale(localeName: string): void; - addLocale(localeName: string, translations: BootboxLocale) : void; } -declare var bootbox : BootboxStatic; \ No newline at end of file +declare var bootbox: BootboxStatic; \ No newline at end of file From 99e5a01f09a3ef163e0aa2acda692d0ddaa95a3f Mon Sep 17 00:00:00 2001 From: Kon P Date: Thu, 28 Aug 2014 22:26:00 -0700 Subject: [PATCH 085/537] fixed setOptions & tests --- bootbox/bootbox-tests.ts | 9 +++++++++ bootbox/bootbox.d.ts | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bootbox/bootbox-tests.ts b/bootbox/bootbox-tests.ts index 189c26209..7cf6124cd 100644 --- a/bootbox/bootbox-tests.ts +++ b/bootbox/bootbox-tests.ts @@ -65,4 +65,13 @@ bdo = { bootbox.dialog(bdo); +bootbox.setDefaults({ + locale: 'en_US', + animate: false, + backdrop: false, + className: 'newClassName', + closeButton: true, + show: true +}) + bootbox.hideAll(); \ No newline at end of file diff --git a/bootbox/bootbox.d.ts b/bootbox/bootbox.d.ts index fd0ce06d8..173e3a2a7 100644 --- a/bootbox/bootbox.d.ts +++ b/bootbox/bootbox.d.ts @@ -42,7 +42,7 @@ interface BootboxDefaultOptions { locale?: string; show?: boolean; backdrop?: boolean; - closeButton: boolean; + closeButton?: boolean; animate?: boolean; className?: string; } @@ -56,7 +56,7 @@ interface BootboxStatic { prompt(options: BootboxPromptOptions): void; dialog(message: string, callback?: (result: string) => void): void; dialog(options: BootboxDialogOptions): void; - setDefaults(options): void; + setDefaults(options: BootboxDefaultOptions): void; hideAll(): void; } From 2c861a8a1dfa46fc962b4124036b83a580e85f28 Mon Sep 17 00:00:00 2001 From: cristian-harja Date: Fri, 29 Aug 2014 10:38:29 +0200 Subject: [PATCH 086/537] Silly mistake in pull request #2643 --- q/Q.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/q/Q.d.ts b/q/Q.d.ts index c7c294a1f..1352115e3 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -104,7 +104,7 @@ declare module Q { /** * If callback is a function, assumes it's a Node.js-style callback, and calls it as either callback(rejectionReason) when/if promise becomes rejected, or as callback(null, fulfillmentValue) when/if promise becomes fulfilled. If callback is not a function, simply returns promise. */ - nodeify(callback: (reason: any, value: any) => void): void; + nodeify(callback: (reason: any, value: any) => void): Promise; /** * Returns a promise to get the named property of an object. Essentially equivalent to From 2b4eb035ffad1fe950ad008e72784f870279071c Mon Sep 17 00:00:00 2001 From: HowardRichards Date: Fri, 29 Aug 2014 14:02:20 +0100 Subject: [PATCH 087/537] Knockout: amended components.register to overloads supported by 3.2 KO Version 3.2 added components. The .register method in the current code is incorrect and does not support the correct overloads permitted. --- knockout/knockout.d.ts | 52 +++++++++++++++++++++++++++++++- knockout/tests/knockout-tests.ts | 45 +++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index 48f550dfe..494b6f844 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -556,7 +556,13 @@ interface KnockoutBindingProvider { } interface KnockoutComponents { - register(componentName: string, definition: KnockoutComponentDefinition): void; + // overloads for register method: + register(componentName: string, config: KnockoutComponentRegister): void; + register(componentName: string, config: KnockoutComponentRegisterStringTemplate): void; + register(componentName: string, config: KnockoutComponentRegisterFnViewModel): void; + register(componentName: string, config: KnockoutComponentRegisterStringTemplateFnViewModel): void; + register(componentName: string, config: KnockoutComponentRegisterAMD): void; + isRegistered(componentName: string): boolean; unregister(componentName: string): void; get(componentName: string, callback: (definition: KnockoutComponentDefinition) => void): void; @@ -566,6 +572,50 @@ interface KnockoutComponents { getComponentNameForNode(node: Node): string; } +/* interfaces for register overloads*/ + +interface KnockoutComponentRegister { + template: KnockoutComponentTemplate; + viewModel?: KnockoutComponentConfigViewModel; +} + +interface KnockoutComponentRegisterAMD { + // load self-describing module using AMD module name + require: string; +} + +interface KnockoutComponentRegisterFnViewModel { + template: KnockoutComponentTemplate; + viewModel?: (params: any) => any; +} + +interface KnockoutComponentRegisterStringTemplate { + template: string; + viewModel?: KnockoutComponentConfigViewModel; +} + +interface KnockoutComponentRegisterStringTemplateFnViewModel { + template: string; + viewModel?: (params: any) => any; +} + +interface KnockoutComponentConfigViewModel { + instance?: any; + createViewModel? (params?: any, componentInfo?: KnockoutComponentInfo): any; + require?: string; +} + +interface KnockoutComponentTemplate { + // specify element id (string) or a node + element?: any; + // AMD module load + require?: string; +} + +interface KnockoutComponentInfo { + element: any; +} +/* end register overloads */ interface KnockoutComponentDefinition { template: Node[]; createViewModel?(params: any, options: { element: Node; }): any; diff --git a/knockout/tests/knockout-tests.ts b/knockout/tests/knockout-tests.ts index 6d4c9e25d..82b5aa25c 100644 --- a/knockout/tests/knockout-tests.ts +++ b/knockout/tests/knockout-tests.ts @@ -602,4 +602,49 @@ function test_allBindingsAccessor() { var fnAccessorBinding = allBindingsAccessor().myBindingName; } }; +} + +function test_Components() { + + function test_Register() { + // test all possible ko.components.register() overloads + var nodeArray = [new Node, new Node]; + var singleNode = new Node; + + // ------- string-templates with different viewmodel overloads: + + // string template and inline function (commonly used in examples) + ko.components.register("name", { template: "string-template", viewModel: function (params) { return null; } }); + + // string template and instance vm + ko.components.register("name", { template: "string-template", viewModel: { instance: null } }); + + // string template and createViewModel factory method + ko.components.register("name", { template: "string-template", viewModel: { createViewModel: function (params: any, componentInfo: KnockoutComponentInfo) { return null; } } }); + + // string template and require module vm + ko.components.register("name", { template: "string-template", viewModel: { require: "module" } }); + + // ------- non-string templates + + // viewmodel as function and four types of template + ko.components.register("name", { template: { element: "elementID" }, viewModel: function (params) { return null; } }); + // Node template for element and inline function (commonly used in examples) + ko.components.register("name", { template: { element: singleNode }, viewModel: function (params) { return null; } }); + // object template for element and inline function (commonly used in examples) + ko.components.register("name", { template: nodeArray, viewModel: function (params) { return null; } }); + // object template for element and inline function (commonly used in examples) + ko.components.register("name", { template: { require: "module" }, viewModel: function (params) { return null; } }); + + // viewmodel as object, and four types of non-string tempalte + ko.components.register("name", { template: { element: "elementID" }, viewModel: { instance: null } }); + // Node template for element and inline function (commonly used in examples) + ko.components.register("name", { template: { element: singleNode }, viewModel: { instance: null } }); + // object template for element and inline function (commonly used in examples) + ko.components.register("name", { template: nodeArray, viewModel: { instance: null } }); + // object template for element and inline function (commonly used in examples) + ko.components.register("name", { template: { require: "module" }, viewModel: { instance: null } }); + + // + } } \ No newline at end of file From 7878659ee9875b6b2ed49509b262bd63a84ca0eb Mon Sep 17 00:00:00 2001 From: HowardRichards Date: Fri, 29 Aug 2014 14:22:34 +0100 Subject: [PATCH 088/537] Fixed valerie.d.ts re-added missing reference for knockout --- valerie/valerie.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/valerie/valerie.d.ts b/valerie/valerie.d.ts index 1514f3a4d..d22227ecc 100644 --- a/valerie/valerie.d.ts +++ b/valerie/valerie.d.ts @@ -1,9 +1,10 @@ + // Type definitions for valerie // Project: https://github.com/davewatts/valerie // Definitions by: Howard Richards // Definitions: https://github.com/borisyankov/DefinitelyTyped - +/// /** * From 5b4566963904b30f0e09a638f0ec128896d04e80 Mon Sep 17 00:00:00 2001 From: Howard Richards Date: Fri, 29 Aug 2014 14:28:38 +0100 Subject: [PATCH 089/537] Removed blank line 1 --- valerie/valerie.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/valerie/valerie.d.ts b/valerie/valerie.d.ts index d22227ecc..8e9d12988 100644 --- a/valerie/valerie.d.ts +++ b/valerie/valerie.d.ts @@ -1,4 +1,3 @@ - // Type definitions for valerie // Project: https://github.com/davewatts/valerie // Definitions by: Howard Richards @@ -725,4 +724,4 @@ declare module Valerie.Rules { Todo: add classes in valerie.rules namespace */ -} \ No newline at end of file +} From dade09fe9d0b5205c4c2f5de9f185f64e59c701c Mon Sep 17 00:00:00 2001 From: HowardRichards Date: Fri, 29 Aug 2014 14:33:47 +0100 Subject: [PATCH 090/537] added any to options type Fixed failing run --- valerie/valerie.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/valerie/valerie.d.ts b/valerie/valerie.d.ts index 8e9d12988..abe5aea28 100644 --- a/valerie/valerie.d.ts +++ b/valerie/valerie.d.ts @@ -316,7 +316,7 @@ declare module Valerie { // - either parameter can be omitted and a clone of the other parameter will be returned // - the merge is shallow // - array properties are shallow cloned - mergeOptions(defaultOptions: ValidationOptions, options): ValidationOptions; + mergeOptions(defaultOptions: ValidationOptions, options:any): ValidationOptions; } From f1d96e63ce3e8070502c5f62e134cbac5b404476 Mon Sep 17 00:00:00 2001 From: Biegal Date: Fri, 29 Aug 2014 18:11:44 +0200 Subject: [PATCH 091/537] Updated CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index bb0933af5..4e5dddb6c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -13,6 +13,7 @@ All definitions files include a header with the author and editors, so at some p * [AngularFire](https://www.firebase.com/docs/angular/reference.html) (by [Dénes Harmath](https://github.com/thSoft)) * [AngularJS](http://angularjs.org) (by [Diego Vilar](https://github.com/diegovilar)) ([wiki](https://github.com/borisyankov/DefinitelyTyped/wiki/AngularJS-Definitions-Usage-Notes)) * [angularLocalStorage](https://github.com/agrublev/angularLocalStorage) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) +* [angular-spinner](https://github.com/urish/angular-spinner) (by [Marcin Biegała](https://github.com/Biegal)) * [AngularUI](http://angular-ui.github.io/) (by [Michel Salib](https://github.com/michelsalib)) * [Angular Hotkeys](https://github.com/chieffancypants/angular-hotkeys/) (by [Jason Zhao](https://github.com/jlz27)) * [Angular Protractor](https://github.com/angular/protractor) (by [Bill Armstrong](https://github.com/BillArmstrong)) From ddfdf46397b3894ef98a70b4de1bbccbf39a381b Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Sat, 30 Aug 2014 10:22:37 +0900 Subject: [PATCH 092/537] Add md5 --- md5/md5-test.ts | 9 +++++++++ md5/md5.d.ts | 11 +++++++++++ 2 files changed, 20 insertions(+) create mode 100644 md5/md5-test.ts create mode 100644 md5/md5.d.ts diff --git a/md5/md5-test.ts b/md5/md5-test.ts new file mode 100644 index 000000000..036ad9c2a --- /dev/null +++ b/md5/md5-test.ts @@ -0,0 +1,9 @@ +/// + +var hash: string; +hash = CybozuLabs.MD5.calc("abc"); +hash = CybozuLabs.MD5.calc("abc", CybozuLabs.MD5.BY_ASCII); +hash = CybozuLabs.MD5.calc("abc", CybozuLabs.MD5.BY_UTF16); + +var version: string; +version = CybozuLabs.MD5.VERSION; \ No newline at end of file diff --git a/md5/md5.d.ts b/md5/md5.d.ts new file mode 100644 index 000000000..207a30699 --- /dev/null +++ b/md5/md5.d.ts @@ -0,0 +1,11 @@ +// Type definitions for CybozuLabs.MD5 +// Project: http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html +// Definitions by: MIZUNE Pine +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module CybozuLabs.MD5 { + var VERSION: string; + var BY_ASCII: number; + var BY_UTF16: number; + function calc(str: string, option?: number): string; +} \ No newline at end of file From 1f44589a3acbcdf697ac3ace6c57fef03c156500 Mon Sep 17 00:00:00 2001 From: satoru kimura Date: Sat, 30 Aug 2014 17:47:16 +0900 Subject: [PATCH 093/537] Added definitions for Physijs. --- CONTRIBUTORS.md | 1 + physijs/physijs-tests.ts | 15 ++ physijs/physijs-tests.ts.tscparams | 2 + physijs/physijs.d.ts | 250 ++++++++++++++++++++++++++ physijs/tests/body.ts | 160 +++++++++++++++++ physijs/tests/collisions.ts | 171 ++++++++++++++++++ physijs/tests/compound.ts | 238 +++++++++++++++++++++++++ physijs/tests/constraints_car.ts | 257 +++++++++++++++++++++++++++ physijs/tests/heightfield.ts | 189 ++++++++++++++++++++ physijs/tests/jenga.ts | 236 ++++++++++++++++++++++++ physijs/tests/memorytest-compound.ts | 171 ++++++++++++++++++ physijs/tests/memorytest-convex.ts | 164 +++++++++++++++++ physijs/tests/memorytest.ts | 164 +++++++++++++++++ physijs/tests/shapes.ts | 238 +++++++++++++++++++++++++ physijs/tests/vehicle.ts | 254 ++++++++++++++++++++++++++ 15 files changed, 2510 insertions(+) create mode 100644 physijs/physijs-tests.ts create mode 100644 physijs/physijs-tests.ts.tscparams create mode 100644 physijs/physijs.d.ts create mode 100644 physijs/tests/body.ts create mode 100644 physijs/tests/collisions.ts create mode 100644 physijs/tests/compound.ts create mode 100644 physijs/tests/constraints_car.ts create mode 100644 physijs/tests/heightfield.ts create mode 100644 physijs/tests/jenga.ts create mode 100644 physijs/tests/memorytest-compound.ts create mode 100644 physijs/tests/memorytest-convex.ts create mode 100644 physijs/tests/memorytest.ts create mode 100644 physijs/tests/shapes.ts create mode 100644 physijs/tests/vehicle.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index fda65cb32..a2a7e5e49 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -290,6 +290,7 @@ All definitions files include a header with the author and editors, so at some p * [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto)) * [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker)) * [PhoneGap](http://phonegap.com) (by [Boris Yankov](https://github.com/borisyankov)) +* [Physijs](http://chandlerprall.github.io/Physijs/) (by [gyoh_k](https://github.com/gyohk)) * [PixiJS](https://github.com/GoodBoyDigital/pixi.js) (by [Pedro Casaubon](https://github.com/xperiments)) * [Platform](https://github.com/bestiejs/platform.js) (by [Jake Hickman](https://github.com/JakeH)) * [PouchDB](http://pouchdb.com) (by [Bill Sears](https://github.com/MrBigDog2U/)) diff --git a/physijs/physijs-tests.ts b/physijs/physijs-tests.ts new file mode 100644 index 000000000..35591c12d --- /dev/null +++ b/physijs/physijs-tests.ts @@ -0,0 +1,15 @@ +///////////////////////////////////////////////////////////// +// https://github.com/chandlerprall/Physijs/tree/master/examples +////////////////////////////////////////////////////////////// + +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// diff --git a/physijs/physijs-tests.ts.tscparams b/physijs/physijs-tests.ts.tscparams new file mode 100644 index 000000000..3b6942a9d --- /dev/null +++ b/physijs/physijs-tests.ts.tscparams @@ -0,0 +1,2 @@ +"" + diff --git a/physijs/physijs.d.ts b/physijs/physijs.d.ts new file mode 100644 index 000000000..8a63b5ad4 --- /dev/null +++ b/physijs/physijs.d.ts @@ -0,0 +1,250 @@ +// Type definitions for Physijs +// Project: http://chandlerprall.github.io/Physijs/ +// Definitions by: Satoru Kimura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// + +declare module Physijs { + export function noConflict():Object; + export function createMaterial(material: THREE.Material, friction?: number, restitution?: number): Material; + + export interface Material extends THREE.Material{ + _physijs: { + id: number; + friction: number; + restriction: number + }; + } + + export interface Constraint { + getDefinition(): any; + } + + export interface PointConstraintDefinition { + type: string; + id: number; + objecta: THREE.Object3D; + objectb: THREE.Object3D; + positiona: THREE.Vector3; + positionb: THREE.Vector3; + } + + export class PointConstraint implements Constraint { + constructor(objecta: THREE.Object3D, objectb: THREE.Object3D, position?: THREE.Vector3); + + getDefinition(): PointConstraintDefinition; + } + + export interface HingeConstraintDefinition { + type: string; + id: number; + objecta: THREE.Object3D; + objectb: THREE.Object3D; + positiona: THREE.Vector3; + positionb: THREE.Vector3; + axis: THREE.Vector3; + } + + export class HingeConstraint implements Constraint { + constructor(objecta: THREE.Object3D, objectb: THREE.Object3D, position: THREE.Vector3, axis?: THREE.Vector3); + + getDefinition(): HingeConstraintDefinition; + setLimits( low: number, high: number, bias_factor: number, relaxation_factor: number ): void; + enableAngularMotor( velocity: number, acceleration: number ): void; + disableMotor(): void; + } + + export interface SliderConstraintDefinition { + type: string; + id: number; + objecta: THREE.Object3D; + objectb: THREE.Object3D; + positiona: THREE.Vector3; + positionb: THREE.Vector3; + axis: THREE.Vector3; + } + + export class SliderConstraint implements Constraint { + constructor(objecta: THREE.Object3D, objectb: THREE.Object3D, position: THREE.Vector3, axis?: THREE.Vector3); + + getDefinition(): SliderConstraintDefinition; + setLimits( lin_lower: number, lin_upper: number, ang_lower: number, ang_upper: number ): void; + setRestitution( linear: number, angular: number ): void; + enableLinearMotor( velocity: number, acceleration: number): void; + disableLinearMotor(): void; + enableAngularMotor( velocity: number, acceleration: number ): void; + disableAngularMotor(): void; + } + + export interface ConeTwistConstraintDefinition { + type: string; + id: number; + objecta: THREE.Object3D; + objectb: THREE.Object3D; + positiona: THREE.Vector3; + positionb: THREE.Vector3; + axisa: THREE.Vector3; + axisb: THREE.Vector3; + } + + export class ConeTwistConstraint implements Constraint { + constructor(objecta: THREE.Object3D, objectb: THREE.Object3D, position: THREE.Vector3); + + getDefinition(): ConeTwistConstraintDefinition; + setLimit( x: number, y: number, z: number ): void; + enableMotor(): void; + setMaxMotorImpulse( max_impulse: number ): void; + setMotorTarget( target: THREE.Vector3 ): void; + setMotorTarget( target: THREE.Euler ): void; + setMotorTarget( target: THREE.Matrix4 ): void; + disableMotor(): void; + + } + + export interface DOFConstraintDefinition { + type: string; + id: number; + objecta: THREE.Object3D; + objectb: THREE.Object3D; + positiona: THREE.Vector3; + positionb: THREE.Vector3; + axisa: THREE.Vector3; + axisb: THREE.Vector3; + } + + export class DOFConstraint implements Constraint { + constructor(objecta: THREE.Object3D, objectb: THREE.Object3D, position?: THREE.Vector3); + + getDefinition(): DOFConstraintDefinition; + setLinearLowerLimit(limit: THREE.Vector3): void; + setLinearUpperLimit(limit: THREE.Vector3): void; + setAngularLowerLimit(limit: THREE.Vector3): void; + setAngularUpperLimit(limit: THREE.Vector3): void; + enableAngularMotor( which: number ): void; + configureAngularMotor( which: number, low_angle: number, high_angle: number, velocity: number, max_force: number ): void; + disableAngularMotor( which: number ): void; + } + export var scripts: { + worker: string; + ammo: string; + }; + + export interface SceneParameters { + ammo?: string; + fixedTimeStep?: number; + rateLimit?: boolean; + } + + export class Scene extends THREE.Scene { + constructor(param?: SceneParameters); + + addConstraint(constraint:Constraint, show_marker?:boolean):void; + onSimulationResume():void; + removeConstraint(constraint:Constraint):void; + execute(cmd:string, params:any):void; + add(object:THREE.Object3D):void; + remove(object:THREE.Object3D):void; + setFixedTimeStep(fixedTimeStep:number):void; + setGravity(gravity:number):void; + simulate(timeStep?:number, maxSubSteps?:number):boolean; + + + // Eventable mixins + addEventListener( event_name: string, callback: (event: any) => void ): void; + removeEventListener( event_name: string, callback: (event: any) => void): void; + dispatchEvent( event_name: string ): void; + + // (extends from Object3D) + dispatchEvent( event: { type: string; target: any; } ): void; + } + + export class Mesh extends THREE.Mesh { + constructor(geometry:THREE.Geometry, material?:THREE.Material, mass?:number); + + applyCentralImpulse(force:THREE.Vector3):void; + applyImpulse(force:THREE.Vector3, offset:THREE.Vector3):void; + applyCentralForce(force:THREE.Vector3):void; + applyForce(force:THREE.Vector3, offset:THREE.Vector3):void; + getAngularVelocity():THREE.Vector3; + setAngularVelocity(velocity:THREE.Vector3):void; + getLinearVelocity():THREE.Vector3; + setLinearVelocity(velocity:THREE.Vector3):void; + setAngularFactor(factor:THREE.Vector3):void; + setLinearFactor(factor:THREE.Vector3):void; + setDamping(linear:number, angular:number):void; + setCcdMotionThreshold(threshold:number):void; + setCcdSweptSphereRadius(radius:number):void; + + + // Eventable mixins + addEventListener( event_name: string, callback: (event: any) => void ): void; + removeEventListener( event_name: string, callback: (event: any) => void): void; + dispatchEvent( event_name: string ): void; + + // (extends from Object3D) + dispatchEvent( event: { type: string; target: any; } ): void; + } + + export class PlaneMesh extends Mesh { + constructor(geometry:THREE.Geometry, material:THREE.Material, mass?:number); + + } + + export class HeightfieldMesh extends Mesh { + constructor(geometry:THREE.Geometry, material:THREE.Material, mass?:number, xdiv?:number, ydiv?:number); + } + + export class BoxMesh extends Mesh { + constructor(geometry:THREE.Geometry, material:THREE.Material, mass?:number); + } + + export class SphereMesh extends Mesh { + constructor(geometry:THREE.Geometry, material:THREE.Material, mass?:number); + } + + export class CylinderMesh extends Mesh { + constructor(geometry:THREE.Geometry, material:THREE.Material, mass?:number); + } + + export class CapsuleMesh extends Mesh { + constructor(geometry:THREE.Geometry, material:THREE.Material, mass?:number); + } + + export class ConeMesh extends Mesh { + constructor(geometry:THREE.Geometry, material:THREE.Material, mass?:number); + } + + export class ConcaveMesh extends Mesh { + constructor(geometry:THREE.Geometry, material:THREE.Material, mass?:number); + } + + export class ConvexMesh extends Mesh { + constructor(geometry:THREE.Geometry, material:THREE.Material, mass?:number); + } + + export class Vehicle { + constructor(mesh:Mesh, tuning?:VehicleTuning); + + mesh:THREE.Mesh; + wheels:THREE.Mesh[]; + + addWheel(wheel_geometry:THREE.Geometry, wheel_material:THREE.Material, connection_point:THREE.Vector3, wheel_direction:THREE.Vector3, wheel_axle:THREE.Vector3, suspension_rest_length:number, wheel_radius:number, is_front_wheel:boolean, tuning?:VehicleTuning): void; + setSteering(amount: number, wheel?: THREE.Mesh): void; + setBrake(amount: number, wheel?: THREE.Mesh): void; + applyEngineForce(amount: number, wheel?: THREE.Mesh): void; + } + + export class VehicleTuning { + constructor(suspension_stiffness?:number, suspension_compression?:number, suspension_damping?:number, max_suspension_travel?:number, friction_slip?:number, max_suspension_force?:number); + + suspension_stiffness:number; + suspension_compression:number; + suspension_damping:number; + max_suspension_travel:number; + friction_slip:number; + max_suspension_force:number; + } +} + diff --git a/physijs/tests/body.ts b/physijs/tests/body.ts new file mode 100644 index 000000000..acf9df500 --- /dev/null +++ b/physijs/tests/body.ts @@ -0,0 +1,160 @@ +/// +/// + + +Physijs.scripts.worker = '../physijs_worker.js'; +Physijs.scripts.ammo = 'examples/js/ammo.js'; + +var initScene, render, applyForce, setMousePosition, mouse_position, + ground_material, box_material, + projector, renderer, render_stats, physics_stats, scene, ground, light, camera, box, boxes = []; + +initScene = function() { + projector = new THREE.Projector; + + renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.shadowMapEnabled = true; + renderer.shadowMapSoft = true; + document.getElementById( 'viewport' ).appendChild( renderer.domElement ); + + render_stats = new Stats(); + render_stats.domElement.style.position = 'absolute'; + render_stats.domElement.style.top = '1px'; + render_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( render_stats.domElement ); + + physics_stats = new Stats(); + physics_stats.domElement.style.position = 'absolute'; + physics_stats.domElement.style.top = '50px'; + physics_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( physics_stats.domElement ); + + scene = new Physijs.Scene(); + scene.setGravity(new THREE.Vector3( 0, -30, 0 )); + scene.addEventListener( + 'update', + function() { + applyForce(); + scene.simulate( undefined, 1 ); + physics_stats.update(); + } + ); + + camera = new THREE.PerspectiveCamera( + 35, + window.innerWidth / window.innerHeight, + 1, + 1000 + ); + camera.position.set( 60, 50, 60 ); + camera.lookAt( scene.position ); + scene.add( camera ); + + // Light + light = new THREE.DirectionalLight( 0xFFFFFF ); + light.position.set( 20, 40, -15 ); + light.target.position.copy( scene.position ); + light.castShadow = true; + light.shadowCameraLeft = -60; + light.shadowCameraTop = -60; + light.shadowCameraRight = 60; + light.shadowCameraBottom = 60; + light.shadowCameraNear = 20; + light.shadowCameraFar = 200; + light.shadowBias = -.0001 + light.shadowMapWidth = light.shadowMapHeight = 2048; + light.shadowDarkness = .7; + scene.add( light ); + + // Materials + ground_material = Physijs.createMaterial( + new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/rocks.jpg' ) }), + .8, // high friction + .4 // low restitution + ); + ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping; + ground_material.map.repeat.set( 3, 3 ); + + box_material = Physijs.createMaterial( + new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/plywood.jpg' ) }), + .4, // low friction + .6 // high restitution + ); + box_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping; + box_material.map.repeat.set( .25, .25 ); + + // Ground + ground = new Physijs.BoxMesh( + new THREE.BoxGeometry(100, 1, 100), + ground_material, + 0 // mass + ); + ground.receiveShadow = true; + scene.add( ground ); + + for ( var i = 0; i < 10; i++ ) { + box = new Physijs.BoxMesh( + new THREE.BoxGeometry( 4, 4, 4 ), + box_material + ); + box.position.set( + Math.random() * 50 - 25, + 10 + Math.random() * 5, + Math.random() * 50 - 25 + ); + box.rotation.set( + Math.random() * Math.PI * 2, + Math.random() * Math.PI * 2, + Math.random() * Math.PI * 2 + ); + box.scale.set( + Math.random() * 1 + .5, + Math.random() * 1 + .5, + Math.random() * 1 + .5 + ); + box.castShadow = true; + scene.add( box ); + boxes.push( box ); + } + + renderer.domElement.addEventListener( 'mousemove', setMousePosition ); + + requestAnimationFrame( render ); + scene.simulate(); +}; + +render = function() { + requestAnimationFrame( render ); + renderer.render( scene, camera ); + render_stats.update(); +}; + +setMousePosition = function( evt ) { + // Find where mouse cursor intersects the ground plane + var vector = new THREE.Vector3( + ( evt.clientX / renderer.domElement.clientWidth ) * 2 - 1, + -( ( evt.clientY / renderer.domElement.clientHeight ) * 2 - 1 ), + .5 + ); + projector.unprojectVector( vector, camera ); + vector.sub( camera.position ).normalize(); + + var coefficient = (box.position.y - camera.position.y) / vector.y + mouse_position = camera.position.clone().add( vector.multiplyScalar( coefficient ) ); +}; + +applyForce = function() { + if (!mouse_position) return; + var strength = 35, distance, effect, offset, box; + + for ( var i = 0; i < boxes.length; i++ ) { + box = boxes[i]; + distance = mouse_position.distanceTo( box.position ), + effect = mouse_position.clone().sub( box.position ).normalize().multiplyScalar( strength / distance ).negate(), + offset = mouse_position.clone().sub( box.position ); + box.applyImpulse( effect, offset ); + } +}; + +window.onload = initScene; diff --git a/physijs/tests/collisions.ts b/physijs/tests/collisions.ts new file mode 100644 index 000000000..bc43a60d6 --- /dev/null +++ b/physijs/tests/collisions.ts @@ -0,0 +1,171 @@ +/// +/// + + +Physijs.scripts.worker = '../physijs_worker.js'; +Physijs.scripts.ammo = 'examples/js/ammo.js'; + +var initScene, render, _boxes = [], spawnBox, + renderer, render_stats, physics_stats, scene, ground_material, ground, light, camera; + +initScene = function() { + renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.shadowMapEnabled = true; + renderer.shadowMapSoft = true; + document.getElementById( 'viewport' ).appendChild( renderer.domElement ); + + render_stats = new Stats(); + render_stats.domElement.style.position = 'absolute'; + render_stats.domElement.style.top = '0px'; + render_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( render_stats.domElement ); + + physics_stats = new Stats(); + physics_stats.domElement.style.position = 'absolute'; + physics_stats.domElement.style.top = '50px'; + physics_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( physics_stats.domElement ); + + scene = new Physijs.Scene; + scene.setGravity(new THREE.Vector3( 0, -30, 0 )); + scene.addEventListener( + 'update', + function() { + scene.simulate( undefined, 1 ); + physics_stats.update(); + } + ); + + camera = new THREE.PerspectiveCamera( + 35, + window.innerWidth / window.innerHeight, + 1, + 1000 + ); + camera.position.set( 60, 50, 60 ); + camera.lookAt( scene.position ); + scene.add( camera ); + + // Light + light = new THREE.DirectionalLight( 0xFFFFFF ); + light.position.set( 20, 40, -15 ); + light.target.position.copy( scene.position ); + light.castShadow = true; + light.shadowCameraLeft = -60; + light.shadowCameraTop = -60; + light.shadowCameraRight = 60; + light.shadowCameraBottom = 60; + light.shadowCameraNear = 20; + light.shadowCameraFar = 200; + light.shadowBias = -.0001 + light.shadowMapWidth = light.shadowMapHeight = 2048; + light.shadowDarkness = .7; + scene.add( light ); + + // Ground + ground_material = Physijs.createMaterial( + new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/rocks.jpg' ) }), + .8, // high friction + .3 // low restitution + ); + ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping; + ground_material.map.repeat.set( 3, 3 ); + + ground = new Physijs.BoxMesh( + new THREE.BoxGeometry(100, 1, 100), + ground_material, + 0 // mass + ); + ground.receiveShadow = true; + scene.add( ground ); + + spawnBox(); + + requestAnimationFrame( render ); + scene.simulate(); +}; + +spawnBox = (function() { + + var box_geometry = new THREE.BoxGeometry( 4, 4, 4 ), + handleCollision = function( collided_with, linearVelocity, angularVelocity ) { + var target = this; + target.collisions = 0; + switch (++target.collisions) { + + case 1: + target.material.color.setHex(0xcc8855); + break; + + case 2: + target.material.color.setHex(0xbb9955); + break; + + case 3: + target.material.color.setHex(0xaaaa55); + break; + + case 4: + target.material.color.setHex(0x99bb55); + break; + + case 5: + target.material.color.setHex(0x88cc55); + break; + + case 6: + target.material.color.setHex(0x77dd55); + break; + } + }, + createBox = function() { + var box, material; + + material = Physijs.createMaterial( + new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/plywood.jpg' ) }), + .6, // medium friction + .3 // low restitution + ); + material.map.wrapS = material.map.wrapT = THREE.RepeatWrapping; + material.map.repeat.set( .5, .5 ); + + //material = new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/rocks.jpg' ) }); + + box = new Physijs.BoxMesh( + box_geometry, + material + ); + + box.collisions = 0; + + box.position.set( + Math.random() * 15 - 7.5, + 25, + Math.random() * 15 - 7.5 + ); + + box.rotation.set( + Math.random() * Math.PI, + Math.random() * Math.PI, + Math.random() * Math.PI + ); + + box.castShadow = true; + box.addEventListener( 'collision', handleCollision ); + box.addEventListener( 'ready', spawnBox ); + scene.add( box ); + }; + + return function() { + setTimeout( createBox, 1000 ); + }; +})(); + +render = function() { + requestAnimationFrame( render ); + renderer.render( scene, camera ); + render_stats.update(); +}; + +window.onload = initScene; \ No newline at end of file diff --git a/physijs/tests/compound.ts b/physijs/tests/compound.ts new file mode 100644 index 000000000..bfd103ca7 --- /dev/null +++ b/physijs/tests/compound.ts @@ -0,0 +1,238 @@ +/// +/// + + +Physijs.scripts.worker = '../physijs_worker.js'; +Physijs.scripts.ammo = 'examples/js/ammo.js'; + +var initScene, render, renderer, render_stats, physics_stats, scene, ground, light, camera, spawnChair, + ground_material, chair_material; + +initScene = function() { + renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.shadowMapEnabled = true; + renderer.shadowMapSoft = true; + document.getElementById( 'viewport' ).appendChild( renderer.domElement ); + + render_stats = new Stats(); + render_stats.domElement.style.position = 'absolute'; + render_stats.domElement.style.top = '0px'; + render_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( render_stats.domElement ); + + physics_stats = new Stats(); + physics_stats.domElement.style.position = 'absolute'; + physics_stats.domElement.style.top = '50px'; + physics_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( physics_stats.domElement ); + + scene = new Physijs.Scene; + scene.setGravity(new THREE.Vector3( 0, -50, 0 )); + scene.addEventListener( + 'update', + function() { + scene.simulate( undefined, 2 ); + physics_stats.update(); + } + ); + + camera = new THREE.PerspectiveCamera( + 35, + window.innerWidth / window.innerHeight, + 1, + 1000 + ); + camera.position.set( 60, 50, 60 ); + camera.lookAt( scene.position ); + scene.add( camera ); + + // Light + light = new THREE.DirectionalLight( 0xFFFFFF ); + light.position.set( 20, 40, -15 ); + light.target.position.copy( scene.position ); + light.castShadow = true; + light.shadowCameraLeft = -60; + light.shadowCameraTop = -60; + light.shadowCameraRight = 60; + light.shadowCameraBottom = 60; + light.shadowCameraNear = 20; + light.shadowCameraFar = 200; + light.shadowBias = -.0001 + light.shadowMapWidth = light.shadowMapHeight = 2048; + light.shadowDarkness = .7; + scene.add( light ); + + // Materials + ground_material = Physijs.createMaterial( + new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/rocks.jpg' ) }), + .8, // high friction + .4 // low restitution + ); + ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping; + ground_material.map.repeat.set( 3, 3 ); + + chair_material = Physijs.createMaterial( + new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/wood.jpg' ) }), + .6, // medium friction + .2 // low restitution + ); + chair_material.map.wrapS = chair_material.map.wrapT = THREE.RepeatWrapping; + chair_material.map.repeat.set( .25, .25 ); + + // Ground + ground = new Physijs.BoxMesh( + new THREE.BoxGeometry(100, 1, 100), + ground_material, + 0 // mass + );; + ground.receiveShadow = true; + scene.add( ground ); + + spawnChair(); + + requestAnimationFrame( render ); + scene.simulate(); +}; + +spawnChair = (function() { + var buildBack, buildLegs, doSpawn; + + buildBack = function() { + var back, _object; + + back = new Physijs.BoxMesh( + new THREE.BoxGeometry( 5, 1, .5 ), + chair_material + ); + back.position.y = 5; + back.position.z = -2.5; + back.castShadow = true; + back.receiveShadow = true; + + // rungs - relative to back + _object = new Physijs.BoxMesh( + new THREE.BoxGeometry( 1, 5, .5 ), + chair_material + ); + _object.position.y = -3; + _object.position.x = -2; + _object.castShadow = true; + _object.receiveShadow = true; + back.add( _object ); + + _object = new Physijs.BoxMesh( + new THREE.BoxGeometry( 1, 5, .5 ), + chair_material + ); + _object.position.y = -3; + _object.castShadow = true; + _object.receiveShadow = true; + back.add( _object ); + + _object = new Physijs.BoxMesh( + new THREE.BoxGeometry( 1, 5, .5 ), + chair_material + ); + _object.position.y = -3; + _object.position.x = 2; + _object.castShadow = true; + _object.receiveShadow = true; + back.add( _object ); + + return back; + }; + + buildLegs = function() { + var leg, _leg; + + // back left + leg = new Physijs.BoxMesh( + new THREE.BoxGeometry( .5, 4, .5 ), + chair_material + ); + leg.position.x = 2.25; + leg.position.z = -2.25; + leg.position.y = -2.5; + leg.castShadow = true; + leg.receiveShadow = true; + + // back right - relative to back left leg + _leg = new Physijs.BoxMesh( + new THREE.BoxGeometry( .5, 4, .5 ), + chair_material + ); + _leg.position.x = -4.5; + _leg.castShadow = true; + _leg.receiveShadow = true; + leg.add( _leg ); + + // front left - relative to back left leg + _leg = new Physijs.BoxMesh( + new THREE.BoxGeometry( .5, 4, .5 ), + chair_material + ); + _leg.position.z = 4.5; + _leg.castShadow = true; + _leg.receiveShadow = true; + leg.add( _leg ); + + // front right - relative to back left leg + _leg = new Physijs.BoxMesh( + new THREE.BoxGeometry( .5, 4, .5 ), + chair_material + ); + _leg.position.x = -4.5; + _leg.position.z = 4.5; + _leg.castShadow = true; + _leg.receiveShadow = true; + leg.add( _leg ); + + return leg; + }; + + doSpawn = function() { + var chair, back, legs; + + // seat of the chair + chair = new Physijs.BoxMesh( + new THREE.BoxGeometry( 5, 1, 5 ), + chair_material + ); + chair.castShadow = true; + chair.receiveShadow = true; + + // back - relative to chair ( seat ) + back = buildBack(); + chair.add( back ); + + // legs - relative to chair ( seat ) + legs = buildLegs(); + chair.add( legs ); + + chair.position.y = 20; + chair.position.x = Math.random() * 50 - 25; + chair.position.z = Math.random() * 50 - 25; + + chair.rotation.set( + Math.random() * Math.PI * 2, + Math.random() * Math.PI * 2, + Math.random() * Math.PI * 2 + ); + + chair.addEventListener( 'ready', spawnChair ); + scene.add( chair ); + }; + + return function() { + setTimeout( doSpawn, 500 ); + }; +})(); + +render = function() { + requestAnimationFrame( render ); + renderer.render( scene, camera ); + render_stats.update(); +}; + +window.onload = initScene; diff --git a/physijs/tests/constraints_car.ts b/physijs/tests/constraints_car.ts new file mode 100644 index 000000000..b74c44449 --- /dev/null +++ b/physijs/tests/constraints_car.ts @@ -0,0 +1,257 @@ +/// +/// + + +Physijs.scripts.worker = '../physijs_worker.js'; +Physijs.scripts.ammo = 'examples/js/ammo.js'; + +var initScene, render, + ground_material, car_material, wheel_material, wheel_geometry, + projector, renderer, render_stats, physics_stats, scene, ground_geometry, ground, light, camera, + car: any = {}; + +initScene = function() { + projector = new THREE.Projector; + + renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.shadowMapEnabled = true; + renderer.shadowMapSoft = true; + document.getElementById( 'viewport' ).appendChild( renderer.domElement ); + + render_stats = new Stats(); + render_stats.domElement.style.position = 'absolute'; + render_stats.domElement.style.top = '0px'; + render_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( render_stats.domElement ); + + physics_stats = new Stats(); + physics_stats.domElement.style.position = 'absolute'; + physics_stats.domElement.style.top = '50px'; + physics_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( physics_stats.domElement ); + + scene = new Physijs.Scene; + scene.setGravity(new THREE.Vector3( 0, -30, 0 )); + scene.addEventListener( + 'update', + function() { + scene.simulate( undefined, 2 ); + physics_stats.update(); + } + ); + + camera = new THREE.PerspectiveCamera( + 35, + window.innerWidth / window.innerHeight, + 1, + 1000 + ); + camera.position.set( 60, 50, 60 ); + camera.lookAt( scene.position ); + scene.add( camera ); + + // Light + light = new THREE.DirectionalLight( 0xFFFFFF ); + light.position.set( 20, 40, -15 ); + light.target.position.copy( scene.position ); + light.castShadow = true; + light.shadowCameraLeft = -60; + light.shadowCameraTop = -60; + light.shadowCameraRight = 60; + light.shadowCameraBottom = 60; + light.shadowCameraNear = 20; + light.shadowCameraFar = 200; + light.shadowBias = -.0001 + light.shadowMapWidth = light.shadowMapHeight = 2048; + light.shadowDarkness = .7; + scene.add( light ); + + // Materials + ground_material = Physijs.createMaterial( + new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/rocks.jpg' ) }), + .8, // high friction + .4 // low restitution + ); + ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping; + ground_material.map.repeat.set( 3, 3 ); + + // Ground + ground = new Physijs.BoxMesh( + new THREE.BoxGeometry(100, 1, 100), + ground_material, + 0 // mass + ); + ground.receiveShadow = true; + scene.add( ground ); + + + // Car + car_material = Physijs.createMaterial( + new THREE.MeshLambertMaterial({ color: 0xff6666 }), + .8, // high friction + .2 // low restitution + ); + + wheel_material = Physijs.createMaterial( + new THREE.MeshLambertMaterial({ color: 0x444444 }), + .8, // high friction + .5 // medium restitution + ); + wheel_geometry = new THREE.CylinderGeometry( 2, 2, 1, 8 ); + + car.body = new Physijs.BoxMesh( + new THREE.BoxGeometry( 10, 5, 7 ), + car_material, + 1000 + ); + car.body.position.y = 10; + car.body.receiveShadow = car.body.castShadow = true; + scene.add( car.body ); + + car.wheel_fl = new Physijs.CylinderMesh( + wheel_geometry, + wheel_material, + 500 + ); + car.wheel_fl.rotation.x = Math.PI / 2; + car.wheel_fl.position.set( -3.5, 6.5, 5 ); + car.wheel_fl.receiveShadow = car.wheel_fl.castShadow = true; + scene.add( car.wheel_fl ); + car.wheel_fl_constraint = new Physijs.DOFConstraint( + car.wheel_fl, car.body, new THREE.Vector3( -3.5, 6.5, 5 ) + ); + scene.addConstraint( car.wheel_fl_constraint ); + car.wheel_fl_constraint.setAngularLowerLimit({ x: 0, y: -Math.PI / 8, z: 1 }); + car.wheel_fl_constraint.setAngularUpperLimit({ x: 0, y: Math.PI / 8, z: 0 }); + + car.wheel_fr = new Physijs.CylinderMesh( + wheel_geometry, + wheel_material, + 500 + ); + car.wheel_fr.rotation.x = Math.PI / 2; + car.wheel_fr.position.set( -3.5, 6.5, -5 ); + car.wheel_fr.receiveShadow = car.wheel_fr.castShadow = true; + scene.add( car.wheel_fr ); + car.wheel_fr_constraint = new Physijs.DOFConstraint( + car.wheel_fr, car.body, new THREE.Vector3( -3.5, 6.5, -5 ) + ); + scene.addConstraint( car.wheel_fr_constraint ); + car.wheel_fr_constraint.setAngularLowerLimit({ x: 0, y: -Math.PI / 8, z: 1 }); + car.wheel_fr_constraint.setAngularUpperLimit({ x: 0, y: Math.PI / 8, z: 0 }); + + car.wheel_bl = new Physijs.CylinderMesh( + wheel_geometry, + wheel_material, + 500 + ); + car.wheel_bl.rotation.x = Math.PI / 2; + car.wheel_bl.position.set( 3.5, 6.5, 5 ); + car.wheel_bl.receiveShadow = car.wheel_bl.castShadow = true; + scene.add( car.wheel_bl ); + car.wheel_bl_constraint = new Physijs.DOFConstraint( + car.wheel_bl, car.body, new THREE.Vector3( 3.5, 6.5, 5 ) + ); + scene.addConstraint( car.wheel_bl_constraint ); + car.wheel_bl_constraint.setAngularLowerLimit({ x: 0, y: 0, z: 0 }); + car.wheel_bl_constraint.setAngularUpperLimit({ x: 0, y: 0, z: 0 }); + + car.wheel_br = new Physijs.CylinderMesh( + wheel_geometry, + wheel_material, + 500 + ); + car.wheel_br.rotation.x = Math.PI / 2; + car.wheel_br.position.set( 3.5, 6.5, -5 ); + car.wheel_br.receiveShadow = car.wheel_br.castShadow = true; + scene.add( car.wheel_br ); + car.wheel_br_constraint = new Physijs.DOFConstraint( + car.wheel_br, car.body, new THREE.Vector3( 3.5, 6.5, -5 ) + ); + scene.addConstraint( car.wheel_br_constraint ); + car.wheel_br_constraint.setAngularLowerLimit({ x: 0, y: 0, z: 0 }); + car.wheel_br_constraint.setAngularUpperLimit({ x: 0, y: 0, z: 0 }); + + document.addEventListener( + 'keydown', + function( ev ) { + switch( ev.keyCode ) { + case 37: + // Left + car.wheel_fl_constraint.configureAngularMotor( 1, -Math.PI / 2, Math.PI / 2, 1, 200 ); + car.wheel_fr_constraint.configureAngularMotor( 1, -Math.PI / 2, Math.PI / 2, 1, 200 ); + car.wheel_fl_constraint.enableAngularMotor( 1 ); + car.wheel_fr_constraint.enableAngularMotor( 1 ); + break; + + case 39: + // Right + car.wheel_fl_constraint.configureAngularMotor( 1, -Math.PI / 2, Math.PI / 2, -1, 200 ); + car.wheel_fr_constraint.configureAngularMotor( 1, -Math.PI / 2, Math.PI / 2, -1, 200 ); + car.wheel_fl_constraint.enableAngularMotor( 1 ); + car.wheel_fr_constraint.enableAngularMotor( 1 ); + break; + + case 38: + // Up + car.wheel_bl_constraint.configureAngularMotor( 2, 1, 0, 5, 2000 ); + car.wheel_br_constraint.configureAngularMotor( 2, 1, 0, 5, 2000 ); + car.wheel_bl_constraint.enableAngularMotor( 2 ); + car.wheel_br_constraint.enableAngularMotor( 2 ); + break; + + case 40: + // Down + car.wheel_bl_constraint.configureAngularMotor( 2, 1, 0, -5, 2000 ); + car.wheel_br_constraint.configureAngularMotor( 2, 1, 0, -5, 2000 ); + car.wheel_bl_constraint.enableAngularMotor( 2 ); + //car.wheel_br_constraint.enableAngularMotor( 2 ); + break; + } + } + ); + + document.addEventListener( + 'keyup', + function( ev ) { + switch( ev.keyCode ) { + case 37: + // Left + car.wheel_fl_constraint.disableAngularMotor( 1 ); + car.wheel_fr_constraint.disableAngularMotor( 1 ); + break; + + case 39: + // Right + car.wheel_fl_constraint.disableAngularMotor( 1 ); + car.wheel_fr_constraint.disableAngularMotor( 1 ); + break; + + case 38: + // Up + car.wheel_bl_constraint.disableAngularMotor( 2 ); + car.wheel_br_constraint.disableAngularMotor( 2 ); + break; + + case 40: + // Down + car.wheel_bl_constraint.disableAngularMotor( 2 ); + car.wheel_br_constraint.disableAngularMotor( 2 ); + break; + } + } + ); + + + requestAnimationFrame( render ); + scene.simulate(); +}; + +render = function() { + requestAnimationFrame( render ); + renderer.render( scene, camera ); + render_stats.update(); +}; + +window.onload = initScene; diff --git a/physijs/tests/heightfield.ts b/physijs/tests/heightfield.ts new file mode 100644 index 000000000..19d0e8c78 --- /dev/null +++ b/physijs/tests/heightfield.ts @@ -0,0 +1,189 @@ +/// +/// + +var TWEEN: any; +var SimplexNoise: any; + + +Physijs.scripts.worker = '../physijs_worker.js'; +Physijs.scripts.ammo = 'examples/js/ammo.js'; + +var initScene, render, createShape, NoiseGen, + renderer, render_stats, physics_stats, scene, light, ground, ground_geometry, ground_material, camera; + +initScene = function() { + TWEEN.start(); + + renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.shadowMapEnabled = true; + renderer.shadowMapSoft = true; + document.getElementById( 'viewport' ).appendChild( renderer.domElement ); + + render_stats = new Stats(); + render_stats.domElement.style.position = 'absolute'; + render_stats.domElement.style.top = '0px'; + render_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( render_stats.domElement ); + + physics_stats = new Stats(); + physics_stats.domElement.style.position = 'absolute'; + physics_stats.domElement.style.top = '50px'; + physics_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( physics_stats.domElement ); + + scene = new Physijs.Scene({ fixedTimeStep: 1 / 120 }); + scene.setGravity(new THREE.Vector3( 0, -30, 0 )); + scene.addEventListener( + 'update', + function() { + scene.simulate( undefined, 2 ); + physics_stats.update(); + } + ); + + camera = new THREE.PerspectiveCamera( + 35, + window.innerWidth / window.innerHeight, + 1, + 1000 + ); + camera.position.set( 60, 50, 60 ); + camera.lookAt( scene.position ); + scene.add( camera ); + + // Light + light = new THREE.DirectionalLight( 0xFFFFFF ); + light.position.set( 20, 40, -15 ); + light.target.position.copy( scene.position ); + light.castShadow = true; + light.shadowCameraLeft = -60; + light.shadowCameraTop = -60; + light.shadowCameraRight = 60; + light.shadowCameraBottom = 60; + light.shadowCameraNear = 20; + light.shadowCameraFar = 200; + light.shadowBias = -.0001 + light.shadowMapWidth = light.shadowMapHeight = 2048; + light.shadowDarkness = .7; + scene.add( light ); + + // Materials + ground_material = Physijs.createMaterial( + new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/grass.png' ) }), + .8, // high friction + .4 // low restitution + ); + ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping; + ground_material.map.repeat.set( 2.5, 2.5 ); + + // Ground + NoiseGen = new SimplexNoise; + + ground_geometry = new THREE.PlaneGeometry( 75, 75, 50, 50 ); + for ( var i = 0; i < ground_geometry.vertices.length; i++ ) { + var vertex = ground_geometry.vertices[i]; + vertex.z = NoiseGen.noise( vertex.x / 10, vertex.y / 10 ) * 2; + } + ground_geometry.computeFaceNormals(); + ground_geometry.computeVertexNormals(); + + // If your plane is not square as far as face count then the HeightfieldMesh + // takes two more arguments at the end: # of x faces and # of y faces that were passed to THREE.PlaneMaterial + ground = new Physijs.HeightfieldMesh( + ground_geometry, + ground_material, + 0, // mass + 50, + 50 + ); + ground.rotation.x = Math.PI / -2; + ground.receiveShadow = true; + scene.add( ground ); + + requestAnimationFrame( render ); + scene.simulate(); + + createShape(); +}; + +render = function() { + requestAnimationFrame( render ); + renderer.render( scene, camera ); + render_stats.update(); +}; + +createShape = (function() { + var addshapes = true, + shapes = 0, + box_geometry = new THREE.BoxGeometry( 3, 3, 3 ), + sphere_geometry = new THREE.SphereGeometry( 1.5, 32, 32 ), + cylinder_geometry = new THREE.CylinderGeometry( 2, 2, 1, 32 ), + cone_geometry = new THREE.CylinderGeometry( 0, 2, 4, 32 ), + octahedron_geometry = new THREE.OctahedronGeometry( 1.7, 1 ), + torus_geometry = new THREE.TorusKnotGeometry ( 1.7, .2, 32, 4 ), + doCreateShape; + + setTimeout( + function addListener() { + var button = document.getElementById( 'stop' ); + if ( button ) { + button.addEventListener( 'click', function() { addshapes = false; } ); + } else { + setTimeout( addListener ); + } + } + ); + + doCreateShape = function() { + var shape, material = new THREE.MeshLambertMaterial({ opacity: 0, transparent: true }); + + switch ( Math.floor(Math.random() * 2) ) { + case 0: + shape = new Physijs.BoxMesh( + box_geometry, + material + ); + break; + + case 1: + shape = new Physijs.SphereMesh( + sphere_geometry, + material, + undefined + ); + break; + } + + shape.material.color.setRGB( Math.random() * 100 / 100, Math.random() * 100 / 100, Math.random() * 100 / 100 ); + shape.castShadow = true; + shape.receiveShadow = true; + + shape.position.set( + Math.random() * 30 - 15, + 20, + Math.random() * 30 - 15 + ); + + shape.rotation.set( + Math.random() * Math.PI, + Math.random() * Math.PI, + Math.random() * Math.PI + ); + + if ( addshapes ) { + shape.addEventListener( 'ready', createShape ); + } + scene.add( shape ); + + new TWEEN.Tween(shape.material).to({opacity: 1}, 500).start(); + + document.getElementById('shapecount').textContent = (++shapes) + ' shapes created'; + }; + + return function() { + setTimeout( doCreateShape, 250 ); + }; +})(); + +window.onload = initScene; \ No newline at end of file diff --git a/physijs/tests/jenga.ts b/physijs/tests/jenga.ts new file mode 100644 index 000000000..05bbd7861 --- /dev/null +++ b/physijs/tests/jenga.ts @@ -0,0 +1,236 @@ +/// +/// + + +Physijs.scripts.worker = '../physijs_worker.js'; +Physijs.scripts.ammo = 'examples/js/ammo.js'; + +var initScene, initEventHandling, render, createTower, + renderer, render_stats, physics_stats, scene, dir_light, am_light, camera, + table, blocks = [], table_material, block_material, intersect_plane, _i, + selected_block = null, mouse_pos = new THREE.Vector3(), block_offset = new THREE.Vector3(), _v3 = new THREE.Vector3(); + +initScene = function() { + renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.shadowMapEnabled = true; + renderer.shadowMapSoft = true; + document.getElementById( 'viewport' ).appendChild( renderer.domElement ); + + render_stats = new Stats(); + render_stats.domElement.style.position = 'absolute'; + render_stats.domElement.style.top = '1px'; + render_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( render_stats.domElement ); + + physics_stats = new Stats(); + physics_stats.domElement.style.position = 'absolute'; + physics_stats.domElement.style.top = '50px'; + physics_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( physics_stats.domElement ); + + scene = new Physijs.Scene({ fixedTimeStep: 1 / 120 }); + scene.setGravity(new THREE.Vector3( 0, -30, 0 )); + scene.addEventListener( + 'update', + function() { + + if ( selected_block !== null ) { + + _v3.copy( mouse_pos ).add( block_offset ).sub( selected_block.position ).multiplyScalar( 5 ); + _v3.y = 0; + selected_block.setLinearVelocity( _v3 ); + + // Reactivate all of the blocks + _v3.set( 0, 0, 0 ); + for ( _i = 0; _i < blocks.length; _i++ ) { + blocks[_i].applyCentralImpulse( _v3 ); + } + } + + scene.simulate( undefined, 1 ); + physics_stats.update(); + } + ); + + camera = new THREE.PerspectiveCamera( + 35, + window.innerWidth / window.innerHeight, + 1, + 1000 + ); + camera.position.set( 25, 20, 25 ); + camera.lookAt(new THREE.Vector3( 0, 7, 0 )); + scene.add( camera ); + + // ambient light + am_light = new THREE.AmbientLight( 0x444444 ); + scene.add( am_light ); + + // directional light + dir_light = new THREE.DirectionalLight( 0xFFFFFF ); + dir_light.position.set( 20, 30, -5 ); + dir_light.target.position.copy( scene.position ); + dir_light.castShadow = true; + dir_light.shadowCameraLeft = -30; + dir_light.shadowCameraTop = -30; + dir_light.shadowCameraRight = 30; + dir_light.shadowCameraBottom = 30; + dir_light.shadowCameraNear = 20; + dir_light.shadowCameraFar = 200; + dir_light.shadowBias = -.001 + dir_light.shadowMapWidth = dir_light.shadowMapHeight = 2048; + dir_light.shadowDarkness = .5; + scene.add( dir_light ); + + // Materials + table_material = Physijs.createMaterial( + new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/wood.jpg' ), ambient: 0xFFFFFF }), + .9, // high friction + .2 // low restitution + ); + table_material.map.wrapS = table_material.map.wrapT = THREE.RepeatWrapping; + table_material.map.repeat.set( 5, 5 ); + + block_material = Physijs.createMaterial( + new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/plywood.jpg' ), ambient: 0xFFFFFF }), + .4, // medium friction + .4 // medium restitution + ); + block_material.map.wrapS = block_material.map.wrapT = THREE.RepeatWrapping; + block_material.map.repeat.set( 1, .5 ); + + // Table + table = new Physijs.BoxMesh( + new THREE.BoxGeometry(50, 1, 50), + table_material, + 0 + ); + table.position.y = -.5; + table.receiveShadow = true; + scene.add( table ); + + createTower(); + + intersect_plane = new THREE.Mesh( + new THREE.PlaneGeometry( 150, 150 ), + new THREE.MeshBasicMaterial({ opacity: 0, transparent: true }) + ); + intersect_plane.rotation.x = Math.PI / -2; + scene.add( intersect_plane ); + + initEventHandling(); + + requestAnimationFrame( render ); + scene.simulate(); +}; + +render = function() { + requestAnimationFrame( render ); + renderer.render( scene, camera ); + render_stats.update(); +}; + +createTower = (function() { + var block_length = 6, block_height = 1, block_width = 1.5, block_offset = 2, + block_geometry = new THREE.BoxGeometry( block_length, block_height, block_width ); + + return function() { + var i, j, rows = 16, + block; + + for ( i = 0; i < rows; i++ ) { + for ( j = 0; j < 3; j++ ) { + block = new Physijs.BoxMesh( block_geometry, block_material ); + block.position.y = (block_height / 2) + block_height * i; + if ( i % 2 === 0 ) { + block.rotation.y = Math.PI / 2.01; // #TODO: There's a bug somewhere when this is to close to 2 + block.position.x = block_offset * j - ( block_offset * 3 / 2 - block_offset / 2 ); + } else { + block.position.z = block_offset * j - ( block_offset * 3 / 2 - block_offset / 2 ); + } + block.receiveShadow = true; + block.castShadow = true; + scene.add( block ); + blocks.push( block ); + } + } + } +})(); + +initEventHandling = (function() { + var _vector = new THREE.Vector3, + projector = new THREE.Projector(), + handleMouseDown, handleMouseMove, handleMouseUp; + + handleMouseDown = function( evt ) { + var ray, intersections; + + _vector.set( + ( evt.clientX / window.innerWidth ) * 2 - 1, + -( evt.clientY / window.innerHeight ) * 2 + 1, + 1 + ); + + projector.unprojectVector( _vector, camera ); + + ray = new THREE.Raycaster( camera.position, _vector.sub( camera.position ).normalize() ); + intersections = ray.intersectObjects( blocks ); + + if ( intersections.length > 0 ) { + selected_block = intersections[0].object; + + _vector.set( 0, 0, 0 ); + selected_block.setAngularFactor( _vector ); + selected_block.setAngularVelocity( _vector ); + selected_block.setLinearFactor( _vector ); + selected_block.setLinearVelocity( _vector ); + + mouse_pos.copy( intersections[0].point ); + block_offset.subVectors( selected_block.position, mouse_pos ); + + intersect_plane.position.y = mouse_pos.y; + } + }; + + handleMouseMove = function( evt ) { + + var ray, intersection, + i, scalar; + + if ( selected_block !== null ) { + + _vector.set( + ( evt.clientX / window.innerWidth ) * 2 - 1, + -( evt.clientY / window.innerHeight ) * 2 + 1, + 1 + ); + projector.unprojectVector( _vector, camera ); + + ray = new THREE.Raycaster( camera.position, _vector.sub( camera.position ).normalize() ); + intersection = ray.intersectObject( intersect_plane ); + mouse_pos.copy( intersection[0].point ); + } + + }; + + handleMouseUp = function( evt ) { + + if ( selected_block !== null ) { + _vector.set( 1, 1, 1 ); + selected_block.setAngularFactor( _vector ); + selected_block.setLinearFactor( _vector ); + + selected_block = null; + } + + }; + + return function() { + renderer.domElement.addEventListener( 'mousedown', handleMouseDown ); + renderer.domElement.addEventListener( 'mousemove', handleMouseMove ); + renderer.domElement.addEventListener( 'mouseup', handleMouseUp ); + }; +})(); + +window.onload = initScene; diff --git a/physijs/tests/memorytest-compound.ts b/physijs/tests/memorytest-compound.ts new file mode 100644 index 000000000..0455b71f2 --- /dev/null +++ b/physijs/tests/memorytest-compound.ts @@ -0,0 +1,171 @@ +/// +/// + + +Physijs.scripts.worker = '../physijs_worker.js'; +Physijs.scripts.ammo = 'examples/js/ammo.js'; + +var initScene, render, _boxes = [], spawnBox, inc_ready, renderer, render_stats, physics_stats, scene, ground_material, ground, light, camera; + +var cubes = []; +var total_cubes = 0; +var total_ready = 0; +var max_on_screen = 100; +var spawn_per_tick = 25; + +initScene = function() { + renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.shadowMapEnabled = true; + renderer.shadowMapSoft = true; + document.getElementById( 'viewport' ).appendChild( renderer.domElement ); + + render_stats = new Stats(); + render_stats.domElement.style.position = 'absolute'; + render_stats.domElement.style.top = '0px'; + render_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( render_stats.domElement ); + + physics_stats = new Stats(); + physics_stats.domElement.style.position = 'absolute'; + physics_stats.domElement.style.top = '50px'; + physics_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( physics_stats.domElement ); + + scene = new Physijs.Scene; + scene.setGravity(new THREE.Vector3( 0, -30, 0 )); + scene.addEventListener( + 'update', + function() { + scene.simulate( undefined, 1 ); + physics_stats.update(); + while(cubes.length > max_on_screen) { + scene.remove(cubes[0]); + cubes[0].geometry.dispose(); + cubes[0].material.dispose(); + cubes.splice( 0, 1 ); + } + document.getElementById( 'totalcubecount' ).textContent = ( total_cubes.toString() ); + document.getElementById( 'currentcubecount' ).textContent = ( cubes.length.toString() ); + document.getElementById( 'totalobjects' ).textContent = ( scene.__objects.length ); + if(total_cubes > total_ready){ + return; + } + for (var i=0;i +/// + + +Physijs.scripts.worker = '../physijs_worker.js'; +Physijs.scripts.ammo = 'examples/js/ammo.js'; + +var initScene, render, _boxes = [], spawnBox, inc_ready, renderer, render_stats, physics_stats, scene, ground_material, ground, light, camera; + +var cubes = []; +var total_cubes = 0; +var total_ready = 0; +var max_on_screen = 100; +var spawn_per_tick = 25; + +initScene = function() { + renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.shadowMapEnabled = true; + renderer.shadowMapSoft = true; + document.getElementById( 'viewport' ).appendChild( renderer.domElement ); + + render_stats = new Stats(); + render_stats.domElement.style.position = 'absolute'; + render_stats.domElement.style.top = '0px'; + render_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( render_stats.domElement ); + + physics_stats = new Stats(); + physics_stats.domElement.style.position = 'absolute'; + physics_stats.domElement.style.top = '50px'; + physics_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( physics_stats.domElement ); + + scene = new Physijs.Scene; + scene.setGravity(new THREE.Vector3( 0, -30, 0 )); + scene.addEventListener( + 'update', + function() { + scene.simulate( undefined, 1 ); + physics_stats.update(); + while(cubes.length > max_on_screen) { + scene.remove(cubes[0]); + cubes[0].geometry.dispose(); + cubes[0].material.dispose(); + cubes.splice( 0, 1 ); + } + document.getElementById( 'totalcubecount' ).textContent = ( total_cubes.toString() ); + document.getElementById( 'currentcubecount' ).textContent = ( cubes.length.toString() ); + document.getElementById( 'totalobjects' ).textContent = ( scene.__objects.length ); + if(total_cubes > total_ready){ + return; + } + for (var i=0;i +/// + + +Physijs.scripts.worker = '../physijs_worker.js'; +Physijs.scripts.ammo = 'examples/js/ammo.js'; + +var initScene, render, _boxes = [], spawnBox, inc_ready, renderer, render_stats, physics_stats, scene, ground_material, ground, light, camera; + +var cubes = []; +var total_cubes = 0; +var total_ready = 0; +var max_on_screen = 100; +var spawn_per_tick = 25; + +initScene = function() { + renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.shadowMapEnabled = true; + renderer.shadowMapSoft = true; + document.getElementById( 'viewport' ).appendChild( renderer.domElement ); + + render_stats = new Stats(); + render_stats.domElement.style.position = 'absolute'; + render_stats.domElement.style.top = '0px'; + render_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( render_stats.domElement ); + + physics_stats = new Stats(); + physics_stats.domElement.style.position = 'absolute'; + physics_stats.domElement.style.top = '50px'; + physics_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( physics_stats.domElement ); + + scene = new Physijs.Scene; + scene.setGravity(new THREE.Vector3( 0, -30, 0 )); + scene.addEventListener( + 'update', + function() { + scene.simulate( undefined, 1 ); + physics_stats.update(); + while(cubes.length > max_on_screen) { + scene.remove(cubes[0]); + cubes[0].geometry.dispose(); + cubes[0].material.dispose(); + cubes.splice( 0, 1 ); + } + document.getElementById( 'totalcubecount' ).textContent = ( total_cubes.toString() ); + document.getElementById( 'currentcubecount' ).textContent = ( cubes.length.toString() ); + document.getElementById( 'totalobjects' ).textContent = ( scene.__objects.length ); + if(total_cubes > total_ready){ + return; + } + for (var i=0;i +/// + + +var TWEEN: any; +var SimplexNoise: any; + + +Physijs.scripts.worker = '../physijs_worker.js'; +Physijs.scripts.ammo = 'examples/js/ammo.js'; + +var initScene, render, createShape, + renderer, render_stats, physics_stats, scene, light, ground, ground_material, camera; + +initScene = function() { + TWEEN.start(); + + renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.shadowMapEnabled = true; + renderer.shadowMapSoft = true; + document.getElementById( 'viewport' ).appendChild( renderer.domElement ); + + render_stats = new Stats(); + render_stats.domElement.style.position = 'absolute'; + render_stats.domElement.style.top = '0px'; + render_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( render_stats.domElement ); + + physics_stats = new Stats(); + physics_stats.domElement.style.position = 'absolute'; + physics_stats.domElement.style.top = '50px'; + physics_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( physics_stats.domElement ); + + scene = new Physijs.Scene({ fixedTimeStep: 1 / 120 }); + scene.setGravity(new THREE.Vector3( 0, -30, 0 )); + scene.addEventListener( + 'update', + function() { + scene.simulate( undefined, 2 ); + physics_stats.update(); + } + ); + + camera = new THREE.PerspectiveCamera( + 35, + window.innerWidth / window.innerHeight, + 1, + 1000 + ); + camera.position.set( 60, 50, 60 ); + camera.lookAt( scene.position ); + scene.add( camera ); + + // Light + light = new THREE.DirectionalLight( 0xFFFFFF ); + light.position.set( 20, 40, -15 ); + light.target.position.copy( scene.position ); + light.castShadow = true; + light.shadowCameraLeft = -60; + light.shadowCameraTop = -60; + light.shadowCameraRight = 60; + light.shadowCameraBottom = 60; + light.shadowCameraNear = 20; + light.shadowCameraFar = 200; + light.shadowBias = -.0001 + light.shadowMapWidth = light.shadowMapHeight = 2048; + light.shadowDarkness = .7; + scene.add( light ); + + // Materials + ground_material = Physijs.createMaterial( + new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/rocks.jpg' ) }), + .8, // high friction + .4 // low restitution + ); + ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping; + ground_material.map.repeat.set( 2.5, 2.5 ); + + // Ground + ground = new Physijs.BoxMesh( + new THREE.BoxGeometry(50, 1, 50), + //new THREE.PlaneGeometry(50, 50), + ground_material, + 0 // mass + ); + ground.receiveShadow = true; + scene.add( ground ); + + // Bumpers + var bumper, + bumper_geom = new THREE.BoxGeometry(2, 1, 50); + + bumper = new Physijs.BoxMesh( bumper_geom, ground_material, 0 ); + bumper.position.y = 1; + bumper.position.x = -24; + bumper.receiveShadow = true; + bumper.castShadow = true; + scene.add( bumper ); + + bumper = new Physijs.BoxMesh( bumper_geom, ground_material, 0 ); + bumper.position.y = 1; + bumper.position.x = 24; + bumper.receiveShadow = true; + bumper.castShadow = true; + scene.add( bumper ); + + bumper = new Physijs.BoxMesh( bumper_geom, ground_material, 0 ); + bumper.position.y = 1; + bumper.position.z = -24; + bumper.rotation.y = Math.PI / 2; + bumper.receiveShadow = true; + bumper.castShadow = true; + scene.add( bumper ); + + bumper = new Physijs.BoxMesh( bumper_geom, ground_material, 0 ); + bumper.position.y = 1; + bumper.position.z = 24; + bumper.rotation.y = Math.PI / 2; + bumper.receiveShadow = true; + bumper.castShadow = true; + scene.add( bumper ); + + requestAnimationFrame( render ); + scene.simulate(); + + createShape(); +}; + +render = function() { + requestAnimationFrame( render ); + renderer.render( scene, camera ); + render_stats.update(); +}; + +createShape = (function() { + var addshapes = true, + shapes = 0, + box_geometry = new THREE.BoxGeometry( 3, 3, 3 ), + sphere_geometry = new THREE.SphereGeometry( 1.5, 32, 32 ), + cylinder_geometry = new THREE.CylinderGeometry( 2, 2, 1, 32 ), + cone_geometry = new THREE.CylinderGeometry( 0, 2, 4, 32 ), + octahedron_geometry = new THREE.OctahedronGeometry( 1.7, 1 ), + torus_geometry = new THREE.TorusKnotGeometry ( 1.7, .2, 32, 4 ), + doCreateShape; + + setTimeout( + function addListener() { + var button = document.getElementById( 'stop' ); + if ( button ) { + button.addEventListener( 'click', function() { addshapes = false; } ); + } else { + setTimeout( addListener ); + } + } + ); + + doCreateShape = function() { + var shape, material = new THREE.MeshLambertMaterial({ opacity: 0, transparent: true }); + + switch ( Math.floor(Math.random() * 6) ) { + case 0: + shape = new Physijs.BoxMesh( + box_geometry, + material + ); + break; + + case 1: + shape = new Physijs.SphereMesh( + sphere_geometry, + material, + undefined + ); + break; + + case 2: + shape = new Physijs.CylinderMesh( + cylinder_geometry, + material + ); + break; + + case 3: + shape = new Physijs.ConeMesh( + cone_geometry, + material + ); + break; + + case 4: + shape = new Physijs.ConvexMesh( + octahedron_geometry, + material + ); + break; + + case 5: + shape = new Physijs.ConvexMesh( + torus_geometry, + material + ); + break; + } + + shape.material.color.setRGB( Math.random() * 100 / 100, Math.random() * 100 / 100, Math.random() * 100 / 100 ); + shape.castShadow = true; + shape.receiveShadow = true; + + shape.position.set( + Math.random() * 30 - 15, + 20, + Math.random() * 30 - 15 + ); + + shape.rotation.set( + Math.random() * Math.PI, + Math.random() * Math.PI, + Math.random() * Math.PI + ); + + if ( addshapes ) { + shape.addEventListener( 'ready', createShape ); + } + scene.add( shape ); + + new TWEEN.Tween(shape.material).to({opacity: 1}, 500).start(); + + document.getElementById( 'shapecount' ).textContent = ( ++shapes ) + ' shapes created'; + }; + + return function() { + setTimeout( doCreateShape, 250 ); + }; +})(); + +window.onload = initScene; diff --git a/physijs/tests/vehicle.ts b/physijs/tests/vehicle.ts new file mode 100644 index 000000000..1b11066fe --- /dev/null +++ b/physijs/tests/vehicle.ts @@ -0,0 +1,254 @@ +/// +/// + +var TWEEN: any; +var SimplexNoise: any; + + +Physijs.scripts.worker = '../physijs_worker.js'; +Physijs.scripts.ammo = 'examples/js/ammo.js'; + +var initScene, render, + ground_material, box_material, + projector, renderer, render_stats, physics_stats, scene, ground, light, camera, + vehicle_body, vehicle; + +initScene = function() { + projector = new THREE.Projector; + + renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.shadowMapEnabled = true; + renderer.shadowMapSoft = true; + document.getElementById( 'viewport' ).appendChild( renderer.domElement ); + + render_stats = new Stats(); + render_stats.domElement.style.position = 'absolute'; + render_stats.domElement.style.top = '1px'; + render_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( render_stats.domElement ); + + physics_stats = new Stats(); + physics_stats.domElement.style.position = 'absolute'; + physics_stats.domElement.style.top = '50px'; + physics_stats.domElement.style.zIndex = 100; + document.getElementById( 'viewport' ).appendChild( physics_stats.domElement ); + + scene = new Physijs.Scene; + scene.setGravity(new THREE.Vector3( 0, -30, 0 )); + scene.addEventListener( + 'update', + function() { + + if ( input && vehicle ) { + if ( input.direction !== null ) { + input.steering += input.direction / 50; + if ( input.steering < -.6 ) input.steering = -.6; + if ( input.steering > .6 ) input.steering = .6; + } + vehicle.setSteering( input.steering, 0 ); + vehicle.setSteering( input.steering, 1 ); + + if ( input.power === true ) { + vehicle.applyEngineForce( 300 ); + } else if ( input.power === false ) { + vehicle.setBrake( 20, 2 ); + vehicle.setBrake( 20, 3 ); + } else { + vehicle.applyEngineForce( 0 ); + } + } + + scene.simulate( undefined, 2 ); + physics_stats.update(); + } + ); + + camera = new THREE.PerspectiveCamera( + 35, + window.innerWidth / window.innerHeight, + 1, + 1000 + ); + scene.add( camera ); + + // Light + light = new THREE.DirectionalLight( 0xFFFFFF ); + light.position.set( 20, 20, -15 ); + light.target.position.copy( scene.position ); + light.castShadow = true; + light.shadowCameraLeft = -150; + light.shadowCameraTop = -150; + light.shadowCameraRight = 150; + light.shadowCameraBottom = 150; + light.shadowCameraNear = 20; + light.shadowCameraFar = 400; + light.shadowBias = -.0001 + light.shadowMapWidth = light.shadowMapHeight = 2048; + light.shadowDarkness = .7; + scene.add( light ); + + + var input; + + + // Materials + ground_material = Physijs.createMaterial( + new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/rocks.jpg' ) }), + .8, // high friction + .4 // low restitution + ); + ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping; + ground_material.map.repeat.set( 3, 3 ); + + box_material = Physijs.createMaterial( + new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/plywood.jpg' ) }), + .4, // low friction + .6 // high restitution + ); + box_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping; + box_material.map.repeat.set( .25, .25 ); + + // Ground + var NoiseGen = new SimplexNoise; + + var ground_geometry = new THREE.PlaneGeometry( 300, 300, 100, 100 ); + for ( var i = 0; i < ground_geometry.vertices.length; i++ ) { + var vertex = ground_geometry.vertices[i]; + //vertex.y = NoiseGen.noise( vertex.x / 30, vertex.z / 30 ) * 1; + } + ground_geometry.computeFaceNormals(); + ground_geometry.computeVertexNormals(); + + // If your plane is not square as far as face count then the HeightfieldMesh + // takes two more arguments at the end: # of x faces and # of z faces that were passed to THREE.PlaneMaterial + ground = new Physijs.HeightfieldMesh( + ground_geometry, + ground_material, + 0 // mass + ); + ground.rotation.x = -Math.PI / 2; + ground.receiveShadow = true; + scene.add( ground ); + + for ( i = 0; i < 50; i++ ) { + var size = Math.random() * 2 + .5; + var box = new Physijs.BoxMesh( + new THREE.BoxGeometry( size, size, size ), + box_material + ); + box.castShadow = box.receiveShadow = true; + box.position.set( + Math.random() * 25 - 50, + 5, + Math.random() * 25 - 50 + ); + scene.add( box ) + } + + + var loader = new THREE.JSONLoader(); + + loader.load( "models/mustang.js", function( car, car_materials ) { + loader.load( "models/mustang_wheel.js", function( wheel, wheel_materials ) { + var mesh = new Physijs.BoxMesh( + car, + new THREE.MeshFaceMaterial( car_materials ) + ); + mesh.position.y = 2; + mesh.castShadow = mesh.receiveShadow = true; + + vehicle = new Physijs.Vehicle(mesh, new Physijs.VehicleTuning( + 10.88, + 1.83, + 0.28, + 500, + 10.5, + 6000 + )); + scene.add( vehicle ); + + var wheel_material = new THREE.MeshFaceMaterial( wheel_materials ); + + for ( var i = 0; i < 4; i++ ) { + vehicle.addWheel( + wheel, + wheel_material, + new THREE.Vector3( + i % 2 === 0 ? -1.6 : 1.6, + -1, + i < 2 ? 3.3 : -3.2 + ), + new THREE.Vector3( 0, -1, 0 ), + new THREE.Vector3( -1, 0, 0 ), + 0.5, + 0.7, + i < 2 ? false : true + ); + } + + input = { + power: null, + direction: null, + steering: 0 + }; + document.addEventListener('keydown', function( ev ) { + switch ( ev.keyCode ) { + case 37: // left + input.direction = 1; + break; + + case 38: // forward + input.power = true; + break; + + case 39: // right + input.direction = -1; + break; + + case 40: // back + input.power = false; + break; + } + }); + document.addEventListener('keyup', function( ev ) { + switch ( ev.keyCode ) { + case 37: // left + input.direction = null; + break; + + case 38: // forward + input.power = null; + break; + + case 39: // right + input.direction = null; + break; + + case 40: // back + input.power = null; + break; + } + }); + }); + }); + + requestAnimationFrame( render ); + scene.simulate(); +}; + + +render = function() { + requestAnimationFrame( render ); + if ( vehicle ) { + camera.position.copy( vehicle.mesh.position ).add( new THREE.Vector3( 40, 25, 40 ) ); + camera.lookAt( vehicle.mesh.position ); + + light.target.position.copy( vehicle.mesh.position ); + light.position.addVectors( light.target.position, new THREE.Vector3( 20, 20, -15 ) ); + } + renderer.render( scene, camera ); + render_stats.update(); +}; + +window.onload = initScene; From f2a81070eafc70f412e93e2a722bbf89cc0c3f57 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Sat, 30 Aug 2014 15:52:38 +0100 Subject: [PATCH 094/537] add definitions for jquery-handsontable --- CONTRIBUTORS.md | 1 + jquery-handsontable/jquery-handsontable.d.ts | 950 +++++++++++++++++++ 2 files changed, 951 insertions(+) create mode 100644 jquery-handsontable/jquery-handsontable.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index fda65cb32..1ff7a943e 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -199,6 +199,7 @@ All definitions files include a header with the author and editors, so at some p * [jQuery.Validation](http://bassistance.de/jquery-plugins/jquery-plugin-validation/) (by [Boris Yankov](https://github.com/borisyankov)) * [jQuery.Watermark](http://jquery-watermark.googlecode.com) (by [Anwar Javed](https://github.com/anwarjaved)) * [jQuery.base64](https://github.com/yatt/jquery.base64) (by [Shinya Mochizuki](https://github.com/enrapt-mochizuki)) +* [jquery-handsontable](https://github.com/handsontable/jquery-handsontable) (by [Ted John](https://github.com/intelorca)) * [js-git](https://github.com/creationix/js-git) (by [Bart van der Schoor](https://github.com/Bartvds)) * [js-url](https://github.com/websanova/js-url) (by [MIZUNE Pine](https://github.com/pine613)) * [js-yaml](https://github.com/nodeca/js-yaml) (by [Bart van der Schoor](https://github.com/Bartvds/)) diff --git a/jquery-handsontable/jquery-handsontable.d.ts b/jquery-handsontable/jquery-handsontable.d.ts new file mode 100644 index 000000000..dbb0d23d6 --- /dev/null +++ b/jquery-handsontable/jquery-handsontable.d.ts @@ -0,0 +1,950 @@ +// Type definitions for jquery-handsontable +// Project: http://handsontable.com +// Definitions by: Ted John +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Handsontable { + interface CellPosition { + row: number; + col: number; + } + + interface Options { + /** + * Initial data source that will be bound to the data grid by reference (editing data grid alters the data source. See Understanding binding as reference. + */ + data?: any; + + /** + * Width of the grid. Can be a number or a function that returns a number. + */ + width?: any; + + /** + * Height of the grid. Can be a number or a function that returns a number. + */ + height?: any; + + /** + * Minimum number of rows. At least that many of rows will be created during initialization. + */ + minRows?: number; + + /** + * Minimum number of columns. At least that many of columns will be created during initialization. + */ + minCols?: number; + + /** + * Maximum number of rows. + */ + maxRows?: number; + + /** + * Maximum number of columns. + */ + maxCols?: number; + + /** + * Initial number of rows. Notice: This option only has effect in Handsontable constructor and only if data option is not provided. + */ + startRows?: number; + + /** + * Initial number of rows. Notice: This option only has effect in Handsontable constructor and only if data option is not provided. + */ + startCols?: number; + + /** + * Setting true or false will enable or disable the default row headers (1, 2, 3). You can also define an array ['One', 'Two', 'Three', ...] or a function to define the headers. If a function is set the index of the rowis passed as a parameter. + */ + rowHeaders?: any; + + /** + * Setting true or false will enable or disable the default column headers (A, B, C). You can also define an array ['One', 'Two', 'Three', ...] or a function to define the headers. If a function is set the index of the column is passed as a parameter. + */ + colHeaders?: any; + + /** + * Defines column widths in pixels. Accepts number, string (that will be converted to number), array of numbers (if you want to define column width separately for each column) or a function (if you want to set column width dynamically on each render). + */ + colWidths?: any; + + /** + * Defines the cell properties and data binding for certain columns. Notice: Using this option sets a fixed number of columns (options startCols, minCols, maxCols will be ignored). + * @see https://github.com/handsontable/jquery-handsontable/wiki/Options below for more detailed explanation. + * @see http://handsontable.com/demo/datasources.html for examples + */ + columns?: any[]; + + /** + * Defines the cell properties for given row, col, prop coordinates. + * See Cells section below for more detailed explanation. + */ + cells?: (row: number, col: number, prop: string) => void; + + /** + * Defines the structure of a new row when data source is an object. + * @see http://handsontable.com/demo/datasources.html for examples. + */ + dataSchema?: any; + + /** + * When set to 1 (or more), Handsontable will add a new row at the end of grid if there are no more empty rows. + */ + minSpareRows?: number; + + /** + * When set to 1 (or more), Handsontable will add a new column at the end of grid if there are no more empty columns. + */ + minSpareCols?: number; + + /** + * If true, selection of multiple cells using keyboard or mouse is allowed. + */ + multiSelect?: boolean; + + /** + * Enables the fill handle (drag-down and copy-down) functionality, which shows the small rectangle in bottom right corner of the selected area, that let's you expand values to the adjacent cells. + * Possible values: true (to enable in all directions), "vertical" or "horizontal" (to enable in one direction), false (to disable completely). Setting to true enables the fillHandle plugin, which, + */ + fillHandle?: any; + + /** + * Defines if the right-click context menu should be enabled. Context menu allows to create new row or column at any place in the grid. + * Possible values: true (to enable basic options), false (to disable completely) or array of any available strings: ["row_above", "row_below", "col_left", "col_right", "remove_row", "remove_col", "undo", "redo", "sep1", "sep2", "sep3"]. + * @see http://handsontable.com/demo/contextmenu.html for examples. + */ + contextMenu?: any; + + /** + * If true, undo/redo functionality is enabled. + */ + undo?: boolean; + + /** + * If true, mouse click outside the grid will deselect the current selection. + */ + outsideClickDeselects?: boolean; + + /** + * If true, ENTER begins editing mode (like Google Docs). If false, ENTER moves to next row (like Excel) and adds new row if necessary. TAB adds new column if necessary. + */ + enterBeginsEditing?: boolean; + + /** + * Defines cursor move after ENTER is pressed (SHIFT+ENTER uses negative vector). Can be an object or a function that returns an object. The event argument passed to the function is a jQuery.Event object received after a ENTER key has been pressed. This event object can be used to check whether user pressed ENTER or SHIFT + ENTER. + */ + enterMoves?: any; + + /** + * Defines cursor move after TAB is pressed (SHIFT+TAB uses negative vector). Can be an object or a function that returns an object. The event argument passed to the function is a jQuery.Event object received after a TAB key has been pressed. This event object can be used to check whether user pressed TAB or SHIFT + TAB. + */ + tabMoves?: any; + + /** + * If true, pressing TAB or right arrow in the last column will move to first column in next row. + */ + autoWrapRow?: boolean; + + /** + * If true, pressing ENTER or down arrow in the last row will move to first row in next column. + */ + autoWrapCol?: boolean; + + /** + * Autocomplete definitions. + * @see demo/autocomplete.html for examples and definitions. + */ + autoComplete?: any[]; + + /** + * Maximum number of rows than can be copied to clipboard using CTRL+C. + */ + copyRowsLimit?: number; + + /** + * Maximum number of columns than can be copied to clipboard using CTRL+C. + */ + copyColsLimit?: number; + + /** + * Defines paste (CTRL+V) behavior. Default value "overwrite" will paste clipboard value over current selection. + * When set to "shift_down", clipboard data will be pasted in place of current selection, while all selected cells are moved down. + * When set to "shift_right", clipboard data will be pasted in place of current selection, while all selected cells are moved right. + */ + pasteMode?: string; + + /** + * Column stretching mode. Possible values: "none", "last", "all". + */ + stretchH?: string; + + /** + * Lets you overwrite the default isEmptyRow method. + */ + isEmptyRow? (row): boolean; + + /** + * Lets you overwrite the default isEmptyCol method. + */ + isEmptyCol? (col): boolean; + + /** + * Turn on Manual column resize, if set to a boolean or define initial column resized widths, if set to an array of numbers. + */ + manualColumnResize?: any; + + /** + * Turn on Manual column move, if set to a boolean or define initial column order, if set to an array of column indexes. + */ + manualColumnMove?: any; + + /** + * Turn on Column sorting. + */ + columnSorting?: boolean; + + /** + * Turn on saving the state of column sorting, columns positions and columns sizes in local storage. For more information see How to save data localy. + */ + persistentState?: boolean; + + /** + * Class name for all visible rows in current selection. + */ + currentRowClassName?: string; + + /** + * Class name for all visible columns in current selection. + */ + currentColClassName?: string; + + /** + * Allows to specify the number of rows fixed (aka freezed) on the top of the table. + */ + fixedRowsTop?: number; + + /** + * Allows to specify the number of columns fixed (aka freezed) on the left side of the table. + */ + fixedColumnsLeft?: number; + + /** + * Setting to true enables selecting just a fragment of the text within a single cell or between adjacent cells. + */ + fragmentSelection?: boolean; + + /** + * Setting to true word wrapping of the cell text content that does not fit in the fixed column width. + */ + wordWrap?: boolean; + + /** + * CSS class name cells configured with wordWrap: false. + */ + noWordWrapClassName?: string; + + /** + * When set to an non-empty string, displayed as the cell content for empty cells. + */ + placeholder?: any; + + /** + * CSS class name for cells that have a placeholder in use. + */ + placeholderCellClassName?: string; + + /** + * CSS class name for cells that did not pass validation. + */ + invalidCellClassName?: string; + + /** + * CSS class name for read-only cells. + */ + readOnlyCellClassName?: string; + + /** + * Setting to true enables the debug mode, currently used to test the correctness of the row and column header fixed positioning on a layer above the master table. + */ + debug?: boolean; + + /** + * When set to true, the table is rerendered when it is detected that it was made visible in DOM. + */ + observeDOMVisibility?: boolean; + + /** + * Setting to true enables the autoColumnSize plugin, which makes sure each column gets enough space to show its content. + */ + autoColumnSize?: boolean; + + /** + * Setting to true enables the observeChanges plugin, which automatically renders the table when a change in the data source is observed. + */ + observeChanges?: boolean; + + /** + * Setting to true enables the manualRowResize plugin, which allows to resize the row height with your mouse. + */ + manualRowResize?: boolean; + + /** + * Setting to true enables the copyPaste plugin, which enables the copying and pasting to the clipboard. + */ + copyPaste?: boolean; + + /** + * Setting to true enables the search plugin (see demo). + */ + search?: boolean; + + /** + * Setting to true or array enables the mergeCells plugin, which enables the merging of the cells. (see demo). You can provide the merged cells on the pageload if you feed the mergeCells option with an array. + */ + mergeCells?: any; + + /** + * Callback fired before Walkontable instance is initiated. + */ + beforeInitWalkontable?: Function; + + /** + * Callback fired before Handsontable instance is initiated. + * Note: this can be set only by global PluginHooks instance. + */ + beforeInit?: Function; + + /** + * Callback fired before Handsontable table is rendered. Parameters: + * - isForced is true if rendering was triggered by a change of settings or data; or false if rendering was triggered by scrolling or moving selection. + */ + beforeRender?: (isForced: boolean) => void; + + /** + * Callback fired before one or more cells is changed. Its main purpose is to alter changes silently before input. Parameters: + * - changes is a 2D array containing information about each of the edited cells [ [row, prop, oldVal, newVal], ... ]. + * - To disregard a single change, set changes[i] to null or remove it from array using changes.splice(i, 1). + * - To alter a single change, overwrite the desired value to changes[i][3]. + * - To cancel all edit, return false from the callback or set array length to 0 (changes.length = 0). + * - source is the name of a source of changes. + */ + beforeChange?: (changes: any[][], source: string) => void; + + beforeChangeRender?: Function; + + /** + * Callback fired before sorting the table. The column argument is a relative (displayed) index of a column that is about to be sorted. To get the absolute column index, just add the current column offset. You can get the offset by using colOffset() method. + */ + beforeColumnSort?: (column: number, order: boolean) => void; + + /** + * Callback fired before setting single value from the data source array. + */ + beforeSet?: (v: Object) => void; + + /** + * Callback fired before getting cell settings. + */ + beforeGetCellMeta?: (row: number, col: number, cellProperties: Object) => void; + + /** + * Parameters: + * - start is an object containing information about first filled cell: { row : 2, col : 0 }. + * - end is an object containing information about last filled cell: { row : 4, col : 1 }. + * - data is an 2D array containing information about fill pattern: [ ["1", "Ted"], ["1", "John"] ]. + */ + beforeAutofill?: (start: CellPosition, end: CellPosition, data: string[][]) => void; + + /** + * Callback fired before keydown event is handled. It can be used to overwrite default key bindings. Caution - in your beforeKeyDown handler you need to call event.stopImmediatePropagation() to prevent default key behavior. + */ + beforeKeyDown?: (event: KeyboardEvent) => void; + + /** + * A plugin hook executed before validator function, only if validator function is defined. This can be used to manipulate value of changed cell before it is applied to the validator function. NOTICE: this will not affect values of changes. This will change value ONLY for validation! + */ + beforeValidate?: (value: any, row; number, prop: string, source: string) => void; + + /** + * Callback fired after Handsontable instance is initiated. + */ + afterInit?: Function; + + /** + * Callback fired after new data is loaded (by loadData method) into the data source array. + */ + afterLoadData?: Function; + + /** + * Callback fired after Handsontable table is rendered. Parameters: + * - isForced is true if rendering was triggered by a change of settings or data; or false if rendering was triggered by scrolling or moving selection. + */ + afterRender?: (isForced: boolean) => void; + + /** + * Callback fired after one or more cells is changed. Its main use case is to save the input. Parameters: + * - changes is a 2D array containing information about each of the edited cells [ [row, prop, oldVal, newVal], ... ]. + * - source is one of the strings: "alter", "empty", "edit", "populateFromArray", "loadData", "autofill", "paste". + * Note: for performance reasons, the changes array is null for "loadData" source. + */ + afterChange?: (changes: any[], source: string) => void; + + /** + * Callback fired after sorting the table. The column argument is a relative (displayed) index of a column that is about to be sorted. To get the absolute column index, just add the current column offset. You can get the offset by using colOffset() method. + */ + afterColumnSort?: (column: number, order: boolean) => void; + + /** + * Callback fired while one or more cells are being selected (on mouse move). Parameters: + * - r selection start row + * - c selection start column + * - r2 selection end row + * - c2 selection end column + */ + afterSelection?: (r: number, c: number, r2: number, c2: number) => void; + + /** + * The same as above, but data source object property name is used instead of the column number. + */ + afterSelectionByProp?: (r: number, p: string, r2: number, p2: string) => void; + + /** + * Callback fired while one or more cells are being selected (on mouse up). Parameters: + * - r selection start row + * - c selection start column + * - r2 selection end row + * - c2 selection end column + */ + afterSelectionEnd?: (r: number, c: number, r2: number, c2: number) => void; + + /** + * The same as above, but data source object property name is used instead of the column number. + */ + afterSelectionEndByProp?: (r: number, p: string, r2: number, p2: string) => void; + + /** + * Event called when current cell is deselected. + */ + afterDeselect?: Function; + + /** + * Callback fired after getting cell settings. + */ + afterGetCellMeta?: (row: number, col: number, cellProperties: Object) => void; + + /** + * Callback fired after getting info about column header. + */ + afterGetColHeader?: (col: number, TH: HTMLTableHeaderCellElement) => void; + + /** + * Callback fired after calculating column width. + */ + afterGetColWidth?: (col: number, response: Object) => void; + + /** + * Callback fired after destroing Handsontable instance. + */ + afterDestroy?: Function; + + /** + * Callback is fired when a new row is created. Parameters: + * - index represents the index of first newly created row in the data source array. + * - amount number of newly created rows in the data source array. + */ + afterCreateRow?: (index: number, amount: number) => void; + + /** + * Callback is fired when a new column is created. Parameters: + * - index represents the index of first newly created column in the data source array. + * - amount number of newly created columns in the data source array. + */ + afterCreateCol?: (index: number, amount: number) => void; + + /** + * Callback is fired when one or more rows are about to be removed. Parameters: + * - index is an index of starter row. + * - amount is an anount of rows to be removed. + */ + beforeRemoveRow?: (index: number, amount: number) => void; + + /** + * Callback is fired when one or more rows are removed. Parameters: + * - index is an index of starter row. + * - amount is an anount of removed rows. + */ + afterRemoveRow?: (index: number, amount: number) => void; + + /** + * Callback is fired when one or more columns are about to be removed. Parameters: + * - index is an index of starter column. + * - amount is an anount of columns to be removed. + */ + beforeRemoveCol?: (index: number, amount: number) => void; + + /** + * Callback is fired when one or more columns are removed. Parameters: + * - index is an index of starter column. + * - amount is an anount of removed columns. + */ + afterRemoveCol?: (index: number, amount: number) => void; + + /** + * Callback is fired after changing column size. + */ + afterColumnResize?: (col: number, size: number) => void; + + /** + * Callback is fired after changing column placement. + */ + afterColumnMove?: (oldIndex: number, newIndex: number) => void; + + /** + * Callback fired if copyRowsLimit or copyColumnsLimit was reached. + */ + afterCopyLimit?: (selectedRowsCount: number, selectedColsCount: number, copyRowsLimit: number, copyColsLimit: number) => void; + + /** + * A plugin hook executed after validator function, only if validator function is defined. Validation result is the first parameter. This can be used to determinate if validation passed successfully or not. You can cancel current change by returning false. + */ + afterValidate?: (isValid: boolean, value: any, row: number, prop: string, source: string) => boolean; + + /** + * Callback fired before setting range is ended. Parameters: + * - coords is WalkontableCellCoords array + */ + beforeSetRangeEnd?: (coords: any[]) => void; + + afterUpdateSettings?: Function; + + afterRenderer?: (TD: HTMLTableDataCellElement, row: number, col: number, prop: string, value: string, cellProperties: Object) => void; + + /** + * Callback fired after clicking on a cell or row/column header. + * In case the row/column header was clicked, the index is negative. For example clicking on the row header of cell (0, 0) results with afterOnCellMouseDown called with coords {row: 0, col: -1}. + */ + afterOnCellMouseDown?: (event: MouseEvent, coords: CellPosition, TD: HTMLTableDataCellElement) => void; + + /** + * Callback fired after hovering a cell or row/column header with the mouse cursor. + * In case the row/column header was hovered, the index is negative. For example clicking on the row header of cell (0, 0) results with afterOnCellMouseOver called with coords {row: 0, col: -1}. + */ + afterOnCellMouseOver?: (event: MouseEvent, coords: CellPosition, TD: HTMLTableDataCellElement) => void; + + /** + * Callback fired after. + */ + afterOnCellCornerMouseDown?: (event: MouseEvent) => void; + + afterScrollVertically?: Function; + + afterScrollHorizontally?: Function; + + /** + * Callback fired after reset cell's meta. + */ + afterCellMetaReset?: Function; + + /** + * Callback fired after modify column's width. + */ + modifyColWidth?: (width: number, col: number) => void; + + /** + * Callback fired after modify hight of row. + */ + modifyRowHeight?: (height: number, row: number) => void; + + /** + * Callback fired after row modify. + */ + modifyRow?: (row: number) => void; + + /** + * Callback fired after column modify. + */ + modifyCol?: (col: number) => void; + + afterSetCellMeta?: Function; + + /** + * Deprecated! Now event is called afterSelection. + */ + onSelection?: (r: number, p: number, r2: number, p2: number) => void; + + /** + * Deprecated! Now event is called afterSelectionByProp. + */ + onSelectionByProp?: (r: number, p: number, r2: number, p2: number) => void; + + /** + * Deprecated! Now event is called afterSelectionEnd. + */ + onSelectionEnd?: (r: number, p: number, r2: number, p2: number) => void; + + /** + * Deprecated! Now event is called afterSelectionEndByProp. + */ + onSelectionEndByProp?: (r: number, p: number, r2: number, p2: number) => void; + + /** + * Deprecated! Now event is called beforeChange. + */ + onBeforeChange?: (changes: any[], source: string) => void; + + /** + * Deprecated! Now event is called afterChange. + */ + onChange?: (changes: any[], source: string) => void; + + /** + * Deprecated! Now event is called afterCopyLimit. + */ + onCopyLimit?: (selectedRowsCount: number, selectedColsCount: number, copyRowsLimit: number, copyColsLimit: number) => void; + } + + interface Context { + /** + * Use it if you need to change configuration after initialization. + */ + updateSettings(options: Options): void; + + /** + * Returns an object containing the current grid settings. + */ + getSettings(): Options; + + /** + * Reset all cells in the grid to contain data from the data array. + */ + loadData(data: any[]): void; + + /** + * Listen to keyboard input on document body. + */ + listen(): void; + + /** + * Returns rederer type/ + */ + getCellRenderer(row: number, col: number): string; + + /** + * Stop listening to keyboard input on document body. + */ + unlisten(): void; + + /** + * Returns true if current Handsontable instance is listening to keyboard input on document body. + */ + isListening(): boolean; + + /** + * Rerender the table. + */ + render(): void; + + /** + * Remove grid from DOM. + */ + destroy(): void; + + /** + * Validates all cells using their validator functions and calls callback when finished. Does not render the view. + */ + validateCells(callback: Function): void; + + /** + * Return the current data object (the same that was passed by data configuration option or loadData method). Optionally you can provide cell range row, col, row2, col2 to get only a fragment of grid data + */ + getData(): any; + + /** + * Return the current data object (the same that was passed by data configuration option or loadData method). Optionally you can provide cell range row, col, row2, col2 to get only a fragment of grid data + */ + getData(row: number, col: number, row2: number, col2: number): any; + + /** + * Return cell value at row, col. row and col are the visible indexes (note that if columns were reordered or sorted, the current order will be used). + */ + getDataAtCell(row: number, col: number): any; + + /** + * Same as getDataAtCell, except instead of col, you provide name of the object property (e.g. 'first.name'). + */ + getDataAtRowProp(row: number, prop: string): any; + + /** + * Returns a single row of the data (array or object, depending on what you have). row is the visible index of the row + */ + getDataAtRow(row: number): any; + + /** + * Returns a single row of the data (array or object, depending on what you have). row is the index of the row in the data source. + */ + getSourceDataAtRow(row: number): any; + + /** + * Returns array of column values from the data source. col is the visible index of the column. + */ + getDataAtCol(col: number): any[]; + + /** + * Returns array of column values from the data source. col is the index of the row in the data source. + */ + getSourceDataAtCol(col: number): any[]; + + /** + * Given the object property name (e.g. 'first.name'), returns array of column values from the data source. + */ + getDataAtProp(prop: string): any[]; + + /** + * Get value of selected range. Each column is separated by tab, each row is separated by new line character. + */ + getCopyableData(startRow: number, startCol: number, endRow: number, endCol: number): any; + + /** + * Returns value of selected cell. + */ + getValue(): any; + + /** + * Set new value to a cell. To change many cells at once, pass an array of changes in format [ [row, col, value], ... ] as the only parameter. col is the index of visible column (note that if columns were reordered, the current order will be used). source is a flag for before/afterChange events. If you pass only array of changes then source could be set as second parameter. + */ + setDataAtCell(row: number, col: number, value: any, source?: string): void; + + /** + * Set new value to a cell. To change many cells at once, pass an array of changes in format [ [row, col, value], ... ] as the only parameter. col is the index of visible column (note that if columns were reordered, the current order will be used). source is a flag for before/afterChange events. If you pass only array of changes then source could be set as second parameter. + */ + setDataAtCell(changes: any[], source?: string): void; + + /** + * Same as above, except instead of col, you provide name of the object property (e.g. [0, 'first.name', 'Jennifer']). + */ + setDataAtRowProp(row: number, prop: string, value: any, source?: string); + + /** + * Same as above, except instead of col, you provide name of the object property (e.g. [0, 'first.name', 'Jennifer']). + */ + setDataAtRowProp(changes: any[], source?: string): void; + + /** + * Populate cells at position with 2D input array (e.g. [ [1, 2], [3, 4] ]). + * Use endRow, endCol when you want to cut input when certain row is reached. + * @param source (default value "populateFromArray") is used to identify this call in the resulting events (beforeChange, afterChange). + * @param populateMethod (default value "overwrite", possible values "shift_down" and "shift_right") has the same effect as pasteMethod option (see Options page). + */ + populateFromArray(row: number, col: number, input: any[], endRow: number, endCol: number, source?: string, populateMethod?: string): void; + + /** + * Adds/removes data from the column. This function works is modelled after Array.splice. Parameter col is the index of column in which do you want to do splice. Parameter index is the row index at which to start changing the array. If negative, will begin that many elements from the end. Parameter amount, is the number of old array elements to remove. If the amount is 0, no elements are removed. Fourth and further parameters are the elements to add to the array. If you don't specify any elements, spliceCol simply removes elements from the array. + */ + spliceCol(col: number, index: number, amount: number, ...elements: any[]): void; + + /** + * Adds/removes data from the row. This function works is modelled after Array.splice. Parameter row is the index of row in which do you want to do splice. Parameter index is the column index at which to start changing the array. If negative, will begin that many elements from the end. Parameter amount, is the number of old array elements to remove. If the amount is 0, no elements are removed. Fourth and further parameters are the elements to add to the array. If you don't specify any elements, spliceCol simply removes elements from the array. + */ + spliceRow(row: number, index: number, amount: number, ...elements: any[]): void; + + /** + * Insert new row(s) above the row at given index. If index is null or undefined, the new row will be added after the current last row. Default amount equals 1. + */ + alter(type: 'insert_row', index: number, amount?: number, source?: string): void; + + /** + * Insert new column(s) before the column at given index. If index is null or undefined, the new column will be added after the current last column. Default amount equals 1. + */ + alter(type: 'insert_col', index: number, amount?: number, source?: string): void; + + /** + * Remove the row(s) at given index. Default amount equals 1. + */ + alter(type: 'remove_row', index: number, amount?: number, source?: string): void; + + /** + * Remove the column(s) at given index. Default amount equals 1. + */ + alter(type: 'remove_col', index: number, amount?: number, source?: string): void; + + alter(type: string, index: number, amount?: number, source?: string): void; + + /** + * Returns TD element for given row, col if it is rendered on screen. + * Returns null if the TD is not rendered on screen (probably because that part of table is not visible). + */ + getCell(row: number, col: number): any; + + /** + * Return cell properties for given row, col coordinates. + */ + getCellMeta(row: number, col: number): any; + + /** + * Sets cell meta data object key corresponding to params row, col. + */ + setCellMeta(row: number, col: number, key: string, val: string): void; + + /** + * Destroys current editor, renders and selects current cell. If revertOriginal == false, edited data is saved. Otherwise previous value is restored. + */ + destroyEditor(revertOriginal?: boolean): void; + + /** + * Select cell row, col or range finishing at row2, col2. By default, viewport will be scrolled to selection. + */ + selectCell(row: number, col: number, row2: number, col2: number, scrollToSelection?: boolean): void; + + /** + * Deselect current selection. + */ + deselectCell(): void; + + /** + * Return index of the currently selected cells as an array [startRow, startCol, endRow, endCol]. Start row and start col are the coordinates of the active cell (where the selection was started). + */ + getSelected(): void; + + /** + * Returns current selection as a WalkontableCellRange object. Returns undefined if there is no selection. + */ + getSelectedRange(): void; + + /** + * Clears grid. + */ + clear(): void; + + /** + * Returns total number of rows in the grid. + */ + countRows(): number; + + /** + * Returns total number of columns in the grid. + */ + countCols(): number; + + /** + * Returns property name that corresponds with the given column index. + */ + colToProp(column: number): string; + + /** + * Returns index of first visible row. + */ + rowOffset(): number; + + /** + * Returns index of first visible column. + */ + colOffset(): number; + + /** + * Returns number of visible rows. + */ + countVisibleRows(): number; + + /** + * Returns number of visible columns. + */ + countVisibleCols(): number; + + /** + * Returns number of empty rows. If the optional ending parameter is true, returns number of empty rows at the bottom of the table. + */ + countEmptyRows(ending?: boolean): number; + + /** + * Returns number of empty columns.If the optional ending parameter is true, returns number of empty columns at right hand edge of the table. + */ + countEmptyCols(ending?: boolean): number; + + /** + * Returns true if the row at the given index is empty, false otherwise. + */ + isEmptyRow(row: number): boolean; + + /** + * Returns true if the column at the given index is empty, false otherwise. + */ + isEmptyCol(col: number): boolean; + + /** + * Returns array of row headers (if they are enabled). If param row given, return header at given row as string. + */ + getRowHeader(row: number): any; + + /** + * Returns array of col headers (if they are enabled). If param col given, return header at given col as string. + */ + getColHeader(col: number): any; + + /** + * Returns information of this table is configured to display row headers. + */ + hasRowHeaders(): boolean; + + /** + * Returns information of this table is configured to display column headers. + */ + hasColHeaders(): boolean; + + /** + * Return column width. + */ + getColWidth(col: number): number; + + /** + * Return row height. + */ + getRowHeight(row: number): number; + + /** + * Returns column index that corresponds with the given property. + */ + propToCol(property: string): number; + + /** + * Clear undo history. + */ + clearUndo(): void; + + /** + * Return true if undo can be performed, false otherwise. + */ + isUndoAvailable(): boolean; + + /** + * Return true if redo can be performed, false otherwise. + */ + isRedoAvailable(): boolean; + + /** + * Undo last edit. + */ + undo(): void; + + /** + * Redo edit (used to reverse an undo). + */ + redo(): void; + + /** + * Sorts table content by cell values in given column, using order. column is a zero-based column index. Order of sorting can be either ascending (order = true) or descending (order = false). + * Note I: This method is only available when coulmnSorting plugin is enabled. See column sorting demo for details. + * Note II: Running this method will not alter the table data. Sorting takes place only in view layer. + */ + sort(column: number, order: boolean): void; + } +} + +interface JQuery { + handsontable(): JQuery; + handsontable(methodName: string, ...arguments?: any[]): any; + handsontable(options: Handsontable.Options): JQuery; +} \ No newline at end of file From f3db344825d769791657f19925333ca965286e46 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Sat, 30 Aug 2014 16:10:05 +0100 Subject: [PATCH 095/537] fix errors in jquery-handsontable --- jquery-handsontable/jquery-handsontable.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery-handsontable/jquery-handsontable.d.ts b/jquery-handsontable/jquery-handsontable.d.ts index dbb0d23d6..7e9b02806 100644 --- a/jquery-handsontable/jquery-handsontable.d.ts +++ b/jquery-handsontable/jquery-handsontable.d.ts @@ -367,7 +367,7 @@ declare module Handsontable { /** * A plugin hook executed before validator function, only if validator function is defined. This can be used to manipulate value of changed cell before it is applied to the validator function. NOTICE: this will not affect values of changes. This will change value ONLY for validation! */ - beforeValidate?: (value: any, row; number, prop: string, source: string) => void; + beforeValidate?: (value: any, row: number, prop: string, source: string) => void; /** * Callback fired after Handsontable instance is initiated. @@ -945,6 +945,6 @@ declare module Handsontable { interface JQuery { handsontable(): JQuery; - handsontable(methodName: string, ...arguments?: any[]): any; + handsontable(methodName: string, ...arguments: any[]): any; handsontable(options: Handsontable.Options): JQuery; -} \ No newline at end of file +} \ No newline at end of file From c3f5cd7864fa0aa032517ddda8d900bf9d1b3633 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Sat, 30 Aug 2014 16:15:42 +0100 Subject: [PATCH 096/537] fix implicitly typed parameters in jquery-handsontable --- jquery-handsontable/jquery-handsontable.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jquery-handsontable/jquery-handsontable.d.ts b/jquery-handsontable/jquery-handsontable.d.ts index 7e9b02806..ea6e3e70b 100644 --- a/jquery-handsontable/jquery-handsontable.d.ts +++ b/jquery-handsontable/jquery-handsontable.d.ts @@ -185,12 +185,12 @@ declare module Handsontable { /** * Lets you overwrite the default isEmptyRow method. */ - isEmptyRow? (row): boolean; + isEmptyRow?: (row: number) => boolean; /** * Lets you overwrite the default isEmptyCol method. */ - isEmptyCol? (col): boolean; + isEmptyCol?: (col: number) => boolean; /** * Turn on Manual column resize, if set to a boolean or define initial column resized widths, if set to an array of numbers. @@ -726,7 +726,7 @@ declare module Handsontable { /** * Same as above, except instead of col, you provide name of the object property (e.g. [0, 'first.name', 'Jennifer']). */ - setDataAtRowProp(row: number, prop: string, value: any, source?: string); + setDataAtRowProp(row: number, prop: string, value: any, source?: string): void; /** * Same as above, except instead of col, you provide name of the object property (e.g. [0, 'first.name', 'Jennifer']). @@ -947,4 +947,4 @@ interface JQuery { handsontable(): JQuery; handsontable(methodName: string, ...arguments: any[]): any; handsontable(options: Handsontable.Options): JQuery; -} \ No newline at end of file +} \ No newline at end of file From a21e99a99968e2156b0f3cb0044d20808d5babbf Mon Sep 17 00:00:00 2001 From: Kon P Date: Sat, 30 Aug 2014 14:15:33 -0700 Subject: [PATCH 097/537] Re-adding original definition owner --- bootbox/bootbox.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/bootbox/bootbox.d.ts b/bootbox/bootbox.d.ts index 173e3a2a7..699bc39bf 100644 --- a/bootbox/bootbox.d.ts +++ b/bootbox/bootbox.d.ts @@ -1,5 +1,6 @@ // Type definitions for Bootbox 4.0.0 // Project: https://github.com/makeusabrew/bootbox +// Definitions by: Vincent Bortone // Definitions by: Kon Pik // Definitions: https://github.com/borisyankov/DefinitelyTyped From 2d244ed02ae920cd23e5759ac8fce2a25b51f8ef Mon Sep 17 00:00:00 2001 From: Kon P Date: Sat, 30 Aug 2014 14:24:46 -0700 Subject: [PATCH 098/537] fixed header --- bootbox/bootbox.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bootbox/bootbox.d.ts b/bootbox/bootbox.d.ts index 699bc39bf..6177e1396 100644 --- a/bootbox/bootbox.d.ts +++ b/bootbox/bootbox.d.ts @@ -1,7 +1,6 @@ // Type definitions for Bootbox 4.0.0 // Project: https://github.com/makeusabrew/bootbox -// Definitions by: Vincent Bortone -// Definitions by: Kon Pik +// Definitions by: Vincent Bortone , Kon Pik // Definitions: https://github.com/borisyankov/DefinitelyTyped From 06c9171176cbefcf0ad53b6d567a7bfa16fa7183 Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Sun, 31 Aug 2014 06:33:09 +0900 Subject: [PATCH 099/537] Add name into CONTRIBUTORS.md --- CONTRIBUTORS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index bb0933af5..bcf912187 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -240,7 +240,8 @@ All definitions files include a header with the author and editors, so at some p * [Marked](https://github.com/chjj/marked) (by [William Orr](https://github.com/worr)) * [MathJax](https://github.com/mathjax/MathJax) (by [Roland Zwaga](https://github.com/rolandzwaga)) * [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) (by [Sarah Williams](https://github.com/flurg)) -* [Meteor](https://www.meteor.com) (by [Dave Allen](https://github.com/fullflavedave)) +* [Meteor](https://www.meteor.com) (by [Dave Allen](https://github.com/fullflavedave)) +* [md5.js](http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html) (by [MIZUNE Pine](https://github.com/pine613)) * [Microsoft Ajax](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) (by [Patrick Magee](https://github.com/pjmagee)) * [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) (by [John Vilk](https://github.com/jvilk)) * [Minimatch](https://github.com/isaacs/minimatch) (by [vvakame](https://github.com/vvakame)) From 60715c8fb783c24cf2093854c5d8ee43530b5ba5 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sat, 30 Aug 2014 15:11:32 -0400 Subject: [PATCH 100/537] Add definition and tests for "xpath" npm module. --- xpath/xpath-tests.ts | 77 +++++++++++++++++ xpath/xpath.d.ts | 197 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 274 insertions(+) create mode 100644 xpath/xpath-tests.ts create mode 100644 xpath/xpath.d.ts diff --git a/xpath/xpath-tests.ts b/xpath/xpath-tests.ts new file mode 100644 index 000000000..26418d9d7 --- /dev/null +++ b/xpath/xpath-tests.ts @@ -0,0 +1,77 @@ +/// + +import xpath = require('xpath'); + +// A string of xml +var xml: string; +// an xpath query +var xpathText: string; +// a DOM +var doc: Document; +// xpath returns lists of Nodes that do not implement the NodeList interface; +// they are merely arrays. +var nodes: Array; +var node: Node; +var stringResult: string; +var booleanResult: boolean; +var numberResult: number; +var selectFn; +var expression: xpath.XPathExpression; +var namespaceResolver; +var xpathResult: xpath.XPathResult; +var length: number; + +xml = 'xml'; +xpathText = '//this/is/an/xpath/query'; +doc = new DOMParser().parseFromString(xml, 'text/xml'); +nodes = xpath.select(xpathText, doc); +node = xpath.select(xpathText, doc, true); +nodes = xpath.select(xpathText, doc, false); + +node = xpath.select1(xpathText, doc); + +stringResult = xpath.select(xpathText, doc).toString(); + +node = xpath.select(xpathText, doc)[0]; + +selectFn = xpath.useNamespaces({ + 'prefix': 'http://namespaceuri.com/nsfile' +}); +nodes = selectFn(xpathText, doc); +node = selectFn(xpathText, doc, true); +nodes = selectFn(xpathText, doc, false); + +namespaceResolver = { + lookupNamespaceURI: function(prefix) { + return 'http://namespace.domain' + } +}; +expression = xpath.createExpression(xpathText, namespaceResolver); +xpathResult = expression.evaluate(doc, xpath.XPathResult.ANY_TYPE, null); +xpathResult = expression.evaluate(doc, xpath.XPathResult.ANY_TYPE, xpathResult); +xpathResult = expression.evaluate(doc, xpath.XPathResult.ANY_TYPE); +booleanResult = xpathResult.booleanValue; +numberResult = xpathResult.numberValue; +stringResult = xpathResult.stringValue; +node = xpathResult.singleNodeValue; +node = xpathResult.iterateNext(); +node = xpathResult.snapshotItem(10); +length = xpathResult.snapshotLength; + +var arrayOfNumbers: Array = [ + xpath.XPathResult.ANY_TYPE, + xpath.XPathResult.NUMBER_TYPE, + xpath.XPathResult.STRING_TYPE, + xpath.XPathResult.BOOLEAN_TYPE, + xpath.XPathResult.UNORDERED_NODE_ITERATOR_TYPE, + xpath.XPathResult.ORDERED_NODE_ITERATOR_TYPE, + xpath.XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, + xpath.XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, + xpath.XPathResult.ANY_UNORDERED_NODE_TYPE, + xpath.XPathResult.FIRST_ORDERED_NODE_TYPE +]; + +namespaceResolver = xpath.createNSResolver(node); +namespaceResolver = xpath.createNSResolver(doc); + + diff --git a/xpath/xpath.d.ts b/xpath/xpath.d.ts new file mode 100644 index 000000000..c9a11f188 --- /dev/null +++ b/xpath/xpath.d.ts @@ -0,0 +1,197 @@ +// Type definitions for xpath v0.0.7 +// Project: https://github.com/goto100/xpath +// Definitions by: Andrew Bradley +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// Some documentation prose is copied from the XPath documentation at https://developer.mozilla.org. + +declare module 'xpath' { + + // select1 can return any of: `Node`, `boolean`, `string`, `number`. + // select and selectWithResolver can return any of the above return types or `Array`. + // For this reason, their return types are `any`. + + interface SelectFn { + /** + * Evaluate an XPath expression against a DOM node. Returns the result as one of the following: + * * Array + * * Node + * * boolean + * * number + * * string + * @param xpathText + * @param contextNode + * @param single If true and the evaluation result is one or more Nodes, will return only the first Node instead of an Array + */ + (xpathText: string, contextNode: Node, single?: boolean): any; + } + + var select: SelectFn; + + /** + * Evaluate an xpath expression against a DOM node, returning the first result only. + * Equivalent to `select(xpathText, contextNode, true)` + * @param xpathText + * @param contextNode + */ + function select1(xpathText: string, contextNode: Node): any; + + /** + * Evaluate an XPath expression against a DOM node using a given namespace resolver. Returns the result as one of the following: + * * Array + * * Node + * * boolean + * * number + * * string + * @param xpathText + * @param contextNode + * @param resolver + * @param single If true and the evaluation result is one or more Nodes, will return only the first Node instead of an Array + */ + function selectWithResolver(xpathText: string, contextNode: Node, resolver: XPathNSResolver, single?: boolean): any; + + /** + * Evaluate an xpath expression against a DOM. + * @param xpathText xpath expression as a string. + * @param contextNode xpath expression is evaluated relative to this DOM node. + * @param resolver XML namespace resolver + * @param resultType + * @param result If non-null, xpath *may* reuse this XPathResult object instead of creating a new one. However, it is not required to do so. + * @return XPathResult object containing the result of the expression. + */ + function evaluate(xpathText: string, contextNode: Node, resolver: XPathNSResolver, resultType: number, result?: XPathResult): XPathResult; + + /** + * Creates a `select` function that uses the given namespace prefix to URI mappings when evaluating queries. + * @param namespaceMappings an object mapping namespace prefixes to namespace URIs. Each key is a prefix; each value is a URI. + * @return a function with the same signature as `xpath.select` + */ + function useNamespaces(namespaceMappings: NamespaceMap): typeof select; + interface NamespaceMap { + [namespacePrefix: string]: string; + } + + /** + * Compile an XPath expression into an XPathExpression which can be (repeatedly) evaluated against a DOM. + * @param xpathText XPath expression as a string + * @param namespaceURLMapper Namespace resolver + * @return compiled expression + */ + function createExpression(xpathText: string, namespaceURLMapper: XPathNSResolver): XPathExpression; + + /** + * Create an XPathNSResolver that resolves based on the information available in the context of a DOM node. + * @param node + */ + function createNSResolver(node: Node): XPathNSResolver; + + /** + * Result of evaluating an XPathExpression. + */ + class XPathResult { + /** + * A result set containing whatever type naturally results from evaluation of the expression. Note that if the result is a node-set then UNORDERED_NODE_ITERATOR_TYPE is always the resulting type. + */ + static ANY_TYPE: number; + /** + * A result containing a single number. This is useful for example, in an XPath expression using the count() function. + */ + static NUMBER_TYPE: number; + /** + * A result containing a single string. + */ + static STRING_TYPE: number; + /** + * A result containing a single boolean value. This is useful for example, in an XPath expression using the not() function. + */ + static BOOLEAN_TYPE: number; + /** + * A result node-set containing all the nodes matching the expression. The nodes may not necessarily be in the same order that they appear in the document. + */ + static UNORDERED_NODE_ITERATOR_TYPE: number; + /** + * A result node-set containing all the nodes matching the expression. The nodes in the result set are in the same order that they appear in the document. + */ + static ORDERED_NODE_ITERATOR_TYPE: number; + /** + * A result node-set containing snapshots of all the nodes matching the expression. The nodes may not necessarily be in the same order that they appear in the document. + */ + static UNORDERED_NODE_SNAPSHOT_TYPE: number; + /** + * A result node-set containing snapshots of all the nodes matching the expression. The nodes in the result set are in the same order that they appear in the document. + */ + static ORDERED_NODE_SNAPSHOT_TYPE: number; + /** + * A result node-set containing any single node that matches the expression. The node is not necessarily the first node in the document that matches the expression. + */ + static ANY_UNORDERED_NODE_TYPE: number; + /** + * A result node-set containing the first node in the document that matches the expression. + */ + static FIRST_ORDERED_NODE_TYPE: number; + + /** + * Type of this result. It is one of the enumerated result types. + */ + resultType: number; + + /** + * Returns the next node in this result, if this result is one of the _ITERATOR_ result types. + */ + iterateNext(): Node; + + /** + * returns the result node for a given index, if this result is one of the _SNAPSHOT_ result types. + * @param index + */ + snapshotItem(index: number): Node; + + /** + * Number of nodes in this result, if this result is one of the _SNAPSHOT_ result types. + */ + snapshotLength: number; + + /** + * Value of this result, if it is a BOOLEAN_TYPE result. + */ + booleanValue: boolean; + /** + * Value of this result, if it is a NUMBER_TYPE result. + */ + numberValue: number; + /** + * Value of this result, if it is a STRING_TYPE result. + */ + stringValue: string; + + /** + * Value of this result, if it is a FIRST_ORDERED_NODE_TYPE result. + */ + singleNodeValue: Node; + } + + /** + * A compiled XPath expression, ready to be (repeatedly) evaluated against a DOM node. + */ + interface XPathExpression { + /** + * evaluate this expression against a DOM node. + * @param contextNode + * @param resultType + * @param result + */ + evaluate(contextNode: Node, resultType: number, result?: XPathResult): XPathResult; + } + + /** + * Object that can resolve XML namespace prefixes to namespace URIs. + */ + interface XPathNSResolver { + /** + * Given an XML namespace prefix, returns the corresponding XML namespace URI. + * @param prefix XML namespace prefix + * @return XML namespace URI + */ + lookupNamespaceURI(prefix: string): string; + } +} From 495675e550d65619b479eced3ced3764eb6aeac0 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sun, 31 Aug 2014 00:51:45 -0400 Subject: [PATCH 101/537] Add "xpath" definition to CONTRIBUTORS list --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index bb0933af5..07795cb9d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -374,6 +374,7 @@ All definitions files include a header with the author and editors, so at some p * [ws](http://einaros.github.io/ws/) (by [Paul Loyd](https://github.com/loyd)) * [x2js](https://code.google.com/p/x2js/) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) * [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) (by [Michel Salib](https://github.com/michelsalib)) +* [xpath](https://github.com/goto100/xpath) (by [Andrew Bradley](https://github.com/cspotcode)) * [XRegExp](http://xregexp.com/) (by [Bart van der Schoor](https://github.com/Bartvds)) * [YouTube](https://developers.google.com/youtube/) (by [Daz Wilkin](https://github.com/DazWilkin/)) * [YouTube Analytics API](https://developers.google.com/youtube/analytics/) (by [Frank M](https://github.com/sgtfrankieboy)) From 80dea1ec4122a31b09e862ad06b010873ee79a22 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sun, 31 Aug 2014 01:03:59 -0400 Subject: [PATCH 102/537] Eliminate implicit `any` in "xpath" tests. --- xpath/xpath-tests.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xpath/xpath-tests.ts b/xpath/xpath-tests.ts index 26418d9d7..c20088b9e 100644 --- a/xpath/xpath-tests.ts +++ b/xpath/xpath-tests.ts @@ -15,9 +15,8 @@ var node: Node; var stringResult: string; var booleanResult: boolean; var numberResult: number; -var selectFn; var expression: xpath.XPathExpression; -var namespaceResolver; +var namespaceResolver: xpath.XPathNSResolver; var xpathResult: xpath.XPathResult; var length: number; @@ -34,7 +33,7 @@ stringResult = xpath.select(xpathText, doc).toString(); node = xpath.select(xpathText, doc)[0]; -selectFn = xpath.useNamespaces({ +var selectFn = xpath.useNamespaces({ 'prefix': 'http://namespaceuri.com/nsfile' }); nodes = selectFn(xpathText, doc); From 37d59baa6ff494e8ea14f9f1863ae3deec5f8ac4 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Sun, 31 Aug 2014 11:11:19 +0100 Subject: [PATCH 103/537] add tests for jquery-handsontable --- .../jquery-handsontable-tests.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 jquery-handsontable/jquery-handsontable-tests.ts diff --git a/jquery-handsontable/jquery-handsontable-tests.ts b/jquery-handsontable/jquery-handsontable-tests.ts new file mode 100644 index 000000000..b17e6fffa --- /dev/null +++ b/jquery-handsontable/jquery-handsontable-tests.ts @@ -0,0 +1,28 @@ +/// +/// + +var data = [ + ["", "Maserati", "Mazda", "Mercedes", "Mini", "Mitsubishi"], + ["2009", 0, 2941, 4303, 354, 5814], + ["2010", 5, 2905, 2867, 412, 5284], + ["2011", 4, 2517, 4822, 552, 6127], + ["2012", 2, 2422, 5399, 776, 4151] +]; + +var div = $('div'); +$('body').append(div); + +div.handsontable({ + data: data, + minSpareRows: 1, + colHeaders: true, + contextMenu: true +}); + +var instance: Handsontable.Context = div.handsontable('getInstance'); +for (var i = 1; i < instance.countCols(); i++) { + for (var j = 1; j < instance.countRows(); j++) { + var value = parseInt(instance.getDataAtCell(j, i)) * 2; + instance.setDataAtCell(j, i, value); + } +} \ No newline at end of file From 6b7657b69d7f3fdd700c6b9b9ea64a0da1d919ce Mon Sep 17 00:00:00 2001 From: mzsm Date: Tue, 2 Sep 2014 03:54:34 +0900 Subject: [PATCH 104/537] JQuery.one can omit `selector`. (like JQuery.on) --- jquery/jquery.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 1884180fb..80ca7e3b8 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -2806,7 +2806,7 @@ interface JQuery { * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. * @param data Data to be passed to the handler in event.data when an event occurs. */ - one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; + one(events: { [key: string]: any; }, selector?: any, data?: any): JQuery; /** From c1be07edcf03510acdeb1f8bfbfa4ef011d969a3 Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Tue, 2 Sep 2014 10:57:42 +0100 Subject: [PATCH 105/537] [minor] Fix typo in URL --- jasmine/jasmine.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index e3f46ca17..04c4f4671 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped -// For ddescribe / iit use : hhttps://github.com/borisyankov/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts +// For ddescribe / iit use : https://github.com/borisyankov/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts declare function describe(description: string, specDefinitions: () => void): void; // declare function ddescribe(description: string, specDefinitions: () => void): void; Not a part of jasmine. Angular team adds these From 1339939e44d82e732c0987fd518035ff0872c260 Mon Sep 17 00:00:00 2001 From: vvakame Date: Wed, 3 Sep 2014 00:55:30 +0900 Subject: [PATCH 106/537] updat IEditor and add IDecorator. see http://blog.atom.io/2014/07/24/decorations.html --- atom/atom.d.ts | 116 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 108 insertions(+), 8 deletions(-) diff --git a/atom/atom.d.ts b/atom/atom.d.ts index 00f55ef02..96b7c849d 100644 --- a/atom/atom.d.ts +++ b/atom/atom.d.ts @@ -497,6 +497,35 @@ declare module AtomCore { screenRangeChanged():any; } + interface IDecorationParams { + id?: number; + class: string; + type: any /* string or string[] */; + } + + interface IDecorationStatic { + isType(decorationParams:IDecorationParams, type:any /* string or string[] */):boolean; + new (marker:IDisplayBufferMarker, displayBuffer:IDisplayBuffer, params: IDecorationParams): IDecoration; + } + + interface IDecoration extends Emissary.IEmitter { + marker: IDisplayBufferMarker; + displayBuffer: IDisplayBuffer; + params: IDecorationParams + id: number; + flashQueue: any[]; + isDestroyed: boolean; + + destroy():void; + update(newParams:IDecorationParams):void; + getMarker():IDisplayBufferMarker; + getParams():IDecorationParams; + isType(type:string):boolean; + matchesPattern(decorationPattern:{[key:string]:IDecorationParams;}):boolean; + flash(klass:string, duration?:number):void; + consumeNextFlash():any; + } + interface IEditor { // Serializable.includeInto(Editor); // Delegator.includeInto(Editor); @@ -509,6 +538,8 @@ declare module AtomCore { cursors:ICursor[]; selections: ISelection[]; suppressSelectionMerging:boolean; + updateBatchDepth: number; + selectionFlashDuration: number; softTabs: boolean; displayBuffer: IDisplayBuffer; @@ -522,6 +553,8 @@ declare module AtomCore { subscriptionsByObject: any; /* WeakMap */ subscriptions: Emissary.ISubscription[]; + mini: any; + serializeParams():{id:number; softTabs:boolean; scrollTop:number; scrollLeft:number; displayBuffer:any;}; deserializeParams(params:any):any; subscribeToBuffer():void; @@ -532,10 +565,7 @@ declare module AtomCore { getTitle():string; getLongTitle():string; setVisible(visible:boolean):void; - setScrollTop(scrollTop:any):void; - getScrollTop():number; - setScrollLeft(scrollLeft:any):void; - getScrollLeft():number; + setMini(mini:any):void; setEditorWidthInChars(editorWidthInChars:any):void; getSoftWrapColumn():number; getSoftTabs():boolean; @@ -545,6 +575,7 @@ declare module AtomCore { getTabText():string; getTabLength():number; setTabLength(tabLength:any):void; + usesSoftTabs():boolean; clipBufferPosition(bufferPosition:any):void; clipBufferRange(range:any):void; indentationForBufferRow(bufferRow:any):void; @@ -553,6 +584,7 @@ declare module AtomCore { buildIndentString(number:any):string; save():void; saveAs(filePath:any):void; + copyPathToClipboard():void; getPath():string; getText():string; setText(text:any):void; @@ -572,6 +604,7 @@ declare module AtomCore { scanInBufferRange():any; backwardsScanInBufferRange():any; isModified():boolean; + isEmpty():boolean; shouldPromptToSave():boolean; screenPositionForBufferPosition(bufferPosition:any, options?:any):TextBuffer.IPoint; bufferPositionForScreenPosition(screenPosition:any, options?:any):TextBuffer.IPoint; @@ -589,15 +622,19 @@ declare module AtomCore { bufferRangeForScopeAtCursor(selector:string):any; tokenForBufferPosition(bufferPosition:any):IToken; getCursorScopes():string[]; + logCursorScope():void; insertText(text:string, options?:any):TextBuffer.IRange[]; insertNewline():TextBuffer.IRange[]; insertNewlineBelow():TextBuffer.IRange[]; insertNewlineAbove():any; indent(options?:any):any; backspace():any[]; - backspaceToBeginningOfWord():any[]; - backspaceToBeginningOfLine():any[]; + // deprecated backspaceToBeginningOfWord():any[]; + // deprecated backspaceToBeginningOfLine():any[]; + deleteToBeginningOfWord():any[]; + deleteToBeginningOfLine():any[]; delete():any[]; + deleteToEndOfLine():any[]; deleteToEndOfWord():any[]; deleteLine():TextBuffer.IRange[]; indentSelectedRows():TextBuffer.IRange[][]; @@ -620,6 +657,7 @@ declare module AtomCore { foldBufferRow(bufferRow:any):any; unfoldBufferRow(bufferRow:any):any; isFoldableAtBufferRow(bufferRow:any):boolean; + isFoldableAtScreenRow(screenRow:any):boolean; createFold(startRow:any, endRow:any):IFold; destroyFoldWithId(id:any):any; destroyFoldsIntersectingBufferRange(bufferRange:any):any; @@ -633,9 +671,12 @@ declare module AtomCore { moveLineUp():ISelection[]; moveLineDown():ISelection[]; duplicateLines():any[][]; - duplicateLine():any[][]; + // duprecated duplicateLine():any[][]; mutateSelectedText(fn:(selection:ISelection)=>any):any; replaceSelectedText(options:any, fn:(selection:string)=>any):any; + decorationsForScreenRowRange(startScreenRow:any, endScreenRow:any):{[id:number]: IDecoration[]}; + decorateMarker(marker:IDisplayBufferMarker, decorationParams: {type:string; class: string;}):IDecoration; + decorationForId(id:number):IDecoration; getMarker(id:number):IDisplayBufferMarker; getMarkers():IDisplayBufferMarker[]; findMarkers(...args:any[]):IDisplayBufferMarker[]; @@ -659,6 +700,7 @@ declare module AtomCore { removeSelection(selection:ISelection):any; clearSelections():boolean; consolidateSelections():boolean; + selectionScreenRangeChanged(selection:any):void; getSelections():ISelection[]; getSelection(index?:number):ISelection; getLastSelection():ISelection; @@ -694,7 +736,16 @@ declare module AtomCore { moveCursorToBeginningOfNextWord():void; moveCursorToPreviousWordBoundary():void; moveCursorToNextWordBoundary():void; + moveCursorToBeginningOfNextParagraph():void; + moveCursorToBeginningOfPreviousParagraph():void; + scrollToCursorPosition(options:any):any; + pageUp():void; + pageDown():void; + selectPageUp():void; + selectPageDown():void; + getRowsPerPage():number; moveCursors(fn:(cursor:ICursor)=>any):any; + cursorMoved(event:any):void; selectToScreenPosition(position:TextBuffer.IPoint):any; selectRight():ISelection[]; selectLeft():ISelection[]; @@ -720,6 +771,8 @@ declare module AtomCore { selectToEndOfWord():ISelection[]; selectToBeginningOfNextWord():ISelection[]; selectWord():ISelection[]; + selectToBeginningOfNextParagraph():ISelection[]; + selectToBeginningOfPreviousParagraph():ISelection[]; selectMarker(marker:any):any; mergeCursors():number[]; expandSelectionsForward():any; @@ -731,16 +784,63 @@ declare module AtomCore { setGrammar(grammer:IGrammar):void; reloadGrammar():any; shouldAutoIndent():boolean; + shouldShowInvisibles():boolean; + updateInvisibles():void; transact(fn:Function):any; beginTransaction():ITransaction; commitTransaction():any; abortTransaction():any[]; inspect():string; logScreenLines(start:number, end:number):any[]; + handleTokenization():void; handleGrammarChange():void; handleMarkerCreated(marker:any):any; getSelectionMarkerAttributes():{type: string; editorId: number; invalidate: string; }; - // joinLine():any; // deprecated + getVerticalScrollMargin():number; + setVerticalScrollMargin(verticalScrollMargin:number):void; + getHorizontalScrollMargin():number; + setHorizontalScrollMargin(horizontalScrollMargin:number):void; + getLineHeightInPixels():number; + setLineHeightInPixels(lineHeightInPixels:number):void; + batchCharacterMeasurement(fn:Function):void; + getScopedCharWidth(scopeNames:any, char:any):any; + setScopedCharWidth(scopeNames:any, char:any, width:any):any; + getScopedCharWidths(scopeNames:any):any; + clearScopedCharWidths():any; + getDefaultCharWidth():number; + setDefaultCharWidth(defaultCharWidth:number):void; + setHeight(height:number):void; + getHeight():number; + getClientHeight():number; + setWidth(width:number):void; + getWidth():number; + getScrollTop():number; + setScrollTop(scrollTop:number):void; + getScrollBottom():number; + setScrollBottom(scrollBottom:number):void; + getScrollLeft():number; + setScrollLeft(scrollLeft:number):void; + getScrollRight():number; + setScrollRight(scrollRight:number):void; + getScrollHeight():number; + getScrollWidth():number; + getVisibleRowRange():number; + intersectsVisibleRowRange(startRow:any, endRow:any):any; + selectionIntersectsVisibleRowRange(selection:any):any; + pixelPositionForScreenPosition(screenPosition:any):any; + pixelPositionForBufferPosition(bufferPosition:any):any; + screenPositionForPixelPosition(pixelPosition:any):any; + pixelRectForScreenRange(screenRange:any):any; + scrollToScreenRange(screenRange:any, options:any):any; + scrollToScreenPosition(screenPosition:any, options:any):any; + scrollToBufferPosition(bufferPosition:any, options:any):any; + horizontallyScrollable():any; + verticallyScrollable():any; + getHorizontalScrollbarHeight():any; + setHorizontalScrollbarHeight(height:any):any; + getVerticalScrollbarWidth():any; + setVerticalScrollbarWidth(width:any):any; + // deprecated joinLine():any; } interface IGrammar { From e2b37fc9788ceb82572893fdea3d0b32fa0ff24c Mon Sep 17 00:00:00 2001 From: Brandon Luong Date: Tue, 2 Sep 2014 11:47:22 -0700 Subject: [PATCH 107/537] stack layout out update definition --- d3/d3.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index e2bf337e4..158462aa3 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -1104,6 +1104,7 @@ declare module D3 { offset(offset: string): StackLayout; x(accessor: (d: any, i: number) => any): StackLayout; y(accessor: (d: any, i: number) => any): StackLayout; + out(setter: (d: any, y0: number, y: number) => void): StackLayout; } export interface TreeLayout { From 0ea44c6c0a505d4bb3a61b152ccafc9006f47c9e Mon Sep 17 00:00:00 2001 From: Pedro Casaubon Date: Tue, 2 Sep 2014 21:02:39 +0200 Subject: [PATCH 108/537] Added HowlerJS Definitions https://github.com/goldfire/howler.js --- howlerjs/howler-tests.ts | 35 +++++++++++++++++++ howlerjs/howler.d.ts | 73 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 howlerjs/howler-tests.ts create mode 100644 howlerjs/howler.d.ts diff --git a/howlerjs/howler-tests.ts b/howlerjs/howler-tests.ts new file mode 100644 index 000000000..aff0df926 --- /dev/null +++ b/howlerjs/howler-tests.ts @@ -0,0 +1,35 @@ +/** + * howler-tests.ts + * Created by xperiments on 02/09/14. + */ +/// + + +Howler.codecs('ogg'); +Howler.iOSAutoEnable = true; +var sound = new Howl({ + urls: ['sound.mp3'] +}).play(); + + +var sound = new Howl({ + urls: ['sound.mp3', 'sound.ogg', 'sound.wav'], + autoplay: true, + loop: true, + volume: 0.5, + onend: function() { + console.log('Finished!'); + } +}); + +var sound = new Howl({ + urls: ['sounds.mp3', 'sounds.ogg'], + sprite: { + blast: [0, 1000], + laser: [2000, 3000], + winner: [4000, 7500] + } +}); + +// shoot the laser! +sound.play('laser'); \ No newline at end of file diff --git a/howlerjs/howler.d.ts b/howlerjs/howler.d.ts new file mode 100644 index 000000000..577c9fd78 --- /dev/null +++ b/howlerjs/howler.d.ts @@ -0,0 +1,73 @@ +// Type definitions for howler.js v1.1.25 +// Project: https://github.com/goldfire/howler.js +// Definitions by: Pedro Casaubon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +declare class HowlerGlobal { + mute(): HowlerGlobal; + unmute(): HowlerGlobal; + volume(): number; + volume(volume: number): HowlerGlobal; + codecs(extension: string): boolean; + iOSAutoEnable: boolean; +} + +declare var Howler: HowlerGlobal; + + +interface IHowlCallback { + (): void; +} +interface IHowlSoundSpriteDefinition { + [name: string]: number[] +} +interface IHowlProperties { + autoplay?: boolean; + buffer?: boolean; + format?: string; + loop?: boolean; + sprite?: IHowlSoundSpriteDefinition; + volume?: number; + urls?: string[]; + onend?: IHowlCallback; + onload?: IHowlCallback; + onloaderror?: IHowlCallback; + onpause?: IHowlCallback; + onplay?: IHowlCallback; +} + + +declare class Howl { + + autoplay: Boolean; + buffer: Boolean; + format: string; + rate: number; + model: string; + onend: IHowlCallback; + onload: IHowlCallback; + onloaderror: IHowlCallback; + onpause: IHowlCallback; + onplay: IHowlCallback; + constructor(properties: IHowlProperties); + play(sprite?: string, callback?: (soundId: number) => void): Howl; + pause(soundId?: number): Howl; + stop(soundId?: number): Howl; + mute(soundId?: number): Howl; + unmute(soundId?: number): Howl; + fade(from: number, to: number, duration: number, callback?: IHowlCallback, soundId?: number): Howl; + loop(): boolean; + loop(loop: boolean): Howl; + pos(position?: number, soundId?: number): number; + pos3d(x: number, y: number, z: number, soundId?: number): any; + sprite(definition?: IHowlSoundSpriteDefinition): IHowlSoundSpriteDefinition; + volume(): number; + volume(volume?: number, soundId?: number): Howl; + urls(): string[]; + urls(urls: string[]): Howl; + on(event: string, listener?: () => void): Howl; + off(event: string, listener?: () => void): Howl; + unload(): void; +} + From 7affe8e6edf688d0f3fc0a52afd0c43311dc70e9 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Tue, 2 Sep 2014 22:35:22 +0200 Subject: [PATCH 109/537] Added $asyncValidators Check https://docs.angularjs.org/api/ng/type/ngModel.NgModelController#$asyncValidators --- angularjs/angular.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 084bea034..b341825e0 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -445,6 +445,7 @@ declare module ng { $untouched: boolean; $validators: IModelValidators; + $asyncValidators: IModelValidators; $pristine: boolean; $dirty: boolean; From 7d1ef8108d0eb432362a3dbf8229cc48f77a5881 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 2 Sep 2014 14:25:53 -0700 Subject: [PATCH 110/537] Update WinRT typings to fix extend conflict as both 'IWebSocket' and 'IClosable' implemetn a close method with diffrent signatures --- winrt/winrt.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/winrt/winrt.d.ts b/winrt/winrt.d.ts index 350b43153..a6829956e 100644 --- a/winrt/winrt.d.ts +++ b/winrt/winrt.d.ts @@ -7940,6 +7940,8 @@ declare module Windows { control: Windows.Networking.Sockets.MessageWebSocketControl; information: Windows.Networking.Sockets.MessageWebSocketInformation; onmessagereceived: any/* TODO */; + close(): void; + close(code: number, reason: string): void; } export class MessageWebSocketControl implements Windows.Networking.Sockets.IMessageWebSocketControl, Windows.Networking.Sockets.IWebSocketControl { maxMessageSize: number; @@ -7978,6 +7980,8 @@ declare module Windows { control: Windows.Networking.Sockets.StreamWebSocketControl; information: Windows.Networking.Sockets.StreamWebSocketInformation; inputStream: Windows.Storage.Streams.IInputStream; + close(): void; + close(code: number, reason: string): void; } export class StreamWebSocketControl implements Windows.Networking.Sockets.IStreamWebSocketControl, Windows.Networking.Sockets.IWebSocketControl { noDelay: boolean; From 11c3bec4212ed162740bf1b181104ddf3fc43d7b Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 2 Sep 2014 14:32:15 -0700 Subject: [PATCH 111/537] Add missing 'new' to PouchDB test --- pouchDB/pouch-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pouchDB/pouch-tests.ts b/pouchDB/pouch-tests.ts index 5534ca367..eb5ea7746 100644 --- a/pouchDB/pouch-tests.ts +++ b/pouchDB/pouch-tests.ts @@ -9,7 +9,7 @@ window.alert = function (thing?: string) { var pouch: PouchDB; function pouchTests() { - PouchDB('testdb', function (err: PouchError, res: PouchDB) { + new PouchDB('testdb', function (err: PouchError, res: PouchDB) { if (err) { alert('Error ' + err.status + ' occurred ' + err.error + ' - ' + err.reason); } From 2aaa293cb1af459b5815621227c204d93906a793 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 2 Sep 2014 14:53:39 -0700 Subject: [PATCH 112/537] Remove quotes from response files --- ace/ace.d.ts.tscparams | 2 +- ace/all-tests.ts.tscparams | 2 +- ace/tests/ace-anchor-tests.ts.tscparams | 2 +- ace/tests/ace-background_tokenizer-tests.ts.tscparams | 2 +- ace/tests/ace-default-tests.ts.tscparams | 2 +- ace/tests/ace-document-tests.ts.tscparams | 2 +- ace/tests/ace-edit_session-tests.ts.tscparams | 2 +- ace/tests/ace-editor1-tests.ts.tscparams | 2 +- .../ace-editor_highlight_selected_word-tests.ts.tscparams | 2 +- ace/tests/ace-editor_navigation-tests.ts.tscparams | 2 +- ace/tests/ace-editor_text_edit-tests.ts.tscparams | 2 +- ace/tests/ace-multi_select-tests.ts.tscparams | 2 +- ace/tests/ace-placeholder-tests.ts.tscparams | 2 +- ace/tests/ace-range-tests.ts.tscparams | 2 +- ace/tests/ace-range_list-tests.ts.tscparams | 2 +- ace/tests/ace-search-tests.ts.tscparams | 2 +- ace/tests/ace-selection-tests.ts.tscparams | 2 +- ace/tests/ace-token_iterator-tests.ts.tscparams | 2 +- ace/tests/ace-virtual_renderer-tests.ts.tscparams | 2 +- amcharts/AmCharts.d.ts.tscparams | 2 +- amplifyjs/amplifyjs-tests.ts.tscparams | 2 +- amplifyjs/amplifyjs.d.ts.tscparams | 2 +- angularjs/legacy/angular-1.0-tests.ts.tscparams | 2 +- angularjs/legacy/angular-scenario-1.0.d.ts.tscparams | 2 +- asciify/asciify.ts.tscparams | 2 +- async/async-tests.ts.tscparams | 2 +- atom/atom-tests.ts.tscparams | 2 +- .../AzureMobileServicesClient-tests.ts.tscparams | 2 +- backbone-relational/backbone-relational-tests.ts.tscparams | 2 +- backbone-relational/backbone-relational.d.ts.tscparams | 2 +- backgrid/backgrid-tests.ts.tscparams | 2 +- backgrid/backgrid.d.ts.tscparams | 2 +- bootstrap-notify/bootstrap-notify.d.ts.tscparams | 2 +- bootstrap.paginator/bootstrap.paginator.d.ts.tscparams | 2 +- browser-harness/browser-harness-tests.ts.tscparams | 2 +- browser-harness/browser-harness.d.ts.tscparams | 2 +- camljs/camljs-tests.ts.tscparams | 2 +- camljs/camljs.d.ts.tscparams | 2 +- chai-fuzzy/chai-fuzzy.d.ts.tscparams | 2 +- chai-jquery/chai-jquery-tests.ts.tscparams | 2 +- chai/chai-tests.ts.tscparams | 2 +- chrome/chrome-app-tests.ts.tscparams | 2 +- chrome/chrome-app.d.ts.tscparams | 2 +- chrome/chrome-tests.ts.tscparams | 2 +- convert-source-map/convert-source-map-tests.ts.tscparams | 2 +- convert-source-map/convert-source-map.d.ts.tscparams | 2 +- crossroads/crossroads-tests.ts.tscparams | 2 +- crossroads/crossroads.d.ts.tscparams | 2 +- d3/d3-tests.ts.tscparams | 2 +- d3/plugins/d3.superformula-tests.ts.tscparams | 2 +- dhtmlxgantt/dhtmlxgantt-tests.ts.tscparams | 2 +- dhtmlxgantt/dhtmlxgantt.d.ts.tscparams | 2 +- dhtmlxscheduler/dhtmlxscheduler-tests.ts.tscparams | 2 +- dhtmlxscheduler/dhtmlxscheduler.d.ts.tscparams | 2 +- domo/domo-tests.ts.tscparams | 2 +- dropzone/dropzone.d.ts.tscparams | 2 +- durandal/durandal-1.x.d.ts.tscparams | 2 +- durandal/durandal.d.ts.tscparams | 2 +- dustjs-linkedin/dustjs-linkedin-tests.ts.tscparams | 2 +- dustjs-linkedin/dustjs-linkedin.d.ts.tscparams | 2 +- ember/ember-tests.ts.tscparams | 2 +- ember/ember.d.ts.tscparams | 2 +- epiceditor/epiceditor-tests.ts.tscparams | 2 +- epiceditor/epiceditor.d.ts.tscparams | 2 +- express/express-tests.ts.tscparams | 2 +- extjs/ExtJS-tests.ts.tscparams | 2 +- fabricjs/fabricjs-tests.ts.tscparams | 2 +- fabricjs/fabricjs.d.ts.tscparams | 2 +- fancybox/fancybox-tests.ts.tscparams | 2 +- fancybox/fancybox.d.ts.tscparams | 2 +- flexSlider/flexSlider-tests.ts.tscparams | 2 +- flexSlider/flexSlider.d.ts.tscparams | 2 +- flot/jquery.flot.d.ts.tscparams | 2 +- foundation/foundation-tests.ts.tscparams | 2 +- foundation/foundation.d.ts.tscparams | 2 +- fullCalendar/fullCalendar-tests.ts.tscparams | 2 +- gamequery/gamequery-tests.ts.tscparams | 2 +- giraffe/giraffe-tests.ts.tscparams | 2 +- giraffe/giraffe.d.ts.tscparams | 2 +- globalize/globalize-tests.ts.tscparams | 2 +- goJS/goJS-tests.ts.tscparams | 2 +- goJS/goJS.d.ts.tscparams | 2 +- history/history-tests.ts.tscparams | 2 +- history/history.d.ts.tscparams | 2 +- humane/humane-tests.ts.tscparams | 2 +- humane/humane.d.ts.tscparams | 2 +- jake/jake-tests.ts.tscparams | 2 +- jasmine-fixture/jasmine-fixture-tests.ts.tscparams | 2 +- jasmine-jquery/jasmine-jquery-tests.ts.tscparams | 2 +- jasmine-jquery/jasmine-jquery.d.ts.tscparams | 2 +- jasmine-matchers/jasmine-matchers-tests.ts.tscparams | 2 +- jointjs/jointjs.d.ts.tscparams | 2 +- jqrangeslider/jqrangeslider-tests.ts.tscparams | 2 +- jqrangeslider/jqrangeslider.d.ts.tscparams | 2 +- jquery.address/jquery.address.d.ts.tscparams | 2 +- jquery.bbq/jquery.bbq-tests.ts.tscparams | 2 +- jquery.bbq/jquery.bbq.d.ts.tscparams | 2 +- jquery.colorbox/jquery.colorbox-tests.ts.tscparams | 2 +- jquery.colorbox/jquery.colorbox.d.ts.tscparams | 2 +- jquery.colorpicker/jquery.colorpicker-tests.ts.tscparams | 2 +- jquery.contextMenu/jquery.contextMenu.d.ts.tscparams | 2 +- jquery.cycle/jquery.cycle-tests.ts.tscparams | 2 +- jquery.dataTables/jquery.dataTables-tests.ts.tscparams | 2 +- jquery.dynatree/jquery.dynatree.d.ts.tscparams | 2 +- jquery.jnotify/jquery.jnotify-tests.ts.tscparams | 2 +- jquery.jnotify/jquery.jnotify.d.ts.tscparams | 2 +- jquery.noty/jquery.noty.d.ts.tscparams | 2 +- jquery.payment/jquery.payment.d.ts.tscparams | 2 +- jquery.pickadate/jquery.pickadate-tests.ts.tscparams | 2 +- jquery.pickadate/jquery.pickadate.d.ts.tscparams | 2 +- jquery.timeago/jquery.timeago-tests.ts.tscparams | 2 +- jquery.timepicker/jquery.timepicker-tests.ts.tscparams | 2 +- jquery.timer/jquery.timer-tests.ts.tscparams | 2 +- jquery.timer/jquery.timer.d.ts.tscparams | 2 +- jquery.tooltipster/jquery.tooltipster-tests.ts.tscparams | 2 +- jquery.tooltipster/jquery.tooltipster.d.ts.tscparams | 2 +- jquery.ui.layout/jquery.ui.layout.d.ts.tscparams | 2 +- jquery.validation/jquery.validation-tests.ts.tscparams | 2 +- jquery.watermark/jquery.watermark-tests.ts.tscparams | 2 +- jquery/jquery-tests.ts.tscparams | 2 +- jquerymobile/jquerymobile-tests.ts.tscparams | 2 +- jqueryui/jqueryui-tests.ts.tscparams | 2 +- js-signals/js-signals.d.ts.tscparams | 2 +- jscrollpane/jscrollpane.d.ts.tscparams | 2 +- jsdeferred/jsdeferred-tests.ts.tscparams | 2 +- jsdeferred/jsdeferred.d.ts.tscparams | 2 +- jsfl/jsfl.d.ts.tscparams | 2 +- jsfl/xJSFL.d.ts.tscparams | 2 +- jsoneditoronline/jsoneditoronline-tests.ts.tscparams | 2 +- jsoneditoronline/jsoneditoronline.d.ts.tscparams | 2 +- jsplumb/jquery.jsPlumb.d.ts.tscparams | 2 +- knockback/knockback.d.ts.tscparams | 2 +- .../knockout.deferred.updates-tests.ts.tscparams | 2 +- .../knockout.deferred.updates.d.ts.tscparams | 2 +- knockout.es5/knockout.es5-tests.ts.tscparams | 2 +- knockout.es5/knockout.es5.d.ts.tscparams | 2 +- knockout.mapping/knockout.mapping.d.ts.tscparams | 2 +- knockout.viewmodel/knockout.viewmodel.d.ts.tscparams | 2 +- knockout/all-tests.ts.tscparams | 2 +- knockout/tests/knockout-templatingBehaviors-tests.ts.tscparams | 2 +- knockout/tests/knockout-tests.ts.tscparams | 2 +- kolite/kolite-tests.ts.tscparams | 2 +- kolite/kolite.d.ts.tscparams | 2 +- less/less-tests.ts.tscparams | 2 +- less/less.d.ts.tscparams | 2 +- levelup/levelup-tests.ts.tscparams | 2 +- levelup/levelup.d.ts.tscparams | 2 +- libxmljs/libxmljs-tests.ts.tscparams | 2 +- libxmljs/libxmljs.d.ts.tscparams | 2 +- linq/linq-tests.ts.tscparams | 2 +- linq/linq.3.0.3-Beta4.d.ts.tscparams | 2 +- linq/linq.d.ts.tscparams | 2 +- linq/linq.jquery.d.ts.tscparams | 2 +- marionette/marionette.d.ts.tscparams | 2 +- meteor/meteor-tests.ts.tscparams | 2 +- meteor/meteor.d.ts.tscparams | 2 +- modernizr/modernizr-tests.ts.tscparams | 2 +- msnodesql/msnodesql-tests.ts.tscparams | 2 +- msnodesql/msnodesql.d.ts.tscparams | 2 +- mustache/mustache-tests.ts.tscparams | 2 +- mustache/mustache.d.ts.tscparams | 2 +- noVNC/noVNC-tests.ts.tscparams | 2 +- noVNC/noVNC.d.ts.tscparams | 2 +- node-fibers/node-fibers-tests.ts.tscparams | 2 +- node-fibers/node-fibers.d.ts.tscparams | 2 +- node/node-0.8.8.d.ts.tscparams | 2 +- node_redis/node_redis-tests.ts.tscparams | 2 +- node_redis/node_redis.d.ts.tscparams | 2 +- parallel/parallel-tests.ts.tscparams | 2 +- pdf/pdf-tests.ts.tscparams | 2 +- pdf/pdf.d.ts.tscparams | 2 +- persona/persona-tests.ts.tscparams | 2 +- persona/persona.d.ts.tscparams | 2 +- phonegap/phonegap-tests.ts.tscparams | 2 +- phonejs/dx.phonejs-tests.ts.tscparams | 2 +- pixi/pixi-tests.ts.tscparams | 2 +- pixi/pixi.d.ts.tscparams | 2 +- popcorn/popcorn.d.ts.tscparams | 2 +- pouchDB/pouch-tests.ts.tscparams | 2 +- pouchDB/pouch.d.ts.tscparams | 2 +- qunit/qunit-tests.ts.tscparams | 2 +- raphael/raphael-tests.ts.tscparams | 2 +- restangular/restangular-tests.ts.tscparams | 2 +- restify/restify-tests.ts.tscparams | 2 +- rethinkdb/rethinkdb-tests.ts.tscparams | 2 +- rethinkdb/rethinkdb.d.ts.tscparams | 2 +- sammyjs/sammyjs-tests.ts.tscparams | 2 +- sammyjs/sammyjs.d.ts.tscparams | 2 +- scroller/scroller-tests.ts.tscparams | 2 +- select2/select2-tests.ts.tscparams | 2 +- sencha_touch/SenchaTouch-Tests.ts.tscparams | 2 +- sharepoint/SharePoint-tests.ts.tscparams | 2 +- sharepoint/SharePoint.d.ts.tscparams | 2 +- siesta/siesta-tests.ts.tscparams | 2 +- siesta/siesta.d.ts.tscparams | 2 +- sinon-chai/sinon-chai-tests.ts.tscparams | 2 +- socket.io/socket.io-tests.ts.tscparams | 2 +- stripe/stripe.d.ts.tscparams | 2 +- swiper/swiper-tests.ts.tscparams | 2 +- swiper/swiper.d.ts.tscparams | 2 +- swipeview/swipeview-tests.ts.tscparams | 2 +- teechart/teechart.d.ts.tscparams | 2 +- threejs/three-tests.ts.tscparams | 3 +-- through/through-tests.ts.tscparams | 2 +- through/through.d.ts.tscparams | 2 +- titanium/titanium-tests.ts.tscparams | 2 +- toastr/toastr-tests.ts.tscparams | 2 +- tween.js/tween.js.d.ts.tscparams | 2 +- underscore/underscore-tests.ts.tscparams | 2 +- unity-webapi/unity-webapi-tests.ts.tscparams | 2 +- unity-webapi/unity-webapi.d.ts.tscparams | 2 +- urijs/URI.d.ts.tscparams | 2 +- viewporter/viewporter-tests.ts.tscparams | 2 +- vimeo/froogaloop.d.ts.tscparams | 2 +- webaudioapi/waa-nightly.d.ts.tscparams | 2 +- webrtc/MediaStream-tests.ts.tscparams | 2 +- webrtc/MediaStream.d.ts.tscparams | 2 +- webrtc/RTCPeerConnection-tests.ts.tscparams | 2 +- webrtc/RTCPeerConnection.d.ts.tscparams | 2 +- xsockets/XSockets-tests.ts.tscparams | 2 +- youtube/youtube.d.ts.tscparams | 2 +- zepto/zepto-tests.ts.tscparams | 2 +- 222 files changed, 222 insertions(+), 223 deletions(-) diff --git a/ace/ace.d.ts.tscparams b/ace/ace.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/ace.d.ts.tscparams +++ b/ace/ace.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/all-tests.ts.tscparams b/ace/all-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/all-tests.ts.tscparams +++ b/ace/all-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-anchor-tests.ts.tscparams b/ace/tests/ace-anchor-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-anchor-tests.ts.tscparams +++ b/ace/tests/ace-anchor-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-background_tokenizer-tests.ts.tscparams b/ace/tests/ace-background_tokenizer-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-background_tokenizer-tests.ts.tscparams +++ b/ace/tests/ace-background_tokenizer-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-default-tests.ts.tscparams b/ace/tests/ace-default-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-default-tests.ts.tscparams +++ b/ace/tests/ace-default-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-document-tests.ts.tscparams b/ace/tests/ace-document-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-document-tests.ts.tscparams +++ b/ace/tests/ace-document-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-edit_session-tests.ts.tscparams b/ace/tests/ace-edit_session-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-edit_session-tests.ts.tscparams +++ b/ace/tests/ace-edit_session-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-editor1-tests.ts.tscparams b/ace/tests/ace-editor1-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-editor1-tests.ts.tscparams +++ b/ace/tests/ace-editor1-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-editor_highlight_selected_word-tests.ts.tscparams b/ace/tests/ace-editor_highlight_selected_word-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-editor_highlight_selected_word-tests.ts.tscparams +++ b/ace/tests/ace-editor_highlight_selected_word-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-editor_navigation-tests.ts.tscparams b/ace/tests/ace-editor_navigation-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-editor_navigation-tests.ts.tscparams +++ b/ace/tests/ace-editor_navigation-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-editor_text_edit-tests.ts.tscparams b/ace/tests/ace-editor_text_edit-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-editor_text_edit-tests.ts.tscparams +++ b/ace/tests/ace-editor_text_edit-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-multi_select-tests.ts.tscparams b/ace/tests/ace-multi_select-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-multi_select-tests.ts.tscparams +++ b/ace/tests/ace-multi_select-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-placeholder-tests.ts.tscparams b/ace/tests/ace-placeholder-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-placeholder-tests.ts.tscparams +++ b/ace/tests/ace-placeholder-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-range-tests.ts.tscparams b/ace/tests/ace-range-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-range-tests.ts.tscparams +++ b/ace/tests/ace-range-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-range_list-tests.ts.tscparams b/ace/tests/ace-range_list-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-range_list-tests.ts.tscparams +++ b/ace/tests/ace-range_list-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-search-tests.ts.tscparams b/ace/tests/ace-search-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-search-tests.ts.tscparams +++ b/ace/tests/ace-search-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-selection-tests.ts.tscparams b/ace/tests/ace-selection-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-selection-tests.ts.tscparams +++ b/ace/tests/ace-selection-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-token_iterator-tests.ts.tscparams b/ace/tests/ace-token_iterator-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-token_iterator-tests.ts.tscparams +++ b/ace/tests/ace-token_iterator-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ace/tests/ace-virtual_renderer-tests.ts.tscparams b/ace/tests/ace-virtual_renderer-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ace/tests/ace-virtual_renderer-tests.ts.tscparams +++ b/ace/tests/ace-virtual_renderer-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/amcharts/AmCharts.d.ts.tscparams b/amcharts/AmCharts.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/amcharts/AmCharts.d.ts.tscparams +++ b/amcharts/AmCharts.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/amplifyjs/amplifyjs-tests.ts.tscparams b/amplifyjs/amplifyjs-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/amplifyjs/amplifyjs-tests.ts.tscparams +++ b/amplifyjs/amplifyjs-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/amplifyjs/amplifyjs.d.ts.tscparams b/amplifyjs/amplifyjs.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/amplifyjs/amplifyjs.d.ts.tscparams +++ b/amplifyjs/amplifyjs.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/angularjs/legacy/angular-1.0-tests.ts.tscparams b/angularjs/legacy/angular-1.0-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/angularjs/legacy/angular-1.0-tests.ts.tscparams +++ b/angularjs/legacy/angular-1.0-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/angularjs/legacy/angular-scenario-1.0.d.ts.tscparams b/angularjs/legacy/angular-scenario-1.0.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/angularjs/legacy/angular-scenario-1.0.d.ts.tscparams +++ b/angularjs/legacy/angular-scenario-1.0.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/asciify/asciify.ts.tscparams b/asciify/asciify.ts.tscparams index 64dbb84a5..d68b297cb 100644 --- a/asciify/asciify.ts.tscparams +++ b/asciify/asciify.ts.tscparams @@ -1 +1 @@ -"--noImplicitAny --module commonjs" \ No newline at end of file +--noImplicitAny --module commonjs diff --git a/async/async-tests.ts.tscparams b/async/async-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/async/async-tests.ts.tscparams +++ b/async/async-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/atom/atom-tests.ts.tscparams b/atom/atom-tests.ts.tscparams index 5f84b9777..6331805a5 100644 --- a/atom/atom-tests.ts.tscparams +++ b/atom/atom-tests.ts.tscparams @@ -1 +1 @@ ---noImplicitAny --module commonjs --target es5 +--noImplicitAny --module commonjs --target es5 diff --git a/azure-mobile-services-client/AzureMobileServicesClient-tests.ts.tscparams b/azure-mobile-services-client/AzureMobileServicesClient-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/azure-mobile-services-client/AzureMobileServicesClient-tests.ts.tscparams +++ b/azure-mobile-services-client/AzureMobileServicesClient-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/backbone-relational/backbone-relational-tests.ts.tscparams b/backbone-relational/backbone-relational-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/backbone-relational/backbone-relational-tests.ts.tscparams +++ b/backbone-relational/backbone-relational-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/backbone-relational/backbone-relational.d.ts.tscparams b/backbone-relational/backbone-relational.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/backbone-relational/backbone-relational.d.ts.tscparams +++ b/backbone-relational/backbone-relational.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/backgrid/backgrid-tests.ts.tscparams b/backgrid/backgrid-tests.ts.tscparams index e85b4ac55..d45eb7650 100644 --- a/backgrid/backgrid-tests.ts.tscparams +++ b/backgrid/backgrid-tests.ts.tscparams @@ -1 +1 @@ ---target ES5 \ No newline at end of file +--target ES5 diff --git a/backgrid/backgrid.d.ts.tscparams b/backgrid/backgrid.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/backgrid/backgrid.d.ts.tscparams +++ b/backgrid/backgrid.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/bootstrap-notify/bootstrap-notify.d.ts.tscparams b/bootstrap-notify/bootstrap-notify.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/bootstrap-notify/bootstrap-notify.d.ts.tscparams +++ b/bootstrap-notify/bootstrap-notify.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/bootstrap.paginator/bootstrap.paginator.d.ts.tscparams b/bootstrap.paginator/bootstrap.paginator.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/bootstrap.paginator/bootstrap.paginator.d.ts.tscparams +++ b/bootstrap.paginator/bootstrap.paginator.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/browser-harness/browser-harness-tests.ts.tscparams b/browser-harness/browser-harness-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/browser-harness/browser-harness-tests.ts.tscparams +++ b/browser-harness/browser-harness-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/browser-harness/browser-harness.d.ts.tscparams b/browser-harness/browser-harness.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/browser-harness/browser-harness.d.ts.tscparams +++ b/browser-harness/browser-harness.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/camljs/camljs-tests.ts.tscparams b/camljs/camljs-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/camljs/camljs-tests.ts.tscparams +++ b/camljs/camljs-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/camljs/camljs.d.ts.tscparams b/camljs/camljs.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/camljs/camljs.d.ts.tscparams +++ b/camljs/camljs.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/chai-fuzzy/chai-fuzzy.d.ts.tscparams b/chai-fuzzy/chai-fuzzy.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/chai-fuzzy/chai-fuzzy.d.ts.tscparams +++ b/chai-fuzzy/chai-fuzzy.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/chai-jquery/chai-jquery-tests.ts.tscparams b/chai-jquery/chai-jquery-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/chai-jquery/chai-jquery-tests.ts.tscparams +++ b/chai-jquery/chai-jquery-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/chai/chai-tests.ts.tscparams b/chai/chai-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/chai/chai-tests.ts.tscparams +++ b/chai/chai-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/chrome/chrome-app-tests.ts.tscparams b/chrome/chrome-app-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/chrome/chrome-app-tests.ts.tscparams +++ b/chrome/chrome-app-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/chrome/chrome-app.d.ts.tscparams b/chrome/chrome-app.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/chrome/chrome-app.d.ts.tscparams +++ b/chrome/chrome-app.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/chrome/chrome-tests.ts.tscparams b/chrome/chrome-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/chrome/chrome-tests.ts.tscparams +++ b/chrome/chrome-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/convert-source-map/convert-source-map-tests.ts.tscparams b/convert-source-map/convert-source-map-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/convert-source-map/convert-source-map-tests.ts.tscparams +++ b/convert-source-map/convert-source-map-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/convert-source-map/convert-source-map.d.ts.tscparams b/convert-source-map/convert-source-map.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/convert-source-map/convert-source-map.d.ts.tscparams +++ b/convert-source-map/convert-source-map.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/crossroads/crossroads-tests.ts.tscparams b/crossroads/crossroads-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/crossroads/crossroads-tests.ts.tscparams +++ b/crossroads/crossroads-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/crossroads/crossroads.d.ts.tscparams b/crossroads/crossroads.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/crossroads/crossroads.d.ts.tscparams +++ b/crossroads/crossroads.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/d3/d3-tests.ts.tscparams b/d3/d3-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/d3/d3-tests.ts.tscparams +++ b/d3/d3-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/d3/plugins/d3.superformula-tests.ts.tscparams b/d3/plugins/d3.superformula-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/d3/plugins/d3.superformula-tests.ts.tscparams +++ b/d3/plugins/d3.superformula-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/dhtmlxgantt/dhtmlxgantt-tests.ts.tscparams b/dhtmlxgantt/dhtmlxgantt-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/dhtmlxgantt/dhtmlxgantt-tests.ts.tscparams +++ b/dhtmlxgantt/dhtmlxgantt-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/dhtmlxgantt/dhtmlxgantt.d.ts.tscparams b/dhtmlxgantt/dhtmlxgantt.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/dhtmlxgantt/dhtmlxgantt.d.ts.tscparams +++ b/dhtmlxgantt/dhtmlxgantt.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/dhtmlxscheduler/dhtmlxscheduler-tests.ts.tscparams b/dhtmlxscheduler/dhtmlxscheduler-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/dhtmlxscheduler/dhtmlxscheduler-tests.ts.tscparams +++ b/dhtmlxscheduler/dhtmlxscheduler-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/dhtmlxscheduler/dhtmlxscheduler.d.ts.tscparams b/dhtmlxscheduler/dhtmlxscheduler.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/dhtmlxscheduler/dhtmlxscheduler.d.ts.tscparams +++ b/dhtmlxscheduler/dhtmlxscheduler.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/domo/domo-tests.ts.tscparams b/domo/domo-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/domo/domo-tests.ts.tscparams +++ b/domo/domo-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/dropzone/dropzone.d.ts.tscparams b/dropzone/dropzone.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/dropzone/dropzone.d.ts.tscparams +++ b/dropzone/dropzone.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/durandal/durandal-1.x.d.ts.tscparams b/durandal/durandal-1.x.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/durandal/durandal-1.x.d.ts.tscparams +++ b/durandal/durandal-1.x.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/durandal/durandal.d.ts.tscparams b/durandal/durandal.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/durandal/durandal.d.ts.tscparams +++ b/durandal/durandal.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/dustjs-linkedin/dustjs-linkedin-tests.ts.tscparams b/dustjs-linkedin/dustjs-linkedin-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/dustjs-linkedin/dustjs-linkedin-tests.ts.tscparams +++ b/dustjs-linkedin/dustjs-linkedin-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/dustjs-linkedin/dustjs-linkedin.d.ts.tscparams b/dustjs-linkedin/dustjs-linkedin.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/dustjs-linkedin/dustjs-linkedin.d.ts.tscparams +++ b/dustjs-linkedin/dustjs-linkedin.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ember/ember-tests.ts.tscparams b/ember/ember-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ember/ember-tests.ts.tscparams +++ b/ember/ember-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/ember/ember.d.ts.tscparams b/ember/ember.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/ember/ember.d.ts.tscparams +++ b/ember/ember.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/epiceditor/epiceditor-tests.ts.tscparams b/epiceditor/epiceditor-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/epiceditor/epiceditor-tests.ts.tscparams +++ b/epiceditor/epiceditor-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/epiceditor/epiceditor.d.ts.tscparams b/epiceditor/epiceditor.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/epiceditor/epiceditor.d.ts.tscparams +++ b/epiceditor/epiceditor.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/express/express-tests.ts.tscparams b/express/express-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/express/express-tests.ts.tscparams +++ b/express/express-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/extjs/ExtJS-tests.ts.tscparams b/extjs/ExtJS-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/extjs/ExtJS-tests.ts.tscparams +++ b/extjs/ExtJS-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/fabricjs/fabricjs-tests.ts.tscparams b/fabricjs/fabricjs-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/fabricjs/fabricjs-tests.ts.tscparams +++ b/fabricjs/fabricjs-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/fabricjs/fabricjs.d.ts.tscparams b/fabricjs/fabricjs.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/fabricjs/fabricjs.d.ts.tscparams +++ b/fabricjs/fabricjs.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/fancybox/fancybox-tests.ts.tscparams b/fancybox/fancybox-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/fancybox/fancybox-tests.ts.tscparams +++ b/fancybox/fancybox-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/fancybox/fancybox.d.ts.tscparams b/fancybox/fancybox.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/fancybox/fancybox.d.ts.tscparams +++ b/fancybox/fancybox.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/flexSlider/flexSlider-tests.ts.tscparams b/flexSlider/flexSlider-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/flexSlider/flexSlider-tests.ts.tscparams +++ b/flexSlider/flexSlider-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/flexSlider/flexSlider.d.ts.tscparams b/flexSlider/flexSlider.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/flexSlider/flexSlider.d.ts.tscparams +++ b/flexSlider/flexSlider.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/flot/jquery.flot.d.ts.tscparams b/flot/jquery.flot.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/flot/jquery.flot.d.ts.tscparams +++ b/flot/jquery.flot.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/foundation/foundation-tests.ts.tscparams b/foundation/foundation-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/foundation/foundation-tests.ts.tscparams +++ b/foundation/foundation-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/foundation/foundation.d.ts.tscparams b/foundation/foundation.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/foundation/foundation.d.ts.tscparams +++ b/foundation/foundation.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/fullCalendar/fullCalendar-tests.ts.tscparams b/fullCalendar/fullCalendar-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/fullCalendar/fullCalendar-tests.ts.tscparams +++ b/fullCalendar/fullCalendar-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/gamequery/gamequery-tests.ts.tscparams b/gamequery/gamequery-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/gamequery/gamequery-tests.ts.tscparams +++ b/gamequery/gamequery-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/giraffe/giraffe-tests.ts.tscparams b/giraffe/giraffe-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/giraffe/giraffe-tests.ts.tscparams +++ b/giraffe/giraffe-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/giraffe/giraffe.d.ts.tscparams b/giraffe/giraffe.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/giraffe/giraffe.d.ts.tscparams +++ b/giraffe/giraffe.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/globalize/globalize-tests.ts.tscparams b/globalize/globalize-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/globalize/globalize-tests.ts.tscparams +++ b/globalize/globalize-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/goJS/goJS-tests.ts.tscparams b/goJS/goJS-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/goJS/goJS-tests.ts.tscparams +++ b/goJS/goJS-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/goJS/goJS.d.ts.tscparams b/goJS/goJS.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/goJS/goJS.d.ts.tscparams +++ b/goJS/goJS.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/history/history-tests.ts.tscparams b/history/history-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/history/history-tests.ts.tscparams +++ b/history/history-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/history/history.d.ts.tscparams b/history/history.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/history/history.d.ts.tscparams +++ b/history/history.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/humane/humane-tests.ts.tscparams b/humane/humane-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/humane/humane-tests.ts.tscparams +++ b/humane/humane-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/humane/humane.d.ts.tscparams b/humane/humane.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/humane/humane.d.ts.tscparams +++ b/humane/humane.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jake/jake-tests.ts.tscparams b/jake/jake-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jake/jake-tests.ts.tscparams +++ b/jake/jake-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jasmine-fixture/jasmine-fixture-tests.ts.tscparams b/jasmine-fixture/jasmine-fixture-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jasmine-fixture/jasmine-fixture-tests.ts.tscparams +++ b/jasmine-fixture/jasmine-fixture-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jasmine-jquery/jasmine-jquery-tests.ts.tscparams b/jasmine-jquery/jasmine-jquery-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jasmine-jquery/jasmine-jquery-tests.ts.tscparams +++ b/jasmine-jquery/jasmine-jquery-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jasmine-jquery/jasmine-jquery.d.ts.tscparams b/jasmine-jquery/jasmine-jquery.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jasmine-jquery/jasmine-jquery.d.ts.tscparams +++ b/jasmine-jquery/jasmine-jquery.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jasmine-matchers/jasmine-matchers-tests.ts.tscparams b/jasmine-matchers/jasmine-matchers-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jasmine-matchers/jasmine-matchers-tests.ts.tscparams +++ b/jasmine-matchers/jasmine-matchers-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jointjs/jointjs.d.ts.tscparams b/jointjs/jointjs.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jointjs/jointjs.d.ts.tscparams +++ b/jointjs/jointjs.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jqrangeslider/jqrangeslider-tests.ts.tscparams b/jqrangeslider/jqrangeslider-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jqrangeslider/jqrangeslider-tests.ts.tscparams +++ b/jqrangeslider/jqrangeslider-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jqrangeslider/jqrangeslider.d.ts.tscparams b/jqrangeslider/jqrangeslider.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jqrangeslider/jqrangeslider.d.ts.tscparams +++ b/jqrangeslider/jqrangeslider.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.address/jquery.address.d.ts.tscparams b/jquery.address/jquery.address.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.address/jquery.address.d.ts.tscparams +++ b/jquery.address/jquery.address.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.bbq/jquery.bbq-tests.ts.tscparams b/jquery.bbq/jquery.bbq-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.bbq/jquery.bbq-tests.ts.tscparams +++ b/jquery.bbq/jquery.bbq-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.bbq/jquery.bbq.d.ts.tscparams b/jquery.bbq/jquery.bbq.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.bbq/jquery.bbq.d.ts.tscparams +++ b/jquery.bbq/jquery.bbq.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.colorbox/jquery.colorbox-tests.ts.tscparams b/jquery.colorbox/jquery.colorbox-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.colorbox/jquery.colorbox-tests.ts.tscparams +++ b/jquery.colorbox/jquery.colorbox-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.colorbox/jquery.colorbox.d.ts.tscparams b/jquery.colorbox/jquery.colorbox.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.colorbox/jquery.colorbox.d.ts.tscparams +++ b/jquery.colorbox/jquery.colorbox.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.colorpicker/jquery.colorpicker-tests.ts.tscparams b/jquery.colorpicker/jquery.colorpicker-tests.ts.tscparams index 3cc762b55..d3f5a12fa 100644 --- a/jquery.colorpicker/jquery.colorpicker-tests.ts.tscparams +++ b/jquery.colorpicker/jquery.colorpicker-tests.ts.tscparams @@ -1 +1 @@ -"" \ No newline at end of file + diff --git a/jquery.contextMenu/jquery.contextMenu.d.ts.tscparams b/jquery.contextMenu/jquery.contextMenu.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.contextMenu/jquery.contextMenu.d.ts.tscparams +++ b/jquery.contextMenu/jquery.contextMenu.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.cycle/jquery.cycle-tests.ts.tscparams b/jquery.cycle/jquery.cycle-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.cycle/jquery.cycle-tests.ts.tscparams +++ b/jquery.cycle/jquery.cycle-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.dataTables/jquery.dataTables-tests.ts.tscparams b/jquery.dataTables/jquery.dataTables-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.dataTables/jquery.dataTables-tests.ts.tscparams +++ b/jquery.dataTables/jquery.dataTables-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.dynatree/jquery.dynatree.d.ts.tscparams b/jquery.dynatree/jquery.dynatree.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.dynatree/jquery.dynatree.d.ts.tscparams +++ b/jquery.dynatree/jquery.dynatree.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.jnotify/jquery.jnotify-tests.ts.tscparams b/jquery.jnotify/jquery.jnotify-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.jnotify/jquery.jnotify-tests.ts.tscparams +++ b/jquery.jnotify/jquery.jnotify-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.jnotify/jquery.jnotify.d.ts.tscparams b/jquery.jnotify/jquery.jnotify.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.jnotify/jquery.jnotify.d.ts.tscparams +++ b/jquery.jnotify/jquery.jnotify.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.noty/jquery.noty.d.ts.tscparams b/jquery.noty/jquery.noty.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.noty/jquery.noty.d.ts.tscparams +++ b/jquery.noty/jquery.noty.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.payment/jquery.payment.d.ts.tscparams b/jquery.payment/jquery.payment.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.payment/jquery.payment.d.ts.tscparams +++ b/jquery.payment/jquery.payment.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.pickadate/jquery.pickadate-tests.ts.tscparams b/jquery.pickadate/jquery.pickadate-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.pickadate/jquery.pickadate-tests.ts.tscparams +++ b/jquery.pickadate/jquery.pickadate-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.pickadate/jquery.pickadate.d.ts.tscparams b/jquery.pickadate/jquery.pickadate.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.pickadate/jquery.pickadate.d.ts.tscparams +++ b/jquery.pickadate/jquery.pickadate.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.timeago/jquery.timeago-tests.ts.tscparams b/jquery.timeago/jquery.timeago-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.timeago/jquery.timeago-tests.ts.tscparams +++ b/jquery.timeago/jquery.timeago-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.timepicker/jquery.timepicker-tests.ts.tscparams b/jquery.timepicker/jquery.timepicker-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.timepicker/jquery.timepicker-tests.ts.tscparams +++ b/jquery.timepicker/jquery.timepicker-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.timer/jquery.timer-tests.ts.tscparams b/jquery.timer/jquery.timer-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.timer/jquery.timer-tests.ts.tscparams +++ b/jquery.timer/jquery.timer-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.timer/jquery.timer.d.ts.tscparams b/jquery.timer/jquery.timer.d.ts.tscparams index 3cc762b55..d3f5a12fa 100644 --- a/jquery.timer/jquery.timer.d.ts.tscparams +++ b/jquery.timer/jquery.timer.d.ts.tscparams @@ -1 +1 @@ -"" \ No newline at end of file + diff --git a/jquery.tooltipster/jquery.tooltipster-tests.ts.tscparams b/jquery.tooltipster/jquery.tooltipster-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.tooltipster/jquery.tooltipster-tests.ts.tscparams +++ b/jquery.tooltipster/jquery.tooltipster-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.tooltipster/jquery.tooltipster.d.ts.tscparams b/jquery.tooltipster/jquery.tooltipster.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.tooltipster/jquery.tooltipster.d.ts.tscparams +++ b/jquery.tooltipster/jquery.tooltipster.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.ui.layout/jquery.ui.layout.d.ts.tscparams b/jquery.ui.layout/jquery.ui.layout.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.ui.layout/jquery.ui.layout.d.ts.tscparams +++ b/jquery.ui.layout/jquery.ui.layout.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.validation/jquery.validation-tests.ts.tscparams b/jquery.validation/jquery.validation-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.validation/jquery.validation-tests.ts.tscparams +++ b/jquery.validation/jquery.validation-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery.watermark/jquery.watermark-tests.ts.tscparams b/jquery.watermark/jquery.watermark-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery.watermark/jquery.watermark-tests.ts.tscparams +++ b/jquery.watermark/jquery.watermark-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquery/jquery-tests.ts.tscparams b/jquery/jquery-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquery/jquery-tests.ts.tscparams +++ b/jquery/jquery-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jquerymobile/jquerymobile-tests.ts.tscparams b/jquerymobile/jquerymobile-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jquerymobile/jquerymobile-tests.ts.tscparams +++ b/jquerymobile/jquerymobile-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jqueryui/jqueryui-tests.ts.tscparams b/jqueryui/jqueryui-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jqueryui/jqueryui-tests.ts.tscparams +++ b/jqueryui/jqueryui-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/js-signals/js-signals.d.ts.tscparams b/js-signals/js-signals.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/js-signals/js-signals.d.ts.tscparams +++ b/js-signals/js-signals.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jscrollpane/jscrollpane.d.ts.tscparams b/jscrollpane/jscrollpane.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jscrollpane/jscrollpane.d.ts.tscparams +++ b/jscrollpane/jscrollpane.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jsdeferred/jsdeferred-tests.ts.tscparams b/jsdeferred/jsdeferred-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jsdeferred/jsdeferred-tests.ts.tscparams +++ b/jsdeferred/jsdeferred-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jsdeferred/jsdeferred.d.ts.tscparams b/jsdeferred/jsdeferred.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jsdeferred/jsdeferred.d.ts.tscparams +++ b/jsdeferred/jsdeferred.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jsfl/jsfl.d.ts.tscparams b/jsfl/jsfl.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jsfl/jsfl.d.ts.tscparams +++ b/jsfl/jsfl.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jsfl/xJSFL.d.ts.tscparams b/jsfl/xJSFL.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jsfl/xJSFL.d.ts.tscparams +++ b/jsfl/xJSFL.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jsoneditoronline/jsoneditoronline-tests.ts.tscparams b/jsoneditoronline/jsoneditoronline-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jsoneditoronline/jsoneditoronline-tests.ts.tscparams +++ b/jsoneditoronline/jsoneditoronline-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jsoneditoronline/jsoneditoronline.d.ts.tscparams b/jsoneditoronline/jsoneditoronline.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jsoneditoronline/jsoneditoronline.d.ts.tscparams +++ b/jsoneditoronline/jsoneditoronline.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/jsplumb/jquery.jsPlumb.d.ts.tscparams b/jsplumb/jquery.jsPlumb.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/jsplumb/jquery.jsPlumb.d.ts.tscparams +++ b/jsplumb/jquery.jsPlumb.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/knockback/knockback.d.ts.tscparams b/knockback/knockback.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/knockback/knockback.d.ts.tscparams +++ b/knockback/knockback.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/knockout.deferred.updates/knockout.deferred.updates-tests.ts.tscparams b/knockout.deferred.updates/knockout.deferred.updates-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/knockout.deferred.updates/knockout.deferred.updates-tests.ts.tscparams +++ b/knockout.deferred.updates/knockout.deferred.updates-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/knockout.deferred.updates/knockout.deferred.updates.d.ts.tscparams b/knockout.deferred.updates/knockout.deferred.updates.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/knockout.deferred.updates/knockout.deferred.updates.d.ts.tscparams +++ b/knockout.deferred.updates/knockout.deferred.updates.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/knockout.es5/knockout.es5-tests.ts.tscparams b/knockout.es5/knockout.es5-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/knockout.es5/knockout.es5-tests.ts.tscparams +++ b/knockout.es5/knockout.es5-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/knockout.es5/knockout.es5.d.ts.tscparams b/knockout.es5/knockout.es5.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/knockout.es5/knockout.es5.d.ts.tscparams +++ b/knockout.es5/knockout.es5.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/knockout.mapping/knockout.mapping.d.ts.tscparams b/knockout.mapping/knockout.mapping.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/knockout.mapping/knockout.mapping.d.ts.tscparams +++ b/knockout.mapping/knockout.mapping.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/knockout.viewmodel/knockout.viewmodel.d.ts.tscparams b/knockout.viewmodel/knockout.viewmodel.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/knockout.viewmodel/knockout.viewmodel.d.ts.tscparams +++ b/knockout.viewmodel/knockout.viewmodel.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/knockout/all-tests.ts.tscparams b/knockout/all-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/knockout/all-tests.ts.tscparams +++ b/knockout/all-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/knockout/tests/knockout-templatingBehaviors-tests.ts.tscparams b/knockout/tests/knockout-templatingBehaviors-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/knockout/tests/knockout-templatingBehaviors-tests.ts.tscparams +++ b/knockout/tests/knockout-templatingBehaviors-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/knockout/tests/knockout-tests.ts.tscparams b/knockout/tests/knockout-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/knockout/tests/knockout-tests.ts.tscparams +++ b/knockout/tests/knockout-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/kolite/kolite-tests.ts.tscparams b/kolite/kolite-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/kolite/kolite-tests.ts.tscparams +++ b/kolite/kolite-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/kolite/kolite.d.ts.tscparams b/kolite/kolite.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/kolite/kolite.d.ts.tscparams +++ b/kolite/kolite.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/less/less-tests.ts.tscparams b/less/less-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/less/less-tests.ts.tscparams +++ b/less/less-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/less/less.d.ts.tscparams b/less/less.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/less/less.d.ts.tscparams +++ b/less/less.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/levelup/levelup-tests.ts.tscparams b/levelup/levelup-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/levelup/levelup-tests.ts.tscparams +++ b/levelup/levelup-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/levelup/levelup.d.ts.tscparams b/levelup/levelup.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/levelup/levelup.d.ts.tscparams +++ b/levelup/levelup.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/libxmljs/libxmljs-tests.ts.tscparams b/libxmljs/libxmljs-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/libxmljs/libxmljs-tests.ts.tscparams +++ b/libxmljs/libxmljs-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/libxmljs/libxmljs.d.ts.tscparams b/libxmljs/libxmljs.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/libxmljs/libxmljs.d.ts.tscparams +++ b/libxmljs/libxmljs.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/linq/linq-tests.ts.tscparams b/linq/linq-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/linq/linq-tests.ts.tscparams +++ b/linq/linq-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/linq/linq.3.0.3-Beta4.d.ts.tscparams b/linq/linq.3.0.3-Beta4.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/linq/linq.3.0.3-Beta4.d.ts.tscparams +++ b/linq/linq.3.0.3-Beta4.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/linq/linq.d.ts.tscparams b/linq/linq.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/linq/linq.d.ts.tscparams +++ b/linq/linq.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/linq/linq.jquery.d.ts.tscparams b/linq/linq.jquery.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/linq/linq.jquery.d.ts.tscparams +++ b/linq/linq.jquery.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/marionette/marionette.d.ts.tscparams b/marionette/marionette.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/marionette/marionette.d.ts.tscparams +++ b/marionette/marionette.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/meteor/meteor-tests.ts.tscparams b/meteor/meteor-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/meteor/meteor-tests.ts.tscparams +++ b/meteor/meteor-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/meteor/meteor.d.ts.tscparams b/meteor/meteor.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/meteor/meteor.d.ts.tscparams +++ b/meteor/meteor.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/modernizr/modernizr-tests.ts.tscparams b/modernizr/modernizr-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/modernizr/modernizr-tests.ts.tscparams +++ b/modernizr/modernizr-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/msnodesql/msnodesql-tests.ts.tscparams b/msnodesql/msnodesql-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/msnodesql/msnodesql-tests.ts.tscparams +++ b/msnodesql/msnodesql-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/msnodesql/msnodesql.d.ts.tscparams b/msnodesql/msnodesql.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/msnodesql/msnodesql.d.ts.tscparams +++ b/msnodesql/msnodesql.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/mustache/mustache-tests.ts.tscparams b/mustache/mustache-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/mustache/mustache-tests.ts.tscparams +++ b/mustache/mustache-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/mustache/mustache.d.ts.tscparams b/mustache/mustache.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/mustache/mustache.d.ts.tscparams +++ b/mustache/mustache.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/noVNC/noVNC-tests.ts.tscparams b/noVNC/noVNC-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/noVNC/noVNC-tests.ts.tscparams +++ b/noVNC/noVNC-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/noVNC/noVNC.d.ts.tscparams b/noVNC/noVNC.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/noVNC/noVNC.d.ts.tscparams +++ b/noVNC/noVNC.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/node-fibers/node-fibers-tests.ts.tscparams b/node-fibers/node-fibers-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/node-fibers/node-fibers-tests.ts.tscparams +++ b/node-fibers/node-fibers-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/node-fibers/node-fibers.d.ts.tscparams b/node-fibers/node-fibers.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/node-fibers/node-fibers.d.ts.tscparams +++ b/node-fibers/node-fibers.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/node/node-0.8.8.d.ts.tscparams b/node/node-0.8.8.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/node/node-0.8.8.d.ts.tscparams +++ b/node/node-0.8.8.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/node_redis/node_redis-tests.ts.tscparams b/node_redis/node_redis-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/node_redis/node_redis-tests.ts.tscparams +++ b/node_redis/node_redis-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/node_redis/node_redis.d.ts.tscparams b/node_redis/node_redis.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/node_redis/node_redis.d.ts.tscparams +++ b/node_redis/node_redis.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/parallel/parallel-tests.ts.tscparams b/parallel/parallel-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/parallel/parallel-tests.ts.tscparams +++ b/parallel/parallel-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/pdf/pdf-tests.ts.tscparams b/pdf/pdf-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/pdf/pdf-tests.ts.tscparams +++ b/pdf/pdf-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/pdf/pdf.d.ts.tscparams b/pdf/pdf.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/pdf/pdf.d.ts.tscparams +++ b/pdf/pdf.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/persona/persona-tests.ts.tscparams b/persona/persona-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/persona/persona-tests.ts.tscparams +++ b/persona/persona-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/persona/persona.d.ts.tscparams b/persona/persona.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/persona/persona.d.ts.tscparams +++ b/persona/persona.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/phonegap/phonegap-tests.ts.tscparams b/phonegap/phonegap-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/phonegap/phonegap-tests.ts.tscparams +++ b/phonegap/phonegap-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/phonejs/dx.phonejs-tests.ts.tscparams b/phonejs/dx.phonejs-tests.ts.tscparams index 3cc762b55..d3f5a12fa 100644 --- a/phonejs/dx.phonejs-tests.ts.tscparams +++ b/phonejs/dx.phonejs-tests.ts.tscparams @@ -1 +1 @@ -"" \ No newline at end of file + diff --git a/pixi/pixi-tests.ts.tscparams b/pixi/pixi-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/pixi/pixi-tests.ts.tscparams +++ b/pixi/pixi-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/pixi/pixi.d.ts.tscparams b/pixi/pixi.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/pixi/pixi.d.ts.tscparams +++ b/pixi/pixi.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/popcorn/popcorn.d.ts.tscparams b/popcorn/popcorn.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/popcorn/popcorn.d.ts.tscparams +++ b/popcorn/popcorn.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/pouchDB/pouch-tests.ts.tscparams b/pouchDB/pouch-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/pouchDB/pouch-tests.ts.tscparams +++ b/pouchDB/pouch-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/pouchDB/pouch.d.ts.tscparams b/pouchDB/pouch.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/pouchDB/pouch.d.ts.tscparams +++ b/pouchDB/pouch.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/qunit/qunit-tests.ts.tscparams b/qunit/qunit-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/qunit/qunit-tests.ts.tscparams +++ b/qunit/qunit-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/raphael/raphael-tests.ts.tscparams b/raphael/raphael-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/raphael/raphael-tests.ts.tscparams +++ b/raphael/raphael-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/restangular/restangular-tests.ts.tscparams b/restangular/restangular-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/restangular/restangular-tests.ts.tscparams +++ b/restangular/restangular-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/restify/restify-tests.ts.tscparams b/restify/restify-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/restify/restify-tests.ts.tscparams +++ b/restify/restify-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/rethinkdb/rethinkdb-tests.ts.tscparams b/rethinkdb/rethinkdb-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/rethinkdb/rethinkdb-tests.ts.tscparams +++ b/rethinkdb/rethinkdb-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/rethinkdb/rethinkdb.d.ts.tscparams b/rethinkdb/rethinkdb.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/rethinkdb/rethinkdb.d.ts.tscparams +++ b/rethinkdb/rethinkdb.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/sammyjs/sammyjs-tests.ts.tscparams b/sammyjs/sammyjs-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/sammyjs/sammyjs-tests.ts.tscparams +++ b/sammyjs/sammyjs-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/sammyjs/sammyjs.d.ts.tscparams b/sammyjs/sammyjs.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/sammyjs/sammyjs.d.ts.tscparams +++ b/sammyjs/sammyjs.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/scroller/scroller-tests.ts.tscparams b/scroller/scroller-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/scroller/scroller-tests.ts.tscparams +++ b/scroller/scroller-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/select2/select2-tests.ts.tscparams b/select2/select2-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/select2/select2-tests.ts.tscparams +++ b/select2/select2-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/sencha_touch/SenchaTouch-Tests.ts.tscparams b/sencha_touch/SenchaTouch-Tests.ts.tscparams index 3cc762b55..d3f5a12fa 100644 --- a/sencha_touch/SenchaTouch-Tests.ts.tscparams +++ b/sencha_touch/SenchaTouch-Tests.ts.tscparams @@ -1 +1 @@ -"" \ No newline at end of file + diff --git a/sharepoint/SharePoint-tests.ts.tscparams b/sharepoint/SharePoint-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/sharepoint/SharePoint-tests.ts.tscparams +++ b/sharepoint/SharePoint-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/sharepoint/SharePoint.d.ts.tscparams b/sharepoint/SharePoint.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/sharepoint/SharePoint.d.ts.tscparams +++ b/sharepoint/SharePoint.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/siesta/siesta-tests.ts.tscparams b/siesta/siesta-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/siesta/siesta-tests.ts.tscparams +++ b/siesta/siesta-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/siesta/siesta.d.ts.tscparams b/siesta/siesta.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/siesta/siesta.d.ts.tscparams +++ b/siesta/siesta.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/sinon-chai/sinon-chai-tests.ts.tscparams b/sinon-chai/sinon-chai-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/sinon-chai/sinon-chai-tests.ts.tscparams +++ b/sinon-chai/sinon-chai-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/socket.io/socket.io-tests.ts.tscparams b/socket.io/socket.io-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/socket.io/socket.io-tests.ts.tscparams +++ b/socket.io/socket.io-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/stripe/stripe.d.ts.tscparams b/stripe/stripe.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/stripe/stripe.d.ts.tscparams +++ b/stripe/stripe.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/swiper/swiper-tests.ts.tscparams b/swiper/swiper-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/swiper/swiper-tests.ts.tscparams +++ b/swiper/swiper-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/swiper/swiper.d.ts.tscparams b/swiper/swiper.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/swiper/swiper.d.ts.tscparams +++ b/swiper/swiper.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/swipeview/swipeview-tests.ts.tscparams b/swipeview/swipeview-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/swipeview/swipeview-tests.ts.tscparams +++ b/swipeview/swipeview-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/teechart/teechart.d.ts.tscparams b/teechart/teechart.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/teechart/teechart.d.ts.tscparams +++ b/teechart/teechart.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/threejs/three-tests.ts.tscparams b/threejs/three-tests.ts.tscparams index 3b6942a9d..d3f5a12fa 100644 --- a/threejs/three-tests.ts.tscparams +++ b/threejs/three-tests.ts.tscparams @@ -1,2 +1 @@ -"" - + diff --git a/through/through-tests.ts.tscparams b/through/through-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/through/through-tests.ts.tscparams +++ b/through/through-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/through/through.d.ts.tscparams b/through/through.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/through/through.d.ts.tscparams +++ b/through/through.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/titanium/titanium-tests.ts.tscparams b/titanium/titanium-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/titanium/titanium-tests.ts.tscparams +++ b/titanium/titanium-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/toastr/toastr-tests.ts.tscparams b/toastr/toastr-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/toastr/toastr-tests.ts.tscparams +++ b/toastr/toastr-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/tween.js/tween.js.d.ts.tscparams b/tween.js/tween.js.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/tween.js/tween.js.d.ts.tscparams +++ b/tween.js/tween.js.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/underscore/underscore-tests.ts.tscparams b/underscore/underscore-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/underscore/underscore-tests.ts.tscparams +++ b/underscore/underscore-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/unity-webapi/unity-webapi-tests.ts.tscparams b/unity-webapi/unity-webapi-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/unity-webapi/unity-webapi-tests.ts.tscparams +++ b/unity-webapi/unity-webapi-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/unity-webapi/unity-webapi.d.ts.tscparams b/unity-webapi/unity-webapi.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/unity-webapi/unity-webapi.d.ts.tscparams +++ b/unity-webapi/unity-webapi.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/urijs/URI.d.ts.tscparams b/urijs/URI.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/urijs/URI.d.ts.tscparams +++ b/urijs/URI.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/viewporter/viewporter-tests.ts.tscparams b/viewporter/viewporter-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/viewporter/viewporter-tests.ts.tscparams +++ b/viewporter/viewporter-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/vimeo/froogaloop.d.ts.tscparams b/vimeo/froogaloop.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/vimeo/froogaloop.d.ts.tscparams +++ b/vimeo/froogaloop.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/webaudioapi/waa-nightly.d.ts.tscparams b/webaudioapi/waa-nightly.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/webaudioapi/waa-nightly.d.ts.tscparams +++ b/webaudioapi/waa-nightly.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/webrtc/MediaStream-tests.ts.tscparams b/webrtc/MediaStream-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/webrtc/MediaStream-tests.ts.tscparams +++ b/webrtc/MediaStream-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/webrtc/MediaStream.d.ts.tscparams b/webrtc/MediaStream.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/webrtc/MediaStream.d.ts.tscparams +++ b/webrtc/MediaStream.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/webrtc/RTCPeerConnection-tests.ts.tscparams b/webrtc/RTCPeerConnection-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/webrtc/RTCPeerConnection-tests.ts.tscparams +++ b/webrtc/RTCPeerConnection-tests.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/webrtc/RTCPeerConnection.d.ts.tscparams b/webrtc/RTCPeerConnection.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/webrtc/RTCPeerConnection.d.ts.tscparams +++ b/webrtc/RTCPeerConnection.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/xsockets/XSockets-tests.ts.tscparams b/xsockets/XSockets-tests.ts.tscparams index 3cc762b55..d3f5a12fa 100644 --- a/xsockets/XSockets-tests.ts.tscparams +++ b/xsockets/XSockets-tests.ts.tscparams @@ -1 +1 @@ -"" \ No newline at end of file + diff --git a/youtube/youtube.d.ts.tscparams b/youtube/youtube.d.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/youtube/youtube.d.ts.tscparams +++ b/youtube/youtube.d.ts.tscparams @@ -1 +1 @@ -"" + diff --git a/zepto/zepto-tests.ts.tscparams b/zepto/zepto-tests.ts.tscparams index e16c76dff..d3f5a12fa 100644 --- a/zepto/zepto-tests.ts.tscparams +++ b/zepto/zepto-tests.ts.tscparams @@ -1 +1 @@ -"" + From 0f047f851f5c5ccd7876ecabddd46e476e678b84 Mon Sep 17 00:00:00 2001 From: Kim Birkelund Date: Wed, 3 Sep 2014 12:30:12 +0200 Subject: [PATCH 113/537] Fixed definition of KnockoutComputedContext.isInitial: should be () => boolean, was boolean. --- knockout/knockout.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index 48f550dfe..27487c7a6 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -586,7 +586,7 @@ interface KnockoutComponentConfig { interface KnockoutComputedContext { getDependenciesCount(): number; - isInitial: boolean; + isInitial: () => boolean; isSleeping: boolean; } From f29f862cf4ac99e66790ad2b6f326c924a847b93 Mon Sep 17 00:00:00 2001 From: Saftpresse99 Date: Wed, 3 Sep 2014 13:56:53 +0200 Subject: [PATCH 114/537] Update typeahead.d.ts Implement typeahead.js bloodhound suggestion engine: https://github.com/twitter/typeahead.js/blob/master/doc/bloodhound.md Take input from here: https://github.com/borisyankov/DefinitelyTyped/pull/2239 with some modifications. --- typeahead/typeahead.d.ts | 224 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 224 insertions(+) diff --git a/typeahead/typeahead.d.ts b/typeahead/typeahead.d.ts index c2d50dfc4..34ea56597 100644 --- a/typeahead/typeahead.d.ts +++ b/typeahead/typeahead.d.ts @@ -186,3 +186,227 @@ declare module Twitter.Typeahead { minLength?: number; } } +declare module Bloodhound +{ + interface BloodhoundOptions + { + /** + * Transforms a datum into an array of string tokens + * + * @constructor + * @param datum individual units that compose the dataset + */ + datumTokenizer?: any; + /** + * Transforms a query into an array of string tokens + * + * @constructor + * @param query tokenizer query + */ + queryTokenizer?: any; + /** + * The max number of suggestions to return from Bloodhound#get. + * If not reached, the data source will attempt to backfill the suggestions from remote. Defaults to 5 + */ + limit?: number; + /** + * If set, this is expected to be a function with the signature (remoteMatch, localMatch) that returns true if the datums are duplicates or false otherwise. + * If not set, duplicate detection will not be performed. + */ + dupDetector?: (remoteMatch: T, localMatch: T) => boolean; + /** + * A compare function used to sort matched datums for a given query. + */ + sorter?: (a: T, b: T) => T[]; + /** + *An array of datums or a function that returns an array of datums. + */ + local?: () => T[]; + /** + * Can be a URL to a JSON file containing an array of datums or, if more configurability is needed, a prefetch options hash. + */ + prefetch?: PrefetchOptions; + /** + * Can be a URL to fetch suggestions from when the data provided by local and prefetch is insufficient or, if more configurability is needed, a remote options hash. + */ + remote?: RemoteOptions; + } + + /** + * Prefetched data is fetched and processed on initialization. + * If the browser supports localStorage, the processed data will be cached + * there to prevent additional network requests on subsequent page loads. + */ + interface PrefetchOptions + { + /** + * A URL to a JSON file containing an array of datums. Required. + */ + url: string; + /** + * The time (in milliseconds) the prefetched data should be cached + * in localStorage. Defaults to 86400000 (1 day). + */ + ttl?: number; + /** + * A function that transforms the response body into an array of datums. + * + * @param parsedResponse Response body + */ + filter?: (parsedResponse: any) => T[]; + /** The key that data will be stored in local storage under. Defaults to value of url. + * + */ + cacheKey?: string; + /** + * A string used for thumbprinting prefetched data. If this doesn't match what's stored in local storage, the data will be refetched. + */ + thumbprint?: string; + /** + * The ajax settings object passed to jQuery.ajax. + */ + ajax?: JQueryAjaxSettings; + } + + /** + * Remote data is only used when the data provided by local and prefetch + * is insufficient. In order to prevent an obscene number of requests + * being made to remote endpoint, typeahead.js rate-limits remote requests. + */ + interface RemoteOptions + { + /** + * A URL to make requests to when the data provided by local and + * prefetch is insufficient. Required. + */ + url: string; + /** + * The pattern in url that will be replaced with the user's query + * when a request is made. Defaults to %QUERY. + */ + wildcard?: string; + /** + * Overrides the request URL. If set, no wildcard substitution will + * be performed on url. + * + * @param url Replacement URL + * @param uriEncodedQuery Encoded query + * @returns A valid URL + */ + replace?: (url: string, uriEncodedQuery: string) => string; + /** + * The function used for rate-limiting network requests. + * Can be either 'debounce' or 'throttle'. Defaults to 'debounce'. + */ + rateLimitby?: string; + /** + * The time interval in milliseconds that will be used by rateLimitFn. + * Defaults to 300. + */ + rateLimitWait?: number; + + /** + * Transforms the response body into an array of datums. + * + * @param parsedResponse Response body + */ + filter?: (parsedResponse: any) => T[]; + /** + * The ajax settings object passed to jQuery.ajax. + */ + ajax?: JQueryAjaxSettings; + } + + /** + * The most common tokenization methods. + */ + interface Tokenizers + { + /** + * Split a given string on whitespace characters. + */ + whitespace(query: string): string[]; + /** + * Split a given string on non-word characters. + */ + nonword(query: string): string[]; + + /** + * Instances of the most common tokenization methods. + */ + obj: ObjTokenizer; + } + + interface ObjTokenizer + { + /** + * Split a given string on whitespace characters. + */ + whitespace(query: string): string[]; + /** + * Split a given string on non-word characters. + */ + nonword(query: string): string[]; + } +} + +declare class Bloodhound { + constructor(options: Bloodhound.BloodhoundOptions) + /** + * wraps the suggestion engine in an adapter that is compatible with the typeahead jQuery plugin + */ + public ttAdapter(): any; + /** + * Kicks off the initialization of the suggestion engine. This includes processing the data provided through local and fetching/processing the data provided through prefetch. + * Until initialized, all other methods will behave as no-ops. + * Returns a jQuery promise which is resolved when engine has been initialized. + * + * After the initial call of initialize, how subsequent invocations of the method behave depends on the reinitialize argument. + * If reinitialize is falsy, the method will not execute the initialization logic and will just return the same jQuery promise returned by the initial invocation. + * If reinitialize is truthy, the method will behave as if it were being called for the first time. + * + * var promise1 = engine.initialize(); + * var promise2 = engine.initialize(); + * var promise3 = engine.initialize(true); + * + * promise1 === promise2; + * promise3 !== promise1 && promise3 !== promise2; + */ + public initialize(reinitialize?: boolean): JQueryPromise; + /** + * Takes one argument, datums, which is expected to be an array of datums. + * The passed in datums will get added to the search index that powers the suggestion engine. + */ + public add(datums: T[]): void; + /** + * Removes all suggestions from the search index. + */ + public clear(): void; + /** + * If you're using prefetch, data gets cached in local storage in an effort to cut down on unnecessary network requests. + * clearPrefetchCache offers a way to programmatically clear said cache. + */ + public clearPrefetchCache(): void; + /** + * If you're using remote, Bloodhound will cache the 10 most recent responses in an effort to provide a better user experience. + * clearRemoteCache offers a way to programmatically clear said cache. + */ + public clearRemoteCache(): void; + /** + * Returns a reference to the Bloodhound constructor and reverts window.Bloodhound to its previous value. Can be used to avoid naming collisions. + */ + public noConflict(): any; + + /** + * Computes a set of suggestions for query. cb will be invoked with an array of datums that represent said set. + * cb will always be invoked once synchronously with suggestions that were available on the client. + * If those suggestions are insufficient (# of suggestions is less than limit) and remote was configured, cb may also be invoked asynchronously with the suggestions available on the client mixed with suggestions from the remote source. + */ + public get(query: string, cb: (datums: T[]) => void): void; + + /** + * The Bloodhound suggestion engine is token-based, so how datums and queries are tokenized plays a vital role in the quality of search results. + * Specify how you want datums and queries tokenized. + */ + public static tokenizers: Bloodhound.Tokenizers; +} From 660d172a48a1a36612d99a37597fdbe5c834aa3d Mon Sep 17 00:00:00 2001 From: Masaya Nasu Date: Wed, 3 Sep 2014 23:32:20 +0900 Subject: [PATCH 115/537] add leanModal --- jquery.leanModal/jquery.leanModal-tests.ts | 18 ++++++++++++++++ jquery.leanModal/jquery.leanModal.d.ts | 24 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100755 jquery.leanModal/jquery.leanModal-tests.ts create mode 100755 jquery.leanModal/jquery.leanModal.d.ts diff --git a/jquery.leanModal/jquery.leanModal-tests.ts b/jquery.leanModal/jquery.leanModal-tests.ts new file mode 100755 index 000000000..fdcaee53e --- /dev/null +++ b/jquery.leanModal/jquery.leanModal-tests.ts @@ -0,0 +1,18 @@ +/// +/// + +class LeanModalOptions implements JQueryLeanModalOption { + top : number; + overlay : number; + closeButton: string; +} + +$.leanModal(); + +var leanModalOptions = new LeanModalOptions; + +leanModalOptions.top = 200; +leanModalOptions.overlay = 0.5; +leanModalOptions.closeButton = ".close_button"; + +$.leanModal(leanModalOptions); diff --git a/jquery.leanModal/jquery.leanModal.d.ts b/jquery.leanModal/jquery.leanModal.d.ts new file mode 100755 index 000000000..f4f395e58 --- /dev/null +++ b/jquery.leanModal/jquery.leanModal.d.ts @@ -0,0 +1,24 @@ + + +/// + +interface JQueryLeanModalOption { + top : number; + overlay : number; + closeButton : String; +} + +interface JQueryLeanModalStatic { + ():any; + (JQueryLeanModalOption):any; +} + +interface JQueryStatic { + leanModal(): JQueryLeanModalStatic; + leanModal(JQueryLeanModalOption): JQueryLeanModalStatic; +} + +interface JQuery { + leanModal(): JQueryLeanModalStatic; + leanModal(JQueryLeanModalOption): JQueryLeanModalStatic; +} \ No newline at end of file From f2646a12ef822d0f639a859153e864c6312a75b4 Mon Sep 17 00:00:00 2001 From: Igor Kriklivets Date: Wed, 3 Sep 2014 19:58:15 +0400 Subject: [PATCH 116/537] Old versions removed --- chartjs/dx.chartjs-tests.ts | 26 - chartjs/dx.chartjs.d.ts | 1662 ----------------------------------- phonejs/dx.phonejs-tests.ts | 265 ------ phonejs/dx.phonejs.d.ts | 1220 ------------------------- 4 files changed, 3173 deletions(-) delete mode 100644 chartjs/dx.chartjs-tests.ts delete mode 100644 chartjs/dx.chartjs.d.ts delete mode 100644 phonejs/dx.phonejs-tests.ts delete mode 100644 phonejs/dx.phonejs.d.ts diff --git a/chartjs/dx.chartjs-tests.ts b/chartjs/dx.chartjs-tests.ts deleted file mode 100644 index 70c53a602..000000000 --- a/chartjs/dx.chartjs-tests.ts +++ /dev/null @@ -1,26 +0,0 @@ -/// - -module Test { - $("
").appendTo(document.body).dxChart({ - size: { - width: 600, - height: 400 - }, - title: { - text: 'Chart in jQuery mode', - font: { color: 'rgb(0, 128, 128)!important' } - }, - argumentAxis: { - categories: ['January', 'February', 'March', 'April', 'May', 'June'] - }, - dataSource: [ - { arg: 'January', v1: 10, v2: 20, v3: 24 }, - { arg: 'February', v1: 5, v2: 35, v3: 43 }, - { arg: 'March', v1: 50, v2: 10, v3: 80 }, - { arg: 'April', v1: 9, v2: 79, v3: 39 }, - { arg: 'May', v1: 100, v2: 42, v3: 22 }, - { arg: 'June', v1: 95, v2: 11, v3: 41 } - ], - series: [{ valueField: 'v1' }, { valueField: 'v2' }, { valueField: 'v3' }] - }); -} \ No newline at end of file diff --git a/chartjs/dx.chartjs.d.ts b/chartjs/dx.chartjs.d.ts deleted file mode 100644 index 7c961da9e..000000000 --- a/chartjs/dx.chartjs.d.ts +++ /dev/null @@ -1,1662 +0,0 @@ -// Type definitions for ChartJS -// Project: http://chartjs.devexpress.com -// Definitions by: DevExpress Inc. -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module DevExpress { - export function abstract(): void; - interface Endpoint { - local?: string; - production: string; - } - class EndpointSelector { - constructor(config: { [key: string]: Endpoint }); - urlFor(key: string): string; - } - export interface ActionOptions { - context?: Object; - component?: any; - beforeExecute? (e: ActionExecuteArgs): void; - afterExecute? (e: ActionExecuteArgs): void; - } - export interface ActionExecuteArgs { - action: any; - args: any[]; - context: any; - component: any; - canceled: boolean; - handled: boolean; - } - export class Action { - constructor(action?: any, config?: ActionOptions); - execute(): any; - } - export module devices { - interface Device { - phone?: boolean; - tablet?: boolean; - android?: boolean; - ios?: boolean; - win8?: boolean; - tizen?: boolean; - platform?: string; - deviceType?: string; - } - export function current(): Device; - export function current(device: Device): Device; - export var real: Device; - } -} -declare module DevExpress.data { - export interface ErrorHandler { (e: Error): void; } - export interface EntityOptions { key: any; keyType: any; } - export interface Getter { (obj: any, options?: any): any; } - export interface Setter { (obj: any, value: any, options?: any): void; } - export interface QueryOptions { - errorHandler?: ErrorHandler; - requireTotalCount?: boolean; - } - export interface ODataQueryOptions extends QueryOptions { - adapter?: any; - } - interface IQuery { - enumerate(): JQueryDeferred>; - count(): JQueryDeferred; - slice(skip: number, take?: number): IQuery; - sortBy(field: string[]): IQuery; - sortBy(field: Getter[]): IQuery; - sortBy(field: { field: string; desc?: boolean }[]): IQuery; - sortBy(field: { field: Getter; desc?: boolean }[]): IQuery; - thenBy(field: string[]): IQuery; - thenBy(field: Getter[]): IQuery; - thenBy(field: { field: string; desc?: boolean }[]): IQuery; - thenBy(field: { field: Getter; desc?: boolean }[]): IQuery; - filter(field: string, operator: string, value: any): IQuery; - filter(field: string, value: any): IQuery; - filter(criteria: any[]): IQuery; - select(field: string): IQuery; - select(field: string[]): IQuery; - select(...field: string[]): IQuery; - select(field: Getter): IQuery; - select(field: Getter[]): IQuery; - select(...field: Getter[]): IQuery; - groupBy(field: string[]): IQuery; - groupBy(field: Getter[]): IQuery; - groupBy(field: { field: string; desc?: boolean }[]): IQuery; - groupBy(field: { field: Getter; desc?: boolean }[]): IQuery; - sum(getter?: string): JQueryDeferred; - min(getter?: string): JQueryDeferred; - max(getter?: string): JQueryDeferred; - avg(getter?: string): JQueryDeferred; - aggregate(step: number): JQueryDeferred; - aggregate(seed: number, step: (accumulator: any, current: any) => any, finalize?: (accumulator: any) => any): JQueryDeferred; - } - export interface ArrayQuery extends IQuery { - toArray(): Array; - } - export interface RemoteQuery extends IQuery { /*todo: exec() ? */ } - export function base64_encode(input: string): string; - export function base64_encode(input: any[]): string; - export function query(items?: any[]): IQuery; - export var queryImpl: { - remote: (url: string, queryOptions: QueryOptions) => RemoteQuery; - array: (iter: Array, queryOptions: QueryOptions) => ArrayQuery; - }; - export class Guid { - constructor(value?: string); - constructor(value?: any); - toString(): string; - valueOf(): string; - toJSON(): string; - } - export class EdmLiteral { - constructor(value: any); - valueOf(): any; - } - export module utils { - export function normalizeSortingInfo(info: string): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: string[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: Getter): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: Getter[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; dir?: string }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; dir?: string }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; desc?: boolean }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; desc?: boolean }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; dir?: string }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; dir?: string }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; desc?: boolean }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; desc?: boolean }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeBinaryCriterion(criteria: Array): Array; - export function keysEqual(key1: any, key2: any): boolean; - export function keysEqual(keyExpr: any, key1: any, key2: any): boolean; - export function toComparable(value: Date, caseSensitive?: boolean): number; - export function toComparable(value: Guid, caseSensitive?: boolean): string; - export function toComparable(value: string, caseSensitive?: boolean): string; - export function compileGetter(): Getter; - export function compileGetter(expr: any[]): Getter; - export function compileGetter(expr: string): Getter; - export function compileGetter(expr: "this"): Getter; - export function compileGetter(expr: Getter): Getter; - export function compileSetter(expr: string): Setter; - export module odata { - export function sendRequest(request: JQueryXHR, requestOptions?: JQueryAjaxSettings): any; - export function serializePropName(propName: EdmLiteral): string; - export function serializePropName(propName: string): string; - export function serializeValue(value: Date): string; - export function serializeValue(value: Guid): string; - export function serializeValue(value: string): string; - export function serializeValue(value: "string"): string; - export function serializeValue(value: EdmLiteral): string; - export function serializeKey(key: any): string; - export function serializeKey(key: Date): string; - export function serializeKey(key: Guid): string; - export function serializeKey(key: string): string; - export function serializeKey(key: "string"): string; - export function serializeKey(key: EdmLiteral): string; - export var keyConverters: { - String(value: any): string; - Guid(value: any): Guid; - Int32(value: any): number; - Int64(value: any): EdmLiteral; - }; - } - } - export module queryAdapters { - export function odata(queryOptions: ODataQueryOptions): RemoteQuery; - } - export interface DataSourceOptions { - map? (item: any): any; - postProcess? (result: any[]): any; - pageSize: number; - paginate: boolean; - } - export class DataSource { - public changed: JQueryCallback; - public loadError: JQueryCallback; - public loadingChanged: JQueryCallback; - constructor(options?: Store); - constructor(options?: string); - constructor(options?: Array); - constructor(options?: { store: Store }); - constructor(options?: CustomStoreOptions); - constructor(options?: { store: Array }); - constructor(options?: { store: { type: string } }); - constructor(options?: { load(options?: LoadOptions): JQueryXHR; }); - constructor(options?: { load(options?: LoadOptions): Array; }); - constructor(options?: { load(options?: LoadOptions): JQueryDeferred; }); - constructor(options?: DataSourceOptions); - loadOptions(): { [key: string]: any }; - items(): Array; - store(): data.Store; - isLastPage(): boolean; - pageIndex(newIndex?: number): number; - sort(expr: any[]): any[]; - group(expr: any[]): any[]; - filter(expr: any[]): any[]; - select(expr: string[]): string[]; - searchValue(value?: string): string; - searchOperation(op?: string): string; - searchExpr(selector: string): string; - key(): any; - isLoaded(): boolean; - isLoading(): boolean; - totalCount(): number; - load(): JQueryDeferred; - dispose(): void; - } - export interface StoreOptions { - key?: any; - errorHandler?: ErrorHandler; - loaded?: JQueryCallback; - loading?: JQueryCallback; - modified?: JQueryCallback; - modifying?: JQueryCallback; - inserted?: JQueryCallback; - inserting?: JQueryCallback; - updated?: JQueryCallback; - updating?: JQueryCallback; - removed?: JQueryCallback; - removing?: JQueryCallback; - } - export interface LoadOptions extends QueryOptions { - skip?: number; - take?: number; - sort?: any; - select?: any; - filter?: any; - group?: any; - } - export class Store { - loaded: JQueryCallback; - loading: JQueryCallback; - modified: JQueryCallback; - modifying: JQueryCallback; - inserted: JQueryCallback; - inserting: JQueryCallback; - updated: JQueryCallback; - updating: JQueryCallback; - removed: JQueryCallback; - removing: JQueryCallback; - constructor(options?: StoreOptions); - key(): any; - keyOf(obj: any): any; - load(options?: LoadOptions): JQueryDeferred; - createQuery(options?: QueryOptions): IQuery; - totalCount(options?: { - filter?: any[]; - group?: string[]; - }): JQueryDeferred; - byKey(key: any, extraOptions?: { - expand?: string[] - }): JQueryDeferred; - remove(key: any): JQueryDeferred; - insert(values: any): JQueryDeferred; - update(key: any, values: any): JQueryDeferred; - } - export interface CustomStoreOptions extends StoreOptions { - load? (options?: LoadOptions): any; - byKey? (key: any): any; - insert? (values: any): any; - update? (key: any, values: any): any; - remove? (key: any): any; - totalCount? (options?: { - filter?: any[]; - group?: string[]; - }): any; - } - export class CustomStore extends Store { - constructor(options?: CustomStoreOptions); - } - export interface ArrayStoreOptions extends StoreOptions { - data?: Array - } - export class ArrayStore extends Store { - constructor(options?: Array); - constructor(options?: ArrayStoreOptions); - } - export interface LocalStoreOptions extends ArrayStoreOptions { - name: string; - } - export class LocalStore extends ArrayStore { - constructor(options?: string); - constructor(options?: LocalStoreOptions); - clear(): void; - } - export interface ODataStoreOptions extends StoreOptions { - url?: string; - name?: string; - keyType?: string; - jsonp?: boolean; - withCredentials?: boolean; - } - export class ODataStore extends Store { - constructor(options?: ODataStoreOptions); - } - export interface ODataContextOptions { - url: string; - jsonp?: boolean; - withCredentials?: boolean; - errorHandler?: ErrorHandler; - beforeSend?: () => any; - entities?: Array; - } - export class ODataContext { - constructor(options?: ODataContextOptions); - get(operationName: string, params: { [key: string]: any }): JQueryDeferred>; - invoke(operationName: string, params: { [key: string]: any }, httpMethod?: string): JQueryDeferred>; - objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; }; - } -} -declare module DevExpress.ui { - interface ViewportOptions { - allowPan?: boolean; - allowZoom?: boolean; - } - export interface ITemplate { - compile(html: string): any; - render(template: JQuery, data: any): any; - render(template: any, data: any): any; - } - class Template { - constructor(element: HTMLElement); - constructor(element: JQueryStatic); - render(container: HTMLElement): any; - render(container: JQueryStatic): any; - dispose(): void; - } - interface TemplateStatic { - new (element: HTMLElement): Template; - new (element: JQueryStatic): Template; - } - class TemplateProvider { - constructor(); - getTemplateClass(widget: any): TemplateStatic; - getDefaultTemplate(widget: any): void; supportDefaultTemplate(): boolean; - } - export function initViewport(options: ViewportOptions): void; - interface NotifyOptions { - message: string; - type?: string; - displayTime?: number; - hiddenAction: () => any; - } - export function notyfy(options: any): void; - export function notify(message: string, type?: string, displayTime?: number): void; - export module dialog { - interface Dialog { - show(): JQueryDeferred; - hide(value?: any): void; - } - interface DialogButton { - text: string; - icon: string; - clickAction: () => any; - } - interface DialogOptions { - message: string; - title?: string; - } - export function custom(options: DialogOptions): Dialog; - export function custom(message: string, title?: string): Dialog; - export function alert(options: DialogOptions): JQueryDeferred; - export function alert(message: string, title?: string): JQueryDeferred; - export function confirm(options: DialogOptions): JQueryDeferred; - export function confirm(message: string, title?: string): JQueryDeferred; - } - export interface CollectionContainerWidgetOptions extends ContainerWidgetOptions { - items?: Array; - itemTemplate?: any; - itemRender?: Function; - itemClickAction?: any; - itemRenderedAction?: any; - noDataText?: string; - dataSource?: data.DataSource; - } - export class CollectionContainerWidget extends ContainerWidget { - constructor(element: Element, options?: CollectionContainerWidgetOptions); - constructor(element: JQuery, options?: CollectionContainerWidgetOptions); - } - export interface ComponentOptions { - disabled?: boolean; - } - export class Component { - constructor(element: Element, options?: ComponentOptions); - constructor(element: JQuery, options?: ComponentOptions); - disposing: JQueryCallback; - optionChanged: JQueryCallback; - instance(): Component; - beginUpdate(): void; - endUpdate(): void; - option(): any; - option(options: string): any; - option(options: string): T; - option(options: string, value: any): void; - option(options: { [key: string]: any }): void; - option(options?: any): any; - } - export interface ContainerWidgetOptions extends WidgetOptions { - contentReadyAction?: any - } - export class ContainerWidget extends Widget { - constructor(element: Element, options?: WidgetOptions); - constructor(element: JQuery, options?: WidgetOptions); - addTemplate(template: ITemplate): void; - } - export interface SelectableCollectionWidgetOptions extends CollectionContainerWidgetOptions { - selectedIndex?: number; - itemSelectAction?: any; - } - export class SelectableCollectionWidget extends CollectionContainerWidget { - constructor(element: Element, options?: SelectableCollectionWidget); - constructor(element: JQuery, options?: SelectableCollectionWidget); - } - export interface WidgetOptions extends ComponentOptions { - clickAction?: any; - width?: any; - height?: any; - visible?: boolean; - activeStateEnabled?: boolean; - } - export class Widget extends Component { - constructor(element: Element, options?: WidgetOptions); - constructor(element: JQuery, options?: WidgetOptions); - init(): void; - repaint(): void; - } -} -declare module DevExpress.viz { - export class Chart extends ui.Component { - constructor(element: Element, options?: viz.charts.ChartOptions); - constructor(element: JQuery, options?: viz.charts.ChartOptions); - clearSelection(): void; - getSeries(): viz.charts.series.Series; - hidiTooltip(): void; - render(options: viz.charts.RenderOptions): void; - render(): void; - zoomArgument(minArg: any, maxArg: any): void; - getSeriesByPos(seriesIndex: number): viz.charts.series.Series; - getSeriesByName(seriesName: string): viz.charts.series.Series; - getAllSeries(): Array; - instance(): Chart; - } - export class PieChart extends ui.Component { - constructor(element: Element, options?: viz.charts.PieOptions); - constructor(element: JQuery, options?: viz.charts.PieOptions); - clearSelection(): void; - getSeries(): viz.charts.series.PieSeries; - hidiTooltip(): void; - render(options: viz.charts.RenderOptions): void; - render(): void; - instance(): PieChart; - } - export class RangeSelector extends ui.Component { - constructor(element: Element, options?: viz.rangeSelector.RangeSelectorOptions); - constructor(element: JQuery, options?: viz.rangeSelector.RangeSelectorOptions); - getSelectedRange: () => viz.rangeSelector.SelectedRange; - setSelectedRange: (selectedRange: viz.rangeSelector.SelectedRange) => void; - instance(): RangeSelector; - } - export class CircularGauge extends ui.Component { - constructor(element: Element, options?: viz.gauges.CircularGaugeOptions); - constructor(element: JQuery, options?: viz.gauges.CircularGaugeOptions); - value(): number; - value(val: number): CircularGauge; - subvalues(): Array; - subvalues(values: Array): CircularGauge; - instance(): CircularGauge; - } - export class LinearGauge extends ui.Component { - constructor(element: Element, options?: viz.gauges.LinearGaugeOptions); - constructor(element: JQuery, options?: viz.gauges.LinearGaugeOptions); - value(): number; - value(val: number): LinearGauge; - subvalues(): Array; - subvalues(values: Array): LinearGauge; - instance(): LinearGauge; - } - export class Sparkline extends ui.Component { - constructor(element: Element, options?: viz.sparklines.SparklineOptions); - constructor(element: JQuery, options?: viz.sparklines.SparklineOptions); - render(): Sparkline; - instance(): Sparkline; - } - export class Bullet extends ui.Component { - constructor(element: Element, options?: viz.sparklines.BulletOptions); - constructor(element: JQuery, options?: viz.sparklines.BulletOptions); - render(): Bullet; - instance(): Bullet; - } - export class Map extends ui.Component { - constructor(element: Element, options?: viz.map.VectorMapOptions); - constructor(element: JQuery, options?: viz.map.VectorMapOptions); - render(): void; - instance(): Map; - getAreas(): Array; - getMarkers(): Array; - clearAreaSelection(): void; - clearMarkerSelection(): void; - clearSelection(): void; - } -} -declare module DevExpress.viz.charts { - interface z_BaseLegendOptions { - backgroundColor?: string; - hoverMode?: string; - customizeText?: (arg: { - seriesName: string; - seriesNumber: number; - seriesColor: string; - }) => string; - verticalAlignment?: string; - horizontalAlignment?: string; - itemTextPosition?: string; - equalColumnWidth?: boolean; - font?: viz.common.FontOptions; - visible?: boolean; - margin?: number; - markerSize?: number; - border?: { - visible?: boolean; - width?: number; - color?: string; - cornerRadius?: number; - opacity?: number; - dashStyle?: string; - }; - paddingLeftRight?: number; - paddingTopBottom?: number; - columnsCount?: number; - rowsCount?: number; - columnItemSpacing?: number; - rowItemSpacing?: number; - } - interface z_BaseTooltipCustomizeArgument { - value?: any; - valueText: string; - originalValue: string; - argument: any; - argumentText: string; - originalArgument: any; - percent?: any; - percentText?: string; - seriesName: string; - } - interface z_BaseTooltipOptions { - enabled?: boolean; - color?: string; - customizeText?: (arg: z_BaseTooltipCustomizeArgument) => string; - format?: string; - argumentFormat?: string; - precision?: number; - argumentPrecision?: number; - percentPrecision?: number; - font?: viz.common.FontOptions; - arrowLength?: number; - paddingLeftRight?: number; - paddingTopBottom?: number; - } - interface z_ChartTooltipCustomizeArgument extends z_BaseTooltipCustomizeArgument { - closeValueText?: string; - highValueText?: string; - lowValueText?: string; - openValueText?: string; - originalCloseValue?: any; - originalHighValue?: any; - originalLowValue?: any; - originalOpenValue?: any; - closeValue?: any; - highValue?: any; - lowValue?: any; - openValue?: any; - reductionValue?: any; - reductionValueText?: string; - originalMinValue?: any; - rangeValue1?: any; - rangeValue1Text?: string; - rangeValue2?: any; - rangeValue2Text?: string; - point: series.Point; - } - interface z_ChartTooltipOptions extends z_BaseTooltipOptions { - customizeText?: (arg: z_ChartTooltipCustomizeArgument) => string; - shared?: boolean; - } - interface z_BaseChartOptions extends ui.ComponentOptions { - incidentOccured?: () => void; - done?: () => void; - drawn?: () => void; - tooltipShown?: () => void; - tooltipHidden?: () => void; - pointSelectionMode?: string; - redrawOnResize?: boolean; - tooltip?: z_BaseTooltipOptions; - margin?: { - left?: number; - top?: number; - right?: number; - bottom?: number; - }; - size?: { - width?: number; - height?: number; - }; - title?: { - horizontalAlignment?: string; - verticalAlignment?: string; - font?: viz.common.FontOptions; - text?: string; - placeholderSize?: number; - }; - dataSource?: any; - palette?: any; legend?: z_BaseLegendOptions; - theme?: string; - animation?: { - enabled?: boolean; - duration?: number; - easing?: string; - maxPointCountSupported?: number; - asyncSeriesRendering?: boolean; - asyncTrackersRendering?: boolean; - trackerRenderingDelay?: number; - }; - } - export interface CommonPaneSettings { - backgroundColor?: string; - border?: { - color?: string; - bottom?: boolean; - left?: boolean; - right?: boolean; - top?: boolean; - dashStyle?: string; - visible?: boolean; - width?: number; - opacity?: number; - }; - } - export interface PaneSettings extends CommonPaneSettings { - name: string; - } - export interface ChartLegendOptions extends z_BaseLegendOptions { - hoverMode?: string; - position?: string; - } - interface z_CommonAxisLabelSettings { - alignment?: string; - font?: viz.common.FontOptions; - indentFromAxis?: number; - overlappingBehavior?: { - mode?: string; - rotationAngle?: number; - staggeringSpacing?: number; - }; - rotationAngle?: number; - staggered?: boolean; - staggeringSpacing?: number; - } - interface z_BaseConstantLineLabel { - visible?: boolean; - position?: string; - font?: viz.common.FontOptions; - } - interface ConstantLineAxisLabel extends z_BaseConstantLineLabel { - horizontalAlignment?: string; - verticalAlignment?: string; - } - export interface ConstantLineLabel extends ConstantLineAxisLabel { - text?: string; - } - export interface CommonConstantLineStyle { - paddingLeftRight?: number; - paddingTopBottom?: number; - width?: number; - dashStyle?: string; - color?: string; - label?: z_BaseConstantLineLabel; - } - export interface ConstantLineOptions extends CommonConstantLineStyle { - value?: any; - label?: ConstantLineLabel; - } - interface z_AxisConstantLineStyle extends CommonConstantLineStyle { - label?: ConstantLineAxisLabel; - } - interface z_StripStyle { - label?: { - font?: viz.common.FontOptions; - horizontalAlignment?: string; - verticalAlignment?: string; - }; - paddingLeftRight?: number; - paddingTopBottom?: number; - } - export interface CommonAxisSettings { - color?: string; - discreteAxisDivisionMode?: string; - grid?: { - color?: string; - opacity?: string; - visible?: boolean; - width?: number; - } - inverted?: boolean; - label?: z_CommonAxisLabelSettings; - maxValueMargin?: number; - minValueMargin?: number; - opacity?: number; - placeholderSize?: number; - setTicksAtUnitBeginning?: boolean; - stripStyle?: z_StripStyle - constantLineStyle?: CommonConstantLineStyle; - tick?: { - color?: string; - opacity?: number; - visible?: boolean; - }; - title?: { - font?: viz.common.FontOptions; - margin?: number; - text?: string; - }; - valueMarginsEnabled?: boolean; - visible?: boolean; - width?: number; - } - export interface StripOptions extends z_StripStyle { - color?: string; - endValue: any; - startValue: any; - label?: { - font?: viz.common.FontOptions; - horizontalAlignment?: string; - verticalAlignment?: string; - text?: string; - }; - } - interface z_AxisLabelSettings extends z_CommonAxisLabelSettings { - customizeText: (arg: { - value: any; - valueText: string; - }) => string; - } - export interface ArgumentAxisOptions extends CommonAxisSettings { - argumentType?: string; - axisDivisionFactor?: number; - categories?: Array; - hoverMode?: string; - label?: z_AxisLabelSettings; - max?: number; - min?: number; - tickInterval?: any; - position?: string; - constantLineStyle?: z_AxisConstantLineStyle; - strips?: Array; - constantLines?: Array; - type?: string; - } - export interface ValueAxisOptions extends CommonAxisSettings { - valueType?: string; - axisDivisionFactor?: number; - categories?: Array; - hoverMode?: string; - max?: number; - min?: number; - tickInterval?: any; position?: string; - strips?: Array; - constantLines?: Array; - constantLineStyle?: z_AxisConstantLineStyle; - type?: string; - name?: string; - label?: z_AxisLabelSettings; - } - interface z_CrosshairLine { - color?: string; - width?: number; - dashStyle?: string; - opacity?: number; - } - interface z_CrosshairOptions extends z_CrosshairLine { - enabled?: boolean; - verticalLine?: z_CrosshairLine; - horizontalLine?: z_CrosshairLine; - } - export interface ChartOptions extends z_BaseChartOptions { - needAggregate?: boolean; - defaultPane?: string; - adjustOnZoom?: boolean; - rotated?: boolean; - synchronizeMultiAxes?: boolean; - equalBarWidth?: { - spacing?: number; - width?: number; - }; - customizePoint?: (arg: { - index: number; - argument: any; - seriesName: string; - tag: any; - value?: any; - rangeValue1?: any; - rangeValue2?: any; - }) => series.BasePointOptions; - commonPaneSettings?: CommonPaneSettings; - panes?: Array; - containerBackgroundColor?: string; - seriesTemplate?: { - nameField?: string; - customizeSeries?: (valueFromNameField: string) => viz.charts.series.SeriesOptions; - }; - crosshair?: z_CrosshairOptions; - seriesSelectionMode?: string; - tooltip?: z_ChartTooltipOptions; - dataPrepareSettings?: { - checkTypeForAllData?: boolean; - convertToAxisDataType?: boolean; - sortingMethod?: any; - }; - useAggregation?: boolean; - argumentAxisClick?: (axis: any, argument: any, event: JQueryMouseEventObject) => void; - legend?: ChartLegendOptions; - argumentAxis?: ArgumentAxisOptions; - valueAxis?: Array; - commonAxisSettings?: CommonAxisSettings; - series?: Array; - commonSeriesSettings?: viz.charts.series.commonSeriesSettings; - seriesClick?: (series: viz.charts.series.Series, event: JQueryMouseEventObject) => void; - seriesHover?: (series: viz.charts.series.Series) => void; - seriesSelected?: (series: viz.charts.series.Series) => void; - seriesHoverChanged?: (series: viz.charts.series.Series) => void; - pointClick?: (point: viz.charts.series.Point, event: JQueryMouseEventObject) => void; - legendClick?: (obj: any, event: JQueryMouseEventObject) => void; pointHover?: (point: viz.charts.series.Point) => void; - pointSelected?: (point: viz.charts.series.Point) => void; - seriesSelectionChanged?: (series: viz.charts.series.Series) => void; - pointSelectionChanged?: (point: viz.charts.series.Point) => void; - pointHoverChanged?: (point: viz.charts.series.Point) => void; - } - export interface PieOptions extends z_BaseChartOptions { - pointClick?: (point: viz.charts.series.PiePoint, event: JQueryMouseEventObject) => void; - legendClick?: (point: viz.charts.series.PiePoint, event: JQueryMouseEventObject) => void; - pointHover?: (point: viz.charts.series.PiePoint) => void; - pointSelected?: (point: viz.charts.series.PiePoint) => void; - pointSelectionChanged?: (point: viz.charts.series.PiePoint) => void; - pointHoverChanged?: (point: viz.charts.series.PiePoint) => void; - series?: viz.charts.series.PieSeriesOptions; - } - export interface RenderOptions { - force?: boolean; - animate?: boolean; - asyncSeriesRendering?: boolean; - } -} -declare module DevExpress.viz.charts.series { - export interface z_BasePointStyle { - color?: string; - border?: { - visible?: boolean; - width?: number; - color?: string; - }; - size?: number; - } - interface BasePointOptions extends z_BasePointStyle { - hoverMode?: string; - selectionMode?: string; - visible?: boolean; - symbol?: string; - image?: any; - hoverStyle?: z_BasePointStyle; - selectionStyle?: z_BasePointStyle; - } - interface z_BaseSeriesOptions { - argumentField?: string; - hoverMode?: string; - maxLabelCount?: number; - label?: z_BaseLabelOptions; - selectionMode?: string; - showInLegend?: boolean; - tagField?: string; - } - interface z_BaseLabelOptions { - visible?: boolean; - alignment?: string; - rotationAngle?: number; - format?: string; - precision?: number; - argumentFormat?: string; - argumentPrecision?: number; - precission?: number; - percentPrecision?: number; - font?: viz.common.FontOptions; - backgroundColor?: string; - border?: { - visible?: boolean; - width?: number; - color?: string; - dashStyle?: string; - }; - connector?: { - visible?: boolean; - width?: number; - color?: string; - } - } - interface z_BaseChartSeriesLabelOptions extends z_BaseLabelOptions { - horizontalOffset?: number; - verticalOffset?: number; - customizeText?: (arg: { - originalValue: any; - value: any; - valueText: string; - originalArgument: any; - argument: any; - argumentText: string; - seriesName: string; - }) => string; - } - interface z_BaseSeriesStyle { - color?: string; - } - export interface ScatterSeriesOptions extends z_BaseSeriesOptions, z_BaseSeriesStyle { - selectionStyle?: z_BaseSeriesStyle; - hoverStyle?: z_BaseSeriesStyle; - valueField?: string; - point?: BasePointOptions; - axis?: string; - pane?: string; - } - export interface LineSeriesStyle extends z_BaseSeriesStyle { - dashStyle?: string; - width?: number; - } - export interface LineSeriesOptions extends LineSeriesStyle, z_BaseSeriesOptions { - selectionStyle?: LineSeriesStyle; - hoverStyle?: LineSeriesStyle; - valueField?: string; - point?: BasePointOptions; - pane?: string; - } - export interface AreaSeriesStyle extends z_BaseSeriesStyle { - hatching?: { - direction?: string; - width?: number; - step?: number; - opacity?: number - }; - border?: { - visible?: boolean; - width?: number; - color?: string; - }; - } - export interface AreaSeriesOptions extends AreaSeriesStyle, z_BaseSeriesOptions { - selectionStyle?: AreaSeriesStyle; - hoverStyle?: AreaSeriesStyle; - valueField?: string; - point?: BasePointOptions; - pane?: string; - axis?: string; - } - export interface BarSeriesLabel extends z_BaseChartSeriesLabelOptions { - position?: string; - showForZeroValues?: boolean; - } - export interface BarSeriesStyle extends AreaSeriesStyle { } - interface z_BaseBarSeriesOptions extends z_BaseSeriesOptions, BarSeriesStyle { - minBarSize?: number; - cornerRadius?: number; - label?: BarSeriesLabel; - selectionStyle?: BarSeriesStyle; - hoverStyle?: BarSeriesStyle; - pane?: string; - axis?: string; - } - export interface BarSeriesOptions extends z_BaseBarSeriesOptions { - valueField?: string; - } - export interface OHLCSeriesStyle extends z_BaseSeriesStyle { - width?: number; - } - interface z_BaseOHLCSeries extends z_BaseSeriesOptions { - openValueField?: string; - highValueField?: string; - lowValueField?: string; - closeValueField?: string; - reduction?: { - color?: string; - level?: string; - }; - pane?: string; - axis?: string; - } - export interface CandleStickSeriesOptions extends z_BaseOHLCSeries, OHLCSeriesStyle { - innerColor?: string; - selectionStyle?: OHLCSeriesStyle; - hoverStyle?: OHLCSeriesStyle; - } - export interface StockSeriesOptions extends z_BaseOHLCSeries, OHLCSeriesStyle { - selectionStyle?: OHLCSeriesStyle; - hoverStyle?: OHLCSeriesStyle; - } - export interface FullStackedAreaSeriesOptions extends z_BaseSeriesOptions, AreaSeriesOptions { - valueField?: string; - selectionStyle?: AreaSeriesStyle; - hoverStyle?: AreaSeriesStyle; - point?: BasePointOptions; - } - export interface FullStackedBarSeriesOptions extends BarSeriesOptions { - stack?: string; - } - export interface FullStackedLineSeriesOptions extends LineSeriesOptions { - point?: BasePointOptions; - } - interface z_BaseRangeSeriesOptions extends z_BaseSeriesOptions { - rangeValue1Field?: string; - rangeValue2Field?: string; - pane?: string; - axis?: string; - } - export interface RangeAreaSeriesOptions extends z_BaseSeriesOptions, AreaSeriesStyle { - selectionStyle?: AreaSeriesStyle; - hoverStyle?: AreaSeriesStyle; - point?: BasePointOptions; - } - export interface RangeBarSeriesOptions extends z_BaseBarSeriesOptions { - rangeValue1Field?: string; - rangeValue2Field?: string; - pane?: string; - axis?: string; - } - export interface SplineSeriesOptions extends LineSeriesOptions { } - export interface SplineAreaSeries extends AreaSeriesOptions { } - export interface StackedLineSeries extends LineSeriesOptions { } - export interface StackedAreaSeries extends AreaSeriesOptions { } - export interface StackedBasrSeriesOptions extends BarSeriesOptions { - stack?: string; - } - export interface BubbleSeriesStyle extends AreaSeriesStyle { } - export interface BubbleSeriesOptions extends z_BaseBarSeriesOptions, BubbleSeriesStyle { - selectionStyle?: LineSeriesStyle; - hoverStyle?: LineSeriesStyle; - valueField?: string; - pane?: string; - sizeField?: string; - } - export interface StepLineSeries extends LineSeriesOptions { } - export interface StepAreaSeries extends AreaSeriesOptions { } - export interface PieSeriesStyle extends AreaSeriesStyle { } - interface PieSeriesLabelOptions extends z_BaseLabelOptions { - customizeText: (arg: { - value: any; - valueText: string; - originalValue: any; - argument: any; - argumentText: string; - originalArgument: any; - percent: any; - percentText: string; - seriesName: string; - }) => string; - radialOffset?: number; - } - export interface PieSeriesOptions extends z_BaseSeriesOptions, PieSeriesStyle { - valueField?: string; - minSegmentSize?: string; - selectionStyle?: PieSeriesStyle; - hoverStyle?: PieSeriesStyle; - segmentsDirection?: string; - type?: string; - label?: PieSeriesLabelOptions; - } - interface AllSeriesStyleOptions extends z_BaseSeriesStyle, AreaSeriesStyle, LineSeriesStyle { } - interface z_AllLabelsOptions extends z_BaseChartSeriesLabelOptions, BarSeriesLabel { } - export interface CommonSeriesOptions extends z_BaseSeriesOptions, z_BaseBarSeriesOptions, z_BaseRangeSeriesOptions, z_BaseOHLCSeries, AllSeriesStyleOptions, BubbleSeriesOptions { - selectionStyle?: AllSeriesStyleOptions; - hoverStyle?: AllSeriesStyleOptions; - label?: z_AllLabelsOptions; - valueField?: string; - } - export interface SeriesOptions extends CommonSeriesOptions { - tag?: any; - name?: string; - type?: string; - } - export interface commonSeriesSettings extends CommonSeriesOptions { - area?: AreaSeriesOptions; - bar?: BarSeriesOptions; - candlestick?: CandleStickSeriesOptions; - fullstackedarea?: FullStackedAreaSeriesOptions; - fullstackedbar?: FullStackedBarSeriesOptions; - fullstackedline?: FullStackedLineSeriesOptions; - line?: LineSeriesOptions; - rangearea?: RangeAreaSeriesOptions; - rangebar?: RangeBarSeriesOptions; - scatter?: ScatterSeriesOptions; - spline?: SplineSeriesOptions; - splinearea?: SplineAreaSeries; - stackedarea?: StackedAreaSeries; - stackedbar?: StackedBasrSeriesOptions; - stackedline?: StackedLineSeries; - steparea?: StepAreaSeries; - stepline?: StepLineSeries; - stock?: StockSeriesOptions; - bubble?: BubbleSeriesOptions; - } - export class Point { - fullState: number; - originalArgument: any; - originalValue: any; - series: Series; - tag: any; - clearSelection(): void; - select(): void; - hideTootip(): void; - isSelected(): boolean; - isHovered(): boolean; - } - export class PiePoint { - fullState: number; - originalArgument: any; - originalValue: any; - percent: any; - series: PieSeries; - tag: any; - clearSelection(): void; - select(): void; - hideTootip(): void; - isSelected(): boolean; - isHovered(): boolean; - } - export class Series { - axis: string; - fullState: number; - name: string; - pane: string; - tag: any; - type: string; - clearSelection(): void; - deselectPoint(point: Point): void; - getAllPoints(): Array - getPointByArg(pointArg: any): Point; - getPointByPos(positionIndex: number): Point; - select(): void; - selectPoint(point: Point): void; - isSelected(): boolean; - isHovered(): boolean; - } - export class PieSeries { - fullState: number; - type: string; - clearSelection(): void; - deselectPoint(point: PiePoint): void; - getAllPoints(): Array - getPointByArg(pointArg: any): PiePoint; - getPointByPos(positionIndex: number): PiePoint; - select(): void; - selectPoint(point: PiePoint): void; - isSelected(): boolean; - isHovered(): boolean; - } -} -declare module DevExpress.viz.common { - export interface FontOptions { - color?: string; - family?: string; - opacity?: number; - size?: number; - weight?: number; - } - export interface tickIntervalObject { - years?: number; - quarters?: number; - months?: number; - days?: number; - hours?: number; - minutes?: number; - seconds?: number; - milliseconds?: number; - } -} -declare module DevExpress.viz.gauges { - interface CustomizeTextArgument { - value: number; - valueText: string; - } - interface z_textOptions { - format?: string; - precision?: number; - customizeText?: (arg: CustomizeTextArgument) => string; - font?: viz.common.FontOptions; - } - interface z_textOptionsWithIndent extends z_textOptions { - indent?: number; - } - interface z_BaseGaugeOptions { - size?: { - width?: number; - height?: number; - }; - margin?: { - left?: number; - right?: number; - top?: number; - bottom?: number; - }; - containerBackgroundColor?: string; - animationEnabled?: boolean; - animationDuration?: number; - redrawOnResize?: boolean; - title?: { - position?: string; - text?: string; - font?: viz.common.FontOptions; - }; - subtitle?: { - text?: string; - font?: viz.common.FontOptions; - }; - tooltip?: { - enabled?: boolean; - format?: string; - precision?: number; - customizeText?: (arg: CustomizeTextArgument) => string; - font?: viz.common.FontOptions; - }; - value?: number; - subvalues?: Array - } - interface z_BaseRangeContainer { - offset?: number; - backgroundColor?: string; - ranges?: Array<{ - startValue?: number; - endValue?: number; - color?: string; - }> - } - interface z_BaseScale { - startValue?: number; - endValue?: number; - hideFirstTick?: boolean; - hideLastTick?: boolean; - hideFirstLabel?: boolean; - hideLastLabel?: boolean; - majorTick?: { - color?: string; - length?: number; - width?: number; - customTickValues?: Array; - useTicksAutoArrangement?: boolean; - tickInterval?: number; - showCalculatedTicks?: boolean; - visible?: boolean; - }; - minorTick?: { - color?: string; - length?: number; - width?: number; - customTickValues?: Array; - tickInterval?: number; - showCalculatedTicks?: boolean; - visible?: boolean; - }; - label?: z_textOptions; - } - interface z_BaseValueIndicator { - color?: string; - baseValue?: number; - size?: number; - backgroundColor?: string; - text?: z_textOptionsWithIndent; - } - interface z_BaseSubValueIndicator { - type?: string; - length?: number; - width?: number; - color?: string; - arrowLength?: number; - text?: z_textOptions; - } - export interface CircularGaugeRangeContainer extends z_BaseRangeContainer { - width?: number; - orientation?: string; - } - export interface CircularGaugeScale extends z_BaseScale { - orientation: string; - label: { - format?: string; - precision?: number; - customizeText?: (arg: CustomizeTextArgument) => string; - font?: viz.common.FontOptions; - indentFromTick?: number; - } - } - export interface CircularGaugeValueIndicator extends z_BaseValueIndicator { - type?: string; - offset?: number; - indentFromCenter?: number; - width?: number; - secondColor?: string; - secondFraction?: number; - spindleSize?: number; - spindleGapSize?: number; - } - export interface CircularGaugeSubValueIndicator extends z_BaseSubValueIndicator { - offset?: number; - } - export interface CircularGaugeOptions extends z_BaseGaugeOptions { - rangeContainer?: CircularGaugeRangeContainer; - geometry?: { - startAngle?: number; - endAngle?: number; - }; - scale?: CircularGaugeScale; - valueIndicator?: CircularGaugeValueIndicator; - spindle?: { - visible?: boolean; - size?: number; - gapSize?: number; - color?: string; - } - } - export interface LinearGaugeScale extends z_BaseScale { - verticalOrientation?: string; - horizontalOrientation?: string; - label?: { - format?: string; - precision?: number; - customizeText?: (arg: CustomizeTextArgument) => string; - font?: viz.common.FontOptions; - indentFromTick?: number; - } - } - export interface LinearGaugeRangeContainer extends z_BaseRangeContainer { - width?: { - start?: number; - end?: number; - }; - verticalOrientation?: string; - horizontalOrientation?: string; - } - export interface LinearGaugeValueIndicator extends z_BaseValueIndicator { - offset?: number; - horizontalOrientation?: string; - verticalOrientation?: string; - length?: number; - width?: number; - } - export interface LinearGaugeSubValueIndicator extends z_BaseSubValueIndicator { - offset?: number; - horizontalOrientation?: string; - verticalOrientation?: string; - } - export interface LinearGaugeOptions extends z_BaseGaugeOptions { - geometry?: { - orientation?: string; - }; - scale?: LinearGaugeScale; - valueIndicator?: LinearGaugeValueIndicator; - } -} -declare module DevExpress.viz.map { - export interface VectorMapOptions { - size?: { - width?: number; - height?: number; - }; - theme?: string; - background?: { - borderColor?: string; - color?: string; - }; - mapData?: any; - areaSettings?: { - borderColor?: string; - color?: string; - hoveredBorderColor?: string; - hoveredColor?: string; - selectedBorderColor?: string; - selectedColor?: string; - hoverEnabled?: boolean; - selectionMode?: string; - palette?: any; - paletteSize?: number; - customize?: (arg: any) => AreaOptions; - click?: (arg: Proxy) => void; - selectionChanged?: (arg: Proxy) => void; - }; - markers?: any; - markerSettings?: { - borderColor?: string; - color?: string; - hoveredBorderColor?: string; - hoveredColor?: string; - selectedBorderColor?: string; - selectedColor?: string; - font?: common.FontOptions; - hoverEnabled?: boolean; - selectionMode?: string; - customize?: (arg: any) => MarkerOptions; - click?: (arg: Proxy) => void; - selectionChanged?: (arg: Proxy) => void; - }; - controlBar?: { - enabled?: boolean; - borderColor?: string; - color?: string; - }; - tooltip?: { - enabled?: boolean; - borderColor?: string; - color?: string; - font?: common.FontOptions; - }; - bounds?: { - minLat?: number; - maxLat?: number; - minLon?: number; - maxLon?: number; - }; - center?: { - lat?: number; - lon?: number; - }; - zoomFactor?: number; - } - export interface AreaOptions { - borderColor?: string; - color?: string; - hoveredBorderColor?: string; - hoveredColor?: string; - selectedBorderColor?: string; - selectedColor?: string; - paletteIndex?: number; - isSelected?: boolean; - } - export interface MarkerOptions { - borderColor?: string; - color?: string; - hoveredBorderColor?: string; - hoveredColor?: string; - selectedBorderColor?: string; - selectedColor?: string; - isSelected?: boolean; - } - export class Proxy { - type: string; - attribute(name: string): any; - selected(state: boolean): void; - selected(): boolean; - } -} -declare module DevExpress.viz.rangeSelector { - export interface SelectedRange { - startValue: any; endValue: any; - } - interface CustomizeTextArgument { - value: any; - valueText: string; - } - export interface RangeSelectorOptions { - background?: { - color?: string; - image?: { - location?: string; - url?: string; - } - visible?: boolean; - }; - behavior?: { - allowSlidersSwap?: boolean; - animationEnabled?: boolean; - callSelectedRangeChanged?: string; - manualRangeSelectionEnabled?: boolean; - moveSelectedRangeByClick?: boolean; - snapToTicks?: boolean; - }; - chart?: { - bottomIndent?: number; - equalBarWidth?: { - spacing?: number; - width?: number; - }; - dataPrepareSettings?: { - checkTypeForAllData?: boolean; - convertToAxisDataType?: boolean; - sortingMethod?: any; - }; - useAggregation?: boolean; - series?: Array; - commonSeriesSettings?: viz.charts.series.commonSeriesSettings; - topIndent?: number; - valueAxis?: { - max?: any; min?: any; inverted?: boolean; - valueType?: string; - }; - } - containerBackgroundColor?: string; - dataSource?: Array<{}>; - dataSourceField?: string; - margin?: { - left?: number; - top?: number; - right?: number; - bottom?: number; - }; - redrawOnResize?: boolean; - scale?: { - startValue?: any; endValue?: any; - label?: { - customizeText?: (arg: CustomizeTextArgument) => string; - font?: viz.common.FontOptions; - format?: string; - precision?: number; - topIndent?: number; - visible?: boolean; - }; - majorTickInterval?: any; marker?: { - label?: { - customizeText?: (arg: CustomizeTextArgument) => string; - format?: string; - }; - separatorHeight?: number; - textLeftIndent?: number; - textTopIndent?: number; - topIndent?: number; - visible?: boolean; - }; - maxRange?: any; minorTickCount?: number; - placeHolderHeight?: number; - setTicksAtUnitBeginning?: boolean; - showCustomBoundaryTicks?: boolean; - showMinorTicks?: boolean; - tick?: { - color?: string; - opacity?: number; - width?: number; - }; - minorTickInterval?: any; useTicksAutoArrangement?: boolean; - valueType?: string; - } - selectedRange?: SelectedRange; - selectedRangeChaged?: (startValue: any, endValue: any) => void; - shutter?: { - color?: string; - opacity?: string; - } - size?: { - width?: number; - height?: number; - }; - sliderHandle?: { - color?: string; - opacity?: number; - width?: string; - }; - sliderMarker?: { - color?: string; - customizeText?: (arg: CustomizeTextArgument) => string; - font?: viz.common.FontOptions; - format?: string; - invalidRangeColor?: string; - padding?: number; - placeHolderSize?: { - height?: number; - width?: { - left?: number; - right?: number; - } - precission?: number; - visible?: boolean; - } - }; - theme?: string; - } -} -declare module DevExpress.viz.sparklines { - interface SparklineTooltipOptions { - customizeText?: (arg: { - firstValue?: string; - lastValue?: string; - maxValue?: string; - minValue?: string; - originalFirstValue?: any; - originalLastValue?: any; - originalMaxValue?: any; - originalMinValue?: any; - }) => string; - enabled?: boolean; - allowContainerResizing?: boolean; - position?: string; - format?: string; - precision?: number; - color?: string; - font?: common.FontOptions; - } - interface z_BaseSparklineSettings { - theme?: string; - size?: { - width?: number; - height?: number; - }; - tooltip?: SparklineTooltipOptions; - } - interface SparklineOptions extends z_BaseSparklineSettings { - dataSource?: Array; - argumentField?: string; - valueField?: string; - type?: string; - lineColor?: string; - lineWidth?: number; - showFirstLast?: boolean; - showMinMax?: boolean; - minColor?: string; - maxColor?: string; - firstLastColor?: string; - barPositiveColor?: string; - barNegativeColor?: string; - winColor?: string; - lossColor?: string; - pointSymbol?: string; - pointSize?: number; - pointColor?: string; - winlossThreshold?: number; - } - interface BulletTooltipOptions extends SparklineTooltipOptions { - customizeText?: (arg: { - originalValue?: any; - originalTarget?: any; - value?: string; - target?: string; - }) => string; - } - interface BulletOptions extends z_BaseSparklineSettings { - value?: number; - target?: number; - endScaleValue?: number; - color?: string; - targetColor?: string; - targetWidth?: number; - targetVisible?: boolean; - tooltip?: BulletTooltipOptions; - } -} -interface JQuery { - dxChart(options?: DevExpress.viz.charts.ChartOptions): JQuery; - dxChart(method: string, param1?: any, param2?: any): any; - dxPieChart(options?: DevExpress.viz.charts.PieOptions): JQuery; - dxPieChart(method: string, param1?: any, param2?: any): any; - dxRangeSelector(options?: DevExpress.viz.rangeSelector.RangeSelectorOptions): JQuery; - dxRangeSelector(method: string, param1?: any, param2?: any): any; - dxCircularGauge(options?: DevExpress.viz.gauges.CircularGaugeOptions): JQuery; - dxCircularGauge(method: string, param1?: any, param2?: any): any; - dxLinearGauge(options?: DevExpress.viz.gauges.LinearGaugeOptions): JQuery; - dxLinearGauge(method: string, param1?: any, param2?: any): any; - dxSparkline(options?: DevExpress.viz.sparklines.SparklineOptions): JQuery; - dxSparkline(method: string, param1?: any, param2?: any): any; - dxBullet(options?: DevExpress.viz.sparklines.BulletOptions): JQuery; - dxBullet(method: string, param1?: any, param2?: any): any; - dxVectorMap(options?: DevExpress.viz.map.VectorMapOptions): JQuery; - dxVectorMap(method: string, param1?: any, param2?: any): any; -} \ No newline at end of file diff --git a/phonejs/dx.phonejs-tests.ts b/phonejs/dx.phonejs-tests.ts deleted file mode 100644 index 049eaef5c..000000000 --- a/phonejs/dx.phonejs-tests.ts +++ /dev/null @@ -1,265 +0,0 @@ -/// - -module Test { - var url = "http://some-json-service.net/data.json"; - var dsFromUrl = new DevExpress.data.DataSource(url); - - var dsFromObject = new DevExpress.data.DataSource({ - load: function (loadOptions?: DevExpress.data.LoadOptions) { - return $.ajax(url); - } - }); - - var application = new DevExpress.framework.html.HtmlApplication({ - namespace: "global", - defaultLayout: "slideout", - navigation: [ - { id: "first", title: "Home", action: "#home" }, - { id: "second", title: "About", action: "#about" } - ] - }); - application.router.register(":view/:id", { view: "home", id: undefined }); - application.navigate(); - - $("div").appendTo(document.body).dxMap({ - location: [40.749825, -73.987963], - zoom: 13, - provider: "googleStatic", - controls: true, - routes: [ - { - weight: 4, - opacity: 0.75, - color: "red", - mode: "walking", - locations: [ - [40.737102, -73.990318], - [40.749825, -73.987963], - [40.75, -73.98], - [40.755823, -73.986397] - ] - } - ] - }); - $("div").appendTo(document.body).dxTabs({ - itemClickAction: function (e) { - console.log(e.itemData.text); - }, - items: [ - { text: "user" }, - { text: "analytics" }, - { text: "customers" }, - { text: "search" }, - { text: "favorites" } - ] - }); - - $("div").appendTo(document.body).dxList({ - scrollByContent: true, - items: ["item1", "item2", "item3"], - itemHoldAction: function (e: any) { console.log("itemHold"); }, - itemClickAction: function (e: any) { console.log("itemClick"); }, - itemSwipeAction: function (e: any) { console.log("itemSwipe " + e.direction); } - }); - $("div").appendTo(document.body).dxToast({ - type: 'error', - message: 'Sample error message' - }); - $("div").appendTo(document.body).dxPopup({ - closeButton: true, - title: "Popup title" - }); - $("div").appendTo(document.body).dxPivot({ - items: [ - { title: "all", text: "all" }, - { title: "unread", text: "unread" }, - { title: "favorites", text: "favorites" } - ], - itemSelectAction: function (e) { console.log("itemSelectAction"); } - }); - $("div").appendTo(document.body).dxLookup({ - items: [ - { id: 1, caption: "red" }, - { id: 3, caption: "blue" }, - { id: 6, caption: "white" }, - { id: 2, caption: "green" }, - { id: 4, caption: "yellow" }, - { id: 5, caption: "orange" }, - { id: 7, caption: "purple" } - ], - valueExpr: 'id', - displayExpr: 'caption', - itemRender: function (item) { - return "Text is: " + item.caption; - } - }); - $("div").appendTo(document.body).dxSlider({ - min: 50, - value: 75, - max: 100, - disabled: false - }); - $("div").appendTo(document.body).dxNavBar({ - items: [ - { text: "user", icon: "user" }, - { text: "find", icon: "find", disabled: false }, - { text: "favorites", icon: "favorites" }, - { text: "about", icon: "info" }, - { text: "home", icon: "home" }, - { text: "URI", icon: "tips" } - ], - itemClickAction: function (e) { console.log(e.itemData.text); } - }); - $("div").appendTo(document.body).dxSwitch({ - value: false, - onText: 'LongName', - offText: 'Short', - width: "100%", - visible: true - }); - $("div").appendTo(document.body).dxButton({ - text: "Click me", - icon: 'add', - clickAction: function () { console.log("clicked"); } - }); - $("div").appendTo(document.body).dxOverlay({ - visible: false, - closeOnOutsideClick: true, - contentReadyAction: function () { - $("#hideButton").dxButton({ - text: "Hide", - clickAction: function () { $("#overlay").data("dxOverlay").option("visible", false); } - }); - } - }); - $("div").appendTo(document.body).dxDateBox({ - value: new Date(), - format: "datetime" - }); - $("div").appendTo(document.body).dxPopover({ - width: '300', - height: 'auto', - visible: true, - target: '.dx-button' - }); - $("div").appendTo(document.body).dxEditBox({ - value: "Value", - readOnly: false, - enterKeyAction: function (e) { console.log("key entered"); }, - focusOutAction: function (e) { console.log("focus out"); }, - focusInAction: function (e) { console.log("focus in"); } - }); - $("div").appendTo(document.body).dxTextBox({ - value: "Text", - placeholder: "Placeholder", - mode: "email", - maxLength: 20, - readOnly: false, - changeAction: function (e) { console.log("value changed"); }, - valueUpdateAction: function (e) { console.log("value updated"); } - }); - $("div").appendTo(document.body).dxToolbar({ - items: [ - { align: 'left', widget: 'button', options: { type: 'back', text: 'Back', clickAction: function (e) { console.log("back clicked"); } } }, - { align: 'center', widget: 'button', options: { text: 'button', clickAction: function (e) { console.log("button clicked"); } } }, - { align: 'center', widget: 'button', options: { icon: 'plus', text: 'add', clickAction: function (e) { console.log("plus clicked"); } } }, - { align: 'right', widget: 'button', options: { icon: 'find', clickAction: function (e) { console.log("find clicked"); } }, useMenu: false }, - { text: 'Products', isMenu: true } - ] - }); - $("div").appendTo(document.body).dxTileView({ - items: [ - { text: "item1", widthRatio: 1.7, heightRatio: 1.7 }, - { text: "item2", widthRatio: 0.2, heightRatio: 0.2 }, - { text: "item3", widthRatio: 2, heightRatio: 2 } - ], - listHeight: 500, - itemRender: function (item) { return "Text is: " + item.text; }, - itemClickAction: function () { console.log("itemClick"); }, - baseItemWidth: 100, - baseItemHeight: 100, - itemMargin: 20 - }); - $("div").appendTo(document.body).dxPanorama({ - title: "my panorama", - items: [ - { header: "first", text: "first item" }, - { text: "second item" }, - { text: "third" }, - { text: "fourth" } - ], - selectedIndex: 0, - backgroundImage: { width: 89, height: 50 }, - itemSelectAction: function () { console.log("item selected"); } - }); - $("div").appendTo(document.body).dxCheckBox({ - checked: false, - disabled: false, - clickAction: function (e) { console.log("clicked"); } - }); - $("div").appendTo(document.body).dxTextArea({ - value: 'Disabled', - disabled: true, - placeholder: "Placeholder" - }); - $("div").appendTo(document.body).dxLoadPanel({ - message: 'Please wait ...', - showIndicator: true, - visible: true - }); - $("div").appendTo(document.body).dxNumberBox({ - value: 100, - min: 0, - max: 200 - }); - $("div").appendTo(document.body).dxSelectBox({ - value: 2, - dataSource: new DevExpress.data.DataSource([1, 2, 2, 3]) - }); - $("div").appendTo(document.body).dxScrollable({ - useNative: false, - startAction: function (e) { console.log("start"); }, - endAction: function (e) { console.log("end"); } - }); - $("div").appendTo(document.body).dxRadioGroup({ - items: [{ text: "0" }, { text: "1" }, { text: "2" }], - name: "Sample", - selectedIndex: -1 - }); - $("div").appendTo(document.body).dxScrollView({ - pullDownAction: function (e) { console.log("pulling down"); }, - reachBottomAction: function (e) { console.log("bottom reached"); }, - disabled: false - }); - $("div").appendTo(document.body).dxActionSheet({ - title: 'Select action', - items: [ - { text: "Reply", clickAction: function () { console.log("Reply"); } }, - { text: "Forward", clickAction: function () { console.log("Forward"); } }, - { text: "Delete", clickAction: function () { console.log("Delete"); }, type: "danger" }, - { text: "Save Image", clickAction: function () { console.log("Save Image"); }, disabled: true } - ], - showTitle: true, - disabled: false, - target: '#button' - }); - $("div").appendTo(document.body).dxRangeSlider({ - start: 30, - end: 70, - min: 0, - max: 100, - step: 1 - }); - $("div").appendTo(document.body).dxAutocomplete({ - value: "Ivan", - dataSource: new DevExpress.data.DataSource(["Ivan", "Svyatoslav", "Alexander", "Nikolay", "Dmitry", "Afanasiy", "John", "Nash", "Stacy", "Izabella", "Margarita", "Anna"]), - placeholder: "Type name, please", - maxItemsCount: 3, - minSearchLength: 2, - searchTimeout: 1000 - }); - $("div").appendTo(document.body).dxDropDownMenu({ - items: ["Item 1", "Item 2", "Item 3"], - itemTemplate: 'itemWithIcon' - }); -} \ No newline at end of file diff --git a/phonejs/dx.phonejs.d.ts b/phonejs/dx.phonejs.d.ts deleted file mode 100644 index 185ee4d41..000000000 --- a/phonejs/dx.phonejs.d.ts +++ /dev/null @@ -1,1220 +0,0 @@ -// Type definitions for PhoneJS -// Project: http://phonejs.devexpress.com -// Definitions by: DevExpress Inc. -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module DevExpress { - export function abstract(): void; - interface Endpoint { - local?: string; - production: string; - } - class EndpointSelector { - constructor(config: { [key: string]: Endpoint }); - urlFor(key: string): string; - } - export interface ActionOptions { - context?: Object; - component?: any; - beforeExecute? (e: ActionExecuteArgs): void; - afterExecute? (e: ActionExecuteArgs): void; - } - export interface ActionExecuteArgs { - action: any; - args: any[]; - context: any; - component: any; - canceled: boolean; - handled: boolean; - } - export class Action { - constructor(action?: any, config?: ActionOptions); - execute(): any; - } - export module devices { - interface Device { - phone?: boolean; - tablet?: boolean; - android?: boolean; - ios?: boolean; - win8?: boolean; - tizen?: boolean; - platform?: string; - deviceType?: string; - } - export function current(): Device; - export function current(device: Device): Device; - export var real: Device; - } -} -declare module DevExpress.data { - export interface ErrorHandler { (e: Error): void; } - export interface EntityOptions { key: any; keyType: any; } - export interface Getter { (obj: any, options?: any): any; } - export interface Setter { (obj: any, value: any, options?: any): void; } - export interface QueryOptions { - errorHandler?: ErrorHandler; - requireTotalCount?: boolean; - } - export interface ODataQueryOptions extends QueryOptions { - adapter?: any; - } - interface IQuery { - enumerate(): JQueryDeferred>; - count(): JQueryDeferred; - slice(skip: number, take?: number): IQuery; - sortBy(field: string[]): IQuery; - sortBy(field: Getter[]): IQuery; - sortBy(field: { field: string; desc?: boolean }[]): IQuery; - sortBy(field: { field: Getter; desc?: boolean }[]): IQuery; - thenBy(field: string[]): IQuery; - thenBy(field: Getter[]): IQuery; - thenBy(field: { field: string; desc?: boolean }[]): IQuery; - thenBy(field: { field: Getter; desc?: boolean }[]): IQuery; - filter(field: string, operator: string, value: any): IQuery; - filter(field: string, value: any): IQuery; - filter(criteria: any[]): IQuery; - select(field: string): IQuery; - select(field: string[]): IQuery; - select(...field: string[]): IQuery; - select(field: Getter): IQuery; - select(field: Getter[]): IQuery; - select(...field: Getter[]): IQuery; - groupBy(field: string[]): IQuery; - groupBy(field: Getter[]): IQuery; - groupBy(field: { field: string; desc?: boolean }[]): IQuery; - groupBy(field: { field: Getter; desc?: boolean }[]): IQuery; - sum(getter?: string): JQueryDeferred; - min(getter?: string): JQueryDeferred; - max(getter?: string): JQueryDeferred; - avg(getter?: string): JQueryDeferred; - aggregate(step: number): JQueryDeferred; - aggregate(seed: number, step: (accumulator: any, current: any) => any, finalize?: (accumulator: any) => any): JQueryDeferred; - } - export interface ArrayQuery extends IQuery { - toArray(): Array; - } - export interface RemoteQuery extends IQuery { /*todo: exec() ? */ } - export function base64_encode(input: string): string; - export function base64_encode(input: any[]): string; - export function query(items?: any[]): IQuery; - export var queryImpl: { - remote: (url: string, queryOptions: QueryOptions) => RemoteQuery; - array: (iter: Array, queryOptions: QueryOptions) => ArrayQuery; - }; - export class Guid { - constructor(value?: string); - constructor(value?: any); - toString(): string; - valueOf(): string; - toJSON(): string; - } - export class EdmLiteral { - constructor(value: any); - valueOf(): any; - } - export module utils { - export function normalizeSortingInfo(info: string): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: string[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: Getter): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: Getter[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; dir?: string }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; dir?: string }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; desc?: boolean }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; desc?: boolean }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; dir?: string }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; dir?: string }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; desc?: boolean }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; desc?: boolean }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeBinaryCriterion(criteria: Array): Array; - export function keysEqual(key1: any, key2: any): boolean; - export function keysEqual(keyExpr: any, key1: any, key2: any): boolean; - export function toComparable(value: Date, caseSensitive?: boolean): number; - export function toComparable(value: Guid, caseSensitive?: boolean): string; - export function toComparable(value: string, caseSensitive?: boolean): string; - export function compileGetter(): Getter; - export function compileGetter(expr: any[]): Getter; - export function compileGetter(expr: string): Getter; - export function compileGetter(expr: "this"): Getter; - export function compileGetter(expr: Getter): Getter; - export function compileSetter(expr: string): Setter; - export module odata { - export function sendRequest(request: JQueryXHR, requestOptions?: JQueryAjaxSettings): any; - export function serializePropName(propName: EdmLiteral): string; - export function serializePropName(propName: string): string; - export function serializeValue(value: Date): string; - export function serializeValue(value: Guid): string; - export function serializeValue(value: string): string; - export function serializeValue(value: "string"): string; - export function serializeValue(value: EdmLiteral): string; - export function serializeKey(key: any): string; - export function serializeKey(key: Date): string; - export function serializeKey(key: Guid): string; - export function serializeKey(key: string): string; - export function serializeKey(key: "string"): string; - export function serializeKey(key: EdmLiteral): string; - export var keyConverters: { - String(value: any): string; - Guid(value: any): Guid; - Int32(value: any): number; - Int64(value: any): EdmLiteral; - }; - } - } - export module queryAdapters { - export function odata(queryOptions: ODataQueryOptions): RemoteQuery; - } - export interface DataSourceOptions { - map? (item: any): any; - postProcess? (result: any[]): any; - pageSize: number; - paginate: boolean; - } - export class DataSource { - public changed: JQueryCallback; - public loadError: JQueryCallback; - public loadingChanged: JQueryCallback; - constructor(options?: Store); - constructor(options?: string); - constructor(options?: Array); - constructor(options?: { store: Store }); - constructor(options?: CustomStoreOptions); - constructor(options?: { store: Array }); - constructor(options?: { store: { type: string } }); - constructor(options?: { load(options?: LoadOptions): JQueryXHR; }); - constructor(options?: { load(options?: LoadOptions): Array; }); - constructor(options?: { load(options?: LoadOptions): JQueryDeferred; }); - constructor(options?: DataSourceOptions); - loadOptions(): { [key: string]: any }; - items(): Array; - store(): data.Store; - isLastPage(): boolean; - pageIndex(newIndex?: number): number; - sort(expr: any[]): any[]; - group(expr: any[]): any[]; - filter(expr: any[]): any[]; - select(expr: string[]): string[]; - searchValue(value?: string): string; - searchOperation(op?: string): string; - searchExpr(selector: string): string; - key(): any; - isLoaded(): boolean; - isLoading(): boolean; - totalCount(): number; - load(): JQueryDeferred; - dispose(): void; - } - export interface StoreOptions { - key?: any; - errorHandler?: ErrorHandler; - loaded?: JQueryCallback; - loading?: JQueryCallback; - modified?: JQueryCallback; - modifying?: JQueryCallback; - inserted?: JQueryCallback; - inserting?: JQueryCallback; - updated?: JQueryCallback; - updating?: JQueryCallback; - removed?: JQueryCallback; - removing?: JQueryCallback; - } - export interface LoadOptions extends QueryOptions { - skip?: number; - take?: number; - sort?: any; - select?: any; - filter?: any; - group?: any; - } - export class Store { - loaded: JQueryCallback; - loading: JQueryCallback; - modified: JQueryCallback; - modifying: JQueryCallback; - inserted: JQueryCallback; - inserting: JQueryCallback; - updated: JQueryCallback; - updating: JQueryCallback; - removed: JQueryCallback; - removing: JQueryCallback; - constructor(options?: StoreOptions); - key(): any; - keyOf(obj: any): any; - load(options?: LoadOptions): JQueryDeferred; - createQuery(options?: QueryOptions): IQuery; - totalCount(options?: { - filter?: any[]; - group?: string[]; - }): JQueryDeferred; - byKey(key: any, extraOptions?: { - expand?: string[] - }): JQueryDeferred; - remove(key: any): JQueryDeferred; - insert(values: any): JQueryDeferred; - update(key: any, values: any): JQueryDeferred; - } - export interface CustomStoreOptions extends StoreOptions { - load? (options?: LoadOptions): any; - byKey? (key: any): any; - insert? (values: any): any; - update? (key: any, values: any): any; - remove? (key: any): any; - totalCount? (options?: { - filter?: any[]; - group?: string[]; - }): any; - } - export class CustomStore extends Store { - constructor(options?: CustomStoreOptions); - } - export interface ArrayStoreOptions extends StoreOptions { - data?: Array - } - export class ArrayStore extends Store { - constructor(options?: Array); - constructor(options?: ArrayStoreOptions); - } - export interface LocalStoreOptions extends ArrayStoreOptions { - name: string; - } - export class LocalStore extends ArrayStore { - constructor(options?: string); - constructor(options?: LocalStoreOptions); - clear(): void; - } - export interface ODataStoreOptions extends StoreOptions { - url?: string; - name?: string; - keyType?: string; - jsonp?: boolean; - withCredentials?: boolean; - } - export class ODataStore extends Store { - constructor(options?: ODataStoreOptions); - } - export interface ODataContextOptions { - url: string; - jsonp?: boolean; - withCredentials?: boolean; - errorHandler?: ErrorHandler; - beforeSend?: () => any; - entities?: Array; - } - export class ODataContext { - constructor(options?: ODataContextOptions); - get(operationName: string, params: { [key: string]: any }): JQueryDeferred>; - invoke(operationName: string, params: { [key: string]: any }, httpMethod?: string): JQueryDeferred>; - objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; }; - } -} -declare module DevExpress.framework { - export interface dxViewOptions { - name: string; - title?: string; - layout?: string; - } - export class dxView extends ui.Component { - constructor(options?: dxViewOptions); - } - export interface dxLayoutOptions { - name: string; - controller: string; - } - export class dxLayout extends ui.Component { - constructor(options?: dxLayoutOptions); - } - export interface dxViewPlaceholderOptions { - viewName: string; - } - export class dxViewPlaceholder extends ui.Component { - constructor(options?: dxLayoutOptions); - } - export interface dxTransitionOptions { - name: string; - type: string; - } - export class dxTransition extends ui.Component { - constructor(options?: dxLayoutOptions); - } - export interface dxContentPlaceholderOptions { - name: string; - transition: string; - } - export class dxContentPlaceholder extends ui.Component { - constructor(options?: dxLayoutOptions); - } - export interface dxContentOptions { - targetPlaceholder: string; - } - export class dxContent extends ui.Component { - constructor(options?: dxLayoutOptions); - } - export interface dxCommandOptions extends ui.ComponentOptions { - id: string; - action?: any; - icon?: string; - title?: string; - iconSrc?: string; - visible?: boolean; - } - export class dxCommand extends ui.Component { - public beforeExecute: JQueryCallback; - public afterExecute: JQueryCallback; - constructor(element: JQuery, options?: dxCommandOptions); - constructor(element: Element, options?: dxCommandOptions); - execute(): void; - } - export class dxCommandContainer extends ui.Component { - constructor(options: ui.ComponentOptions); - constructor(element: JQuery, options?: ui.ComponentOptions); - constructor(element: Element, options?: ui.ComponentOptions); - } - export interface CommandMap { - [containerId: string]: { commands: any[]; defaults?: any; } - } - export class CommandMapping { - constructor(); - static defaultMapping: CommandMap; - mapCommands(containerId: string, commandMappings: any[]): CommandMapping; - unmapCommands(containerId: string, commandIds: string[]): void; - getCommandMappingForContainer(commandId: string, containerId: string): any; - load(config: CommandMap): CommandMapping; - } - interface IViewCache { - setView(key: string, viewInfo: any): void; - removeView(key: string): any; - hasView(viewInfo: any): boolean; - getView(key: string): any; - clear(): void; - } - export class ViewCache implements IViewCache { - constructor(); - setView(key: string, viewInfo: any): void; - removeView(key: string): any; - hasView(viewInfo: any): boolean; - getView(key: string): any; - clear(): void; - } - export class NullViewCache implements IViewCache { - constructor(); - setView(key: string, viewInfo: any): void; - removeView(key: string): any; - hasView(viewInfo: any): boolean; - getView(key: string): any; - clear(): void; - } - export interface IStorage { - getItem(key: string): any; - setItem(key: string, value: any): void; - removeItem(key: string): void; - } - export class MemoryKeyValueStorage implements IStorage { - constructor(); - getItem(key: string): any; - setItem(key: string, value: any): void; - removeItem(key: string): void; - } - export interface StateManagerOptions { - storage?: IStorage; - stateSources?: any[]; - } - export class StateManager { - public storage: IStorage; - public stateSources: any[]; - constructor(options?: StateManagerOptions); - addStateSource(stateSource: any): void; - removeStateSource(stateSource: any): void; - saveState(): void; - restoreState(): void; - clearState(): void; - } - export class Route { - constructor(pattern: string, defaults?: any, constraints?: any); - parse(url: string): any; - format(routeValues: any): string; - formatSegment(value: any): string; - parseSegment(): any; - } - export class MvcRouter { - constructor(); - register(pattern: string, defaults?: any, constraints?: any): void; - parse(uri: string): any; - format(obj: any): string; - } - interface BrowserAdapterOptions { - window: Window; - } - export class DefaultBrowserAdapter { - constructor(options?: BrowserAdapterOptions); - replaceState(uri: string): void; - pushState(uri: string): void; - createRootPage(): void; - getWindowName(): string; - setWindowName(windowName: string): void; - back(): void; - getHash(): string; - isRootPage(): boolean; - } - export class OldBrowserAdapter extends DefaultBrowserAdapter { } - export class HistorylessBrowserAdapter extends DefaultBrowserAdapter { } - export interface INavigationDevice { - setUri(uri: string): void; - getUri(): string; - back(): void; - } - export class BrowserNavigationDevice implements INavigationDevice { - constructor(options?: BrowserAdapterOptions); - setUri(uri: string): void; - getUri(): string; - back(): void; - } - export class NavigationStack { - public items: any[]; - public currentIndex: number; - public itemsRemoved: JQueryCallback; - constructor(); - currentItem(): any; - back(uri: string): void; - forward(): void; - navigate(uri: any, replaceCurrent?: boolean): any; - getPreviousItem(): any; - canBack(): boolean; - clear(): void; - } - export interface NavigationManagerOptions { - stateStorageKey?: string; - navigationDevice?: INavigationDevice; - keepPositionInStack?: boolean; - } - export class NavigationManager { - public currentUri: string; - public currentStack: NavigationStack; - public navigationStacks: { - [key: string]: NavigationStack - }; - public navigating: JQueryCallback; - public navigated: JQueryCallback; - public navigatingBack: JQueryCallback; - public navigationCanceled: JQueryCallback; - public itemRemoved: JQueryCallback; - constructor(options?: NavigationManagerOptions); - navigate(uri: any, options?: { - root?: boolean; - target?: string; - direction?: string; - }): void; - back(alternate: any): void; - rootUri(): string; - canBack(): boolean; - currentItem(): any; - currentIndex(): number; - getPreviousItem(): any; - getItemByIndex(index: number): any; - saveState(storage: IStorage): void; - restoreState(storage: IStorage): void; - removeState(storage: IStorage): void; - clearHistory(): void; - static NAVIGATION_TARGETS: { - [key: string]: string - }; - } - export module utils { - export function mergeCommands(destination: any, source: any): dxCommand[]; - } - export interface ApplicationOptions { - router?: MvcRouter; - namespace?: any; - disableViewCache?: boolean; - stateManager?: StateManager; - navigationManager?: NavigationManager; - navigation?: dxCommandOptions[]; - commandMapping?: CommandMap; - } - export class Application { - public router: MvcRouter; - public namespace: any; - public components: any[]; - public stateManager: StateManager; - public commandMapping: CommandMap; - public navigation: dxCommand[]; - public navigationManager: NavigationManager; - public beforeViewSetup: JQueryCallback; - public afterViewSetup: JQueryCallback; - public viewShowing: JQueryCallback; - public viewShown: JQueryCallback; - public viewHidden: JQueryCallback; - public viewDisposing: JQueryCallback; - public viewDisposed: JQueryCallback; - public navigating: JQueryCallback; - constructor(options?: ApplicationOptions); - init(): any; - navigate(uri?: any, options?: { - root?: boolean; - target?: string; - direction?: string; - }): void; - back(): void; - canBack(): boolean; - saveState(): void; - clearState(): void; - restoreState(): void; - } - export function createActionExecutors(app: Application): { - [key: string]: { execute(e: any): void; } - }; -} -declare module DevExpress.framework.html { - export interface ILayoutController { - viewReleased: JQueryCallback; - init(options: InitLayoutControllerOptions): void; - activate(): void; - deactivate(): void; - showView(viewInfo: any, direction?: string): JQueryDeferred; - } - export interface ILayoutControllerRegistration extends devices.Device { - name: string; - controller: ILayoutController; - root?: boolean; - } - export var layoutControllers: Array; - export interface InitLayoutControllerOptions { - $viewPort: JQuery; - $hiddenBag: JQuery; - navigationManager: framework.NavigationManager; - } - export class DefaultLayoutController implements ILayoutController { - public viewReleased: JQueryCallback; - constructor(options?: { layoutTemplateName: string }); - init(options: InitLayoutControllerOptions): void; - activate(): void; - deactivate(): void; - showView(viewInfo: any, direction?: string): JQueryDeferred; - } - export interface CommandManagerOptions { - globalCommands?: framework.dxCommand[]; - commandMapping?: framework.CommandMapping; - } - export class CommandManager { - public globalCommands: framework.dxCommand[]; - public commandMapping: framework.CommandMapping; - constructor(options?: CommandManagerOptions); - layoutCommands($markup: JQuery, extraCommands?: any): void; - } - export interface ITemplateEngine { - applyTemplate(template: string, model: any): void; - applyTemplate(template: Element, model: any): void; - applyTemplate(template: JQuery, model: any): void; - } - export class KnockoutJSTemplateEngine implements ITemplateEngine { - constructor(); - applyTemplate(template: string, model: any): void; - applyTemplate(template: Element, model: any): void; - applyTemplate(template: JQuery, model: any): void; - } - export interface TransitionExecutorOptions { - type: string; - source: JQuery; - destination: JQuery; - } - export class TransitionExecutor { - public container: JQuery; - constructor(container: JQuery, options: TransitionExecutorOptions); - finalize(): void; - exec(): JQueryDeferred; - static create(container: JQuery, options: TransitionExecutorOptions): TransitionExecutor; - } - export interface ViewEngineOptions { - $root?: JQuery; - device?: devices.Device; - commandManager: CommandManager; - templateEngine: ITemplateEngine; - dataOptionsAttributeName?: string; - } - export class ViewEngineBase { - public $root: JQuery; - public device: devices.Device; - public commandManager: CommandManager; - public templateEngine: ITemplateEngine; - public dataOptionsAttributeName: string; - public viewSelecting: JQueryCallback; - public modelFromViewDataExtended: JQueryCallback; - constructor(options?: ViewEngineOptions); - init(): JQueryDeferred; - findViewTemplate(viewName: string): JQuery; - afterViewSetup(viewInfo: any): void; - } - export class ViewEngine extends ViewEngineBase { - public layoutSelecting: JQueryCallback; - public layoutApplying: JQueryCallback; - public layoutApplied: JQueryCallback; - constructor(options?: ViewEngineOptions); - init(): JQueryDeferred; - findLayoutTemplate(layoutName: string): JQuery; - } - export interface HtmlApplicationBaseOptions extends framework.ApplicationOptions { - device?: devices.Device; - navigationType?: string; - } - export class HtmlApplicationBase extends framework.Application { - public viewRendered: JQueryCallback; - constructor(options?: HtmlApplicationBaseOptions); - init(): any; - viewPort(): JQuery; - } - export interface HtmlApplicationOptions extends HtmlApplicationBaseOptions { - commandManager?: CommandManager; - templateEngine?: ITemplateEngine; - navigateToRootViewMode?: string; - layoutControllers?: Array - } - export class HtmlApplication extends HtmlApplicationBase { - public viewEngine: ViewEngineBase; - constructor(options?: HtmlApplicationOptions); - } -} -declare module DevExpress.ui { - interface ViewportOptions { - allowPan?: boolean; - allowZoom?: boolean; - } - export interface ITemplate { - compile(html: string): any; - render(template: JQuery, data: any): any; - render(template: any, data: any): any; - } - class Template { - constructor(element: HTMLElement); - constructor(element: JQueryStatic); - render(container: HTMLElement): any; - render(container: JQueryStatic): any; - dispose(): void; - } - interface TemplateStatic { - new (element: HTMLElement): Template; - new (element: JQueryStatic): Template; - } - class TemplateProvider { - constructor(); - getTemplateClass(widget: any): TemplateStatic; - getDefaultTemplate(widget: any): void; supportDefaultTemplate(): boolean; - } - export function initViewport(options: ViewportOptions): void; - interface NotifyOptions { - message: string; - type?: string; - displayTime?: number; - hiddenAction: () => any; - } - export function notyfy(options: any): void; - export function notify(message: string, type?: string, displayTime?: number): void; - export module dialog { - interface Dialog { - show(): JQueryDeferred; - hide(value?: any): void; - } - interface DialogButton { - text: string; - icon: string; - clickAction: () => any; - } - interface DialogOptions { - message: string; - title?: string; - } - export function custom(options: DialogOptions): Dialog; - export function custom(message: string, title?: string): Dialog; - export function alert(options: DialogOptions): JQueryDeferred; - export function alert(message: string, title?: string): JQueryDeferred; - export function confirm(options: DialogOptions): JQueryDeferred; - export function confirm(message: string, title?: string): JQueryDeferred; - } - export interface CollectionContainerWidgetOptions extends ContainerWidgetOptions { - items?: Array; - itemTemplate?: any; - itemRender?: Function; - itemClickAction?: any; - itemRenderedAction?: any; - noDataText?: string; - dataSource?: data.DataSource; - } - export class CollectionContainerWidget extends ContainerWidget { - constructor(element: Element, options?: CollectionContainerWidgetOptions); - constructor(element: JQuery, options?: CollectionContainerWidgetOptions); - } - export interface ComponentOptions { - disabled?: boolean; - } - export class Component { - constructor(element: Element, options?: ComponentOptions); - constructor(element: JQuery, options?: ComponentOptions); - disposing: JQueryCallback; - optionChanged: JQueryCallback; - instance(): Component; - beginUpdate(): void; - endUpdate(): void; - option(): any; - option(options: string): any; - option(options: string): T; - option(options: string, value: any): void; - option(options: { [key: string]: any }): void; - option(options?: any): any; - } - export interface ContainerWidgetOptions extends WidgetOptions { - contentReadyAction?: any - } - export class ContainerWidget extends Widget { - constructor(element: Element, options?: WidgetOptions); - constructor(element: JQuery, options?: WidgetOptions); - addTemplate(template: ITemplate): void; - } - export interface SelectableCollectionWidgetOptions extends CollectionContainerWidgetOptions { - selectedIndex?: number; - itemSelectAction?: any; - } - export class SelectableCollectionWidget extends CollectionContainerWidget { - constructor(element: Element, options?: SelectableCollectionWidget); - constructor(element: JQuery, options?: SelectableCollectionWidget); - } - export interface WidgetOptions extends ComponentOptions { - clickAction?: any; - width?: any; - height?: any; - visible?: boolean; - activeStateEnabled?: boolean; - } - export class Widget extends Component { - constructor(element: Element, options?: WidgetOptions); - constructor(element: JQuery, options?: WidgetOptions); - init(): void; - repaint(): void; - } - export interface ActionSheetOptions extends CollectionContainerWidgetOptions { - usePopover?: boolean; - target?: any; - title?: string; - showTitle?: boolean; - cancelText?: string; - noDataText?: string; - } - export class ActionSheet extends CollectionContainerWidget { - constructor(element: Element, options?: ActionSheetOptions); - constructor(element: JQuery, options?: ActionSheetOptions); - toggle(): void; - show(): void; - hide(): void; - } - export interface AutocompleteOptions extends CollectionContainerWidgetOptions { - value?: any; - minSearchLength?: number; - searchTimeout?: number; - placeholder?: string; - filterOperator?: string; - displayExpr?: string; - valueUpdateAction?: any; - valueUpdateEvent?: string; - } - export class Autocomplete extends CollectionContainerWidget { - constructor(element: Element, options?: AutocompleteOptions); - constructor(element: JQuery, options?: AutocompleteOptions); - toggle(): void; - show(): void; - hide(): void; - } - export interface ButtonOptions extends WidgetOptions { - type?: string; - text?: string; - icon?: string; - iconSrc?: string; - } - export class Button extends Widget { - constructor(element: Element, options?: ButtonOptions); - constructor(element: JQuery, options?: ButtonOptions); - } - export interface CheckBoxOptions extends WidgetOptions { - checked?: boolean; - } - export class CheckBox extends Widget { - constructor(element: Element, options?: CheckBoxOptions); - constructor(element: JQuery, options?: CheckBoxOptions); - } - export interface DateBoxOptions extends EditBoxOptions { - format?: string; - useNativePicker?: boolean; - value?: Date; - } - export class DateBox extends EditBox { - constructor(element: Element, options?: DateBoxOptions); - constructor(element: JQuery, options?: DateBoxOptions); - } - export interface DropDownMenuOptions extends ContainerWidgetOptions { - items?: Array; - itemClickAction?: any; - dataSource?: data.DataSource; - itemTemplate?: any; - itemRender?: Function; - buttonText?: string; - buttonIcon?: string; - buttonIconSrc?: string; - buttonClickAction?: any; - usePopover?: boolean; - } - export class DropDownMenu extends ContainerWidget { - constructor(element: Element, options?: DropDownMenuOptions); - constructor(element: JQuery, options?: DropDownMenuOptions); - } - export interface EditBoxOptions extends WidgetOptions { - value?: any; - valueUpdateEvent?: string; - valueUpdateAction?: any; - placeholder?: string; - readOnly?: boolean; - focusInAction?: any; - focusOutAction?: any; - keyDownAction?: any; - keyPressAction?: any; - keyUpAction?: any; - changeAction?: any; - enterKeyAction?: any; - mode?: string; - } - export class EditBox extends Widget { - constructor(element: Element, options?: EditBoxOptions); - constructor(element: JQuery, options?: EditBoxOptions); - focus(): void; - } - export interface ListOptions extends CollectionContainerWidgetOptions { - pullRefreshEnabled?: boolean; - autoPagingEnabled?: boolean; - scrollingEnabled?: boolean; - showScrollbar?: boolean; - useNativeScrolling?: boolean; - grouped?: boolean; - editEnabled?: boolean; - showNextButton?: boolean; - groupTemplate?: string; - pullingDownText?: string; - pulledDownText?: string; - refreshingText?: string; - pageLoadingText?: string; - scrollAction?: any; - pullRefreshAction?: any; - pageLoadingAction?: any; - itemHoldAction?: any; - itemSwipeAction?: any; - itemHoldTimeout?: number; - groupRender? (groupData: any, groupIndex: number, groupElement: Element): any; - editConfig?: { - itemTemplate?: any; - itemRenderer? (itemData: any, itemIndex: number, itemElement: Element): any; - deleteEnabled?: boolean; - deleteMode?: string; - selectionEnabled?: boolean; - selectionMode?: string; - } - itemDeleteAction?: any; - selectedItems?: any[]; - itemSelectAction?: any; - itemUnselectAction?: any; - } - export class List extends CollectionContainerWidget { - constructor(element: Element, options?: ListOptions); - constructor(element: JQuery, options?: ListOptions); - update(): JQueryDeferred; - deleteItem(itemElement: JQuery): JQueryDeferred; - deleteItem(itemElement: Element): JQueryDeferred; - clearSelectedItems(): void; - isItemSelected(itemElement: JQuery): boolean; - isItemSelected(itemElement: Element): boolean; - selectItem(itemElement: JQuery): void; - selectItem(itemElement: Element): void; - unselectItem(itemElement: JQuery): void; - unselectItem(itemElement: Element): void; - getSelectedItems(): number[]; - } - export interface LoadPanelOptions extends OverlayOptions { - message?: string; - width?: number; - height?: number; - } - export class LoadPanel extends Overlay { - constructor(element: Element, options?: LoadPanelOptions); - constructor(element: JQuery, options?: LoadPanelOptions); - } - export interface LookupOptions extends ContainerWidgetOptions { - dataSource?: data.DataSource; - value?: any; - displayValue?: string; - title?: string; - valueExpr?: string; - displayExpr?: string; - placeholder?: string; - searchPlaceholder?: string; - searchEnabled?: boolean; - searchTimeout?: number; - minFilterLength?: number; - fullScreen?: boolean; - valueChangeAction?: any; - itemTemplate?: any; - itemRender?: Function; - showCancelButton?: boolean; - showClearButton?: boolean; - showDoneButton?: boolean; - } - export class Lookup extends ContainerWidget { - constructor(element: Element, options?: LookupOptions); - constructor(element: JQuery, options?: LookupOptions); - } - export interface MapOptions extends WidgetOptions { - location?: any; - width?: number; - height?: number; - zoom?: number; - mapType?: string; - provider?: string; - markers?: Array; - routes?: Array; - key?: string; - controls?: any; - mapReadyAction?: any; - } - export class Map extends Widget { - constructor(element: Element, options?: MapOptions); - constructor(element: JQuery, options?: MapOptions); - addMarker(markerOptions: any, callback: Function): JQueryDeferred; - removeMarker(marker: any): void; - addRoute(routeOptions: any, callback: Function): JQueryDeferred; - removeRoute(route: any): void; - } - export interface NavBarOptions extends TabsOptions { } - export class NavBar extends Tabs { - constructor(element: Element, options?: NavBarOptions); - constructor(element: JQuery, options?: NavBarOptions); - } - export interface NumberBoxOptions extends EditBoxOptions { - min?: number; - max?: number; - value?: number; - } - export class NumberBox extends EditBox { - constructor(element: Element, options?: NumberBoxOptions); - constructor(element: JQuery, options?: NumberBoxOptions); - } - export interface OverlayOptions extends WidgetOptions { - activeStateEnabled?: boolean; - shading?: boolean; - closeOnOutsideClick?: boolean; - position?: any; - animation?: any; - showingAction?: any; - shownAction?: any; - hidingAction?: any; - hiddenAction?: any; - deferRendering?: boolean; - targetContainer?: any; - } - export class Overlay extends Widget { - constructor(element: Element, options?: OverlayOptions); - constructor(element: JQuery, options?: OverlayOptions); - } - export interface PanoramaOptions extends SelectableCollectionWidgetOptions { - title?: string; - backgroundImage?: any; - } - export class Panorama extends SelectableCollectionWidget { - constructor(element: Element, options?: PanoramaOptions); - constructor(element: JQuery, options?: PanoramaOptions); - } - export interface PivotOptions extends SelectableCollectionWidgetOptions { } - export class Pivot extends SelectableCollectionWidget { - constructor(element: Element, options?: PivotOptions); - constructor(element: JQuery, options?: PivotOptions); - } - export interface PopoverOptions extends PopupOptions { - target?: any; - } - export class Popover extends Popup { - constructor(element: Element, options?: PopoverOptions); - constructor(element: JQuery, options?: PopoverOptions); - } - export interface PopupOptions extends OverlayOptions { - title?: string; - showTitle?: boolean; - fullScreen?: boolean; - cancelButton?: any; - doneButton?: any; - clearButton?: any; - } - export class Popup extends Overlay { - constructor(element: Element, options?: PopupOptions); - constructor(element: JQuery, options?: PopupOptions); - content(): Element; - } - export interface RadioGroupOptions extends SelectableCollectionWidgetOptions { - layout?: string; - name?: string; - } - export class RadioGroup extends SelectableCollectionWidget { - constructor(element: Element, options?: RadioGroupOptions); - constructor(element: JQuery, options?: RadioGroupOptions); - } - export interface RangeSliderOptions extends SliderOptions { - start?: number; - end?: number; - } - export class RangeSlider extends Slider { - constructor(element: Element, options?: RangeSliderOptions); - constructor(element: JQuery, options?: RangeSliderOptions); - } - export interface ScrollableOptions extends ComponentOptions { - startAction?: any; - scrollAction?: any; - endAction?: any; - stopAction?: any; - inertiaAction?: any; - bounceAction?: any; - updateAction?: any; - bounceEnabled?: boolean; - direction?: string; - showScrollbar?: boolean; - useNative?: boolean; - } - export class Scrollable extends Component { - constructor(element: Element, options?: ScrollableOptions); - constructor(element: JQuery, options?: ScrollableOptions); - update(): void; - content(): JQuery; - location(): Object; - clientHeight(): number; - scrollHeight(): number; - scrollBy(distance: number): void; - scrollBy(distance: Object): void; - scrollTo(targetLocation: number): void; - scrollTo(targetLocation: Object): void; - } - export interface ScrollViewOptions extends ScrollableOptions { - pullingDownText?: string; - pulledDownText?: string; - refreshingText?: string; - reachBottomText?: string; - pullDownAction?: any; - reachBottomAction?: any; - } - export class ScrollView extends Scrollable { - constructor(element: Element, options?: ScrollViewOptions); - constructor(element: JQuery, options?: ScrollViewOptions); - release(preventReachBottom: boolean): JQueryDeferred; - toggleLoading(showOrHide: boolean): void; - isFull(): boolean; - } - export interface SelectBoxOptions extends AutocompleteOptions { - valueChangeAction?: any; - } - export class SelectBox extends Autocomplete { - constructor(element: Element, options?: SelectBoxOptions); - constructor(element: JQuery, options?: SelectBoxOptions); - } - export interface SliderOptions extends WidgetOptions { - min?: number; - max?: number; - step?: number; - value?: number; - } - export class Slider extends Widget { - constructor(element: Element, options?: SliderOptions); - constructor(element: JQuery, options?: SliderOptions); - } - export interface SwitchOptions extends WidgetOptions { - onText?: string; - offText?: string; - value?: boolean; - } - export class Switch extends Widget { - constructor(element: Element, options?: SwitchOptions); - constructor(element: JQuery, options?: SwitchOptions); - } - export interface TabsOptions extends SelectableCollectionWidgetOptions { } - export class Tabs extends SelectableCollectionWidget { - constructor(element: Element, options?: TabsOptions); - constructor(element: JQuery, options?: TabsOptions); - } - export interface TextAreaOptions extends EditBoxOptions { - cols?: number; - rows?: number; - } - export class TextArea extends EditBox { - constructor(element: Element, options?: TextAreaOptions); - constructor(element: JQuery, options?: TextAreaOptions); - } - export interface TextBoxOptions extends EditBoxOptions { - maxLength?: any; - } - export class TextBox extends EditBox { - constructor(element: Element, options?: TextBoxOptions); - constructor(element: JQuery, options?: TextBoxOptions); - } - export interface TileViewOptions extends CollectionContainerWidgetOptions { - bounceEnabled?: boolean; - showScrollbar?: boolean; - listHeight?: number; - baseItemWidth?: number; - baseItemHeight?: number; - itemMargin?: number; - } - export class TileView extends CollectionContainerWidget { - constructor(element: Element, options?: TileViewOptions); - constructor(element: JQuery, options?: TileViewOptions); - } - export interface ToastOptions extends OverlayOptions { - message?: string; - type?: string; - displayTime?: number; - } - export class Toast extends Overlay { - constructor(element: Element, options?: ToastOptions); - constructor(element: JQuery, options?: ToastOptions); - } - export interface ToolbarOptions extends CollectionContainerWidgetOptions { - menuItemRender?: Function; - menuItemTemplate?: any; - submenuType?: string; - } - export class Toolbar extends CollectionContainerWidget { - constructor(element: Element, options?: ToolbarOptions); - constructor(element: JQuery, options?: ToolbarOptions); - } -} -interface JQuery { - dxActionSheet(options?: DevExpress.ui.ActionSheetOptions): JQuery; - dxAutocomplete(options?: DevExpress.ui.AutocompleteOptions): JQuery; - dxButton(options?: DevExpress.ui.ButtonOptions): JQuery; - dxCheckBox(options?: DevExpress.ui.CheckBoxOptions): JQuery; - dxDateBox(options?: DevExpress.ui.DateBoxOptions): JQuery; - dxDropDownMenu(options?: DevExpress.ui.DropDownMenuOptions): JQuery; - dxEditBox(options?: DevExpress.ui.EditBoxOptions): JQuery; - dxList(options?: DevExpress.ui.ListOptions): JQuery; - dxLoadPanel(options?: DevExpress.ui.LoadPanelOptions): JQuery; - dxLookup(options?: DevExpress.ui.LookupOptions): JQuery; - dxMap(options?: DevExpress.ui.MapOptions): JQuery; - dxNavBar(options?: DevExpress.ui.NavBarOptions): JQuery; - dxNumberBox(options?: DevExpress.ui.NumberBoxOptions): JQuery; - dxOverlay(options?: DevExpress.ui.OverlayOptions): JQuery; - dxPanorama(options?: DevExpress.ui.PanoramaOptions): JQuery; - dxPivot(options?: DevExpress.ui.PivotOptions): JQuery; - dxPopover(options?: DevExpress.ui.PopoverOptions): JQuery; - dxPopup(options?: DevExpress.ui.PopupOptions): JQuery; - dxRadioGroup(options?: DevExpress.ui.RadioGroupOptions): JQuery; - dxRangeSlider(options?: DevExpress.ui.RangeSliderOptions): JQuery; - dxScrollable(options?: DevExpress.ui.ScrollableOptions): JQuery; - dxScrollView(options?: DevExpress.ui.ScrollViewOptions): JQuery; - dxSelectBox(options?: DevExpress.ui.SelectBoxOptions): JQuery; - dxSlider(options?: DevExpress.ui.SliderOptions): JQuery; - dxSwitch(options?: DevExpress.ui.SwitchOptions): JQuery; - dxTabs(options?: DevExpress.ui.TabsOptions): JQuery; - dxTextArea(options?: DevExpress.ui.TextAreaOptions): JQuery; - dxTextBox(options?: DevExpress.ui.TextBoxOptions): JQuery; - dxTileView(options?: DevExpress.ui.TileViewOptions): JQuery; - dxToast(options?: DevExpress.ui.ToastOptions): JQuery; - dxToolbar(options?: DevExpress.ui.ToolbarOptions): JQuery; -} \ No newline at end of file From 6e0bae985d640a78126eca4b6533557dcd172679 Mon Sep 17 00:00:00 2001 From: Earl Ferguson Date: Wed, 3 Sep 2014 16:04:51 -0400 Subject: [PATCH 117/537] Added Parse SDK Definition --- parse/parse-tests.ts | 519 ++++++++++++++++++++++++ parse/parse.d.ts | 943 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1462 insertions(+) create mode 100644 parse/parse-tests.ts create mode 100644 parse/parse.d.ts diff --git a/parse/parse-tests.ts b/parse/parse-tests.ts new file mode 100644 index 000000000..6316aaf17 --- /dev/null +++ b/parse/parse-tests.ts @@ -0,0 +1,519 @@ +/// + +function test_events() { + + var object = new Parse.Events(); + object.on("alert", (eventName: string) => alert("Triggered " + eventName)); + + object.trigger("alert", "an event"); + + var onChange = () => console.log('whatever'); + var context: any; + + object.off("change", onChange); + object.off("change"); + object.off(null, onChange); + object.off(null, null, context); + object.off(); +} + +class GameScore extends Parse.Object { + + constructor(options?: any) { + + super("GameScore", options); + } +} + +class Game extends Parse.Object { + + constructor(options?: any) { + + super("GameScore", options); + } + + set score(score: GameScore) { + this.set('score', score); + } + + get score(): GameScore { + return this.get("gameScore"); + } +} + +function test_object() { + + var game = new Game(); + +// Create a new instance of that class. + var gameScore = new GameScore(); + + gameScore.set("score", 1337); + gameScore.set("playerName", "Sean Plott"); + gameScore.set("cheatMode", false); + + + var score = gameScore.get("score"); + var playerName = gameScore.get("playerName"); + var cheatMode = gameScore.get("cheatMode"); + + gameScore.increment("score"); + gameScore.addUnique("skills", "flying"); + gameScore.addUnique("skills", "kungfu"); + + game.set("gameScore", gameScore); + game.score = gameScore; + + var newGameScore = game.score; + + game.save(null, { + success: (game) => { + // Execute any logic that should take place after the object is saved. + console.log('New object created with objectId: ' + game.id); + }, + error: (game, error) => { + // Execute any logic that should take place if the save fails. + // error is a Parse.Error with an error code and description. + console.log('Fa iled to create new object, with error code: ' + error.message); + } + }).then( + + (response) => { + + console.log(response); + }, + (error) => { + + console.log(error); + } + ); + + game.fetch().then( + + (response) => { + + console.log(response); + }, + (error) => { + + console.log(error); + } + ); + + game.destroy().then( + + (response) => { + + console.log(response); + }, + (error) => { + + console.log(error); + } + ); +} + +function test_query() { + + var gameScore = new GameScore(); + + var query = new Parse.Query(GameScore); + query.equalTo("playerName", "Dan Stemkoski"); + query.notEqualTo("playerName", "Michael Yabuti"); + query.greaterThan("playerAge", 18); + query.limit(10); + query.skip(10); + + // Sorts the results in ascending order by the score field + query.ascending("score"); + + // Sorts the results in descending order by the score field + query.descending("score"); + + // Restricts to wins < 50 + query.lessThan("wins", 50); + + // Restricts to wins <= 50 + query.lessThanOrEqualTo("wins", 50); + + // Restricts to wins > 50 + query.greaterThan("wins", 50); + + // Restricts to wins >= 50 + query.greaterThanOrEqualTo("wins", 50); + + // Finds scores from any of Jonathan, Dario, or Shawn + query.containedIn("playerName", + ["Jonathan Walsh", "Dario Wunsch", "Shawn Simon"]); + + // Finds scores from anyone who is neither Jonathan, Dario, nor Shawn + query.notContainedIn("playerName", + ["Jonathan Walsh", "Dario Wunsch", "Shawn Simon"]); + + // Finds objects that have the score set + query.exists("score"); + + // Finds objects that don't have the score set + query.doesNotExist("score"); + query.matchesKeyInQuery("hometown", "city", query); + query.doesNotMatchKeyInQuery("hometown", "city", query); + query.select("score", "playerName"); + + // Find objects where the array in arrayKey contains 2. + query.equalTo("arrayKey", 2); + + // Find objects where the array in arrayKey contains all of the elements 2, 3, and 4. + query.containsAll("arrayKey", [2, 3, 4]); + + query.startsWith("name", "Big Daddy's"); + query.equalTo("score", gameScore); + query.exists("score"); + query.include("score"); + query.include(["score.team"]); + + var testQuery = Parse.Query.or(query, query); + + query.count().then( + (object) => { + + }, + (error) => { + console.log("Error: " + error.code + " " + error.message); + } + ); + + query.find({ + success: (results) => { + alert("Successfully retrieved " + results.length + " scores."); + // Do something with the returned Parse.Object values + for (var i = 0; i < results.length; i++) { + var object = results[i]; + console.log(object.id + ' - ' + object.get('playerName')); + } + }, + error: (error) => { + alert("Error: " + error.code + " " + error.message); + } + }); + + query.first().then( + (object) => { + + }, + (error) => { + console.log("Error: " + error.code + " " + error.message); + } + ); +} + +class TestCollection extends Parse.Collection { + + constructor(models?: Parse.Object[]) { + + super(models); + } +} + +function test_collections() { + + var collection = new TestCollection(); + + var query = new Parse.Query(Game); + query.equalTo("temperature", "hot"); + query.greaterThan("degreesF", 100); + + collection = query.collection(); + + collection.comparator = (object) => { + return object.get("temperature"); + }; + + collection.add([ + {"name": "Duke"}, + {"name": "Scarlett"} + ]); + + collection.fetch().then( + (data) => { + + }, + (error) => { + console.log("Error: " + error.code + " " + error.message); + } + ); + + var model = collection.at(0); + + // Or you can get it by Parse objectId. + var modelAgain = collection.get(model.id); + + // Remove "Duke" from the collection. + collection.remove(model); + + // Completely replace all items in the collection. + collection.reset([ + {"name": "Hawk"}, + {"name": "Jane"} + ]); +} + +function test_file() { + + var base64 = "V29ya2luZyBhdCBQYXJzZSBpcyBncmVhdCE="; + var file = new Parse.File("myfile.txt", { base64: base64 }); + + var bytes = [ 0xBE, 0xEF, 0xCA, 0xFE ]; + var file = new Parse.File("myfile.txt", bytes); + + var file = new Parse.File("myfile.zzz", {}, "image/png"); + + var src = file.url(); + + file.save().then( + () => { + // The file has been saved to Parse. + }, + (error) => { + // The file either could n ot be read, or could not be saved to Parse. + }); + + Parse.Cloud.httpRequest({ url: file.url() }).then((response: Parse.Promise) => { + // result + }); + + // TODO: Check +} + +function test_analytics() { + + var dimensions = { + // Define ranges to bucket data points into meaningful segments + priceRange: '1000-1500', + // Did the user filter the query? + source: 'craigslist', + // Do searches happen more often on weekdays or weekends? + dayType: 'weekday' + }; + // Send the dimensions to Parse along with the 'search' event + Parse.Analytics.track('search', dimensions); + + var codeString = '404'; + Parse.Analytics.track('error', { code: codeString }) +} + +function test_user_acl_roles() { + + var user = new Parse.User(); + user.set("username", "my name"); + user.set("password", "my pass"); + user.set("email", "email@example.com"); + +// other fields can be set just like with Parse.Object + user.set("phone", "415-392-0202"); + + user.signUp(null, { + success: function(user) { + // Hooray! Let them use the app now. + }, + error: function(user, error) { + // Show the error message somewhere and let the user try again. + alert("Error: " + error.code + " " + error.message); + } + }); + + Parse.User.logIn("myname", "mypass").then( + (data) => { + + }, + (error) => { + console.log("Error: " + error.code + " " + error.message); + } + ); + + var currentUser = Parse.User.current(); + if (currentUser) { + // do stuff with the user + } else { + // show the signup or login page + } + + Parse.User.become("session-token-here").then(function (user) { + // The current user is now set to user. + }, function (error) { + // The token could not be validated. + }); + + var game = new Game(); + game.set("score", new GameScore()); + game.setACL(new Parse.ACL(Parse.User.current())); + game.save(); + + var groupACL = new Parse.ACL(); + + var userList = []; + // userList is an array with the users we are sending this message to. + for (var i = 0; i < userList.length; i++) { + groupACL.setReadAccess(userList[i], true); + groupACL.setWriteAccess(userList[i], true); + } + + groupACL.setPublicReadAccess(true); + + game.setACL(groupACL); + + Parse.User.requestPasswordReset("email@example.com").then(function (data) { + // The current user is now set to user. + }, function (error) { + // The token could not be validated. + }); + + // By specifying no write privileges for the ACL, we can ensure the role cannot be altered. + var role = new Parse.Role("Administrator", groupACL); + role.getUsers().add(role); + role.getRoles().add(role); + role.save(); + + Parse.User.logOut(); +} + +function test_facebook_util() { + + Parse.FacebookUtils.init({ + appId : 'YOUR_APP_ID', // Facebook App ID + channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File + cookie : true, // enable cookies to allow Parse to access the session + xfbml : true // parse XFBML + }); + + Parse.FacebookUtils.logIn(null, { + success: (user) => { + if (!user.existed()) { + alert("User signed up and logged in through Facebook!"); + } else { + alert("User logged in through Facebook!"); + } + }, + error: (user, error) => { + alert("User cancelled the Facebook login or did not fully authorize."); + } + }); + + var user = Parse.User.current(); + + if (!Parse.FacebookUtils.isLinked(user)) { + Parse.FacebookUtils.link(user, null, { + success: (user) => { + alert("Woohoo, user logged in with Facebook!"); + }, + error: (user, error) => { + alert("User cancelled the Facebook login or did not fully authorize."); + } + }); + } + + Parse.FacebookUtils.unlink(user, { + success: (user) => { + alert("The user is no longer associated with their Facebook account."); + } + }); +} + +function test_cloud_functions() { + + Parse.Cloud.run('hello', {}, { + success: (result) => { + // result + }, + error: (error) => { + } + }); + + Parse.Cloud.afterDelete('MyCustomClass', (request: Parse.Cloud.AfterDeleteRequest) => { + // result + }); + + Parse.Cloud.afterSave('MyCustomClass', (request: Parse.Cloud.AfterSaveRequest) => { + // result + }); + + Parse.Cloud.beforeDelete('MyCustomClass', (request: Parse.Cloud.BeforeDeleteRequest, + response: Parse.Cloud.BeforeDeleteResponse) => { + // result + }); +} + +class PlaceObject extends Parse.Object {} + +function test_geo_points() { + + var point = new Parse.GeoPoint({latitude: 40.0, longitude: -30.0}); + + var userObject = Parse.User.current(); + + // User's location + var userGeoPoint = userObject.get("location"); + + // Create a query for places + var query = new Parse.Query(Parse.User); +// Interested in locations near user. + query.near("location", userGeoPoint); + // Limit what could be a lot of points. + query.limit(10); + // Final list of objects + query.find({ + success: (placesObjects) => { + } + }); + + + var southwestOfSF = new Parse.GeoPoint(37.708813, -122.526398); + var northeastOfSF = new Parse.GeoPoint(37.822802, -122.373962); + + var query = new Parse.Query(PlaceObject); + query.withinGeoBox("location", southwestOfSF, northeastOfSF); + query.find({ + success: function(place) { + + } + }); +} + +function test_push() { + + Parse.Push.send({ + channels: [ "Gia nts", "Mets" ], + data: { + alert: "The Giants won against the Mets 2-3." + } + }, { + success: () => { + // Push was successful + }, + error: (error) => { + // Handle error + } + }); + + var query = new Parse.Query(Parse.Installation); + query.equalTo('injuryReports', true); + + Parse.Push.send({ + where: query, // Set our Installation query + data: { + alert: "Willie Hayes injured by own pop fly." + } + }, { + success: function() { + // Push was successful + }, + error: function(error) { + // Handle error + } + }); +} + +function test_view() { + + var model = Parse.User.current(); + var view = new Parse.View(); +} \ No newline at end of file diff --git a/parse/parse.d.ts b/parse/parse.d.ts new file mode 100644 index 000000000..697e3bf87 --- /dev/null +++ b/parse/parse.d.ts @@ -0,0 +1,943 @@ +// Type definitions for Parse v1.2.19 +// Project: https://parse.com/ +// Definitions by: Ullisen Media Group, LLC <[http://ullisenmedia.com]> +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// +/// + +declare module Parse { + + var applicationId: string; + var javaScriptKey: string; + var masterKey: string; + var serverURL: string; + var VERSION: string; + + interface ParseDefaultOptions { + wait?: boolean; + silent?: boolean; + success?: Function; + error?: Function; + 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; + } + + /** + * A Promise is returned by async methods as a hook to provide callbacks to be + * called when the async task is fulfilled. + * + *

Typical usage would be like:

+     *    query.find().then(function(results) {
+     *      results[0].set("foo", "bar");
+     *      return results[0].saveAsync();
+     *    }).then(function(result) {
+     *      console.log("Updated " + result.id);
+     *    });
+     * 

+ * + * @see Parse.Promise.prototype.then + * @class + */ + + interface IPromise { + + then(resolvedCallback: (value: T) => IPromise, rejectedCallback?: (reason: any) => IPromise): IPromise; + then(resolvedCallback: (value: T) => U, rejectedCallback?: (reason: any) => IPromise): IPromise; + then(resolvedCallback: (value: T) => U, rejectedCallback?: (reason: any) => U): IPromise; + } + + interface Promise { + + always(callback: Function): Promise; + as(): Promise; + done(callback: Function): Promise; + error(): Promise; + fail(callback: Function): Promise; + is(): Promise; + reject(error: any): void; + resolve(result: any): void; + then(resolvedCallback: (value: T) => Promise, + rejectedCallback?: (reason: any) => Promise): IPromise; + then(resolvedCallback: (value: T) => U, + rejectedCallback?: (reason: any) => IPromise): IPromise; + then(resolvedCallback: (value: T) => U, + rejectedCallback?: (reason: any) => U): IPromise; + + when(promises: Promise[]): Promise; + } + + interface IBaseObject { + toJSON(): any; + } + + class BaseObject implements IBaseObject { + toJSON(): any; + } + + /** + * Creates a new ACL. + * If no argument is given, the ACL has no permissions for anyone. + * If the argument is a Parse.User, the ACL will have read and write + * permission for only that user. + * If the argument is any other JSON object, that object will be interpretted + * as a serialized ACL created with toJSON(). + * @see Parse.Object#setACL + * @class + * + *

An ACL, or Access Control List can be added to any + * Parse.Object to restrict access to only a subset of users + * of your application.

+ */ + class ACL extends BaseObject { + + permissionsById: any; + + constructor(arg1?: any); + + setPublicReadAccess(allowed: boolean); + getPublicReadAccess(): boolean; + + setPublicWriteAccess(allowed: boolean); + getPublicWriteAccess(): boolean; + + setReadAccess(userId: User, allowed: boolean); + getReadAccess(userId: User): boolean; + + setReadAccess(userId: string, allowed: boolean); + getReadAccess(userId: string): boolean; + + setRoleReadAccess(role: Role, allowed: boolean); + setRoleReadAccess(role: string, allowed: boolean); + getRoleReadAccess(role: Role): boolean; + getRoleReadAccess(role: string): boolean; + + setRoleWriteAccess(role: Role, allowed: boolean); + setRoleWriteAccess(role: string, allowed: boolean); + getRoleWriteAccess(role: Role): boolean; + getRoleWriteAccess(role: string): boolean; + + setWriteAccess(userId: User, allowed: boolean); + setWriteAccess(userId: string, allowed: boolean); + getWriteAccess(userId: User): boolean; + getWriteAccess(userId: string): boolean; + } + + + /** + * A Parse.File is a local representation of a file that is saved to the Parse + * cloud. + * @class + * @param name {String} The file's name. This will be prefixed by a unique + * value once the file has finished saving. The file name must begin with + * an alphanumeric character, and consist of alphanumeric characters, + * periods, spaces, underscores, or dashes. + * @param data {Array} The data for the file, as either: + * 1. an Array of byte value Numbers, or + * 2. an Object like { base64: "..." } with a base64-encoded String. + * 3. a File object selected with a file upload control. (3) only works + * in Firefox 3.6+, Safari 6.0.2+, Chrome 7+, and IE 10+. + * For example:
+     * var fileUploadControl = $("#profilePhotoFileUpload")[0];
+     * if (fileUploadControl.files.length > 0) {
+     *   var file = fileUploadControl.files[0];
+     *   var name = "photo.jpg";
+     *   var parseFile = new Parse.File(name, file);
+     *   parseFile.save().then(function() {
+     *     // The file has been saved to Parse.
+     *   }, function(error) {
+     *     // The file either could not be read, or could not be saved to Parse.
+     *   });
+     * }
+ * @param type {String} Optional Content-Type header to use for the file. If + * this is omitted, the content type will be inferred from the name's + * extension. + */ + class File { + + constructor(name: string, data: any, type?: string); + name(): string; + url(): string; + save(options?: ParseDefaultOptions); + + } + + /** + * Creates a new GeoPoint with any of the following forms:
+ *
+     *   new GeoPoint(otherGeoPoint)
+     *   new GeoPoint(30, 30)
+     *   new GeoPoint([30, 30])
+     *   new GeoPoint({latitude: 30, longitude: 30})
+     *   new GeoPoint()  // defaults to (0, 0)
+     *   
+ * @class + * + *

Represents a latitude / longitude point that may be associated + * with a key in a ParseObject or used as a reference point for geo queries. + * This allows proximity-based queries on the key.

+ * + *

Only one key in a class may contain a GeoPoint.

+ * + *

Example:

+     *   var point = new Parse.GeoPoint(30.0, -20.0);
+     *   var object = new Parse.Object("PlaceObject");
+     *   object.set("location", point);
+     *   object.save();

+ */ + class GeoPoint extends BaseObject { + + latitude: number; + longitude: number; + + constructor(arg1?: any, arg2?: any); + + current(options?: ParseDefaultOptions): GeoPoint; + radiansTo(point: GeoPoint): number; + kilometersTo(point: GeoPoint): number; + milesTo(point: GeoPoint): number; + } + + /** + * History serves as a global router (per frame) to handle hashchange + * events or pushState, match the appropriate route, and trigger + * callbacks. You shouldn't ever have to create one of these yourself + * — you should use the reference to Parse.history + * that will be created for you automatically if you make use of + * Routers with routes. + * @class + * + *

A fork of Backbone.History, provided for your convenience. If you + * use this class, you must also include jQuery, or another library + * that provides a jQuery-compatible $ function. For more information, + * see the + * Backbone documentation.

+ *

Available in the client SDK only.

+ */ + class History { + + handlers: any[]; + interval: number; + fragment: string; + + checkUrl(e?: any): void; + getFragment(fragment?: string, forcePushState?: boolean): string; + getHash(windowOverride: Window): string; + loadUrl(fragmentOverride: any): boolean; + navigate(fragment: string, options?: any): any; + route(route: any, callback: Function): void; + start(options: any): boolean; + stop(): void; + } + + /** + * A class that is used to access all of the children of a many-to-many relationship. + * Each instance of Parse.Relation is associated with a particular parent object and key. + */ + class Relation extends BaseObject { + + parent: Object; + key: string; + targetClassName: string; + + constructor(parent?: Object, key?: string); + + //Adds a Parse.Object or an array of Parse.Objects to the relation. + add(object: Object): void; + + // Returns a Parse.Query that is limited to objects in this relation. + query(): Query; + + // Removes a Parse.Object or an array of Parse.Objects from this relation. + remove(object: Object): void; + } + + /** + * Creates a new model with defined attributes. A client id (cid) is + * automatically generated and assigned for you. + * + *

You won't normally call this method directly. It is recommended that + * you use a subclass of Parse.Object instead, created by calling + * extend.

+ * + *

However, if you don't want to use a subclass, or aren't sure which + * subclass is appropriate, you can use this form:

+     *     var object = new Parse.Object("ClassName");
+     * 
+ * That is basically equivalent to:
+     *     var MyClass = Parse.Object.extend("ClassName");
+     *     var object = new MyClass();
+     * 

+ * + * @param {Object} attributes The initial set of data to store in the object. + * @param {Object} options A set of Backbone-like options for creating the + * object. The only option currently supported is "collection". + * @see Parse.Object.extend + * + * @class + * + *

The fundamental unit of Parse data, which implements the Backbone Model + * interface.

+ */ + class Object extends BaseObject { + + id: any; + attributes: any; + cid: string; + changed: boolean; + className: string; + + constructor(className?: string, options?: any); + 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; + + initialize(); + add(attr: string, item: any); + addUnique(attr: string, item: any); + change(options: any); + changedAttributes(diff: any): any; + clear(options: any): any; + clone(): Object; + destroy(options?: ParseDefaultOptions): Promise; + destroyAll(list: Object[], options?: ParseDefaultOptions): Promise; + dirty(attr: String): boolean; + dirtyKeys(): string[]; + escape(attr: string); + existed(): boolean; + fetch(options?: ParseDefaultOptions): Promise; + get(attr: string): any; + getACL(): ACL; + has(attr: string): boolean; + hasChanged(attr: string): boolean; + increment(attr: string, amount?: number): any; + isValid(): boolean; + op(attr: string): any; + previous(attr: string): any; + previousAttributes(): any; + relation(attr: string): Relation; + remove(attr: string, item: any): any; + save(options?: ParseDefaultOptions, arg2?: any, arg3?: any): Promise; + saveAll(list: Object[], options?: ParseDefaultOptions): Promise; + set(key: string, value: any, options?: ParseDefaultOptions): boolean; + setACL(acl: ACL, options?: ParseDefaultOptions): boolean; + unset(attr: string, options?: any): any; + validate(attrs: any, options?: ParseDefaultOptions): boolean; + + } + + /** + * Every Parse application installed on a device registered for + * push notifications has an associated Installation object. + */ + class Installation extends Object { + + badge: any; + channels: string[]; + timeZone: any; + deviceType: string; + pushType: string; + installationId: string; + deviceToken: string; + channelUris: string; + appName: string; + appVersion: string; + parseVersion: string; + appIdentifier: string; + + } + + /** + * Creates a new instance with the given models and options. Typically, you + * will not call this method directly, but will instead make a subclass using + * Parse.Collection.extend. + * + * @param {Array} models An array of instances of Parse.Object. + * + * @param {Object} options An optional object with Backbone-style options. + * Valid options are:
    + *
  • model: The Parse.Object subclass that this collection contains. + *
  • query: An instance of Parse.Query to use when fetching items. + *
  • comparator: A string property name or function to sort by. + *
+ * + * @see Parse.Collection.extend + * + * @class + * + *

Provides a standard collection class for our sets of models, ordered + * or unordered. For more information, see the + * Backbone + * documentation.

+ */ + class Collection extends Events implements IBaseObject { + + model: Object; + models: Object[]; + query: Query; + comparator: (object: Object) => any; + + constructor(models?: Object[], options?: CollectionOptions); + static extend(instanceProps: any, classProps: any): any; + + initialize(): void; + add(models: any[], options?: CollectionAddOptions); + at(index: number): Object; + chain(): _Chain>; + fetch(options?: ParseDefaultOptions): Promise; + create(model: Object, options?: ParseDefaultOptions): 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; + toJSON(): any; + + } + + /** + * @class + * + *

Parse.Events is a fork of Backbone's Events module, provided for your + * convenience.

+ * + *

A module that can be mixed in to any object in order to provide + * it with custom events. You may bind callback functions to an event + * with `on`, or remove these functions with `off`. + * Triggering an event fires all callbacks in the order that `on` was + * called. + * + *

+     *     var object = {};
+     *     _.extend(object, Parse.Events);
+     *     object.on('expand', function(){ alert('expanded'); });
+     *     object.trigger('expand');

+ * + *

For more information, see the + * Backbone + * documentation.

+ */ + class Events { + + static off(events: string[], callback?: Function, context?: any); + static on(events: string[], callback?: Function, context?: any); + static trigger(events: string[]); + static bind(); + static unbind(); + + on(eventName: string, callback?: Function, context?: any): any; + off(eventName?: string, callback?: Function, context?: any): any; + trigger(eventName: string, ...args: any[]): any; + bind(eventName: string, callback: Function, context?: any): any; + unbind(eventName?: string, callback?: Function, context?: any): any; + + } + + /** + * Creates a new parse Parse.Query for the given Parse.Object subclass. + * @param objectClass - + * An instance of a subclass of Parse.Object, or a Parse className string. + * @class + * + *

Parse.Query defines a query that is used to fetch Parse.Objects. The + * most common use case is finding all objects that match a query through the + * find method. For example, this sample code fetches all objects + * of class MyClass. It calls a different function depending on + * whether the fetch succeeded or not. + * + *

+     * var query = new Parse.Query(MyClass);
+     * query.find({
+     *   success: function(results) {
+     *     // results is an array of Parse.Object.
+     *   },
+     *
+     *   error: function(error) {
+     *     // error is an instance of Parse.Error.
+     *   }
+     * });

+ * + *

A Parse.Query can also be used to retrieve a single object whose id is + * known, through the get method. For example, this sample code fetches an + * object of class MyClass and id myId. It calls a + * different function depending on whether the fetch succeeded or not. + * + *

+     * var query = new Parse.Query(MyClass);
+     * query.get(myId, {
+     *   success: function(object) {
+     *     // object is an instance of Parse.Object.
+     *   },
+     *
+     *   error: function(object, error) {
+     *     // error is an instance of Parse.Error.
+     *   }
+     * });

+ * + *

A Parse.Query can also be used to count the number of objects that match + * the query without retrieving all of those objects. For example, this + * sample code counts the number of objects of the class MyClass + *

+     * var query = new Parse.Query(MyClass);
+     * query.count({
+     *   success: function(number) {
+     *     // There are number instances of MyClass.
+     *   },
+     *
+     *   error: function(error) {
+     *     // error is an instance of Parse.Error.
+     *   }
+     * });

+ */ + class Query extends BaseObject { + + objectClass: any; + className: string; + + constructor(objectClass: any); + + static or(...var_args: Query[]): Query; + + addAscending(key: string): Query; + addAscending(key: string[]): Query; + addDescending(key: string): Query; + addDescending(key: string[]): Query; + ascending(key: string): Query; + ascending(key: string[]): Query; + collection(items?: Object[], options?: ParseDefaultOptions): Collection; + containedIn(key: string, values: any[]): Query; + contains(key: string, substring: string): Query; + containsAll(key: string, values: any[]): Query; + count(options?: ParseDefaultOptions): 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; + 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; + greaterThan(key: string, value: any): Query; + greaterThanOrEqualTo(key: string, value: any): Query; + include(key: string): Query; + include(keys: string[]): Query; + lessThan(key: string, value: any): Query; + lessThanOrEqualTo(key: string, value: any): Query; + limit(n: number): Query; + matches(key: string, regex: RegExp, modifiers: any): Query; + matchesKeyInQuery(key: string, queryKey: string, query: Query): Query; + matchesQuery(key: string, query: Query): Query; + near(key: string, point: GeoPoint): Query; + notContainedIn(key: string, values: any[]): Query; + notEqualTo(key: string, value: any): Query; + select(...keys: string[]): Query; + skip(n: number): Query; + startsWith(key: string, prefix: string): Query; + withinGeoBox(key: string, southwest: GeoPoint, northeast: GeoPoint): Query; + withinKilometers(key: string, point: GeoPoint, maxDistance: number): Query; + withinMiles(key: string, point: GeoPoint, maxDistance: number): Query; + withinRadians(key: string, point: GeoPoint, maxDistance: number): Query; + } + + /** + * Represents a Role on the Parse server. Roles represent groupings of + * Users for the purposes of granting permissions (e.g. specifying an ACL + * for an Object). Roles are specified by their sets of child users and + * child roles, all of which are granted any permissions that the parent + * role has. + * + *

Roles must have a name (which cannot be changed after creation of the + * role), and must specify an ACL.

+ * @class + * A Parse.Role is a local representation of a role persisted to the Parse + * cloud. + */ + class Role extends Object { + + constructor(name: string, acl: ACL); + + getRoles(): Relation; + getUsers(): Relation; + getName(): string; + setName(name: string, options?: ParseDefaultOptions); + } + + /** + * Routers map faux-URLs to actions, and fire events when routes are + * matched. Creating a new one sets its `routes` hash, if not set statically. + * @class + * + *

A fork of Backbone.Router, provided for your convenience. + * For more information, see the + * Backbone + * documentation.

+ *

Available in the client SDK only.

+ */ + class Router extends Events { + + routes: any[]; + + constructor(options?: RouterOptions); + + static extend(instanceProps: any, classProps: any): any; + + initialize(): void; + navigate(fragment: string, options?: NavigateOptions): Router; + navigate(fragment: string, trigger?: boolean): Router; + route(route: string, name: string, callback: Function): Router; + } + + /** + * @class + * + *

A Parse.User object is a local representation of a user persisted to the + * Parse cloud. This class is a subclass of a Parse.Object, and retains the + * same functionality of a Parse.Object, but also extends it with various + * user specific methods, like authentication, signing up, and validation of + * uniqueness.

+ */ + 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 logOut(): void; + static allowCustomUserClass(isAllowed: boolean): void; + static become(sessionToken: string, options?: ParseDefaultOptions): Promise; + static requestPasswordReset(email: string, options?: ParseDefaultOptions): Promise; + + signUp(attrs: any, options?: ParseDefaultOptions): Promise; + logIn(options?: ParseDefaultOptions): Promise; + fetch(options?: ParseDefaultOptions): Promise; + save(arg1: any, arg2: any, arg3: any): Promise; + authenticated(): boolean; + isCurrent(): boolean; + + getEmail(): string; + setEmail(email: string, options: ParseDefaultOptions): boolean; + + getUsername(): string; + setUsername(username: string, options?: ParseDefaultOptions): boolean; + + setPassword(password: string, options?: ParseDefaultOptions): boolean; + + getSessionToken(): string; + } + + /** + * Creating a Parse.View creates its initial element outside of the DOM, + * if an existing element is not provided... + * @class + * + *

A fork of Backbone.View, provided for your convenience. If you use this + * class, you must also include jQuery, or another library that provides a + * jQuery-compatible $ function. For more information, see the + * Backbone + * documentation.

+ *

Available in the client SDK only.

+ */ + class View extends Events { + + model: any; + collection: any; + id: string; + cid: string; + className: string; + tagName: string; + el: any; + $el: JQuery; + attributes: any; + + constructor(options?: ViewOptions); + + static extend(properties: any, classProperties?: any): any; + + $(selector?: string): JQuery; + setElement(element: HTMLElement, delegate?: boolean): View; + setElement(element: JQuery, delegate?: boolean): View; + render(): View; + remove(): View; + make(tagName: any, attributes?: any, content?: any): any; + delegateEvents(events?: any): any; + undelegateEvents(): any; + + } + + module Analytics { + + function track(name: string, dimensions: any):Promise; + } + + /** + * Provides a set of utilities for using Parse with Facebook. + * @namespace + * Provides a set of utilities for using Parse with Facebook. + */ + module FacebookUtils { + + function init(options?: any); + 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; + } + + /** + * @namespace Contains functions for calling and declaring + * cloud functions. + *

+ * Some functions are only available from Cloud Code. + *

+ */ + module Cloud { + + interface CookieOptions { + domain?: string; + expires?: Date; + httpOnly?: boolean; + maxAge?: number; + path?: string; + secure?: boolean; + } + + interface HttpResponse { + buffer?: Buffer; + cookies?: any; + data?: any; + headers?: any; + status?: number; + text?: string; + } + + interface JobRequest { + params: any; + } + + interface JobStatus { + error?: Function; + message?: Function; + success?: Function; + } + + interface FunctionRequest { + installationId?: String; + master?: boolean; + params?: any; + user?: User; + } + + interface FunctionResponse { + success?: (response: HttpResponse) => void; + error?: (response: HttpResponse) => void; + } + + interface Cookie { + name?: string; + options?: CookieOptions; + value?: string; + } + + interface AfterSaveRequest extends FunctionRequest {} + interface AfterDeleteRequest extends FunctionRequest {} + interface BeforeDeleteRequest extends FunctionRequest {} + interface BeforeDeleteResponse extends FunctionResponse {} + interface BeforeSaveRequest extends FunctionRequest {} + interface BeforeSaveResponse extends FunctionResponse {} + + function afterDelete(arg1: any, func?: (request: AfterDeleteRequest) => void): void; + function afterSave(arg1: any, func?: (request: AfterSaveRequest) => void): void; + 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 job(name: string, func?: (request: JobRequest, status: JobStatus) => void): HttpResponse; + function run(name: string, data?: any, options?: ParseDefaultOptions): Promise; + function useMasterKey(): void; + } + + + class Error { + + code: ErrorCode; + message: string; + + constructor(code: ErrorCode, message: string); + + } + + enum ErrorCode { + + OTHER_CAUSE = -1, + INTERNAL_SERVER_ERROR = 1, + CONNECTION_FAILED = 100, + OBJECT_NOT_FOUND = 101, + INVALID_QUERY = 102, + INVALID_CLASS_NAME = 103, + MISSING_OBJECT_ID = 104, + INVALID_KEY_NAME = 105, + INVALID_POINTER = 106, + INVALID_JSON = 107, + COMMAND_UNAVAILABLE = 108, + NOT_INITIALIZED = 109, + INCORRECT_TYPE = 111, + INVALID_CHANNEL_NAME = 112, + PUSH_MISCONFIGURED = 115, + OBJECT_TOO_LARGE = 116, + OPERATION_FORBIDDEN = 119, + CACHE_MISS = 120, + INVALID_NESTED_KEY = 121, + INVALID_FILE_NAME = 122, + INVALID_ACL = 123, + TIMEOUT = 124, + INVALID_EMAIL_ADDRESS = 125, + MISSING_CONTENT_TYPE = 126, + MISSING_CONTENT_LENGTH = 127, + INVALID_CONTENT_LENGTH = 128, + FILE_TOO_LARGE = 129, + FILE_SAVE_ERROR = 130, + FILE_DELETE_ERROR = 153, + DUPLICATE_VALUE = 137, + INVALID_ROLE_NAME = 139, + EXCEEDED_QUOTA = 140, + SCRIPT_FAILED = 141, + VALIDATION_ERROR = 142, + INVALID_IMAGE_DATA = 150, + UNSAVED_FILE_ERROR = 151, + INVALID_PUSH_TIME_ERROR = 152, + USERNAME_MISSING = 200, + PASSWORD_MISSING = 201, + USERNAME_TAKEN = 202, + EMAIL_TAKEN = 203, + EMAIL_MISSING = 204, + EMAIL_NOT_FOUND = 205, + SESSION_MISSING = 206, + MUST_CREATE_USER_THROUGH_SIGNUP = 207, + ACCOUNT_ALREADY_LINKED = 208, + LINKED_ID_MISSING = 250, + INVALID_LINKED_SESSION = 251, + UNSUPPORTED_SERVICE = 252, + AGGREGATE_ERROR = 600, + FILE_READ_ERROR = 601, + X_DOMAIN_REQUEST = 602 + } + + /** + * @class + * A Parse.Op is an atomic operation that can be applied to a field in a + * Parse.Object. For example, calling object.set("foo", "bar") + * is an example of a Parse.Op.Set. Calling object.unset("foo") + * is a Parse.Op.Unset. These operations are stored in a Parse.Object and + * sent to the server as part of object.save() operations. + * Instances of Parse.Op should be immutable. + * + * You should not create subclasses of Parse.Op or instantiate Parse.Op + * directly. + */ + module Op { + + interface BaseOperation extends IBaseObject { + objects(): any[]; + } + + interface Add extends BaseOperation { + } + + interface AddUnique extends BaseOperation { + } + + interface Increment extends IBaseObject { + amount: number; + } + + interface Relation extends IBaseObject { + added(): Object[]; + removed: Object[]; + } + + interface Set extends IBaseObject { + value(): any; + } + + interface Unset extends IBaseObject { + } + + } + + /** + * Contains functions to deal with Push in Parse + * @name Parse.Push + * @namespace + */ + module Push { + + function send(data: PushData, options?: ParseDefaultOptions):Promise; + } + + /** + * Call this method first to set up your authentication tokens for Parse. + * You can get your keys from the Data Browser on parse.com. + * @param {String} applicationId Your Parse Application ID. + * @param {String} javaScriptKey Your Parse JavaScript Key. + * @param {String} masterKey (optional) Your Parse Master Key. (Node.js only!) + */ + function initialize(applicationId: string, javaScriptKey: string, masterKey?: string); + +} + +declare module "parse" { + var type: typeof Parse; + var subType: { + Parse: typeof type; + } + + export = subType; +} From f43c2d163ab7bf8672caa0921a6559b5758a74e4 Mon Sep 17 00:00:00 2001 From: Earl Ferguson Date: Wed, 3 Sep 2014 16:16:54 -0400 Subject: [PATCH 118/537] Cleaning up test --- parse/parse-tests.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/parse/parse-tests.ts b/parse/parse-tests.ts index 6316aaf17..49b2e62b2 100644 --- a/parse/parse-tests.ts +++ b/parse/parse-tests.ts @@ -31,14 +31,6 @@ class Game extends Parse.Object { super("GameScore", options); } - - set score(score: GameScore) { - this.set('score', score); - } - - get score(): GameScore { - return this.get("gameScore"); - } } function test_object() { @@ -62,9 +54,6 @@ function test_object() { gameScore.addUnique("skills", "kungfu"); game.set("gameScore", gameScore); - game.score = gameScore; - - var newGameScore = game.score; game.save(null, { success: (game) => { From 577175844db5f7efe7d0a19a8e3d47605c468fc5 Mon Sep 17 00:00:00 2001 From: Earl Ferguson Date: Wed, 3 Sep 2014 16:59:24 -0400 Subject: [PATCH 119/537] Bug fixes after running tests --- parse/parse-tests.ts | 128 ++++--------------------------------------- parse/parse.d.ts | 66 +++++++++++----------- 2 files changed, 42 insertions(+), 152 deletions(-) diff --git a/parse/parse-tests.ts b/parse/parse-tests.ts index 49b2e62b2..c7cc6ff49 100644 --- a/parse/parse-tests.ts +++ b/parse/parse-tests.ts @@ -54,52 +54,6 @@ function test_object() { gameScore.addUnique("skills", "kungfu"); game.set("gameScore", gameScore); - - game.save(null, { - success: (game) => { - // Execute any logic that should take place after the object is saved. - console.log('New object created with objectId: ' + game.id); - }, - error: (game, error) => { - // Execute any logic that should take place if the save fails. - // error is a Parse.Error with an error code and description. - console.log('Fa iled to create new object, with error code: ' + error.message); - } - }).then( - - (response) => { - - console.log(response); - }, - (error) => { - - console.log(error); - } - ); - - game.fetch().then( - - (response) => { - - console.log(response); - }, - (error) => { - - console.log(error); - } - ); - - game.destroy().then( - - (response) => { - - console.log(response); - }, - (error) => { - - console.log(error); - } - ); } function test_query() { @@ -161,38 +115,6 @@ function test_query() { query.include(["score.team"]); var testQuery = Parse.Query.or(query, query); - - query.count().then( - (object) => { - - }, - (error) => { - console.log("Error: " + error.code + " " + error.message); - } - ); - - query.find({ - success: (results) => { - alert("Successfully retrieved " + results.length + " scores."); - // Do something with the returned Parse.Object values - for (var i = 0; i < results.length; i++) { - var object = results[i]; - console.log(object.id + ' - ' + object.get('playerName')); - } - }, - error: (error) => { - alert("Error: " + error.code + " " + error.message); - } - }); - - query.first().then( - (object) => { - - }, - (error) => { - console.log("Error: " + error.code + " " + error.message); - } - ); } class TestCollection extends Parse.Collection { @@ -300,25 +222,6 @@ function test_user_acl_roles() { // other fields can be set just like with Parse.Object user.set("phone", "415-392-0202"); - user.signUp(null, { - success: function(user) { - // Hooray! Let them use the app now. - }, - error: function(user, error) { - // Show the error message somewhere and let the user try again. - alert("Error: " + error.code + " " + error.message); - } - }); - - Parse.User.logIn("myname", "mypass").then( - (data) => { - - }, - (error) => { - console.log("Error: " + error.code + " " + error.message); - } - ); - var currentUser = Parse.User.current(); if (currentUser) { // do stuff with the user @@ -339,7 +242,7 @@ function test_user_acl_roles() { var groupACL = new Parse.ACL(); - var userList = []; + var userList: Parse.User[] = [Parse.User.current()]; // userList is an array with the users we are sending this message to. for (var i = 0; i < userList.length; i++) { groupACL.setReadAccess(userList[i], true); @@ -375,14 +278,14 @@ function test_facebook_util() { }); Parse.FacebookUtils.logIn(null, { - success: (user) => { + success: (user: Parse.User) => { if (!user.existed()) { alert("User signed up and logged in through Facebook!"); } else { alert("User logged in through Facebook!"); } }, - error: (user, error) => { + error: (user: Parse.User, error: any) => { alert("User cancelled the Facebook login or did not fully authorize."); } }); @@ -391,17 +294,17 @@ function test_facebook_util() { if (!Parse.FacebookUtils.isLinked(user)) { Parse.FacebookUtils.link(user, null, { - success: (user) => { + success: (user: any) => { alert("Woohoo, user logged in with Facebook!"); }, - error: (user, error) => { + error: (user: any, error: any) => { alert("User cancelled the Facebook login or did not fully authorize."); } }); } Parse.FacebookUtils.unlink(user, { - success: (user) => { + success: (user: Parse.User) => { alert("The user is no longer associated with their Facebook account."); } }); @@ -410,10 +313,10 @@ function test_facebook_util() { function test_cloud_functions() { Parse.Cloud.run('hello', {}, { - success: (result) => { + success: (result: any) => { // result }, - error: (error) => { + error: (error: any) => { } }); @@ -448,23 +351,12 @@ function test_geo_points() { query.near("location", userGeoPoint); // Limit what could be a lot of points. query.limit(10); - // Final list of objects - query.find({ - success: (placesObjects) => { - } - }); - var southwestOfSF = new Parse.GeoPoint(37.708813, -122.526398); var northeastOfSF = new Parse.GeoPoint(37.822802, -122.373962); var query = new Parse.Query(PlaceObject); query.withinGeoBox("location", southwestOfSF, northeastOfSF); - query.find({ - success: function(place) { - - } - }); } function test_push() { @@ -478,7 +370,7 @@ function test_push() { success: () => { // Push was successful }, - error: (error) => { + error: (error: any) => { // Handle error } }); @@ -495,7 +387,7 @@ function test_push() { success: function() { // Push was successful }, - error: function(error) { + error: function(error: any) { // Handle error } }); diff --git a/parse/parse.d.ts b/parse/parse.d.ts index 697e3bf87..4f179eb91 100644 --- a/parse/parse.d.ts +++ b/parse/parse.d.ts @@ -1,6 +1,6 @@ // Type definitions for Parse v1.2.19 // Project: https://parse.com/ -// Definitions by: Ullisen Media Group, LLC <[http://ullisenmedia.com]> +// Definitions by: Ullisen Media Group LLC // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -136,30 +136,30 @@ declare module Parse { constructor(arg1?: any); - setPublicReadAccess(allowed: boolean); + setPublicReadAccess(allowed: boolean): void; getPublicReadAccess(): boolean; - setPublicWriteAccess(allowed: boolean); + setPublicWriteAccess(allowed: boolean): void; getPublicWriteAccess(): boolean; - setReadAccess(userId: User, allowed: boolean); + setReadAccess(userId: User, allowed: boolean): void; getReadAccess(userId: User): boolean; - setReadAccess(userId: string, allowed: boolean); + setReadAccess(userId: string, allowed: boolean): void; getReadAccess(userId: string): boolean; - setRoleReadAccess(role: Role, allowed: boolean); - setRoleReadAccess(role: string, allowed: boolean); + setRoleReadAccess(role: Role, allowed: boolean): void; + setRoleReadAccess(role: string, allowed: boolean): void; getRoleReadAccess(role: Role): boolean; getRoleReadAccess(role: string): boolean; - setRoleWriteAccess(role: Role, allowed: boolean); - setRoleWriteAccess(role: string, allowed: boolean); + setRoleWriteAccess(role: Role, allowed: boolean): void; + setRoleWriteAccess(role: string, allowed: boolean): void; getRoleWriteAccess(role: Role): boolean; getRoleWriteAccess(role: string): boolean; - setWriteAccess(userId: User, allowed: boolean); - setWriteAccess(userId: string, allowed: boolean); + setWriteAccess(userId: User, allowed: boolean): void; + setWriteAccess(userId: string, allowed: boolean): void; getWriteAccess(userId: User): boolean; getWriteAccess(userId: string): boolean; } @@ -199,7 +199,7 @@ declare module Parse { constructor(name: string, data: any, type?: string); name(): string; url(): string; - save(options?: ParseDefaultOptions); + save(options?: ParseDefaultOptions): Promise; } @@ -335,18 +335,18 @@ declare module Parse { static fetchAll(list: Object[], options: ParseDefaultOptions): Promise; static fetchAllIfNeeded(list: Object[], options: ParseDefaultOptions): Promise; - initialize(); - add(attr: string, item: any); - addUnique(attr: string, item: any); - change(options: any); - changedAttributes(diff: any): any; + initialize(): void; + add(attr: string, item: any): Object; + addUnique(attr: string, item: any): any; + change(options: any): Object; + changedAttributes(diff: any): boolean; clear(options: any): any; clone(): Object; destroy(options?: ParseDefaultOptions): Promise; destroyAll(list: Object[], options?: ParseDefaultOptions): Promise; dirty(attr: String): boolean; dirtyKeys(): string[]; - escape(attr: string); + escape(attr: string): string; existed(): boolean; fetch(options?: ParseDefaultOptions): Promise; get(attr: string): any; @@ -424,7 +424,7 @@ declare module Parse { static extend(instanceProps: any, classProps: any): any; initialize(): void; - add(models: any[], options?: CollectionAddOptions); + add(models: any[], options?: CollectionAddOptions): Collection; at(index: number): Object; chain(): _Chain>; fetch(options?: ParseDefaultOptions): Promise; @@ -464,17 +464,17 @@ declare module Parse { */ class Events { - static off(events: string[], callback?: Function, context?: any); - static on(events: string[], callback?: Function, context?: any); - static trigger(events: string[]); - static bind(); - static unbind(); + static off(events: string[], callback?: Function, context?: any): Events; + static on(events: string[], callback?: Function, context?: any): Events; + static trigger(events: string[]): Events; + static bind(): Events; + static unbind(): Events; - on(eventName: string, callback?: Function, context?: any): any; - off(eventName?: string, callback?: Function, context?: any): any; - trigger(eventName: string, ...args: any[]): any; - bind(eventName: string, callback: Function, context?: any): any; - unbind(eventName?: string, callback?: Function, context?: any): any; + on(eventName: string, callback?: Function, context?: any): Events; + off(eventName?: string, callback?: Function, context?: any): Events; + trigger(eventName: string, ...args: any[]): Events; + bind(eventName: string, callback: Function, context?: any): Events; + unbind(eventName?: string, callback?: Function, context?: any): Events; } @@ -608,7 +608,7 @@ declare module Parse { getRoles(): Relation; getUsers(): Relation; getName(): string; - setName(name: string, options?: ParseDefaultOptions); + setName(name: string, options?: ParseDefaultOptions): any; } /** @@ -627,7 +627,6 @@ declare module Parse { routes: any[]; constructor(options?: RouterOptions); - static extend(instanceProps: any, classProps: any): any; initialize(): void; @@ -669,7 +668,6 @@ declare module Parse { setUsername(username: string, options?: ParseDefaultOptions): boolean; setPassword(password: string, options?: ParseDefaultOptions): boolean; - getSessionToken(): string; } @@ -724,7 +722,7 @@ declare module Parse { */ module FacebookUtils { - function init(options?: any); + 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; @@ -929,7 +927,7 @@ declare module Parse { * @param {String} javaScriptKey Your Parse JavaScript Key. * @param {String} masterKey (optional) Your Parse Master Key. (Node.js only!) */ - function initialize(applicationId: string, javaScriptKey: string, masterKey?: string); + function initialize(applicationId: string, javaScriptKey: string, masterKey?: string): void; } From 32bfad140fa864dea286f5f5db7e9385f7172cbc Mon Sep 17 00:00:00 2001 From: Earl Ferguson Date: Wed, 3 Sep 2014 17:08:59 -0400 Subject: [PATCH 120/537] Header cleanup --- parse/parse.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse/parse.d.ts b/parse/parse.d.ts index 4f179eb91..1acc44c6b 100644 --- a/parse/parse.d.ts +++ b/parse/parse.d.ts @@ -1,6 +1,6 @@ // Type definitions for Parse v1.2.19 // Project: https://parse.com/ -// Definitions by: Ullisen Media Group LLC +// Definitions by: Ullisen Media Group // Definitions: https://github.com/borisyankov/DefinitelyTyped /// From 2167630b2ae3332c01cf985832e3146efb0458b8 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 4 Sep 2014 09:50:18 +1000 Subject: [PATCH 121/537] Argument to eval and evalAsync are optional Reference : https://github.com/angular/angular.js/pull/8558 --- angularjs/angular.d.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 084bea034..7e2f5ddba 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -482,13 +482,11 @@ declare module ng { $digest(): void; $emit(name: string, ...args: any[]): IAngularEvent; - // Documentation says exp is optional, but actual implementaton counts on it - $eval(expression: string, args?: Object): any; - $eval(expression: (scope: IScope) => any, args?: Object): any; + $eval(expression?: string, args?: Object): any; + $eval(expression?: (scope: IScope) => any, args?: Object): any; - // Documentation says exp is optional, but actual implementaton counts on it - $evalAsync(expression: string): void; - $evalAsync(expression: (scope: IScope) => any): void; + $evalAsync(expression?: string): void; + $evalAsync(expression?: (scope: IScope) => any): void; // Defaults to false by the implementation checking strategy $new(isolate?: boolean): IScope; From d8c36a37f5e3d4cfac1b262304d12a8317f67b86 Mon Sep 17 00:00:00 2001 From: tomato360 Date: Thu, 4 Sep 2014 09:11:26 +0900 Subject: [PATCH 122/537] add header and modification JQueryLeanModalOption --- jquery.leanModal/jquery.leanModal.d.ts | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/jquery.leanModal/jquery.leanModal.d.ts b/jquery.leanModal/jquery.leanModal.d.ts index f4f395e58..47c0e3537 100755 --- a/jquery.leanModal/jquery.leanModal.d.ts +++ b/jquery.leanModal/jquery.leanModal.d.ts @@ -1,24 +1,22 @@ - +// Type definitions for leanModal.js 1.1 +// Project: http://leanmodal.finelysliced.com.au/ +// Definitions by: FinelySliced +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// interface JQueryLeanModalOption { - top : number; - overlay : number; - closeButton : String; -} - -interface JQueryLeanModalStatic { - ():any; - (JQueryLeanModalOption):any; + top? : number; + overlay? : number; + closeButton? : String; } interface JQueryStatic { - leanModal(): JQueryLeanModalStatic; - leanModal(JQueryLeanModalOption): JQueryLeanModalStatic; + leanModal(): JQuery; + leanModal(val : JQueryLeanModalOption): JQuery; } interface JQuery { - leanModal(): JQueryLeanModalStatic; - leanModal(JQueryLeanModalOption): JQueryLeanModalStatic; + leanModal(): JQuery; + leanModal(val : JQueryLeanModalOption): JQuery; } \ No newline at end of file From 556005691d5f42fd2a49a4de37273997a42b704b Mon Sep 17 00:00:00 2001 From: tomato360 Date: Thu, 4 Sep 2014 09:11:26 +0900 Subject: [PATCH 123/537] add header and modification JQueryLeanModalOption --- CONTRIBUTORS.md | 5 +- ...TORS_98f07bc20cb66328be238119df96c490.html | 407 ++++++++++++++++++ jquery.leanModal/jquery.leanModal.d.ts | 24 +- 3 files changed, 421 insertions(+), 15 deletions(-) create mode 100644 CONTRIBUTORS_98f07bc20cb66328be238119df96c490.html diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 1cded38d5..afc287da3 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,4 +1,4 @@ -# Contributors +# Contributors This is a non-exhaustive list of definitions and their creators. If you created a definition but are not listed then feel free to send a pull request on this file with your name and url. @@ -175,6 +175,7 @@ All definitions files include a header with the author and editors, so at some p * [jQuery.jNotify](http://jnotify.codeplex.com) (by [James Curran](https://github.com/jamescurran/)) * [jQuery.joyride](http://zurb.com/playground/jquery-joyride-feature-tour-plugin) (by [Vincent Bortone](https://github.com/vbortone)) * [jQuery.jSignature](https://github.com/willowsystems/jSignature) (by [Patrick Magee](https://github.com/pjmagee)) +* [jQuery.leanModal](http://leanmodal.finelysliced.com.au/)(by [tomato360](https://github.com/tomato360)) * [jQuery.notifyBar](http://www.whoop.ee/posts/2013-04-05-the-resurrection-of-jquery-notify-bar/) (by [Shunsuke Ohtani](https://github.com/zaneli)) * [jQuery.noty](http://needim.github.io/noty/) (by [Aaron King](https://github.com/kingdango/)) * [jQuery.payment](http://needim.github.io/noty/) (by [Eric J. Smith](https://github.com/ejsmith/)) @@ -244,7 +245,7 @@ All definitions files include a header with the author and editors, so at some p * [Marked](https://github.com/chjj/marked) (by [William Orr](https://github.com/worr)) * [MathJax](https://github.com/mathjax/MathJax) (by [Roland Zwaga](https://github.com/rolandzwaga)) * [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) (by [Sarah Williams](https://github.com/flurg)) -* [Meteor](https://www.meteor.com) (by [Dave Allen](https://github.com/fullflavedave)) +* [Meteor](https://www.meteor.com) (by [Dave Allen](https://github.com/fullflavedave)) * [md5.js](http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html) (by [MIZUNE Pine](https://github.com/pine613)) * [Microsoft Ajax](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) (by [Patrick Magee](https://github.com/pjmagee)) * [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) (by [John Vilk](https://github.com/jvilk)) diff --git a/CONTRIBUTORS_98f07bc20cb66328be238119df96c490.html b/CONTRIBUTORS_98f07bc20cb66328be238119df96c490.html new file mode 100644 index 000000000..5fbae25d6 --- /dev/null +++ b/CONTRIBUTORS_98f07bc20cb66328be238119df96c490.html @@ -0,0 +1,407 @@ + + + + + + +CONTRIBUTORS.md + + +

Contributors

+

This is a non-exhaustive list of definitions and their creators. If you created a definition but are not listed then feel free to send a pull request on this file with your name and url.

+

All definitions files include a header with the author and editors, so at some point this list will be auto-generated.

+ +
    +
  • jQuery.leanModal(by tomato360)
  • +
  • jQuery.notifyBar (by Shunsuke Ohtani)
  • +
  • jQuery.noty (by Aaron King)
  • +
  • jQuery.payment (by Eric J. Smith)
  • +
  • jQuery.pickadate (by Theodore Brown)
  • +
  • jQuery.pjax (by Junle Li)
  • +
  • jQuery.pjax.falsandtru (by NewNotMoon)
  • +
  • jQuery.pnotify (by David Sichau)
  • +
  • jQuery.postMessage (by Junle Li)
  • +
  • jQuery.prettyphoto (by Paul Gaske)
  • +
  • jQuery.scrollTo (by Neil Stalker)
  • +
  • jQuery.simplePagination (by Natan Vivo)
  • +
  • jquery.superLink (by Blake Niemyjski)
  • +
  • jQuery.tile (by Shunsuke Ohtani)
  • +
  • jQuery.timeago (by François Guillot)
  • +
  • jQuery.Timepicker (by Anwar Javed)
  • +
  • jQuery.Timer (by Joshua Strobl)
  • +
  • jQuery.TinyCarousel (by Christiaan Rakowski)
  • +
  • jQuery.TinyScrollbar (by Christiaan Rakowski)
  • +
  • jQuery.tooltipster (by Patrick Magee)
  • +
  • jQuery.total-storage (by Jeremy Brooks)
  • +
  • jQuery.Transit (by MrBigDog2U)
  • +
  • jQuery.Validation (by Boris Yankov)
  • +
  • jQuery.Watermark (by Anwar Javed)
  • +
  • jQuery.base64 (by Shinya Mochizuki)
  • +
  • jquery-handsontable (by Ted John)
  • +
  • js-git (by Bart van der Schoor)
  • +
  • js-url (by MIZUNE Pine)
  • +
  • js-yaml (by Bart van der Schoor)
  • +
  • jsbn (by Eugene Chernyshov)
  • +
  • jScrollPane (by Dániel Tar)
  • +
  • JSDeferred (by Daisuke Mino)
  • +
  • JSONEditorOnline (by Vincent Bortone)
  • +
  • JSON-Pointer (by Bart van der Schoor)
  • +
  • JsRender (by Kensuke MATSUZAKI)
  • +
  • jStorage (by Danil Flores)
  • +
  • jsTree (by Adam Pluciński)
  • +
  • JWPlayer (by Martin Duparc)
  • +
  • KeyboardJS (by Vincent Bortone)
  • +
  • keymaster.js (by Marting W. Kirst)
  • +
  • KineticJS (by Basarat Ali Syed)
  • +
  • Knockback (by Marcel Binot)
  • +
  • Knockout.js (by Boris Yankov)
  • +
  • Knockout.Amd.Helpers (by David Sichau)
  • +
  • Knockout.DeferredUpdates (by Sebastián Galiano)
  • +
  • Knockout.ES5 (by Sebastián Galiano)
  • +
  • Knockout.Mapper (by Brandon Meyer)
  • +
  • Knockout.Mapping (by Boris Yankov)
  • +
  • Knockout.Postbox (by Judah Gabriel Himango)
  • +
  • Knockout.Rx (by Igor Oleinikov)
  • +
  • Knockout.Validation (by Dan Ludwig)
  • +
  • Knockout.Viewmodel (by Oisin Grehan)
  • +
  • ko.editables (by Oisin Grehan)
  • +
  • KoLite (by Boris Yankov)
  • +
  • Lazy.js (by Bart van der Schoor)
  • +
  • Leaflet (by Vladimir)
  • +
  • Libxmljs (by François de Campredon)
  • +
  • ladda (by Danil Flores)
  • +
  • Levelup (by Bret Little)
  • +
  • linq.js (by Marcin Najder)
  • +
  • Livestamp.js (by Vincent Bortone)
  • +
  • localForage (by david pichsenmeister)
  • +
  • Lodash (by Brian Zengel)
  • +
  • Logg (by Bret Little)
  • +
  • Long.js (by Toshihide Hara)
  • +
  • lz-string (by Roman Nikitin)
  • +
  • Mapbox (by Maxime Fabre)
  • +
  • Marked (by William Orr)
  • +
  • MathJax (by Roland Zwaga)
  • +
  • mCustomScrollbar (by Sarah Williams)
  • +
  • Meteor (by Dave Allen)
  • +
  • md5.js (by MIZUNE Pine)
  • +
  • Microsoft Ajax (by Patrick Magee)
  • +
  • Microsoft Live Connect (by John Vilk)
  • +
  • Minimatch (by vvakame)
  • +
  • minimist (by Bart van der Schoor)
  • +
  • Mixpanel (by Knut Eirik Leira Hjelle)
  • +
  • mixto (by vvakame)
  • +
  • Modernizr (by Boris Yankov and Theodore Brown)
  • +
  • Moment.js (by Michael Lakerveld)
  • +
  • MongoDB (from TypeScript samples, updated by Niklas Mollenhauer)
  • +
  • mongoose (by Hiroki Horiuchi)
  • +
  • morgan (by James Roland Cabresos)
  • +
  • Mousetrap (by Dániel Tar)
  • +
  • msgpack.js (by Shinya Mochizuki)
  • +
  • Mustache.js (by Boris Yankov)
  • +
  • mysql (by William Johnston)
  • +
  • nconf (by Jeff Goddard)
  • +
  • needle (by San Chen)
  • +
  • noble (by Seon-Wook Park)
  • +
  • nock (by bonnici)
  • +
  • Node.js (from TypeScript samples)
  • +
  • node_redis (by Boris Yankov)
  • +
  • node-ffi (by Paul Loyd)
  • +
  • node-form (by Roman Samec)
  • +
  • node-git (by vvakame)
  • +
  • nodeunit (by Jeff Goddard)
  • +
  • node_zeromq (by Dave McKeown)
  • +
  • node-sqlserver (by Boris Yankov)
  • +
  • node-uuid (by Jeff May)
  • +
  • notify.js (by soundTricker)
  • +
  • NProgress (by Judah Gabriel Himango)
  • +
  • Numeral.js (by Vincent Bortone)
  • +
  • object-path (by Paulo Cesar)
  • +
  • ocLazyLoad (by Roland Zwaga)
  • +
  • OpenLayers (by Ilya Bolkhovsky)
  • +
  • Optimist (by Carlos Ballesteros Velasco)
  • +
  • Passport (by Hiroki Horiuchi)
  • +
  • passport-facebook (by James Roland Cabresos)
  • +
  • passport-strategy (by Lior Mualem)
  • +
  • pathwatcher (by vvakame)
  • +
  • Parallel.js (by Josh Baldwin)
  • +
  • Parsimmon (by Bart van der Schoor)
  • +
  • PDF.js (by Josh Baldwin)
  • +
  • PEG.js (by vvakame)
  • +
  • Persona (by James Frasca)
  • +
  • PhantomJS (by Jed Hunsaker)
  • +
  • PhoneGap (by Boris Yankov)
  • +
  • Physijs (by gyoh_k)
  • +
  • PixiJS (by Pedro Casaubon)
  • +
  • Platform (by Jake Hickman)
  • +
  • PouchDB (by Bill Sears)
  • +
  • PreloadJS (by Pedro Ferreira)
  • +
  • ProgressJs (by Shunsuke Ohtani)
  • +
  • promise-pool (by VILIC VANE)
  • +
  • Q (by Barrie Nemetchek, Andrew Gaspar)
  • +
  • Q-io (by Bart van der Schoor)
  • +
  • q-retry (by VILIC VANE)
  • +
  • QUnit (by Diullei Gomes)
  • +
  • Raven.js (by Santi Albo)
  • +
  • Recaptcha.js (by Brent Jenkins)
  • +
  • Rickshaw (by Blake Niemyjski)
  • +
  • Riot.js (by vvakame)
  • +
  • Restify (by Bret Little)
  • +
  • Redis (by Carlos Ballesteros Velasco)
  • +
  • Request (by Carlos Ballesteros Velasco)
  • +
  • Royalslider (by Christiaan Rakowski)
  • +
  • Rx.js (by gsino, Igor Oleinikov, Carl de Billy, zoetrope)
  • +
  • Raphael (by CheCoxshall)
  • +
  • Restangular (by Boris Yankov)
  • +
  • require.js (by Josh Baldwin)
  • +
  • rtree.js (by Omede Firouz)
  • +
  • Sammy.js (by Boris Yankov)
  • +
  • Select2 (by Boris Yankov)
  • +
  • Selenium WebDriverJS (by Bill Armstrong)
  • +
  • Semver (by Bart van der Schoor)
  • +
  • Sencha Touch (by Brian Kotek)
  • +
  • SharePoint (by Stanislav Vyshchepan and Andrey Markeev)
  • +
  • ShellJS (by Niklas Mollenhauer)
  • +
  • SignalR (by Boris Yankov)
  • +
  • simple-cw-node (by vvakame)
  • +
  • Sinon (by William Sears)
  • +
  • SIPml (by Adriaan Groenenboom)
  • +
  • sjcl (by Eugene Chernyshov)
  • +
  • SlickGrid (by Josh Baldwin)
  • +
  • smoothie (by Mike H. Hawley and Drew Noakes)
  • +
  • socket.io (by William Orr)
  • +
  • socket.io-client (by Maido Kaara)
  • +
  • SockJS (by Emil Ivanov)
  • +
  • sockjs-node (by Phil McCloghry-Laing)
  • +
  • SoundJS (by Pedro Ferreira)
  • +
  • source-map (by Morten Houston Ludvigsen)
  • +
  • Spin (by Boris Yankov)
  • +
  • sqlite3 (by Nick Malaguti)
  • +
  • status-bar (by vvakame)
  • +
  • stripe (by Eric J. Smith)
  • +
  • Store.js (by Vincent Bortone)
  • +
  • Sugar (by Josh Baldwin)
  • +
  • Swiper (by Sebastián Galiano)
  • +
  • SwipeView (by Boris Yankov)
  • +
  • Swiz (by Jeff Goddard)
  • +
  • TV4 (by Bart van der Schoor)
  • +
  • Tags Manager (by Vincent Bortone)
  • +
  • Teechart (by Steema)
  • +
  • text-buffer (by vvakame)
  • +
  • text-encoding (by MIZUNE Pine)
  • +
  • three.js (by Kon)
  • +
  • TimelineJS (by Roland Zwaga)
  • +
  • timezonecomplete (by Rogier Schouten)
  • +
  • Toastr (by Boris Yankov)
  • +
  • trunk8 (by Blake Niemyjski)
  • +
  • TweenJS (by Pedro Ferreira)
  • +
  • tween.js (by Adam R. Smith)
  • +
  • twitter-bootstrap-wizard (by Blake Niemyjski)
  • +
  • Twitter Typeahead (by Ivaylo Gochkov)
  • +
  • Ubuntu Unity Web API (by John Vrbanac)
  • +
  • Underscore.js (by Boris Yankov)
  • +
  • Underscore.js (Typed) (by Josh Baldwin)
  • +
  • Underscore-ko.js (by Maurits Elbers)
  • +
  • universal-analytics (by Bart van der Schoor)
  • +
  • update-notifier (by vvakame)
  • +
  • uri-templates (by Bart van der Schoor)
  • +
  • urlrouter (by Carlos Ballesteros Velasco)
  • +
  • UUID.js (by Jason Jarrett)
  • +
  • Valerie (by Howard Richards)
  • +
  • Velocity (by Greg Smith)
  • +
  • Viewporter (by Boris Yankov)
  • +
  • Vimeo (by Daz Wilkin)
  • +
  • vinyl (by vvakame)
  • +
  • vinyl-fs (by vvakame)
  • +
  • WebRTC (by Ken Smith)
  • +
  • websocket (by Paul Loyd)
  • +
  • WinJS (from TypeScript samples)
  • +
  • WinRT (from TypeScript samples)
  • +
  • ws (by Paul Loyd)
  • +
  • x2js (by Hiroki Horiuchi)
  • +
  • xml2js (by Michel Salib)
  • +
  • xpath (by Andrew Bradley)
  • +
  • XRegExp (by Bart van der Schoor)
  • +
  • YouTube (by Daz Wilkin)
  • +
  • YouTube Analytics API (by Frank M)
  • +
  • YouTube Data API (by Frank M)
  • +
  • Zepto.js (by Josh Baldwin)
  • +
  • Zynga Scroller (by Boris Yankov)
  • +
  • ZeroClipboard (by Eric J. Smith)
  • + + + +> diff --git a/jquery.leanModal/jquery.leanModal.d.ts b/jquery.leanModal/jquery.leanModal.d.ts index f4f395e58..47c0e3537 100755 --- a/jquery.leanModal/jquery.leanModal.d.ts +++ b/jquery.leanModal/jquery.leanModal.d.ts @@ -1,24 +1,22 @@ - +// Type definitions for leanModal.js 1.1 +// Project: http://leanmodal.finelysliced.com.au/ +// Definitions by: FinelySliced +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// interface JQueryLeanModalOption { - top : number; - overlay : number; - closeButton : String; -} - -interface JQueryLeanModalStatic { - ():any; - (JQueryLeanModalOption):any; + top? : number; + overlay? : number; + closeButton? : String; } interface JQueryStatic { - leanModal(): JQueryLeanModalStatic; - leanModal(JQueryLeanModalOption): JQueryLeanModalStatic; + leanModal(): JQuery; + leanModal(val : JQueryLeanModalOption): JQuery; } interface JQuery { - leanModal(): JQueryLeanModalStatic; - leanModal(JQueryLeanModalOption): JQueryLeanModalStatic; + leanModal(): JQuery; + leanModal(val : JQueryLeanModalOption): JQuery; } \ No newline at end of file From 029781c46f906f960cfdbc18acd8d3fe9d00b33f Mon Sep 17 00:00:00 2001 From: Masaya Nasu Date: Thu, 4 Sep 2014 09:33:18 +0900 Subject: [PATCH 124/537] Delete unnecessary files Delete unnecessary files --- ...TORS_98f07bc20cb66328be238119df96c490.html | 407 ------------------ 1 file changed, 407 deletions(-) delete mode 100644 CONTRIBUTORS_98f07bc20cb66328be238119df96c490.html diff --git a/CONTRIBUTORS_98f07bc20cb66328be238119df96c490.html b/CONTRIBUTORS_98f07bc20cb66328be238119df96c490.html deleted file mode 100644 index 5fbae25d6..000000000 --- a/CONTRIBUTORS_98f07bc20cb66328be238119df96c490.html +++ /dev/null @@ -1,407 +0,0 @@ - - - - - - -CONTRIBUTORS.md - - -

    Contributors

    -

    This is a non-exhaustive list of definitions and their creators. If you created a definition but are not listed then feel free to send a pull request on this file with your name and url.

    -

    All definitions files include a header with the author and editors, so at some point this list will be auto-generated.

    - -
      -
    • jQuery.leanModal(by tomato360)
    • -
    • jQuery.notifyBar (by Shunsuke Ohtani)
    • -
    • jQuery.noty (by Aaron King)
    • -
    • jQuery.payment (by Eric J. Smith)
    • -
    • jQuery.pickadate (by Theodore Brown)
    • -
    • jQuery.pjax (by Junle Li)
    • -
    • jQuery.pjax.falsandtru (by NewNotMoon)
    • -
    • jQuery.pnotify (by David Sichau)
    • -
    • jQuery.postMessage (by Junle Li)
    • -
    • jQuery.prettyphoto (by Paul Gaske)
    • -
    • jQuery.scrollTo (by Neil Stalker)
    • -
    • jQuery.simplePagination (by Natan Vivo)
    • -
    • jquery.superLink (by Blake Niemyjski)
    • -
    • jQuery.tile (by Shunsuke Ohtani)
    • -
    • jQuery.timeago (by François Guillot)
    • -
    • jQuery.Timepicker (by Anwar Javed)
    • -
    • jQuery.Timer (by Joshua Strobl)
    • -
    • jQuery.TinyCarousel (by Christiaan Rakowski)
    • -
    • jQuery.TinyScrollbar (by Christiaan Rakowski)
    • -
    • jQuery.tooltipster (by Patrick Magee)
    • -
    • jQuery.total-storage (by Jeremy Brooks)
    • -
    • jQuery.Transit (by MrBigDog2U)
    • -
    • jQuery.Validation (by Boris Yankov)
    • -
    • jQuery.Watermark (by Anwar Javed)
    • -
    • jQuery.base64 (by Shinya Mochizuki)
    • -
    • jquery-handsontable (by Ted John)
    • -
    • js-git (by Bart van der Schoor)
    • -
    • js-url (by MIZUNE Pine)
    • -
    • js-yaml (by Bart van der Schoor)
    • -
    • jsbn (by Eugene Chernyshov)
    • -
    • jScrollPane (by Dániel Tar)
    • -
    • JSDeferred (by Daisuke Mino)
    • -
    • JSONEditorOnline (by Vincent Bortone)
    • -
    • JSON-Pointer (by Bart van der Schoor)
    • -
    • JsRender (by Kensuke MATSUZAKI)
    • -
    • jStorage (by Danil Flores)
    • -
    • jsTree (by Adam Pluciński)
    • -
    • JWPlayer (by Martin Duparc)
    • -
    • KeyboardJS (by Vincent Bortone)
    • -
    • keymaster.js (by Marting W. Kirst)
    • -
    • KineticJS (by Basarat Ali Syed)
    • -
    • Knockback (by Marcel Binot)
    • -
    • Knockout.js (by Boris Yankov)
    • -
    • Knockout.Amd.Helpers (by David Sichau)
    • -
    • Knockout.DeferredUpdates (by Sebastián Galiano)
    • -
    • Knockout.ES5 (by Sebastián Galiano)
    • -
    • Knockout.Mapper (by Brandon Meyer)
    • -
    • Knockout.Mapping (by Boris Yankov)
    • -
    • Knockout.Postbox (by Judah Gabriel Himango)
    • -
    • Knockout.Rx (by Igor Oleinikov)
    • -
    • Knockout.Validation (by Dan Ludwig)
    • -
    • Knockout.Viewmodel (by Oisin Grehan)
    • -
    • ko.editables (by Oisin Grehan)
    • -
    • KoLite (by Boris Yankov)
    • -
    • Lazy.js (by Bart van der Schoor)
    • -
    • Leaflet (by Vladimir)
    • -
    • Libxmljs (by François de Campredon)
    • -
    • ladda (by Danil Flores)
    • -
    • Levelup (by Bret Little)
    • -
    • linq.js (by Marcin Najder)
    • -
    • Livestamp.js (by Vincent Bortone)
    • -
    • localForage (by david pichsenmeister)
    • -
    • Lodash (by Brian Zengel)
    • -
    • Logg (by Bret Little)
    • -
    • Long.js (by Toshihide Hara)
    • -
    • lz-string (by Roman Nikitin)
    • -
    • Mapbox (by Maxime Fabre)
    • -
    • Marked (by William Orr)
    • -
    • MathJax (by Roland Zwaga)
    • -
    • mCustomScrollbar (by Sarah Williams)
    • -
    • Meteor (by Dave Allen)
    • -
    • md5.js (by MIZUNE Pine)
    • -
    • Microsoft Ajax (by Patrick Magee)
    • -
    • Microsoft Live Connect (by John Vilk)
    • -
    • Minimatch (by vvakame)
    • -
    • minimist (by Bart van der Schoor)
    • -
    • Mixpanel (by Knut Eirik Leira Hjelle)
    • -
    • mixto (by vvakame)
    • -
    • Modernizr (by Boris Yankov and Theodore Brown)
    • -
    • Moment.js (by Michael Lakerveld)
    • -
    • MongoDB (from TypeScript samples, updated by Niklas Mollenhauer)
    • -
    • mongoose (by Hiroki Horiuchi)
    • -
    • morgan (by James Roland Cabresos)
    • -
    • Mousetrap (by Dániel Tar)
    • -
    • msgpack.js (by Shinya Mochizuki)
    • -
    • Mustache.js (by Boris Yankov)
    • -
    • mysql (by William Johnston)
    • -
    • nconf (by Jeff Goddard)
    • -
    • needle (by San Chen)
    • -
    • noble (by Seon-Wook Park)
    • -
    • nock (by bonnici)
    • -
    • Node.js (from TypeScript samples)
    • -
    • node_redis (by Boris Yankov)
    • -
    • node-ffi (by Paul Loyd)
    • -
    • node-form (by Roman Samec)
    • -
    • node-git (by vvakame)
    • -
    • nodeunit (by Jeff Goddard)
    • -
    • node_zeromq (by Dave McKeown)
    • -
    • node-sqlserver (by Boris Yankov)
    • -
    • node-uuid (by Jeff May)
    • -
    • notify.js (by soundTricker)
    • -
    • NProgress (by Judah Gabriel Himango)
    • -
    • Numeral.js (by Vincent Bortone)
    • -
    • object-path (by Paulo Cesar)
    • -
    • ocLazyLoad (by Roland Zwaga)
    • -
    • OpenLayers (by Ilya Bolkhovsky)
    • -
    • Optimist (by Carlos Ballesteros Velasco)
    • -
    • Passport (by Hiroki Horiuchi)
    • -
    • passport-facebook (by James Roland Cabresos)
    • -
    • passport-strategy (by Lior Mualem)
    • -
    • pathwatcher (by vvakame)
    • -
    • Parallel.js (by Josh Baldwin)
    • -
    • Parsimmon (by Bart van der Schoor)
    • -
    • PDF.js (by Josh Baldwin)
    • -
    • PEG.js (by vvakame)
    • -
    • Persona (by James Frasca)
    • -
    • PhantomJS (by Jed Hunsaker)
    • -
    • PhoneGap (by Boris Yankov)
    • -
    • Physijs (by gyoh_k)
    • -
    • PixiJS (by Pedro Casaubon)
    • -
    • Platform (by Jake Hickman)
    • -
    • PouchDB (by Bill Sears)
    • -
    • PreloadJS (by Pedro Ferreira)
    • -
    • ProgressJs (by Shunsuke Ohtani)
    • -
    • promise-pool (by VILIC VANE)
    • -
    • Q (by Barrie Nemetchek, Andrew Gaspar)
    • -
    • Q-io (by Bart van der Schoor)
    • -
    • q-retry (by VILIC VANE)
    • -
    • QUnit (by Diullei Gomes)
    • -
    • Raven.js (by Santi Albo)
    • -
    • Recaptcha.js (by Brent Jenkins)
    • -
    • Rickshaw (by Blake Niemyjski)
    • -
    • Riot.js (by vvakame)
    • -
    • Restify (by Bret Little)
    • -
    • Redis (by Carlos Ballesteros Velasco)
    • -
    • Request (by Carlos Ballesteros Velasco)
    • -
    • Royalslider (by Christiaan Rakowski)
    • -
    • Rx.js (by gsino, Igor Oleinikov, Carl de Billy, zoetrope)
    • -
    • Raphael (by CheCoxshall)
    • -
    • Restangular (by Boris Yankov)
    • -
    • require.js (by Josh Baldwin)
    • -
    • rtree.js (by Omede Firouz)
    • -
    • Sammy.js (by Boris Yankov)
    • -
    • Select2 (by Boris Yankov)
    • -
    • Selenium WebDriverJS (by Bill Armstrong)
    • -
    • Semver (by Bart van der Schoor)
    • -
    • Sencha Touch (by Brian Kotek)
    • -
    • SharePoint (by Stanislav Vyshchepan and Andrey Markeev)
    • -
    • ShellJS (by Niklas Mollenhauer)
    • -
    • SignalR (by Boris Yankov)
    • -
    • simple-cw-node (by vvakame)
    • -
    • Sinon (by William Sears)
    • -
    • SIPml (by Adriaan Groenenboom)
    • -
    • sjcl (by Eugene Chernyshov)
    • -
    • SlickGrid (by Josh Baldwin)
    • -
    • smoothie (by Mike H. Hawley and Drew Noakes)
    • -
    • socket.io (by William Orr)
    • -
    • socket.io-client (by Maido Kaara)
    • -
    • SockJS (by Emil Ivanov)
    • -
    • sockjs-node (by Phil McCloghry-Laing)
    • -
    • SoundJS (by Pedro Ferreira)
    • -
    • source-map (by Morten Houston Ludvigsen)
    • -
    • Spin (by Boris Yankov)
    • -
    • sqlite3 (by Nick Malaguti)
    • -
    • status-bar (by vvakame)
    • -
    • stripe (by Eric J. Smith)
    • -
    • Store.js (by Vincent Bortone)
    • -
    • Sugar (by Josh Baldwin)
    • -
    • Swiper (by Sebastián Galiano)
    • -
    • SwipeView (by Boris Yankov)
    • -
    • Swiz (by Jeff Goddard)
    • -
    • TV4 (by Bart van der Schoor)
    • -
    • Tags Manager (by Vincent Bortone)
    • -
    • Teechart (by Steema)
    • -
    • text-buffer (by vvakame)
    • -
    • text-encoding (by MIZUNE Pine)
    • -
    • three.js (by Kon)
    • -
    • TimelineJS (by Roland Zwaga)
    • -
    • timezonecomplete (by Rogier Schouten)
    • -
    • Toastr (by Boris Yankov)
    • -
    • trunk8 (by Blake Niemyjski)
    • -
    • TweenJS (by Pedro Ferreira)
    • -
    • tween.js (by Adam R. Smith)
    • -
    • twitter-bootstrap-wizard (by Blake Niemyjski)
    • -
    • Twitter Typeahead (by Ivaylo Gochkov)
    • -
    • Ubuntu Unity Web API (by John Vrbanac)
    • -
    • Underscore.js (by Boris Yankov)
    • -
    • Underscore.js (Typed) (by Josh Baldwin)
    • -
    • Underscore-ko.js (by Maurits Elbers)
    • -
    • universal-analytics (by Bart van der Schoor)
    • -
    • update-notifier (by vvakame)
    • -
    • uri-templates (by Bart van der Schoor)
    • -
    • urlrouter (by Carlos Ballesteros Velasco)
    • -
    • UUID.js (by Jason Jarrett)
    • -
    • Valerie (by Howard Richards)
    • -
    • Velocity (by Greg Smith)
    • -
    • Viewporter (by Boris Yankov)
    • -
    • Vimeo (by Daz Wilkin)
    • -
    • vinyl (by vvakame)
    • -
    • vinyl-fs (by vvakame)
    • -
    • WebRTC (by Ken Smith)
    • -
    • websocket (by Paul Loyd)
    • -
    • WinJS (from TypeScript samples)
    • -
    • WinRT (from TypeScript samples)
    • -
    • ws (by Paul Loyd)
    • -
    • x2js (by Hiroki Horiuchi)
    • -
    • xml2js (by Michel Salib)
    • -
    • xpath (by Andrew Bradley)
    • -
    • XRegExp (by Bart van der Schoor)
    • -
    • YouTube (by Daz Wilkin)
    • -
    • YouTube Analytics API (by Frank M)
    • -
    • YouTube Data API (by Frank M)
    • -
    • Zepto.js (by Josh Baldwin)
    • -
    • Zynga Scroller (by Boris Yankov)
    • -
    • ZeroClipboard (by Eric J. Smith)
    • - - - -> From 27305dfa79bf115f5f843199949e3d2b270f8d6c Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Thu, 4 Sep 2014 20:45:10 +0900 Subject: [PATCH 125/537] Add event shortcut methods --- zepto/zepto-tests.ts | 6 ++++ zepto/zepto.d.ts | 69 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/zepto/zepto-tests.ts b/zepto/zepto-tests.ts index fc3760f9a..2d85f16c0 100644 --- a/zepto/zepto-tests.ts +++ b/zepto/zepto-tests.ts @@ -306,3 +306,9 @@ $.browser.playbook; !!$.os.ios; // => true !!$.os.version; // => "6.1" !!$.browser.version; // => "536.26" + +// shortcut methods for `.bind(event, fn)` for each event type +$('#example').click(); +$('#example').click(() => { + alert('clicked'); +}); \ No newline at end of file diff --git a/zepto/zepto.d.ts b/zepto/zepto.d.ts index ba75e7556..04f11289e 100644 --- a/zepto/zepto.d.ts +++ b/zepto/zepto.d.ts @@ -1407,6 +1407,75 @@ interface ZeptoCollection { **/ undelegate(selector: string, type: string, fn: (e: Event) => boolean): ZeptoCollection; + focusin(): ZeptoCollection; + focusin(fn: (e: Event) => any): ZeptoCollection; + + focusout(): ZeptoCollection; + focusout(fn: (e: Event) => any): ZeptoCollection; + + load(): ZeptoCollection; + load(fn: (e: Event) => any): ZeptoCollection; + + resize(): ZeptoCollection; + resize(fn: (e: Event) => any): ZeptoCollection; + + scroll(): ZeptoCollection; + scroll(fn: (e: Event) => any): ZeptoCollection; + + unload(): ZeptoCollection; + unload(fn: (e: Event) => any): ZeptoCollection; + + click(): ZeptoCollection; + click(fn: (e: Event) => any): ZeptoCollection; + + dblclick(): ZeptoCollection; + dblclick(fn: (e: Event) => any): ZeptoCollection; + + mousedown(): ZeptoCollection; + mousedown(fn: (e: Event) => any): ZeptoCollection; + + mouseup(): ZeptoCollection; + mouseup(fn: (e: Event) => any): ZeptoCollection; + + mousemove(): ZeptoCollection; + mousemove(fn: (e: Event) => any): ZeptoCollection; + + mouseover(): ZeptoCollection; + mouseover(fn: (e: Event) => any): ZeptoCollection; + + mouseout(): ZeptoCollection; + mouseout(fn: (e: Event) => any): ZeptoCollection; + + mouseenter(): ZeptoCollection; + mouseenter(fn: (e: Event) => any): ZeptoCollection; + + mouseleave(): ZeptoCollection; + mouseleave(fn: (e: Event) => any): ZeptoCollection; + + change(): ZeptoCollection; + change(fn: (e: Event) => any): ZeptoCollection; + + select(): ZeptoCollection; + select(fn: (e: Event) => any): ZeptoCollection; + + keydown(): ZeptoCollection; + keydown(fn: (e: Event) => any): ZeptoCollection; + + keypress(): ZeptoCollection; + keypress(fn: (e: Event) => any): ZeptoCollection; + + keyup(): ZeptoCollection; + keyup(fn: (e: Event) => any): ZeptoCollection; + + error(): ZeptoCollection; + error(fn: (e: Event) => any): ZeptoCollection; + + focus(): ZeptoCollection; + focus(fn: (e: Event) => any): ZeptoCollection; + + blur(): ZeptoCollection; + blur(fn: (e: Event) => any): ZeptoCollection; + /** * Ajax **/ From 3ecf2530af5571a6f5cee52018bab2d5e658a413 Mon Sep 17 00:00:00 2001 From: Carl-Erik Kopseng Date: Thu, 4 Sep 2014 17:03:58 +0200 Subject: [PATCH 126/537] Fixed error in test for indexedDB While Modernizr 3 uses 'indexeddb' (lower caps), the Modernizr 2 versions all use 'indexedDB'. --- modernizr/modernizr.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modernizr/modernizr.d.ts b/modernizr/modernizr.d.ts index 5827bbf9e..25043375c 100644 --- a/modernizr/modernizr.d.ts +++ b/modernizr/modernizr.d.ts @@ -75,7 +75,7 @@ interface ModernizrStatic { history: boolean; audio: Audioboolean; video: Videoboolean; - indexeddb: boolean; + indexedDB: boolean; input: Inputboolean; inputtypes: InputTypesboolean; localstorage: boolean; From e7c2d0b916102f5edbfb022f3e5ae6f23ba5d30f Mon Sep 17 00:00:00 2001 From: mzsm Date: Fri, 5 Sep 2014 11:58:03 +0900 Subject: [PATCH 127/537] Add overload JQuery.one and jQuery.on --- jquery/jquery.d.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 80ca7e3b8..064f6f51a 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -2763,7 +2763,14 @@ interface JQuery { * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. * @param data Data to be passed to the handler in event.data when an event occurs. */ - on(events: { [key: string]: any; }, selector?: any, data?: any): JQuery; + on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + on(events: { [key: string]: any; }, data?: any): JQuery; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. @@ -2806,7 +2813,15 @@ interface JQuery { * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. * @param data Data to be passed to the handler in event.data when an event occurs. */ - one(events: { [key: string]: any; }, selector?: any, data?: any): JQuery; + one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + one(events: { [key: string]: any; }, data?: any): JQuery; /** From 54de4356d0d53628e234c687ae9e1764cd543bc3 Mon Sep 17 00:00:00 2001 From: vvakame Date: Fri, 5 Sep 2014 12:31:46 +0900 Subject: [PATCH 128/537] add rows property to OnRowsChangedEventData --- slickgrid/SlickGrid.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slickgrid/SlickGrid.d.ts b/slickgrid/SlickGrid.d.ts index 7301ecb1a..a27b038ff 100644 --- a/slickgrid/SlickGrid.d.ts +++ b/slickgrid/SlickGrid.d.ts @@ -1595,7 +1595,7 @@ declare module Slick { // empty } export interface OnRowsChangedEventData { - // empty + rows: number[]; } export interface OnPagingInfoChangedEventData extends PagingOptions { From 81f4b1f3c05f01e5acbc7208a74fb48a92779a5e Mon Sep 17 00:00:00 2001 From: Roger Chen Date: Thu, 4 Sep 2014 13:31:51 -0400 Subject: [PATCH 129/537] Add typings for Keypress v2.0.3 --- CONTRIBUTORS.md | 3 +- keypress/keypress-tests.ts | 61 ++++++++++++++++++++++++++++++++++++++ keypress/keypress.d.ts | 61 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 keypress/keypress-tests.ts create mode 100644 keypress/keypress.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 1cded38d5..cdd9a5f78 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -214,6 +214,7 @@ All definitions files include a header with the author and editors, so at some p * [JWPlayer](http://developer.longtailvideo.com/trac/) (by [Martin Duparc](https://github.com/martinduparc/)) * [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) (by [Vincent Bortone](https://github.com/vbortone/)) * [keymaster.js](https://github.com/madrobby/keymaster) (by [Marting W. Kirst](https://github.com/nitram509/)) +* [Keypress](https://github.com/dmauro/Keypress/) (by [Roger Chen](https://github.com/rcchen/)) * [KineticJS](http://kineticjs.com/) (by [Basarat Ali Syed](https://github.com/basarat)) * [Knockback](http://kmalakoff.github.com/knockback/) (by [Marcel Binot](https://github.com/docgit)) * [Knockout.js](http://knockoutjs.com/) (by [Boris Yankov](https://github.com/borisyankov)) @@ -244,7 +245,7 @@ All definitions files include a header with the author and editors, so at some p * [Marked](https://github.com/chjj/marked) (by [William Orr](https://github.com/worr)) * [MathJax](https://github.com/mathjax/MathJax) (by [Roland Zwaga](https://github.com/rolandzwaga)) * [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) (by [Sarah Williams](https://github.com/flurg)) -* [Meteor](https://www.meteor.com) (by [Dave Allen](https://github.com/fullflavedave)) +* [Meteor](https://www.meteor.com) (by [Dave Allen](https://github.com/fullflavedave)) * [md5.js](http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html) (by [MIZUNE Pine](https://github.com/pine613)) * [Microsoft Ajax](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) (by [Patrick Magee](https://github.com/pjmagee)) * [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) (by [John Vilk](https://github.com/jvilk)) diff --git a/keypress/keypress-tests.ts b/keypress/keypress-tests.ts new file mode 100644 index 000000000..38d12c12f --- /dev/null +++ b/keypress/keypress-tests.ts @@ -0,0 +1,61 @@ +/// + +module KeypressComboTests { + var listener = new window.keypress.Listener(); + + var copyCombo = { + keys: "cmd c", + on_keydown: () => { + console.log("Key down"); + }, + on_keyup: () => { + console.log("Key up"); + }, + on_release: () => { + console.log("Released"); + }, + prevent_default: true, + prevent_repeat: false, + is_unordered: true, + is_counting: false, + is_exclusive: false, + is_sequence: true, + is_solitary: true + }; + + var pasteCombo = { + keys: "ctrl v", + on_keydown: () => { + console.log("Paste"); + }, + prevent_default: true, + prevent_repeat: true, + is_exclusive: true + }; + + listener.register_combo(copyCombo); + listener.unregister_combo("cmd c"); + + listener.register_many([copyCombo, pasteCombo]); + listener.stop_listening(); + listener.listen(); + listener.unregister_many(["cmd c", "cmd v"]); + + listener.reset(); +} + +module KeypressBindingTests { + var element = document.createElement('div'); + var defaults = { + prevent_default: true, + prevent_repeat: true, + is_unordered: true, + is_counting: false, + is_exclusive: false, + is_solitary: false, + is_sequence: false + }; + var listener = new window.keypress.Listener(element); + listener = new window.keypress.Listener(element, defaults); + listener.reset(); +} diff --git a/keypress/keypress.d.ts b/keypress/keypress.d.ts new file mode 100644 index 000000000..bd831d5b0 --- /dev/null +++ b/keypress/keypress.d.ts @@ -0,0 +1,61 @@ +// Type definitions for Keypress v2.0.3 +// Project: https://github.com/dmauro/Keypress/ +// Definitions by: Roger Chen +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// A keyboard input capturing utility in which any key can be a modifier key. +declare module Keypress { + + interface ListenerDefaults { + keys: string; + prevent_default: boolean; + prevent_repeat: boolean; + is_unordered: boolean; + is_counting: boolean; + is_exclusive: boolean; + is_solitary: boolean; + is_sequence: boolean; + } + + interface Combo { + keys: string; + on_keydown: () => any; + on_keyup: () => any; + on_release: () => any; + this: Element; + prevent_default: boolean; + prevent_repeat: boolean; + is_unordered: boolean; + is_counting: boolean; + is_exclusive: boolean; + is_sequence: boolean; + is_solitary: boolean; + } + + interface Listener { + new(element: Element, defaults: ListenerDefaults): Listener; + new(element: Element): Listener; + new(): Listener; + simple_combo(keys: string, on_keydown_callback: () => any): void; + counting_combo(keys: string, on_count_callback: () => any): void; + sequence_combo(keys: string, callback: () => any): void; + register_combo(combo: Combo): void; + unregister_combo(combo: Combo): void; + unregister_combo(keys: string): void; + register_many(combos: Combo[]): void; + unregister_many(combos: Combo[]): void; + unregister_many(keys: string[]): void; + get_registered_combos(): Combo[]; + reset(): void; + listen(): void; + stop_listening(): void; + } + + interface Keypress { + Listener: Listener; + } +} + +interface Window { + keypress: Keypress.Keypress; +} From 6a002cfbb3cdab2328d6d5c77d1a50c11fa2db9e Mon Sep 17 00:00:00 2001 From: Vladimir Kotikov Date: Mon, 1 Sep 2014 18:20:06 +0400 Subject: [PATCH 130/537] Updates definitions and tests according to 3.6.0 changes. --- cordova/.gitignore | 1 + cordova/cordova-tests.ts | 80 +++++++++++++++++--- cordova/cordova.d.ts | 27 +++++++ cordova/plugins/Camera.d.ts | 17 +++-- cordova/plugins/Contacts.d.ts | 13 +++- cordova/plugins/Dialogs.d.ts | 5 +- cordova/plugins/FileSystem.d.ts | 120 +++++++++++++++++++++++++----- cordova/plugins/FileTransfer.d.ts | 7 +- cordova/plugins/Vibration.d.ts | 13 ++++ 9 files changed, 245 insertions(+), 38 deletions(-) create mode 100644 cordova/.gitignore diff --git a/cordova/.gitignore b/cordova/.gitignore new file mode 100644 index 000000000..3be8493bd --- /dev/null +++ b/cordova/.gitignore @@ -0,0 +1 @@ +cordova-tests.js \ No newline at end of file diff --git a/cordova/cordova-tests.ts b/cordova/cordova-tests.ts index 4cd95e694..dfaa25cc3 100644 --- a/cordova/cordova-tests.ts +++ b/cordova/cordova-tests.ts @@ -10,19 +10,33 @@ console.log('cordova.version: ' + cordova.version + ', cordova.platformId: ' + c cordova.exec(null, null, "NativeClassName", "MethodName"); -cordova.define('mymodule', (require, exports, module) => { }); +cordova.define('mymodule', (req, exp, mod)=> { + mod.exports = { dummy: () => { console.log("i'm a dummy"); }}; +}); + var myModule = cordova.require('mymodule'); +myModule.dummy(); var argsCheck: ArgsCheck = cordova.require('cordova/argcheck'); argsCheck.checkArgs('ssA', 'cordova.exec', [() => { }, () => { }, 'window', 'openDatabase']); +class Application { + start() { console.log("Starting app"); } + pause() { console.log('app paused'); } +} + +declare var app: Application; + +document.addEventListener('deviceready', () => { app.start(); }); +document.addEventListener('pause', ()=> { app.pause(); }); + // Battery status plugin //---------------------------------------------------------------------- window.addEventListener('batterystatus', (ev: BatteryStatusEvent) => { console.log('Battery level is ' + ev.level); }); window.addEventListener('batterycritical', - ()=> { alert('Battery is critical low!'); }); + () => { alert('Battery is critical low!'); }); // Camera plugin //---------------------------------------------------------------------- @@ -51,10 +65,12 @@ var contact: Contact = navigator.contacts.create({ navigator.contacts.find(["phoneNumbers"], (contacts: Contact[])=> { alert('Find ' + contacts.length + ' contacts'); }, (error: ContactError) => { alert('Error: ' + error.message); }, - { - filter: "+1", - multiple: true - } + new ContactFindOptions("+1", true) +); + +navigator.contacts.pickContact( + (contact: Contact)=> { console.log(contact); }, + (err: ContactError)=> { console.log(err.message); } ); // Device API @@ -105,26 +121,64 @@ function fsaccessor(fs: FileSystem) { var fsreader: DirectoryReader = fs.root.createReader(); fsreader.readEntries( (entries: Entry[]) => { console.log(fs.root.name + ' has ' + entries.length + ' child elements'); }, - (err: Error)=> { alert('Error: ' + err.message); }); + (err: FileError)=> { alert('Error: ' + err.code); }); } window.requestFileSystem( window.TEMPORARY, 1024 * 1024 * 5, fsaccessor, - (err: Error) => { alert('Error: ' + err.message); }); + (err: FileError) => { alert('Error: ' + err.code); } +); + +window.resolveLocalFileSystemURI(cordova.file.applicationDirectory, + (entry: Entry)=> { + if (entry.isDirectory) { + console.log('successfully resolved ' + entry.fullPath + 'directory'); + console.log(entry.toURL()); + console.log(entry.toInternalURL()); + } else { + var fentry = entry; + fentry.file((f: File) => { console.log(f.slice(f.size - 10, f.size)); }); + fentry.createWriter((writer: FileWriter)=> { + if (writer.readyState == FileWriter.INIT) { + console.log('Init FileWriter'); + writer.write(new Blob(['sdfdsfsdf'])); + writer.onprogress = function(ev: ProgressEvent) { + console.log('Writing ' + ev.target); + }; + } + }); + } + }, + (error: FileError) => { console.log(error.code); } +); // FileTransfer plugin //---------------------------------------------------------------------- var file = new FileTransfer(); + +file.onprogress = (ev: ProgressEvent) => { + if (ev.lengthComputable) { + console.log(ev.loaded + '/' + ev.total); + } +}; + file.download('http://some.server.com/download.php', 'cdvfile://localhost/persistent/path/to/downloads/', (file: FileEntry)=> { console.log('File Downloaded to ' + file.fullPath); }, - (err: FileTransferError)=> { alert('Error ' + err.code); }, + (err: FileTransferError) => { + console.error('Error ' + err.code); + if (err.exception) { + console.error('Failed with exception ' + err.exception); + } + }, { headers: null }, true); +file.abort(); + // InAppBrowser plugin //---------------------------------------------------------------------- @@ -135,6 +189,10 @@ file.download('http://some.server.com/download.php', var iab = window.open('google.com', '_self'); iab.addEventListener('loadstart', (ev: InAppBrowserEvent) => { console.log('Start opening ' + ev.url); }); iab.show(); +iab.executeScript( + { code: "console.log('Injected script in action')" }, + ()=> { console.log('Script is executed'); } +); // Globalization plugin //---------------------------------------------------------------------- @@ -226,4 +284,6 @@ db.transaction( // Vibration plugin //---------------------------------------------------------------------- -navigator.notification.vibrate(100); \ No newline at end of file +navigator.notification.vibrate(100); +navigator.notification.vibrateWithPattern([100, 200, 200, 150, 50], 3); +setTimeout(navigator.notification.cancelVibration, 1000); \ No newline at end of file diff --git a/cordova/cordova.d.ts b/cordova/cordova.d.ts index 9377912b0..06d13e8cf 100644 --- a/cordova/cordova.d.ts +++ b/cordova/cordova.d.ts @@ -44,6 +44,33 @@ interface Cordova { require(moduleName: string): any; } +interface Document { + addEventListener(type: "deviceready", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resume", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "backbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "menubutton", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "searchbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "startcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "endcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumedownbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumeupbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + + removeEventListener(type: "deviceready", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "resume", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "backbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "menubutton", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "searchbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "startcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "endcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "volumedownbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: "volumeupbutton", listener: (ev: Event) => any, useCapture?: boolean): void; + + addEventListener(type: string, listener: (ev: Event) => any, useCapture?: boolean): void; + removeEventListener(type: string, listener: (ev: Event) => any, useCapture?: boolean): void; +} + // cordova/argscheck module interface ArgsCheck { checkArgs(argsSpec: string, functionName: string, args: any[], callee?: any): void; diff --git a/cordova/plugins/Camera.d.ts b/cordova/plugins/Camera.d.ts index eb0c97147..126b329ff 100644 --- a/cordova/plugins/Camera.d.ts +++ b/cordova/plugins/Camera.d.ts @@ -44,11 +44,11 @@ interface Camera { } interface CameraOptions { - /** Picture quality in range o-100 */ + /** Picture quality in range 0-100. Default is 50 */ quality?: number; /** * Choose the format of the return value. - * Defined in navigator.camera.DestinationType + * Defined in navigator.camera.DestinationType. Default is FILE_URI. * DATA_URL : 0, Return image as base64-encoded string * FILE_URI : 1, Return image file URI * NATIVE_URI : 2 Return image native URI @@ -56,7 +56,8 @@ interface CameraOptions { */ destinationType?: number; /** - * Set the source of the picture. Defined in navigator.camera.PictureSourceType + * Set the source of the picture. + * Defined in navigator.camera.PictureSourceType. Default is CAMERA. * PHOTOLIBRARY : 0, * CAMERA : 1, * SAVEDPHOTOALBUM : 2 @@ -65,7 +66,8 @@ interface CameraOptions { /** Allow simple editing of image before selection. */ allowEdit?: boolean; /** - * Choose the returned image file's encoding. Defined in navigator.camera.EncodingType + * Choose the returned image file's encoding. + * Defined in navigator.camera.EncodingType. Default is JPEG * JPEG : 0 Return JPEG encoded image * PNG : 1 Return PNG encoded image */ @@ -93,7 +95,12 @@ interface CameraOptions { correctOrientation?: boolean; /** Save the image to the photo album on the device after capture. */ saveToPhotoAlbum?: boolean; - /** Choose the camera to use (front- or back-facing). Defined in navigator.camera.Direction */ + /** + * Choose the camera to use (front- or back-facing). + * Defined in navigator.camera.Direction. Default is BACK. + * FRONT: 0 + * BACK: 1 + */ cameraDirection?: number; /** iOS-only options that specify popover location in iPad. Defined in CameraPopoverOptions. */ popoverOptions?: CameraPopoverOptions; diff --git a/cordova/plugins/Contacts.d.ts b/cordova/plugins/Contacts.d.ts index f054c12d0..29a9a596c 100644 --- a/cordova/plugins/Contacts.d.ts +++ b/cordova/plugins/Contacts.d.ts @@ -34,6 +34,14 @@ interface Contacts { onSuccess: (contacts: Contact[]) => void, onError: (error: ContactError) => void, options?: ContactFindOptions): void; + /** + * The navigator.contacts.pickContact method launches the Contact Picker to select a single contact. + * The resulting object is passed to the contactSuccess callback function specified by the contactSuccess parameter. + * @param onSuccess Success callback function invoked with the array of Contact objects returned from the database + * @param onError Error callback function, invoked when an error occurs. + */ + pickContact(onSuccess: (contact: Contact) => void, + onError: (error: ContactError) => void): void } interface ContactProperties { @@ -253,10 +261,13 @@ interface ContactFindOptions { filter?: string; /** Determines if the find operation returns multiple navigator.contacts. */ multiple?: boolean; + /* Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. */ + desiredFields?: string[]; } declare var ContactFindOptions: { /** Constructor for ContactFindOptions object */ new(filter?: string, - multiple?: boolean): ContactFindOptions + multiple?: boolean, + desiredFields?: string[]): ContactFindOptions }; \ No newline at end of file diff --git a/cordova/plugins/Dialogs.d.ts b/cordova/plugins/Dialogs.d.ts index 5e2a7416d..6d86c6228 100644 --- a/cordova/plugins/Dialogs.d.ts +++ b/cordova/plugins/Dialogs.d.ts @@ -59,7 +59,10 @@ interface Notification { /** Object, passed to promptCallback */ interface NotificationPromptResult { - /** The index of the pressed button. Note that the index uses one-based indexing, so the value is 1, 2, 3, etc. */ + /** + * The index of the pressed button. Note that the index uses one-based indexing, so the value is 1, 2, 3, etc. + * 0 is the result when the dialog is dismissed without a button press. + */ buttonIndex: number; /** The text entered in the prompt dialog box. */ input1: string; diff --git a/cordova/plugins/FileSystem.d.ts b/cordova/plugins/FileSystem.d.ts index 569f9a209..1e1476b39 100644 --- a/cordova/plugins/FileSystem.d.ts +++ b/cordova/plugins/FileSystem.d.ts @@ -18,7 +18,16 @@ interface Window { type: number, size: number, successCallback: (fileSystem: FileSystem) => void, - errorCallback?: (fileError: Error) => void): void; + errorCallback?: (fileError: FileError) => void): void; + /** + * Look up file system Entry referred to by local URI. + * @param string uri URI referring to a local file or directory + * @param successCallback invoked with Entry object corresponding to URI + * @param errorCallback invoked if error occurs retrieving file system entry + */ + resolveLocalFileSystemURI(uri: string, + successCallback: (entry: Entry) => void, + errorCallback?: (error: FileError) => void): void; TEMPORARY: number; PERSISTENT: number; } @@ -54,7 +63,7 @@ interface Entry { */ getMetadata( successCallback: (metadata: Metadata) => void, - errorCallback?: (error: Error) => void): void; + errorCallback?: (error: FileError) => void): void; /** * Move an entry to a different location on the file system. It is an error to try to: * move a directory inside itself or to any child at any depth;move an entry into its parent if a name different from its current one isn't provided; @@ -69,9 +78,9 @@ interface Entry { * @param errorCallback A callback that is called when errors happen. */ moveTo(parent: DirectoryEntry, - newName?: string, - successCallback?: (entry: Entry) => void , - errorCallback?: (error: Error) => void ): void; + newName?: string, + successCallback?: (entry: Entry) => void, + errorCallback?: (error: FileError) => void): void; /** * Copy an entry to a different location on the file system. It is an error to try to: * copy a directory inside itself or to any child at any depth; @@ -88,24 +97,34 @@ interface Entry { * @param errorCallback A callback that is called when errors happen. */ copyTo(parent: DirectoryEntry, - newName?: string, - successCallback?: (entry: Entry) => void , - errorCallback?: (error: Error) => void ): void; + newName?: string, + successCallback?: (entry: Entry) => void, + errorCallback?: (error: FileError) => void): void; + /** + * Returns a URL that can be used as the src attribute of a