From b24d2ab7d9003eff940302e77edec81a2375c117 Mon Sep 17 00:00:00 2001 From: Olmo del Corral Date: Thu, 2 Feb 2017 21:14:23 +0100 Subject: [PATCH 001/276] rename language to culture in numbro --- numbro/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numbro/index.d.ts b/numbro/index.d.ts index ccb0892a0d..55234aad81 100644 --- a/numbro/index.d.ts +++ b/numbro/index.d.ts @@ -24,7 +24,7 @@ interface Numbro { (value?: any): Numbro; version: string; isNumbro: boolean; - language(key: string, values?: NumbroLanguage): Numbro; + culture(key: string, values?: NumbroLanguage): Numbro; zeroFormat(format: string): string; clone(): Numbro; format(inputString?: string): string; From d09124c0dadba0706409036d1b2948ee5d08496f Mon Sep 17 00:00:00 2001 From: Olmo del Corral Date: Sun, 5 Feb 2017 20:34:10 +0100 Subject: [PATCH 002/276] remove numbro and add it to notNeededPackages.json --- notNeededPackages.json | 6 ++++++ numbro/index.d.ts | 49 ------------------------------------------ numbro/numbro-tests.ts | 43 ------------------------------------ numbro/tsconfig.json | 22 ------------------- 4 files changed, 6 insertions(+), 114 deletions(-) delete mode 100644 numbro/index.d.ts delete mode 100644 numbro/numbro-tests.ts delete mode 100644 numbro/tsconfig.json diff --git a/notNeededPackages.json b/notNeededPackages.json index e671ef4523..ef4e4f7f85 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -5,6 +5,12 @@ "typingsPackageName": "moment", "sourceRepoURL": "https://github.com/moment/moment", "asOfVersion": "2.13.0" + }, + { + "libraryName": "Numbro", + "typingsPackageName": "numbro", + "sourceRepoURL": "https://github.com/foretagsplatsen/numbro/", + "asOfVersion": "1.9.3" }, { "libraryName": "ng-table", diff --git a/numbro/index.d.ts b/numbro/index.d.ts deleted file mode 100644 index 55234aad81..0000000000 --- a/numbro/index.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Type definitions for Numbro.js -// Project: https://github.com/foretagsplatsen/numbro -// Definitions by: Vincent Bortone -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface NumbroLanguage { - delimiters: { - thousands: string; - decimal: string; - }; - abbreviations: { - thousand: string; - million: string; - billion: string; - trillion: string; - }; - ordinal(num: number): string; - currency: { - symbol: string; - }; -} - -interface Numbro { - (value?: any): Numbro; - version: string; - isNumbro: boolean; - culture(key: string, values?: NumbroLanguage): Numbro; - zeroFormat(format: string): string; - clone(): Numbro; - format(inputString?: string): string; - formatCurrency(inputString?: string): string; - unformat(inputString: string): number; - value(): number; - valueOf(): number; - set (value: any): Numbro; - add(value: any): Numbro; - subtract(value: any): Numbro; - multiply(value: any): Numbro; - divide(value: any): Numbro; - difference(value: any): number; -} - -declare var numbro: Numbro; - -declare module "numbro" { - - export = numbro; - -} diff --git a/numbro/numbro-tests.ts b/numbro/numbro-tests.ts deleted file mode 100644 index 5b5b762353..0000000000 --- a/numbro/numbro-tests.ts +++ /dev/null @@ -1,43 +0,0 @@ - - -var valueFormat: string = numbro(1000).format('0,0'); -// '1,000' - -var valueUnformat: number = numbro().unformat('($10,000.00)'); -// '-10000' - -var value3: Numbro = numbro(1000); -var added: Numbro = value3.add(10); -// 1010 - -var value4: Numbro = numbro(1000); -var formatValue4a: string = value4.format('0,0'); -// '1,000' -var formatValue4b: number = value4.value(); -// 1000 - -var value5: Numbro = numbro(); -value5.set(1000); -var value5Num: number = value5.value(); -// 1000 - -var value6: Numbro = numbro(1000); -var value: number = 100; -var difference = value6.difference(value); -// 900 - -var value7: Numbro = numbro(0); -numbro.zeroFormat('N/A'); -var zeroString: string = value7.format('0.0'); -// 'N/A' - -var a: Numbro = numbro(1000); -var b: Numbro = numbro(a); -var c: Numbro = a.clone(); - -var aVal: number = a.set(2000).value(); -// 2000 -var bVal: number = b.value(); -// 1000 -var cVal: number = c.add(10).value(); -// 1010 diff --git a/numbro/tsconfig.json b/numbro/tsconfig.json deleted file mode 100644 index 4a55ffe0ab..0000000000 --- a/numbro/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "numbro-tests.ts" - ] -} \ No newline at end of file From ec4b986bc8641599b223a79efaebafe196aeb2e8 Mon Sep 17 00:00:00 2001 From: Alexey Svetliakov Date: Tue, 14 Feb 2017 01:49:54 +0100 Subject: [PATCH 003/276] enzyme: return any as state for shallow() and mount() --- enzyme/enzyme-tests.tsx | 14 ++++++++++++++ enzyme/index.d.ts | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/enzyme/enzyme-tests.tsx b/enzyme/enzyme-tests.tsx index 82a8dc9822..c7323766f7 100644 --- a/enzyme/enzyme-tests.tsx +++ b/enzyme/enzyme-tests.tsx @@ -37,6 +37,13 @@ namespace ShallowWrapperTest { elementWrapper: ShallowWrapper, {}>, statelessWrapper: ShallowWrapper; + function test_props_state_inferring() { + let wrapper: ShallowWrapper; + wrapper = shallow(); + wrapper.state().stateProperty; + wrapper.props().stringProp.toUpperCase(); + } + function test_shallow_options() { shallow(, { context: { @@ -337,6 +344,13 @@ namespace ReactWrapperTest { elementWrapper: ReactWrapper, {}>, statelessWrapper: ReactWrapper; + function test_prop_state_inferring() { + let wrapper: ReactWrapper; + wrapper = mount(); + wrapper.state().stateProperty; + wrapper.props().stringProp.toUpperCase(); + } + function test_unmount() { reactWrapper = reactWrapper.unmount(); } diff --git a/enzyme/index.d.ts b/enzyme/index.d.ts index 66c86d1166..184b20ec57 100644 --- a/enzyme/index.d.ts +++ b/enzyme/index.d.ts @@ -541,14 +541,14 @@ export interface MountRendererProps { * @param node * @param [options] */ -export function shallow(node: ReactElement

, options?: ShallowRendererProps): ShallowWrapper; +export function shallow(node: ReactElement

, options?: ShallowRendererProps): ShallowWrapper; /** * Mounts and renders a react component into the document and provides a testing wrapper around it. * @param node * @param [options] */ -export function mount(node: ReactElement

, options?: MountRendererProps): ReactWrapper; +export function mount(node: ReactElement

, options?: MountRendererProps): ReactWrapper; /** * Render react components to static HTML and analyze the resulting HTML structure. From 7a0e3cf5362f8f546f20d96574a66bb53a2473a5 Mon Sep 17 00:00:00 2001 From: Gilbert Date: Thu, 16 Feb 2017 11:13:03 +0100 Subject: [PATCH 004/276] updated jasmine-expect matchers + assymetric matchers. --- jasmine-expect/index.d.ts | 221 ++++++++++++++++++++++++-------------- 1 file changed, 141 insertions(+), 80 deletions(-) diff --git a/jasmine-expect/index.d.ts b/jasmine-expect/index.d.ts index c2ee7e0ee5..f8dbc54f56 100644 --- a/jasmine-expect/index.d.ts +++ b/jasmine-expect/index.d.ts @@ -1,93 +1,154 @@ -// Type definitions for jasmine-expect 2.0 +// Type definitions for jasmine-expect 3.6.0 // Project: https://github.com/JamieMason/Jasmine-Matchers -// Definitions by: UserPixel +// Definitions by: GeneralCss // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 /// declare namespace jasmine { - interface Matchers { - // These functions are written in the order defined in the src directory of jasmine-matchers - // The type system is used smartly whenever it can provide value (by looking at the code of every matcher) - toBeAfter(otherDate: Date): boolean; // - toBeArray(): boolean; // - toBeArrayOfBooleans(): boolean; // - toBeArrayOfNumbers(): boolean; - toBeArrayOfObjects(): boolean; - toBeArrayOfSize(size: number): boolean; - toBeArrayOfStrings(): boolean; - toBeBefore(otherDate: Date): boolean; // - toBeBoolean(): boolean; - toBeCalculable(): boolean; - toBeDate(): boolean; - toBeEmptyArray(): boolean; - toBeEmptyObject(): boolean; - toBeEmptyString(): boolean; - toBeEvenNumber(): boolean; - toBeFalse(): boolean; - toBeFunction(): boolean; - toBeHtmlString(): boolean; - toBeIso8601(): boolean; - toBeJsonString(): boolean; - toBeLongerThan(other: string): boolean; - toBeNonEmptyArray(): boolean; - toBeNonEmptyObject(): boolean; - toBeNonEmptyString(): boolean; - toBeNumber(): boolean; - toBeObject(): boolean; - toBeOddNumber(): boolean; - toBeSameLengthAs(other: string): boolean; - toBeShorterThan(other: string): boolean; - toBeString(): boolean; - toBeTrue(): boolean; - toBeWhitespace(): boolean; - toBeWholeNumber(): boolean; - toBeWithinRange(floor: number, ceiling: number): boolean; + interface Matchers { + // toBe + toBeArray(): boolean; + toBeArrayOfBooleans(): boolean; + toBeArrayOfNumbers(): boolean; + toBeArrayOfObjects(): boolean; + toBeArrayOfSize(): boolean; + toBeArrayOfStrings(): boolean; + toBeEmptyArray(): boolean; + toBeNonEmptyArray(): boolean; - toEndWith(subString: string): boolean; + // Booleans + toBeBoolean(): boolean; + toBeFalse(): boolean; + toBeTrue(): boolean; - toHaveArray(key: string): boolean; - toHaveArrayOfBooleans(key: string): boolean; - toHaveArrayOfNumbers(key: string): boolean; - toHaveArrayOfObjects(key: string): boolean; - toHaveArrayOfSize(key: string, size?: number): boolean; - toHaveArrayOfStrings(key: string): boolean; - toHaveBoolean(key: string): boolean; - toHaveCalculable(key: string): boolean; - toHaveDate(key: string): boolean; - toHaveDateAfter(key: string, otherDate: Date): boolean; - toHaveDateBefore(key: string, otherDate: Date): boolean; - toHaveEmptyArray(key: string): boolean; - toHaveEmptyObject(key: string): boolean; - toHaveEmptyString(key: string): boolean; - toHaveEvenNumber(key: string): boolean; - toHaveFalse(key: string): boolean; - toHaveHtmlString(key: string): boolean; - toHaveIso8601(key: string): boolean; - toHaveJsonString(key: string): boolean; - toHaveMember(key: string): boolean; - toHaveMethod(key: string): boolean; - toHaveNonEmptyArray(key: string): boolean; - toHaveNonEmptyObject(key: string): boolean; - toHaveNonEmptyString(key: string): boolean; - toHaveNumber(key: string): boolean; - toHaveNumberWithinRange(key: string, floor: number, ceiling: number): boolean; - toHaveObject(key: string): boolean; - toHaveOddNumber(key: string): boolean; - toHaveString(key: string): boolean; - toHaveStringLongerThan(key: string, other: string): boolean; - toHaveStringSameLengthAs(key: string, other: string): boolean; - toHaveStringShorterThan(key: string, other: string): boolean; - toHaveTrue(key: string): boolean; - toHaveWhitespaceString(key: string): boolean; - toHaveWholeNumber(key: string): boolean; + // Dates + toBeAfter(date: Date): boolean + toBeBefore(date: Date): boolean + toBeDate(): boolean; + toBeValidDate(): boolean; - toImplement(api: {}): boolean; + // Functions + toBeFunction(): boolean; + toThrowAnyError(): boolean; + toThrowErrorOfType(constructorName: string): boolean - toStartWith(subString: string): boolean; + // Numbers + toBeCalculable(): boolean; + toBeEvenNumber(): boolean; + toBeGreaterThanOrEqualTo(number: number): boolean; + toBeLessThanOrEqualTo(number: number): boolean; + toBeNear(number: number, epsilon: number): boolean; + toBeNumber(): boolean; + toBeOddNumber(): boolean + toBeWholeNumber(): boolean; + toBeWithinRange(floor: number, ceiling: number): boolean; - toThrowAnyError(): boolean; - toThrowErrorOfType(type: string): boolean; - } + // Strings + toBeEmptyString(): boolean; + toBeHtmlString(): boolean; + toBeIso8601(): boolean; + toBeJsonString(): boolean; + toBeLongerThan(): boolean; + toBeNonEmptyString(): boolean; + toBeSameLengthAs(): boolean; + toBeShorterThan(): boolean; + toBeString(): boolean; + toBeWhitespace(): boolean; + toEndWith(): boolean; + toStartWith(): boolean; + + // Objects + toBeEmptyObject(): boolean; + toBeNonEmptyObject(): boolean; + toBeObject(): boolean; + + // Regular Expression + toBeRegExp(): boolean; + + // Members, Properties, Methods + toHaveArray(memberName: string): boolean; + toHaveArrayOfBooleans(memberName: string): boolean; + toHaveArrayOfNumbers(memberName: string): boolean; + toHaveArrayOfObjects(memberName: string): boolean; + toHaveArrayOfSize(memberName: string, size: number): boolean; + toHaveArrayOfStrings(memberName: string): boolean; + toHaveBoolean(memberName: string): boolean; + toHaveCalculable(memberName: string): boolean; + toHaveDate(memberName: string): boolean; + toHaveDateAfter(memberName: string, date: Date): boolean; + toHaveDateBefore(memberName: string, date: Date): boolean; + toHaveEmptyArray(memberName: string): boolean; + toHaveEmptyObject(memberName: string): boolean; + toHaveEmptyString(memberName: string): boolean; + toHaveEvenNumber(memberName: string): boolean; + toHaveFalse(memberName: string): boolean; + toHaveHtmlString(memberName: string): boolean; + toHaveIso8601(memberName: string): boolean; + toHaveJsonString(memberName: string): boolean; + toHaveMember(memberName: string): boolean; + toHaveMethod(memberName: string): boolean; + toHaveNonEmptyArray(memberName: string): boolean; + toHaveNonEmptyObject(memberName: string): boolean; + toHaveNonEmptyString(memberName: string): boolean; + toHaveNumber(memberName: string): boolean; + toHaveNumberWithinRange(memberName: string, floor: number, ceiling: number): boolean; + toHaveObject(memberName: string): boolean; + toHaveOddNumber(memberName: string): boolean; + toHaveString(memberName: string): boolean; + toHaveStringLongerThan(memberName: string, string: string): boolean; + toHaveStringSameLengthAs(memberName: string, string: string): boolean; + toHaveStringShorterThan(memberName: string, string: string): boolean; + toHaveTrue(memberName: string): boolean; + toHaveUndefined(memberName: string): boolean; + toHaveWhitespaceString(memberName: string): boolean; + toHaveWholeNumber(memberName: string): boolean; + } + + interface AssymetricMatchers { + + // Arrays + arrayOfBooleans(): boolean; + arrayOfNumbers(): boolean; + arrayOfObjects(): boolean; + arrayOfSize(number: number): boolean; + arrayOfStrings(): boolean; + emptyArray(): boolean; + nonEmptyArray(): boolean; + + // Dates + after(date: Date): boolean; + before(date: Date): boolean; + + // Numbers + calculable(): boolean; + evenNumber(): boolean; + greaterThanOrEqualTo(number: number): boolean; + lessThanOrEqualTo(number: number): boolean; + oddNumber(): boolean; + wholeNumber(): boolean; + withinRange(floor: number, ceiling: number): boolean; + + // Strings + endingWith(string: string): boolean; + iso8601(): boolean; + jsonString(): boolean; + longerThan(string: string): boolean; + nonEmptyString(string: string): boolean; + sameLengthAs(string: string): boolean; + shorterThan(string: string): boolean; + startingWith(string: string): boolean; + whitespace(): boolean; + + //Objects + emptyObject(): boolean; + nonEmptyObject(): boolean; + + // Regular expressions + regExp(): boolean; + } } + +declare var any: jasmine.AssymetricMatchers; + From d4f54ea6c1a9d2867081c71254012bc6b0d0b105 Mon Sep 17 00:00:00 2001 From: Gilbert Date: Thu, 16 Feb 2017 11:50:23 +0100 Subject: [PATCH 005/276] fixed failing tests. Did not add any new ones though --- jasmine-expect/index.d.ts | 12 ++++---- jasmine-expect/jasmine-expect-tests.ts | 38 ++------------------------ 2 files changed, 9 insertions(+), 41 deletions(-) diff --git a/jasmine-expect/index.d.ts b/jasmine-expect/index.d.ts index f8dbc54f56..1a37f8fbe7 100644 --- a/jasmine-expect/index.d.ts +++ b/jasmine-expect/index.d.ts @@ -13,7 +13,7 @@ declare namespace jasmine { toBeArrayOfBooleans(): boolean; toBeArrayOfNumbers(): boolean; toBeArrayOfObjects(): boolean; - toBeArrayOfSize(): boolean; + toBeArrayOfSize(size: number): boolean; toBeArrayOfStrings(): boolean; toBeEmptyArray(): boolean; toBeNonEmptyArray(): boolean; @@ -50,14 +50,14 @@ declare namespace jasmine { toBeHtmlString(): boolean; toBeIso8601(): boolean; toBeJsonString(): boolean; - toBeLongerThan(): boolean; + toBeLongerThan(string: string): boolean; toBeNonEmptyString(): boolean; - toBeSameLengthAs(): boolean; - toBeShorterThan(): boolean; + toBeSameLengthAs(string: string): boolean; + toBeShorterThan(string: string): boolean; toBeString(): boolean; toBeWhitespace(): boolean; - toEndWith(): boolean; - toStartWith(): boolean; + toEndWith(string: string): boolean; + toStartWith(string: string): boolean; // Objects toBeEmptyObject(): boolean; diff --git a/jasmine-expect/jasmine-expect-tests.ts b/jasmine-expect/jasmine-expect-tests.ts index 7753cc7381..d01595a171 100644 --- a/jasmine-expect/jasmine-expect-tests.ts +++ b/jasmine-expect/jasmine-expect-tests.ts @@ -873,9 +873,11 @@ describe('toHaveArrayOfSize', function() { describeToHaveArrayX('toHaveArrayOfSize', function() { describe('when number of expected items does not match', function() { it('should deny', function() { - expect({ + var xpToFail = expect; + xpToFail({ memberName: '' }).not.toHaveArrayOfSize('memberName'); + expect({ memberName: ['bar'] }).not.toHaveArrayOfSize('memberName', 0); @@ -1877,40 +1879,6 @@ describe('toHaveWholeNumber', function() { }); }); -describe('toImplement', function() { - describe('when invoked', function() { - describe('when subject IS an Object containing all of the supplied members', function() { - it('should confirm', function() { - expect({ - a: 1, - b: 2 - }).toImplement({ - a: 1, - b: 2 - }); - expect({ - a: 1, - b: 2 - }).toImplement({ - a: 1 - }); - }); - }); - describe('when subject is NOT an Object containing all of the supplied members', function() { - it('should deny', function() { - expect({ - a: 1 - }).not.toImplement({ - c: 3 - }); - expect(null).not.toImplement({ - a: 1 - }); - }); - }); - }); -}); - describe('toStartWith', function() { describe('when invoked', function() { describe('when subject is NOT an undefined or empty string', function() { From 3479affcfe6394800fc3562be7461552c3ed1326 Mon Sep 17 00:00:00 2001 From: Yuya Tanaka Date: Wed, 15 Feb 2017 03:06:14 +0900 Subject: [PATCH 006/276] react: Fix SVGAttributes contains all HTMLAttributes --- react/index.d.ts | 21 +++++++++++++++++++-- react/test/index.ts | 3 +++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/react/index.d.ts b/react/index.d.ts index b2be91bf62..61b282dfc7 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -2203,7 +2203,25 @@ declare namespace React { // - "number | string" // - "string" // - union of string literals - interface SVGAttributes extends HTMLAttributes { + interface SVGAttributes extends DOMAttributes { + // Attributes which also defined in HTMLAttributes + // See comment in SVGDOMPropertyConfig.js + className?: string; + color?: string; + height?: number | string; + id?: string; + lang?: string; + max?: number | string; + media?: string; + method?: string; + min?: number | string; + name?: string; + style?: CSSProperties; + target?: string; + type?: string; + width?: number | string; + + // SVG Specific attributes accentHeight?: number | string; accumulate?: "none" | "sum"; additive?: "replace" | "sum"; @@ -2396,7 +2414,6 @@ declare namespace React { textRendering?: number | string; to?: number | string; transform?: string; - type?: string; u1?: number | string; u2?: number | string; underlinePosition?: number | string; diff --git a/react/test/index.ts b/react/test/index.ts index 4b00e988bf..702f1632c9 100644 --- a/react/test/index.ts +++ b/react/test/index.ts @@ -341,6 +341,9 @@ React.DOM.svg({ xmlns: "http://www.w3.org/2000/svg" }, React.DOM.rect({ + className: 'foobar', + id: 'foo', + color: 'black', x: 22, y: 10, width: 4, From a302f69580ad40511c18a61d5e8bcbdabcf4f16a Mon Sep 17 00:00:00 2001 From: Yuya Tanaka Date: Wed, 15 Feb 2017 04:30:20 +0900 Subject: [PATCH 007/276] react: Add type parameter to SVGProps --- react/index.d.ts | 108 +++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/react/index.d.ts b/react/index.d.ts index 61b282dfc7..867e066c7e 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -437,7 +437,7 @@ declare namespace React { interface ChangeTargetHTMLProps extends ChangeTargetHTMLAttributes, ClassAttributes { } - interface SVGProps extends SVGAttributes, ClassAttributes { + interface SVGProps extends SVGAttributes, ClassAttributes { } interface DOMAttributes { @@ -2810,60 +2810,60 @@ declare global { wbr: React.HTMLProps; // SVG - svg: React.SVGProps; + svg: React.SVGProps; - circle: React.SVGProps; - clipPath: React.SVGProps; - defs: React.SVGProps; - desc: React.SVGProps; - ellipse: React.SVGProps; - feBlend: React.SVGProps; - feColorMatrix: React.SVGProps; - feComponentTransfer: React.SVGProps; - feComposite: React.SVGProps; - feConvolveMatrix: React.SVGProps; - feDiffuseLighting: React.SVGProps; - feDisplacementMap: React.SVGProps; - feDistantLight: React.SVGProps; - feFlood: React.SVGProps; - feFuncA: React.SVGProps; - feFuncB: React.SVGProps; - feFuncG: React.SVGProps; - feFuncR: React.SVGProps; - feGaussianBlur: React.SVGProps; - feImage: React.SVGProps; - feMerge: React.SVGProps; - feMergeNode: React.SVGProps; - feMorphology: React.SVGProps; - feOffset: React.SVGProps; - fePointLight: React.SVGProps; - feSpecularLighting: React.SVGProps; - feSpotLight: React.SVGProps; - feTile: React.SVGProps; - feTurbulence: React.SVGProps; - filter: React.SVGProps; - foreignObject: React.SVGProps; - g: React.SVGProps; - image: React.SVGProps; - line: React.SVGProps; - linearGradient: React.SVGProps; - marker: React.SVGProps; - mask: React.SVGProps; - metadata: React.SVGProps; - path: React.SVGProps; - pattern: React.SVGProps; - polygon: React.SVGProps; - polyline: React.SVGProps; - radialGradient: React.SVGProps; - rect: React.SVGProps; - stop: React.SVGProps; - switch: React.SVGProps; - symbol: React.SVGProps; - text: React.SVGProps; - textPath: React.SVGProps; - tspan: React.SVGProps; - use: React.SVGProps; - view: React.SVGProps; + circle: React.SVGProps; + clipPath: React.SVGProps; + defs: React.SVGProps; + desc: React.SVGProps; + ellipse: React.SVGProps; + feBlend: React.SVGProps; + feColorMatrix: React.SVGProps; + feComponentTransfer: React.SVGProps; + feComposite: React.SVGProps; + feConvolveMatrix: React.SVGProps; + feDiffuseLighting: React.SVGProps; + feDisplacementMap: React.SVGProps; + feDistantLight: React.SVGProps; + feFlood: React.SVGProps; + feFuncA: React.SVGProps; + feFuncB: React.SVGProps; + feFuncG: React.SVGProps; + feFuncR: React.SVGProps; + feGaussianBlur: React.SVGProps; + feImage: React.SVGProps; + feMerge: React.SVGProps; + feMergeNode: React.SVGProps; + feMorphology: React.SVGProps; + feOffset: React.SVGProps; + fePointLight: React.SVGProps; + feSpecularLighting: React.SVGProps; + feSpotLight: React.SVGProps; + feTile: React.SVGProps; + feTurbulence: React.SVGProps; + filter: React.SVGProps; + foreignObject: React.SVGProps; + g: React.SVGProps; + image: React.SVGProps; + line: React.SVGProps; + linearGradient: React.SVGProps; + marker: React.SVGProps; + mask: React.SVGProps; + metadata: React.SVGProps; + path: React.SVGProps; + pattern: React.SVGProps; + polygon: React.SVGProps; + polyline: React.SVGProps; + radialGradient: React.SVGProps; + rect: React.SVGProps; + stop: React.SVGProps; + switch: React.SVGProps; + symbol: React.SVGProps; + text: React.SVGProps; + textPath: React.SVGProps; + tspan: React.SVGProps; + use: React.SVGProps; + view: React.SVGProps; } } } From df8b672c7a12c28d0cc05401529de547ec607be9 Mon Sep 17 00:00:00 2001 From: Lukas Zech Date: Thu, 23 Feb 2017 12:16:04 +0100 Subject: [PATCH 008/276] Use Partial keyword for objectContaining --- jasmine/index.d.ts | 6 +++--- jasmine/jasmine-tests.ts | 13 +++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/jasmine/index.d.ts b/jasmine/index.d.ts index e18361dec4..146ab55ad4 100644 --- a/jasmine/index.d.ts +++ b/jasmine/index.d.ts @@ -49,7 +49,7 @@ declare namespace jasmine { function any(aclass: any): Any; function anything(): Any; function arrayContaining(sample: any[]): ArrayContaining; - function objectContaining(sample: any): ObjectContaining; + function objectContaining(sample: Partial): ObjectContaining; function createSpy(name: string, originalFn?: Function): Spy; function createSpyObj(baseName: string, methodNames: any[]): any; function createSpyObj(baseName: string, methodNames: any[]): T; @@ -82,8 +82,8 @@ declare namespace jasmine { jasmineToString(): string; } - interface ObjectContaining { - new (sample: any): any; + interface ObjectContaining { + new (sample: Partial): T; jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean; jasmineToString(): string; diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts index 4632eb8b4c..13d80af9db 100644 --- a/jasmine/jasmine-tests.ts +++ b/jasmine/jasmine-tests.ts @@ -663,7 +663,12 @@ describe("jasmine.any", function () { }); describe("jasmine.objectContaining", function () { - var foo: any; + interface fooType { + a:number; + b:number; + bar:string; + } + var foo: fooType; beforeEach(function () { foo = { @@ -674,11 +679,11 @@ describe("jasmine.objectContaining", function () { }); it("matches objects with the expect key/value pairs", function () { - expect(foo).toEqual(jasmine.objectContaining({ + expect(foo).toEqual(jasmine.objectContaining({ bar: "baz" })); - expect(foo).not.toEqual(jasmine.objectContaining({ - c: 37 + expect(foo).not.toEqual(jasmine.objectContaining({ + a: 37 })); }); From fe7183b55a5d6ee28b005a5816b6641d05b0dd12 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Thu, 23 Feb 2017 13:57:11 +0100 Subject: [PATCH 009/276] Re-indent a bit + missing ; + missing spaces --- gapi/index.d.ts | 96 ++++++++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/gapi/index.d.ts b/gapi/index.d.ts index 28d5c990bc..3a4a78ca21 100644 --- a/gapi/index.d.ts +++ b/gapi/index.d.ts @@ -38,7 +38,7 @@ declare namespace gapi { /** * Pragmatically initialize gapi class member. */ - export function load(object: string, fn: any) : any; + export function load(object: string, fn: any): any; } @@ -155,37 +155,37 @@ declare namespace gapi.client { } /** - * Loads the client library interface to a particular API. If a callback is not provided, a promise is returned. - * @param name The name of the API to load. - * @param version The version of the API to load. - * @return promise The promise that get's resolved after the request is finished. - */ - export function load(name: string, version: string): Promise + * Loads the client library interface to a particular API. If a callback is not provided, a promise is returned. + * @param name The name of the API to load. + * @param version The version of the API to load. + * @return promise The promise that get's resolved after the request is finished. + */ + export function load(name: string, version: string): Promise; /** - * Loads the client library interface to a particular API. The new API interface will be in the form gapi.client.api.collection.method. - * @param name The name of the API to load. - * @param version The version of the API to load - * @param callback the function that is called once the API interface is loaded - * @param url optional, the url of your app - if using Google's APIs, don't set it - */ + * Loads the client library interface to a particular API. The new API interface will be in the form gapi.client.api.collection.method. + * @param name The name of the API to load. + * @param version The version of the API to load + * @param callback the function that is called once the API interface is loaded + * @param url optional, the url of your app - if using Google's APIs, don't set it + */ export function load(name: string, version: string, callback: () => any, url?: string): void; /** - * Creates a HTTP request for making RESTful requests. - * An object encapsulating the various arguments for this method. - */ + * Creates a HTTP request for making RESTful requests. + * An object encapsulating the various arguments for this method. + */ export function request(args: RequestOptions): HttpRequest; /** - * Creates an RPC Request directly. The method name and version identify the method to be executed and the RPC params are provided upon RPC creation. - * @param method The method to be executed. - * @param version The version of the API which defines the method to be executed. Defaults to v1 - * @param rpcParams A key-value pair of the params to supply to this RPC - */ + * Creates an RPC Request directly. The method name and version identify the method to be executed and the RPC params are provided upon RPC creation. + * @param method The method to be executed. + * @param version The version of the API which defines the method to be executed. Defaults to v1 + * @param rpcParams A key-value pair of the params to supply to this RPC + */ export function rpcRequest(method: string, version?: string, rpcParams?: any): RpcRequest; /** - * Sets the API key for the application. - * @param apiKey The API key to set - */ + * Sets the API key for the application. + * @param apiKey The API key to set + */ export function setApiKey(apiKey: string): void; /** @@ -210,24 +210,24 @@ declare namespace gapi.client { status: number; statusText: string; } - ) => any):void; - /** + ) => any): void; + /** * HttpRequest supports promises. */ - then(success:(response:{ - result:T; - body:string; + then(success: (response: { + result: T; + body: string; headers?: any[]; status?: number; - statusText?: string - })=>void, - failure:(response:{ - result:T; - body:string; + statusText?: string; + }) => void, + failure: (response: { + result: T; + body: string; headers?: any[]; status?: number; - statusText?: string - })=>void): void; + statusText?: string; + }) => void): void; } /** * Represents an HTTP Batch operation. Individual HTTP requests are added with the add method and the batch is executed using execute. @@ -244,16 +244,16 @@ declare namespace gapi.client { */ id: string; callback: ( - /** - * is the response for this request only. Its format is defined by the API method being called. - */ - individualResponse: any, - /** - * is the raw batch ID-response map as a string. It contains all responses to all requests in the batch. - */ - rawBatchResponse: any - ) => any - }):void; + /** + * is the response for this request only. Its format is defined by the API method being called. + */ + individualResponse: any, + /** + * is the raw batch ID-response map as a string. It contains all responses to all requests in the batch. + */ + rawBatchResponse: any + ) => any + }): void; /** * Executes all requests in the batch. The supplied callback is executed on success or failure. * @param callback The callback to execute when the batch returns. @@ -267,7 +267,7 @@ declare namespace gapi.client { * is the same response, but as an unparsed JSON-string. */ rawBatchResponse: string - ) => any):void; + ) => any): void; } /** @@ -288,7 +288,7 @@ declare namespace gapi.client { * is the same as jsonResp, except it is a raw string that has not been parsed. It is typically used when the response is not JSON. */ rawResp: string - ) => void ):void; + ) => void): void; } } From 318a5c5896c5dbee368d546f904ded23b759d2c6 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Thu, 23 Feb 2017 14:01:24 +0100 Subject: [PATCH 010/276] Better gapi.load --- gapi/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gapi/index.d.ts b/gapi/index.d.ts index 3a4a78ca21..84da600e7b 100644 --- a/gapi/index.d.ts +++ b/gapi/index.d.ts @@ -38,7 +38,7 @@ declare namespace gapi { /** * Pragmatically initialize gapi class member. */ - export function load(object: string, fn: any): any; + export function load(apiName: string, callback: () => void): void; } From ea45419314f1dd5be0b5b7c30c495b4203cc098c Mon Sep 17 00:00:00 2001 From: Konrad Mattheis Date: Thu, 23 Feb 2017 16:01:54 +0100 Subject: [PATCH 011/276] add qlik-visualizationextensions as typescript definition Signed-off-by: Konrad Mattheis --- qlik-visualizationextensions/index.d.ts | 2417 +++++++++++++++++ .../qlik-visualizationextensions-tests.ts | 3 + qlik-visualizationextensions/tsconfig.json | 23 + qlik-visualizationextensions/tslint.json | 7 + 4 files changed, 2450 insertions(+) create mode 100644 qlik-visualizationextensions/index.d.ts create mode 100644 qlik-visualizationextensions/qlik-visualizationextensions-tests.ts create mode 100644 qlik-visualizationextensions/tsconfig.json create mode 100644 qlik-visualizationextensions/tslint.json diff --git a/qlik-visualizationextensions/index.d.ts b/qlik-visualizationextensions/index.d.ts new file mode 100644 index 0000000000..8a9c145969 --- /dev/null +++ b/qlik-visualizationextensions/index.d.ts @@ -0,0 +1,2417 @@ +// Type definitions for qlik-visualizationextensions +// Project: http://help.qlik.com/en-US/sense-developer/3.2/Subsystems/Extensions/Content/extensions-introduction.htm +// Definitions by: Konrad Mattheis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace BackendAPI { + type StateType = "L" | "S" | "O" | "D" | "A" | "X" | "XS" | "XL"; + type SortIndicatorType = "N" | "A" | "D"; + type DimensionType = "D" | "N" | "T"; + type GroupingType = "N" | "H" | "C"; + type FieldAttributesType = "U" | "A" | "I" | "R" | "F" | "M" | "D" | "T" | "TS" | "IV"; + type PatchType = "Add" | "Remove" | "Replace"; + + interface ICharRange { + /** + * Position of the first search occurrence + * Integer + */ + qCharPos: number; + + /** + * Number of occurrences found + * Integer + */ + qCharCount: number; + } + + interface INxHighlightRanges { + /** + * Ranges of highlighted values + * Array of CharRange + */ + qRanges: ICharRange[]; + } + + interface INxSimpleValue { + /** + * Text related to the attribute expression value. + * This property is optional. No text is returned if the attribute expression value is a numeric. + * String + */ + qText: string; + + /** + * Numeric value of the attribute expression. + * This property is set to NaN (Not a Number) if the attribute expression value is not a numeric. + * Numerical values are not returned as text. + * Double precision floating point + */ + qNum: number; + } + + interface INxAttributeExpressionValues { + /** + * List of attribute expressions values. + * Array of NxSimpleValue + */ + qValues: INxSimpleValue[]; + } + + interface INxSimpleDimValue { + /** + * Text related to the attribute expression value. + * This property is optional. No text is returned if the attribute expression value is a numeric. + * String + */ + qText: string; + + /** + * Element number. + * Integer + */ + qElemNo: number; + } + + interface INxAttributeDimValues { + /** + * List of values. + * Array of NxSimpleDimValue + */ + qValues: INxSimpleDimValue[]; + } + + interface INxCell { + /** + * Some text. + * This parameter is optional. + */ + qText?: string; + + /** + * A value. + * This parameter is optional. + */ + qNum?: number; + + /** + * Rank number of the value, starting from 0. + * If the element number is a negative number, it means that the returned value is not an element number. + * You can get the following negative values: + * # -1: the cell is a Total cell. It shows a total. + * # -2: the cell is collapsed. Applies to pivot tables. + * # -3: the cell belongs to the group Others. + * # -4: the cell is empty. Applies to pivot tables. + */ + qElemNumber: number; + + /** + * State of the value. + * The default state for a measure is L. + * L for Locked + * S for Selected + * O for Optional + * D for Deselected + * A for Alternative + * X for eXcluded + * XS for eXcluded Selected + * XL for eXcluded Locked + */ + qState: StateType; + + /** + * Is set to true, if qText and qNum are empty. + * This parameter is optional. The default value is false. + */ + qIsEmpty: boolean; + + /** + * Is set to true if a total is displayed in the cell. + * This parameter is optional. The default value is false. + * Not applicable to list objects. + */ + qIsTotalCell: boolean; + + /** + * Is set to true if the cell belongs to the group Others. + * Dimension values can be set as Others depending on what has been defined in OtherTotalSpecProp. + * This parameter is optional. The default value is false. + * Not applicable to list objects. + */ + qIsOtherCell: boolean; + + /** + * Frequency of the value. + * This parameter is optional. + */ + qFrequency: string; + + /** + * Search hits. + * The search hits are highlighted. + * This parameter is optional. + */ + qHighlightRanges: INxHighlightRanges; + + /** + * Attribute expression values. + */ + qAttrExps: INxAttributeExpressionValues; + + /** + * Is set to true if the value is Null. + */ + qIsNull: boolean; + + /** + * Attribute dimensions values. + */ + qAttrDims: INxAttributeDimValues; + } + + interface INxPage { + /** + * Position from the left. + * Corresponds to the first column. + */ + qLeft: number; + + /** + * Position from the top. + * Corresponds to the first row. + */ + qTop: number; + + /** + * Number of columns in the page. The indexing of the columns may vary depending on whether the cells are expanded or not (parameter qAlwaysFullyExpanded in HyperCubeDef). + */ + qWidth: number; + + /** + * Number of rows or elements in the page. The indexing of the rows may vary depending on whether the cells are expanded or not (parameter qAlwaysFullyExpanded in HyperCubeDef). + */ + qHeight: number; + } + + interface INxAttrDimInfo { + /** + * Cardinality of the attribute expression. + * Integer + */ + qCardinal: number; + + /** + * Number of rows. + * Size + */ + qSize: number; + + /** + * The title for the attribute dimension. + * String + */ + qFallbackTitle: string; + + /** + * The Locked value of the dimension. + * Boolean + */ + qLocked: boolean; + + /** + * Validation error. + * REF(NxValidationError) + */ + //?Type = REF(NxValidationError)? + qError: INxValidationError; + } + + interface INxDimensionInfo { + /** + * Corresponds to the label of the dimension that is selected. + * If the label is not defined then the field name is used. + * String + */ + qFallbackTitle: string; + + /** + * Length of the longest value in the field. + * Integer + */ + qApprMaxGlyphCount: number; + + /** + * Number of distinct field values. + * Integer + */ + qCardinal: number; + + /** + * Is set to true if the field is locked. + * Boolean + */ + qLocked: boolean; + + /** + * Sort indicator. + * This parameter is optional. + * The default value is no sorting. + * One of: + * # N for no sorting + * # A for sorting ascending + * # D for sorting descending + */ + qSortIndicator: SortIndicatorType; + + /** + * Array of dimension labels. + * Contains the labels of all dimensions in a hierarchy group (for example the labels of all dimensions in a drill down group). + * Array of String + */ + qGroupFallbackTitles: string[]; + + /** + * Index of the dimension that is currently in use. + * qGroupPos is set to 0 if there are no hierarchical groups (drill-down groups) or cycle groups. + * Integer + */ + qGroupPos: number; + + /** + * Number of values in a particular state. + * NxStateCounts + */ + qStateCounts: INxStateCounts; + + /** + * Gives information on a field. For example, it can return the type of the field. + * Examples: key, text, ASCII + * Array of String + */ + qTags: string[]; + + /** + * This parameter is optional. + * Gives information on the error. + * Null or NxValidationError + */ + qError: INxValidationError; + + /** + * Binary format of the field. + * One of: + * # D for discrete (String) + * # N for numeric (Double) + * # T for Time (Timestamp) + */ + qDimensionType: DimensionType; + + /** + * If set to true, it inverts the sort criteria in the field. + * Boolean + */ + qReverseSort: boolean; + + /** + * Defines the grouping. + * One of: + * # N for no grouping + * # H for drill-down + * # C for cyclic + */ + qGrouping: GroupingType; + + /** + * If set to true, it means that the field is a semantic. + * Boolean + */ + qIsSemantic: boolean; + + /** + * Format of the field. + * This parameter is optional. + * FieldAttributes + */ + qNumFormat: FieldAttributesType; + + /** + * This parameter is set to true if qNumFormat is set to U (unknown). The engine guesses the type of the field based on the field's definition. + * Boolean + */ + qIsAutoFormat: boolean; + + /** + * Array of field names. + * Array of String + */ + qGroupFieldDefs: string[]; + + /** + * Array of attribute expressions. + * Array of NxAttrExprInfo + */ + qAttrExprInfo: INxAttrExprInfo; + + /** + * Minimum value. + * Double + */ + qMin: number; + + /** + * Maximum value. + * Double + */ + qMax: number; + + /** + * Is continuous axis used. + * Boolean + */ + qContinuousAxes: boolean; + + /** + * Is a cyclic dimension used. + * Boolean + */ + qIsCyclic: boolean; + + /** + * Is derived field is used as a dimension. + * Boolean + */ + qDerivedField: boolean; + + /** + * Array of attribute dimensions. + * Array of NxAttrDimInfo + */ + qAttrDimInfo: INxAttrDimInfo; + } + + interface INxAttrExprInfo { + /** + * Minimum value. + */ + qMin: number; + + /** + * Maximum value. + */ + qMax: number; + + /** + * Is continuous axis used. + */ + qContinuousAxes: boolean; + + /** + * Is a cyclic dimension used. + */ + qIsCyclic: boolean; + + /** + * Corresponds to the label of the dimension that is selected. + */ + qFallbackTitle: string; + } + + interface INxStateCounts { + /** + * Number of values in locked state. + * Integer + */ + qLocked: number; + + /** + * Number of values in selected state. + * Integer + */ + qSelected: number; + + /** + * Number of values in optional state. + * Integer + */ + qOption: number; + + /** + * Number of values in deselected state. + * Integer + */ + qDeselected: number; + + /** + * Number of values in alternative state. + * Integer + */ + qAlternative: number; + + /** + * Number of values in excluded state + * Integer + */ + qExcluded: number; + + /** + * Number of values in selected excluded state. + * Integer + */ + qSelectedExcluded: number; + + /** + * Number of values in locked excluded state. + * Integer + */ + qLockedExcluded: number; + } + + interface INxValidationError { + /** + * Error code. + * This parameter is always displayed in case of error. + * Integer + */ + qErrorCode: number; + + /** + * Context related to the error, from the user app domain. + * It can be the identifier of an object, a field name, a table name. + * This parameter is optional. + * String + */ + qContext: string; + + /** + * Internal information from the server. + * This parameter is optional. + * String + */ + qExtendedMessage: string; + } + + interface IFieldAttributes { + /** + * Type of the field. + * Default is U. + * One of: + * # U for UNKNOWN type. + * # A for ASCII; Numeric fields values contain only standard ASCII characters. + * # I for INTEGER; Numeric fields values are shown as integer numbers. + * # R for REAL; Numeric fields values are shown as real numbers. + * # F for FIX; Numeric fields values are shown as numbers with a fix number of decimals. + * # M for MONEY; Numeric fields values are shown as in the money format. + * # D for DATE; Numeric fields values are shown as dates. + * # T for TIME; Numeric fields values are shown as times. + * # TS TIMESTAMP; Numeric fields values are shown as time stamps. + * # IV for INTERVAL; Numeric fields values are shown as intervals. + */ + qType: FieldAttributesType; + + /** + * Number of decimals. + * Default is 10. + * Integer between 0 and 15. + */ + qnDec: number; + + /** + * Defines whether or not a thousands separator must be used. + * Default is 0. + * One of: 0 for false | 1 for true + */ + qUseThou: boolean; + + /** + * Defines the format pattern that applies to qText. + * Is used in connection to the type of the field (parameter qType). + * For more information, see Struct FieldAttributes. + * Example: YYYY-MM-DD for a date + */ + qFmt: string; + + /** + * Defines the decimal separator. + * Example: . + */ + qDec: string; + + /** + * Defines the thousand separator (if any). + * Is used if qUseThou is set to 1. + * Example: , + */ + qThou: string; + + /** + * Array + */ + qSAFEARRAY: any[]; + } + + interface INxMeasureInfo { + /** + * Corresponds to the label of the measure. If the label is not defined then the measure name is used. + * String + */ + qFallbackTitle: string; + + /** + * Length of the longest value in the field. + * Integer + */ + qApprMaxGlyphCount: number; + + /** + * Number of distinct field values. + * Integer + */ + qCardinal: number; + + /** + * Sort indicator. This parameter is optional. The default value is no sorting. + */ + qSortIndicator: SortIndicatorType; + + /** + * Format of the field. This parameter is optional. + * One of: N for no sorting, A for sorting ascending, D for sorting descending + */ + qNumFormat: IFieldAttributes; + + /** + * This parameter is set to true if qNumFormat is set to U (unknown). The engine guesses the type of the field based on the field's expression. + */ + qIsAutoFormat: boolean; + + /** + * Lowest value in the range. + */ + qMin: number; + + /** + * Highest value in the range. + */ + qMax: number; + + /** + * This parameter is optional. Gives information on the error. + */ + qError: INxValidationError; + + /** + * If set to true, it inverts the sort criteria in the field. + */ + qReverseSort: boolean; + + /** + * List of attribute expressions. + */ + qAttrExprInfo: INxAttrExprInfo[]; + + /** + * List of attribute dimensions. + */ + qAttrDimInfo: INxMeasureInfo[]; + } + + interface IRange { + /** + * Lowest value in the range + * Double + */ + qMin: number; + + /** + * Highest value in the range + * Double + */ + qMax: number; + + /** + * If set to true, the range includes the lowest value in the range of selections (Equals to ). [bn(50500)] + * Example: The range is [1,10]. If qMinInclEq is set to true it means that 1 is included in the range of selections. + */ + qMinInclEq: boolean; + + /** + * If set to true, the range includes the highest value in the range of selections (Equals to ). [bn(50500)] + * Example: The range is [1,10]. If qMinInclEq is set to true it means that 10 is included in the range of selections. + */ + qMaxInclEq: boolean; + } + + interface INxPatch { + /** + * Operation to perform. + * One of: + * # Add + * # Remove + * # Replace + */ + qOp: PatchType; + + /** + * Path to the property to add, remove or replace. + * String + */ + qPath: string; + + /** + * This parameter is not used in a remove operation. + * Corresponds to the value of the property to add or to the new value of the property to update. + * Examples: "false", "2", "\"New title\"" + * String + */ + qValue: string; + } + + interface IBackend { + /** + * Aborts the result of a search in a list object. Clears the existing search and returns the object to the state it was in prior to the search started. + */ + abortSearch(): void; + + /** + * Accepts the result of a search in a list object and the search result is selected in the field. + * @param {boolean} toggleMode - If true, toggle state for selected values + */ + acceptSearch(toggleMode: boolean): void; + + /** + * Updates the properties for this object. + * @param {array} qPatches - Array of patches. Each path contains: + * #qOp: Add/Remove/Replace + * #qPath: Path to property + * #qValue: The new value in string format. Strings need to be surrounded by \". + * @param {boolean} qSoftPatch - Set to True if properties should be soft, that is not persisted. + * @return {Promise} - A promise of a Qlik engine reply. + */ + applyPatches(qPatches: any[], qSoftPatch: boolean): ng.IPromise; + + /** + * Clears unconfirmed selections for this object. + */ + clearSelections(): void; + + /** + * Clears all soft patches that has previously been applied for this object using the applyPatches method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + clearSoftPatches(): ng.IPromise; + + /** + * Collapse the left dimensions of a pivot table. Only works for hypercubes with qMode = P which are not always fully expanded. + * @param {number} qRow - Row index. + * @param {number} qCol - Column index. + * @param {boolean} [qAll] - Optional. If set to true, qRow and qCol are ignored and all cells are collapsed. + * @return {Promise} - A promise of a Qlik engine reply. + */ + collapseLeft(qRow: number, qCol: number, qAll?: boolean): ng.IPromise; + + /** + * Collapse the top dimensions of a pivot table. Only works for hypercubes with qMode = P which are not always fully expanded. + * @param {number} qRow - Row index. + * @param {number} qCol - Column index. + * @param {boolean} [qAll] - Optional. If set to true, qRow and qCol are ignored and all cells are collapsed. + * @return {Promise} - A promise of a Qlik engine reply. + */ + collapseTop(qRow: number, qCol: number, qAll?: boolean): ng.IPromise; + + /** + * Loops through data rows for this object. Only rows that are available client side will be used. + * @param {function} callback - Function to call for each row. + * Parameters are row number and row data as an array of NxCell objects. + * The loop is terminated if the function returns false. + * @return {NxCell[]} - An array of NxCell. + */ + eachDataRow(callback: any): INxCell[]; + + /** + * Expands the left dimensions of a pivot table. Only works for hypercubes with qMode = P which are not always fully expanded. + * @param {number} qRow - Row index. + * @param {number} qCol - Column index. + * @param {boolean} [qAll] - Optional. If set to true, qRow and qCol are ignored and all cells are collapsed. + * @return {Promise} - A promise of a Qlik engine reply. + */ + expandLeft(qRow: number, qCol: number, qAll?: boolean): ng.IPromise; + + /** + * Expands the top dimensions of a pivot table. Only works for hypercubes with qMode = P which are not always fully expanded. + * @param {number} qRow - Row index. + * @param {number} qCol - Column index. + * @param {boolean} [qAll] - Optional. If set to true, qRow and qCol are ignored and all cells are collapsed. + * @return {Promise} - A promise of a Qlik engine reply. + */ + expandTop(qRow: number, qCol: number, qAll?: boolean): ng.IPromise; + + /** + * Geta data from Qlik engine for this object. + * @param {array} qPages - An array of NxPage objects. + * @return {Promise} - A promise of qDataPages. + */ + getData(qPages: INxPage[]): ng.IPromise; + + /** + * Gets a data row for this object. + * @param {number} rownum - The row number. + * @return {NxCell} - A row of NxCell or null if the row is not available client side and need to be fetched with getData method. + */ + getDataRow(rownum: number): INxCell; + + /** + * Gets qDimensionInfo for this object. + * @return {NxDimensionInfo[]} - An array of qDimensionInfo objects. + */ + getDimensionInfos(): INxDimensionInfo[]; + + /** + * Gets qMeasureInfo for this object. + * @return {NxMeasureInfo} - An array of qMeasureInfo objects. + */ + getMeasureInfos(): INxMeasureInfo; + + /** + * Gets pivot data from the Qlik engine for this object. Only works for hypercubes with qMode = P. + * @param {array} qPages - An array of request page objects. + * @return {Promise} - A promise of pivot data pages. + */ + getPivotData(qPages: INxPage[]): ng.IPromise; + + /** + * Get properties for this object. + * @return {Promise} - A promise of object properties. + */ + getProperties(): ng.IPromise; + + /** + * Get reduced data from the Qlik engine for this object. This method is intended for preserving the shape of the data, not for viewing the actual data points. + * @param {array} qPages - An array of request page objects. + * @param {number} qZoomFactor - Zoom factor. + * If set to -1, the Qlik engine decides of the zoom factor. + * If qReductionMode is D1 or S, the zoom factor is 2ⁿ. If the zoom factor is 5, the data are reduced by a factor 32. + * If qReductionMode is C, the zoom factor defines the number of centroids. + * @param {string} qReductionMode - Reduction mode.Can be: + * # N for no data reduction. + * # D1 to reduce a bar chart or line chart. The profile of the chart is reduced whatever the number of dimensions in the chart. + * # S to reduce the resolution of a scatter plot. + * # C to reduce the data of a scatter plot chart. + * # ST to reduce the data of a stacked pivot table. + * @return {Promise} - A promise of reduced data pages. + */ + getReducedData(qPages: INxPage[], qZoomFactor: number, qReductionMode: string): ng.IPromise; + + /** + * Get total number of data rows for this object. + * @return {Number} - A number. + */ + getRowCount(): number; + + /** + * Get stacked data from the Qlik engine for this object. Only works for hypercubes with qMode = S. + * @param {array} qPages - An array of request page objects. + * @param {number} qMaxNbrCells - Maximum number of cells at outer level. + * @return {Promise} - A promise of stack data pages. + */ + getStackedData(qPages: INxPage[], qMaxNbrCells: number): ng.IPromise; + + /** + * Find out if there are unconfirmed selections for this object. + * @return {boolean} - True if there are unconfirmed selections. + */ + hasSelections(): boolean; + + /** + * Save this object. + * @return {Promise} - A promise. In case of success, it returns "undefined". In case of failure it returns the error. + */ + save(): ng.IPromise; + + /** + * Search for a term in a list object. Results in an updated layout, containing only matching records. + * @param {string} term - Term to search for. + */ + search(term: string): void; + + /** + * Select values in this object using ranges. + * @param {array} qRanges - Array of ranges to select. + * @param {boolean} qOrMode - If true only one of the measures needs to be in range. + */ + selectRange(qRanges: IRange[], qOrMode: boolean): void; + + /** + * Select values in this object with a Qlik engine call which triggers a repaint of the object. + * @param {number} qDimNo - Dimension number. 0 = first dimension. + * @param {array} qValues - Array of values (qElemNumber in the matrix from the Qlik engine) to select or deselect. + * @param {boolean} qToggleMode - If true, values in the field are selected in addition to any previously selected items. + * If false, values in the field are selected while previously selected items are deselected. + */ + selectValues(qDimNo: number, qValues: any[], qToggleMode: boolean): void; + + /** + * Set properties for this object. + * @param {object} props - The properties to set. + * @return {Promise} - A promise of a Qlik engine reply. + */ + setProperties(props: any): ng.IPromise; + } +} + +declare namespace RootAPI { + interface IAppConfig { + /** + * Optional Qlik host. + */ + host?: string; + + /** + * Port number. + */ + port: string | number; + + /** + * Optional. Qlik virtual proxy. "/" if no proxy. + */ + prefix?: string; + + /** + * Optional. Use SSL. + */ + isSecure?: boolean; + + /** + * Optional. Open app without loading data. Introduced in version 1.1. + */ + openWithoutData?: boolean; + + /** + * Optional. Unique identity for the session. If omitted, the session will be shared. + */ + identity?: string; + } + + interface IGlobalConfig { + /** + * Qlik Sense host + */ + host: string; + + /** + * Port number + */ + port: string; + + /** + * Qlik Sense virtual proxy. / if no virtual proxy + */ + prefix: string; + + /** + * Use SSL + */ + isSecure: boolean; + + /** + * Unique identity for the session. If omitted, the session will be shared. + */ + identity: string; + } + + interface IRoot { + /** + * Calls the Qlik Sense repository. + * @param {string} path - Path to the Qlik Sense repository. + * Refer to Qlik Sense repository documentation for the available paths. + * @param {string} [method] - Optional. HTTP method. Default is GET. + * @param {string} [body] - Optional. Body of the post. + * @return {Promise} - A promise of a Qlik engine reply. + */ + callRepository(path: string, method?: string, body?: string): ng.IPromise; + + /** currApp + * Gets a reference to the current app. Use the currApp method in an extension to get a reference to the app currently displayed. + * @param {object} [reference] - Optional. Reference to extension object. Introduced in version 1.1. + * @return {IApp} - An App JavaScript object with app methods. + */ + currApp(object?: any): AppAPI.IApp; + + /** + * Gets a list of Qlik Sense apps that you potentially can connect to and registers a callback to receive the data. + * The getAppList method opens a WebSocket, gets the app list, and then closes the WebSocket. + * @param {function} callback - Callback method. + * @param {object} [config] - Optional. Additional configuration parameters: + * Name | Type | Descr | Name + * host | String | Optional. Qlik host. | host + * port | String or integer | Port number. | port + * prefix | String | Optional. Qlik virtual proxy. "/" if no proxy. | prefix + * isSecure | Boolean | Optional. Use SSL. | isSecure + * openWithoutData | Boolean | Optional. Open app without loading data. Introduced in version 1.1. | openWithoutData + * identity | String | Optional. Unique identity for the session. If omitted, the session will be shared. | identity + */ + getAppList(callback: any, config?: any): void; + + /** + * Gets a list of extensions installed for Qlik Sense. The reply contains all extensions, that is widget libraries, visualization extensions and mashups. + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getExtensionList(callback?: any): ng.IPromise; + + /** + * Opens a WebSocekt connection to the Qlik engine for global methods. + * @param {object} [config] - Optional. Parameters: + * Name | Type | Description + * host | String | Qlik Sense host + * port | String | Port number + * prefix | String | Qlik Sense virtual proxy. / if no virtual proxy + * isSecure | Boolean | Use SSL + * identity | String | Unique identity for the session. If omitted, the session will be shared. + * @return {ANY} - A global JavaScript object with global methods. + */ + getGlobal(config: any): any; + + /** Opens a Qlik Sense app. You can open multiple apps. + * Most other methods are defined on the app. Returns: App JavaScript object with app methods. + * @param {string} appId The app id. + * @param {object} [config] Optional. Additional configuration parameters: + * Name | Type | Descr + * host | String | Optional. Qlik host. + * port | String or Integer | Port number. + * prefix | String | Optional. Qlik virtual proxy. "/" if no proxy. + * isSecure | Boolean | Optional. Use SSL. + * openWithoutData | Boolean | Optional. Open app without loading data. Introduced in version 1.1. + * identity | String | Optional. Unique identity for the session. If omitted, the session will be shared. + * Parameter updated in version 2.2. + * @return {any} - App JavaScript object with app methods. + */ + openApp(appId: string, config?: any): any; + + /** + * Registers an extension for use in this mashup. The extension is not installed on the Qlik Sense server and only available in the session where it is created. + * As long as a JavaScript module is created in the correct format, it can be sent to the registerExtension function. + * @param {string} id - Set the ID of the visualization extension. + * @param {object} impl - Set the extension implementation. + * @param {object} [metadata] - Optional. Extension meta-data, same format as the QEXT file. Default: {"type":"visualization"} + */ + registerExtension(id: string, impl: any, metadata?: any): void; + + /** + * Sends a resize event to all Qlik Sense objects. + * @param {string} [ID] - Object id. Optional: if no ID resize event will be sent to all objects. + */ + resize(ID?: string): void; + + /** + * Sets a specific language for the Qlik Sense session. + * Language should be defined before the app is opened meaning the setLanguage method should be called before the openApp method is called. + * @param {string} lang - Language code. Can be: + * # German: short: de long: de-DE + * # English: short: en long: en-US + * # Spanish: short: es long: es-ES + * # French: short: fr long: fr-FR + * # Italian: short: it long: it-IT + * # Japanese: short: ja long: ja-JP + * # Korean: (introduced in version 3.0) short: ko long: ko-KR + * # Dutch: short: nl long: nl-NL + * # Polish: (introduced in version 3.0) short: pl long: pl-PL + * # Brazilian Portuguese: short: pt long: pt-BR + * # Russian: short: ru long: ru-RU + * # Swedish: short: sv long: sv-SE + * # Turkish: (introduced in version 3.0) short: tr long: tr-TR + * # Simplified Chinese: short: Do not use! long: zh-CN + * # Traditional Chinese: (introduced in version 3.0) short: Do not use! long: zh-TW + */ + setLanguage(lang: string): void; + + /** + * Registers a callback for error handling. Standard Qlik Sense error handling is used if this method is not called. + * @param {function} onError - Error handling function + * @param {function} [onWarning] - Optional. Warning handling function. Introduced in version 2.1. + */ + setOnError(onError: any, onWarning?: any): void; + + /** + * Create a QTable object that wraps data in your extension and provides an object oriented interface. + * @param {object} ext - Extension or angular scope for the extension. + * @param {string} [path] - Optional. Path to the hypercube. Default: qHyperCube + * @return {QTable} - A QTable object that holds data and options for the table. + */ + table(ext: any, path?: string): TableAPI.IQTable; + + navigation: NavigationAPI.INavigation; + } +} + +declare namespace AppAPI { + interface IApp { + /** + * Adds an alternate state in the app. Multiple states within a Qlik Sense app can be created and applied to specific objects within the app. Objects in a given state are not affected by user selection in the other states. + * @param {string} qStateName - Mandatory. Alternate state name. + * @return {Promise} - A promise of a Qlik engine reply. + */ + addAlternateState(qStateName: string): ng.IPromise; + + /** + * Steps back in the list of selections. + * @return {Promise} - A promise of a Qlik engine reply. + */ + back(): ng.IPromise; + + /** + * Clears all selections in all fields of the current Qlik Sense app. + * @param {boolean} [lockedAlso] - Optional. Alternate state name. Default: false Introduced in version 2.1. + * @param {string} [state] - Optional. Alternate state name. Default: $ Introduced in version 2.1. + * @return {Promise} - A promise of a Qlik engine reply. + */ + clearAll(lockedAlso?: boolean, state?: string): ng.IPromise; + + /** + * Closes a Qlik Sense app. Also closes the WebSocket and clears out client side data. + */ + close(): void; + + /** + * Defines a hypercube and registers a callback to receive the data. + * @param {object} qHyperCubeDef - Cube definition. + * @param {function} [callback] - Optional. Callback method. Parameter will contain a qHyperCube. + * @return {Promise} - A promise of an object model. + */ + createCube(qHyperCubeDef: any, callback?: any): ng.IPromise; + + /** + * Creates a generic object and registers a callback to receive the data. The generic object can contain the following: + * # qHyperCubeDef + * # qListObjectDef + * # qStringExpression + * # qValueExpression + * The callback method will be called whenever the selection state changes in a way that affects the generic object. The parameter will be the evaluated version of the definition. + * @param {object} [def] - Optional. Generic object definition + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of an object model. + */ + createGenericObject(def?: any, callback?: any): ng.IPromise; + + /** + * Defines a list of field values and registers a callback to receive the data. + * @param {object} qListObjectDef - List definition. + * @param {function} [callback] - Optional. Callback method. Parameter will contain a qListObject. + * @return {Promise} - A promise of an object model. + */ + createList(qListObjectDef: any, callback?: any): ng.IPromise; + + /** + * Defines a hypercube for a table and is the entry point to the Table API. It creates a table object that wraps the hypercube. + * @param {Array.} dimensions - Dimensions to use. + * Should, for each entry, be a field name or a NxDimension structure. + * @param {Array.} measures - Measures to use. + * Should, for each entry, be an expression or a NxMeasure structure. + * @param {object} [options] - Optional. Options to set. + * @return {QTable} - A table object of type QTable, which is initially empty but that eventually will contain data. The table object will be updated when selection state changes. + */ + createTable(dimensions: string[] | any[], measures: string[] | any[], options?: any): TableAPI.IQTable; + + /** + * Destroys a Qlik Sense session object created with the createGenericObject method or any of createCube, createList or getList methods. + * Calling this method removes the object from the Qlik engine, no more updates are sent to the client and all methods on the object are invalid. + * @param {string} id - Session object id. + * @return {Promise} - A promise of a Qlik engine reply. + */ + destroySessionObject(id: string): ng.IPromise; + + /** + * Reloads the data in a Qlik Sense app. + * @param {string} [qMode] - Optional. Error handling mode: + * # 0 = default mode. + * # 1 = attempt recovery on all errors. + * # 2 = fail on all errors. + * @param {boolean} [qPartial] - Optional. Set to true for partial reload. + * @param {boolean} [qDebug] - Optional. Set to true if debug breakpoints are honored. Execution of the script will be in debug mode. + * @return {Promise} - A promise of a Qlik engine reply. + */ + doReload(qMode?: string, qPartial?: boolean, qDebug?: boolean): ng.IPromise; + + /** + * Saves a Qlik Sense app, including all objects and data in the data model. + * @param {string} [qFileName] - Optional. File name of the file to save. + * @return {Promise} - A promise of a Qlik engine reply. + */ + doSave(qFileName?: string): ng.IPromise; + + /** + * Gets a field reference with methods that can be used to manipulate the field. + * @param {string} [field] - Optional. Name of the field. + * @param {string} [state] - Optional. Alternate state name. Default is $. + * @return {QField} - A QField object with methods and properties that can be used to manipulate the field. + */ + field(field?: string, state?: string): FieldAPI.IQField; + + /** + * Step forward in list of selections. + * @return {Promise} - A promise of a Qlik engine reply. + */ + forward(): ng.IPromise; + + /** + * Gets a layout for this Qlik Sense app and registers a callback to receive the data. Returns the dynamic properties (if any) in addition to the fixed properties. + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getAppLayout(callback?: any): ng.IPromise; + + /** + * Gets a list of sheets and visualizations and registers a callback to receive the data. + * @param {string} [field] - Optional. Type of object. One of: + * # sheet + * # masterobject + * Default is sheet. + * @param {function} [callback] - Optional. Callback method. + */ + getAppObjectList(type?: string, callback?: any): void; + + /** + * Gets properties for a generic object, the children of the generic object and the bookmarks and/or embedded snapshots of the generic object. + * @param {string} id - Object id. + * @return {Promise} - A promise of an object model. + */ + getFullPropertyTree(id: string): ng.IPromise; + + /** + * Gets a list of internal Qlik Sense objects and registers a callback to receive the data. + * @param {string} type - Type of object: + * # FieldList + * # MeasureList + * # DimensionList + * # BookmarkList + * # SelectionObject + * # SnapshotList (Introduced in version 1.1) + * # MediaList (Introduced in version 1.1) + * # Sheet (Introduced in version 1.1) + * # MasterObject (Introduced in version 1.1) + * # VariableList (Introduced in version 2.0) + * # story (Introduced in version 2.1) + * @param {function} [callback] - Optional. Registers a callback that is executed every time data is returned. + * @return {Promise} - A promise of an object model. + */ + getList(type: string, callback?: any): ng.IPromise; + + /** + * Retrieves a Qlik Sense object from the Qlik Sense application and inserts it into a HTML element. The object fills the HTML object, so you can size and position the element to determine how large the Qlik Sense object will be. + * If you supply only one parameter, you get the model without displaying the object. + * @param {string} id - Object id or 'CurrentSelections' if used for Selections bar. + * @param {Element | string} [elem] - Optional. HTML element. + * Since version 1.1 it is also possible to define a string of the HTML element id. + * @param {object} [options] - Optional. + * Name | Type | Description + * noInteraction | Boolean | Set to true if you want to disable interaction, including selections, in the visualization. Introduced in version 1.1 and updated in version 3.0. + * noSelections | Boolean | Set to true if you want to disable selections in the visualization. Introduced in version 3.0. + * @return {Promise} - A promise of an object model. + */ + getObject(id: string, elem?: any | string, options?: any): ng.IPromise; + + /** + * Gets properties for a Qlik Sense object. + * @param {string} id - Object id. + * @return {Promise} - A promise of an object model. + */ + getObjectProperties(id: string): ng.IPromise; + + /** + * Inserts a Qlik Sense snapshot into a HTML element. The snapshot fills the HTML object so you can size and position the element to determine how large the Qlik Sense object will be. + * If you only supply one parameter, you will just get the model without displaying the object. + * @param {string} id - Snapshot ID. + * @param {element | string} [elem] - Optional. HTML element or string with HTML element id. + * @return {Promise} - A promise of an object model. + */ + getSnapshot(id: string, elem?: any | string): ng.IPromise; + + /** + * Locks all selections. + * @param {string} [state=$] - Optional. Alternate state name. + * Default: $ + * Introduced in version 2.1. + * @return {Promise} - A promise of a Qlik engine reply. + */ + lockAll(state?: string): ng.IPromise; + + /** + * Removes an alternate state in the app. + * @param {string} qStateName - Alternate state name. + * @return {Promise} - A promise of a Qlik engine reply. + */ + removeAlternateState(qStateName: string): ng.IPromise; + + /** + * Searches for one or more terms in the values of a Qlik Sense app. + * @param {array} qTerms - Terms to search for. + * @param {object} qPage - Properties: + * Name | Type | Description + * qOffset | Number | Position from the top, starting from 0. + * qCount | Number | Number of search results to return. + * qMaxNbrFieldMatches | Number | Maximum number of matching values to return per search result. + * @param {object} qOptions - Properties + * Name | Type | Description + * qSearchFields | Array | List of search fields. + * qContext | | Search context. Can be one of: + * # Cleared: In this mode, the first step is to clear any current selections in the app. The second step is to search for one or more terms in the values of the app. + * # LockedFieldsOnly: In this mode, the search applies only to the values associated with the selections made in locked fields, ignoring selections in any unlocked field. If no locked fields, the behavior is identical to the Cleared context. You cannot make any new selections in a locked field. You can get search hits for the associated values of a locked field but you cannot get the search hits for the non associative values. + * # CurrentSelections: In this mode, the current selections are kept (if any). Search for one or more terms in the values of the app. New selections are made on top of the current selections. If no selections were made before the search, this mode is identical to the Cleared context. + * | | Default value is LockedFieldsOnly. + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + searchAssociations(qTerms: any[], qPage: any, qOptions: any, callback?: any): ng.IPromise; + + /** + * Searches for one or more terms in the values of a Qlik Sense app. + * @param {array} qTerms - Terms to search for. + * @param {object} qPage - Properties: + * Name | Type | Description + * qOffset | Number | Position from the top, starting from 0. + * qCount | Number | Number of search results to return. + * qGroupOptions | Array | This parameter is optional. Options of the search groups. If this property is not set, all values are returned. + * qGroupItemOptions | Array | This parameter is optional. Options of the search group items. If this property is not set, all values are returned. + * qOptions | Object | Optional. Search options. Properties: + * Name | Type | Description + * qSearchFields | Array | List of search fields. + * qContext | | Search context. Can be one of: + * # Cleared: In this mode, the first step is to clear any current selections in the app. The second step is to search for one or more terms in the values of the app. + * # LockedFieldsOnly: In this mode, the search applies only to the values associated with the selections made in locked fields, ignoring selections in any unlocked field. If no locked fields, the behavior is identical to the Cleared context. You cannot make any new selections in a locked field. You can get search hits for the associated values of a locked field but you cannot get the search hits for the non associative values. + * # CurrentSelections: In this mode, the current selections are kept (if any). Search for one or more terms in the values of the app. New selections are made on top of the current selections. If no selections were made before the search, this mode is identical to the Cleared context. + * | | Default value is LockedFieldsOnly. + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + searchResults(qTerms: any[], qPage: any, qOptions?: any, callback?: any): ng.IPromise; + + /** + * Returns suggestions of words from the values entered in the search. Acts as a helper for the searchAssociations method. + * @param {array} qTerms - Terms to search for. + * @param {object} [qOptions] - Optional. Search options. Properties: + * Name | Type | Description + * qSearchFields | Array | List of search fields. + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + searchSuggest(qTerms: any[], qOptions?: any, callback?: any): ng.IPromise; + + /** + * Makes a selection based on searchAssociation results. + * @param {number} qMatchIx - Index to search result. + * @param {array} qTerms - Values to select. + * @param {object} qOptions - Values to select. + * @param {array} [qTerms] - Optional. Parameter sent to the Qlik engine containing information about the search fields and the search context. + * @param {object} [qSoftLock] - Optional. This parameter was deprecated in version 2.0 and is ignored in newer versions. Use the qOtions.qContext parameter instead. + * @return {Promise} - A promise of a Qlik engine reply. + */ + selectAssociations(qMatchIx: number, qTerms: any[], qOptions?: any, qSoftLock?: any): ng.IPromise; + + /** + * Creates a QSelectionState object that encapsulates the selection state. Entry point to the Selection API. + * @param {string} [state] - Optional. Sets the state. Default is $. + */ + selectionState(state?: string): SelectionStateAPI.IQSelectionState; + + /** + * Unlocks all selections that has previously been locked. + * @param {string} [state] - Optional. Alternate state name. Default: $ Introduced in version 2.1. + */ + unlockAll(state?: string): ng.IPromise; + } +} + +declare namespace BookmarkAPI { + interface IBookmark { + /** + * Applies a bookmark. + * @param {string} id - Bookmark id. + * @return {Promise} - A promise of a Qlik engine reply. + */ + apply(id: string): ng.IPromise; + + /** + * Creates a bookmark based on the current selection. + * @param {string} title - Bookmark title. + * @param {string} description - Bookmark description. + * @param {string} [sheetId] - Optional. Bookmark sheet id. Introduced in version 2.2. + * @return {Promise} - A promise of a Qlik engine reply. + */ + create(title: string, description: string, sheetId?: string): ng.IPromise; + + /** + * Removes a bookmark. + * @param {string} id - Bookmark id. + * @return {Promise} - A promise of a Qlik engine reply. + */ + remove(id: string): ng.IPromise; + } +} + +declare namespace FieldAPI { + interface IQField { + /** + * Clears a field selection. + * @return {Promise} - A promise. + */ + clear(): ng.IPromise; + + /** + * Clears all fields except the selected one. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + clearOther(softlock?: boolean): ng.IPromise; + + /** + * Gets field data. The values are available as QFieldValue in array field.rows and will updated when the selection state changes. Notification OnData will be triggered after each update. + * @param {boolean} [options] - Optional. Properties: + * Name | Type | Description + * rows | Number | Number of rows to fetch. Default: 200. + * frequencyMode | String | Can be one of: + * # V=Absolute + * # P=Percent + * # R=Relative + * # N=No frequency + * | | Default: V. + * @return {IQField} - The field object. + */ + getData(options?: boolean): IQField; + + /** + * Gets more data for your field. Notification OnData is triggered when complete. + * @return {IQField} - The field object. + */ + getMoreData(): IQField; + + /** + * Locks a field selection. + * @return {Promise} - A promise. + */ + lock(): ng.IPromise; + + /** + * Selects field values using indexes. + * @param {number[]} Array - Array of index values to select + * @param {boolean} [toggle] - Optional. If true, toggle selected state. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + select(Array: number[], toggle?: boolean, softlock?: boolean): ng.IPromise; + + /** + * Selects all values in a field. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectAll(softlock?: boolean): ng.IPromise; + + /** + * Selects alternative values in a field. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectAlternative(softlock?: boolean): ng.IPromise; + + /** + * Selects excluded values in a field. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectExcluded(softlock?: boolean): ng.IPromise; + + /** + * Selects matching field values. + * @param {string} match - Match string. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectMatch(match: string, softlock?: boolean): ng.IPromise; + + /** + * Selects possible values in a field. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectPossible(softlock?: boolean): ng.IPromise; + + /** + * Selects specific values in a field. + * @param {array} array - Array of qFieldValues to select. A simplified syntax with strings or numbers also works since version 1.1. + * For a numeric field you need to provide the numeric value. + * @param {boolean} [toggle] - Optional. If true, toggle selected state. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectValues(array: IQFieldValue[], toggle?: boolean, softlock?: boolean): ng.IPromise; + + /** + * Toggles a field selection. + * @param {string} match - Match string. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + toggleSelect(match: string, softlock?: boolean): ng.IPromise; + + /** + * Unlocks field selections. + * @return {Promise} - A promise. + */ + unlock(): ng.IPromise; + + /** + * Field values. You need to call getData() method to make this available. Introduced in 2.1. + */ + rows: IQFieldValue[]; + + /** + * Optional. Number of different values. Only after getData() call. Introduced in 2.1. + */ + rowCount: number; + + /** + * Optional. Object with number of values in different states. Only after getData() call. Introduced in 2.1. + */ + qStateCounts: any; + } + + interface IQFieldValue { + /** + * Cell value formatted as set up in properties. + */ + qText: string; + + /** + * Cell value index. + */ + qElemNumber: number; + + /** + * Cell state. + */ + qState: any; + + /** + * Optional. Cell numeric value, if cell is numeric. + */ + qNum?: number; + + /** + * Optional. Frequency, if calculated by the Qlik engine. + */ + qFrequency?: string; + + /** + * Selects a field value. + * @param {boolean} [toggle] - Optional. If true, toggle selected state. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + select(toggle?: boolean, softlock?: boolean): ng.IPromise; + } +} + +declare namespace GlobalAPI { + interface IGlobal { + /** + * Cancels an ongoing reload. The reload of the app is stopped. + * @return {Promise} - A promise of a Qlik engine reply. + */ + cancelReload(): ng.IPromise; + + /** + * Gets a list of Qlik Sense apps that you potentially can connect to and registers a callback to receive the data. + * Calling the getAppList method opens a WebSocket, gets the app list, and then keeps the WebSocket open for you to make other calls as well. + * @param {Function} callback - Callback method. + */ + getAppList(callback: any): void; + + /** + * Gets information (user directory and user id) about the authenticated user. + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getAuthenticatedUser(callback?: any): ng.IPromise; + + /** + * Gets information about progress of doReload and doSave calls. + * @param {Number} qRequestId - Request id from doReload call or 0. + * Complete information is returned if the identifier of the request is specified. + * If qRequestId = 0, less information is returned. + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getProgress(qRequestId: number, callback?: any): ng.IPromise; + + /** + * Gets the product version. + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getProductVersion(callback?: any): ng.IPromise; + + /** + * Gets the Qlik product name. + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getQTProduct(callback?: any): ng.IPromise; + + /** + * Gets the Qlik Sense version number. + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise. + */ + getQvVersion(callback?: any): ng.IPromise; + + /** + * Gets information if the user is working in personal mode (returns true if Qlik Sense Desktop is used) or not (returns false if Qlik Sense Desktop is not used). + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + isPersonalMode(callback?: any): ng.IPromise; + } +} + +declare namespace NavigationAPI { + type NavigationModeType = "ANALYSIS" | "EDIT"; + type NavigationErrorType = "NOSUCHSHEET" | "NOCURRENTSHEET" | "NOSUCHSTORY"; + + /** + * The navigation result object. + */ + interface NavigationResult { + /** + * Returns true if successful. + */ + success: boolean; + + /** + * The new sheet ID. + */ + sheetId: string; + + /** + * The new story ID. + */ + storyId: string; + + /** + * The new mode. + */ + mode: string; + + /** + * Error code. Can be: NOSUCHSHEET | NOCURRENTSHEET | NOSUCHSTORY + */ + error: NavigationErrorType; + + /** + * Error message, for example 'No current sheet'. + */ + errorMsg: string; + } + + /** Navigation API for Qlik Sense. The Navigation API allows you to navigate + * within a Qlik Sense app, and is meant to be used in visualization extensions + * and will not work in Mashup scenarios. + */ + interface INavigation { + /** + * Used for analysis mode. + */ + edit: "edit"; + + /** + * Used for edit mode. + */ + analysis: "analysis"; + + /** + * Gets the current sheet ID. + * @return {NavigationResult} - A navigation result object. + */ + getCurrentSheetId(): NavigationResult; + + /** + * Gets the current mode. + * @return {string} - The current mode as a string. + */ + getMode(): string; + + /** + * Navigate to a given sheet in the current app. The method will return before the actual navigation takes place. + * @param {string} sheetId - Set the sheet ID to navigate to. + * @return {NavigationResult} - A navigation result object. + */ + gotoSheet(sheetId: string): NavigationResult; + + /** + * Navigate to a given story in the current app. The method will return before the actual navigation takes place. + * @param {string} storyId - Set the story ID to navigate to. + * @return {NavigationResult} - A navigation result object. + */ + gotoStory(storyId: string): NavigationResult; + + /** + * Checks if a given mode is allowed. + * @param {NavigationModeType} mode - Can be one of the strings: edit | analysis + * or one of the constants: qlik.navigation.EDIT | qlik.navigation.ANALYSIS + * @return {boolean} - A Boolean value (true or false). + */ + isModeAllowed(mode: NavigationModeType): boolean; + + /** + * Go to the next sheet in the current app. It will do nothing if you do not have sheets in the current context. + * The method will return before the actual navigation takes place. + * @return {NavigationResult} - A navigation result object. + */ + nextSheet(): NavigationResult; + + /** + * Jumps to the previous sheet in the current app. It will do nothing if you do not have sheets in the current context. + * The method will return before the actual navigation takes place + * @return {NavigationResult} - A navigation result object. + */ + prevSheet(): NavigationResult; + + /** + * Sets the current working mode of Qlik Sense. + * @param {string | constant} mode - Can be one of the strings: edit | analysis + * or one of the constants: qlik.navigation.EDIT | qlik.navigation.ANALYSIS + * @return {NavigationResult} - A navigation result object. + */ + setMode(mode: string): NavigationResult; + + /** + * Switches the working mode of Qlik Sense. + * @param {NavigationModeType} mode - Can be one of the strings: edit | analysis + * or one of the constants: qlik.navigation.EDIT | qlik.navigation.ANALYSIS + * @return {NavigationResult} - A navigation result object. + */ + switchMode(mode: NavigationModeType): NavigationResult; + } +} + +declare namespace SelectionStateAPI { + interface IQFieldSelections { + /** + * Selection state for a field. + */ + fieldName: string; + + /** + * Sort index. Starting from 0. + */ + qSortIndex: number; + + /** + * Reference to the field. + */ + field: FieldAPI.IQField; + + /** + * Defines if the field is locked. + */ + locked: boolean; + + /** + * Defines if the field is numeric. + */ + isNumeric: boolean; + + /** + * Total number of values in the field. + */ + totalCount: number; + + /** + * Number of selected values. + */ + selectedCount: number; + + /** + * Number of values that will be listed. + */ + qSelectionThreshold: number; + + /** + * Object with number of values in different states. + */ + qStateCounts: any; + + /** + * Concatenated string of selected values if number of values are less than the threshold, or if the string is of format "7 of 123". + */ + qSelected: string; + + /** + * Array with maximum of qSelectionThreshold values that are selected. For each value, the text plus the selection mode (NORMAL/AND/NOT) + */ + selectedValues: number[]; + + /** + * Array with maximum of qSelectionThreshold values that are not selected. For each value, the text plus the selection mode (NORMAL/AND/NOT) + */ + notSelectedValues: number[]; + } + + interface IQSelectionState { + /** + * State name. $ for default state. + */ + stateName: string; + + /** + * Selections + */ + selections: IQFieldSelections; + + /** + * Number of back steps available. + */ + backCount: number; + + /** + * Number of forward steps available. OnData notification will be triggered after each update. + */ + forwardCount: number; + + /** + * Cleara all selections in this state. + * @param {boolean} lockedAlso - Use to also clear locked fields. + * @return {Promise} - A promise of a Qlik engine reply. + */ + clearAll(lockedAlso: boolean): ng.IPromise; + + /** + * Locks all selections in this state. + * @return {Promise} - A promise of a Qlik engine reply. + */ + lockAll(): ng.IPromise; + + /** + * Unlocks all selections in this state. + * @return {Promise} - A promise of a Qlik engine reply. + */ + unlockAll(): ng.IPromise; + } +} + +declare namespace TableAPI { + interface IQTable { + /** + * Data rows. + */ + rows: IQRow[]; + + /** + * Header information. + */ + headers: IQHeader[]; + + /** + * Total information for measures. + */ + totals: IQMeasureCell[]; + + /** + * Total number of rows for the qHyperCube, including rows not fetched from the server. + */ + rowCount: number; + + /** + * Total number of columns for the qHyperCube. + */ + colCount: number; + + /** + * Exports data of the underlying hypercube in OOXML or CSV format. + * @param {object} [options] - Optional. Properties: + * Name | Type | Description + * format | String | Data format. Can be one of: + * # OOXML: open XML, default + * # CSV_C: comma separated CSV + * # CSV_T: tab separated CSV + * filename | String | Name of the exported file after download from browser. This parameter is optional and only used in desktop. + * state | String | Can be: + * # A: all values + * # P: possible values (default) + * download | Boolean | Automatically start download of file (with window.open). + * @param {Function} [callback] - Optional. Callback function returning the link to the exported file. + */ + exportData(options?: any, callback?: any): void; + + /** + * Gets the column number for a given field name. + * @param {string} fld - Field name. + * @return {number} - Column number, starting with zero. Undefined if no column with that name exists. + */ + getColByName(fld: string): number; + + /** + * Gets more data for your qHyperCube. + */ + getMoreData(): any; + } + + interface IQHeader { + /** + * Column title. + */ + qFallbackTitle: string; + + /** + * Can be: + * # A: ascending + * # D: descending + */ + qSortIndicator: string; + + /** + * True indicates if this is the first column for sorting. + */ + isOrderedBy: boolean; + + /** + * True indicates if the sort order is reversed for this column. + */ + qReverseSort: boolean; + + /** + * Column number. + */ + col: number; + + /** + * Optional. Number of different values. Only used for dimensions. + */ + qCardinal?: number; + + /** + * Optional. Object with number of values in different states. Only used for dimensions. + */ + qStateCounts?: any; + + /** + * Optional. Field object with methods to manipulate the underlying field. Only used for dimensions. + */ + field?: any; + + /** + * Optional. Minimum value. Only used for measures. + */ + qMin?: number; + + /** + * Optional. Maximum value. Only used for measures. + */ + qMax?: number; + + /** + * Optional. Error code for this column. Only if column has an error. Introduced in version 2.2. + */ + errorCode?: number; + + /** + * Error message for this column. Only if column has an error. Introduced in version 2.2. + */ + errorMessage: number; + + /** + * Sets this column to be the first in the sort order. + */ + orderBy(): void; + + /** + * Reverses the sort order for this column. + */ + reverseOrder(): void; + + /** + * Select a range in this measure. + * @param {number} min - Sets the minimum value of the range. + * @param {number} max - Sets the maximum value of the range. + * @param {boolean} [inclMin] - Optional. Set to true to include minimum value. + * @param {boolean} [inclMax] - Optional. Set to true to include maximum value. + * @return {Promise} - A promise. + */ + selectRange(min: number, max: number, inclMin?: boolean, inclMax?: boolean): ng.IPromise; + } + + interface IQRow { + /** + * Dimension cells. + */ + dimensions: IQDimensionCell[]; + + /** + * Measure cells. + */ + measures: IQMeasureCell[]; + + /** + * All cells, in the order they are defined in the properties. + */ + cells: any[]; + } + + interface IQDimensionCell extends IQMeasureCell { + /** + * Cell value index. + */ + qElemNumber: number; + + /** + * Cell state. + */ + qState: string; + + /** + * Selects the value in this cell. + */ + select(): void; + } + + interface IQMeasureCell { + /** + * Cell value formatted as set up in properties. + */ + qText: string; + + /** + * Optional. Cell numeric value, if cell is numeric. + */ + qNum?: number; + + /** + * Gets the value of this cell as a percentage of the total. Might be more than 100% if this is an average. + */ + getPercent(): number; + + /** + * Gets the value of this cell as a percentage of the maximum. + */ + getPercentOfMax(): number; + } +} + +declare namespace VariableAPI { + interface IVariable { + /** + * Creates a variable. + * @param {string | object} qProp - Variable name or properties. Properties: + * Name | Type | Description + * qInfo.qId | String | Optional. Variable id. If the selected ID is already in use, a new ID is automatically set by the engine. + * qName | String | Variable name. The name must be unique. + * qComment | String | Optional. Comment related to the variable. + * qDefinition | String | Optional. Variable definition. + * qNumberPresentation | Object | Optional. Defines the format of the value. + * qIncludeInBookmark | Boolean | Optional. Set to true to update the variable when applying a bookmark. The variable value will be persisted in the bookmark. + * @return {Promise} - Returns a promise of a variable model. + */ + create(qProp: string | any): ng.IPromise; + + /** + * Creates a session variable, that is a temporary variable which is not persisted and needs to be recreated for each new session. + * @param {object} qProp - Variable properties: + * Name | Type | Description + * qInfo.qId | String | Optional. Variable id. + * qName | String | Variable name. + * qComment | String | Optional. Comment. + * qDefinition | String | Optional. Variable definition. + * qNumberPresentation | Object | Optional. + * qIncludeInBookmark | Boolean | Optional. Include in bookmark flag. + * @return {Promise} - A promise of a variable model. + */ + createSessionVariable(qProp: any): ng.IPromise; + + /** + * Gets a variable by id. + * @param {string} qId - Variable id. + * @return {Promise} - A promise of a variable model. + */ + get(qId: string): ng.IPromise; + + /** + * Gets a variable by name. + * @param {string} qName - Variable name. + * @return {Promise} - A promise of a variable model. + */ + getByName(qName: string): ng.IPromise; + + /** + * Gets variable content. + * @param {string} name - Variable name. + * @param {Function} callback - Callback to receive the content. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getContent(name: string, callback: any): ng.IPromise; + + /** + * Sets the content of a variable. + * @param {string} name - Variable name. + * @param {string} content - Variable content. + * @return {Promise} - A promise of a Qlik engine reply. + */ + setContent(name: string, content: string): ng.IPromise; + + /** + * Sets a numeric value as a variable. + * @param {string} qName - Variable name. + * @param {Number} qVal - Variable value. + * @return {Promise} - A promise of a Qlik engine reply. + */ + setNumValue(qName: string, qVal: number): ng.IPromise; + + /** + * Sets variable string value. + * @param {string} qName - Variable name. + * @param {string} qVal - Variable value. + * @return {Promise} - A promise of a Qlik engine reply. + */ + setStringValue(qName: string, qVal: string): ng.IPromise; + } +} + +declare namespace VisualizationAPI { + type VisualizationType = "barchart" | "combochart" | "gauge" | "kpi" | "linechart" | "piechart" | "pivot-table" | + "scatterplot" | "table" | "treemap" | "extension"; + + interface IVisualization { + /** + * Create a new visualization on the fly based on a session object and will not be persisted in the app. + * @param {VisualizationType} type - Visualization type. Can be: + * # barchart + * # combochart + * # gauge + * # kpi + * # linechart + * # piechart + * # pivot-table + * # scatterplot + * # table + * # treemap + * # extension + * @param {array} [cols] - Optional. Column definitions, dimensions and measures. Each entry can be of the following structures: + * # String + * # NxDimension + * # NxMeasure + * If the NxDimension or the NxMeasure refer to a library dimension or a library measure, you also need to add qType : "measure" or "dimension". + * @param {object} [options] - Optional. Options to set. + * @return {Promise} - A promise of a QVisualization. + */ + create(type: VisualizationType, cols?: any[], options?: any): ng.IPromise; + + /** + * Gets an existing visualization. + * @param {string} id - Id for an existing visualization. + * @return {Promise} - A promise of a QVisualization. + */ + get(id: string): ng.IPromise; + } + + interface IQVisualization { + /** + * Table object for this visualization. Only for visualizations built on a hypercube. + */ + table: TableAPI.IQTable; + + /** + * Closes a visualization and releases the session object. + * @return {Promise} - A promise. + */ + close(): ng.IPromise; + + /** + * Tells the visualization it has been resized and should re-paint. + */ + resize(): void; + + /** + * Sets options for a visualization. + * @param {object} options - Options to set (using applyPatches). + */ + setOptions(options?: any): void; + + /** + * Shows the visualization in an HTML element. + * @param {Element | string} [element] - Optional. HTML element or HTML element ID. + * @param {object} [options] - Optional. + * Name | Type | Description + * noInteraction | Boolean | Set to true if you want to disable all interaction, including selections, in the visualization. + * noSelections | Boolean | Set to true if you want to disable selections in the visualization. + * | | Parameter introduced in version 3.0. + */ + show(element?: any | string, options?: any): void; + } +} + +declare namespace ExtensionAPI { + + + interface IExtensionModel { + + } + + interface IExtensionComponent { + model: IExtensionModel; + } + + interface IExtensionScope extends ng.IScope { + component: IExtensionComponent; + } + + + //ExtensionAPI + type SelectionModeType = "CONFIRM" | "QUICK"; + + interface IInitialProperties { + qHyperCubeDef?: any; //IHyperCubeDef; + qListObjectDef?: any; //IListObjectDef; + fixed?: boolean; + width?: number; + percent?: boolean; + selectionMode?: SelectionModeType; + } + + interface ISupport { + snapshot?: boolean; + export?: boolean; + exportData?: boolean; + } + + interface IExtension { + definition?: IDefinition; + paint?: ($element: HTMLElement, layout?: any) => void; + initialProperties?: IInitialProperties; + template?: string; + controller?: any; + support?: ISupport; + } + + interface ISupport { + snapshot?: boolean; // | () => boolean; + export?: boolean; // | () => boolean; + canTakeSnapshot?: boolean; + } + + interface IInitialProperties { + // qHyperCubeDef: IVisualizationHyperCubeDef; + // qListObjectDef: IVis + + //[""]: + } + + //#region IDefinition + type ExpressionType = "always" | "optional" | ""; + + type func = () => T; + type valueOrfunc = T | func; + + //#region Controls + interface ICustomControlOption { + value: string; + label: string; + } + + interface ICustomControl { + type: string; + label: string; + ref: string; + } + + interface ICustomString extends ICustomControl { + defaultValue: string; + expression: ExpressionType; + show: valueOrfunc; + maxlength: number; + } + + interface ICustomNumber extends ICustomControl { + defaultValue: number; + min: number; + max: number; + } + + interface ICustomInteger extends ICustomNumber { + } + + interface ICustomArray extends ICustomControl { + itemTitleRef: string; + addTranslation: string; + allowAdd: boolean; + allowMove: boolean; + allowRemove: boolean; + } + + interface ICustomButton extends ICustomControl { + label: string; + component: "button"; + action: valueOrfunc; + } + + interface ICustomButtonGroup extends ICustomControl { + component: "buttongroup"; + defaultValue: string; + options: valueOrfunc; + } + + interface ICustomCheckBox extends ICustomControl { + component: "checkbox"; + defaultValue: boolean; + } + + interface ICustomColorPicker extends ICustomControl { + component: "color-picker"; + defaultValue: number; + } + + interface ICustomDropDownList extends ICustomControl { + component: "dropdown"; + defaultValue: string; + options: valueOrfunc; + } + + interface ICustomLink { + type: string; + component: "link"; + label: string; + url: string; + } + + interface ICustomMedia extends ICustomControl { + component: "media"; + layoutRef: string; + } + + interface ICustomRadioButton extends ICustomControl { + component: "radiobuttons"; + defaultValue: string; + options: valueOrfunc; + } + + interface ICustomSlider extends ICustomControl { + component: "slider"; + defaultValue: number; + min: number; + max: number; + step: number; + } + + interface ICustomRangeSlider extends ICustomControl { + component: "slider"; + defaultValue: number[]; + min: number; + max: number; + step: number; + } + + interface ICustomSwitch { + component: "switch"; + defaultValue: boolean; + options: valueOrfunc; + } + + interface ICustomText { + type: "text"; + component: "text"; + label: string; + } + + interface ICustomTextArea extends ICustomControl { + component: "textarea"; + rows: number; + maxlength: number; + defaultValue: string; + show: valueOrfunc; + } + //#endregion + + interface IDefinition { + type: "items"; + component: "accordion"; + items: IItems; + } + + interface IItems { + dimentions?: IDimensions; + measures?: IMeasures; + appearance?: IAppearance; + sorting?: ISorting; + AddOns?: IAddOns; + [other: string]: any; + } + + interface IAddOns { + uses: "addons"; + } + + interface ISorting { + uses: "sorting"; + } + + interface IDimensions { + uses: "dimensions"; + min?: number; + max?: number; + } + + interface IAppearance { + uses: "settings"; + min?: number; + max?: number; + items: any; + } + + //?Das selbe wie Appearance? + interface ISettings { + uses: "settings"; + min?: number; + max?: number; + } + + interface IMeasures { + uses: "measures"; + min?: number; + max?: number; + } + + //#endregion +} + +declare module "qlik" { + var e: RootAPI.IRoot; export = e; +} + +interface IQVAngular { + /** + * 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: ng.Injectable): void; + directive(object: { [directiveName: string]: ng.Injectable }): void; + + filter(name: string, filterFactoryFunction: ng.Injectable): void; + filter(object: { [name: string]: ng.Injectable }): void; + + /** + * Register a service constructor, which will be invoked with new to create the service instance. This is short for registering a service where its provider's $get property is a factory function that returns an instance instantiated by the injector from the service constructor function. + * + * @param name The name of the instance. + * @param serviceConstructor An injectable class (constructor function) that will be instantiated. + * @return Returns the constructed singleton of the service class/function. + */ + service(name: string, serviceConstructor: ng.Injectable): T; + service(object: { [name: string]: ng.Injectable }): T; + + //provider(name: string, serviceProviderFactory: ng.IServiceProviderFactory): void; + //provider(name: string, serviceProviderConstructor: ng.IServiceProviderClass): void; +} + +declare module "qvangular" { + var e: IQVAngular; export = e; +} \ No newline at end of file diff --git a/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts b/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts new file mode 100644 index 0000000000..032b755b34 --- /dev/null +++ b/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts @@ -0,0 +1,3 @@ +import * as qlik from "qlik"; + +const t = qlik.currApp(); \ No newline at end of file diff --git a/qlik-visualizationextensions/tsconfig.json b/qlik-visualizationextensions/tsconfig.json new file mode 100644 index 0000000000..47e4903e2e --- /dev/null +++ b/qlik-visualizationextensions/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "amd", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "qlik-visualizationextensions-tests.ts" + ] +} \ No newline at end of file diff --git a/qlik-visualizationextensions/tslint.json b/qlik-visualizationextensions/tslint.json new file mode 100644 index 0000000000..965a36a968 --- /dev/null +++ b/qlik-visualizationextensions/tslint.json @@ -0,0 +1,7 @@ +{ "extends": "../tslint.json", + "rules": { + "forbidden-types": false, + "no-empty-interface": false, + "interface-name": false + } +} \ No newline at end of file From 47134067acfda2acc7230e44d1c2b7ba9c6ef85b Mon Sep 17 00:00:00 2001 From: Konrad Mattheis Date: Thu, 23 Feb 2017 16:08:25 +0100 Subject: [PATCH 012/276] fixes BOM & module to run npm test Signed-off-by: Konrad Mattheis --- qlik-visualizationextensions/index.d.ts | 4 ++-- .../qlik-visualizationextensions-tests.ts | 2 +- qlik-visualizationextensions/tsconfig.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qlik-visualizationextensions/index.d.ts b/qlik-visualizationextensions/index.d.ts index 8a9c145969..c7eb32273c 100644 --- a/qlik-visualizationextensions/index.d.ts +++ b/qlik-visualizationextensions/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for qlik-visualizationextensions +// Type definitions for qlik-visualizationextensions 3.2 // Project: http://help.qlik.com/en-US/sense-developer/3.2/Subsystems/Extensions/Content/extensions-introduction.htm // Definitions by: Konrad Mattheis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -791,7 +791,7 @@ declare namespace BackendAPI { * @param {array} qPages - An array of request page objects. * @param {number} qZoomFactor - Zoom factor. * If set to -1, the Qlik engine decides of the zoom factor. - * If qReductionMode is D1 or S, the zoom factor is 2ⁿ. If the zoom factor is 5, the data are reduced by a factor 32. + * If qReductionMode is D1 or S, the zoom factor is 2n. If the zoom factor is 5, the data are reduced by a factor 32. * If qReductionMode is C, the zoom factor defines the number of centroids. * @param {string} qReductionMode - Reduction mode.Can be: * # N for no data reduction. diff --git a/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts b/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts index 032b755b34..2e1d738198 100644 --- a/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts +++ b/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts @@ -1,3 +1,3 @@ -import * as qlik from "qlik"; +import qlik=require("qlik"); const t = qlik.currApp(); \ No newline at end of file diff --git a/qlik-visualizationextensions/tsconfig.json b/qlik-visualizationextensions/tsconfig.json index 47e4903e2e..f4a5bc132a 100644 --- a/qlik-visualizationextensions/tsconfig.json +++ b/qlik-visualizationextensions/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "module": "amd", + "module": "commonjs", "lib": [ "es6", "dom" From 28be3862f5ad801e7e8c23ab6052bc5bdf4d926e Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Fri, 24 Feb 2017 01:15:16 +0100 Subject: [PATCH 013/276] Basic definitions for Google+ API (gapi.plus) --- gapi.plus/gapi.plus-tests.ts | 10 ++++ gapi.plus/index.d.ts | 111 +++++++++++++++++++++++++++++++++++ gapi.plus/tsconfig.json | 18 ++++++ 3 files changed, 139 insertions(+) create mode 100644 gapi.plus/gapi.plus-tests.ts create mode 100644 gapi.plus/index.d.ts create mode 100644 gapi.plus/tsconfig.json diff --git a/gapi.plus/gapi.plus-tests.ts b/gapi.plus/gapi.plus-tests.ts new file mode 100644 index 0000000000..12368dd63c --- /dev/null +++ b/gapi.plus/gapi.plus-tests.ts @@ -0,0 +1,10 @@ +/* Example taken from https://developers.google.com/+/web/people/ */ + +gapi.client.load('plus','v1', function(){ + var request = gapi.client.plus.people.get({ + 'userId': 'me' + }); + request.execute(function(resp) { + console.log('Retrieved profile for:' + resp.displayName); + }); +}); diff --git a/gapi.plus/index.d.ts b/gapi.plus/index.d.ts new file mode 100644 index 0000000000..3e24b79ce1 --- /dev/null +++ b/gapi.plus/index.d.ts @@ -0,0 +1,111 @@ +// Type definitions for Google+ Platform API 1.0 +// Project: https://developers.google.com/+/web/people/ +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +// See Google+ REST API Reference https://developers.google.com/+/web/api/rest/latest/ +declare namespace gapi.client.plus { + export namespace people { + + interface GetParameters { + userId: string; + } + function get(parameters: GetParameters): HttpRequest; + + interface SearchParameters { + query: string; + language?: string; + maxResults?: number; + pageToken?: string; + } + function search(parameters: SearchParameters): HttpRequest; + + // Search response + interface PeopleFeed { + kind: 'plus#peopleFeed'; + etag: string; + selfLink: string; + title: string; + nextPageToken: string; + totalItems: number; + items: Person[]; + } + + interface Person { + kind: 'plus#person'; + etag: string; + nickname: string; + occupation: string; + skills: string; + birthday: string; + gender: string; + emails: { + value: string; + type: string; + }[]; + urls: { + value: string; + type: string; + label: string; + }[]; + objectType: string; + id: string; + displayName: string; + name: { + formatted: string; + familyName: string; + givenName: string; + middleName: string; + honorificPrefix: string; + honorificSuffix: string; + }; + tagline: string; + braggingRights: string; + aboutMe: string; + relationshipStatus: string; + url: string; + image: { + url: string; + }; + organizations: { + name: string; + department: string; + title: string; + type: string; + startDate: string; + endDate: string; + location: string; + description: string; + primary: boolean; + }[]; + placesLived: { + value: string; + primary: boolean; + }[]; + isPlusUser: boolean; + language: string; + ageRange: { + min: number; + max: number; + }; + plusOneCount: number; + circledByCount: number; + verified: boolean; + cover: { + layout: string; + coverPhoto: { + url: string; + height: number; + width: number; + }; + coverInfo: { + topImageOffset: number; + leftImageOffset: number; + } + }; + domain: string; + } + } +} diff --git a/gapi.plus/tsconfig.json b/gapi.plus/tsconfig.json new file mode 100644 index 0000000000..1fc2401de1 --- /dev/null +++ b/gapi.plus/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "module": "commonjs", + "lib": ["es6", "dom"], + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "gapi.plus-tests.ts" + ] +} From 9e80f1e890b49247de1b9fd37b6d5c68f8fc52b3 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Fri, 24 Feb 2017 01:17:28 +0100 Subject: [PATCH 014/276] Add definitions for Google People API (gapi.people) --- gapi.people/gapi.people-tests.ts | 99 +++++++++++++ gapi.people/index.d.ts | 246 +++++++++++++++++++++++++++++++ gapi.people/tsconfig.json | 18 +++ 3 files changed, 363 insertions(+) create mode 100644 gapi.people/gapi.people-tests.ts create mode 100644 gapi.people/index.d.ts create mode 100644 gapi.people/tsconfig.json diff --git a/gapi.people/gapi.people-tests.ts b/gapi.people/gapi.people-tests.ts new file mode 100644 index 0000000000..65b6339765 --- /dev/null +++ b/gapi.people/gapi.people-tests.ts @@ -0,0 +1,99 @@ +/* Example taken from Google People API JavaScript Quickstart https://developers.google.com/people/quickstart/js */ + +{ + // Your Client ID can be retrieved from your project in the Google + // Developer Console, https://console.developers.google.com + var CLIENT_ID = ''; + + var SCOPES = ["https://www.googleapis.com/auth/contacts.readonly"]; + + /** + * Check if current user has authorized this application. + */ + function checkAuth() { + gapi.auth.authorize( + { + 'client_id': CLIENT_ID, + 'scope': SCOPES.join(' '), + 'immediate': true + }, handleAuthResult); + } + + /** + * Handle response from authorization server. + * + * @param {Object} authResult Authorization result. + */ + function handleAuthResult(authResult: GoogleApiOAuth2TokenObject) { + var authorizeDiv = document.getElementById('authorize-div')!; + if (authResult && !authResult.error) { + // Hide auth UI, then load client library. + authorizeDiv.style.display = 'none'; + loadPeopleApi(); + } else { + // Show auth UI, allowing the user to initiate authorization by + // clicking authorize button. + authorizeDiv.style.display = 'inline'; + } + } + + /** + * Initiate auth flow in response to user clicking authorize button. + * + * @param {Event} event Button click event. + */ + function handleAuthClick(event: MouseEvent) { + gapi.auth.authorize( + {client_id: CLIENT_ID, scope: SCOPES, immediate: false}, + handleAuthResult); + return false; + } + + /** + * Load Google People client library. List names if available + * of 10 connections. + */ + function loadPeopleApi() { + gapi.client.load('https://people.googleapis.com/$discovery/rest', 'v1', listConnectionNames); + } + + /** + * Print the display name if available for 10 connections. + */ + function listConnectionNames() { + var request = gapi.client.people.people.connections.list({ + 'resourceName': 'people/me', + 'pageSize': 10, + }); + + request.execute(function(resp) { + var connections = resp.connections; + appendPre('Connections:'); + + if (connections.length > 0) { + for (var i = 0; i < connections.length; i++) { + var person = connections[i]; + if (person.names && person.names.length > 0) { + appendPre(person.names[0].displayName) + } else { + appendPre("No display name found for connection."); + } + } + } else { + appendPre('No upcoming events found.'); + } + }); + } + + /** + * Append a pre element to the body containing the given message + * as its text node. + * + * @param {string} message Text to be placed in pre element. + */ + function appendPre(message: string) { + var pre = document.getElementById('output')!; + var textContent = document.createTextNode(message + '\n'); + pre.appendChild(textContent); + } +} diff --git a/gapi.people/index.d.ts b/gapi.people/index.d.ts new file mode 100644 index 0000000000..86bf930beb --- /dev/null +++ b/gapi.people/index.d.ts @@ -0,0 +1,246 @@ +// Type definitions for Google People API 1.0 +// Project: https://developers.google.com/people/ +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace gapi.client.people { + export namespace people { + + interface GetParameters { + resourceName: string; + + // Query parameters + requestMask?: RequestMask; + } + + function get(parameters: GetParameters): HttpRequest; + + interface GetBatchGetParameters { + // Query parameters + resourcesName?: string; + requestMask?: RequestMask; + } + + function getBatchGet(parameters: GetBatchGetParameters): HttpRequest; + + interface BatchGetResponse { + responses: PersonResponse[]; + } + + interface PersonResponse { + httpStatusCode: number; + person: Person; + requestedResourceName: string; + } + + namespace connections { + function list(parameters: ListParameters): HttpRequest; + + type SortOrder = 'LAST_MODIFIED_ASCENDING' | 'FIRST_NAME_ASCENDING' | 'LAST_NAME_ASCENDING'; + + interface ListParameters { + resourceName: string; + + // Query parameters + pageToken?: string; + pageSize?: number; + sortOrder?: SortOrder; + syncToken?: string; + requestMask?: RequestMask; + } + + interface Response { + connections: Person[]; + nextPageToken: string; + nextSyncToken: string; + } + } + } + + interface RequestMask { + includeField: string; + } + + type SourceType = 'SOURCE_TYPE_UNSPECIFIED' | 'ACCOUNT' | 'PROFILE' | 'DOMAIN_PROFILE' | 'CONTACT'; + + interface Source { + type: SourceType; + id: string; + etag: string; + resourceName: string; + } + + type ObjectType = 'OBJECT_TYPE_UNSPECIFIED' | 'PERSON' | 'PAGE'; + + interface PersonMetadata { + sources: Source[]; + previousResourceNames: string[]; + linkedPeopleResourceNames: string[]; + deleted: boolean; + objectType: ObjectType; + } + + interface FieldMetadata { + primary: boolean; + verified: boolean; + source: Source; + } + + interface Locale { + metadata: FieldMetadata; + value: string; + } + + interface Name { + metadata: FieldMetadata; + displayName: string; + displayNameLastFirst: string; + familyName: string; + givenName: string; + middleName: string; + honorificPrefix: string; + honorificSuffix: string; + phoneticFullName: string; + phoneticFamilyName: string; + phoneticGivenName: string; + phoneticMiddleName: string; + phoneticHonorificPrefix: string; + phoneticHonorificSuffix: string; + } + + type NicknameType = 'DEFAULT' | 'MAIDEN_NAME' | 'INITIALS' | 'GPLUS' | 'OTHER_NAME'; + + interface Nickname { + metadata: FieldMetadata; + value: string; + type: NicknameType; + } + + interface CoverPhoto { + } + + interface Photo { + } + + interface Gender { + } + + interface AgeRange { + } + + interface Birthday { + } + + interface Event { + } + + interface Address { + metadata: FieldMetadata; + formattedValue: string; + type: string; + formattedType: string; + poBox: string; + streetAddress: string; + extendedAddress: string; + city: string; + region: string; + postalCode: string; + country: string; + countryCode: string; + } + + interface Residence { + metadata: FieldMetadata; + value: string; + current: boolean; + } + + interface EmailAddress { + metadata: FieldMetadata; + value: string; + type: string; + formattedType: string; + displayName: string; + } + + interface PhoneNumber { + metadata: FieldMetadata; + value: string; + canonicalForm: string; + type: string; + formattedType: string; + } + + interface ImClient { + } + + interface Tagline { + } + + interface Biography { + } + + interface Url { + } + + interface Organization { + } + + interface Occupation { + } + + interface Interest { + } + + interface Skill { + } + + interface BraggingRights { + } + + interface Relation { + } + + interface RelationshipInterest { + } + + interface RelationshipStatus { + } + + interface Membership { + } + + interface Person { + resourceName: string; + etag: string; + metadata: PersonMetadata; + locales: Locale[]; + names: Name[]; + nicknames?: Nickname[]; + coverPhotos: CoverPhoto[]; + photos?: Photo[]; + genders?: Gender[]; + ageRange?: AgeRange; + birthdays?: Birthday[]; + events?: Event[]; + addresses?: Address[]; + residences?: Residence[]; + emailAddresses?: EmailAddress[]; + phoneNumbers?: PhoneNumber[]; + imClients?: ImClient[]; + taglines?: Tagline[]; + biographies?: Biography[]; + urls?: Url[]; + organizations?: Organization[]; + occupations?: Occupation[]; + interests?: Interest[]; + skills?: Skill[]; + BraggingRights?: BraggingRights[]; + relations?: Relation[]; + relationshipInterests?: RelationshipInterest[]; + relationshipStatuses?: RelationshipStatus[]; + memberships?: Membership[]; + } +} diff --git a/gapi.people/tsconfig.json b/gapi.people/tsconfig.json new file mode 100644 index 0000000000..93fcfc59b6 --- /dev/null +++ b/gapi.people/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "module": "commonjs", + "lib": ["es6", "dom"], + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "gapi.people-tests.ts" + ] +} From fc9bff794033c7509144dd53f28cba8fe8748796 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Fri, 24 Feb 2017 01:18:59 +0100 Subject: [PATCH 015/276] Add tests for gapi Includes various fixes due to the tests --- gapi/gapi-tests.ts | 97 ++++++++++++++++++++++++++++++++++++++++++++++ gapi/index.d.ts | 86 ++++++++++++++++++++++++++++++---------- gapi/tsconfig.json | 10 +++-- 3 files changed, 168 insertions(+), 25 deletions(-) create mode 100644 gapi/gapi-tests.ts diff --git a/gapi/gapi-tests.ts b/gapi/gapi-tests.ts new file mode 100644 index 0000000000..b16cade6bb --- /dev/null +++ b/gapi/gapi-tests.ts @@ -0,0 +1,97 @@ +/// +/// + +/* Examples taken from https://developers.google.com/api-client-library/javascript/start/start-js */ + +{ + function start1() { + // 2. Initialize the JavaScript client library. + gapi.client.init({ + 'apiKey': 'YOUR_API_KEY', + 'discoveryDocs': ['https://people.googleapis.com/$discovery/rest'], + // clientId and scope are optional if auth is not required. + 'clientId': 'YOUR_WEB_CLIENT_ID.apps.googleusercontent.com', + 'scope': 'profile', + }).then(function() { + // 3. Initialize and make the API request. + return gapi.client.people.people.get({ + resourceName: 'people/me' + }); + }).then(function(response) { + console.log(response.result); + }, function(reason) { + console.log('Error: ' + reason.result.error.message); + }); + }; + // 1. Load the JavaScript client library. + gapi.load('client', start1); +} + +{ + function start2() { + // 2. Initialize the JavaScript client library. + gapi.client.init({ + 'apiKey': 'YOUR_API_KEY', + // clientId and scope are optional if auth is not required. + 'clientId': 'YOUR_WEB_CLIENT_ID.apps.googleusercontent.com', + 'scope': 'profile', + }).then(function() { + // 3. Initialize and make the API request. + return gapi.client.request({ + 'path': 'https://people.googleapis.com/v1/people/me', + }) + }).then(function(response) { + console.log(response.result); + }, function(reason) { + console.log('Error: ' + reason.result.error.message); + }); + }; + // 1. Load the JavaScript client library. + gapi.load('client', start2); +} + + +/* Examples taken from https://developers.google.com/api-client-library/javascript/features/promises */ + +gapi.client.request({'path': '/plus/v1/people', 'params': {'query': 'John'}}).then(function(response) { + // Handle response +}, function(reason) { + // Handle error +}); + +gapi.client.load('plus', 'v1').then(function() { + gapi.client.plus.people.search({'query': ''}).then(response => { }); +}); + +var personFetcher = { + results: [], + + // Why this: any? Check https://github.com/Microsoft/TypeScript/issues/10835 + + fetch: function(this: any, name: string) { + gapi.client.request({path: '/plus/v1/people', params:{query: name}}).then(function(this: any, response) { + this.results.push(response.result); + }, function(reason) { + console.error(name, 'was not fetched:', reason.result.error.message); + }, this); + } +}; +personFetcher.fetch('John'); + +gapi.client.request({ + 'path': 'plus/v1/people', + 'params': {'query': name} +}).execute(function(resp, rawResp) { + processResponse(resp); +}); + +gapi.client.request({ + 'path': 'plus/v1/people', + 'params': {'query': name} +}).then(function(resp) { + processResponse(resp.result); +}); + +function processResponse(response: any) { + // Stub +} diff --git a/gapi/index.d.ts b/gapi/index.d.ts index 84da600e7b..8f8e621fa3 100644 --- a/gapi/index.d.ts +++ b/gapi/index.d.ts @@ -1,8 +1,8 @@ -// Type definitions for Google API Client +// Type definitions for Google API Client 0.0 // Project: https://code.google.com/p/google-api-javascript-client/ // Definitions by: Frank M // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.1 /** * The OAuth 2.0 token object represents the OAuth 2.0 token and any associated data. @@ -102,7 +102,7 @@ declare namespace gapi.auth { /** * A function in the global namespace, which is called when the sign-in button is rendered and also called after a sign-in flow completes. */ - callback?: Function; + callback?: () => void; /** * If true, all previously granted scopes remain granted in each incremental request, for incremental authorization. The default value true is correct for most use cases; use false only if employing delegated auth, where you pass the bearer token to a less-trusted component with lower programmatic authority. */ @@ -127,6 +127,30 @@ declare namespace gapi.auth { } declare namespace gapi.client { + /** + * Initializes the JavaScript client with API key, OAuth client ID, scope, and API discovery document(s). + * If OAuth client ID and scope are provided, this function will load the gapi.auth2 module to perform OAuth. + * The gapi.client.init function can be run multiple times, such as to set up more APIs, to change API key, or initialize OAuth lazily. + */ + export function init(args: { + /** + * The API Key to use. + */ + apiKey?: string; + /** + * An array of discovery doc URLs or discovery doc JSON objects. + */ + discoveryDocs?: string[]; + /** + * The app's client ID, found and created in the Google Developers Console. + */ + clientId?: string; + /** + * The scopes to request, as a space-delimited string. + */ + scope?: string + }): Promise; + interface RequestOptions { /** * The URL to handle the request @@ -188,10 +212,46 @@ declare namespace gapi.client { */ export function setApiKey(apiKey: string): void; + interface HttpRequestFulfilled { + result: T; + body: string; + headers?: any[]; + status?: number; + statusText?: string; + } + + interface HttpRequestRejected { + result: { + error: { + message: string; + } + }; + body: string; + headers?: any[]; + status?: number; + statusText?: string; + } + + /** + * HttpRequest supports promises. + * See Google API Client JavaScript Using Promises https://developers.google.com/api-client-library/javascript/features/promises + * + * TODO This should be updated when TypeScript 2.3 is released + * See https://github.com/Microsoft/TypeScript/issues/12409 + * See https://github.com/Microsoft/TypeScript/blob/65da012527937a3074c62655d60ee08fee809f7f/lib/lib.es5.d.ts#L1339 + */ + class HttpRequestPromise { + then( + opt_onFulfilled?: ((response: HttpRequestFulfilled) => void) | null, + opt_onRejected?: ((reason: HttpRequestRejected) => void) | null, + opt_context?: any + ): Promise; + } + /** * An object encapsulating an HTTP request. This object is not instantiated directly, rather it is returned by gapi.client.request. */ - export class HttpRequest { + export class HttpRequest extends HttpRequestPromise { /** * Executes the request and runs the supplied callback on response. * @param callback The callback function which executes when the request succeeds or fails. @@ -211,24 +271,8 @@ declare namespace gapi.client { statusText: string; } ) => any): void; - /** - * HttpRequest supports promises. - */ - then(success: (response: { - result: T; - body: string; - headers?: any[]; - status?: number; - statusText?: string; - }) => void, - failure: (response: { - result: T; - body: string; - headers?: any[]; - status?: number; - statusText?: string; - }) => void): void; } + /** * Represents an HTTP Batch operation. Individual HTTP requests are added with the add method and the batch is executed using execute. */ diff --git a/gapi/tsconfig.json b/gapi/tsconfig.json index 27e01ecd7b..22f5738c1a 100644 --- a/gapi/tsconfig.json +++ b/gapi/tsconfig.json @@ -2,11 +2,12 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -16,6 +17,7 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts" + "index.d.ts", + "gapi-tests.ts" ] -} \ No newline at end of file +} From 966f6241c6c5471138737e047b95bd404c87b8c8 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Fri, 24 Feb 2017 01:19:43 +0100 Subject: [PATCH 016/276] gapi.auth2 small fixes --- gapi.auth2/gapi.auth2-tests.ts | 12 ++++++------ gapi.auth2/index.d.ts | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gapi.auth2/gapi.auth2-tests.ts b/gapi.auth2/gapi.auth2-tests.ts index 621ca6f056..362a60c904 100644 --- a/gapi.auth2/gapi.auth2-tests.ts +++ b/gapi.auth2/gapi.auth2-tests.ts @@ -1,6 +1,6 @@ -function test_init(){ +function test_init() { var auth = gapi.auth2.init({ client_id: 'my-id', cookie_policy: 'single_host_origin', @@ -9,7 +9,7 @@ function test_init(){ }); } -function test_getAuthInstance(){ +function test_getAuthInstance() { gapi.auth2.init({ client_id: 'my-id', cookie_policy: 'single_host_origin', @@ -19,14 +19,14 @@ function test_getAuthInstance(){ var auth = gapi.auth2.getAuthInstance(); } -function test_signIn(){ +function test_signIn() { gapi.auth2.getAuthInstance().signIn({ scope: 'email profile', prompt: 'content' }); } -function test_signInOptionsBuild(){ +function test_signInOptionsBuild() { var options = new gapi.auth2.SigninOptionsBuilder(); options.setAppPackageName('com.example.app'); options.setFetchBasicProfile(true); @@ -35,13 +35,13 @@ function test_signInOptionsBuild(){ gapi.auth2.getAuthInstance().signIn(options); } -function test_getAuthResponse(){ +function test_getAuthResponse() { var user = gapi.auth2.getAuthInstance().currentUser.get(); var authResponse = user.getAuthResponse(); var authResponseWithAuth = user.getAuthResponse(true); } -function test_render(){ +function test_render() { var success = (googleUser: gapi.auth2.GoogleUser): void => { console.log(googleUser); }; diff --git a/gapi.auth2/index.d.ts b/gapi.auth2/index.d.ts index 6146a87e28..402da68699 100644 --- a/gapi.auth2/index.d.ts +++ b/gapi.auth2/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Sign-In API +// Type definitions for Google Sign-In API 0.0 // Project: https://developers.google.com/identity/sign-in/web/ // Definitions by: Derek Lawless // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -21,7 +21,7 @@ declare namespace gapi.auth2 { * Calls the onInit function when the GoogleAuth object is fully initialized, or calls the onFailure function if * initialization fails. */ - then(onInit: () => any, onFailure: (reason: string) => any): any; + then(onInit: () => any, onFailure?: (reason: string) => any): any; /** * Signs in the user with the options specified to gapi.auth2.init(). @@ -58,7 +58,7 @@ declare namespace gapi.auth2 { onsuccess: (googleUser: GoogleUser) => any, onfailure: (reason: string) => any): any; } - export interface IsSignedIn{ + export interface IsSignedIn { /** * Returns whether the current user is currently signed in. */ From 2b11d2ab76a29a2dfec9972eec486d9754ec0ede Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Fri, 24 Feb 2017 01:20:07 +0100 Subject: [PATCH 017/276] More tests for gapi.auth2 --- gapi.auth2/gapi.auth2-tests.ts | 86 +++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/gapi.auth2/gapi.auth2-tests.ts b/gapi.auth2/gapi.auth2-tests.ts index 362a60c904..1d389d59e9 100644 --- a/gapi.auth2/gapi.auth2-tests.ts +++ b/gapi.auth2/gapi.auth2-tests.ts @@ -1,4 +1,4 @@ - +/// function test_init() { var auth = gapi.auth2.init({ @@ -59,3 +59,87 @@ function test_render() { onfailure: failure }); } + +/* Example taken from https://developers.google.com/identity/sign-in/web/ */ +function onSignIn(googleUser: gapi.auth2.GoogleUser) { + // Useful data for your client-side scripts: + var profile = googleUser.getBasicProfile(); + console.log("ID: " + profile.getId()); // Don't send this directly to your server! + console.log('Full Name: ' + profile.getName()); + console.log('Given Name: ' + profile.getGivenName()); + console.log('Family Name: ' + profile.getFamilyName()); + console.log("Image URL: " + profile.getImageUrl()); + console.log("Email: " + profile.getEmail()); + + // The ID token you need to pass to your backend: + var id_token = googleUser.getAuthResponse().id_token; + console.log("ID Token: " + id_token); +}; + + +/* Example taken from https://github.com/google/google-api-javascript-client/blob/master/samples/authSample.html */ + +// Enter an API key from the Google API Console: +// https://console.developers.google.com/apis/credentials +var apiKey = 'YOUR_API_KEY'; +// Enter the API Discovery Docs that describes the APIs you want to +// access. In this example, we are accessing the People API, so we load +// Discovery Doc found here: https://developers.google.com/people/api/rest/ +var discoveryDocs = ["https://people.googleapis.com/$discovery/rest?version=v1"]; +// Enter a client ID for a web application from the Google API Console: +// https://console.developers.google.com/apis/credentials?project=_ +// In your API Console project, add a JavaScript origin that corresponds +// to the domain where you will be running the script. +var clientId = 'YOUR_WEB_CLIENT_ID.apps.googleusercontent.com'; +// Enter one or more authorization scopes. Refer to the documentation for +// the API or https://developers.google.com/people/v1/how-tos/authorizing +// for details. +var scopes = 'profile'; +var authorizeButton = document.getElementById('authorize-button'); +var signoutButton = document.getElementById('signout-button'); +function handleClientLoad() { + // Load the API client and auth2 library + gapi.load('client:auth2', initClient); +} +function initClient() { + gapi.client.init({ + apiKey: apiKey, + discoveryDocs: discoveryDocs, + clientId: clientId, + scope: scopes + }).then(function () { + // Listen for sign-in state changes. + gapi.auth2.getAuthInstance().isSignedIn.listen(updateSigninStatus); + // Handle the initial sign-in state. + updateSigninStatus(gapi.auth2.getAuthInstance().isSignedIn.get()); + authorizeButton.onclick = handleAuthClick; + signoutButton.onclick = handleSignoutClick; + }); +} +function updateSigninStatus(isSignedIn: boolean) { + if (isSignedIn) { + authorizeButton.style.display = 'none'; + signoutButton.style.display = 'block'; + makeApiCall(); + } else { + authorizeButton.style.display = 'block'; + signoutButton.style.display = 'none'; + } +} +function handleAuthClick(event: MouseEvent) { + gapi.auth2.getAuthInstance().signIn(); +} +function handleSignoutClick(event: MouseEvent) { + gapi.auth2.getAuthInstance().signOut(); +} +// Load the API and make an API call. Display the results on the screen. +function makeApiCall() { + gapi.client.people.people.get({ + resourceName: 'people/me' + }).then(function(resp) { + var p = document.createElement('p'); + var name = resp.result.names[0].givenName; + p.appendChild(document.createTextNode('Hello, '+name+'!')); + document.getElementById('content').appendChild(p); + }); +} From 77af13e3b476ff344e90063a6787483bffa562ef Mon Sep 17 00:00:00 2001 From: Stefan Dobrev Date: Fri, 24 Feb 2017 11:04:40 +0200 Subject: [PATCH 018/276] [react-native] SubViewRenderer can return null SubViewRenderer could potentially return `null` along with JSX element. --- react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-native/index.d.ts b/react-native/index.d.ts index 2f95939db6..60556d3d09 100644 --- a/react-native/index.d.ts +++ b/react-native/index.d.ts @@ -7635,7 +7635,7 @@ declare module "react" { onNavigateBack?(): void; } - type SubViewRenderer = (subViewProps: SubViewProps) => JSX.Element; + type SubViewRenderer = (subViewProps: SubViewProps) => JSX.Element | null; export interface NavigationHeaderProps extends NavigationSceneRendererProps { onNavigateBack?(): void, From 1dfe4c5dada036e164d2114a1cf3ebbb71224bf0 Mon Sep 17 00:00:00 2001 From: Jan Alonzo Date: Sat, 25 Feb 2017 15:55:05 +1100 Subject: [PATCH 019/276] Remove localforage and point to upstream typings instead --- localforage/index.d.ts | 115 ------------------------------ localforage/localforage-tests.ts | 117 ------------------------------- localforage/package.json | 5 ++ localforage/tsconfig.json | 23 ------ notNeededPackages.json | 8 ++- 5 files changed, 12 insertions(+), 256 deletions(-) delete mode 100644 localforage/index.d.ts delete mode 100644 localforage/localforage-tests.ts create mode 100644 localforage/package.json delete mode 100644 localforage/tsconfig.json diff --git a/localforage/index.d.ts b/localforage/index.d.ts deleted file mode 100644 index d0194ec60f..0000000000 --- a/localforage/index.d.ts +++ /dev/null @@ -1,115 +0,0 @@ -// Type definitions for Mozilla's localForage -// Project: https://github.com/mozilla/localforage -// Definitions by: yuichi david pichsenmeister -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface LocalForageOptions { - driver?: string | LocalForageDriver | LocalForageDriver[]; - - name?: string; - - size?: number; - - storeName?: string; - - version?: number; - - description?: string; -} - -interface LocalForageDbMethods { - getItem(key: string): Promise; - getItem(key: string, callback: (err: any, value: T) => void): void; - - setItem(key: string, value: T): Promise; - setItem(key: string, value: T, callback: (err: any, value: T) => void): void; - - removeItem(key: string): Promise; - removeItem(key: string, callback: (err: any) => void): void; - - clear(): Promise; - clear(callback: (err: any) => void): void; - - length(): Promise; - length(callback: (err: any, numberOfKeys: number) => void): void; - - key(keyIndex: number): Promise; - key(keyIndex: number, callback: (err: any, key: string) => void): void; - - keys(): Promise; - keys(callback: (err: any, keys: string[]) => void): void; - - iterate(iteratee: (value: any, key: string, iterationNumber: number) => any): Promise; - iterate(iteratee: (value: any, key: string, iterationNumber: number) => any, - callback: (err: any, result: any) => void): void; -} - -interface LocalForageDriverSupportFunc { - (): Promise; -} - -interface LocalForageDriver extends LocalForageDbMethods { - _driver: string; - - _initStorage(options: LocalForageOptions): void; - - _support?: boolean | LocalForageDriverSupportFunc; -} - -interface LocalForageSerializer { - serialize(value: T | ArrayBuffer | Blob, callback: (value: string, error: any) => void): void; - - deserialize(value: string): T | ArrayBuffer | Blob; - - stringToBuffer(serializedString: string): ArrayBuffer; - - bufferToString(buffer: ArrayBuffer): string; -} - -interface LocalForage extends LocalForageDbMethods { - LOCALSTORAGE: string; - WEBSQL: string; - INDEXEDDB: string; - - /** - * Set and persist localForage options. This must be called before any other calls to localForage are made, but can be called after localForage is loaded. - * If you set any config values with this method they will persist after driver changes, so you can call config() then setDriver() - * @param {LocalForageOptions} options? - */ - config(options: LocalForageOptions): boolean; - - /** - * Create a new instance of localForage to point to a different store. - * All the configuration options used by config are supported. - * @param {LocalForageOptions} options - */ - createInstance(options: LocalForageOptions): LocalForage; - - driver(): string; - /** - * Force usage of a particular driver or drivers, if available. - * @param {string} driver - */ - setDriver(driver: string | string[]): Promise; - setDriver(driver: string | string[], callback: () => void, errorCallback: (error: any) => void): void; - defineDriver(driver: LocalForageDriver): Promise; - defineDriver(driver: LocalForageDriver, callback: () => void, errorCallback: (error: any) => void): void; - /** - * Return a particular driver - * @param {string} driver - */ - getDriver(driver: string): Promise; - - getSerializer(): Promise; - getSerializer(callback: (serializer: LocalForageSerializer) => void): void; - - supports(driverName: string): boolean; - - ready(callback: () => void): void; - ready(): Promise; -} - -declare module "localforage" { - let localforage: LocalForage; - export = localforage; -} diff --git a/localforage/localforage-tests.ts b/localforage/localforage-tests.ts deleted file mode 100644 index e3edeba2d0..0000000000 --- a/localforage/localforage-tests.ts +++ /dev/null @@ -1,117 +0,0 @@ - - -declare let localForage: LocalForage; - -namespace LocalForageTest { - localForage.clear((err: any) => { - let newError: any = err; - }); - - localForage.iterate((str: string, key: string, num: number) => { - let newStr: string = str; - let newKey: string = key; - let newNum: number = num; - }); - - localForage.length((err: any, num: number) => { - let newError: any = err; - let newNumber: number = num; - }); - - localForage.length().then((num: number) => { - var newNumber: number = num; - }); - - localForage.key(0, (err: any, value: string) => { - let newError: any = err; - let newValue: string = value; - }); - - localForage.keys((err: any, keys: Array) => { - let newError: any = err; - let newArray: Array = keys; - }); - - localForage.keys().then((keys: Array) => { - var newArray: Array = keys; - }); - - localForage.getItem("key",(err: any, str: string) => { - let newError: any = err; - let newStr: string = str - }); - - localForage.getItem("key").then((str: string) => { - let newStr: string = str; - }); - - localForage.setItem("key", "value",(err: any, str: string) => { - let newError: any = err; - let newStr: string = str - }); - - localForage.setItem("key", "value").then((str: string) => { - let newStr: string = str; - }); - - localForage.removeItem("key",(err: any) => { - let newError: any = err; - }); - - localForage.removeItem("key").then(() => { - }); - - localForage.getDriver("CustomDriver").then((result: LocalForageDriver) => { - var driver: LocalForageDriver = result; - // we need to use a variable for proper type guards before TS 2.0 - var _support = driver._support; - if (typeof _support === "function") { - // _support = _support.bind(driver); - _support().then((result: boolean) => { - let doesSupport: boolean = result; - }); - } else if (typeof _support === "boolean") { - let doesSupport: boolean = _support; - } - }); - - { - let config: boolean; - - config = localForage.config({ - name: "testyo", - driver: localForage.LOCALSTORAGE - }); - } - - { - let store: LocalForage; - - store = localForage.createInstance({ - name: "da instance", - driver: localForage.LOCALSTORAGE - }); - } - - { - let testSerializer: LocalForageSerializer; - - localForage.getSerializer() - .then((serializer: LocalForageSerializer) => { - testSerializer = serializer; - }); - - localForage.getSerializer((serializer: LocalForageSerializer) => { - testSerializer = serializer; - }); - } - - { - let store: LocalForage; - - store.ready() - .then(() => {}); - - store.ready(() => {}); - } -} \ No newline at end of file diff --git a/localforage/package.json b/localforage/package.json new file mode 100644 index 0000000000..29f45814b2 --- /dev/null +++ b/localforage/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "localforage": ">=1.5.0" + } +} diff --git a/localforage/tsconfig.json b/localforage/tsconfig.json deleted file mode 100644 index 1e3cbf9e63..0000000000 --- a/localforage/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "localforage-tests.ts" - ] -} \ No newline at end of file diff --git a/notNeededPackages.json b/notNeededPackages.json index 0cd56b96d1..bcdf36987a 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -305,6 +305,12 @@ "typingsPackageName": "gaea-model", "sourceRepoURL": "https://github.com/ascoders/gaea-model", "asOfVersion": "0.0.0" + }, + { + "libraryName": "localforage", + "typingsPackageName": "localforage", + "sourceRepoURL": "https://github.com/localForage/localForage", + "asOfVersion": "0.0.34" } ] -} +} \ No newline at end of file From a8059edc7aab2c3ac955fb6049209c102fd3db86 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Sat, 25 Feb 2017 12:55:26 -0500 Subject: [PATCH 020/276] placeId => placeid As per https://developers.google.com/places/web-service/details --- googlemaps/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googlemaps/index.d.ts b/googlemaps/index.d.ts index 06eba68a94..d4d0935717 100644 --- a/googlemaps/index.d.ts +++ b/googlemaps/index.d.ts @@ -2258,7 +2258,7 @@ declare namespace google.maps { } export interface PlaceDetailsRequest { - placeId: string; + placeid: string; } export interface PlaceGeometry { From 01ad861c95798ff83d7f5a05eefafd8bace185ac Mon Sep 17 00:00:00 2001 From: Diogo Sant'Ana Date: Sat, 25 Feb 2017 21:46:31 -0300 Subject: [PATCH 021/276] Update chart.js Chart constructor from v2.4.0 Version 2.4.0 new Chart constructor signature https://github.com/chartjs/Chart.js/commit/4a5b5a0e7eba85ca44f658375cb0c78e6af93e5c --- chart.js/index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chart.js/index.d.ts b/chart.js/index.d.ts index 08781f4463..d21fc3ec80 100644 --- a/chart.js/index.d.ts +++ b/chart.js/index.d.ts @@ -5,7 +5,10 @@ declare class Chart { static readonly Chart: typeof Chart; - constructor(context: CanvasRenderingContext2D | HTMLCanvasElement, options: Chart.ChartConfiguration); + constructor( + context: string | JQuery | CanvasRenderingContext2D | HTMLCanvasElement | string[] | CanvasRenderingContext2D[] | HTMLCanvasElement[], + options: Chart.ChartConfiguration + ); config: Chart.ChartConfiguration; data: Chart.ChartData; destroy: () => {}; From 279fcd17bcf56d08b1dfa423cf62381f5a1bf8f5 Mon Sep 17 00:00:00 2001 From: Diogo Sant'Ana Date: Sat, 25 Feb 2017 22:00:25 -0300 Subject: [PATCH 022/276] Added jquery import declaration --- chart.js/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chart.js/index.d.ts b/chart.js/index.d.ts index d21fc3ec80..c103ab40ec 100644 --- a/chart.js/index.d.ts +++ b/chart.js/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Alberto Nuti // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + declare class Chart { static readonly Chart: typeof Chart; constructor( From e45de33a3f658465e6c96a6b686eea9afc49757e Mon Sep 17 00:00:00 2001 From: Lukas Zech Date: Thu, 23 Feb 2017 15:32:05 +0100 Subject: [PATCH 023/276] Add generic parameter to Matchers --- jasmine/index.d.ts | 55 ++++-- jasmine/jasmine-tests.ts | 391 ++++++++++++++++++++------------------- 2 files changed, 233 insertions(+), 213 deletions(-) diff --git a/jasmine/index.d.ts b/jasmine/index.d.ts index 146ab55ad4..78fea75ec2 100644 --- a/jasmine/index.d.ts +++ b/jasmine/index.d.ts @@ -24,8 +24,9 @@ declare function afterEach(action: (done: DoneFn) => void, timeout?: number): vo declare function beforeAll(action: (done: DoneFn) => void, timeout?: number): void; declare function afterAll(action: (done: DoneFn) => void, timeout?: number): void; -declare function expect(spy: Function): jasmine.Matchers; -declare function expect(actual: any): jasmine.Matchers; +declare function expect>(actual: ArrayLike): jasmine.ArrayLikeMatchers; +declare function expect(actual: T): jasmine.Matchers; +declare function expect(spy: Function): jasmine.Matchers; declare function fail(e?: any): void; /** Action method that should be called when the async work is complete */ @@ -43,23 +44,33 @@ declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, t declare function waits(timeout?: number): void; declare namespace jasmine { + type Expected = T | ObjectContaining | Any | Spy; var clock: () => Clock; function any(aclass: any): Any; + function anything(): Any; + function arrayContaining(sample: any[]): ArrayContaining; function objectContaining(sample: Partial): ObjectContaining; function createSpy(name: string, originalFn?: Function): Spy; + function createSpyObj(baseName: string, methodNames: any[]): any; function createSpyObj(baseName: string, methodNames: any[]): T; + function pp(value: any): string; + function getEnv(): Env; + function addCustomEqualityTester(equalityTester: CustomEqualityTester): void; + function addMatchers(matchers: CustomMatcherFactories): void; + function stringMatching(str: string): Any; function stringMatching(str: RegExp): Any; - function formatErrorMsg(domain: string, usage: string) : (msg: string) => string + + function formatErrorMsg(domain: string, usage: string): (msg: string) => string interface Any { @@ -83,7 +94,7 @@ declare namespace jasmine { } interface ObjectContaining { - new (sample: Partial): T; + new (sample: Partial): Partial; jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean; jasmineToString(): string; @@ -150,7 +161,7 @@ declare namespace jasmine { currentSpec: Spec; - matchersClass: Matchers; + matchersClass: Matchers; version(): any; versionString(): string; @@ -224,12 +235,12 @@ declare namespace jasmine { passed(): boolean; } - interface MessageResult extends Result { + interface MessageResult extends Result { values: any; trace: Trace; } - interface ExpectationResult extends Result { + interface ExpectationResult extends Result { matcherName: string; passed(): boolean; expected: any; @@ -242,12 +253,13 @@ declare namespace jasmine { new (options: {random: boolean, seed: string}): any; random: boolean; seed: string; - sort(items: T[]) : T[]; + sort(items: T[]): T[]; } namespace errors { class ExpectationFailed extends Error { constructor(); + stack: any; } } @@ -255,7 +267,7 @@ declare namespace jasmine { interface TreeProcessor { new (attrs: any): any; execute: (done: Function) => void; - processTree() : any; + processTree(): any; } interface Trace { @@ -301,18 +313,18 @@ declare namespace jasmine { results(): NestedResults; } - interface Matchers { + interface Matchers { - new (env: Env, actual: any, spec: Env, isNot?: boolean): any; + new (env: Env, actual: T, spec: Env, isNot?: boolean): any; env: Env; - actual: any; + actual: T; spec: Env; isNot?: boolean; message(): any; - toBe(expected: any, expectationFailOutput?: any): boolean; - toEqual(expected: any, expectationFailOutput?: any): boolean; + toBe(expected: Expected, expectationFailOutput?: any): boolean; + toEqual(expected: Expected, expectationFailOutput?: any): boolean; toMatch(expected: string | RegExp, expectationFailOutput?: any): boolean; toBeDefined(expectationFailOutput?: any): boolean; toBeUndefined(expectationFailOutput?: any): boolean; @@ -332,11 +344,18 @@ declare namespace jasmine { toThrow(expected?: any): boolean; toThrowError(message?: string | RegExp): boolean; toThrowError(expected?: new (...args: any[]) => Error, message?: string | RegExp): boolean; - not: Matchers; + not: Matchers; Any: Any; } + interface ArrayLikeMatchers> extends Matchers { + toBe(expected: Expected>, expectationFailOutput?: any): boolean; + toEqual(expected: Expected>, expectationFailOutput?: any): boolean; + toContain(expected: T, expectationFailOutput?: any): boolean; + not: ArrayLikeMatchers; + } + interface Reporter { reportRunnerStarting(runner: Runner): void; reportRunnerResults(runner: Runner): void; @@ -433,7 +452,7 @@ declare namespace jasmine { spies_: Spy[]; results_: NestedResults; - matchersClass: Matchers; + matchersClass: Matchers; getFullName(): string; results(): NestedResults; @@ -446,7 +465,7 @@ declare namespace jasmine { waits(timeout: number): Spec; waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec; fail(e?: any): void; - getMatchersClass_(): Matchers; + getMatchersClass_(): Matchers; addMatchers(matchersPrototype: CustomMatcherFactories): void; finishCallback(): void; finish(onComplete?: () => void): void; @@ -494,7 +513,7 @@ declare namespace jasmine { identity: string; and: SpyAnd; calls: Calls; - mostRecentCall: { args: any[]; }; + mostRecentCall: {args: any[];}; argsForCall: any[]; } diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts index 13d80af9db..f841a613c5 100644 --- a/jasmine/jasmine-tests.ts +++ b/jasmine/jasmine-tests.ts @@ -1,34 +1,34 @@ // tests based on http://jasmine.github.io/2.2/introduction.html -describe("A suite", function () { - it("contains spec with an expectation", function () { +describe("A suite", function() { + it("contains spec with an expectation", function() { expect(true).toBe(true); }); }); -describe("A suite is just a function", function () { +describe("A suite is just a function", function() { var a: boolean; - it("and so is a spec", function () { + it("and so is a spec", function() { a = true; expect(a).toBe(true); }); }); -describe("The 'toBe' matcher compares with ===", function () { +describe("The 'toBe' matcher compares with ===", function() { - it("and has a positive case", function () { + it("and has a positive case", function() { expect(true).toBe(true); }); - it("and can have a negative case", function () { + it("and can have a negative case", function() { expect(false).not.toBe(true); }); }); -describe("Included matchers:", function () { +describe("Included matchers:", function() { - it("The 'toBe' matcher compares with ===", function () { + it("The 'toBe' matcher compares with ===", function() { var a = 12; var b = a; @@ -36,14 +36,14 @@ describe("Included matchers:", function () { expect(a).not.toBe(null); }); - describe("The 'toEqual' matcher", function () { + describe("The 'toEqual' matcher", function() { - it("works for simple literals and variables", function () { + it("works for simple literals and variables", function() { var a = 12; expect(a).toEqual(12); }); - it("should work for objects", function () { + it("should work for objects", function() { var foo = { a: 12, b: 34 @@ -56,7 +56,7 @@ describe("Included matchers:", function () { }); }); - it("The 'toMatch' matcher is for regular expressions", function () { + it("The 'toMatch' matcher is for regular expressions", function() { var message = "foo bar baz"; expect(message).toMatch(/bar/); @@ -64,7 +64,7 @@ describe("Included matchers:", function () { expect(message).not.toMatch(/quux/); }); - it("The 'toBeDefined' matcher compares against `undefined`", function () { + it("The 'toBeDefined' matcher compares against `undefined`", function() { var a = { foo: "foo" }; @@ -73,16 +73,16 @@ describe("Included matchers:", function () { expect((a).bar).not.toBeDefined(); }); - it("The `toBeUndefined` matcher compares against `undefined`", function () { + it("The `toBeUndefined` matcher compares against `undefined`", function() { var a = { foo: "foo" }; expect(a.foo).not.toBeUndefined(); - expect((a).bar).toBeUndefined(); + expect((a as any).bar).toBeUndefined(); }); - it("The 'toBeNull' matcher compares against null", function () { + it("The 'toBeNull' matcher compares against null", function() { var a: string = null; var foo = "foo"; @@ -91,28 +91,28 @@ describe("Included matchers:", function () { expect(foo).not.toBeNull(); }); - it("The 'toBeTruthy' matcher is for boolean casting testing", function () { + it("The 'toBeTruthy' matcher is for boolean casting testing", function() { var a: string, foo = "foo"; expect(foo).toBeTruthy(); expect(a).not.toBeTruthy(); }); - it("The 'toBeFalsy' matcher is for boolean casting testing", function () { + it("The 'toBeFalsy' matcher is for boolean casting testing", function() { var a: string, foo = "foo"; expect(a).toBeFalsy(); expect(foo).not.toBeFalsy(); }); - it("The 'toContain' matcher is for finding an item in an Array", function () { + it("The 'toContain' matcher is for finding an item in an Array", function() { var a = ["foo", "bar", "baz"]; - expect(a).toContain("bar"); + expect(a).toContain('foo'); expect(a).not.toContain("quux"); }); - it("The 'toBeLessThan' matcher is for mathematical comparisons", function () { + it("The 'toBeLessThan' matcher is for mathematical comparisons", function() { var pi = 3.1415926, e = 2.78; @@ -120,7 +120,7 @@ describe("Included matchers:", function () { expect(pi).not.toBeLessThan(e); }); - it("The 'toBeGreaterThan' is for mathematical comparisons", function () { + it("The 'toBeGreaterThan' is for mathematical comparisons", function() { var pi = 3.1415926, e = 2.78; @@ -128,7 +128,7 @@ describe("Included matchers:", function () { expect(e).not.toBeGreaterThan(pi); }); - it("The 'toBeCloseTo' matcher is for precision math comparison", function () { + it("The 'toBeCloseTo' matcher is for precision math comparison", function() { var pi = 3.1415926, e = 2.78; @@ -136,11 +136,11 @@ describe("Included matchers:", function () { expect(pi).toBeCloseTo(e, 0); }); - it("The 'toThrow' matcher is for testing if a function throws an exception", function () { - var foo = function () { + it("The 'toThrow' matcher is for testing if a function throws an exception", function() { + var foo = function() { return 1 + 2; }; - var bar = function () { + var bar = function() { var a: any = undefined; return a + 1; }; @@ -161,15 +161,15 @@ describe("Included matchers:", function () { }); }); -describe("A spec", function () { - it("is just a function, so it can contain any code", function () { +describe("A spec", function() { + it("is just a function, so it can contain any code", function() { var foo = 0; foo += 1; expect(foo).toEqual(1); }); - it("can have more than one expectation", function () { + it("can have more than one expectation", function() { var foo = 0; foo += 1; @@ -178,94 +178,94 @@ describe("A spec", function () { }); }); -describe("A spec (with setup and tear-down)", function () { +describe("A spec (with setup and tear-down)", function() { var foo: number; - beforeEach(function () { + beforeEach(function() { foo = 0; foo += 1; }); - afterEach(function () { + afterEach(function() { foo = 0; }); - it("is just a function, so it can contain any code", function () { + it("is just a function, so it can contain any code", function() { expect(foo).toEqual(1); }); - it("can have more than one expectation", function () { + it("can have more than one expectation", function() { expect(foo).toEqual(1); expect(true).toEqual(true); }); }); -describe("A spec", function () { +describe("A spec", function() { var foo: number; - beforeEach(function () { + beforeEach(function() { foo = 0; foo += 1; }); - afterEach(function () { + afterEach(function() { foo = 0; }); - it("is just a function, so it can contain any code", function () { + it("is just a function, so it can contain any code", function() { expect(foo).toEqual(1); }); - it("can have more than one expectation", function () { + it("can have more than one expectation", function() { expect(foo).toEqual(1); expect(true).toEqual(true); }); - describe("nested inside a second describe", function () { + describe("nested inside a second describe", function() { var bar: number; - beforeEach(function () { + beforeEach(function() { bar = 1; }); - it("can reference both scopes as needed", function () { + it("can reference both scopes as needed", function() { expect(foo).toEqual(bar); }); }); }); -xdescribe("A spec", function () { +xdescribe("A spec", function() { var foo: number; - beforeEach(function () { + beforeEach(function() { foo = 0; foo += 1; }); - it("is just a function, so it can contain any code", function () { + it("is just a function, so it can contain any code", function() { expect(foo).toEqual(1); }); }); -describe("Pending specs", function () { +describe("Pending specs", function() { - xit("can be declared 'xit'", function () { + xit("can be declared 'xit'", function() { expect(true).toBe(false); }); it("can be declared with 'it' but without a function"); - it("can be declared by calling 'pending' in the spec body", function () { + it("can be declared by calling 'pending' in the spec body", function() { expect(true).toBe(false); pending(); // without reason pending('this is why it is pending'); }); }); -describe("A spy", function () { +describe("A spy", function() { var foo: any, bar: any = null; - beforeEach(function () { + beforeEach(function() { foo = { setBar: function (value: any) { bar = value; @@ -278,29 +278,29 @@ describe("A spy", function () { foo.setBar(456, 'another param'); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", function() { expect(foo.setBar).toHaveBeenCalled(); }); - it("tracks all the arguments of its calls", function () { + it("tracks all the arguments of its calls", function() { expect(foo.setBar).toHaveBeenCalledWith(123); expect(foo.setBar).toHaveBeenCalledWith(456, 'another param'); }); - it("stops all execution on a function", function () { + it("stops all execution on a function", function() { expect(bar).toBeNull(); }); }); -describe("A spy, when configured to call through", function () { +describe("A spy, when configured to call through", function() { var foo: any, bar: any, fetchedBar: any; - beforeEach(function () { + beforeEach(function() { foo = { setBar: function (value: any) { bar = value; }, - getBar: function () { + getBar: function() { return bar; } }; @@ -311,28 +311,28 @@ describe("A spy, when configured to call through", function () { fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", function() { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function () { + it("should not effect other functions", function() { expect(bar).toEqual(123); }); - it("when called returns the requested value", function () { + it("when called returns the requested value", function() { expect(fetchedBar).toEqual(123); }); }); -describe("A spy, when configured to fake a return value", function () { +describe("A spy, when configured to fake a return value", function() { var foo: any, bar: any, fetchedBar: any; - beforeEach(function () { + beforeEach(function() { foo = { setBar: function (value: any) { bar = value; }, - getBar: function () { + getBar: function() { return bar; } }; @@ -343,15 +343,15 @@ describe("A spy, when configured to fake a return value", function () { fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", function() { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function () { + it("should not effect other functions", function() { expect(bar).toEqual(123); }); - it("when called returns the requested value", function () { + it("when called returns the requested value", function() { expect(fetchedBar).toEqual(745); }); }); @@ -361,7 +361,7 @@ describe("A spy, when configured to fake a series of return values", function() beforeEach(function() { foo = { - setBar: function(value: any) { + setBar: function (value: any) { bar = value; }, getBar: function() { @@ -390,20 +390,20 @@ describe("A spy, when configured to fake a series of return values", function() }); }); -describe("A spy, when configured with an alternate implementation", function () { +describe("A spy, when configured with an alternate implementation", function() { var foo: any, bar: any, fetchedBar: any; - beforeEach(function () { + beforeEach(function() { foo = { setBar: function (value: any) { bar = value; }, - getBar: function () { + getBar: function() { return bar; } }; - spyOn(foo, "getBar").and.callFake(function () { + spyOn(foo, "getBar").and.callFake(function() { return 1001; }); @@ -411,23 +411,23 @@ describe("A spy, when configured with an alternate implementation", function () fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", function() { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function () { + it("should not effect other functions", function() { expect(bar).toEqual(123); }); - it("when called returns the requested value", function () { + it("when called returns the requested value", function() { expect(fetchedBar).toEqual(1001); }); }); -describe("A spy, when configured to throw a value", function () { +describe("A spy, when configured to throw a value", function() { var foo: any, bar: any; - beforeEach(function () { + beforeEach(function() { foo = { setBar: function (value: any) { bar = value; @@ -437,55 +437,55 @@ describe("A spy, when configured to throw a value", function () { spyOn(foo, "setBar").and.throwError("quux"); }); - it("throws the value", function () { - expect(function () { + it("throws the value", function() { + expect(function() { foo.setBar(123) - }).toThrowError("quux"); + }).toThrowError("quux"); }); }); -describe("A spy, when configured with multiple actions", function () { +describe("A spy, when configured with multiple actions", function() { var foo: any, bar: any, fetchedBar: any; - beforeEach(function () { + beforeEach(function() { foo = { setBar: function (value: any) { bar = value; }, - getBar: function () { + getBar: function() { return bar; } }; spyOn(foo, 'getBar').and.callThrough().and.callFake(() => { - this.fakeCalled = true; + this.fakeCalled = true; }); foo.setBar(123); fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", function() { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function () { + it("should not effect other functions", function() { expect(bar).toEqual(123); }); - it("when called returns the requested value", function () { + it("when called returns the requested value", function() { expect(fetchedBar).toEqual(123); }); - it("should have called the fake implementation", function () { + it("should have called the fake implementation", function() { expect(this.fakeCalled).toEqual(true); }); }); -describe("A spy", function () { +describe("A spy", function() { var foo: any, bar: any = null; - beforeEach(function () { + beforeEach(function() { foo = { setBar: function (value: any) { bar = value; @@ -495,7 +495,7 @@ describe("A spy", function () { spyOn(foo, 'setBar').and.callThrough(); }); - it("can call through and then stub in the same spec", function () { + it("can call through and then stub in the same spec", function() { foo.setBar(123); expect(bar).toEqual(123); @@ -507,10 +507,10 @@ describe("A spy", function () { }); }); -describe("A spy", function () { +describe("A spy", function() { var foo: any, bar: any = null; - beforeEach(function () { + beforeEach(function() { foo = { setBar: function (value: any) { bar = value; @@ -520,7 +520,7 @@ describe("A spy", function () { spyOn(foo, 'setBar'); }); - it("tracks if it was called at all", function () { + it("tracks if it was called at all", function() { expect(foo.setBar.calls.any()).toEqual(false); foo.setBar(); @@ -528,7 +528,7 @@ describe("A spy", function () { expect(foo.setBar.calls.any()).toEqual(true); }); - it("tracks the number of times it was called", function () { + it("tracks the number of times it was called", function() { expect(foo.setBar.calls.count()).toEqual(0); foo.setBar(); @@ -537,7 +537,7 @@ describe("A spy", function () { expect(foo.setBar.calls.count()).toEqual(2); }); - it("tracks the arguments of each call", function () { + it("tracks the arguments of each call", function() { foo.setBar(123); foo.setBar(456, "baz"); @@ -545,34 +545,34 @@ describe("A spy", function () { expect(foo.setBar.calls.argsFor(1)).toEqual([456, "baz"]); }); - it("tracks the arguments of all calls", function () { + it("tracks the arguments of all calls", function() { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.allArgs()).toEqual([[123], [456, "baz"]]); }); - it("can provide the context and arguments to all calls", function () { + it("can provide the context and arguments to all calls", function() { foo.setBar(123); expect(foo.setBar.calls.all()).toEqual([{ object: foo, args: [123], returnValue: undefined }]); }); - it("has a shortcut to the most recent call", function () { + it("has a shortcut to the most recent call", function() { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.mostRecent()).toEqual({ object: foo, args: [456, "baz"], returnValue: undefined }); }); - it("has a shortcut to the first call", function () { + it("has a shortcut to the first call", function() { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.first()).toEqual({ object: foo, args: [123], returnValue: undefined }); }); - it("can be reset", function () { + it("can be reset", function() { foo.setBar(123); foo.setBar(456, "baz"); @@ -584,40 +584,40 @@ describe("A spy", function () { }); }); -describe("A spy, when created manually", function () { +describe("A spy, when created manually", function() { var whatAmI: any; - beforeEach(function () { + beforeEach(function() { whatAmI = jasmine.createSpy('whatAmI'); whatAmI("I", "am", "a", "spy"); }); - it("is named, which helps in error reporting", function () { + it("is named, which helps in error reporting", function() { expect(whatAmI.and.identity()).toEqual('whatAmI'); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", function() { expect(whatAmI).toHaveBeenCalled(); }); - it("tracks its number of calls", function () { + it("tracks its number of calls", function() { expect(whatAmI.calls.count()).toEqual(1); }); - it("tracks all the arguments of its calls", function () { + it("tracks all the arguments of its calls", function() { expect(whatAmI).toHaveBeenCalledWith("I", "am", "a", "spy"); }); - it("allows access to the most recent call", function () { + it("allows access to the most recent call", function() { expect(whatAmI.calls.mostRecent().args[0]).toEqual("I"); }); }); -describe("Multiple spies, when created manually", function () { +describe("Multiple spies, when created manually", function() { var tape: any; - beforeEach(function () { + beforeEach(function() { tape = jasmine.createSpyObj('tape', ['play', 'pause', 'stop', 'rewind']); tape.play(); @@ -625,35 +625,35 @@ describe("Multiple spies, when created manually", function () { tape.rewind(0); }); - it("creates spies for each requested function", function () { + it("creates spies for each requested function", function() { expect(tape.play).toBeDefined(); expect(tape.pause).toBeDefined(); expect(tape.stop).toBeDefined(); expect(tape.rewind).toBeDefined(); }); - it("tracks that the spies were called", function () { + it("tracks that the spies were called", function() { expect(tape.play).toHaveBeenCalled(); expect(tape.pause).toHaveBeenCalled(); expect(tape.rewind).toHaveBeenCalled(); expect(tape.stop).not.toHaveBeenCalled(); }); - it("tracks all the arguments of its calls", function () { + it("tracks all the arguments of its calls", function() { expect(tape.rewind).toHaveBeenCalledWith(0); }); }); -describe("jasmine.any", function () { - it("matches any value", function () { +describe("jasmine.any", function() { + it("matches any value", function() { expect({}).toEqual(jasmine.any(Object)); expect(12).toEqual(jasmine.any(Number)); }); - describe("when used with a spy", function () { - it("is useful for comparing arguments", function () { + describe("when used with a spy", function() { + it("is useful for comparing arguments", function() { var foo = jasmine.createSpy('foo'); - foo(12, function () { + foo(12, function() { return true; }); @@ -662,15 +662,15 @@ describe("jasmine.any", function () { }); }); -describe("jasmine.objectContaining", function () { +describe("jasmine.objectContaining", function() { interface fooType { - a:number; - b:number; - bar:string; + a: number; + b: number; + bar: string; } var foo: fooType; - beforeEach(function () { + beforeEach(function() { foo = { a: 1, b: 2, @@ -678,17 +678,18 @@ describe("jasmine.objectContaining", function () { }; }); - it("matches objects with the expect key/value pairs", function () { + it("matches objects with the expect key/value pairs", function() { expect(foo).toEqual(jasmine.objectContaining({ - bar: "baz" + bar: '' })); - expect(foo).not.toEqual(jasmine.objectContaining({ + + expect(foo).not.toEqual(jasmine.objectContaining({ a: 37 })); }); - describe("when used with a spy", function () { - it("is useful for comparing arguments", function () { + describe("when used with a spy", function() { + it("is useful for comparing arguments", function() { var callback = jasmine.createSpy('callback'); callback({ @@ -706,43 +707,43 @@ describe("jasmine.objectContaining", function () { }); describe("jasmine.arrayContaining", function() { - var foo: any; + var foo: any; - beforeEach(function() { - foo = [1, 2, 3, 4]; - }); + beforeEach(function() { + foo = [1, 2, 3, 4]; + }); - it("matches arrays with some of the values", function() { - expect(foo).toEqual(jasmine.arrayContaining([3, 1])); - expect(foo).not.toEqual(jasmine.arrayContaining([6])); - }); + it("matches arrays with some of the values", function() { + expect(foo).toEqual(jasmine.arrayContaining([3, 1])); + expect(foo).not.toEqual(jasmine.arrayContaining([6])); + }); - describe("when used with a spy", function() { - it("is useful when comparing arguments", function() { - var callback = jasmine.createSpy('callback'); + describe("when used with a spy", function() { + it("is useful when comparing arguments", function() { + var callback = jasmine.createSpy('callback'); - callback([1, 2, 3, 4]); + callback([1, 2, 3, 4]); - expect(callback).toHaveBeenCalledWith(jasmine.arrayContaining([4, 2, 3])); - expect(callback).not.toHaveBeenCalledWith(jasmine.arrayContaining([5, 2])); + expect(callback).toHaveBeenCalledWith(jasmine.arrayContaining([4, 2, 3])); + expect(callback).not.toHaveBeenCalledWith(jasmine.arrayContaining([5, 2])); + }); }); - }); }); -describe("Manually ticking the Jasmine Clock", function () { +describe("Manually ticking the Jasmine Clock", function() { var timerCallback: any; - beforeEach(function () { + beforeEach(function() { timerCallback = jasmine.createSpy("timerCallback"); jasmine.clock().install(); }); - afterEach(function () { + afterEach(function() { jasmine.clock().uninstall(); }); - it("causes a timeout to be called synchronously", function () { - setTimeout(function () { + it("causes a timeout to be called synchronously", function() { + setTimeout(function() { timerCallback(); }, 100); @@ -753,8 +754,8 @@ describe("Manually ticking the Jasmine Clock", function () { expect(timerCallback).toHaveBeenCalled(); }); - it("causes an interval to be called synchronously", function () { - setInterval(function () { + it("causes an interval to be called synchronously", function() { + setInterval(function() { timerCallback(); }, 100); @@ -770,7 +771,7 @@ describe("Manually ticking the Jasmine Clock", function () { expect(timerCallback.calls.count()).toEqual(2); }); - describe("Mocking the Date object", function(){ + describe("Mocking the Date object", function() { it("mocks the Date object and sets it to a given time", function() { var baseTime = new Date(2013, 9, 23); @@ -782,10 +783,10 @@ describe("Manually ticking the Jasmine Clock", function () { }); }); -describe("Asynchronous specs", function () { +describe("Asynchronous specs", function() { var value: number; beforeEach(function (done: DoneFn) { - setTimeout(function () { + setTimeout(function() { value = 0; done(); }, 1); @@ -798,42 +799,42 @@ describe("Asynchronous specs", function () { }); describe("long asynchronous specs", function() { - beforeEach(function(done: DoneFn) { - done(); + beforeEach(function (done: DoneFn) { + done(); }, 1000); - it("takes a long time", function(done: DoneFn) { - setTimeout(function() { - done(); - }, 9000); + it("takes a long time", function (done: DoneFn) { + setTimeout(function() { + done(); + }, 9000); }, 10000); - afterEach(function(done: DoneFn) { - done(); + afterEach(function (done: DoneFn) { + done(); }, 1000); }); }); -describe("Fail", function () { +describe("Fail", function() { - it("should fail test when called without arguments", function () { - fail(); - }); + it("should fail test when called without arguments", function() { + fail(); + }); - it("should fail test when called with a fail message", function () { - fail("The test failed"); - }); + it("should fail test when called with a fail message", function() { + fail("The test failed"); + }); - it("should fail test when called an error", function () { - fail(new Error("The test failed with this error")); - }); + it("should fail test when called an error", function() { + fail(new Error("The test failed with this error")); + }); }); // test based on http://jasmine.github.io/2.2/custom_equality.html describe("custom equality", function() { - var myCustomEquality: jasmine.CustomEqualityTester = function(first: any, second: any): boolean { + var myCustomEquality: jasmine.CustomEqualityTester = function (first: any, second: any): boolean { if (typeof first == "string" && typeof second == "string") { return first[0] == second[1]; } @@ -886,29 +887,29 @@ var customMatchers: jasmine.CustomMatcherFactories = { // } // } declare namespace jasmine { - interface Matchers { - toBeGoofy(expected?: any): boolean; + interface Matchers { + toBeGoofy(expected?: jasmine.Expected): boolean; } } -describe("Custom matcher: 'toBeGoofy'", function () { - beforeEach(function () { +describe("Custom matcher: 'toBeGoofy'", function() { + beforeEach(function() { jasmine.addMatchers(customMatchers); }); - it("is available on an expectation", function () { + it("is available on an expectation", function() { expect({ hyuk: 'gawrsh' }).toBeGoofy(); }); - it("can take an 'expected' parameter", function () { + it("can take an 'expected' parameter", function() { expect({ hyuk: 'gawrsh is fun' - }).toBeGoofy(' is fun'); + }).toBeGoofy({ hyuk: ' is fun' }); }); - it("can be negated", function () { + it("can be negated", function() { expect({ hyuk: 'this is fun' }).not.toBeGoofy(); @@ -917,7 +918,7 @@ describe("Custom matcher: 'toBeGoofy'", function () { // test based on http://jasmine.github.io/2.5/custom_reporter.html var myReporter: jasmine.CustomReporter = { - jasmineStarted: function (suiteInfo: jasmine.SuiteInfo ) { + jasmineStarted: function (suiteInfo: jasmine.SuiteInfo) { console.log("Running suite with " + suiteInfo.totalSpecsDefined); }, @@ -948,7 +949,7 @@ var myReporter: jasmine.CustomReporter = { } }, - jasmineDone: function(runDetails: jasmine.RunDetails) { + jasmineDone: function (runDetails: jasmine.RunDetails) { console.log('Finished suite'); console.log('Random:', runDetails.order.random); } @@ -957,20 +958,20 @@ var myReporter: jasmine.CustomReporter = { jasmine.getEnv().addReporter(myReporter); describe("Randomize Tests", function() { - it("should allow randomization of the order of tests", function() { - expect(function() { - var env = jasmine.getEnv(); - return env.randomizeTests(true); - }).not.toThrow(); - }); + it("should allow randomization of the order of tests", function() { + expect(function() { + var env = jasmine.getEnv(); + return env.randomizeTests(true); + }).not.toThrow(); + }); - it("should allow a seed to be passed in for randomization", function() { - expect(function() { - var env = jasmine.getEnv(); - env.randomizeTests(true); - return env.seed(1234); - }).not.toThrow(); - }); + it("should allow a seed to be passed in for randomization", function() { + expect(function() { + var env = jasmine.getEnv(); + env.randomizeTests(true); + return env.seed(1234); + }).not.toThrow(); + }); }); (() => { @@ -986,7 +987,7 @@ describe("Randomize Tests", function() { }; var currentWindowOnload = window.onload; - window.onload = function () { + window.onload = function() { if (currentWindowOnload) { (currentWindowOnload)(null); } From 5d864d9772c27269b06f0ecccc2cd88e98af9428 Mon Sep 17 00:00:00 2001 From: Lukas Zech Date: Sun, 26 Feb 2017 12:29:39 +0100 Subject: [PATCH 024/276] Fix linter errors --- jasmine/index.d.ts | 34 ++-- jasmine/jasmine-tests.ts | 386 ++++++++++++++++++------------------ jasmine/v1/jasmine-tests.ts | 22 +- 3 files changed, 219 insertions(+), 223 deletions(-) diff --git a/jasmine/index.d.ts b/jasmine/index.d.ts index 78fea75ec2..03c1e30c78 100644 --- a/jasmine/index.d.ts +++ b/jasmine/index.d.ts @@ -70,7 +70,7 @@ declare namespace jasmine { function stringMatching(str: string): Any; function stringMatching(str: RegExp): Any; - function formatErrorMsg(domain: string, usage: string): (msg: string) => string + function formatErrorMsg(domain: string, usage: string): (msg: string) => string; interface Any { @@ -124,18 +124,14 @@ declare namespace jasmine { withMock(func: () => void): void; } - interface CustomEqualityTester { - (first: any, second: any): boolean; - } + type CustomEqualityTester = (first: any, second: any) => boolean; interface CustomMatcher { compare(actual: T, expected: T): CustomMatcherResult; compare(actual: any, expected: any): CustomMatcherResult; } - interface CustomMatcherFactory { - (util: MatchersUtil, customEqualityTesters: Array): CustomMatcher; - } + type CustomMatcherFactory = (util: MatchersUtil, customEqualityTesters: CustomEqualityTester[]) => CustomMatcher; interface CustomMatcherFactories { [index: string]: CustomMatcherFactory; @@ -147,9 +143,9 @@ declare namespace jasmine { } interface MatchersUtil { - equals(a: any, b: any, customTesters?: Array): boolean; - contains(haystack: ArrayLike | string, needle: any, customTesters?: Array): boolean; - buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: Array): string; + equals(a: any, b: any, customTesters?: CustomEqualityTester[]): boolean; + contains(haystack: ArrayLike | string, needle: any, customTesters?: CustomEqualityTester[]): boolean; + buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: any[]): string; } interface Env { @@ -390,18 +386,18 @@ declare namespace jasmine { } interface CustomReporterResult { - description: string, - failedExpectations?: FailedExpectation[], - fullName: string, + description: string; + failedExpectations?: FailedExpectation[]; + fullName: string; id: string; - passedExpectations?: PassedExpectation[], + passedExpectations?: PassedExpectation[]; pendingReason?: string; status?: string; } interface RunDetails { failedExpectations: ExpectationResult[]; - order: jasmine.Order + order: jasmine.Order; } interface CustomReporter { @@ -431,9 +427,7 @@ declare namespace jasmine { results(): NestedResults; } - interface SpecFunction { - (spec?: Spec): void; - } + type SpecFunction = (spec?: Spec) => void; interface SuiteOrSpec { id: number; @@ -513,7 +507,7 @@ declare namespace jasmine { identity: string; and: SpyAnd; calls: Calls; - mostRecentCall: {args: any[];}; + mostRecentCall: {args: any[]; }; argsForCall: any[]; } @@ -574,7 +568,7 @@ declare namespace jasmine { finished: boolean; result: any; messages: any; - runDetails: RunDetails + runDetails: RunDetails; new (): any; diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts index f841a613c5..e80060510b 100644 --- a/jasmine/jasmine-tests.ts +++ b/jasmine/jasmine-tests.ts @@ -1,34 +1,34 @@ // tests based on http://jasmine.github.io/2.2/introduction.html -describe("A suite", function() { - it("contains spec with an expectation", function() { +describe("A suite", () => { + it("contains spec with an expectation", () => { expect(true).toBe(true); }); }); -describe("A suite is just a function", function() { +describe("A suite is just a function", () => { var a: boolean; - it("and so is a spec", function() { + it("and so is a spec", () => { a = true; expect(a).toBe(true); }); }); -describe("The 'toBe' matcher compares with ===", function() { +describe("The 'toBe' matcher compares with ===", () => { - it("and has a positive case", function() { + it("and has a positive case", () => { expect(true).toBe(true); }); - it("and can have a negative case", function() { + it("and can have a negative case", () => { expect(false).not.toBe(true); }); }); -describe("Included matchers:", function() { +describe("Included matchers:", () => { - it("The 'toBe' matcher compares with ===", function() { + it("The 'toBe' matcher compares with ===", () => { var a = 12; var b = a; @@ -36,14 +36,14 @@ describe("Included matchers:", function() { expect(a).not.toBe(null); }); - describe("The 'toEqual' matcher", function() { + describe("The 'toEqual' matcher", () => { - it("works for simple literals and variables", function() { + it("works for simple literals and variables", () => { var a = 12; expect(a).toEqual(12); }); - it("should work for objects", function() { + it("should work for objects", () => { var foo = { a: 12, b: 34 @@ -56,7 +56,7 @@ describe("Included matchers:", function() { }); }); - it("The 'toMatch' matcher is for regular expressions", function() { + it("The 'toMatch' matcher is for regular expressions", () => { var message = "foo bar baz"; expect(message).toMatch(/bar/); @@ -64,16 +64,16 @@ describe("Included matchers:", function() { expect(message).not.toMatch(/quux/); }); - it("The 'toBeDefined' matcher compares against `undefined`", function() { + it("The 'toBeDefined' matcher compares against `undefined`", () => { var a = { foo: "foo" }; expect(a.foo).toBeDefined(); - expect((a).bar).not.toBeDefined(); + expect((a as any).bar).not.toBeDefined(); }); - it("The `toBeUndefined` matcher compares against `undefined`", function() { + it("The `toBeUndefined` matcher compares against `undefined`", () => { var a = { foo: "foo" }; @@ -82,7 +82,7 @@ describe("Included matchers:", function() { expect((a as any).bar).toBeUndefined(); }); - it("The 'toBeNull' matcher compares against null", function() { + it("The 'toBeNull' matcher compares against null", () => { var a: string = null; var foo = "foo"; @@ -91,28 +91,28 @@ describe("Included matchers:", function() { expect(foo).not.toBeNull(); }); - it("The 'toBeTruthy' matcher is for boolean casting testing", function() { + it("The 'toBeTruthy' matcher is for boolean casting testing", () => { var a: string, foo = "foo"; expect(foo).toBeTruthy(); expect(a).not.toBeTruthy(); }); - it("The 'toBeFalsy' matcher is for boolean casting testing", function() { + it("The 'toBeFalsy' matcher is for boolean casting testing", () => { var a: string, foo = "foo"; expect(a).toBeFalsy(); expect(foo).not.toBeFalsy(); }); - it("The 'toContain' matcher is for finding an item in an Array", function() { + it("The 'toContain' matcher is for finding an item in an Array", () => { var a = ["foo", "bar", "baz"]; expect(a).toContain('foo'); expect(a).not.toContain("quux"); }); - it("The 'toBeLessThan' matcher is for mathematical comparisons", function() { + it("The 'toBeLessThan' matcher is for mathematical comparisons", () => { var pi = 3.1415926, e = 2.78; @@ -120,7 +120,7 @@ describe("Included matchers:", function() { expect(pi).not.toBeLessThan(e); }); - it("The 'toBeGreaterThan' is for mathematical comparisons", function() { + it("The 'toBeGreaterThan' is for mathematical comparisons", () => { var pi = 3.1415926, e = 2.78; @@ -128,7 +128,7 @@ describe("Included matchers:", function() { expect(e).not.toBeGreaterThan(pi); }); - it("The 'toBeCloseTo' matcher is for precision math comparison", function() { + it("The 'toBeCloseTo' matcher is for precision math comparison", () => { var pi = 3.1415926, e = 2.78; @@ -136,12 +136,12 @@ describe("Included matchers:", function() { expect(pi).toBeCloseTo(e, 0); }); - it("The 'toThrow' matcher is for testing if a function throws an exception", function() { - var foo = function() { + it("The 'toThrow' matcher is for testing if a function throws an exception", () => { + var foo = () => { return 1 + 2; }; - var bar = function() { - var a: any = undefined; + var bar = () => { + var a: any; return a + 1; }; @@ -149,8 +149,8 @@ describe("Included matchers:", function() { expect(bar).toThrow(); }); - it("The 'toThrowError' matcher is for testing a specific thrown exception", function() { - var foo = function() { + it("The 'toThrowError' matcher is for testing a specific thrown exception", () => { + var foo = () => { throw new TypeError("foo bar baz"); }; @@ -161,15 +161,15 @@ describe("Included matchers:", function() { }); }); -describe("A spec", function() { - it("is just a function, so it can contain any code", function() { +describe("A spec", () => { + it("is just a function, so it can contain any code", () => { var foo = 0; foo += 1; expect(foo).toEqual(1); }); - it("can have more than one expectation", function() { + it("can have more than one expectation", () => { var foo = 0; foo += 1; @@ -178,96 +178,96 @@ describe("A spec", function() { }); }); -describe("A spec (with setup and tear-down)", function() { +describe("A spec (with setup and tear-down)", () => { var foo: number; - beforeEach(function() { + beforeEach(() => { foo = 0; foo += 1; }); - afterEach(function() { + afterEach(() => { foo = 0; }); - it("is just a function, so it can contain any code", function() { + it("is just a function, so it can contain any code", () => { expect(foo).toEqual(1); }); - it("can have more than one expectation", function() { + it("can have more than one expectation", () => { expect(foo).toEqual(1); expect(true).toEqual(true); }); }); -describe("A spec", function() { +describe("A spec", () => { var foo: number; - beforeEach(function() { + beforeEach(() => { foo = 0; foo += 1; }); - afterEach(function() { + afterEach(() => { foo = 0; }); - it("is just a function, so it can contain any code", function() { + it("is just a function, so it can contain any code", () => { expect(foo).toEqual(1); }); - it("can have more than one expectation", function() { + it("can have more than one expectation", () => { expect(foo).toEqual(1); expect(true).toEqual(true); }); - describe("nested inside a second describe", function() { + describe("nested inside a second describe", () => { var bar: number; - beforeEach(function() { + beforeEach(() => { bar = 1; }); - it("can reference both scopes as needed", function() { + it("can reference both scopes as needed", () => { expect(foo).toEqual(bar); }); }); }); -xdescribe("A spec", function() { +xdescribe("A spec", () => { var foo: number; - beforeEach(function() { + beforeEach(() => { foo = 0; foo += 1; }); - it("is just a function, so it can contain any code", function() { + it("is just a function, so it can contain any code", () => { expect(foo).toEqual(1); }); }); -describe("Pending specs", function() { +describe("Pending specs", () => { - xit("can be declared 'xit'", function() { + xit("can be declared 'xit'", () => { expect(true).toBe(false); }); it("can be declared with 'it' but without a function"); - it("can be declared by calling 'pending' in the spec body", function() { + it("can be declared by calling 'pending' in the spec body", () => { expect(true).toBe(false); pending(); // without reason pending('this is why it is pending'); }); }); -describe("A spy", function() { +describe("A spy", () => { var foo: any, bar: any = null; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; } }; @@ -278,29 +278,29 @@ describe("A spy", function() { foo.setBar(456, 'another param'); }); - it("tracks that the spy was called", function() { + it("tracks that the spy was called", () => { expect(foo.setBar).toHaveBeenCalled(); }); - it("tracks all the arguments of its calls", function() { + it("tracks all the arguments of its calls", () => { expect(foo.setBar).toHaveBeenCalledWith(123); expect(foo.setBar).toHaveBeenCalledWith(456, 'another param'); }); - it("stops all execution on a function", function() { + it("stops all execution on a function", () => { expect(bar).toBeNull(); }); }); -describe("A spy, when configured to call through", function() { +describe("A spy, when configured to call through", () => { var foo: any, bar: any, fetchedBar: any; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, - getBar: function() { + getBar: () => { return bar; } }; @@ -311,28 +311,28 @@ describe("A spy, when configured to call through", function() { fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function() { + it("tracks that the spy was called", () => { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function() { + it("should not effect other functions", () => { expect(bar).toEqual(123); }); - it("when called returns the requested value", function() { + it("when called returns the requested value", () => { expect(fetchedBar).toEqual(123); }); }); -describe("A spy, when configured to fake a return value", function() { +describe("A spy, when configured to fake a return value", () => { var foo: any, bar: any, fetchedBar: any; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, - getBar: function() { + getBar: () => { return bar; } }; @@ -343,28 +343,28 @@ describe("A spy, when configured to fake a return value", function() { fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function() { + it("tracks that the spy was called", () => { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function() { + it("should not effect other functions", () => { expect(bar).toEqual(123); }); - it("when called returns the requested value", function() { + it("when called returns the requested value", () => { expect(fetchedBar).toEqual(745); }); }); -describe("A spy, when configured to fake a series of return values", function() { +describe("A spy, when configured to fake a series of return values", () => { var foo: any, bar: any; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, - getBar: function() { + getBar: () => { return bar; } }; @@ -374,36 +374,36 @@ describe("A spy, when configured to fake a series of return values", function() foo.setBar(123); }); - it("tracks that the spy was called", function() { + it("tracks that the spy was called", () => { foo.getBar(123); expect(foo.getBar).toHaveBeenCalled(); }); - it("should not affect other functions", function() { + it("should not affect other functions", () => { expect(bar).toEqual(123); }); - it("when called multiple times returns the requested values in order", function() { + it("when called multiple times returns the requested values in order", () => { expect(foo.getBar()).toEqual("fetched first"); expect(foo.getBar()).toEqual("fetched second"); expect(foo.getBar()).toBeUndefined(); }); }); -describe("A spy, when configured with an alternate implementation", function() { +describe("A spy, when configured with an alternate implementation", () => { var foo: any, bar: any, fetchedBar: any; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, - getBar: function() { + getBar: () => { return bar; } }; - spyOn(foo, "getBar").and.callFake(function() { + spyOn(foo, "getBar").and.callFake(() => { return 1001; }); @@ -411,25 +411,25 @@ describe("A spy, when configured with an alternate implementation", function() { fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function() { + it("tracks that the spy was called", () => { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function() { + it("should not effect other functions", () => { expect(bar).toEqual(123); }); - it("when called returns the requested value", function() { + it("when called returns the requested value", () => { expect(fetchedBar).toEqual(1001); }); }); -describe("A spy, when configured to throw a value", function() { +describe("A spy, when configured to throw a value", () => { var foo: any, bar: any; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; } }; @@ -437,22 +437,22 @@ describe("A spy, when configured to throw a value", function() { spyOn(foo, "setBar").and.throwError("quux"); }); - it("throws the value", function() { - expect(function() { - foo.setBar(123) + it("throws the value", () => { + expect(() => { + foo.setBar(123); }).toThrowError("quux"); }); }); -describe("A spy, when configured with multiple actions", function() { +describe("A spy, when configured with multiple actions", () => { var foo: any, bar: any, fetchedBar: any; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, - getBar: function() { + getBar: () => { return bar; } }; @@ -465,29 +465,29 @@ describe("A spy, when configured with multiple actions", function() { fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function() { + it("tracks that the spy was called", () => { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function() { + it("should not effect other functions", () => { expect(bar).toEqual(123); }); - it("when called returns the requested value", function() { + it("when called returns the requested value", () => { expect(fetchedBar).toEqual(123); }); - it("should have called the fake implementation", function() { + it("should have called the fake implementation", () => { expect(this.fakeCalled).toEqual(true); }); }); -describe("A spy", function() { +describe("A spy", () => { var foo: any, bar: any = null; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; } }; @@ -495,7 +495,7 @@ describe("A spy", function() { spyOn(foo, 'setBar').and.callThrough(); }); - it("can call through and then stub in the same spec", function() { + it("can call through and then stub in the same spec", () => { foo.setBar(123); expect(bar).toEqual(123); @@ -507,12 +507,12 @@ describe("A spy", function() { }); }); -describe("A spy", function() { +describe("A spy", () => { var foo: any, bar: any = null; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; } }; @@ -520,7 +520,7 @@ describe("A spy", function() { spyOn(foo, 'setBar'); }); - it("tracks if it was called at all", function() { + it("tracks if it was called at all", () => { expect(foo.setBar.calls.any()).toEqual(false); foo.setBar(); @@ -528,7 +528,7 @@ describe("A spy", function() { expect(foo.setBar.calls.any()).toEqual(true); }); - it("tracks the number of times it was called", function() { + it("tracks the number of times it was called", () => { expect(foo.setBar.calls.count()).toEqual(0); foo.setBar(); @@ -537,7 +537,7 @@ describe("A spy", function() { expect(foo.setBar.calls.count()).toEqual(2); }); - it("tracks the arguments of each call", function() { + it("tracks the arguments of each call", () => { foo.setBar(123); foo.setBar(456, "baz"); @@ -545,34 +545,34 @@ describe("A spy", function() { expect(foo.setBar.calls.argsFor(1)).toEqual([456, "baz"]); }); - it("tracks the arguments of all calls", function() { + it("tracks the arguments of all calls", () => { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.allArgs()).toEqual([[123], [456, "baz"]]); }); - it("can provide the context and arguments to all calls", function() { + it("can provide the context and arguments to all calls", () => { foo.setBar(123); expect(foo.setBar.calls.all()).toEqual([{ object: foo, args: [123], returnValue: undefined }]); }); - it("has a shortcut to the most recent call", function() { + it("has a shortcut to the most recent call", () => { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.mostRecent()).toEqual({ object: foo, args: [456, "baz"], returnValue: undefined }); }); - it("has a shortcut to the first call", function() { + it("has a shortcut to the first call", () => { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.first()).toEqual({ object: foo, args: [123], returnValue: undefined }); }); - it("can be reset", function() { + it("can be reset", () => { foo.setBar(123); foo.setBar(456, "baz"); @@ -584,40 +584,40 @@ describe("A spy", function() { }); }); -describe("A spy, when created manually", function() { +describe("A spy, when created manually", () => { var whatAmI: any; - beforeEach(function() { + beforeEach(() => { whatAmI = jasmine.createSpy('whatAmI'); whatAmI("I", "am", "a", "spy"); }); - it("is named, which helps in error reporting", function() { + it("is named, which helps in error reporting", () => { expect(whatAmI.and.identity()).toEqual('whatAmI'); }); - it("tracks that the spy was called", function() { + it("tracks that the spy was called", () => { expect(whatAmI).toHaveBeenCalled(); }); - it("tracks its number of calls", function() { + it("tracks its number of calls", () => { expect(whatAmI.calls.count()).toEqual(1); }); - it("tracks all the arguments of its calls", function() { + it("tracks all the arguments of its calls", () => { expect(whatAmI).toHaveBeenCalledWith("I", "am", "a", "spy"); }); - it("allows access to the most recent call", function() { + it("allows access to the most recent call", () => { expect(whatAmI.calls.mostRecent().args[0]).toEqual("I"); }); }); -describe("Multiple spies, when created manually", function() { +describe("Multiple spies, when created manually", () => { var tape: any; - beforeEach(function() { + beforeEach(() => { tape = jasmine.createSpyObj('tape', ['play', 'pause', 'stop', 'rewind']); tape.play(); @@ -625,35 +625,35 @@ describe("Multiple spies, when created manually", function() { tape.rewind(0); }); - it("creates spies for each requested function", function() { + it("creates spies for each requested function", () => { expect(tape.play).toBeDefined(); expect(tape.pause).toBeDefined(); expect(tape.stop).toBeDefined(); expect(tape.rewind).toBeDefined(); }); - it("tracks that the spies were called", function() { + it("tracks that the spies were called", () => { expect(tape.play).toHaveBeenCalled(); expect(tape.pause).toHaveBeenCalled(); expect(tape.rewind).toHaveBeenCalled(); expect(tape.stop).not.toHaveBeenCalled(); }); - it("tracks all the arguments of its calls", function() { + it("tracks all the arguments of its calls", () => { expect(tape.rewind).toHaveBeenCalledWith(0); }); }); -describe("jasmine.any", function() { - it("matches any value", function() { +describe("jasmine.any", () => { + it("matches any value", () => { expect({}).toEqual(jasmine.any(Object)); expect(12).toEqual(jasmine.any(Number)); }); - describe("when used with a spy", function() { - it("is useful for comparing arguments", function() { + describe("when used with a spy", () => { + it("is useful for comparing arguments", () => { var foo = jasmine.createSpy('foo'); - foo(12, function() { + foo(12, () => { return true; }); @@ -662,7 +662,7 @@ describe("jasmine.any", function() { }); }); -describe("jasmine.objectContaining", function() { +describe("jasmine.objectContaining", () => { interface fooType { a: number; b: number; @@ -670,7 +670,7 @@ describe("jasmine.objectContaining", function() { } var foo: fooType; - beforeEach(function() { + beforeEach(() => { foo = { a: 1, b: 2, @@ -678,7 +678,7 @@ describe("jasmine.objectContaining", function() { }; }); - it("matches objects with the expect key/value pairs", function() { + it("matches objects with the expect key/value pairs", () => { expect(foo).toEqual(jasmine.objectContaining({ bar: '' })); @@ -688,8 +688,8 @@ describe("jasmine.objectContaining", function() { })); }); - describe("when used with a spy", function() { - it("is useful for comparing arguments", function() { + describe("when used with a spy", () => { + it("is useful for comparing arguments", () => { var callback = jasmine.createSpy('callback'); callback({ @@ -706,20 +706,20 @@ describe("jasmine.objectContaining", function() { }); }); -describe("jasmine.arrayContaining", function() { +describe("jasmine.arrayContaining", () => { var foo: any; - beforeEach(function() { + beforeEach(() => { foo = [1, 2, 3, 4]; }); - it("matches arrays with some of the values", function() { + it("matches arrays with some of the values", () => { expect(foo).toEqual(jasmine.arrayContaining([3, 1])); expect(foo).not.toEqual(jasmine.arrayContaining([6])); }); - describe("when used with a spy", function() { - it("is useful when comparing arguments", function() { + describe("when used with a spy", () => { + it("is useful when comparing arguments", () => { var callback = jasmine.createSpy('callback'); callback([1, 2, 3, 4]); @@ -730,20 +730,20 @@ describe("jasmine.arrayContaining", function() { }); }); -describe("Manually ticking the Jasmine Clock", function() { +describe("Manually ticking the Jasmine Clock", () => { var timerCallback: any; - beforeEach(function() { + beforeEach(() => { timerCallback = jasmine.createSpy("timerCallback"); jasmine.clock().install(); }); - afterEach(function() { + afterEach(() => { jasmine.clock().uninstall(); }); - it("causes a timeout to be called synchronously", function() { - setTimeout(function() { + it("causes a timeout to be called synchronously", () => { + setTimeout(() => { timerCallback(); }, 100); @@ -754,8 +754,8 @@ describe("Manually ticking the Jasmine Clock", function() { expect(timerCallback).toHaveBeenCalled(); }); - it("causes an interval to be called synchronously", function() { - setInterval(function() { + it("causes an interval to be called synchronously", () => { + setInterval(() => { timerCallback(); }, 100); @@ -771,8 +771,8 @@ describe("Manually ticking the Jasmine Clock", function() { expect(timerCallback.calls.count()).toEqual(2); }); - describe("Mocking the Date object", function() { - it("mocks the Date object and sets it to a given time", function() { + describe("Mocking the Date object", () => { + it("mocks the Date object and sets it to a given time", () => { var baseTime = new Date(2013, 9, 23); jasmine.clock().mockDate(baseTime); @@ -783,82 +783,82 @@ describe("Manually ticking the Jasmine Clock", function() { }); }); -describe("Asynchronous specs", function() { +describe("Asynchronous specs", () => { var value: number; - beforeEach(function (done: DoneFn) { - setTimeout(function() { + beforeEach((done: DoneFn) => { + setTimeout(() => { value = 0; done(); }, 1); }); - it("should support async execution of test preparation and expectations", function (done: DoneFn) { + it("should support async execution of test preparation and expectations", (done: DoneFn) => { value++; expect(value).toBeGreaterThan(0); done(); }); - describe("long asynchronous specs", function() { - beforeEach(function (done: DoneFn) { + describe("long asynchronous specs", () => { + beforeEach((done: DoneFn) => { done(); }, 1000); - it("takes a long time", function (done: DoneFn) { - setTimeout(function() { + it("takes a long time", (done: DoneFn) => { + setTimeout(() => { done(); }, 9000); }, 10000); - afterEach(function (done: DoneFn) { + afterEach((done: DoneFn) => { done(); }, 1000); }); }); -describe("Fail", function() { +describe("Fail", () => { - it("should fail test when called without arguments", function() { + it("should fail test when called without arguments", () => { fail(); }); - it("should fail test when called with a fail message", function() { + it("should fail test when called with a fail message", () => { fail("The test failed"); }); - it("should fail test when called an error", function() { + it("should fail test when called an error", () => { fail(new Error("The test failed with this error")); }); }); // test based on http://jasmine.github.io/2.2/custom_equality.html -describe("custom equality", function() { - var myCustomEquality: jasmine.CustomEqualityTester = function (first: any, second: any): boolean { - if (typeof first == "string" && typeof second == "string") { - return first[0] == second[1]; +describe("custom equality", () => { + var myCustomEquality: jasmine.CustomEqualityTester = function(first: any, second: any): boolean { + if (typeof first === "string" && typeof second === "string") { + return first[0] === second[1]; } }; - beforeEach(function() { + beforeEach(() => { jasmine.addCustomEqualityTester(myCustomEquality); }); - it("should be custom equal", function() { + it("should be custom equal", () => { expect("abc").toEqual("aaa"); }); - it("should be custom not equal", function() { + it("should be custom not equal", () => { expect("abc").not.toEqual("abc"); }); }); // test based on http://jasmine.github.io/2.2/custom_matcher.html var customMatchers: jasmine.CustomMatcherFactories = { - toBeGoofy: function (util: jasmine.MatchersUtil, customEqualityTesters: Array) { + toBeGoofy: (util: jasmine.MatchersUtil, customEqualityTesters: jasmine.CustomEqualityTester[]) => { return { - compare: function (actual: any, expected: any): jasmine.CustomMatcherResult { + compare: (actual: any, expected: any): jasmine.CustomMatcherResult => { if (expected === undefined) { expected = ''; } @@ -892,24 +892,24 @@ declare namespace jasmine { } } -describe("Custom matcher: 'toBeGoofy'", function() { - beforeEach(function() { +describe("Custom matcher: 'toBeGoofy'", () => { + beforeEach(() => { jasmine.addMatchers(customMatchers); }); - it("is available on an expectation", function() { + it("is available on an expectation", () => { expect({ hyuk: 'gawrsh' }).toBeGoofy(); }); - it("can take an 'expected' parameter", function() { + it("can take an 'expected' parameter", () => { expect({ hyuk: 'gawrsh is fun' }).toBeGoofy({ hyuk: ' is fun' }); }); - it("can be negated", function() { + it("can be negated", () => { expect({ hyuk: 'this is fun' }).not.toBeGoofy(); @@ -918,20 +918,21 @@ describe("Custom matcher: 'toBeGoofy'", function() { // test based on http://jasmine.github.io/2.5/custom_reporter.html var myReporter: jasmine.CustomReporter = { - jasmineStarted: function (suiteInfo: jasmine.SuiteInfo) { + jasmineStarted: (suiteInfo: jasmine.SuiteInfo) => { console.log("Running suite with " + suiteInfo.totalSpecsDefined); }, - suiteStarted: function (result: jasmine.CustomReporterResult) { + suiteStarted: (result: jasmine.CustomReporterResult) => { console.log("Suite started: " + result.description + " whose full description is: " + result.fullName); }, - specStarted: function (result: jasmine.CustomReporterResult) { + specStarted: (result: jasmine.CustomReporterResult) => { console.log("Spec started: " + result.description + " whose full description is: " + result.fullName); }, - specDone: function (result: jasmine.CustomReporterResult) { + specDone: (result: jasmine.CustomReporterResult) => { console.log("Spec: " + result.description + " was " + result.status); + //tslint:disable-next-line:prefer-for-of for (var i = 0; i < result.failedExpectations.length; i++) { console.log("Failure: " + result.failedExpectations[i].message); console.log("Actual: " + result.failedExpectations[i].actual); @@ -941,15 +942,16 @@ var myReporter: jasmine.CustomReporter = { console.log(result.passedExpectations.length); }, - suiteDone: function (result: jasmine.CustomReporterResult) { + suiteDone: (result: jasmine.CustomReporterResult) => { console.log('Suite: ' + result.description + ' was ' + result.status); + //tslint:disable-next-line:prefer-for-of for (var i = 0; i < result.failedExpectations.length; i++) { console.log('AfterAll ' + result.failedExpectations[i].message); console.log(result.failedExpectations[i].stack); } }, - jasmineDone: function (runDetails: jasmine.RunDetails) { + jasmineDone: (runDetails: jasmine.RunDetails) => { console.log('Finished suite'); console.log('Random:', runDetails.order.random); } @@ -957,16 +959,16 @@ var myReporter: jasmine.CustomReporter = { jasmine.getEnv().addReporter(myReporter); -describe("Randomize Tests", function() { - it("should allow randomization of the order of tests", function() { - expect(function() { +describe("Randomize Tests", () => { + it("should allow randomization of the order of tests", () => { + expect(() => { var env = jasmine.getEnv(); return env.randomizeTests(true); }).not.toThrow(); }); - it("should allow a seed to be passed in for randomization", function() { - expect(function() { + it("should allow a seed to be passed in for randomization", () => { + expect(() => { var env = jasmine.getEnv(); env.randomizeTests(true); return env.seed(1234); @@ -982,14 +984,14 @@ describe("Randomize Tests", function() { env.addReporter(htmlReporter); var specFilter = new jasmine.HtmlSpecFilter(); - env.specFilter = function (spec) { + env.specFilter = (spec) => { return specFilter.matches(spec.getFullName()); }; var currentWindowOnload = window.onload; - window.onload = function() { + window.onload = () => { if (currentWindowOnload) { - (currentWindowOnload)(null); + (currentWindowOnload as any)(null); } htmlReporter.initialize(); env.execute(); diff --git a/jasmine/v1/jasmine-tests.ts b/jasmine/v1/jasmine-tests.ts index 9177679f8a..c47fc84007 100644 --- a/jasmine/v1/jasmine-tests.ts +++ b/jasmine/v1/jasmine-tests.ts @@ -60,7 +60,7 @@ describe("Included matchers:", () => { foo: 'foo' }; expect(a.foo).toBeDefined(); - expect((a).bar).not.toBeDefined(); + expect((a as any).bar).not.toBeDefined(); }); it("The `toBeUndefined` matcher compares against `undefined`", () => { @@ -68,7 +68,7 @@ describe("Included matchers:", () => { foo: 'foo' }; expect(a.foo).not.toBeUndefined(); - expect((a).bar).toBeUndefined(); + expect((a as any).bar).toBeUndefined(); }); it("The 'toBeNull' matcher compares against null", () => { @@ -202,7 +202,7 @@ describe("A spy", () => { var foo: any, bar: any = null; beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; } }; @@ -235,7 +235,7 @@ describe("A spy, when configured to call through", () => { var foo: any, bar: any, fetchedBar: any; beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, getBar: () => { @@ -261,7 +261,7 @@ describe("A spy, when faking a return value", () => { var foo: any, bar: any, fetchedBar: any; beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, getBar: () => { @@ -287,7 +287,7 @@ describe("A spy, when faking a return value", () => { var foo: any, bar: any, fetchedBar: any; beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, getBar: () => { @@ -319,7 +319,7 @@ describe("A spy, when created manually", () => { whatAmI("I", "am", "a", "spy"); }); it("is named, which helps in error reporting", () => { - expect(whatAmI.identity).toEqual('whatAmI') + expect(whatAmI.identity).toEqual('whatAmI'); }); it("tracks that the spy was called", () => { expect(whatAmI).toHaveBeenCalled(); @@ -369,7 +369,7 @@ describe("jasmine.any", () => { it("is useful for comparing arguments", () => { var foo = jasmine.createSpy('foo'); foo(12, () => { - return true + return true; }); expect(foo).toHaveBeenCalledWith(jasmine.any(Number), jasmine.any(Function)); }); @@ -430,7 +430,7 @@ describe("Asynchronous specs", () => { jasmineEnv.updateInterval = 250; var htmlReporter = new jasmine.HtmlReporter(); jasmineEnv.addReporter(htmlReporter); - jasmineEnv.specFilter = function (spec) { + jasmineEnv.specFilter = (spec) => { return htmlReporter.specFilter(spec); }; var currentWindowOnload = (arg: any) => window.onload(arg); @@ -439,11 +439,11 @@ describe("Asynchronous specs", () => { currentWindowOnload(null); } - (document.querySelector('.version')).innerHTML = jasmineEnv.versionString(); + (document.querySelector('.version') as HTMLElement).innerHTML = jasmineEnv.versionString(); execJasmine(); }; function execJasmine() { jasmineEnv.execute(); } -})(); \ No newline at end of file +})(); From ba29010d1438767c5db5e73d716447178d85f0f3 Mon Sep 17 00:00:00 2001 From: Lukas Zech Date: Sun, 26 Feb 2017 13:17:07 +0100 Subject: [PATCH 025/276] Fix other jasmine packages --- jasmine-es6-promise-matchers/index.d.ts | 2 +- jasmine-expect/index.d.ts | 2 +- jasmine-jquery/index.d.ts | 6 +++--- jasmine-jquery/jasmine-jquery-tests.ts | 4 ++-- jasmine-matchers/index.d.ts | 2 +- jasmine-promise-matchers/index.d.ts | 2 +- jasmine/v1/index.d.ts | 16 ++++++++-------- jasminewd2/index.d.ts | 17 ++++++++++++----- 8 files changed, 29 insertions(+), 22 deletions(-) diff --git a/jasmine-es6-promise-matchers/index.d.ts b/jasmine-es6-promise-matchers/index.d.ts index 89e3146c2c..7d61d4d660 100644 --- a/jasmine-es6-promise-matchers/index.d.ts +++ b/jasmine-es6-promise-matchers/index.d.ts @@ -13,7 +13,7 @@ declare namespace JasminePromiseMatchers { declare namespace jasmine { - interface Matchers { + interface Matchers { /** * Verifies that a Promise is (or has been) rejected. */ diff --git a/jasmine-expect/index.d.ts b/jasmine-expect/index.d.ts index c2ee7e0ee5..25a21d49d5 100644 --- a/jasmine-expect/index.d.ts +++ b/jasmine-expect/index.d.ts @@ -7,7 +7,7 @@ /// declare namespace jasmine { - interface Matchers { + interface Matchers { // These functions are written in the order defined in the src directory of jasmine-matchers // The type system is used smartly whenever it can provide value (by looking at the code of every matcher) toBeAfter(otherDate: Date): boolean; // diff --git a/jasmine-jquery/index.d.ts b/jasmine-jquery/index.d.ts index fb91e0c37b..ebc14cee75 100644 --- a/jasmine-jquery/index.d.ts +++ b/jasmine-jquery/index.d.ts @@ -81,7 +81,7 @@ declare namespace jasmine { proxyCallTo_(methodName: string, passedArguments: any): any; } - interface Matchers { + interface Matchers { /** * Check if DOM element has class. * @@ -232,7 +232,7 @@ declare namespace jasmine { * */ toHaveData(key : string, expectedValue : string): boolean; - toBe(selector: JQuery): boolean; + toBe(selector: T): boolean; /** * Check if DOM element is matched by the given selector. @@ -241,7 +241,7 @@ declare namespace jasmine { * // returns true * expect($('

')).toContain('some-class') */ - toContain(selector: JQuery): boolean; + toContain(selector: T): boolean; /** * Check if DOM element exists inside the given parent element. diff --git a/jasmine-jquery/jasmine-jquery-tests.ts b/jasmine-jquery/jasmine-jquery-tests.ts index 67b349d45e..9d51a3775b 100644 --- a/jasmine-jquery/jasmine-jquery-tests.ts +++ b/jasmine-jquery/jasmine-jquery-tests.ts @@ -4,8 +4,8 @@ describe("Jasmine jQuery extension", () => { it("Adds jQuery matchers", () => { - expect($('
')).toBe('div'); - expect($('
')).toBe('div#some-id'); + expect($('
')).toBe($('div')); + expect($('
')).toBe($('div#some-id')); expect($('')).toBeChecked(); expect($('
')).toBeHidden(); expect($('
')).toHaveCss({ display: "none", margin: "10px" }); diff --git a/jasmine-matchers/index.d.ts b/jasmine-matchers/index.d.ts index ac44d25c1c..d4cad3b77c 100644 --- a/jasmine-matchers/index.d.ts +++ b/jasmine-matchers/index.d.ts @@ -23,7 +23,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI /// declare namespace jasmine { - interface Matchers { + interface Matchers { //toBe toBeArray(): boolean; diff --git a/jasmine-promise-matchers/index.d.ts b/jasmine-promise-matchers/index.d.ts index c511019b62..ffe4f65142 100644 --- a/jasmine-promise-matchers/index.d.ts +++ b/jasmine-promise-matchers/index.d.ts @@ -10,7 +10,7 @@ declare function installPromiseMatchers(): void; declare namespace jasmine { - interface Matchers { + interface Matchers { /** * Verifies that a Promise is (or has been) rejected. */ diff --git a/jasmine/v1/index.d.ts b/jasmine/v1/index.d.ts index 5cbb2a9f83..3f51240f63 100644 --- a/jasmine/v1/index.d.ts +++ b/jasmine/v1/index.d.ts @@ -16,9 +16,9 @@ declare function xit(expectation: string, assertion: () => void): void; declare function beforeEach(action: () => void): void; declare function afterEach(action: () => void): void; -declare function expect(spy: Function): jasmine.Matchers; -//declare function expect(spy: jasmine.Spy): jasmine.Matchers; -declare function expect(actual: any): jasmine.Matchers; +declare function expect(spy: Function): jasmine.Matchers; +//declare function expect(spy: jasmine.Spy): jasmine.Matchers; +declare function expect(actual: any): jasmine.Matchers; declare function spyOn(object: any, method: string): jasmine.Spy; @@ -91,7 +91,7 @@ declare namespace jasmine { currentSpec: Spec; - matchersClass: Matchers; + matchersClass: Matchers; version(): any; versionString(): string; @@ -204,7 +204,7 @@ declare namespace jasmine { results(): NestedResults; } - interface Matchers { + interface Matchers { new (env: Env, actual: any, spec: Env, isNot?: boolean): any; @@ -232,7 +232,7 @@ declare namespace jasmine { toContainHtml(expected: string): boolean; toContainText(expected: string): boolean; toThrow(expected?: any): boolean; - not: Matchers; + not: Matchers; Any: Any; } @@ -287,7 +287,7 @@ declare namespace jasmine { spies_: Spy[]; results_: NestedResults; - matchersClass: Matchers; + matchersClass: Matchers; getFullName(): string; results(): NestedResults; @@ -299,7 +299,7 @@ declare namespace jasmine { waits(timeout: number): Spec; waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec; fail(e?: any): void; - getMatchersClass_(): Matchers; + getMatchersClass_(): Matchers; addMatchers(matchersPrototype: any): void; finishCallback(): void; finish(onComplete?: () => void): void; diff --git a/jasminewd2/index.d.ts b/jasminewd2/index.d.ts index 9d8ecde76e..a4122c6639 100644 --- a/jasminewd2/index.d.ts +++ b/jasminewd2/index.d.ts @@ -17,10 +17,10 @@ declare function afterAll(action: () => Promise, timeout?: number): void; declare namespace jasmine { // The global `Promise` type is too strict and kinda wrong interface Promise { - then(onFulfill?: (value: T) => U | Promise, onReject?: (error: any) => U | Promise): Promise; + then(onFulfill?: (value: T) => U | Promise, onReject?: (error: any) => U | Promise): Promise; } - interface Matchers { + interface Matchers { toBe(expected: any, expectationFailOutput?: any): Promise; toEqual(expected: any, expectationFailOutput?: any): Promise; toMatch(expected: string | RegExp | Promise, expectationFailOutput?: any): Promise; @@ -44,6 +44,13 @@ declare namespace jasmine { toThrowError(expected?: new (...args: any[]) => Error | Promise Error>, message?: string | RegExp | Promise): Promise; } + interface ArrayLikeMatchers> extends Matchers { + toBe(expected: Expected>, expectationFailOutput?: any): Promise; + toEqual(expected: Expected>, expectationFailOutput?: any): Promise; + toContain(expected: T, expectationFailOutput?: any): Promise; + not: ArrayLikeMatchers; + } + function addMatchers(matchers: AsyncCustomMatcherFactories): void; interface Env { @@ -59,12 +66,12 @@ declare namespace jasmine { } interface AsyncCustomMatcherFactory { - (util: MatchersUtil, customEqualityTesters: CustomEqualityTester[]): AsyncCustomMatcher; + (util: MatchersUtil, customEqualityTesters: CustomEqualityTester[]): AsyncCustomMatcher; } interface AsyncCustomMatcher { - compare(actual: T, expected: T): AsyncCustomMatcherResult; - compare(actual: any, expected: any): AsyncCustomMatcherResult; + compare(actual: T, expected: T): AsyncCustomMatcherResult; + compare(actual: any, expected: any): AsyncCustomMatcherResult; } interface AsyncCustomMatcherResult { From 4fa3d7fda8444f7d880aa31f0ef82ed1e7fab92d Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Fri, 24 Feb 2017 01:20:39 +0100 Subject: [PATCH 026/276] Add definitions for Google Calendar API (gapi.calendar) --- gapi.calendar/gapi.calendar-tests.ts | 152 ++++++ gapi.calendar/index.d.ts | 675 +++++++++++++++++++++++++++ gapi.calendar/tsconfig.json | 18 + 3 files changed, 845 insertions(+) create mode 100644 gapi.calendar/gapi.calendar-tests.ts create mode 100644 gapi.calendar/index.d.ts create mode 100644 gapi.calendar/tsconfig.json diff --git a/gapi.calendar/gapi.calendar-tests.ts b/gapi.calendar/gapi.calendar-tests.ts new file mode 100644 index 0000000000..de335c6a15 --- /dev/null +++ b/gapi.calendar/gapi.calendar-tests.ts @@ -0,0 +1,152 @@ +/* Example taken from Google Calendar API JavaScript Quickstart https://developers.google.com/google-apps/calendar/quickstart/js */ + +{ + // Your Client ID can be retrieved from your project in the Google + // Developer Console, https://console.developers.google.com + var CLIENT_ID = ''; + + var SCOPES = ["https://www.googleapis.com/auth/calendar.readonly"]; + + /** + * Check if current user has authorized this application. + */ + function checkAuth() { + gapi.auth.authorize( + { + 'client_id': CLIENT_ID, + 'scope': SCOPES.join(' '), + 'immediate': true + }, handleAuthResult); + } + + /** + * Handle response from authorization server. + * + * @param {Object} authResult Authorization result. + */ + function handleAuthResult(authResult: GoogleApiOAuth2TokenObject) { + var authorizeDiv = document.getElementById('authorize-div')!; + if (authResult && !authResult.error) { + // Hide auth UI, then load client library. + authorizeDiv.style.display = 'none'; + loadCalendarApi(); + } else { + // Show auth UI, allowing the user to initiate authorization by + // clicking authorize button. + authorizeDiv.style.display = 'inline'; + } + } + + /** + * Initiate auth flow in response to user clicking authorize button. + * + * @param {Event} event Button click event. + */ + function handleAuthClick(event: MouseEvent) { + gapi.auth.authorize( + {client_id: CLIENT_ID, scope: SCOPES, immediate: false}, + handleAuthResult); + return false; + } + + /** + * Load Google Calendar client library. List upcoming events + * once client library is loaded. + */ + function loadCalendarApi() { + gapi.client.load('calendar', 'v3', listUpcomingEvents); + } + + /** + * Print the summary and start datetime/date of the next ten events in + * the authorized user's calendar. If no events are found an + * appropriate message is printed. + */ + function listUpcomingEvents() { + var request = gapi.client.calendar.events.list({ + 'calendarId': 'primary', + 'timeMin': (new Date()).toISOString(), + 'showDeleted': false, + 'singleEvents': true, + 'maxResults': 10, + 'orderBy': 'startTime' + }); + + request.execute(function(resp) { + var events = resp.items; + appendPre('Upcoming events:'); + + if (events.length > 0) { + for (let i = 0; i < events.length; i++) { + var event = events[i]; + var when = event.start.dateTime; + if (!when) { + when = event.start.date; + } + appendPre(event.summary + ' (' + when + ')') + } + } else { + appendPre('No upcoming events found.'); + } + + }); + } + + /** + * Append a pre element to the body containing the given message + * as its text node. + * + * @param {string} message Text to be placed in pre element. + */ + function appendPre(message: string) { + var pre = document.getElementById('output')!; + var textContent = document.createTextNode(message + '\n'); + pre.appendChild(textContent); + } +} + +/* Example taken from https://developers.google.com/google-apps/calendar/v3/reference/events/insert#examples */ + +{ + // Refer to the JavaScript quickstart on how to setup the environment: + // https://developers.google.com/google-apps/calendar/quickstart/js + // Change the scope to 'https://www.googleapis.com/auth/calendar' and delete any + // stored credentials. + + const event = { + 'summary': 'Google I/O 2015', + 'location': '800 Howard St., San Francisco, CA 94103', + 'description': 'A chance to hear more about Google\'s developer products.', + 'start': { + 'dateTime': '2015-05-28T09:00:00-07:00', + 'timeZone': 'America/Los_Angeles' + }, + 'end': { + 'dateTime': '2015-05-28T17:00:00-07:00', + 'timeZone': 'America/Los_Angeles' + }, + 'recurrence': [ + 'RRULE:FREQ=DAILY;COUNT=2' + ], + 'attendees': [ + {'email': 'lpage@example.com'}, + {'email': 'sbrin@example.com'} + ], + 'reminders': { + 'useDefault': false, + 'overrides': [ + {'method': 'email', 'minutes': 24 * 60}, + {'method': 'popup', 'minutes': 10} + ] + } + }; + + var request = gapi.client.calendar.events.insert({ + 'calendarId': 'primary', + 'resource': event + }); + + request.execute(function(event) { + appendPre('Event created: ' + event.htmlLink); + }); +} diff --git a/gapi.calendar/index.d.ts b/gapi.calendar/index.d.ts new file mode 100644 index 0000000000..bd0e3b0d17 --- /dev/null +++ b/gapi.calendar/index.d.ts @@ -0,0 +1,675 @@ +// Type definitions for Google Calendar API 3.0 +// Project: https://developers.google.com/google-apps/calendar/ +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace gapi.client.calendar { + export class freebusy { + static query(parameters: FreeBusyQueryParameters): HttpRequest; + } + + interface FreeBusyQueryParameters { + timeMin: datetime; + timeMax: datetime; + timeZone?: string; + groupExpansionMax?: integer; + calendarExpansionMax?: integer; + items: {id: string}[]; + } + + interface FreeBusy { + kind: 'calendar#freeBusy'; + timeMin: datetime; + timeMax: datetime; + groups: { + (key: string): { + errors?: { + domain: string; + reason: string; + }[]; + calendars: string[]; + } + }; + calendars: { + (key: string): { + errors?: { + domain: string; + reason: string; + }[]; + busy: { + start: datetime; + end: datetime; + }[]; + } + }; + } + + export class acl { + static insert(parameters: AclInsertParameters): HttpRequest; + static get(parameters: AclGetParameters): HttpRequest; + static update(parameters: AclUpdateParameters): HttpRequest; + static delete(parameters: AclDeleteParameters): HttpRequest; + } + + // The type of the scope. Possible values are: + type ScopeType = + // The public scope. This is the default value. + // Note: The permissions granted to the "default", or public, scope apply to any user, authenticated or not. + 'default' | + // Limits the scope to a single user. + 'user' | + // Limits the scope to a group. + 'group' | + // Limits the scope to a domain. + 'domain'; + + interface Acl { + kind: 'calendar#aclRule'; + etag: etag; + id: string; + scope: { + type: ScopeType; + value: string; + }; + role: AccessRole; + } + + interface AclInsertParameters { + calendarId: string; + + // Acl resource + role: AccessRole; + scope: { + type: ScopeType; + value?: string; + }; + } + + interface AclGetParameters { + calendarId: string; + ruleId: string; + } + + interface AclUpdateParameters extends AclInsertParameters { + ruleId: string; + } + + interface AclDeleteParameters extends AclGetParameters { + } + + export class calendarList { + static list(parameters?: CalendarListListParameters): HttpRequest; + static insert(parameters: CalendarListInsertParameters): HttpRequest; + } + + type AccessRoleWithoutNone = + // The user has read access to free/busy information. + 'freeBusyReader' | + // The user has read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. + 'reader' | + // The user has read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible. + 'writer' | + // The user has ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and manipulate ACLs. + 'owner'; + + // The user's access role for this calendar. Read-only. Possible values are: + type AccessRole = + // The user has no access. + 'none' | + AccessRoleWithoutNone; + + interface CalendarListListParameters { + maxResults?: integer; + // The minimum access role for the user in the returned entries. Optional. The default is no restriction. Acceptable values are: + minAccessRole?: AccessRoleWithoutNone; + pageToken?: string; + showDeleted?: boolean; + showHidden?: boolean; + syncToken?: string; + } + + interface CalendarListInsertParameters { + // Parameters + // Optional query parameters + colorRgbFormat?: boolean; + + // CalendarList resource + resource: CalendarListInput; + } + + interface CalendarListInput { + // Required Properties + id: string; + + // Optional Properties + backgroundColor?: string; + colorId?: string; + defaultReminders?: { + method: ReminderMethod; + minutes: integer; + }[]; + foregroundColor?: string; + hidden?: boolean; + notificationSettings?: { + notifications: { + type: NotificationType; + method: string; + }[]; + }; + selected?: boolean; + summaryOverride?: string; + } + + interface CalendarList { + kind: 'calendar#calendarList'; + etag: etag; + + /** + * Token used to access the next page of this result. + * Omitted if no further results are available, in which case nextSyncToken is provided. + */ + nextPageToken?: string; + + /** + * Token used at a later point in time to retrieve only the entries that have changed since this result was returned. + * Omitted if further results are available, in which case nextPageToken is provided. + */ + nextSyncToken?: string; + + items: CalendarListEntry[]; + } + + // The type of notification. Possible values are: + type NotificationType = + // Notification sent when a new event is put on the calendar. + 'eventCreation' | + // Notification sent when an event is changed. + 'eventChange' | + // Notification sent when an event is cancelled. + 'eventCancellation' | + // Notification sent when an event is changed. + 'eventResponse' | + // An agenda with the events of the day (sent out in the morning). + 'agenda'; + + interface CalendarListEntry { + kind: 'calendar#calendarListEntry'; + etag: etag; + id: string; + summary: string; + description?: string; + location?: string; + timeZone?: string; + summaryOverride?: string; + colorId?: string; + backgroundColor?: string; + foregroundColor?: string; + hidden?: boolean; + selected?: boolean; + // The effective access role that the authenticated user has on the calendar. Read-only. + accessRole: AccessRoleWithoutNone; + defaultReminders: { + method: ReminderMethod; + minutes: integer; + }[]; + notificationSettings?: { + notifications: { + type: NotificationType; + method: string; + }[]; + }; + primary?: boolean; + deleted?: boolean; + } + + export class calendars { + static insert(parameters: CalendarsInsertParameters): HttpRequest; + static update(parameters: CalendarsUpdateParameters): HttpRequest; + static delete(parameters: CalendarsDeleteParameters): HttpRequest; + } + + interface CalendarsUpdateParameters { + calendarId: string; + + // Calendars resource + // Optional Properties + description?: string; + location?: string; + summary?: string; + timeZone?: string; + } + + interface CalendarsInsertParameters { + // Calendars resource + // Required Properties + summary: string; + + description?: string; + location?: string; + timeZone?: string; + } + + interface CalendarsDeleteParameters { + calendarId: string; + } + + interface Calendar { + kind: 'calendar#calendar'; + etag: etag; + id: string; + summary: string; + description?: string; + location?: string; + timeZone?: string; + } + + export class events { + static list(parameters: EventsListParameters): HttpRequest; + static insert(parameters: EventsInsertParameters): HttpRequest; + static update(parameters: EventsUpdateParameters): HttpRequest; + static get(parameters: EventsGetParameters): HttpRequest; + } + + interface EventsGetParameters { + calendarId: string; + eventId: string; + + alwaysIncludeEmail?: boolean; + maxAttendees?: integer; + timeZone?: string; + } + + interface EventsInsertParameters { + calendarId: string; + + maxAttendees?: integer; + sendNotifications?: boolean; + supportsAttachments?: boolean; + + // Event resource + resource: EventInput; + } + + interface EventsUpdateParameters { + calendarId: string; + eventId: string; + + alwaysIncludeEmail?: boolean; + maxAttendees?: integer; + sendNotifications?: boolean; + supportsAttachments?: boolean; + + // Event resource + resource: EventInput; + } + + interface EventInput { + // Required Properties + attachments?: { + fileUrl: string; + }[]; + attendees?: { + email: string; + displayName?: string; + optional?: boolean; + responseStatus?: AttendeeResponseStatus; + comment?: string; + additionalGuests?: integer; + }[]; + end: { + date?: date; + dateTime?: datetime; + timeZone?: string + }; + reminders?: { + overrides: { + method: string; + minutes: integer; + }[]; + useDefault: boolean; + }; + start: { + date?: date; + dateTime?: datetime; + timeZone: string; + }; + + // Optional Properties + anyoneCanAddSelf?: boolean; + colorId?: string; + description?: string; + extendedProperties?: { + private: { + (key: string): string + }; + shared: { + (key: string): string + } + }; + gadget?: { + display?: GadgetDisplayMode; + height: integer; + iconLink: string; + link: string; + preferences: { + (key: string): string + } + title: string; + type: string; + width: integer; + }; + guestsCanInviteOthers?: boolean; + guestsCanSeeOtherGuests?: boolean; + id?: string; + location?: string; + originalStartTime?: { + date: date; + dateTime: datetime; + timeZone: string + }; + recurrence?: string[]; + sequence?: integer; + source?: { + url: string; + title: string + }; + status?: EventStatus; + summary?: string; + transparency?: EventTransparency; + visibility?: EventVisibility; + } + + // The order of the events returned in the result. Optional. The default is an unspecified, stable order. + // Acceptable values are: + type EventsOrder = + // Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter singleEvents is True) + 'startTime' | + // Order by last modification time (ascending). + 'updated'; + + // Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. + // It makes the result of this list request contain only entries that have changed since then. + // All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. + // There are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state. + // These are: + type SyncToken = + 'iCalUID' | + 'orderBy' | + 'privateExtendedProperty' | + 'q' | + 'sharedExtendedProperty' | + 'timeMin' | + 'timeMax' | + 'updatedMin'; + + interface EventsListParameters { + calendarId: string; + alwaysIncludeEmail?: boolean; + iCalUID?: string; + maxAttendees?: integer; + maxResults?: integer; + orderBy?: EventsOrder; + pageToken?: string; + privateExtendedProperty?: string; + q?: string; + sharedExtendedProperty?: string; + showDeleted?: boolean; + showHiddenInvitations?: boolean; + singleEvents?: boolean; + syncToken?: SyncToken; + timeMax?: datetime; + timeMin?: datetime; + timeZone?: string; + updatedMin?: datetime; + } + + interface Events { + kind: 'calendar#events'; + etag: etag; + summary: string; + description: string; + updated: datetime; + timeZone: string; + // The user's access role for this calendar. Read-only. Possible values are: + accessRole: AccessRole; + defaultReminders: { + method: ReminderMethod; + minutes: integer; + }[]; + nextPageToken?: string; + nextSyncToken?: string; + items: Event[]; + } + + type etag = string; + type datetime = string; + type date = string; + type integer = number; + + // The attendee's response status. Possible values are: + type AttendeeResponseStatus = + // The attendee has not responded to the invitation. + 'needsAction' | + // The attendee has declined the invitation. + 'declined' | + // The attendee has tentatively accepted the invitation. + 'tentative' | + // The attendee has accepted the invitation. + 'accepted'; + + // The gadget's display mode. Optional. Possible values are: + type GadgetDisplayMode = + // The gadget displays next to the event's title in the calendar view. + 'icon' | + // The gadget displays when the event is clicked. + 'chip'; + + // The method used by this reminder. Possible values are: + type ReminderMethod = + // Reminders are sent via email. + 'email' | + // Reminders are sent via SMS. These are only available for Google Apps for Work, Education, and Government customers. Requests to set SMS reminders for other account types are ignored. + 'sms' | + // Reminders are sent via a UI popup. + 'popup'; + + // Status of the event. Optional. Possible values are: + type EventStatus = + // The event is confirmed. This is the default status. + 'confirmed' | + // The event is tentatively confirmed. + 'tentative' | + // The event is cancelled. + 'cancelled'; + + // Whether the event blocks time on the calendar. Optional. Possible values are: + type EventTransparency = + // The event blocks time on the calendar. This is the default value. + 'opaque' | + // The event does not block time on the calendar. + 'transparent'; + + // Visibility of the event. Optional. Possible values are: + type EventVisibility = + // Uses the default visibility for events on the calendar. This is the default value. + 'default' | + // The event is public and event details are visible to all readers of the calendar. + 'public' | + // The event is private and only event attendees may view event details. + 'private' | + // The event is private. This value is provided for compatibility reasons. + 'confidential'; + + class Event { + kind: 'calendar#event'; + etag: etag; + id: string; + status?: EventStatus; + htmlLink: string; + created: datetime; + updated: datetime; + summary: string; + description: string; + location?: string; + colorId?: string; + + // The creator of the event. Read-only. + creator: { + // The creator's Profile ID, if available. + id?: string; + + // The creator's email address, if available. + email?: string; + + // The creator's name, if available. + displayName?: string; + + // Whether the creator corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. + self?: boolean; + }; + + // The organizer of the event. + organizer: { + // The organizer's Profile ID, if available. + id?: string; + + // The organizer's email address, if available. + email?: string; + + // The organizer's name, if available. + displayName?: string; + + // Whether the organizer corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. + self?: boolean; + }; + + // The (inclusive) start time of the event. For a recurring event, this is the start time of the first instance. + start: { + // The date, in the format "yyyy-mm-dd", if this is an all-day event. + date?: date; + + // The time, as a combined date-time value (formatted according to RFC3339). + // A time zone offset is required unless a time zone is explicitly specified in timeZone. + dateTime?: datetime; + + // The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) + // For recurring events this field is required and specifies the time zone in which the recurrence is expanded. + // For single events this field is optional and indicates a custom time zone for the event start/end. + timeZone?: string; + }; + + // The (exclusive) end time of the event. For a recurring event, this is the end time of the first instance. + end: { + // The date, in the format "yyyy-mm-dd", if this is an all-day event. + date?: date; + + // The time, as a combined date-time value (formatted according to RFC3339). + // A time zone offset is required unless a time zone is explicitly specified in timeZone. + dateTime?: datetime; + + // The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) + // For recurring events this field is required and specifies the time zone in which the recurrence is expanded. + // For single events this field is optional and indicates a custom time zone for the event start/end. + timeZone?: string; + }; + + // Whether the end time is actually unspecified. An end time is still provided for compatibility reasons, even if this attribute is set to True. + // The default is False. + endTimeUnspecified?: boolean; + + recurrence: string[]; + + // For an instance of a recurring event, this is the id of the recurring event to which this instance belongs. Immutable. + recurringEventId?: string; + + // Whether the organizer corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. + originalStartTime?: { + date: date; + dateTime: datetime; + timeZone?: string; + }; + + transparency?: EventTransparency; + visibility?: EventVisibility; + iCalUID: string; + sequence: integer; + + // The attendees of the event. + attendees?: { + id: string; + email: string; + displayName?: string; + organizer: boolean; + self: boolean; + resource: boolean; + optional?: boolean; + responseStatus: AttendeeResponseStatus; + comment?: string; + additionalGuests?: integer; + }[]; + + attendeesOmitted?: boolean; + + // Extended properties of the event. + extendedProperties?: { + private: { + (key: string): string; + }; + shared: { + (key: string): string; + } + }; + + // An absolute link to the Google+ hangout associated with this event. Read-only. + hangoutLink?: string; + + // A gadget that extends this event. + gadget?: { + type: string; + title: string; + link: string; + iconLink: string; + width?: integer; + height?: integer; + display?: GadgetDisplayMode; + preferences: { + (key: string): string; + } + }; + + anyoneCanAddSelf?: boolean; + guestsCanInviteOthers?: boolean; + guestsCanModify?: boolean; + guestsCanSeeOtherGuests?: boolean; + privateCopy?: boolean; + + // Whether this is a locked event copy where no changes can be made to the main event fields "summary", "description", "location", "start", "end" or "recurrence". The default is False. Read-Only. + locked?: boolean; + + reminders: { + useDefault: boolean; + overrides?: { + method: ReminderMethod; + minutes: integer; + }[]; + }; + + // Source from which the event was created. For example, a web page, an email message or any document identifiable by an URL with HTTP or HTTPS scheme. + // Can only be seen or modified by the creator of the event. + source?: { + url: string; + title: string; + }; + + // File attachments for the event. Currently only Google Drive attachments are supported. + attachments?: { + fileUrl: string; + title: string; + mimeType: string; + iconLink: string; + fileId: string; + }[]; + } +} diff --git a/gapi.calendar/tsconfig.json b/gapi.calendar/tsconfig.json new file mode 100644 index 0000000000..7613ee5b3d --- /dev/null +++ b/gapi.calendar/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "module": "commonjs", + "lib": ["es6", "dom"], + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "gapi.calendar-tests.ts" + ] +} From 5e762d799d6779106c33b899ed71839501b1443a Mon Sep 17 00:00:00 2001 From: Anton Kandybo Date: Mon, 6 Mar 2017 01:18:30 +0200 Subject: [PATCH 027/276] Add compression-webpack-plugin --- .../compression-webpack-plugin-tests.ts | 14 +++++++ compression-webpack-plugin/index.d.ts | 40 +++++++++++++++++++ compression-webpack-plugin/tsconfig.json | 20 ++++++++++ compression-webpack-plugin/tslint.json | 7 ++++ 4 files changed, 81 insertions(+) create mode 100644 compression-webpack-plugin/compression-webpack-plugin-tests.ts create mode 100644 compression-webpack-plugin/index.d.ts create mode 100644 compression-webpack-plugin/tsconfig.json create mode 100644 compression-webpack-plugin/tslint.json diff --git a/compression-webpack-plugin/compression-webpack-plugin-tests.ts b/compression-webpack-plugin/compression-webpack-plugin-tests.ts new file mode 100644 index 0000000000..4ee93c78b7 --- /dev/null +++ b/compression-webpack-plugin/compression-webpack-plugin-tests.ts @@ -0,0 +1,14 @@ +import { Configuration } from 'webpack' +import * as CompressionPlugin from 'compression-webpack-plugin' + +const c: Configuration = { + plugins: [ + new CompressionPlugin({ + asset: "[path].gz[query]", + algorithm: "gzip", + test: /\.js$|\.html$/, + threshold: 10240, + minRatio: 0.8 + }) + ] +}; diff --git a/compression-webpack-plugin/index.d.ts b/compression-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..cf65f55300 --- /dev/null +++ b/compression-webpack-plugin/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for compression-webpack-plugin 0.3.2 +// Project: https://github.com/webpack-contrib/compression-webpack-plugin +// Definitions by: Anton Kandybo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'webpack'; + +export = CompressionPlugin; + +declare class CompressionPlugin extends Plugin { + constructor(options?: CompressionPlugin.Options); +} + +declare namespace CompressionPlugin { + export interface Options { + asset?: string; + algorithm?: string; + test?: RegExp | RegExp[]; + regExp?: RegExp | RegExp[]; + threshold?: number; + minRatio?: number; + + // zopfli options + verbose?: boolean; + verbose_more?: boolean; + numiterations?: number; + blocksplitting?: boolean; + blocksplittinglast?: boolean; + blocksplittingmax?: number; + + // zlib options + level?: number; + flush?: number; + chunkSize?: number; + windowBits?: number; + memLevel?: number; + strategy?: number; + dictionary?: any; + } +} diff --git a/compression-webpack-plugin/tsconfig.json b/compression-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..f9c84d64f8 --- /dev/null +++ b/compression-webpack-plugin/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "compression-webpack-plugin-tests.ts" + ] +} diff --git a/compression-webpack-plugin/tslint.json b/compression-webpack-plugin/tslint.json new file mode 100644 index 0000000000..02312e1c7d --- /dev/null +++ b/compression-webpack-plugin/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "../tslint.json", + "rules": { + "dt-header": false + } + } + \ No newline at end of file From 972fc4d5606f96fc50b01bf2578f2cff786dd3a7 Mon Sep 17 00:00:00 2001 From: Anton Kandybo Date: Mon, 6 Mar 2017 01:26:47 +0200 Subject: [PATCH 028/276] Added es6 lib --- compression-webpack-plugin/tsconfig.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compression-webpack-plugin/tsconfig.json b/compression-webpack-plugin/tsconfig.json index f9c84d64f8..70383d3658 100644 --- a/compression-webpack-plugin/tsconfig.json +++ b/compression-webpack-plugin/tsconfig.json @@ -2,6 +2,9 @@ "compilerOptions": { "module": "commonjs", "target": "es6", + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, From da5139066741bd05d72d981936a696ddda51be4e Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Mon, 6 Mar 2017 14:35:08 +1100 Subject: [PATCH 029/276] tidy up some linting warnings --- fs-extra/fs-extra-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts index 896d6411f7..26ad80ffb4 100644 --- a/fs-extra/fs-extra-tests.ts +++ b/fs-extra/fs-extra-tests.ts @@ -2,7 +2,7 @@ /// import fs = require('fs-extra'); -import * as Path from 'path' +import * as Path from 'path'; var src: string; var dest: string; @@ -22,7 +22,7 @@ fs.copy(src, dest, { clobber: true, preserveTimestamps: true, - filter: (src: string) => {return false} + filter: (src: string) => { return false; } }, errorCallback ); @@ -43,7 +43,7 @@ fs.copySync(src, dest, { clobber: true, preserveTimestamps: true, - filter: (src: string) => {return false} + filter: (src: string) => { return false; } } ); fs.copySync(src, dest, From 23de3bee82fd19f2178a7179b9f649feba771210 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Mon, 6 Mar 2017 14:35:29 +1100 Subject: [PATCH 030/276] walk and walkSync now live in different packages --- fs-extra/fs-extra-tests.ts | 32 -------------------------------- fs-extra/index.d.ts | 3 --- 2 files changed, 35 deletions(-) diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts index 26ad80ffb4..f2056d3e06 100644 --- a/fs-extra/fs-extra-tests.ts +++ b/fs-extra/fs-extra-tests.ts @@ -102,35 +102,3 @@ fs.ensureSymlink(path, errorCallback); fs.ensureSymlinkSync(path); fs.emptyDir(path, errorCallback); fs.emptyDirSync(path); - -var items: string[]; -fs.walk("my-path") - .on('data', function (item) { - items.push(item.path); - }) - .on('end', function () { - console.dir(items); - }); - -const ignoreHiddenFiles = (item: string): boolean => { - const basename = Path.basename(item) - return basename === '.' || basename[0] !== '.' -} - -const sortPaths = (left: string, right: string) => left.localeCompare(right); - -const options = { - filter: ignoreHiddenFiles, - pathSorter: sortPaths -} - -fs.walk(path, options) - .on('readable', function (this: fs.PathEntryStream) { - let item: fs.PathEntry | undefined - while ((item = this.read())) { - items.push(item.path) - } - }) - .on('end', function () { - - }) diff --git a/fs-extra/index.d.ts b/fs-extra/index.d.ts index 2cc47724c8..e30426321e 100644 --- a/fs-extra/index.d.ts +++ b/fs-extra/index.d.ts @@ -120,9 +120,6 @@ export type PathEntryStream = { read(): PathEntry | null } -export function walk(path: string, options?: WalkOptions): WalkEventEmitter; -export function walkSync(path: string): ReadonlyArray; - export interface CopyFilterFunction { (src: string): boolean } From 64708242be98bb708fe877226d7970aa34219b2b Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Mon, 6 Mar 2017 14:38:18 +1100 Subject: [PATCH 031/276] tag the version for fs-extra --- fs-extra/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs-extra/index.d.ts b/fs-extra/index.d.ts index e30426321e..e17b47115f 100644 --- a/fs-extra/index.d.ts +++ b/fs-extra/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for fs-extra +// Type definitions for fs-extra v2.0.0 // Project: https://github.com/jprichardson/node-fs-extra // Definitions by: midknight41 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 416210d5bbfba701abb723c8c7855d9bcd56258e Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Mon, 6 Mar 2017 14:38:30 +1100 Subject: [PATCH 032/276] add myself as a reviewer --- fs-extra/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs-extra/index.d.ts b/fs-extra/index.d.ts index e17b47115f..57f4a6fb24 100644 --- a/fs-extra/index.d.ts +++ b/fs-extra/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for fs-extra v2.0.0 // Project: https://github.com/jprichardson/node-fs-extra -// Definitions by: midknight41 +// Definitions by: midknight41 , Brendan Forster // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Imported from: https://github.com/soywiz/typescript-node-definitions/fs-extra.d.ts From f3840dd3df0da771a82f174958bc376e6ef02d99 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Mon, 6 Mar 2017 10:54:34 +0100 Subject: [PATCH 033/276] Underscore: A bunch of fixes, and added a lot of "or undefined" for strict nulls. --- underscore/index.d.ts | 115 +++++++++++++++++---------------- underscore/underscore-tests.ts | 2 +- 2 files changed, 61 insertions(+), 56 deletions(-) diff --git a/underscore/index.d.ts b/underscore/index.d.ts index 48452b9e2e..f0f6784de3 100644 --- a/underscore/index.d.ts +++ b/underscore/index.d.ts @@ -153,9 +153,19 @@ declare module _ { **/ map( list: _.List, - iterator: _.ListIterator | _.IterateePropertyShorthand | _.IterateeMatcherShorthand, + iterator: _.ListIterator, context?: any): TResult[]; + map( + list: _.List, + iterator: _.IterateePropertyShorthand, + context?: any): T[]; + + map( + list: _.List, + iterator: _.IterateeMatcherShorthand, + context?: any): boolean[]; + /** * @see _.map * @param object Maps the properties of this object. @@ -171,18 +181,7 @@ declare module _ { /** * @see _.map **/ - collect( - list: _.List, - iterator: _.ListIterator | _.IterateePropertyShorthand | _.IterateeMatcherShorthand, - context?: any): TResult[]; - - /** - * @see _.map - **/ - collect( - object: _.Dictionary, - iterator: _.ObjectIterator, - context?: any): TResult[]; + collect: typeof _.map; /** * Also known as inject and foldl, reduce boils down a list of values into a single value. @@ -196,7 +195,7 @@ declare module _ { * @return Reduced object result. **/ reduce( - list: _.Collection, + list: _.List, iterator: _.MemoIterator, memo?: TResult, context?: any): TResult; @@ -211,11 +210,17 @@ declare module _ { * @see _.reduce **/ inject( - list: _.Collection, + list: _.List, iterator: _.MemoIterator, memo?: TResult, context?: any): TResult; + inject( + list: _.Dictionary, + iterator: _.MemoObjectIterator, + memo?: TResult, + context?: any): TResult; + /** * @see _.reduce **/ @@ -262,7 +267,7 @@ declare module _ { find( list: _.List, iterator: _.ListIterator, - context?: any): T; + context?: any): T | undefined; /** * @see _.find @@ -270,21 +275,21 @@ declare module _ { find( object: _.Dictionary, iterator: _.ObjectIterator, - context?: any): T; + context?: any): T | undefined; /** * @see _.find **/ find( object: _.List | _.Dictionary, - iterator: U): T; + iterator: U): T | undefined; /** * @see _.find **/ find( object: _.List | _.Dictionary, - iterator: string): T; + iterator: string): T | undefined; /** * @see _.find @@ -292,7 +297,7 @@ declare module _ { detect( list: _.List, iterator: _.ListIterator, - context?: any): T; + context?: any): T | undefined; /** * @see _.find @@ -300,21 +305,21 @@ declare module _ { detect( object: _.Dictionary, iterator: _.ObjectIterator, - context?: any): T; + context?: any): T | undefined; /** * @see _.find **/ detect( object: _.List | _.Dictionary, - iterator: U): T; + iterator: U): T | undefined; /** * @see _.find **/ detect( object: _.List | _.Dictionary, - iterator: string): T; + iterator: string): T | undefined; /** * Looks through each value in the list, returning an array of all the values that pass a truth @@ -372,7 +377,7 @@ declare module _ { **/ findWhere( list: _.List, - properties: U): T; + properties: U): T | undefined; /** * Returns the values in list without the elements that the truth test (iterator) passes. @@ -754,7 +759,7 @@ declare module _ { * @param array Retrieves the first element of this array. * @return Returns the first element of `array`. **/ - first(array: _.List): T; + first(array: _.List): T | undefined; /** * @see _.first @@ -767,7 +772,7 @@ declare module _ { /** * @see _.first **/ - head(array: _.List): T; + head(array: _.List): T | undefined; /** * @see _.first @@ -804,7 +809,7 @@ declare module _ { * @param array Retrieves the last element of this array. * @return Returns the last element of `array`. **/ - last(array: _.List): T; + last(array: _.List): T | undefined; /** * @see _.last @@ -3768,7 +3773,7 @@ declare module _ { * @param attrs Object with key values pair * @return Predicate function **/ - matches(attrs: T): _.ListIterator; + matches(attrs: T): _.ListIterator; /** * Returns a predicate function that will tell you if a passed in object contains all of the key/value properties present in attrs. @@ -3776,7 +3781,7 @@ declare module _ { * @param attrs Object with key values pair * @return Predicate function **/ - matcher(attrs: T): _.ListIterator; + matcher(attrs: T): _.ListIterator; /** * Returns a function that will itself return the key property of any passed-in object. @@ -4100,22 +4105,22 @@ declare module _ { * Wrapped type `any[]`. * @see _.each **/ - each(iterator: _.ListIterator, context?: any): T[]; + each(iterator: _.ListIterator, context?: any): _.List; /** * @see _.each **/ - each(iterator: _.ObjectIterator, context?: any): T[]; + each(iterator: _.ObjectIterator, context?: any): _.List; /** * @see _.each **/ - forEach(iterator: _.ListIterator, context?: any): T[]; + forEach(iterator: _.ListIterator, context?: any): _.List; /** * @see _.each **/ - forEach(iterator: _.ObjectIterator, context?: any): T[]; + forEach(iterator: _.ObjectIterator, context?: any): _.List; /** * Wrapped type `any[]`. @@ -4170,32 +4175,32 @@ declare module _ { * Wrapped type `any[]`. * @see _.find **/ - find(iterator: _.ListIterator | _.ObjectIterator, context?: any): T; + find(iterator: _.ListIterator | _.ObjectIterator, context?: any): T | undefined; /** * @see _.find **/ - find(interator: U): T; + find(interator: U): T | undefined; /** * @see _.find **/ - find(interator: string): T; + find(interator: string): T | undefined; /** * @see _.find **/ - detect(iterator: _.ListIterator | _.ObjectIterator, context?: any): T; + detect(iterator: _.ListIterator | _.ObjectIterator, context?: any): T | undefined; /** * @see _.find **/ - detect(interator?: U): T; + detect(interator?: U): T | undefined; /** * @see _.find **/ - detect(interator?: string): T; + detect(interator?: string): T | undefined; /** * Wrapped type `any[]`. @@ -4218,7 +4223,7 @@ declare module _ { * Wrapped type `any[]`. * @see _.findWhere **/ - findWhere(properties: U): T; + findWhere(properties: U): T | undefined; /** * Wrapped type `any[]`. @@ -4399,7 +4404,7 @@ declare module _ { * Wrapped type `any[]`. * @see _.first **/ - first(): T; + first(): T | undefined; /** * Wrapped type `any[]`. @@ -4410,7 +4415,7 @@ declare module _ { /** * @see _.first **/ - head(): T; + head(): T | undefined; /** * @see _.first @@ -4437,7 +4442,7 @@ declare module _ { * Wrapped type `any[]`. * @see _.last **/ - last(): T; + last(): T | undefined; /** * Wrapped type `any[]`. @@ -4690,7 +4695,7 @@ declare module _ { * Wrapped type `Function`. * @see _.negate **/ - negate(): boolean; + negate(): (...args: any[]) => boolean; /** * Wrapped type `Function[]`. @@ -4805,13 +4810,13 @@ declare module _ { * Wrapped type `any[]`. * @see _.matches **/ - matches(): _.ListIterator; + matches(): _.ListIterator; /** * Wrapped type `any[]`. * @see _.matcher **/ - matcher(): _.ListIterator; + matcher(): _.ListIterator; /** * Wrapped type `string`. @@ -5130,32 +5135,32 @@ declare module _ { * Wrapped type `any[]`. * @see _.find **/ - find(iterator: _.ListIterator | _.ObjectIterator, context?: any): _ChainSingle; + find(iterator: _.ListIterator | _.ObjectIterator, context?: any): _ChainSingle; /** * @see _.find **/ - find(interator: U): _ChainSingle; + find(interator: U): _ChainSingle; /** * @see _.find **/ - find(interator: string): _ChainSingle; + find(interator: string): _ChainSingle; /** * @see _.find **/ - detect(iterator: _.ListIterator | _.ObjectIterator, context?: any): _ChainSingle; + detect(iterator: _.ListIterator | _.ObjectIterator, context?: any): _ChainSingle; /** * @see _.find **/ - detect(interator: U): _ChainSingle; + detect(interator: U): _ChainSingle; /** * @see _.find **/ - detect(interator: string): _ChainSingle; + detect(interator: string): _ChainSingle; /** * Wrapped type `any[]`. @@ -5359,7 +5364,7 @@ declare module _ { * Wrapped type `any[]`. * @see _.first **/ - first(): _ChainSingle; + first(): _ChainSingle; /** * Wrapped type `any[]`. @@ -5765,13 +5770,13 @@ declare module _ { * Wrapped type `any[]`. * @see _.matches **/ - matches(): _Chain; + matches(): _Chain; /** * Wrapped type `any[]`. * @see _.matcher **/ - matcher(): _Chain; + matcher(): _Chain; /** * Wrapped type `string`. diff --git a/underscore/underscore-tests.ts b/underscore/underscore-tests.ts index d3a5729022..f5e8e984ef 100644 --- a/underscore/underscore-tests.ts +++ b/underscore/underscore-tests.ts @@ -212,7 +212,7 @@ interface Family { name: string; relation: string; } -var isUncleMoe = _.matches({ name: 'moe', relation: 'uncle' }); +var isUncleMoe = _.matches({ name: 'moe', relation: 'uncle' }); _.filter([{ name: 'larry', relation: 'father' }, { name: 'moe', relation: 'uncle' }], isUncleMoe); From d6bf165b66ae9fb11b8080eed64fba18207b7d54 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Mon, 6 Mar 2017 11:04:25 +0100 Subject: [PATCH 034/276] Underscore: Updated version number (I've done it before: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/11117) --- underscore/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/underscore/index.d.ts b/underscore/index.d.ts index f0f6784de3..856bf8e0fa 100644 --- a/underscore/index.d.ts +++ b/underscore/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Underscore 1.7.0 +// Type definitions for Underscore 1.8 // Project: http://underscorejs.org/ // Definitions by: Boris Yankov , Josh Baldwin , Christopher Currens // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From eadbc0cd3badb6f402d66311b171e57d860f0b84 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Mon, 6 Mar 2017 15:32:29 +0100 Subject: [PATCH 035/276] async: Various fixes, mostly related to strict-nulls. Also some places where the error type was wrong. --- async/index.d.ts | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/async/index.d.ts b/async/index.d.ts index e3fbe7e512..7f71f3b9bc 100644 --- a/async/index.d.ts +++ b/async/index.d.ts @@ -6,17 +6,16 @@ interface Dictionary { [key: string]: T; } interface ErrorCallback { (err?: T): void; } -interface AsyncWaterfallCallback { (err: E, ...args: any[]): void; } -interface AsyncBooleanResultCallback { (err: E, truthValue: boolean): void; } -interface AsyncResultCallback { (err: E, result: T): void; } -interface AsyncResultArrayCallback { (err: E, results: T[]): void; } -interface AsyncResultObjectCallback { (err: E, results: Dictionary): void; } +interface AsyncBooleanResultCallback { (err?: E, truthValue?: boolean): void; } +interface AsyncResultCallback { (err?: E, result?: T): void; } +interface AsyncResultArrayCallback { (err?: E, results?: (T | undefined)[]): void; } +interface AsyncResultObjectCallback { (err: E | undefined, results: Dictionary): void; } -interface AsyncFunction { (callback: (err?: E, result?: T) => void): void; } +interface AsyncFunction { (callback: (err?: E, result?: T) => void): any; } interface AsyncIterator { (item: T, callback: ErrorCallback): void; } interface AsyncForEachOfIterator { (item: T, key: number|string, callback: ErrorCallback): void; } interface AsyncResultIterator { (item: T, callback: AsyncResultCallback): void; } -interface AsyncMemoIterator { (memo: R, item: T, callback: AsyncResultCallback): void; } +interface AsyncMemoIterator { (memo: R | undefined, item: T, callback: AsyncResultCallback): void; } interface AsyncBooleanIterator { (item: T, callback: AsyncBooleanResultCallback): void; } interface AsyncWorker { (task: T, callback: ErrorCallback): void; } @@ -76,7 +75,7 @@ interface AsyncPriorityQueue { interface AsyncCargo { length(): number; - payload: number; + payload?: number; push(task: any, callback? : Function): void; push(task: any[], callback? : Function): void; saturated(): void; @@ -186,25 +185,25 @@ interface Async { cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo; auto(tasks: any, concurrency?: number, callback?: AsyncResultCallback): void; autoInject(tasks: any, callback?: AsyncResultCallback): void; - retry(opts: number, task: (callback : AsyncResultCallback, results: any) => void, callback: AsyncResultCallback): void; - retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results : any) => void, callback: AsyncResultCallback): void; - retryable(opts: number | {times: number, interval: number}, task: AsyncFunction): AsyncFunction; - apply(fn: Function, ...arguments: any[]): AsyncFunction; + retry(opts: number, task: (callback : AsyncResultCallback, results: any) => void, callback: AsyncResultCallback): void; + retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results : any) => void, callback: AsyncResultCallback): void; + retryable(opts: number | {times: number, interval: number}, task: AsyncFunction): AsyncFunction; + apply(fn: Function, ...arguments: any[]): AsyncFunction; nextTick(callback: Function, ...args: any[]): void; setImmediate: typeof async.nextTick; - reflect(fn: AsyncFunction) : (callback: (err: void, result: {error?: Error, value?: T}) => void) => void; - reflectAll(tasks: AsyncFunction[]): ((callback: (err: void, result: {error?: Error, value?: T}) => void) => void)[]; + reflect(fn: AsyncFunction) : (callback: (err: null, result: {error?: E, value?: T}) => void) => void; + reflectAll(tasks: AsyncFunction[]): ((callback: (err: undefined, result: {error?: E, value?: T}) => void) => void)[]; - timeout(fn: AsyncFunction, milliseconds: number, info?: any): AsyncFunction; - timeout(fn: AsyncResultIterator, milliseconds: number, info?: any): AsyncResultIterator; + timeout(fn: AsyncFunction, milliseconds: number, info?: any): AsyncFunction; + timeout(fn: AsyncResultIterator, milliseconds: number, info?: any): AsyncResultIterator; times (n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; timesSeries(n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; timesLimit(n: number, limit: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; transform(arr: T[], iteratee: (acc: R[], item: T, key: string, callback: (error?: E) => void) => void): void; - transform(arr: T[], acc: R[], iteratee: (acc: R[], item: T, key: string, callback: (error?: E) => void) => void): void; + transform(arr: T[], acc: R[], iteratee: (acc: R[] | null, item: T | undefined[], key?: string, callback?: (error?: E) => void) => void): void; transform(arr: {[key: string] : T}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void): void; transform(arr: {[key: string] : T}, acc: {[key: string] : R}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void): void; @@ -226,4 +225,3 @@ declare var async: Async; declare module "async" { export = async; } - From 393a3b4b8f777b405adaffcc7917b482e576aa7e Mon Sep 17 00:00:00 2001 From: Dasa Paddock Date: Mon, 6 Mar 2017 16:42:06 -0800 Subject: [PATCH 036/276] Update for ArcGIS API for JavaScript version 4.3 --- arcgis-js-api/index.d.ts | 1961 +++++++++++++++++++++++++++++++++++--- 1 file changed, 1814 insertions(+), 147 deletions(-) diff --git a/arcgis-js-api/index.d.ts b/arcgis-js-api/index.d.ts index 87df41a8d8..293c5190e9 100644 --- a/arcgis-js-api/index.d.ts +++ b/arcgis-js-api/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ArcGIS API for JavaScript 4.2 +// Type definitions for ArcGIS API for JavaScript 4.3 // Project: http://js.arcgis.com // Definitions by: Esri // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -32,14 +32,19 @@ declare namespace JSX { declare namespace __esri { export class Accessor { + constructor(obj?: any); + destroyed: boolean; initialized: boolean; declaredClass: string; destroy(): void; + get(propertyName: string): T; get(propertyName: string): any; set(propertyName: string, value: T): this; set(props: HashMap): this; + watch(path: string | string[], callback: WatchCallback, sync?: boolean): WatchHandle; + protected notifyChange(propertyName: string): void; protected _get(propertyName: string): any; protected _get(propertyName: string): T; @@ -69,18 +74,521 @@ declare namespace __esri { remove(): void; } + export interface EachAlwaysResult { + promise: IPromise; + value: any; + error: any; + } + export interface PausableWatchHandle { remove(): void; pause(): void; resume(): void; } + export interface FeatureEditResult { + objectId: number; + error: any; + } + export interface AttributeParamValue { attributeName: string; parameterName: string; value: string; } + export interface DataWorkspace { + id: string; + name: string; + } + + export interface GroupMembership { + id: number; + name: string; + } + + export interface HoldType { + description: string; + id: number; + name: string; + } + + export interface JobPriority { + description: string; + name: string; + value: number; + } + + export interface JobQuery { + id: number; + name: string; + } + + export interface JobStatus { + caption: string; + description: string; + id: number; + name: string; + } + + export interface JobQueryContainer { + containers: JobQueryContainer[]; + id: number; + name: string; + queries: JobQuery[]; + } + + export interface JobQueryDetails { + aliases: string[]; + fields: string[]; + id: number; + name: string; + orderBy: string; + tables: string[]; + where: string; + } + + export interface Privilege { + description: string; + id: number; + name: string; + } + + export interface UserDetails { + lastName: string; + address: string; + faxNumber: string; + firstName: string; + fullName: string; + groups: GroupMembership[]; + email: string; + phoneNumber: string; + privileges: Privilege[]; + roomNumber: string; + userName: string; + userQueries: JobQueryContainer[]; + zipCode: string; + } + + export interface VersionInfo { + access: string; + name: string; + parent: string; + } + + export interface WorkflowManagerServiceInfo { + jobPriorities: JobPriority[]; + activityTypes: ActivityType[]; + currentVersion: number; + dataWorkspaces: DataWorkspace[]; + holdTypes: HoldType[]; + configProperties: any; + jobStatuses: JobStatus[]; + jobTypes: JobType[]; + notificationTypes: NotificationType[]; + privileges: Privilege[]; + publicQueries: JobQueryContainer[]; + } + + export interface JobType { + category: string; + description: string; + id: string; + name: string; + state: string; + } + + export interface JobTypeDetails { + defaultParentVersionName: string; + autoExecuteCreatedJobs: boolean; + category: string; + defaultAssignedTo: string; + defaultAssignedType: string; + defaultDataWorkspaceId: string; + defaultDescription: string; + defaultDueDate: string; + defaultJobDuration: number; + canDataWorkspaceChange: boolean; + defaultPriority: string; + defaultStartDate: Date; + description: string; + id: string; + jobNamingScheme: string; + jobVersionNamingScheme: string; + mxdNamingScheme: string; + name: string; + state: string; + } + + export interface TableRelationship { + cardinality: string; + linkField: string; + tableAlias: string; + tableName: string; + } + + export interface JobCreationParameters { + loi: Geometry; + assignedTo: string; + autoCommitWorkflow: boolean; + autoExecute: boolean; + dataWorkspaceId: string; + description: string; + dueDate: Date; + jobTypeId: number; + assignedType: string; + name: string; + numJobs: string; + ownedBy: string; + parentJobId: number; + parentVersion: string; + priority: number; + startDate: Date; + user: string; + } + + export interface JobQueryParameters { + aliases: string; + fields: string; + orderBy: string; + tables: string; + where: string; + user: string; + } + + export interface JobUpdateParameters { + ownedBy: string; + assignedTo: string; + dataWorkspaceId: string; + description: string; + dueDate: Date; + loi: Geometry; + jobId: number; + name: string; + assignedType: string; + parentJobId: number; + parentVersion: string; + percent: number; + priority: number; + startDate: Date; + status: number; + versionName: string; + user: string; + } + + export interface AuxRecordDescription { + properties: any; + recordId: number; + tableName: string; + } + + export interface ActivityType { + desription: string; + id: number; + message: string; + name: string; + } + + export interface AuxRecordContainer { + records: AuxRecord; + relationshipType: string; + tableAlias: string; + tableName: string; + } + + export interface JobTaskJobInfo { + name: string; + assignedTo: string; + childJobIds: number[]; + createdBy: string; + createdDate: Date; + dataWorkspaceId: string; + description: string; + dueDate: Date; + endDate: Date; + id: number; + jobTypeId: number; + loi: Geometry; + assignedType: string; + ownedBy: string; + parentJobId: number; + parentVersion: string; + pendingDays: number; + percentageComplete: number; + priority: number; + stage: string; + startDate: Date; + status: number; + versionExists: boolean; + versionInfo: JobVersionInfo; + versionName: string; + } + + export interface QueryResult { + fields: QueryFieldInfo[]; + rows: string[]; + } + + export interface AuxRecord { + displayProperty: any; + id: number; + recordvalues: AuxRecordValue; + } + + export interface AuxRecordValue { + filter: string; + alias: string; + data: any; + dataType: string; + displayOrder: number; + displayType: string; + domain: string; + canUpdate: boolean; + length: number; + name: string; + required: boolean; + tableListClass: string; + tableListDisplayField: string; + tableListStoreField: string; + userVisible: boolean; + } + + export interface FieldValue { + description: string; + value: any; + } + + export interface JobVersionInfo { + dataWorkspaceId: string; + name: string; + parent: string; + created: boolean; + owner: string; + } + + export interface QueryFieldInfo { + alias: string; + length: string; + name: string; + type: string; + } + + export interface JobAttachment { + filename: string; + folder: string; + id: number; + storageType: string; + } + + export interface JobDependency { + depJobId: number; + depOnType: string; + depOnValue: string; + heldOnValue: number; + holdOnType: string; + id: number; + jobID: string; + } + + export interface ChangeRule { + description: string; + evaluators: any[]; + id: number; + name: string; + notifier: any; + summarize: boolean; + } + + export interface DataSetEvaluator { + dataSetConfigurations: DatasetConfiguration[]; + name: string; + type: string; + } + + export interface AOIEvaluator { + aoi: Polygon; + inverse: boolean; + name: string; + relation: string; + type: string; + useJobAOI: boolean; + } + + export interface DatasetConfiguration { + changeCondition: number; + changeFields: string; + dataset: string; + dataWorkspaceId: string; + name: string; + whereConditions: WhereCondition[]; + } + + export interface EmailNotifier { + attachJobAttachments: boolean; + message: string; + name: string; + senderEmail: string; + senderName: string; + subject: string; + subscribers: string[]; + type: string; + } + + export interface WhereCondition { + compareValue: any; + field: string; + operator: string; + } + + export interface NotificationType { + attachJobAttachments: boolean; + id: number; + message: string; + senderEmail: string; + senderName: string; + subject: string; + subscribers: string[]; + type: string; + } + + export interface ChangeRuleMatch { + changeTime: Date; + changeType: string; + dataset: string; + dataWorkspaceId: string; + id: string; + jobID: string; + ruleID: string; + } + + export interface ReportDataGroup { + aggregateLabel: string; + aggregateValue: string; + row: string[]; + value: string; + } + + export interface ReportData { + columns: string[]; + description: string; + groups: ReportDataGroup[]; + title: string; + } + + export interface Report { + description: string; + hierarchy: string; + id: number; + name: string; + title: string; + } + + export interface ExecuteInfo { + conflicts: WorkflowConflicts; + errorCode: number; + errorDescription: string; + executionResult: string; + hasConflicts: boolean; + hasReturnCode: boolean; + jobID: number; + returnCode: number; + stepID: number; + threwError: boolean; + } + + export interface Step { + hasBeenExecuted: boolean; + assignedTo: string; + async: boolean; + autoRun: boolean; + canSkip: boolean; + canSpawnConcurrency: boolean; + commonId: number; + defaultPercentComplete: number; + assignedType: string; + hasBeenStarted: boolean; + id: number; + name: string; + selfCheck: boolean; + statusId: number; + stepPercentComplete: number; + notificationType: string; + stepType: StepType; + } + + export interface StepType { + program: string; + arguments: string; + executionType: string; + id: number; + name: string; + description: string; + stepDescriptionLink: string; + stepDescriptionType: string; + stepIndicatorType: string; + supportedPlatform: string; + visible: boolean; + } + + export interface WorkflowDisplayDetails { + annotations: WorkflowAnnotationDisplayDetails[]; + paths: WorkflowPathDisplayDetails[]; + steps: WorkflowStepDisplayDetails[]; + } + + export interface WorkflowOption { + returnCode: number; + steps: WorkflowStepInfo[]; + } + + export interface WorkflowStepInfo { + id: number; + name: string; + } + + export interface WorkflowAnnotationDisplayDetails { + centerX: number; + centerY: number; + fillColor: any; + height: number; + label: string; + labelColor: any; + OutlineColor: any; + width: number; + } + + export interface WorkflowConflicts { + jobID: number; + options: WorkflowOption[]; + spawnsConcurrency: boolean; + stepId: number; + } + + export interface WorkflowPathDisplayDetails { + destStepId: number; + sourceStepID: number; + label: string; + labelColor: any; + labelX: number; + labelY: number; + lineColor: any; + pathObject: any; + } + + export interface WorkflowStepDisplayDetails { + labelColor: any; + centerX: number; + fillColor: any; + height: number; + label: string; + centerY: number; + OutlineColor: any; + shape: string; + stepId: number; + stepType: string; + width: number; + } + export interface ExternalRenderer { setup(): void; render(): void; @@ -139,26 +647,6 @@ declare namespace __esri { suggestionTemplate: string; } - export interface SearchViewModelLocatorSource { - categories: string[]; - countryCode: string; - localSearchOptions: any; - locationToAddressDistance: number; - searchTemplate: string; - locator: Locator; - singleLineFieldName: string; - } - - export interface SearchViewModelFeatureLayerSource { - displayField: string; - exactMatch: boolean; - featureLayer: FeatureLayer; - searchFields: string[]; - searchQueryParams: any; - suggestQueryParams: any; - suggestionTemplate: string; - } - export type GetHeader = (headerName: string) => string; export type WatchCallback = (newValue: any, oldValue: any, propertyName: string, target: Accessor) => void; @@ -282,11 +770,33 @@ declare namespace __esri { offset?: number; } + export interface FeatureLayerApplyEditsEdits { + addFeatures?: Graphic[]; + updateFeatures?: Graphic[]; + deleteFeatures?: Graphic[] | any[]; + } + + export interface FeatureLayerCapabilities { + operations: FeatureLayerCapabilitiesOperations; + } + + export interface FeatureLayerCapabilitiesOperations { + supportsAdd: boolean; + supportsDelete: boolean; + supportsUpdate: boolean; + supportsEditing: boolean; + supportsQuery: boolean; + } + export interface FeatureLayerElevationInfo { mode: string; offset?: number; } + export interface FeatureLayerGetFieldDomainOptions { + feature: Graphic; + } + export interface GraphicsLayerElevationInfo { mode: string; offset?: number; @@ -306,6 +816,21 @@ declare namespace __esri { offset?: number; } + export interface StreamLayerFilter { + geometry: Extent; + where: string; + } + + export interface StreamLayerPurgeOptions { + displayCount: number; + age: number; + } + + export interface StreamLayerUpdateFilterFilterChanges { + geometry: Extent; + where: string; + } + export interface VectorTileLayerCurrentStyleInfo { serviceUrl: string; styleUrl: string; @@ -382,6 +907,14 @@ declare namespace __esri { label: string; } + export interface PointCloudRendererPointSizeAlgorithm { + type: string; + useRealWorldSymbolSizes: boolean; + size: number; + scaleFactor: number; + minSize: number; + } + export interface PointCloudClassBreaksRendererColorClassBreakInfos { minValue: number; maxValue: number; @@ -422,8 +955,8 @@ declare namespace __esri { } export interface Symbol3DStyleOrigin { - styleName: string; - styleUrl: string; + styleName?: string; + styleUrl?: string; name: string; } @@ -508,6 +1041,294 @@ declare namespace __esri { tolerance: number; } + export interface ConfigurationTaskGetDataWorkspaceDetailsParams { + dataWorkspaceId: string; + user: string; + } + + export interface ConfigurationTaskGetUserJobQueryDetailsParams { + queryId: number; + user: string; + } + + export interface JobTaskAddEmbeddedAttachmentParams { + jobId: number; + form: any; + user: string; + } + + export interface JobTaskAddLinkedAttachmentParams { + jobId: number; + attachmentType: number; + path: string; + user: string; + } + + export interface JobTaskAddLinkedRecordParams { + jobId: number; + tableName: string; + user: string; + } + + export interface JobTaskAssignJobsParams { + jobIds: number[]; + assignedType: string; + assignedTo: string; + user: string; + } + + export interface JobTaskCloseJobsParams { + jobIds: number[]; + user: string; + } + + export interface JobTaskCreateDependencyParams { + jobId: number; + heldOnType: string; + heldOnValue: number; + depJobId: number; + depOnType: string; + depOnValue: number; + user: string; + } + + export interface JobTaskCreateHoldParams { + jobId: number; + holdTypeId: number; + comments: string; + user: string; + } + + export interface JobTaskCreateJobVersionParams { + jobId: number; + name: string; + parent: string; + user: string; + } + + export interface JobTaskDeleteAttachmentParams { + jobId: number; + attachmentId: number; + user: string; + } + + export interface JobTaskDeleteDependencyParams { + jobId: number; + dependencyId: number; + user: string; + } + + export interface JobTaskDeleteJobsParams { + jobIds: number[]; + deleteHistory?: boolean; + user: string; + } + + export interface JobTaskDeleteLinkedRecordParams { + jobId: number; + tableName: string; + recordId: number; + user: string; + } + + export interface JobTaskGetAttachmentContentUrlParams { + jobId: number; + attachmentId: number; + } + + export interface JobTaskListFieldValuesParams { + jobId: number; + tableName: string; + field: string; + user: string; + } + + export interface JobTaskListMultiLevelFieldValuesParams { + field: string; + previousSelectedValues: string[]; + user: string; + } + + export interface JobTaskLogActionParams { + jobId: number; + activityTypeId: number; + comments: string; + user: string; + } + + export interface JobTaskQueryJobsParams { + queryId: number; + user: string; + } + + export interface JobTaskQueryMultiLevelSelectedValuesParams { + field: string; + user: string; + } + + export interface JobTaskReleaseHoldParams { + jobId: number; + holdId: number; + } + + export interface JobTaskReopenClosedJobsParams { + jobIds: number[]; + user: string; + } + + export interface JobTaskSearchJobsParams { + text: string; + user: string; + } + + export interface JobTaskUnassignJobsParams { + jobIds: number[]; + user: string; + } + + export interface JobTaskUpdateNotesParams { + jobId: number; + notes: string; + user: string; + } + + export interface JobTaskUpdateRecordParams { + jobId: number; + record: AuxRecordDescription; + user: string; + } + + export interface NotificationTaskAddChangeRuleParams { + rule: ChangeRule; + user: string; + } + + export interface NotificationTaskDeleteChangeRuleParams { + ruleId: string; + user: string; + } + + export interface NotificationTaskNotifySessionParams { + sessionid: string; + deleteAfter: boolean; + user: string; + } + + export interface NotificationTaskQueryChangeRulesParams { + name: string; + description: string; + searchType: string; + user: string; + } + + export interface NotificationTaskRunSpatialNotificationOnHistoryParams { + dataWorkspaceId: string; + from: Date; + to: Date; + logMatches: boolean; + send: boolean; + user: string; + } + + export interface NotificationTaskSendNotificationParams { + jobId: number; + notificationType: string; + user: string; + } + + export interface NotificationTaskSubscribeToNotificationParams { + notificationTypeId: number; + email: string; + user: string; + } + + export interface NotificationTaskUnsubscribeFromNotificationParams { + notificationTypeId: number; + email: string; + user: string; + } + + export interface ReportTaskGenerateReportParams { + reportId: number; + user: string; + } + + export interface ReportTaskGetReportContentUrlParams { + reportId: number; + user: number; + } + + export interface ReportTaskGetReportDataParams { + reportId: number; + user: string; + } + + export interface TokenTaskParseTokensParams { + jobId: any; + stringToParse: string; + user: string; + } + + export interface WorkflowTaskCanRunStepParams { + jobId: number; + stepId: number; + user: string; + } + + export interface WorkflowTaskExecuteStepsParams { + jobId: number; + stepIds: number[]; + auto: boolean; + user: string; + } + + export interface WorkflowTaskGetStepDescriptionParams { + jobId: number; + stepId: number; + } + + export interface WorkflowTaskGetStepFileUrlParams { + jobId: number; + stepId: number; + } + + export interface WorkflowTaskGetStepParams { + jobId: number; + stepId: number; + } + + export interface WorkflowTaskMarkStepsAsDoneParams { + jobId: number; + stepIds: number[]; + user: string; + } + + export interface WorkflowTaskMoveToNextStepParams { + jobId: number; + stepId: number; + returnCode: number; + user: string; + } + + export interface WorkflowTaskRecreateWorkflowParams { + jobId: number; + user: string; + } + + export interface WorkflowTaskResolveConflictParams { + jobId: number; + stepId: number; + optionReturnCode: number; + optionStepIds: number[]; + user: string; + } + + export interface WorkflowTaskSetCurrentStepParams { + jobId: number; + stepId: number; + user: string; + } + export interface MapViewConstraints { lods?: LOD[]; minScale?: number; @@ -804,6 +1625,17 @@ declare namespace __esri { urlPrefix: string; } + export interface configWorkers { + loaderConfig: configWorkersLoaderConfig; + } + + export interface configWorkersLoaderConfig { + has: any; + paths: any; + map: any; + packages: any[]; + } + export interface requestEsriRequestOptions { callbackParamName?: string; query?: any; @@ -827,6 +1659,7 @@ declare namespace __esri { cast?: Function; readOnly?: boolean; aliasOf?: string; + value?: any; } export interface colorCreateContinuousRendererParams { @@ -895,21 +1728,22 @@ declare namespace __esri { title: string; } - export interface sizeCreateVisualVariableParams { + export interface sizeCreateVisualVariablesParams { layer: FeatureLayer | SceneLayer; field: string; normalizationField?: string; basemap?: string | Basemap; sizeScheme?: any | any | any; - legendOptions?: sizeCreateVisualVariableParamsLegendOptions; + legendOptions?: sizeCreateVisualVariablesParamsLegendOptions; statistics?: any; minValue?: number; maxValue?: number; view?: SceneView; worldScale?: boolean; + axis?: boolean; } - export interface sizeCreateVisualVariableParamsLegendOptions { + export interface sizeCreateVisualVariablesParamsLegendOptions { title: string; } @@ -972,6 +1806,7 @@ declare namespace __esri { } export interface univariateColorSizeCreateVisualVariablesParamsSizeOptions { + axis?: boolean; sizeScheme?: any | any | any; legendOptions?: univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions; } @@ -1433,6 +2268,7 @@ declare namespace __esri { expand(factor: number): Extent; intersection(extent: Extent): Extent; intersects(geometry: Geometry): boolean; + normalize(): Extent[]; offset(dx: number, dy: number, dz: number): Extent; union(extent: Extent): Extent; } @@ -1519,6 +2355,7 @@ declare namespace __esri { copy(other: Point): void; distance(other: Point): number; equals(point: Point): boolean; + normalize(): Point; } interface PointConstructor { @@ -1556,6 +2393,9 @@ declare namespace __esri { interface PolygonConstructor { new(properties?: PolygonProperties): Polygon; + + fromExtent(extent: Extent): Polygon; + fromJSON(json: any): Polygon; } @@ -1873,6 +2713,7 @@ declare namespace __esri { } interface FeatureLayer extends Layer, PortalLayer, ScaleRangeLayer { + capabilities: FeatureLayerCapabilities; copyright: string; definitionExpression: string; elevationInfo: FeatureLayerElevationInfo; @@ -1898,7 +2739,9 @@ declare namespace __esri { url: string; version: number; + applyEdits(edits: FeatureLayerApplyEditsEdits): IPromise; createQuery(): Query; + getFieldDomain(fieldName: string, options?: FeatureLayerGetFieldDomainOptions): Domain; queryExtent(params?: Query): IPromise; queryFeatureCount(params?: Query): IPromise; queryFeatures(params?: Query): IPromise; @@ -1914,6 +2757,7 @@ declare namespace __esri { export const FeatureLayer: FeatureLayerConstructor; interface FeatureLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { + capabilities?: FeatureLayerCapabilities; copyright?: string; definitionExpression?: string; elevationInfo?: FeatureLayerElevationInfo; @@ -1940,6 +2784,26 @@ declare namespace __esri { version?: number; } + interface GeoRSSLayer extends Layer { + lineSymbol: SimpleLineSymbol; + pointSymbol: PictureMarkerSymbol; + polygonSymbol: SimpleFillSymbol; + url: string; + } + + interface GeoRSSLayerConstructor { + new(properties?: GeoRSSLayerProperties): GeoRSSLayer; + } + + export const GeoRSSLayer: GeoRSSLayerConstructor; + + interface GeoRSSLayerProperties extends LayerProperties { + lineSymbol?: SimpleLineSymbolProperties; + pointSymbol?: PictureMarkerSymbolProperties; + polygonSymbol?: SimpleFillSymbolProperties; + url?: string; + } + interface GraphicsLayer extends Layer, ScaleRangeLayer { elevationInfo: GraphicsLayerElevationInfo; graphics: Collection; @@ -2061,6 +2925,7 @@ declare namespace __esri { } interface SceneLayer extends Layer, SceneService, PortalLayer { + definitionExpression: string; elevationInfo: SceneLayerElevationInfo; fields: Field[]; geometryType: string; @@ -2072,6 +2937,7 @@ declare namespace __esri { popupTemplate: PopupTemplate; renderer: Renderer; + createQuery(): Query; getFieldUsageInfo(fieldName: string): any; queryExtent(params?: Query): IPromise; queryFeatureCount(params?: Query): IPromise; @@ -2088,6 +2954,7 @@ declare namespace __esri { export const SceneLayer: SceneLayerConstructor; interface SceneLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { + definitionExpression?: string; elevationInfo?: SceneLayerElevationInfo; fields?: FieldProperties[]; geometryType?: string; @@ -2101,9 +2968,12 @@ declare namespace __esri { } interface StreamLayer extends FeatureLayer { + filter: StreamLayerFilter; geometryDefinition: Extent; maximumTrackPoints: number; - purgeOptions: any; + purgeOptions: StreamLayerPurgeOptions; + + updateFilter(filterChanges: StreamLayerUpdateFilterFilterChanges): IPromise; } interface StreamLayerConstructor { @@ -2115,9 +2985,10 @@ declare namespace __esri { export const StreamLayer: StreamLayerConstructor; interface StreamLayerProperties extends FeatureLayerProperties { + filter?: StreamLayerFilter; geometryDefinition?: ExtentProperties; maximumTrackPoints?: number; - purgeOptions?: any; + purgeOptions?: StreamLayerPurgeOptions; } interface UnknownLayer extends Layer { @@ -2199,13 +3070,20 @@ declare namespace __esri { } interface CodedValueDomainConstructor { - new(properties?: any): CodedValueDomain; + new(properties?: CodedValueDomainProperties): CodedValueDomain; + getName(code: string | number): string; + + fromJSON(json: any): CodedValueDomain; } export const CodedValueDomain: CodedValueDomainConstructor; + interface CodedValueDomainProperties extends DomainProperties { + codedValues?: CodedValueDomainCodedValues[]; + } + interface DimensionalDefinition { dimensionName: string; isSlice: boolean; @@ -2221,20 +3099,25 @@ declare namespace __esri { export const DimensionalDefinition: DimensionalDefinitionConstructor; - interface Domain { + interface Domain extends Accessor, JSONSupport { name: string; type: string; - - toJSON(): any; } interface DomainConstructor { - new(): Domain; + new(properties?: DomainProperties): Domain; + + fromJSON(json: any): Domain; } export const Domain: DomainConstructor; - interface Field extends JSONSupport { + interface DomainProperties { + name?: string; + type?: string; + } + + interface Field extends Accessor, JSONSupport { alias: string; domain: Domain; editable: boolean; @@ -2254,7 +3137,7 @@ declare namespace __esri { interface FieldProperties { alias?: string; - domain?: Domain; + domain?: DomainProperties; editable?: boolean; length?: number; name?: string; @@ -2262,7 +3145,7 @@ declare namespace __esri { type?: string; } - interface ImageParameters { + interface ImageParameters extends Accessor { dpi: number; extent: Extent; format: string; @@ -2278,20 +3161,39 @@ declare namespace __esri { } interface ImageParametersConstructor { - new(properties?: any): ImageParameters; + new(properties?: ImageParametersProperties): ImageParameters; } export const ImageParameters: ImageParametersConstructor; + interface ImageParametersProperties { + dpi?: number; + extent?: ExtentProperties; + format?: string; + height?: number; + imageSpatialReference?: SpatialReferenceProperties; + layerDefinitions?: string[]; + layerIds?: number[]; + layerOption?: string; + transparent?: boolean; + width?: number; + } + interface InheritedDomain extends Domain { } interface InheritedDomainConstructor { - new(): InheritedDomain; + new(properties?: InheritedDomainProperties): InheritedDomain; + + fromJSON(json: any): InheritedDomain; } export const InheritedDomain: InheritedDomainConstructor; + interface InheritedDomainProperties extends DomainProperties { + + } + interface LabelClass extends Accessor, JSONSupport { labelExpression: string; labelExpressionInfo: LabelClassLabelExpressionInfo; @@ -2301,6 +3203,8 @@ declare namespace __esri { symbol: TextSymbol | LabelSymbol3D; useCodedValues: boolean; where: string; + + clone(): LabelClass; } interface LabelClassConstructor { @@ -2372,7 +3276,7 @@ declare namespace __esri { width?: number; } - interface MosaicRule extends JSONSupport { + interface MosaicRule extends Accessor, JSONSupport { ascending: boolean; lockRasterIds: number[]; method: string; @@ -2406,7 +3310,7 @@ declare namespace __esri { where?: string; } - interface PixelBlock { + interface PixelBlock extends Accessor { height: number; mask: number[]; pixels: number[][]; @@ -2421,23 +3325,39 @@ declare namespace __esri { } interface PixelBlockConstructor { - new(properties?: any): PixelBlock; + new(properties?: PixelBlockProperties): PixelBlock; } export const PixelBlock: PixelBlockConstructor; + interface PixelBlockProperties { + height?: number; + mask?: number[]; + pixels?: number[][]; + pixelType?: string; + statistics?: PixelBlockStatistics[]; + width?: number; + } + interface RangeDomain extends Domain { maxValue: number; minValue: number; } interface RangeDomainConstructor { - new(): RangeDomain; + new(properties?: RangeDomainProperties): RangeDomain; + + fromJSON(json: any): RangeDomain; } export const RangeDomain: RangeDomainConstructor; - interface RasterFunction extends JSONSupport { + interface RangeDomainProperties extends DomainProperties { + maxValue?: number; + minValue?: number; + } + + interface RasterFunction extends Accessor, JSONSupport { functionArguments: any; functionName: string; outputPixelType: string; @@ -2875,6 +3795,7 @@ declare namespace __esri { role: string; roleId: string; thumbnailUrl: string; + units: string; userContentUrl: string; username: string; @@ -2907,6 +3828,7 @@ declare namespace __esri { role?: string; roleId?: string; thumbnailUrl?: string; + units?: string; userContentUrl?: string; username?: string; } @@ -3005,7 +3927,7 @@ declare namespace __esri { valueExpression: string; valueExpressionTitle: string; - addUniqueValueInfo(valueOrInfo: string | any, symbol: Symbol): void; + addUniqueValueInfo(valueOrInfo: string | any, symbol?: Symbol): void; clone(): UniqueValueRenderer; getUniqueValueInfo(graphic: Graphic): any; removeUniqueValueInfo(value: string): void; @@ -3034,6 +3956,7 @@ declare namespace __esri { } interface PointCloudRenderer extends Accessor, JSONSupport { + pointSizeAlgorithm: PointCloudRendererPointSizeAlgorithm; pointsPerInch: number; } @@ -3046,6 +3969,7 @@ declare namespace __esri { export const PointCloudRenderer: PointCloudRendererConstructor; interface PointCloudRendererProperties { + pointSizeAlgorithm?: PointCloudRendererPointSizeAlgorithm; pointsPerInch?: number; } @@ -3133,6 +4057,30 @@ declare namespace __esri { type?: string; } + interface Action extends Accessor { + className: string; + id: string; + image: string; + title: string; + visible: boolean; + + clone(): Action; + } + + interface ActionConstructor { + new(properties?: ActionProperties): Action; + } + + export const Action: ActionConstructor; + + interface ActionProperties { + className?: string; + id?: string; + image?: string; + title?: string; + visible?: boolean; + } + interface ExtrudeSymbol3DLayer extends Symbol3DLayer { size: number; @@ -3817,8 +4765,6 @@ declare namespace __esri { } interface QueryTask extends Task { - gdbVersion: string; - execute(params: Query, requestOptions?: any): IPromise; executeForCount(params: Query, requestOptions?: any): IPromise; executeForExtent(params: Query, requestOptions?: any): IPromise; @@ -3833,7 +4779,7 @@ declare namespace __esri { export const QueryTask: QueryTaskConstructor; interface QueryTaskProperties extends TaskProperties { - gdbVersion?: string; + } interface PrintTask extends Task { @@ -4276,6 +5222,7 @@ declare namespace __esri { foundFieldName: string; layerId: number; layerName: string; + value: void; } interface FindResultConstructor { @@ -4292,6 +5239,7 @@ declare namespace __esri { foundFieldName?: string; layerId?: number; layerName?: string; + value?: void; } interface GeneralizeParameters extends Accessor { @@ -5042,6 +5990,173 @@ declare namespace __esri { trimExtendTo?: PolylineProperties; } + interface ConfigurationTask extends Task { + url: string; + + getAllGroups(requestOptions?: any): IPromise; + getAllUsers(requestOptions?: any): IPromise; + getDataWorkspaceDetails(params: ConfigurationTaskGetDataWorkspaceDetailsParams, requestOptions?: any): IPromise; + getGroup(groupId: number, requestOptions?: any): IPromise; + getJobTypeDetails(jobTypeId: number, requestOptions?: any): IPromise; + getPublicJobQueryDetails(queryId: number, requestOptions?: any): IPromise; + getServiceInfo(requestOptions?: any): IPromise; + getTableRelationshipsDetails(requestOptions?: any): IPromise; + getUser(user: string, requestOptions?: any): IPromise; + getUserJobQueryDetails(params: ConfigurationTaskGetUserJobQueryDetailsParams, requestOptions?: any): IPromise; + getVisibleJobTypes(user: string, requestOptions?: any): IPromise; + } + + interface ConfigurationTaskConstructor { + new(properties?: ConfigurationTaskProperties): ConfigurationTask; + } + + export const ConfigurationTask: ConfigurationTaskConstructor; + + interface ConfigurationTaskProperties extends TaskProperties { + url?: string; + } + + interface JobTask extends Task { + url: string; + + addEmbeddedAttachment(params: JobTaskAddEmbeddedAttachmentParams, requestOptions?: any): IPromise; + addLinkedAttachment(params: JobTaskAddLinkedAttachmentParams, requestOptions?: any): IPromise; + addLinkedRecord(params: JobTaskAddLinkedRecordParams, requestOptions?: any): IPromise; + assignJobs(params: JobTaskAssignJobsParams, requestOptions?: any): IPromise; + closeJobs(params: JobTaskCloseJobsParams, requestOptions?: any): IPromise; + createDependency(params: JobTaskCreateDependencyParams, requestOptions?: any): IPromise; + createHold(params: JobTaskCreateHoldParams, requestOptions?: any): IPromise; + createJobs(params: JobCreationParameters, requestOptions?: any): IPromise; + createJobVersion(params: JobTaskCreateJobVersionParams, requestOptions?: any): IPromise; + deleteAttachment(params: JobTaskDeleteAttachmentParams, requestOptions?: any): IPromise; + deleteDependency(params: JobTaskDeleteDependencyParams, requestOptions?: any): IPromise; + deleteJobs(params: JobTaskDeleteJobsParams, requestOptions?: any): IPromise; + deleteLinkedRecord(params: JobTaskDeleteLinkedRecordParams, requestOptions?: any): IPromise; + getActivityLog(jobId: number, requestOptions?: any): IPromise; + getAttachmentContentUrl(params: JobTaskGetAttachmentContentUrlParams): string; + getAttachments(jobId: number, requestOptions?: any): IPromise; + getDependencies(jobId: number, requestOptions?: any): IPromise; + getExtendedProperties(jobId: number, requestOptions?: any): IPromise; + getHolds(jobId: number, requestOptions?: any): IPromise; + getJob(jobId: number, requestOptions?: any): IPromise; + getJobIds(requestOptions?: any): IPromise; + getNotes(jobId: number, requestOptions?: any): IPromise; + listFieldValues(params: JobTaskListFieldValuesParams, requestOptions?: any): IPromise; + listMultiLevelFieldValues(params: JobTaskListMultiLevelFieldValuesParams, requestOptions?: any): IPromise; + logAction(params: JobTaskLogActionParams, requestOptions?: any): IPromise; + queryJobs(params: JobTaskQueryJobsParams, requestOptions?: any): IPromise; + queryJobsAdHoc(params: JobQueryParameters, requestOptions?: any): IPromise; + queryMultiLevelSelectedValues(params: JobTaskQueryMultiLevelSelectedValuesParams, requestOptions?: any): IPromise; + releaseHold(params: JobTaskReleaseHoldParams, requestOptions?: any): IPromise; + reopenClosedJobs(params: JobTaskReopenClosedJobsParams, requestOptions?: any): IPromise; + searchJobs(params: JobTaskSearchJobsParams, requestOptions?: any): IPromise; + unassignJobs(params: JobTaskUnassignJobsParams, requestOptions?: any): IPromise; + updateJob(params: JobUpdateParameters, requestOptions?: any): IPromise; + updateNotes(params: JobTaskUpdateNotesParams, requestOptions?: any): IPromise; + updateRecord(params: JobTaskUpdateRecordParams, requestOptions?: any): IPromise; + } + + interface JobTaskConstructor { + new(properties?: JobTaskProperties): JobTask; + } + + export const JobTask: JobTaskConstructor; + + interface JobTaskProperties extends TaskProperties { + url?: string; + } + + interface NotificationTask extends Task { + url: string; + + addChangeRule(params: NotificationTaskAddChangeRuleParams, requestOptions?: any): IPromise; + deleteChangeRule(params: NotificationTaskDeleteChangeRuleParams, requestOptions?: any): IPromise; + getAllChangeRules(requestOptions?: any): IPromise; + getChangeRule(ruleId: string, requestOptions?: any): IPromise; + getChangeRuleMatch(matchId: string, requestOptions?: any): IPromise; + getDatabaseTime(dataWorkspaceId: string, requestOptions?: any): IPromise; + getSessionMatches(sessionId: string, requestOptions?: any): IPromise; + notifySession(params: NotificationTaskNotifySessionParams, requestOptions?: any): IPromise; + queryChangeRules(params: NotificationTaskQueryChangeRulesParams, requestOptions?: any): IPromise; + runSpatialNotificationOnHistory(params: NotificationTaskRunSpatialNotificationOnHistoryParams, requestOptions?: any): IPromise; + sendNotification(params: NotificationTaskSendNotificationParams, requestOptions?: any): IPromise; + subscribeToNotification(params: NotificationTaskSubscribeToNotificationParams, requestOptions?: any): IPromise; + unsubscribeFromNotification(params: NotificationTaskUnsubscribeFromNotificationParams, requestOptions?: any): IPromise; + } + + interface NotificationTaskConstructor { + new(properties?: NotificationTaskProperties): NotificationTask; + } + + export const NotificationTask: NotificationTaskConstructor; + + interface NotificationTaskProperties extends TaskProperties { + url?: string; + } + + interface ReportTask extends Task { + url: string; + + generateReport(params: ReportTaskGenerateReportParams, requestOptions?: any): IPromise; + getAllReports(requestOptions?: any): IPromise; + getReportContentUrl(params: ReportTaskGetReportContentUrlParams): string; + getReportData(params: ReportTaskGetReportDataParams, requestOptions?: any): IPromise; + getReportStylesheet(reportId: number, requestOptions?: any): IPromise; + } + + interface ReportTaskConstructor { + new(properties?: ReportTaskProperties): ReportTask; + } + + export const ReportTask: ReportTaskConstructor; + + interface ReportTaskProperties extends TaskProperties { + url?: string; + } + + interface TokenTask extends Task { + parseTokens(params: TokenTaskParseTokensParams, requestOptions?: any): IPromise; + } + + interface TokenTaskConstructor { + new(properties?: TokenTaskProperties): TokenTask; + } + + export const TokenTask: TokenTaskConstructor; + + interface TokenTaskProperties extends TaskProperties { + + } + + interface WorkflowTask extends Task { + url: string; + + canRunStep(params: WorkflowTaskCanRunStepParams, requestOptions?: any): IPromise; + executeSteps(params: WorkflowTaskExecuteStepsParams, requestOptions?: any): IPromise; + getAllSteps(jobId: number, requestOptions?: any): IPromise; + getCurrentSteps(jobId: number, requestOptions?: any): IPromise; + getStep(params: WorkflowTaskGetStepParams, requestOptions?: any): IPromise; + getStepDescription(params: WorkflowTaskGetStepDescriptionParams, requestOptions?: any): IPromise; + getStepFileUrl(params: WorkflowTaskGetStepFileUrlParams): string; + getWorkflowDisplayDetails(jobId: number, requestOptions?: any): IPromise; + getWorkflowImageUrl(jobId: number): string; + markStepsAsDone(params: WorkflowTaskMarkStepsAsDoneParams, requestOptions?: any): IPromise; + moveToNextStep(params: WorkflowTaskMoveToNextStepParams, requestOptions?: any): IPromise; + recreateWorkflow(params: WorkflowTaskRecreateWorkflowParams, requestOptions?: any): IPromise; + resolveConflict(params: WorkflowTaskResolveConflictParams, requestOptions?: any): IPromise; + setCurrentStep(params: WorkflowTaskSetCurrentStepParams, requestOptions?: any): IPromise; + } + + interface WorkflowTaskConstructor { + new(properties?: WorkflowTaskProperties): WorkflowTask; + } + + export const WorkflowTask: WorkflowTaskConstructor; + + interface WorkflowTaskProperties extends TaskProperties { + url?: string; + } + interface MapView extends View { center: Point; constraints: MapViewConstraints; @@ -5053,6 +6168,7 @@ declare namespace __esri { zoom: number; goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | any, options?: MapViewGoToOptions): IPromise; + hasEventListener(type: string): boolean; hitTest(screenPoint: MapViewHitTestScreenPoint): IPromise; on(type: string | string[], modifiersOrHandler: string[] | Function, handler?: Function): any; toMap(screenPoint: ScreenPoint, mapPoint?: Point): Point; @@ -5090,6 +6206,7 @@ declare namespace __esri { zoom: number; goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | Camera | any, options?: SceneViewGoToOptions): IPromise; + hasEventListener(type: string): boolean; hitTest(screenPoint: SceneViewHitTestScreenPoint): IPromise; on(type: string | string[], modifiersOrHandler: string[] | Function, handler?: Function): any; toMap(screenPoint: ScreenPoint, mapPoint?: Point): Point; @@ -5116,7 +6233,7 @@ declare namespace __esri { zoom?: number; } - interface View extends Accessor, corePromise, Evented, BreakpointsOwner, DOMContainer { + interface View extends Accessor, corePromise, BreakpointsOwner, DOMContainer { allLayerViews: Collection; animation: ViewAnimation; graphics: Collection; @@ -5238,16 +6355,33 @@ declare namespace __esri { pixelData?: ImageryLayerViewPixelData; } + interface SceneLayerView extends LayerView { + queryExtent(params?: Query): IPromise; + queryFeatureCount(params?: Query): IPromise; + queryFeatures(params?: Query): IPromise; + queryObjectIds(params?: Query): IPromise; + } + + interface SceneLayerViewConstructor { + new(properties?: SceneLayerViewProperties): SceneLayerView; + } + + export const SceneLayerView: SceneLayerViewConstructor; + + interface SceneLayerViewProperties extends LayerViewProperties { + + } + interface UI extends Accessor { container: any; height: number; padding: any; - view: SceneView | MapView; + view: MapView | SceneView; width: number; - add(component: any | any[], position?: string | any): void; + add(component: Widget | any | string | any | any, position?: string | any): void; empty(position?: string): void; - move(component: any | any[], position?: string): void; + move(component: Widget | any | string | any | any, position?: string): void; remove(component: any | any[]): void; } @@ -5261,7 +6395,7 @@ declare namespace __esri { container?: any; height?: number; padding?: any | number; - view?: SceneView | MapView; + view?: MapView | SceneView; width?: number; } @@ -5406,9 +6540,11 @@ declare namespace __esri { visibleLayers?: SlideVisibleLayers; } - interface Attribution extends Accessor { - view: SceneView | MapView; + interface Attribution extends Widget { + view: MapView | SceneView; viewModel: AttributionViewModel; + + render(): any; } interface AttributionConstructor { @@ -5417,18 +6553,41 @@ declare namespace __esri { export const Attribution: AttributionConstructor; - interface AttributionProperties { - view?: SceneView | MapView; + interface AttributionProperties extends WidgetProperties { + view?: MapView | SceneView; viewModel?: AttributionViewModel; } - interface BasemapToggle extends Accessor, Evented { + interface BasemapGallery extends Widget { + activeBasemap: Basemap; + source: LocalBasemapsSource | PortalBasemapsSource; + view: MapView | SceneView; + viewModel: BasemapGalleryViewModel; + + render(): any; + } + + interface BasemapGalleryConstructor { + new(properties?: BasemapGalleryProperties): BasemapGallery; + } + + export const BasemapGallery: BasemapGalleryConstructor; + + interface BasemapGalleryProperties extends WidgetProperties { + activeBasemap?: BasemapProperties; + source?: LocalBasemapsSource | PortalBasemapsSource; + view?: MapView | SceneView; + viewModel?: BasemapGalleryViewModelProperties; + } + + interface BasemapToggle extends Widget { activeBasemap: Basemap; nextBasemap: Basemap; titleVisible: boolean; - view: SceneView | MapView; + view: MapView | SceneView; viewModel: BasemapToggleViewModel; + render(): any; toggle(): void; } @@ -5438,15 +6597,15 @@ declare namespace __esri { export const BasemapToggle: BasemapToggleConstructor; - interface BasemapToggleProperties { + interface BasemapToggleProperties extends WidgetProperties { activeBasemap?: BasemapProperties; nextBasemap?: Basemap | string; titleVisible?: boolean; - view?: SceneView | MapView; + view?: MapView | SceneView; viewModel?: BasemapToggleViewModelProperties; } - interface ColorSlider extends Accessor { + interface ColorSlider extends Accessor, Widgette { handlesVisible: boolean; histogram: any; histogramVisible: boolean; @@ -5469,7 +6628,7 @@ declare namespace __esri { export const ColorSlider: ColorSliderConstructor; - interface ColorSliderProperties { + interface ColorSliderProperties extends WidgetteProperties { handlesVisible?: boolean; histogram?: any; histogramVisible?: boolean; @@ -5486,10 +6645,11 @@ declare namespace __esri { visualVariable?: any; } - interface Compass extends Accessor { - view: SceneView | MapView; + interface Compass extends Widget { + view: MapView | SceneView; viewModel: CompassViewModel; + render(): any; reset(): void; } @@ -5499,17 +6659,51 @@ declare namespace __esri { export const Compass: CompassConstructor; - interface CompassProperties { - view?: SceneView | MapView; + interface CompassProperties extends WidgetProperties { + view?: MapView | SceneView; viewModel?: CompassViewModelProperties; } - interface Home extends Accessor, Evented { + interface Expand extends Widget { + collapseTooltip: string; + content: any; + expanded: boolean; + expandIconClass: string; + expandTooltip: string; + iconNumber: string; + view: MapView | SceneView; + viewModel: ExpandViewModel; + + collapse(): void; + expand(): void; + render(): any; + toggle(): void; + } + + interface ExpandConstructor { + new(properties?: ExpandProperties): Expand; + } + + export const Expand: ExpandConstructor; + + interface ExpandProperties extends WidgetProperties { + collapseTooltip?: string; + content?: any | any | string | Widget; + expanded?: boolean; + expandIconClass?: string; + expandTooltip?: string; + iconNumber?: string; + view?: MapView | SceneView; + viewModel?: ExpandViewModelProperties; + } + + interface Home extends Widget { view: MapView | SceneView; viewModel: HomeViewModel; viewpoint: Viewpoint; go(): void; + render(): any; } interface HomeConstructor { @@ -5518,7 +6712,7 @@ declare namespace __esri { export const Home: HomeConstructor; - interface HomeProperties { + interface HomeProperties extends WidgetProperties { view?: MapView | SceneView; viewModel?: HomeViewModelProperties; viewpoint?: ViewpointProperties; @@ -5526,10 +6720,12 @@ declare namespace __esri { interface LayerList extends Widget { createActionsFunction: Function; - view: SceneView | MapView; + operationalItems: Collection; + view: MapView | SceneView; viewModel: LayerListViewModel; render(): any; + triggerAction(action: Action, item: ListItem): void; } interface LayerListConstructor { @@ -5540,13 +6736,14 @@ declare namespace __esri { interface LayerListProperties extends WidgetProperties { createActionsFunction?: Function; - view?: SceneView | MapView; + operationalItems?: Collection; + view?: MapView | SceneView; viewModel?: LayerListViewModelProperties; } - interface Legend extends Accessor { + interface Legend extends Accessor, Widgette { layerInfos: LegendLayerInfos[]; - view: SceneView | MapView; + view: MapView | SceneView; } interface LegendConstructor { @@ -5555,12 +6752,12 @@ declare namespace __esri { export const Legend: LegendConstructor; - interface LegendProperties { + interface LegendProperties extends WidgetteProperties { layerInfos?: LegendLayerInfos[]; - view?: SceneView | MapView; + view?: MapView | SceneView; } - interface Locate extends Accessor, Evented { + interface Locate extends Widget { geolocationOptions: any; goToLocationEnabled: boolean; graphic: Graphic; @@ -5568,6 +6765,7 @@ declare namespace __esri { viewModel: LocateViewModel; locate(): IPromise; + render(): any; } interface LocateConstructor { @@ -5576,7 +6774,7 @@ declare namespace __esri { export const Locate: LocateConstructor; - interface LocateProperties { + interface LocateProperties extends WidgetProperties { geolocationOptions?: any; goToLocationEnabled?: boolean; graphic?: GraphicProperties; @@ -5584,11 +6782,12 @@ declare namespace __esri { viewModel?: LocateViewModelProperties; } - interface NavigationToggle extends Accessor { + interface NavigationToggle extends Widget { layout: string; view: SceneView; viewModel: NavigationToggleViewModel; + render(): any; toggle(): void; } @@ -5598,13 +6797,13 @@ declare namespace __esri { export const NavigationToggle: NavigationToggleConstructor; - interface NavigationToggleProperties { + interface NavigationToggleProperties extends WidgetProperties { layout?: string; view?: SceneViewProperties; viewModel?: NavigationToggleViewModelProperties; } - interface Popup extends Accessor, Evented { + interface Popup extends Accessor, Widgette, Evented { actions: Collection; content: string; currentDockPosition: string; @@ -5636,7 +6835,7 @@ declare namespace __esri { export const Popup: PopupConstructor; - interface PopupProperties { + interface PopupProperties extends WidgetteProperties { actions?: Collection; content?: string | any; currentDockPosition?: string; @@ -5674,12 +6873,34 @@ declare namespace __esri { viewModel?: PrintViewModelProperties; } - interface Search extends Accessor, Evented { + interface ScaleBar extends Widget { + style: string; + unit: string; + view: MapView; + viewModel: ScaleBarViewModel; + + render(): any; + } + + interface ScaleBarConstructor { + new(properties?: ScaleBarProperties): ScaleBar; + } + + export const ScaleBar: ScaleBarConstructor; + + interface ScaleBarProperties extends WidgetProperties { + style?: string; + unit?: string; + view?: MapViewProperties; + viewModel?: ScaleBarViewModelProperties; + } + + interface Search extends Widget { activeSource: FeatureLayer | Locator; activeSourceIndex: number; allPlaceholder: string; autoSelect: boolean; - defaultSource: any; + defaultSource: any | any; maxResults: number; maxSuggestions: number; minSuggestCharacters: number; @@ -5690,6 +6911,7 @@ declare namespace __esri { resultGraphicEnabled: boolean; results: any[]; searchAllEnabled: boolean; + searching: boolean; searchTerm: string; selectedResult: any; sources: SearchSources; @@ -5699,6 +6921,7 @@ declare namespace __esri { viewModel: SearchViewModel; clear(): void; + render(): any; search(searchTerm?: string | Geometry | any | number[][]): IPromise; suggest(value?: string): IPromise; } @@ -5709,12 +6932,12 @@ declare namespace __esri { export const Search: SearchConstructor; - interface SearchProperties { + interface SearchProperties extends WidgetProperties { activeSource?: FeatureLayer | Locator; activeSourceIndex?: number; allPlaceholder?: string; autoSelect?: boolean; - defaultSource?: any; + defaultSource?: any | any; maxResults?: number; maxSuggestions?: number; minSuggestCharacters?: number; @@ -5725,6 +6948,7 @@ declare namespace __esri { resultGraphicEnabled?: boolean; results?: any[]; searchAllEnabled?: boolean; + searching?: boolean; searchTerm?: string; selectedResult?: any; sources?: SearchSources; @@ -5734,7 +6958,7 @@ declare namespace __esri { viewModel?: SearchViewModelProperties; } - interface SizeSlider extends Accessor { + interface SizeSlider extends Accessor, Widgette { handlesVisible: boolean; histogram: any; histogramVisible: boolean; @@ -5757,7 +6981,7 @@ declare namespace __esri { export const SizeSlider: SizeSliderConstructor; - interface SizeSliderProperties { + interface SizeSliderProperties extends WidgetteProperties { handlesVisible?: boolean; histogram?: any; histogramVisible?: boolean; @@ -5774,7 +6998,7 @@ declare namespace __esri { visualVariable?: any; } - interface Track extends Accessor { + interface Track extends Widget { geolocationOptions: any; goToLocationEnabled: boolean; graphic: Graphic; @@ -5782,6 +7006,7 @@ declare namespace __esri { view: MapView | SceneView; viewModel: TrackViewModel; + render(): any; start(): void; stop(): void; } @@ -5792,7 +7017,7 @@ declare namespace __esri { export const Track: TrackConstructor; - interface TrackProperties { + interface TrackProperties extends WidgetProperties { geolocationOptions?: any; goToLocationEnabled?: boolean; graphic?: GraphicProperties; @@ -5801,7 +7026,7 @@ declare namespace __esri { viewModel?: TrackViewModelProperties; } - interface UnivariateColorSizeSlider extends Accessor { + interface UnivariateColorSizeSlider extends Accessor, Widgette { handlesVisible: boolean; histogram: any; histogramVisible: boolean; @@ -5824,7 +7049,7 @@ declare namespace __esri { export const UnivariateColorSizeSlider: UnivariateColorSizeSliderConstructor; - interface UnivariateColorSizeSliderProperties { + interface UnivariateColorSizeSliderProperties extends WidgetteProperties { handlesVisible?: boolean; histogram?: any; histogramVisible?: boolean; @@ -5847,7 +7072,9 @@ declare namespace __esri { id: string; destroy(): void; + own(handles: any[]): void; postInitialize(): void; + renderNow(): void; scheduleRender(): void; startup(): void; } @@ -5859,15 +7086,16 @@ declare namespace __esri { export const Widget: WidgetConstructor; interface WidgetProperties { - container?: string; + container?: string | any; destroyed?: boolean; id?: string; } - interface Zoom extends Accessor { - view: SceneView | MapView; + interface Zoom extends Widget { + view: MapView | SceneView; viewModel: ZoomViewModel; + render(): any; zoomIn(): void; zoomOut(): void; } @@ -5878,8 +7106,8 @@ declare namespace __esri { export const Zoom: ZoomConstructor; - interface ZoomProperties { - view?: SceneView | MapView; + interface ZoomProperties extends WidgetProperties { + view?: MapView | SceneView; viewModel?: ZoomViewModelProperties; } @@ -5887,7 +7115,7 @@ declare namespace __esri { attributionText: string; itemDelimiter: string; state: string; - view: SceneView | MapView; + view: MapView | SceneView; } interface AttributionViewModelConstructor { @@ -5896,11 +7124,35 @@ declare namespace __esri { export const AttributionViewModel: AttributionViewModelConstructor; + interface BasemapGalleryViewModel extends Accessor { + activeBasemap: Basemap; + items: Collection; + source: LocalBasemapsSource | PortalBasemapsSource; + state: string; + view: MapView | SceneView; + + basemapEquals(basemap1: Basemap, basemap2: Basemap): boolean; + } + + interface BasemapGalleryViewModelConstructor { + new(properties?: BasemapGalleryViewModelProperties): BasemapGalleryViewModel; + } + + export const BasemapGalleryViewModel: BasemapGalleryViewModelConstructor; + + interface BasemapGalleryViewModelProperties { + activeBasemap?: BasemapProperties; + items?: Collection; + source?: LocalBasemapsSource | PortalBasemapsSource; + state?: string; + view?: MapView | SceneView; + } + interface BasemapToggleViewModel extends Accessor, Evented { activeBasemap: Basemap; nextBasemap: Basemap; state: string; - view: SceneView | MapView; + view: MapView | SceneView; toggle(): void; } @@ -5915,12 +7167,13 @@ declare namespace __esri { activeBasemap?: BasemapProperties; nextBasemap?: Basemap | string; state?: string; - view?: SceneView | MapView; + view?: MapView | SceneView; } interface CompassViewModel extends Accessor { + orientation: any; state: string; - view: SceneView | MapView; + view: MapView | SceneView; reset(): void; } @@ -5932,8 +7185,27 @@ declare namespace __esri { export const CompassViewModel: CompassViewModelConstructor; interface CompassViewModelProperties { + orientation?: any; state?: string; - view?: SceneView | MapView; + view?: MapView | SceneView; + } + + interface ExpandViewModel extends Accessor { + expanded: boolean; + state: string; + view: MapView | SceneView; + } + + interface ExpandViewModelConstructor { + new(properties?: ExpandViewModelProperties): ExpandViewModel; + } + + export const ExpandViewModel: ExpandViewModelConstructor; + + interface ExpandViewModelProperties { + expanded?: boolean; + state?: string; + view?: MapView | SceneView; } interface HomeViewModel extends Accessor, Evented { @@ -5960,9 +7232,9 @@ declare namespace __esri { createActionsFunction: Function; operationalItems: Collection; state: string; - view: SceneView | MapView; + view: MapView | SceneView; - triggerAction(actionIndex: number): void; + triggerAction(action: Action, item: ListItem): void; } interface LayerListViewModelConstructor { @@ -5975,9 +7247,32 @@ declare namespace __esri { createActionsFunction?: Function; operationalItems?: Collection; state?: string; - view?: SceneView | MapView; + view?: MapView | SceneView; } + interface ListItem { + actionsOpen: boolean; + actionsSections: Collection; + children: Collection; + error: Error; + layer: Layer; + open: boolean; + title: string; + updating: boolean; + view: MapView | SceneView; + visibilityMode: string; + visible: boolean; + visibleAtCurrentScale: boolean; + + clone(): ListItem; + } + + interface ListItemConstructor { + new(): ListItem; + } + + export const ListItem: ListItemConstructor; + interface LocateViewModel extends Accessor, Evented, GeolocationPositioning { state: string; @@ -6075,6 +7370,20 @@ declare namespace __esri { view?: MapView | SceneView; } + interface ScaleBarViewModel extends Accessor { + view: MapView; + } + + interface ScaleBarViewModelConstructor { + new(properties?: ScaleBarViewModelProperties): ScaleBarViewModel; + } + + export const ScaleBarViewModel: ScaleBarViewModelConstructor; + + interface ScaleBarViewModelProperties { + view?: MapViewProperties; + } + interface SearchViewModel extends Accessor, Evented { activeSource: FeatureLayer | Locator; activeSourceIndex: number; @@ -6163,7 +7472,7 @@ declare namespace __esri { canZoomIn: boolean; canZoomOut: boolean; state: string; - view: SceneView | MapView; + view: MapView | SceneView; zoomIn(): void; zoomOut(): void; @@ -6179,7 +7488,7 @@ declare namespace __esri { canZoomIn?: boolean; canZoomOut?: boolean; state?: string; - view?: SceneView | MapView; + view?: MapView | SceneView; } interface JSONSupport { @@ -6301,6 +7610,8 @@ declare namespace __esri { dpi: number; gdbVersion: string; imageFormat: string; + imageMaxHeight: number; + imageMaxWidth: number; imageTransparency: boolean; sublayers: Collection; @@ -6320,6 +7631,8 @@ declare namespace __esri { dpi?: number; gdbVersion?: string; imageFormat?: string; + imageMaxHeight?: number; + imageMaxWidth?: number; imageTransparency?: boolean; sublayers?: Collection; } @@ -6547,6 +7860,24 @@ declare namespace __esri { width?: number; } + interface Widgette { + container: string | any; + visible: boolean; + + destroy(): void; + } + + interface WidgetteConstructor { + new(): Widgette; + } + + export const Widgette: WidgetteConstructor; + + interface WidgetteProperties { + container?: string | any; + visible?: boolean; + } + interface GeolocationPositioning { geolocationOptions: any; goToLocationEnabled: boolean; @@ -6569,8 +7900,10 @@ declare namespace __esri { interface config { geometryServiceUrl: string; + geoRSSServiceUrl: string; portalUrl: string; request: configRequest; + workers: configWorkers; } export const config: config; @@ -6596,13 +7929,19 @@ declare namespace __esri { export const lang: lang; interface promiseUtils { - eachAlways(promises: IPromise[]): IPromise[]; - reject(error?: any): IPromise; - resolve(value?: any): IPromise; + eachAlways(promises: IPromise[] | any): IPromise | any; + reject(error?: any): IPromise; + resolve(value?: T): IPromise; } export const promiseUtils: promiseUtils; + interface requireUtils { + when(moduleRequire: any, moduleNames: string[] | string): IPromise; + } + + export const requireUtils: requireUtils; + interface urlUtils { addProxyRule(rule: urlUtilsAddProxyRuleRule): number; getProxyRule(url: string): any; @@ -6636,7 +7975,7 @@ declare namespace __esri { interface decorators { aliasOf(propertyName: string): Function; cast(propertyName: string): Function; - cast(classFunction: Function): void; + cast(classFunction: Function): Function; declared(baseClass: T, ...mixinClasses: any[]): T; property(propertyMetadata?: decoratorsPropertyPropertyMetadata): Function; subclass(declaredClass?: string): Function; @@ -6739,6 +8078,12 @@ declare namespace __esri { export const jsonUtils: jsonUtils; + interface normalizeUtils { + normalizeCentralMeridian(geometries: Geometry[], geometryService?: GeometryService): IPromise; + } + + export const normalizeUtils: normalizeUtils; + interface webMercatorUtils { canProject(source: SpatialReference | any, target: SpatialReference | any): boolean; geographicToWebMercator(geometry: Geometry): Geometry; @@ -6765,7 +8110,7 @@ declare namespace __esri { interface size { createContinuousRenderer(params: sizeCreateContinuousRendererParams): IPromise; - createVisualVariable(params: sizeCreateVisualVariableParams): IPromise; + createVisualVariables(params: sizeCreateVisualVariablesParams): IPromise; } export const size: size; @@ -6787,13 +8132,17 @@ declare namespace __esri { histogram(params: histogramHistogramParams): IPromise; } - export const histogram: histogram; + const __histogramMapped: histogram; + export const histogram: typeof __histogramMapped.histogram; + interface summaryStatistics { summaryStatistics(params: summaryStatisticsSummaryStatisticsParams): IPromise; } - export const summaryStatistics: summaryStatistics; + const __summaryStatisticsMapped: summaryStatistics; + export const summaryStatistics: typeof __summaryStatisticsMapped.summaryStatistics; + interface symbologyColor { cloneScheme(scheme: any): any; @@ -6824,16 +8173,6 @@ declare namespace __esri { export const supportJsonUtils: supportJsonUtils; - interface Action { - className: string; - id: string; - image: string; - title: string; - visible: boolean; - } - - export const Action: Action; - interface symbolsSupportJsonUtils { fromJSON(json: any): Symbol; } @@ -6861,20 +8200,30 @@ declare namespace __esri { export const widget: widget; - interface ListItem { - actionsOpen: boolean; - actionsSections: Collection; - children: Collection; + interface BasemapGalleryItem { + basemap: Basemap; error: Error; - open: boolean; - title: string; - updating: boolean; - visibilityMode: string; - visible: boolean; - visibleAtCurrentScale: boolean; + state: string; + view: MapView | SceneView; } - export const ListItem: ListItem; + export const BasemapGalleryItem: BasemapGalleryItem; + + interface LocalBasemapsSource { + basemaps: Collection; + state: string; + } + + export const LocalBasemapsSource: LocalBasemapsSource; + + interface PortalBasemapsSource { + basemaps: Collection; + filterFunction: Function; + portal: Portal; + state: string; + } + + export const PortalBasemapsSource: PortalBasemapsSource; } declare module "esri" { @@ -6888,10 +8237,116 @@ declare module "esri" { export import WatchHandle = __esri.WatchHandle; + export import EachAlwaysResult = __esri.EachAlwaysResult; + export import PausableWatchHandle = __esri.PausableWatchHandle; + export import FeatureEditResult = __esri.FeatureEditResult; + export import AttributeParamValue = __esri.AttributeParamValue; + export import DataWorkspace = __esri.DataWorkspace; + + export import GroupMembership = __esri.GroupMembership; + + export import HoldType = __esri.HoldType; + + export import JobPriority = __esri.JobPriority; + + export import JobQuery = __esri.JobQuery; + + export import JobStatus = __esri.JobStatus; + + export import JobQueryContainer = __esri.JobQueryContainer; + + export import JobQueryDetails = __esri.JobQueryDetails; + + export import Privilege = __esri.Privilege; + + export import UserDetails = __esri.UserDetails; + + export import VersionInfo = __esri.VersionInfo; + + export import WorkflowManagerServiceInfo = __esri.WorkflowManagerServiceInfo; + + export import JobType = __esri.JobType; + + export import JobTypeDetails = __esri.JobTypeDetails; + + export import TableRelationship = __esri.TableRelationship; + + export import JobCreationParameters = __esri.JobCreationParameters; + + export import JobQueryParameters = __esri.JobQueryParameters; + + export import JobUpdateParameters = __esri.JobUpdateParameters; + + export import AuxRecordDescription = __esri.AuxRecordDescription; + + export import ActivityType = __esri.ActivityType; + + export import AuxRecordContainer = __esri.AuxRecordContainer; + + export import JobTaskJobInfo = __esri.JobTaskJobInfo; + + export import QueryResult = __esri.QueryResult; + + export import AuxRecord = __esri.AuxRecord; + + export import AuxRecordValue = __esri.AuxRecordValue; + + export import FieldValue = __esri.FieldValue; + + export import JobVersionInfo = __esri.JobVersionInfo; + + export import QueryFieldInfo = __esri.QueryFieldInfo; + + export import JobAttachment = __esri.JobAttachment; + + export import JobDependency = __esri.JobDependency; + + export import ChangeRule = __esri.ChangeRule; + + export import DataSetEvaluator = __esri.DataSetEvaluator; + + export import AOIEvaluator = __esri.AOIEvaluator; + + export import DatasetConfiguration = __esri.DatasetConfiguration; + + export import EmailNotifier = __esri.EmailNotifier; + + export import WhereCondition = __esri.WhereCondition; + + export import NotificationType = __esri.NotificationType; + + export import ChangeRuleMatch = __esri.ChangeRuleMatch; + + export import ReportDataGroup = __esri.ReportDataGroup; + + export import ReportData = __esri.ReportData; + + export import Report = __esri.Report; + + export import ExecuteInfo = __esri.ExecuteInfo; + + export import Step = __esri.Step; + + export import StepType = __esri.StepType; + + export import WorkflowDisplayDetails = __esri.WorkflowDisplayDetails; + + export import WorkflowOption = __esri.WorkflowOption; + + export import WorkflowStepInfo = __esri.WorkflowStepInfo; + + export import WorkflowAnnotationDisplayDetails = __esri.WorkflowAnnotationDisplayDetails; + + export import WorkflowConflicts = __esri.WorkflowConflicts; + + export import WorkflowPathDisplayDetails = __esri.WorkflowPathDisplayDetails; + + export import WorkflowStepDisplayDetails = __esri.WorkflowStepDisplayDetails; + export import ExternalRenderer = __esri.ExternalRenderer; export import RenderContext = __esri.RenderContext; @@ -6906,10 +8361,6 @@ declare module "esri" { export import FeatureLayerSource = __esri.FeatureLayerSource; - export import SearchViewModelLocatorSource = __esri.SearchViewModelLocatorSource; - - export import SearchViewModelFeatureLayerSource = __esri.SearchViewModelFeatureLayerSource; - export import GetHeader = __esri.GetHeader; export import WatchCallback = __esri.WatchCallback; @@ -6966,8 +8417,16 @@ declare module "esri" { export import CSVLayerElevationInfo = __esri.CSVLayerElevationInfo; + export import FeatureLayerApplyEditsEdits = __esri.FeatureLayerApplyEditsEdits; + + export import FeatureLayerCapabilities = __esri.FeatureLayerCapabilities; + + export import FeatureLayerCapabilitiesOperations = __esri.FeatureLayerCapabilitiesOperations; + export import FeatureLayerElevationInfo = __esri.FeatureLayerElevationInfo; + export import FeatureLayerGetFieldDomainOptions = __esri.FeatureLayerGetFieldDomainOptions; + export import GraphicsLayerElevationInfo = __esri.GraphicsLayerElevationInfo; export import LayerFromArcGISServerUrlParams = __esri.LayerFromArcGISServerUrlParams; @@ -6976,6 +8435,12 @@ declare module "esri" { export import SceneLayerElevationInfo = __esri.SceneLayerElevationInfo; + export import StreamLayerFilter = __esri.StreamLayerFilter; + + export import StreamLayerPurgeOptions = __esri.StreamLayerPurgeOptions; + + export import StreamLayerUpdateFilterFilterChanges = __esri.StreamLayerUpdateFilterFilterChanges; + export import VectorTileLayerCurrentStyleInfo = __esri.VectorTileLayerCurrentStyleInfo; export import CodedValueDomainCodedValues = __esri.CodedValueDomainCodedValues; @@ -7004,6 +8469,8 @@ declare module "esri" { export import UniqueValueRendererUniqueValueInfos = __esri.UniqueValueRendererUniqueValueInfos; + export import PointCloudRendererPointSizeAlgorithm = __esri.PointCloudRendererPointSizeAlgorithm; + export import PointCloudClassBreaksRendererColorClassBreakInfos = __esri.PointCloudClassBreaksRendererColorClassBreakInfos; export import PointCloudStretchRendererStops = __esri.PointCloudStretchRendererStops; @@ -7042,6 +8509,102 @@ declare module "esri" { export import QueryQuantizationParameters = __esri.QueryQuantizationParameters; + export import ConfigurationTaskGetDataWorkspaceDetailsParams = __esri.ConfigurationTaskGetDataWorkspaceDetailsParams; + + export import ConfigurationTaskGetUserJobQueryDetailsParams = __esri.ConfigurationTaskGetUserJobQueryDetailsParams; + + export import JobTaskAddEmbeddedAttachmentParams = __esri.JobTaskAddEmbeddedAttachmentParams; + + export import JobTaskAddLinkedAttachmentParams = __esri.JobTaskAddLinkedAttachmentParams; + + export import JobTaskAddLinkedRecordParams = __esri.JobTaskAddLinkedRecordParams; + + export import JobTaskAssignJobsParams = __esri.JobTaskAssignJobsParams; + + export import JobTaskCloseJobsParams = __esri.JobTaskCloseJobsParams; + + export import JobTaskCreateDependencyParams = __esri.JobTaskCreateDependencyParams; + + export import JobTaskCreateHoldParams = __esri.JobTaskCreateHoldParams; + + export import JobTaskCreateJobVersionParams = __esri.JobTaskCreateJobVersionParams; + + export import JobTaskDeleteAttachmentParams = __esri.JobTaskDeleteAttachmentParams; + + export import JobTaskDeleteDependencyParams = __esri.JobTaskDeleteDependencyParams; + + export import JobTaskDeleteJobsParams = __esri.JobTaskDeleteJobsParams; + + export import JobTaskDeleteLinkedRecordParams = __esri.JobTaskDeleteLinkedRecordParams; + + export import JobTaskGetAttachmentContentUrlParams = __esri.JobTaskGetAttachmentContentUrlParams; + + export import JobTaskListFieldValuesParams = __esri.JobTaskListFieldValuesParams; + + export import JobTaskListMultiLevelFieldValuesParams = __esri.JobTaskListMultiLevelFieldValuesParams; + + export import JobTaskLogActionParams = __esri.JobTaskLogActionParams; + + export import JobTaskQueryJobsParams = __esri.JobTaskQueryJobsParams; + + export import JobTaskQueryMultiLevelSelectedValuesParams = __esri.JobTaskQueryMultiLevelSelectedValuesParams; + + export import JobTaskReleaseHoldParams = __esri.JobTaskReleaseHoldParams; + + export import JobTaskReopenClosedJobsParams = __esri.JobTaskReopenClosedJobsParams; + + export import JobTaskSearchJobsParams = __esri.JobTaskSearchJobsParams; + + export import JobTaskUnassignJobsParams = __esri.JobTaskUnassignJobsParams; + + export import JobTaskUpdateNotesParams = __esri.JobTaskUpdateNotesParams; + + export import JobTaskUpdateRecordParams = __esri.JobTaskUpdateRecordParams; + + export import NotificationTaskAddChangeRuleParams = __esri.NotificationTaskAddChangeRuleParams; + + export import NotificationTaskDeleteChangeRuleParams = __esri.NotificationTaskDeleteChangeRuleParams; + + export import NotificationTaskNotifySessionParams = __esri.NotificationTaskNotifySessionParams; + + export import NotificationTaskQueryChangeRulesParams = __esri.NotificationTaskQueryChangeRulesParams; + + export import NotificationTaskRunSpatialNotificationOnHistoryParams = __esri.NotificationTaskRunSpatialNotificationOnHistoryParams; + + export import NotificationTaskSendNotificationParams = __esri.NotificationTaskSendNotificationParams; + + export import NotificationTaskSubscribeToNotificationParams = __esri.NotificationTaskSubscribeToNotificationParams; + + export import NotificationTaskUnsubscribeFromNotificationParams = __esri.NotificationTaskUnsubscribeFromNotificationParams; + + export import ReportTaskGenerateReportParams = __esri.ReportTaskGenerateReportParams; + + export import ReportTaskGetReportContentUrlParams = __esri.ReportTaskGetReportContentUrlParams; + + export import ReportTaskGetReportDataParams = __esri.ReportTaskGetReportDataParams; + + export import TokenTaskParseTokensParams = __esri.TokenTaskParseTokensParams; + + export import WorkflowTaskCanRunStepParams = __esri.WorkflowTaskCanRunStepParams; + + export import WorkflowTaskExecuteStepsParams = __esri.WorkflowTaskExecuteStepsParams; + + export import WorkflowTaskGetStepDescriptionParams = __esri.WorkflowTaskGetStepDescriptionParams; + + export import WorkflowTaskGetStepFileUrlParams = __esri.WorkflowTaskGetStepFileUrlParams; + + export import WorkflowTaskGetStepParams = __esri.WorkflowTaskGetStepParams; + + export import WorkflowTaskMarkStepsAsDoneParams = __esri.WorkflowTaskMarkStepsAsDoneParams; + + export import WorkflowTaskMoveToNextStepParams = __esri.WorkflowTaskMoveToNextStepParams; + + export import WorkflowTaskRecreateWorkflowParams = __esri.WorkflowTaskRecreateWorkflowParams; + + export import WorkflowTaskResolveConflictParams = __esri.WorkflowTaskResolveConflictParams; + + export import WorkflowTaskSetCurrentStepParams = __esri.WorkflowTaskSetCurrentStepParams; + export import MapViewConstraints = __esri.MapViewConstraints; export import MapViewGoToOptions = __esri.MapViewGoToOptions; @@ -7124,6 +8687,10 @@ declare module "esri" { export import configRequestProxyRules = __esri.configRequestProxyRules; + export import configWorkers = __esri.configWorkers; + + export import configWorkersLoaderConfig = __esri.configWorkersLoaderConfig; + export import requestEsriRequestOptions = __esri.requestEsriRequestOptions; export import urlUtilsAddProxyRuleRule = __esri.urlUtilsAddProxyRuleRule; @@ -7144,9 +8711,9 @@ declare module "esri" { export import sizeCreateContinuousRendererParamsLegendOptions = __esri.sizeCreateContinuousRendererParamsLegendOptions; - export import sizeCreateVisualVariableParams = __esri.sizeCreateVisualVariableParams; + export import sizeCreateVisualVariablesParams = __esri.sizeCreateVisualVariablesParams; - export import sizeCreateVisualVariableParamsLegendOptions = __esri.sizeCreateVisualVariableParamsLegendOptions; + export import sizeCreateVisualVariablesParamsLegendOptions = __esri.sizeCreateVisualVariablesParamsLegendOptions; export import univariateColorSizeCreateContinuousRendererParams = __esri.univariateColorSizeCreateContinuousRendererParams; @@ -7351,6 +8918,11 @@ declare module "esri/layers/FeatureLayer" { export = FeatureLayer; } +declare module "esri/layers/GeoRSSLayer" { + import GeoRSSLayer = __esri.GeoRSSLayer; + export = GeoRSSLayer; +} + declare module "esri/layers/GraphicsLayer" { import GraphicsLayer = __esri.GraphicsLayer; export = GraphicsLayer; @@ -7571,6 +9143,11 @@ declare module "esri/renderers/PointCloudUniqueValueRenderer" { export = PointCloudUniqueValueRenderer; } +declare module "esri/support/Action" { + import Action = __esri.Action; + export = Action; +} + declare module "esri/symbols/ExtrudeSymbol3DLayer" { import ExtrudeSymbol3DLayer = __esri.ExtrudeSymbol3DLayer; export = ExtrudeSymbol3DLayer; @@ -7961,6 +9538,36 @@ declare module "esri/tasks/support/TrimExtendParameters" { export = TrimExtendParameters; } +declare module "esri/tasks/workflow/ConfigurationTask" { + import ConfigurationTask = __esri.ConfigurationTask; + export = ConfigurationTask; +} + +declare module "esri/tasks/workflow/JobTask" { + import JobTask = __esri.JobTask; + export = JobTask; +} + +declare module "esri/tasks/workflow/NotificationTask" { + import NotificationTask = __esri.NotificationTask; + export = NotificationTask; +} + +declare module "esri/tasks/workflow/ReportTask" { + import ReportTask = __esri.ReportTask; + export = ReportTask; +} + +declare module "esri/tasks/workflow/TokenTask" { + import TokenTask = __esri.TokenTask; + export = TokenTask; +} + +declare module "esri/tasks/workflow/WorkflowTask" { + import WorkflowTask = __esri.WorkflowTask; + export = WorkflowTask; +} + declare module "esri/views/MapView" { import MapView = __esri.MapView; export = MapView; @@ -8001,6 +9608,11 @@ declare module "esri/views/layers/ImageryLayerView" { export = ImageryLayerView; } +declare module "esri/views/layers/SceneLayerView" { + import SceneLayerView = __esri.SceneLayerView; + export = SceneLayerView; +} + declare module "esri/views/ui/UI" { import UI = __esri.UI; export = UI; @@ -8046,6 +9658,11 @@ declare module "esri/widgets/Attribution" { export = Attribution; } +declare module "esri/widgets/BasemapGallery" { + import BasemapGallery = __esri.BasemapGallery; + export = BasemapGallery; +} + declare module "esri/widgets/BasemapToggle" { import BasemapToggle = __esri.BasemapToggle; export = BasemapToggle; @@ -8061,6 +9678,11 @@ declare module "esri/widgets/Compass" { export = Compass; } +declare module "esri/widgets/Expand" { + import Expand = __esri.Expand; + export = Expand; +} + declare module "esri/widgets/Home" { import Home = __esri.Home; export = Home; @@ -8096,6 +9718,11 @@ declare module "esri/widgets/Print" { export = Print; } +declare module "esri/widgets/ScaleBar" { + import ScaleBar = __esri.ScaleBar; + export = ScaleBar; +} + declare module "esri/widgets/Search" { import Search = __esri.Search; export = Search; @@ -8131,6 +9758,11 @@ declare module "esri/widgets/Attribution/AttributionViewModel" { export = AttributionViewModel; } +declare module "esri/widgets/BasemapGallery/BasemapGalleryViewModel" { + import BasemapGalleryViewModel = __esri.BasemapGalleryViewModel; + export = BasemapGalleryViewModel; +} + declare module "esri/widgets/BasemapToggle/BasemapToggleViewModel" { import BasemapToggleViewModel = __esri.BasemapToggleViewModel; export = BasemapToggleViewModel; @@ -8141,6 +9773,11 @@ declare module "esri/widgets/Compass/CompassViewModel" { export = CompassViewModel; } +declare module "esri/widgets/Expand/ExpandViewModel" { + import ExpandViewModel = __esri.ExpandViewModel; + export = ExpandViewModel; +} + declare module "esri/widgets/Home/HomeViewModel" { import HomeViewModel = __esri.HomeViewModel; export = HomeViewModel; @@ -8151,6 +9788,11 @@ declare module "esri/widgets/LayerList/LayerListViewModel" { export = LayerListViewModel; } +declare module "esri/widgets/LayerList/ListItem" { + import ListItem = __esri.ListItem; + export = ListItem; +} + declare module "esri/widgets/Locate/LocateViewModel" { import LocateViewModel = __esri.LocateViewModel; export = LocateViewModel; @@ -8171,6 +9813,11 @@ declare module "esri/widgets/Popup/PopupViewModel" { export = PopupViewModel; } +declare module "esri/widgets/ScaleBar/ScaleBarViewModel" { + import ScaleBarViewModel = __esri.ScaleBarViewModel; + export = ScaleBarViewModel; +} + declare module "esri/widgets/Search/SearchViewModel" { import SearchViewModel = __esri.SearchViewModel; export = SearchViewModel; @@ -8266,6 +9913,11 @@ declare module "esri/views/DOMContainer" { export = DOMContainer; } +declare module "esri/widgets/Widgette" { + import Widgette = __esri.Widgette; + export = Widgette; +} + declare module "esri/widgets/support/GeolocationPositioning" { import GeolocationPositioning = __esri.GeolocationPositioning; export = GeolocationPositioning; @@ -8296,6 +9948,11 @@ declare module "esri/core/promiseUtils" { export = promiseUtils; } +declare module "esri/core/requireUtils" { + import requireUtils = __esri.requireUtils; + export = requireUtils; +} + declare module "esri/core/urlUtils" { import urlUtils = __esri.urlUtils; export = urlUtils; @@ -8331,6 +9988,11 @@ declare module "esri/geometry/support/jsonUtils" { export = jsonUtils; } +declare module "esri/geometry/support/normalizeUtils" { + import normalizeUtils = __esri.normalizeUtils; + export = normalizeUtils; +} + declare module "esri/geometry/support/webMercatorUtils" { import webMercatorUtils = __esri.webMercatorUtils; export = webMercatorUtils; @@ -8391,11 +10053,6 @@ declare module "esri/renderers/support/jsonUtils" { export = supportJsonUtils; } -declare module "esri/support/Action" { - import Action = __esri.Action; - export = Action; -} - declare module "esri/symbols/support/jsonUtils" { import symbolsSupportJsonUtils = __esri.symbolsSupportJsonUtils; export = symbolsSupportJsonUtils; @@ -8411,7 +10068,17 @@ declare module "esri/widgets/support/widget" { export = widget; } -declare module "esri/widgets/LayerList/ListItem" { - import ListItem = __esri.ListItem; - export = ListItem; +declare module "esri/widgets/BasemapGallery/BasemapGalleryItem" { + import BasemapGalleryItem = __esri.BasemapGalleryItem; + export = BasemapGalleryItem; } + +declare module "esri/widgets/BasemapGallery/support/LocalBasemapsSource" { + import LocalBasemapsSource = __esri.LocalBasemapsSource; + export = LocalBasemapsSource; +} + +declare module "esri/widgets/BasemapGallery/support/PortalBasemapsSource" { + import PortalBasemapsSource = __esri.PortalBasemapsSource; + export = PortalBasemapsSource; +} \ No newline at end of file From e19736d7fe980db3ddf649d7fb5a78a028c81d0f Mon Sep 17 00:00:00 2001 From: bappleyard Date: Tue, 7 Mar 2017 09:09:09 +0000 Subject: [PATCH 037/276] #15029 include declaration for DOMImplementation --- xmldom/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) mode change 100644 => 100755 xmldom/index.d.ts diff --git a/xmldom/index.d.ts b/xmldom/index.d.ts old mode 100644 new mode 100755 index dfbe34599c..8c252389cc --- a/xmldom/index.d.ts +++ b/xmldom/index.d.ts @@ -7,6 +7,11 @@ declare namespace xmldom { var DOMParser: DOMParserStatic; var XMLSerializer: XMLSerializerStatic; + var DOMImplementation: DOMImplementationStatic; + + interface DOMImplementationStatic { + new(): DOMImplementation; + } interface DOMParserStatic { new (): DOMParser; From 476377219255cabaf8ba512ccb4ac1cd5cb68907 Mon Sep 17 00:00:00 2001 From: Ben Swartz Date: Wed, 8 Mar 2017 11:18:34 -0800 Subject: [PATCH 038/276] Update Faker Definitions to V4.1.0 --- faker/faker-tests.ts | 22 +++ faker/index.d.ts | 36 +++- faker/v3/faker-tests.ts | 183 ++++++++++++++++++ faker/v3/index.d.ts | 416 ++++++++++++++++++++++++++++++++++++++++ faker/v3/tsconfig.json | 25 +++ 5 files changed, 680 insertions(+), 2 deletions(-) create mode 100644 faker/v3/faker-tests.ts create mode 100644 faker/v3/index.d.ts create mode 100644 faker/v3/tsconfig.json diff --git a/faker/faker-tests.ts b/faker/faker-tests.ts index 4dc2a3735f..5fb6a53746 100644 --- a/faker/faker-tests.ts +++ b/faker/faker-tests.ts @@ -52,6 +52,11 @@ resultStr = faker.company.bsAdjective(); resultStr = faker.company.bsBuzz(); resultStr = faker.company.bsNoun(); +resultStr = faker.database.column(); +resultStr = faker.database.type(); +resultStr = faker.database.collation(); +resultStr = faker.database.engine(); + resultDate = faker.date.past(); resultDate = faker.date.future(); resultDate = faker.date.between('foo', 'bar'); @@ -80,6 +85,8 @@ resultStr = faker.finance.transactionType(); resultStr = faker.finance.currencyCode(); resultStr = faker.finance.currencyName(); resultStr = faker.finance.currencySymbol(); +resultStr = faker.finance.bitcoinAddress(); +resultStr = faker.finance.bic(); resultStr = faker.hacker.abbreviation(); resultStr = faker.hacker.adjective(); @@ -110,6 +117,8 @@ resultStr = userCard.address.suite; resultStr = faker.internet.avatar(); resultStr = faker.internet.email(); resultStr = faker.internet.email('foo', 'bar', 'quux'); +resultStr = faker.internet.exampleEmail(); +resultStr = faker.internet.exampleEmail('foo', 'bar'); resultStr = faker.internet.protocol(); resultStr = faker.internet.url(); resultStr = faker.internet.domainName(); @@ -128,12 +137,18 @@ resultStr = faker.lorem.words(); resultStr = faker.lorem.words(0); resultStr = faker.lorem.sentence(); resultStr = faker.lorem.sentence(0, 0); +resultStr = faker.lorem.slug(); +resultStr = faker.lorem.slug(0); resultStr = faker.lorem.sentences(); resultStr = faker.lorem.sentences(0); resultStr = faker.lorem.paragraph(); resultStr = faker.lorem.paragraph(0); resultStr = faker.lorem.paragraphs(); resultStr = faker.lorem.paragraphs(0, ''); +resultStr = faker.lorem.text(); +resultStr = faker.lorem.text(0); +resultStr = faker.lorem.lines(); +resultStr = faker.lorem.lines(0); resultStr = faker.name.firstName(); resultStr = faker.name.firstName(0); @@ -169,6 +184,13 @@ resultStr = faker.random.objectElement(); resultStr = faker.random.objectElement({foo: 'bar', field: 'foo'}); resultStr = faker.random.uuid(); resultBool = faker.random.boolean(); +resultStr = faker.random.word(); +resultStr = faker.random.words(); +resultStr = faker.random.words(0); +resultStr = faker.random.image(); +resultStr = faker.random.locale(); +resultStr = faker.random.alphaNumeric(); +resultStr = faker.random.alphaNumeric(0); resultStr = faker.system.fileName( "foo", "bar" ); resultStr = faker.system.commonFileName( "foo", "bar" ); diff --git a/faker/index.d.ts b/faker/index.d.ts index 01e01b8b8b..8c6ea8ec6f 100644 --- a/faker/index.d.ts +++ b/faker/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for faker v3.1 +// Based off type definitions for faker v4.1.0 // Project: http://marak.com/faker.js/ -// Definitions by: Bas Pennings , Yuki Kokubun +// Definitions by: Ben Swartz , Bas Pennings , Yuki Kokubun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare var fakerStatic: Faker.FakerStatic; @@ -52,6 +52,13 @@ declare namespace Faker { bsNoun(): string; }; + database: { + column(): string; + type(): string; + collation(): string; + engine(): string; + }; + date: { past(years?: number, refDate?: string|Date): Date; future(years?: number, refDate?: string|Date): Date; @@ -72,6 +79,8 @@ declare namespace Faker { currencyCode(): string; currencyName(): string; currencySymbol(): string; + bitcoinAddress(): string; + bic(): string }; hacker: { @@ -116,11 +125,13 @@ declare namespace Faker { sports(width?: number, height?: number): string; technics(width?: number, height?: number): string; transport(width?: number, height?: number): string; + dataUri(width?: number, height?: number): string; }; internet: { avatar(): string; email(firstName?: string, lastName?: string, provider?: string): string; + exampleEmail(firstName?: string, lastName?: string): string; userName(firstName?: string, lastName?: string): string; protocol(): string; url(): string; @@ -128,6 +139,7 @@ declare namespace Faker { domainSuffix(): string; domainWord(): string; ip(): string; + ipv6(): string; userAgent(): string; color(baseRed255?: number, baseGreen255?: number, baseBlue255?: number): string; mac(): string; @@ -138,9 +150,12 @@ declare namespace Faker { word(): string; words(num?: number): string; sentence(wordCount?: number, range?: number): string; + slug(wordCount?: number): string; sentences(sentenceCount?: number): string; paragraph(sentenceCount?: number): string; paragraphs(paragraphCount?: number, separator?: string): string; + text(times?: number): string; + lines(lineCount?: number): string; }; name: { @@ -171,6 +186,11 @@ declare namespace Faker { objectElement(object?: { [key: string]: T }, field?: any): T; uuid(): string; boolean(): boolean; + word(): string; // TODO: have ability to return specific type of word? As in: noun, adjective, verb, etc + words(count?: number): string; + image(): string; + locale(): string; + alphaNumeric(count?: number): string; }; system: { @@ -275,6 +295,14 @@ declare module "faker" { export = fakerStatic; } +declare module "faker/locale/az" { + export = fakerStatic; +} + +declare module "faker/locale/cz" { + export = fakerStatic; +} + declare module "faker/locale/de" { export = fakerStatic; } @@ -351,6 +379,10 @@ declare module "faker/locale/ge" { export = fakerStatic; } +declare module "faker/locale/id_ID" { + export = fakerStatic; +} + declare module "faker/locale/it" { export = fakerStatic; } diff --git a/faker/v3/faker-tests.ts b/faker/v3/faker-tests.ts new file mode 100644 index 0000000000..4dc2a3735f --- /dev/null +++ b/faker/v3/faker-tests.ts @@ -0,0 +1,183 @@ + + +let resultStr: string; +let resultBool: boolean; +let resultNum: number; +let resultStrArr: string[]; +let resultDate: Date; + +import faker = require('faker'); +faker.locale = 'en'; + +resultStr = faker.address.zipCode(); +resultStr = faker.address.zipCode('###'); +resultStr = faker.address.city(); +resultStr = faker.address.city(0); +resultStr = faker.address.cityPrefix(); +resultStr = faker.address.citySuffix(); +resultStr = faker.address.streetName(); +resultStr = faker.address.streetAddress(); +resultStr = faker.address.streetAddress(false);; +resultStr = faker.address.streetSuffix(); +resultStr = faker.address.streetPrefix(); +resultStr = faker.address.secondaryAddress(); +resultStr = faker.address.county(); +resultStr = faker.address.country(); +resultStr = faker.address.countryCode(); +resultStr = faker.address.state(); +resultStr = faker.address.state(false); +resultStr = faker.address.stateAbbr(); +resultStr = faker.address.latitude(); +resultStr = faker.address.longitude(); + +resultStr = faker.commerce.color(); +resultStr = faker.commerce.department(); +resultStr = faker.commerce.productName(); +resultStr = faker.commerce.price(); +resultStr = faker.commerce.price(0, 0, 0, '#'); +resultStr = faker.commerce.productAdjective(); +resultStr = faker.commerce.productMaterial(); +resultStr = faker.commerce.product(); + +resultStrArr = faker.company.suffixes(); +resultStr = faker.company.companyName(); +resultStr = faker.company.companyName(0); +resultStr = faker.company.companySuffix(); +resultStr = faker.company.catchPhrase(); +resultStr = faker.company.bs(); +resultStr = faker.company.catchPhraseAdjective(); +resultStr = faker.company.catchPhraseDescriptor(); +resultStr = faker.company.catchPhraseNoun(); +resultStr = faker.company.bsAdjective(); +resultStr = faker.company.bsBuzz(); +resultStr = faker.company.bsNoun(); + +resultDate = faker.date.past(); +resultDate = faker.date.future(); +resultDate = faker.date.between('foo', 'bar'); +resultDate = faker.date.between(new Date(), new Date()); +resultDate = faker.date.recent(); +resultDate = faker.date.recent(100); +resultStr = faker.date.month(); +resultStr = faker.date.month({ + abbr: true, + context: true +}); +resultStr = faker.date.weekday(); +resultStr = faker.date.weekday({ + abbr: true, + context: true +}); + +resultStr = faker.finance.account(); +resultStr = faker.finance.account(0); +resultStr = faker.finance.accountName(); +resultStr = faker.finance.mask(); +resultStr = faker.finance.mask(0, false, false); +resultStr = faker.finance.amount(); +resultStr = faker.finance.amount(0, 0, 0, '#'); +resultStr = faker.finance.transactionType(); +resultStr = faker.finance.currencyCode(); +resultStr = faker.finance.currencyName(); +resultStr = faker.finance.currencySymbol(); + +resultStr = faker.hacker.abbreviation(); +resultStr = faker.hacker.adjective(); +resultStr = faker.hacker.noun(); +resultStr = faker.hacker.verb(); +resultStr = faker.hacker.ingverb(); +resultStr = faker.hacker.phrase(); + +resultStr = faker.helpers.randomize(); +resultNum = faker.helpers.randomize([1,2,3,4]); +resultStr = faker.helpers.randomize(['foo', 'bar', 'quux']); +resultStr = faker.helpers.slugify('foo bar quux'); +resultStr = faker.helpers.replaceSymbolWithNumber('foo# bar#'); +resultStr = faker.helpers.replaceSymbols('foo# bar? quux#'); +resultStrArr = faker.helpers.shuffle(['foo', 'bar', 'quux']); +resultStr = faker.helpers.mustache('{{foo}}{{bar}}', {foo: 'x', bar: 'y'}); + +const card = faker.helpers.createCard(); +resultStr = card.name; +resultStr = card.address.streetA; +const contextualCard = faker.helpers.contextualCard(); +resultStr = contextualCard.name; +resultStr = contextualCard.address.suite; +const userCard = faker.helpers.userCard(); +resultStr = userCard.name; +resultStr = userCard.address.suite; + +resultStr = faker.internet.avatar(); +resultStr = faker.internet.email(); +resultStr = faker.internet.email('foo', 'bar', 'quux'); +resultStr = faker.internet.protocol(); +resultStr = faker.internet.url(); +resultStr = faker.internet.domainName(); +resultStr = faker.internet.domainSuffix(); +resultStr = faker.internet.domainWord(); +resultStr = faker.internet.ip(); +resultStr = faker.internet.userAgent(); +resultStr = faker.internet.color(); +resultStr = faker.internet.color(0, 0, 0); +resultStr = faker.internet.mac(); +resultStr = faker.internet.password(); +resultStr = faker.internet.password(0, false, '#', 'foo'); + +resultStr = faker.lorem.word(); +resultStr = faker.lorem.words(); +resultStr = faker.lorem.words(0); +resultStr = faker.lorem.sentence(); +resultStr = faker.lorem.sentence(0, 0); +resultStr = faker.lorem.sentences(); +resultStr = faker.lorem.sentences(0); +resultStr = faker.lorem.paragraph(); +resultStr = faker.lorem.paragraph(0); +resultStr = faker.lorem.paragraphs(); +resultStr = faker.lorem.paragraphs(0, ''); + +resultStr = faker.name.firstName(); +resultStr = faker.name.firstName(0); +resultStr = faker.name.lastName(); +resultStr = faker.name.lastName(0); +resultStr = faker.name.findName(); +resultStr = faker.name.findName('', '', 0); +resultStr = faker.name.jobTitle(); +resultStr = faker.name.prefix(); +resultStr = faker.name.suffix(); +resultStr = faker.name.title(); +resultStr = faker.name.jobDescriptor(); +resultStr = faker.name.jobArea(); +resultStr = faker.name.jobType(); + +resultStr = faker.phone.phoneNumber(); +resultStr = faker.phone.phoneNumber('#'); +resultStr = faker.phone.phoneNumberFormat(); +// https://github.com/Marak/faker.js/blob/master/lib/phone_number.js#L9-L13 +resultStr = faker.phone.phoneNumberFormat(0); +resultStr = faker.phone.phoneFormats(); + +resultNum = faker.random.number(); +resultNum = faker.random.number(0); +resultNum = faker.random.number({ + min: 0, + max: 0, + precision: 0 +}); +resultStr = faker.random.arrayElement(); +resultStr = faker.random.arrayElement(['foo', 'bar', 'quux']) +resultStr = faker.random.objectElement(); +resultStr = faker.random.objectElement({foo: 'bar', field: 'foo'}); +resultStr = faker.random.uuid(); +resultBool = faker.random.boolean(); + +resultStr = faker.system.fileName( "foo", "bar" ); +resultStr = faker.system.commonFileName( "foo", "bar" ); +resultStr = faker.system.mimeType(); +resultStr = faker.system.commonFileType(); +resultStr = faker.system.commonFileExt(); +resultStr = faker.system.fileType(); +resultStr = faker.system.fileExt( "foo" ); +resultStr = faker.system.semver(); + +import fakerEn = require('faker/locale/en'); +resultStr = faker.name.firstName(); diff --git a/faker/v3/index.d.ts b/faker/v3/index.d.ts new file mode 100644 index 0000000000..01e01b8b8b --- /dev/null +++ b/faker/v3/index.d.ts @@ -0,0 +1,416 @@ +// Type definitions for faker v3.1 +// Project: http://marak.com/faker.js/ +// Definitions by: Bas Pennings , Yuki Kokubun +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare var fakerStatic: Faker.FakerStatic; + +declare namespace Faker { + interface FakerStatic { + locale: string; + + address: { + zipCode(format?: string): string; + city(format?: number): string; + cityPrefix(): string; + citySuffix(): string; + streetName(): string; + streetAddress(useFullAddress?: boolean): string; + streetSuffix(): string; + streetPrefix(): string; + secondaryAddress(): string; + county(): string; + country(): string; + countryCode(): string; + state(useAbbr?: boolean): string; + stateAbbr(): string; + latitude(): string; + longitude(): string; + }; + + commerce: { + color(): string; + department(): string; + productName(): string; + price(min?: number, max?: number, dec?: number, symbol?: string): string; + productAdjective(): string; + productMaterial(): string; + product(): string; + }; + + company: { + suffixes(): string[]; + companyName(format?: number): string; + companySuffix(): string; + catchPhrase(): string; + bs(): string; + catchPhraseAdjective(): string; + catchPhraseDescriptor(): string; + catchPhraseNoun(): string; + bsAdjective(): string; + bsBuzz(): string; + bsNoun(): string; + }; + + date: { + past(years?: number, refDate?: string|Date): Date; + future(years?: number, refDate?: string|Date): Date; + between(from: string|number|Date, to: string|Date): Date; + recent(days?: number): Date; + month(options?: { abbr?: boolean, context?: boolean }): string; + weekday(options?: { abbr?: boolean, context?: boolean }): string; + }; + + fake(str: string): string; + + finance: { + account(length?: number): string; + accountName(): string; + mask(length?: number, parens?: boolean, elipsis?: boolean): string; + amount(min?:number, max?: number, dec?: number, symbol?: string): string; + transactionType(): string; + currencyCode(): string; + currencyName(): string; + currencySymbol(): string; + }; + + hacker: { + abbreviation(): string; + adjective(): string; + noun(): string; + verb(): string; + ingverb(): string; + phrase(): string; + }; + + helpers: { + randomize(array: T[]): T; + randomize(): string; + slugify(string?: string): string; + replaceSymbolWithNumber(string?: string, symbol?: string): string; + replaceSymbols(string?: string): string; + shuffle(o: T[]): T[]; + shuffle(): string[]; + mustache(str: string, data: { [key: string]: string|((substring: string, ...args: any[]) => string) }): string; + createCard(): Faker.Card; + contextualCard(): Faker.ContextualCard; + userCard(): Faker.UserCard; + createTransaction(): Faker.Transaction; + }; + + + image: { + image(): string; + avatar(): string; + imageUrl(width?: number, height?: number, category?: string): string; + abstract(width?: number, height?: number): string; + animals(width?: number, height?: number): string; + business(width?: number, height?: number): string; + cats(width?: number, height?: number): string; + city(width?: number, height?: number): string; + food(width?: number, height?: number): string; + nightlife(width?: number, height?: number): string; + fashion(width?: number, height?: number): string; + people(width?: number, height?: number): string; + nature(width?: number, height?: number): string; + sports(width?: number, height?: number): string; + technics(width?: number, height?: number): string; + transport(width?: number, height?: number): string; + }; + + internet: { + avatar(): string; + email(firstName?: string, lastName?: string, provider?: string): string; + userName(firstName?: string, lastName?: string): string; + protocol(): string; + url(): string; + domainName(): string; + domainSuffix(): string; + domainWord(): string; + ip(): string; + userAgent(): string; + color(baseRed255?: number, baseGreen255?: number, baseBlue255?: number): string; + mac(): string; + password(len?: number, memorable?: boolean, pattern?: string|RegExp, prefix?: string): string; + }; + + lorem: { + word(): string; + words(num?: number): string; + sentence(wordCount?: number, range?: number): string; + sentences(sentenceCount?: number): string; + paragraph(sentenceCount?: number): string; + paragraphs(paragraphCount?: number, separator?: string): string; + }; + + name: { + firstName(gender?: number): string; + lastName(gender?: number): string; + findName(firstName?: string, lastName?: string, gender?: number): string; + jobTitle(): string; + prefix(): string; + suffix(): string; + title(): string; + jobDescriptor(): string; + jobArea(): string; + jobType(): string; + }; + + phone: { + phoneNumber(format?: string): string; + phoneNumberFormat(phoneFormatsArrayIndex?: number): string; + phoneFormats(): string; + }; + + random: { + number(max: number): number; + number(options?: { min?: number, max?: number, precision?: number }): number; + arrayElement(): string; + arrayElement(array: T[]): T; + objectElement(object?: { [key: string]: any }, field?: "key"): string; + objectElement(object?: { [key: string]: T }, field?: any): T; + uuid(): string; + boolean(): boolean; + }; + + system: { + fileName(ext: string, type: string): string; + commonFileName(ext: string, type: string): string; + mimeType(): string; + commonFileType(): string; + commonFileExt(): string; + fileType(): string; + fileExt(mimeType: string): string; + //directoryPath(): string; + //filePath(): string; + semver(): string; + }; + + seed(value: number): void; + } + + interface Card { + name: string; + username: string; + email: string; + address: FullAddress; + phone: string; + website: string; + company: Company; + posts: Post[]; + accountHistory: string[]; + } + + interface FullAddress { + streetA: string; + streetB: string; + streetC: string; + streetD: string; + city: string; + state: string; + county: string; + zipcode: string; + geo: Geo; + } + + interface Geo { + lat: string; + lng: string; + } + + interface Company { + name: string; + catchPhrase: string; + bs: string; + } + + interface Post { + words: string; + sentence: string; + sentences: string; + paragraph: string; + } + + interface ContextualCard { + name: string; + username: string; + email: string; + dob: Date; + phone: string; + address: Address; + website: string; + company: Company; + } + + interface Address { + street: string; + suite: string; + city: string; + state: string; + zipcode: string; + geo: Geo; + } + + interface UserCard { + name: string; + username: string; + email: string; + address: Address; + phone: string; + website: string; + company: Company; + } + + interface Transaction { + amount: string; + date: Date; + business: string; + name: string; + type: string; + account: string; + } +} + +declare module "faker" { + export = fakerStatic; +} + +declare module "faker/locale/de" { + export = fakerStatic; +} + +declare module "faker/locale/de_AT" { + export = fakerStatic; +} + +declare module "faker/locale/de_CH" { + export = fakerStatic; +} + +declare module "faker/locale/el_GR" { + export = fakerStatic; +} + +declare module "faker/locale/en" { + export = fakerStatic; +} + +declare module "faker/locale/en_AU" { + export = fakerStatic; +} + +declare module "faker/locale/en_BORK" { + export = fakerStatic; +} + +declare module "faker/locale/en_CA" { + export = fakerStatic; +} + +declare module "faker/locale/en_GB" { + export = fakerStatic; +} + +declare module "faker/locale/en_IE" { + export = fakerStatic; +} + +declare module "faker/locale/en_IND" { + export = fakerStatic; +} + +declare module "faker/locale/en_US" { + export = fakerStatic; +} + +declare module "faker/locale/en_au_ocker" { + export = fakerStatic; +} + +declare module "faker/locale/es" { + export = fakerStatic; +} + +declare module "faker/locale/es_MX" { + export = fakerStatic; +} + +declare module "faker/locale/fa" { + export = fakerStatic; +} + +declare module "faker/locale/fr" { + export = fakerStatic; +} + +declare module "faker/locale/fr_CA" { + export = fakerStatic; +} + +declare module "faker/locale/ge" { + export = fakerStatic; +} + +declare module "faker/locale/it" { + export = fakerStatic; +} + +declare module "faker/locale/ja" { + export = fakerStatic; +} + +declare module "faker/locale/ko" { + export = fakerStatic; +} + +declare module "faker/locale/nb_NO" { + export = fakerStatic; +} + +declare module "faker/locale/nep" { + export = fakerStatic; +} + +declare module "faker/locale/nl" { + export = fakerStatic; +} + +declare module "faker/locale/pl" { + export = fakerStatic; +} + +declare module "faker/locale/pt_BR" { + export = fakerStatic; +} + +declare module "faker/locale/ru" { + export = fakerStatic; +} + +declare module "faker/locale/sk" { + export = fakerStatic; +} + +declare module "faker/locale/sv" { + export = fakerStatic; +} + +declare module "faker/locale/tr" { + export = fakerStatic; +} + +declare module "faker/locale/uk" { + export = fakerStatic; +} + +declare module "faker/locale/vi" { + export = fakerStatic; +} + +declare module "faker/locale/zh_CN" { + export = fakerStatic; +} + +declare module "faker/locale/zh_TW" { + export = fakerStatic; +} diff --git a/faker/v3/tsconfig.json b/faker/v3/tsconfig.json new file mode 100644 index 0000000000..40af61eba9 --- /dev/null +++ b/faker/v3/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "faker": [ "faker/v3" ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "faker-tests.ts" + ] +} From c105965b68d0639a6360c5a6bb3b7c98c79b2bee Mon Sep 17 00:00:00 2001 From: Ben Swartz Date: Wed, 8 Mar 2017 11:28:16 -0800 Subject: [PATCH 039/276] Change Header Comment --- faker/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/faker/index.d.ts b/faker/index.d.ts index 8c6ea8ec6f..ccca40e51a 100644 --- a/faker/index.d.ts +++ b/faker/index.d.ts @@ -1,4 +1,4 @@ -// Based off type definitions for faker v4.1.0 +// Type definitions for faker v4.1.0 // Project: http://marak.com/faker.js/ // Definitions by: Ben Swartz , Bas Pennings , Yuki Kokubun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 7275ca875933bc55aa8bef54fd296560ae0ecc7c Mon Sep 17 00:00:00 2001 From: Ben Swartz Date: Wed, 8 Mar 2017 13:52:41 -0800 Subject: [PATCH 040/276] set strictNullChecks to true, add new line at eof --- faker/tsconfig.json | 4 ++-- faker/v3/tsconfig.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/faker/tsconfig.json b/faker/tsconfig.json index c2ce14c941..0589e5dc54 100644 --- a/faker/tsconfig.json +++ b/faker/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +19,4 @@ "index.d.ts", "faker-tests.ts" ] -} \ No newline at end of file +} diff --git a/faker/v3/tsconfig.json b/faker/v3/tsconfig.json index 40af61eba9..052493a9c7 100644 --- a/faker/v3/tsconfig.json +++ b/faker/v3/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" From 3186a2ba273c41c91bde9f4adff3067ae1c901f7 Mon Sep 17 00:00:00 2001 From: voxmatt Date: Thu, 9 Mar 2017 16:52:56 -0800 Subject: [PATCH 041/276] fleshing out the relayProp --- react-relay/index.d.ts | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/react-relay/index.d.ts b/react-relay/index.d.ts index 9c45ed9c7c..8170e03190 100644 --- a/react-relay/index.d.ts +++ b/react-relay/index.d.ts @@ -31,6 +31,24 @@ declare module "react-relay" { response: any } + type RelayMutationStatus = + 'UNCOMMITTED' | // Transaction hasn't yet been sent to the server. Transaction can be committed or rolled back. + 'COMMIT_QUEUED' | // Transaction was committed but another transaction with the same collision key is pending, so the transaction has been queued to send to the server. + 'COLLISION_COMMIT_FAILED' | //Transaction was queued for commit but another transaction with the same collision key failed. All transactions in the collision queue, including this one, have been failed. Transaction can be recommitted or rolled back. + 'COMMITTING' | // Transaction is waiting for the server to respond. + 'COMMIT_FAILED'; + + class RelayMutationTransaction { + applyOptimistic(): RelayMutationTransaction; + commit(): RelayMutationTransaction; + recommit(): void; + rollback(): void; + getError(): Error; + getStatus(): RelayMutationStatus; + getHash(): string; + getID(): string; + } + interface RelayMutationRequest { getQueryString(): string getVariables(): RelayVariables @@ -104,7 +122,7 @@ declare module "react-relay" { renderFailure?(error: Error, retry: Function): JSX.Element } - type ReadyStateEvent = + type ReadyStateEvent = 'ABORT' | 'CACHE_RESTORED_REQUIRED' | 'CACHE_RESTORE_FAILED' | @@ -128,7 +146,12 @@ declare module "react-relay" { } interface RelayProp { - variables: any - setVariables(variables: Object, onReadyStateChange?: OnReadyStateChange): void + route: { name: string; }; // incomplete, also has params and queries + variables: any; + pendingVariables?: any; + setVariables(variables: Object, onReadyStateChange?: OnReadyStateChange): void; + forceFetch(variables: Object, onReadyStateChange?: OnReadyStateChange): void; + hasOptimisticUpdate(record: any): boolean; + getPendingTransactions(record: any): RelayMutationTransaction[]; } } From 4cc74c831a3f186cf42e417a462257f97fa526e3 Mon Sep 17 00:00:00 2001 From: voxmatt Date: Thu, 9 Mar 2017 17:22:18 -0800 Subject: [PATCH 042/276] fixing tests --- react-relay/index.d.ts | 4 ++-- react-relay/react-relay-tests.tsx | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/react-relay/index.d.ts b/react-relay/index.d.ts index 8170e03190..5b40145d18 100644 --- a/react-relay/index.d.ts +++ b/react-relay/index.d.ts @@ -151,7 +151,7 @@ declare module "react-relay" { pendingVariables?: any; setVariables(variables: Object, onReadyStateChange?: OnReadyStateChange): void; forceFetch(variables: Object, onReadyStateChange?: OnReadyStateChange): void; - hasOptimisticUpdate(record: any): boolean; - getPendingTransactions(record: any): RelayMutationTransaction[]; + hasOptimisticUpdate(record?: any): boolean; + getPendingTransactions(record?: any): RelayMutationTransaction[]; } } diff --git a/react-relay/react-relay-tests.tsx b/react-relay/react-relay-tests.tsx index 7160e60b0a..fa27f10c01 100644 --- a/react-relay/react-relay-tests.tsx +++ b/react-relay/react-relay-tests.tsx @@ -74,10 +74,16 @@ class StubbedArtwork extends React.Component { const props = { artwork: { title: "CHAMPAGNE FORMICA FLAG" }, relay: { + route: { + name: "champagne" + }, variables: { artworkID: "champagne-formica-flag", }, setVariables: () => {}, + forceFetch: () => {}, + hasOptimisticUpdate: () => false, + getPendingTransactions: (): Relay.RelayMutationTransaction[] => undefined, } } return From 498bf589489249b77f4259a95fe9dd97a670aab6 Mon Sep 17 00:00:00 2001 From: voxmatt Date: Thu, 9 Mar 2017 17:26:33 -0800 Subject: [PATCH 043/276] adding in commitUpdate while I'm at it --- react-relay/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/react-relay/index.d.ts b/react-relay/index.d.ts index 5b40145d18..0f6dbba024 100644 --- a/react-relay/index.d.ts +++ b/react-relay/index.d.ts @@ -153,5 +153,6 @@ declare module "react-relay" { forceFetch(variables: Object, onReadyStateChange?: OnReadyStateChange): void; hasOptimisticUpdate(record?: any): boolean; getPendingTransactions(record?: any): RelayMutationTransaction[]; + commitUpdate?: (mutation: Mutation, callbacks?: StoreUpdateCallbacks) => any; } } From 29af632b69cf4974407e43c4b100c54f24da2f87 Mon Sep 17 00:00:00 2001 From: Martin Probst Date: Fri, 10 Mar 2017 07:55:40 +0100 Subject: [PATCH 044/276] angular: specify what locals $controller requires (#14919) * Specify/hint what locals $controller requires `$controller` must at least get a `$scope` and a `$element` object. * Fix whitespace --- angular/index.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/angular/index.d.ts b/angular/index.d.ts index 05b6ce92ff..5d47751844 100644 --- a/angular/index.d.ts +++ b/angular/index.d.ts @@ -1332,9 +1332,19 @@ declare namespace angular { // see http://docs.angularjs.org/api/ng.$controller // see http://docs.angularjs.org/api/ng.$controllerProvider /////////////////////////////////////////////////////////////////////////// + + /** + * The minimal local definitions required by $controller(ctrl, locals) calls. + */ + interface IControllerLocals { + $scope: ng.IScope; + $element: JQuery; + } + interface IControllerService { // Although the documentation doesn't state this, locals are optional (controllerConstructor: new (...args: any[]) => T, locals?: any, later?: boolean, ident?: string): T; + (controllerConstructor: Function, locals?: IControllerLocals, later?: boolean, ident?: string): T; (controllerConstructor: Function, locals?: any, later?: boolean, ident?: string): T; (controllerName: string, locals?: any, later?: boolean, ident?: string): T; } From 3326972199b04cd095b0f99aad3d3ad7544da9e2 Mon Sep 17 00:00:00 2001 From: Benni Date: Fri, 10 Mar 2017 07:56:26 +0100 Subject: [PATCH 045/276] Added missing definitions for TinyMce (#14918) * Added definitions for TinyMce except the 'ui' namespace. * Fixed lint warnings * Refactoring: new => class definition with constructor --- tinymce/index.d.ts | 1437 +++++++++++++++++++++++++++++++++++++- tinymce/tinymce-tests.ts | 19 +- 2 files changed, 1423 insertions(+), 33 deletions(-) diff --git a/tinymce/index.d.ts b/tinymce/index.d.ts index f760671a8e..b82f90a46e 100644 --- a/tinymce/index.d.ts +++ b/tinymce/index.d.ts @@ -5,40 +5,1425 @@ // Work In Progress -declare namespace TinyMCE { - export interface Observable { - off: (name?: string, callback?: () => void) => any; - on: (name: string, callback: () => void) => any; - fire: (name: string, args?: any, bubble?: boolean) => Event; +declare namespace TinyMce { + + export interface Static extends TinyMce.EditorManager { + + DOM: TinyMce.dom.DOMUtils; + + PluginManager: TinyMce.AddOnManager; + + ScriptLoader: TinyMce.dom.ScriptLoader; + + ThemeManager: TinyMce.AddOnManager; + + create(s: string, p: {}, root?: {}): void; + + createNS(n: string, o: {}): {}; + + each(o: {}, cb: () => void, s?: {}): void; + + explode(s: string, d: string): void; + + grep(a: any[], f: () => void): any[]; + + inArray(item: any, arr: any[]): number; + + is(obj: {}, type?: string): boolean; + + isArray(obj: {}): boolean; + + makeMap(items: any[], delim?: string, map?: {}): {}; + + map(array: any[], callback: () => void): any[]; + + resolve(n: string, o?: {}): {}; + + toArray(obj: {}): any[]; + + trim(s: string): string; + + walk(o: {}, f: () => void, n?: string, s?: string): void; } - export interface Editor extends Observable { - destroy: (automatic: boolean) => void; - remove: () => void; - hide: () => void; - show: () => void; - getContent: (args?: any) => string; - setContent: (content: string, args?: any) => string; - focus: (skip_focus?: boolean) => void; + export interface Settings { + + auto_focus?: string; + + cache_suffix?: string; + + content_security_policy?: string; + + external_plugins?: {}; + + hidden_input?: boolean; + + init_instance_callback?: (editor: TinyMce.Editor) => void; + + plugins?: string | string[]; + + selector?: string; + + setup?: (edtor: TinyMce.Editor) => void; + + target?: Element; + + color_picker_callback?: (callback: (hexColor: string) => void, value: string) => void; + + elementpath?: boolean; + + event_root?: boolean; + + fixed_toolbar_container?: string; + + height?: number; + + inline?: boolean; + + insert_button_items?: string; + + insert_toolbar?: string; + + max_height?: number; + + max_width?: number; + + menu?: settings.Menu; + + menubar?: string | boolean; + + min_height?: number; + + min_width?: number; + + preview_styles?: boolean | string; + + removed_menuitems?: string; + + resize?: boolean | string; + + selection_toolbar?: string; + + skin_url?: string; + + skin?: string; + + statusbar?: boolean; + + theme_url?: string; + + theme?: string; + + toolbar?: boolean | string | string[]; + + width?: number; + + body_class?: string; + + body_id?: string; + + content_css?: string; + + content_style?: string; + + visual_anchor_class?: string; + + visual_table_class?: string; + + visual?: boolean; + + allow_conditional_comments?: boolean; + + allow_html_in_named_anchor?: boolean; + + allow_unsafe_link_target?: boolean; + + convert_fonts_to_spans?: boolean; + + custom_elements?: string; + + doctype?: string; + + element_format?: string; + + encoding?: string; + + entities?: string; + + entity_encoding?: string; + + extended_valid_elements?: string; + + fix_list_elements?: boolean; + + force_hex_style_colors?: boolean; + + forced_root_block?: string; + + forced_root_block_attrs?: {}; + + invalid_elements?: string; + + invalid_styles?: string | {}; + + keep_styles?: boolean; + + protect?: RegExp[]; + + remove_trailing_brs?: boolean; + + schema?: string; + + valid_children?: string; + + valid_classes?: string | {}; + + valid_elements?: string; + + valid_styles?: {}; + + block_formats?: string; + + font_formats?: string; + + fontsize_formats?: string; + + formats?: {}; + + removeFormat?: Array<{}>; + + indentation?: string; + + style_formats?: Array<{}>; + + style_formats_autohide?: boolean; + + style_formats_merge?: boolean; + + browser_spellcheck?: boolean; + + gecko_spellcheck?: boolean; + + automatic_uploads?: boolean; + + file_browser_callback?: (field_name: string, url: string, type: string, win: Window) => void; + + file_browser_callback_types?: string; + + file_picker_callback?: (callback: (filename: string, metadata: {}) => void, valud: string, meta: {}) => void; + + file_picker_types?: string; + + images_dataimg_filter?: (img: any) => void; + + images_reuse_filename?: boolean; + + images_upload_base_path?: string; + + images_upload_credentials?: boolean; + + images_upload_handler?: (blobInfo: any, success: (msg: string) => void, failure: (msg: string) => void) => void; + + images_upload_url?: string; + + directionality?: string; + + language?: string; + + language_url?: string; + + allow_script_urls?: boolean; + + convert_urls?: boolean; + + document_base_url?: string; + + relative_urls?: boolean; + + remove_script_host?: boolean; + + urlconverter_callback?: (url: string, node: HTMLElement, on_save: boolean, name: string) => void; + + anchor_bottom?: string; + + anchor_top?: string; + + br_in_pre?: boolean; + + custom_undo_redo_levels?: number; + + end_container_on_empty_block?: boolean; + + nowrap?: boolean; + + object_resizing?: boolean | string; + + type_ahead_urls?: boolean; + + } + + export namespace settings { + + export interface Menu { + file: MenuItem; + edit: MenuItem; + insert: MenuItem; + view: MenuItem; + format: MenuItem; + table: MenuItem; + tools: MenuItem; + } + + export interface MenuItem { + title: string; + items: string; + } + } + + export interface AddOnManager { + + add(id: string, addOn: (editor: TinyMce.Editor, url: string) => void): Theme | Plugin; + + addComponents(pluginName: string, scripts: string[]): void; + + get(name: string): Theme | Plugin; + + load(name: string, addOnUrl: string, success?: () => void, scope?: {}, failure?: () => void): void; + + requireLangPack(name: string, languages?: string): void; + } + + export interface Editor extends util.Observable { + + $: dom.DomQuery; + + baseURI: util.URI; + + contentCSS: string[]; + + contentStyles: string[]; + + documentBaseURI: util.URI; + + dom: dom.DOMUtils; + + formatter: Formatter; + + id: string; + + initialized: boolean; + + notificationManager: notificationManager; + + parser: html.DomParser; + + schema: html.Schema; + + selection: dom.Selection; + + serializer: dom.Serializer; + + settings: Settings; + + theme: Theme; + undoManager: UndoManager; - settings: any; - getDoc: () => Document; - editorUpload: any; + + WindowManager: WindowManager; + + addButton(name: string, settings: {}): void; + + addCommand(name: string, callback: (ui: boolean, value: {}) => boolean, scope?: {}): void; + + addContextToolbar(predicate: () => void, items: string): void; + + addMenuItem(name: string, settings: {}): void; + + addQueryStateHandler(name: string, callback: () => boolean, scope?: {}): void; + + addQueryValueHandler(name: string, callback: () => {}, scope?: {}): void; + + addShortcut(pattern: string, desc: string, cmdFunc: string, sc?: {}): boolean; + + addSidebar(name: string, settings: {}): void; + + addVisual(elm?: Element): void; + + convertURL(url: string, name: string, elm: string): string; + + destroy(automatic?: boolean): void; + + execCallback(name: string): {}; + + execCommand(cmd: string, ui: boolean, value?: any, args?: {}): void; + + focus(skipFocus: boolean): void; + + getBody(): HTMLBodyElement; + + getContainer(): Element; + + getContent(args?: {}): string; + + getContentAreaContainer(): Element; + + getDoc(): Document; + + getElement(): Element; + + getLang(name: string, defaultVal?: string): void; + + getParam(name: string, defaultVal?: string, type?: string): string; + + getWin(): Window; + + hasEventListeners(name: string): boolean; + + hide(): void; + + init(): void; + + insertContent(content: string, args?: {}): void; + + isDirty(): boolean; + + isHidden(): boolean; + + load(args?: {}): string; + + nodeChanged(args?: {}): void; + + queryCommandState(cmd: string): boolean; + + queryCommandSupported(cmd: string): boolean; + + queryCommandValue(cmd: string): {}; + + remove(): void; + + render(): void; + + save(args: {}): string; + + setContent(content: string, args?: {}): string; + + setDirty(state: boolean): void; + + setMode(mode: string): void; + + setProgressState(state: boolean, time: number): boolean; + + show(): void; + + translate(text: string): string; + + uploadImages(callback: () => void): Promise; + } + + export interface EditorCommands { + + addCommands(command_list: {}, type?: string): void; + + execCommand(command: string, ui?: boolean, value?: {}, args?: {}): boolean; + + queryCommandState(command: string): boolean | number; + + queryCommandSupported(command: string): boolean; + + queryCommandValue(command: string): {}; + } + + export interface EditorManager extends util.Observable { + + $: dom.DomQuery; + + activeEditor: TinyMce.Editor; + + baseURI: TinyMce.util.URI; + + baseURL: string; + + documentBaseURL: string; + + editors: TinyMce.Editor[]; + + i18n: {}; + + majorVersion: string; + + minorVersion: string; + + releaseDate: string; + + suffix: string; + + add(editor: TinyMce.Editor): TinyMce.Editor; + + addI18n(code: string, items: {}): void; + + createEditor(id: string, settings: {}): TinyMce.Editor; + + execCommand(cmd: string, ui?: boolean, value?: string): boolean; + + get(id: string): TinyMce.Editor; + + init(settings: Settings): Promise; + + overrideDefaults(defaultSettings: {}): void; + + remove(selector: TinyMce.Editor): TinyMce.Editor; + + setActive(editor: TinyMce.Editor): void; + + translate(text: string): string; + + triggerSave(): void; + } + + export interface Env { + + android: boolean; + + ceFalse: boolean; + + contentEditable: boolean; + + documentMode: boolean; + + fileApi: boolean; + + gecko: boolean; + + iOS: boolean; + + ie: boolean; + + mac: boolean; + + noCaretAfter: boolean; + + opera: boolean; + + range: boolean; + + transparentSrc: boolean; + + webKit: boolean; + } + + export namespace Events { + + export interface Event { + + type: string; + + target: string; + + isDefaultPrevented(): boolean; + + isImmediatePropagationStopped(): boolean; + + isPropagationStopped(): boolean; + + preventDefault(): void; + + stopImmediatePropagation(): void; + + stopPropagation(): void; + } + + export interface FocusBlurEvent extends Event { + + blurredEditor: Editor; + } + + export interface ContentEvent extends Event { + + format: string; + + set: boolean; + + content: string; + } + + export interface ProcessEvent extends Event { + + content: string; + + forced_root_block: string; + + format: string; + + get: boolean; + + get_inner: boolean; + + node: Node; + + selection: true; + } + + export interface NodeChangeEvent extends Event { + + element: Node; + + parents: Node[]; + + selectionChange: boolean; + } + + export interface UndoRedoEvent extends Event { + + level: {}; + } + + export interface ChangeEvent extends Event { + + lastLevel: {}; + + level: {}; + } + + export interface CommandEvent extends Event { + + command: string; + + ui: boolean; + + value: string; + } + } + + export interface FocusManager { + + isEditorUIElement(elm: Element): boolean; + } + + export class FocusManager implements FocusManager { + + constructor(editorManager: TinyMce.EditorManager); + } + + export interface Formatter { + + apply(name: string, vars?: {}, node?: html.Node): void; + + canApply(name: string): boolean; + + formatChanged(formats: string, callback: () => void, similar: boolean): void; + + get(name?: string): any[] | {}; + + getCssText(format: string): string; + + match(name: string, vars?: {}, node?: html.Node): boolean; + + matchAll(names: any[], vars?: {}): any[]; + + matchNode(node: html.Node, name: string, vars: {}, similar: boolean): {}; + + register(name: {}, format?: {}): void; + + remove(name: string, vars?: {}, node?: html.Node): void; + + toggle(name: string, vars?: {}, node?: html.Node): void; + + unregister(name: string): void; + } + + export class Formatter implements Formatter { + + constructor(ed: Editor); + } + + export interface Shortcuts { + + add(pattern: string, desc: string, cmdFunc: () => void | string, scope?: {}): boolean; + + remove(pattern: string): boolean; + } + + export interface Theme { + + renderUI(obj: {}): {}; } export interface UndoManager { - undo: () => any; - clear: () => void; - hasUndo: () => boolean; + + add(level?: {}, event?: DocumentEvent): {}; + + beforeChange(): void; + + clear(): void; + + extra(callback1: () => void, callback2: () => void): void; + + hasRedo(): boolean; + + hasUndo(): boolean; + + redo(): {}; + + transact(callback: () => void): {}; + + undo(): {}; } - export interface Static extends Observable { - init: (settings: any) => void; - execCommand: (c: string, u: boolean, v: string) => boolean; - activeEditor: Editor; - get: (id: string) => Editor; - triggerSave: () => void; + export interface WindowManager { + + alert(message: string, callback: () => void, scope?: {}): void; + + close(): void; + + confirm(message: string, callback: () => void, scope?: {}): void; + + getParams(): {}; + + getWindows(): Window[]; + + open(args: {}, params: {}): void; + + setParams(params: {}): void; + } + + export interface notificationManager { + + close(): void; + + getNotifications(): Array<{}>; + + open(args?: {}): void; + } + + export namespace dom { + + export interface BookmarkManager { + + getBookmark(type?: number, normalized?: boolean): {}; + + isBookmarkNode(node: HTMLElement): boolean; + + moveToBookmark(bookmark: {}): boolean; + } + + export interface DOMUtils { + + add(parentElm: string, name: string, attrs?: {}, html?: string, create?: boolean): Element | T[]; + + addClass(elm: string, cls: string): string | T[]; + + addStyle(cssText: string): void; + + bind(target: Element, name: string, func: () => void, scope?: {}): () => void; + + create(name: string, attrs?: {}, html?: string): Element; + + createFragment(html: string): DocumentFragment; + + createHTML(name: string, attrs?: {}, html?: string): string; + + createRng(): Range; + + decode(s: string): string; + + destroy(): void; + + encode(text: string): string; + + findCommonAncestor(a: Element, b: Element): Element; + + fire(target: Node, name: string, evt: {}): Event; + + get(n: string): Element; + + getAttrib(elm: string, name: string, defaultVal: string): string; + + getAttribs(elm?: HTMLElement): NodeList; + + getNext(node: Node, selector: string): Node; + + getOuterHTML(elm: string): string; + + getParent(node: Node, selector: () => void, root?: Node): Node; + + getParents(node: Node, selector: () => void, root?: Node): T[]; + + getPos(elm: Element, rootElm?: Element): {}; + + getPrev(node: Node, selector: string): Node; + + getRect(elm: Element): {}; + + getRoot(): Element; + + getSize(elm: Element): {}; + + getStyle(elm: string, name: string, computed: boolean): string; + + getViewPort(win?: Window): {}; + + hasClass(elm: string, cls: string): boolean; + + hide(elm: string): void; + + insertAfter(node: Element, referenceNode: Element): Element | T[]; + + is(elm: Node, selector: string): void; + + isBlock(node: Node): boolean; + + isEmpty(elements?: {}): boolean; + + isHidden(elm: string): boolean; + + loadCSS(url: string): void; + + nodeIndex(node: Node, normalized?: boolean): number; + + parseStyle(cssText: string): {}; + + remove(node: string, keepChildren?: boolean): Element | T[]; + + removeAllAttribs(e: Element): void; + + removeClass(elm: string, cls: string): string | T[]; + + rename(elm: Element, name: string): Element; + + replace(newElm: Element, oldElm: Element, keepChildren?: boolean): void; + + run(elm: string, func: () => void, scope?: {}): {} | T[]; + + select(selector: string, scope?: {}): T[]; + + serializeStyle(styles: {}, name?: string): string; + + setAttrib(elm: Element, name: string, value: string): void; + + setAttribs(elm: Element, attrs: {}): void; + + setHTML(elm: Element, html: string): void; + + setOuterHTML(elm: Element, html: {}): void; + + setStyle(elm: string, name: string, value: string): void; + + setStyles(elm: Element, styles: {}): void; + + show(elm: string): void; + + split(parentElm: Element, splitElm: Element, replacementElm?: Element): Element; + + toHex(rgbVal: string): string; + + toggleClass(elm: Element, cls: string, state?: string): void; + + unbind(target: Element, name: string, func: () => void): boolean | T[]; + + uniqueId(prefix?: string): string; + } + + export class DOMUtils implements DOMUtils { + + constructor(doc: Document, settings?: {}); + } + + export interface DomQuery { + + add(items: T[], sort?: boolean): DomQuery; + + addClass(className: string): DomQuery; + + after(content: string): DomQuery; + + append(content: string): DomQuery; + + appendTo(val: string): DomQuery; + + attr(name: string, value?: string): DomQuery | string; + + before(content: string): DomQuery; + + children(node: Element | string): DomQuery; + + clone(): DomQuery; + + closest(selector: string): DomQuery; + + contents(node: Element | string): DomQuery; + + css(name: string, value?: string): DomQuery | string; + + each(callback: () => void): DomQuery; + + each(obj: {}, callback: () => void): void; + + empty(): DomQuery; + + eq(index: number): DomQuery; + + extend(target: {}, object: {}): {}; + + filter(selector: string): DomQuery; + + find(selector: string): DomQuery; + + first(): DomQuery; + + grep(array: T[], callback: () => void): T[]; + + hasClass(className: string): boolean; + + hide(): DomQuery; + + html(value?: string): DomQuery | string; + + inArray(item: {}, array: T[]): number; + + is(selector: string): boolean; + + isArray(array: {}): boolean; + + last(): DomQuery; + + makeArray(object: {}): T[]; + + next(node: Element | string): DomQuery; + + nextUntil(node: Element | string, until: string): DomQuery; + + off(name?: string, callback?: () => void): DomQuery; + + offset(offset?: {}): {} | DomQuery; + + on(name: string, callback: () => void): DomQuery; + + parent(node: Element | string): DomQuery; + + parents(node: Element | string): DomQuery; + + parentsUntil(node: Element | string, until: string): DomQuery; + + prepend(content: string): DomQuery; + + prependTo(val: string): DomQuery; + + prev(node: Element | string): DomQuery; + + prevUntil(node: Element | string, until: string): DomQuery; + + remove(): DomQuery; + + removeAttr(name: string): DomQuery | string; + + removeClass(className: string): DomQuery; + + replaceWith(content: string): DomQuery; + + show(): DomQuery; + + slice(start: number, end?: number): DomQuery; + + text(value?: string): DomQuery | string; + + toArray(): T[]; + + toggleClass(className: string, state?: boolean): DomQuery; + + trigger(name: string): DomQuery; + + trim(str: string): string; + + unwrap(): DomQuery; + + wrap(content: string): DomQuery; + + wrapAll(content: string): DomQuery; + + wrapInner(content: string): DomQuery; + } + + export class DomQuery implements DomQuery { + + constructor(selector?: string, context?: Document); + } + + export interface EventUtils { + + bind(target: {}, names: string, callback: () => void, scope: {}): () => void; + + clean(target: {}): EventUtils; + + fire(target: {}, name: string, args?: {}): EventUtils; + + unbind(target: {}, names?: string, callback?: () => void): EventUtils; + } + + export interface RangeUtils { + + compareRanges(rng1: Range, rng2: Range): boolean; + + getCaretRangeFromPoint(clientX: number, clientY: number, doc: Document): Range; + } + + export interface ScriptLoader { + + add(url: string, success?: () => void, scope?: {}, failure?: () => void): void; + + isDone(url: string): boolean; + + load(url: string, callback1?: () => void, callback2?: () => void): void; + + loadQueue(success?: () => void, failure?: () => void, scope?: {}): void; + + loadScripts(scripts: string[], callback1?: () => void, scope?: {}, callback2?: () => void): void; + + markDone(url: string): void; + } + + export interface Selection { + + collapse(toStart?: boolean): void; + + getBookmark(type?: number, normalized?: boolean): {}; + + getContent(args?: {}): string; + + getEnd(real?: boolean): Element; + + getNode(): Element; + + getRng(w3c: boolean): Range; + + getSel(): Selection; + + getStart(real?: boolean): Element; + + isCollapsed(): boolean; + + moveToBookmark(bookmark: {}): boolean; + + select(node: Element, content?: boolean): Element; + + selectorChanged(selector: string, callback: () => void): void; + + setContent(content: string, args?: {}): void; + + setCursorLocation(node?: html.Node, offset?: number): void; + + setNode(elm: Element): Element; + + setRng(rng: Range, forward?: boolean): void; + } + + export class Selection implements Selection { + + constructor(dom: DOMUtils, win: Window, editor: Editor, serializer: Serializer); + } + + export interface Serializer { + + addAttributeFilter(callback: () => void): void; + + addNodeFilter(callback: () => void): void; + + addRules(rules: string): void; + + addTempAttr(name: string): void; + + serialize(node: HTMLElement, args: {}): void; + + setRules(rules: string): void; + + } + + export class Serializer implements Serializer { + + constructor(settings: {}, editor?: Editor); + } + + export interface TreeWalker { + + current(): html.Node; + + next(): html.Node; + + prev(): html.Node; + } + } + + export class TreeWalker implements TreeWalker { + + constructor(startNode: html.Node, rootNode: html.Node); + } + + export namespace geom { + + export interface Rect { + + clamp(rect: Rect, clampRect: Rect, fixedSize: boolean): Rect; + + create(x: number, y: number, w: number, h: number): Rect; + + findBestRelativePosition(rect: Rect, targetRect: Rect, constrainRect: Rect, rels: any[]): void; + + fromClientRect(clientRect: ClientRect): Rect; + + inflate(rect: Rect, w: number, h: number): Rect; + + intersect(rect: Rect, cropRect: Rect): Rect; + + relativePosition(rect: Rect, targetRect: Rect, rel: string): void; + } + } + + export namespace html { + + export interface DomParser { + + addAttributeFilter(attributes: string, callback: () => void): void; + + addNodeFilter(attributes: string, callback: () => void): void; + + filterNode(node: TinyMce.html.Node): TinyMce.html.Node; + + parse(html: string, args?: {}): TinyMce.html.Node; + } + + export class DomParser implements DomParser { + + constructor(settings: {}, schema: TinyMce.html.Schema); + } + + export interface Entities { + + decode(text: string): string; + + encodeAllRaw(text: string): string; + + encodeNamed(text: string, attr?: boolean, entities?: {}): string; + + encodeNumeric(text: string, attr?: boolean): string; + + encodeRaw(text: string, attr?: boolean): string; + + getEncodeFunc(name: string, entities?: string): () => void; + } + + export interface Node { + + append(node: TinyMce.html.Node): TinyMce.html.Node; + + attr(name: string, value?: string): string | TinyMce.html.Node; + + clone(): TinyMce.html.Node; + + create(name: string, attrs: {}): void; + + empty(): TinyMce.html.Node; + + getAll(name: string): TinyMce.html.Node[]; + + insert(node: TinyMce.html.Node, ref_node: TinyMce.html.Node, before?: boolean): TinyMce.html.Node; + + isEmpty(elements: {}): boolean; + + remove(): TinyMce.html.Node; + + replace(node: TinyMce.html.Node): TinyMce.html.Node; + + unwrap(): void; + + walk(prev?: boolean): TinyMce.html.Node; + + wrap(wrapperNode: TinyMce.html.Node): TinyMce.html.Node; + } + + export class Node implements Node { + + constructor(name: string, type: number); + } + + export interface SaxParser { + + parse(html: string): void; + } + + export class SaxParser implements SaxParser { + + constructor(settings: {}, schema: TinyMce.html.Schema); + } + + export interface Schema { + + addCustomElements(custom_elements: string): void; + + addValidChildren(valid_children: string): void; + + addValidElements(valid_elements: string): void; + + getBlockElements(): {}; + + getBoolAttrs(): {}; + + getCustomElements(): {}; + + getElementRule(name: string): {}; + + getInvalidStyles(): void; + + getMoveCaretBeforeOnEnterElements(): {}; + + getNonEmptyElements(): {}; + + getSelfClosingElements(): {}; + + getShortEndedElements(): {}; + + getSpecialElements(): {}; + + getTextBlockElements(): {}; + + getTextInlineElements(): {}; + + getValidClasses(): void; + + getValidStyles(): void; + + getWhiteSpaceElements(): {}; + + isValid(name: string, attr?: string): boolean; + + isValidChild(name: string, child: string): boolean; + + setValidElements(valid_elements: string): void; + } + + export class Schema implements Schema { + + constructor(settings: {}); + } + + export interface Serializer { + + serialize(node: TinyMce.html.Node): string; + } + + export class Serializer implements Serializer { + + constructor(settings: {}, schema: TinyMce.html.Schema); + } + + export interface Styles { + + parse(css: string): {}; + + serialize(styles: {}, elementName: string): string; + + toHex(color: string): string; + } + + export interface Writer { + + cdata(text: string): void; + + doctype(text: string): void; + + end(name: string): void; + + getContent(): string; + + pi(name: string, text: string): void; + + reset(): void; + + start(name: string, attrs?: any[], empty?: boolean): void; + + text(text: string, raw: boolean): void; + } + } + + export class Writer implements Writer { + + constructor(settings: {}); + } + + export namespace util { + + export interface Color { + + parse(value: {}): TinyMce.util.Color; + + toHex(): string; + + toHsv(): {}; + + toRgb(): {}; + } + + export class Color implements Color { + + constructor(value: string | {}); + } + + export interface Delay { + + clearInterval(interval: number): void; + + clearTimeout(timeout: number): void; + + debounce(callback: () => void, time: number): () => void; + + requestAnimationFrame(callback: () => void, element?: HTMLElement): void; + + setEditorInterval(callback: () => void, time: number): number; + + setEditorTimeout(editor: TinyMce.Editor, callback: () => void, time: number): number; + + setInterval(callback: () => void, time: number): number; + + setTimeout(callback: () => void, time: number): number; + } + + export interface EventDispatcher { + + fire(name: string, args?: {}): {}; + + has(name: string): boolean; + + isNative(name: string): boolean; + + off(name: string, callback?: () => void): {}; + + on(name: string, callback: () => void, first?: boolean): {}; + + once(name: string, callback: () => void, first: boolean): {}; + } + + export interface i18n { + + rtl: boolean; + + add(code: string, items: Array<{}>): void; + + getCode(): string; + + setCode(newCode: string): void; + + translate(text: string): string; + } + + export interface JSON { + + parse(s: string): {}; + + serialize(obj: {}, quote?: string): string; + } + + export interface JSONRequest { + + send(args: {}): void; + + sendRPC(o: {}): void; + } + + export interface LocalStorage { + + length: number; + + clear(): void; + + getItem(key: string): string; + + key(index: number): string; + + removeItem(key: string): void; + + setItem(key: string, value: string): void; + } + + export interface Observable { + + fire(name: string, args?: {}, bubble?: boolean): {}; + + hasEventListeners(name: string): boolean; + + off(name?: string, callback?: () => void): {}; + + on(name: string, callback: (event: any) => void, first?: boolean): {}; + + once(name: string, callback: (event: any) => void): {}; + } + + export interface Tools { + + create(s: string, p: {}, root?: {}): void; + + createNS(n: string, o?: {}): {}; + + each(o: {}, cb: () => void, s?: {}): void; + + explode(s: string, d: string): void; + + grep(a: T[], f: () => void): T[]; + + inArray(item: T, arr: T[]): number; + + is(obj: {}, type: string): boolean; + + isArray(obj: {}): boolean; + + makeMap(items: T[], delim?: string, map?: {}): {}; + + map(array: T[], callback: (c: T) => S): S[]; + + resolve(n: string, o?: {}): {}; + + toArray(obj: {}): T[]; + + trim(s: string): string; + + walk(o: {}, f: () => void, n?: string, s?: string): void; + } + + export interface URI { + + getURI(noProtoHost: boolean): URI; + + isSameOrigin(uri: TinyMce.util.URI): boolean; + + setPath(path: string): void; + + toAbsPath(base: string, path: string): void; + + toAbsolute(uri: string, noHost: boolean): string; + + toRelPath(base: string, path: string): void; + + toRelative(uri: string): string; + } + + export class URI implements URI { + + constructor(url: string, settings?: {}); + } + + export interface XHR { + + fire(name: string, args?: {}, bubble?: boolean): {}; + + hasEventListeners(name: string): boolean; + + off(name?: string, callback?: () => void): {}; + + on(name: string, callback: () => void, first?: boolean): {}; + + once(name: string, callback: () => void): {}; + + send(settings: {}): void; + } + } } -declare var tinymce: TinyMCE.Static; +declare var tinymce: TinyMce.Static; diff --git a/tinymce/tinymce-tests.ts b/tinymce/tinymce-tests.ts index 3b3f3386f1..18dd5cfbc7 100644 --- a/tinymce/tinymce-tests.ts +++ b/tinymce/tinymce-tests.ts @@ -1,12 +1,17 @@ tinymce.init( { - selector: '.tinymce-editable', - height: 145, + selector: 'textarea', + height: 500, + menubar: false, plugins: [ - 'autolink table contextmenu paste code link textcolor colorpicker image imagetools' + 'advlist autolink lists link image charmap print preview anchor', + 'searchreplace visualblocks code fullscreen', + 'insertdatetime media table contextmenu paste code' ], - menubar: 'edit insert table tools', - toolbar: 'undo redo | styleselect bold italic forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | link image', - content_css: 'page.css' + toolbar: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image', + content_css: '//www.tinymce.com/css/codepen.min.css' } -); \ No newline at end of file +); + + +let t = new TinyMce.util.Color('#FFFFFF'); From 44449d5481a1bec25d9f61bfee04722bb7f8ccaf Mon Sep 17 00:00:00 2001 From: Kang Date: Fri, 10 Mar 2017 15:58:22 +0900 Subject: [PATCH 046/276] Fixed ES6 import error. (#14917) Fixed this error message "resolves to a non-module entity and cannot be imported using this construct." --- file-type/index.d.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/file-type/index.d.ts b/file-type/index.d.ts index a1bc0d8466..3a88fe0a94 100644 --- a/file-type/index.d.ts +++ b/file-type/index.d.ts @@ -5,11 +5,13 @@ /// -interface FileTypeResult { - ext: string - mime: string +export = FileType; + +declare function FileType(buf: Buffer): FileType.FileTypeResult; + +declare namespace FileType { + export interface FileTypeResult { + ext: string; + mime: string; + } } - -declare function FileType(buf: Buffer): FileTypeResult - -export = FileType From 3c07598678e48c8985341bab45d58fbe52c8aa98 Mon Sep 17 00:00:00 2001 From: Anurag Rao Date: Fri, 10 Mar 2017 12:29:11 +0530 Subject: [PATCH 047/276] Moving __DEV__ to global namespace (#14916) --- react-native/index.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/react-native/index.d.ts b/react-native/index.d.ts index 0330d39a90..950451e574 100644 --- a/react-native/index.d.ts +++ b/react-native/index.d.ts @@ -8323,11 +8323,11 @@ declare module "react" { declare global { const global: React.GlobalStatic; function require(name: string): any; -} -/** - * This variable is set to true when react-native is running in Dev mode - * Typical usage: - * if (__DEV__) console.log('Running in dev mode') - */ -declare var __DEV__: boolean + /** + * This variable is set to true when react-native is running in Dev mode + * Typical usage: + * if (__DEV__) console.log('Running in dev mode') + */ + var __DEV__: boolean +} From b50995f7df8ee58e46f4c64dc229ead49b4b59bd Mon Sep 17 00:00:00 2001 From: Calvin Jeong Date: Fri, 10 Mar 2017 19:59:35 +1300 Subject: [PATCH 048/276] Add a definition for `Box3.expandByObject()` in three.js (#14915) Not a documented method yet, but have been included in the latest build (r84) of the library. See mrdoob/three.js#10474 for more info. From 279736f8b2ce760ece5a76ff7c9ccd5de6f75e09 Mon Sep 17 00:00:00 2001 From: Diogo Sant'Ana Date: Fri, 10 Mar 2017 03:59:49 -0300 Subject: [PATCH 049/276] Add fromLabel and toLabel to Locale (#14914) Add fromLabel and toLabel to Locale to daterangepicker --- daterangepicker/index.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/daterangepicker/index.d.ts b/daterangepicker/index.d.ts index 7929474994..d78e06dd97 100644 --- a/daterangepicker/index.d.ts +++ b/daterangepicker/index.d.ts @@ -140,6 +140,14 @@ declare namespace daterangepicker { * Text for apply label. */ applyLabel?: string; + /** + * Text for fromLabel label. + */ + fromLabel?: string; + /** + * Text for toLabel label. + */ + toLabel?: string; /** * Format of the date string. example: 'YYYY-MM-DD' */ From 951a105ad7c3492861201c2aa1331d8913af3c10 Mon Sep 17 00:00:00 2001 From: Ryan Price Date: Fri, 10 Mar 2017 02:00:40 -0500 Subject: [PATCH 050/276] Add react-tether definition (#14913) --- react-tether/index.d.ts | 25 +++++++++++++++++++++++++ react-tether/react-tether-tests.tsx | 16 ++++++++++++++++ react-tether/tsconfig.json | 25 +++++++++++++++++++++++++ react-tether/tslint.json | 2 ++ 4 files changed, 68 insertions(+) create mode 100644 react-tether/index.d.ts create mode 100644 react-tether/react-tether-tests.tsx create mode 100644 react-tether/tsconfig.json create mode 100644 react-tether/tslint.json diff --git a/react-tether/index.d.ts b/react-tether/index.d.ts new file mode 100644 index 0000000000..14344c5476 --- /dev/null +++ b/react-tether/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for react-tether 0.5 +// Project: https://github.com/souporserious/react-tether +// Definitions by: Ryan Price +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export default TetherComponent; +export as namespace ReactTether; + +import * as React from 'react'; +import * as Tether from 'tether'; + +declare class TetherComponent extends React.Component { } + +declare namespace ReactTether { + export interface TetherComponentProps extends React.Props, Tether.ITetherOptions { + renderElementTag?: string; + renderElementTo?: string | {appendChild: (element: HTMLElement) => void}; + id?: string; + className?: string; + style?: React.CSSProperties; + onUpdate?: () => void; + onRepositioned?: () => void; + } +} diff --git a/react-tether/react-tether-tests.tsx b/react-tether/react-tether-tests.tsx new file mode 100644 index 0000000000..666329621e --- /dev/null +++ b/react-tether/react-tether-tests.tsx @@ -0,0 +1,16 @@ +import TetherComponent from "react-tether"; +import * as React from "react"; + +const ReactTetherAllOptions: JSX.Element = + {}} + onRepositioned={() => {}} + renderElementTag="div" + renderElementTo=".container" + />; + +const ReactTetherRequiredOptions: JSX.Element = + ; \ No newline at end of file diff --git a/react-tether/tsconfig.json b/react-tether/tsconfig.json new file mode 100644 index 0000000000..f2138b25c9 --- /dev/null +++ b/react-tether/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "jsx": "react", + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-tether-tests.tsx" + ] +} + diff --git a/react-tether/tslint.json b/react-tether/tslint.json new file mode 100644 index 0000000000..ccdb64abf2 --- /dev/null +++ b/react-tether/tslint.json @@ -0,0 +1,2 @@ +{ "extends": "../tslint.json" } + From 5eff71dd9c1c3c8da50003007ed6136401804271 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 10 Mar 2017 16:03:22 +0900 Subject: [PATCH 051/276] add new options to introjs (#14912) --- intro.js/index.d.ts | 4 ++++ intro.js/intro.js-tests.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/intro.js/index.d.ts b/intro.js/index.d.ts index d7893018c2..b0925cd41a 100644 --- a/intro.js/index.d.ts +++ b/intro.js/index.d.ts @@ -21,6 +21,8 @@ declare namespace IntroJs { prevLabel?: string; skipLabel?: string; doneLabel?: string; + hidePrev?: boolean; + hideNext?: boolean; tooltipPosition?: string; tooltipClass?: string; highlightClass?: string; @@ -33,10 +35,12 @@ declare namespace IntroJs { showProgress?: boolean; scrollToElement?: boolean; overlayOpacity?: number; + scrollPadding?: number; positionPrecedence?: string[]; disableInteraction?: boolean; hintPosition?: string; hintButtonLabel?: string; + hintAnimation?: boolean; steps?: Step[]; hints?: Hint[]; } diff --git a/intro.js/intro.js-tests.ts b/intro.js/intro.js-tests.ts index 0d79c1bd21..19267a94a3 100644 --- a/intro.js/intro.js-tests.ts +++ b/intro.js/intro.js-tests.ts @@ -8,6 +8,10 @@ intro.setOption('doneLabel', 'Next page'); intro.setOption('overlayOpacity', 50); intro.setOption('showProgress', true); intro.setOptions({ + hidePrev: true, + hideNext: false, + scrollPadding: 30, + hintAnimation: false, steps: [ { intro: "Hello world!" From 572f175d05b1209ec49755949785cd2a2d65da0e Mon Sep 17 00:00:00 2001 From: Bill Kim Date: Fri, 10 Mar 2017 02:03:57 -0500 Subject: [PATCH 052/276] adding keyed partitioner so can overrwrite prototype (#14911) * adding keyed partitioner to can overrwrite prototype * adding close to client/producers * adding myself to Defintitions by * not exporting KeyedPartitioner, passing into HLP and producer --- kafka-node/index.d.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/kafka-node/index.d.ts b/kafka-node/index.d.ts index 018b1a6f9e..a9992ccc52 100644 --- a/kafka-node/index.d.ts +++ b/kafka-node/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for kafka-node 1.3.3 // Project: https://github.com/SOHU-Co/kafka-node/ -// Definitions by: Daniel Imrie-Situnayake +// Definitions by: Daniel Imrie-Situnayake , Bill // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -9,22 +9,26 @@ export declare class Client { constructor(connectionString: string, clientId: string, options?: ZKOptions); close(callback?: Function): void; topicExists(topics: Array, callback: Function): void; + refreshMetadata(topics: Array, cb?: (error: any, data: any) => any): void; + close(cb: (error: any) => any): void; } export declare class Producer { - constructor(client: Client); + constructor(client: Client, options?: any, customPartitioner?: any); on(eventName: string, cb: () => any): void; on(eventName: string, cb: (error: any) => any): void; send(payloads: Array, cb: (error: any, data: any) => any): void; createTopics(topics: Array, async: boolean, cb?: (error: any, data: any) => any): void; + close(cb: (error: any) => any): void; } export declare class HighLevelProducer { - constructor(client: Client, options?: any); + constructor(client: Client, options?: any, customPartitioner?: any); on(eventName: string, cb: () => any): void; on(eventName: string, cb: (error: any) => any): void; send(payloads: Array, cb: (error: any, data: any) => any): void; createTopics(topics: Array, async: boolean, cb?: (error: any, data: any) => any): void; + close(cb: (error: any) => any): void; } export declare class Consumer { @@ -96,7 +100,7 @@ export interface ZKOptions { export interface ProduceRequest { topic: string; messages: any; // Array | Array | string | KeyedMessage - key?: string; + key?: any; partition?: number; attributes?: number; } From 99a966dddd29b044334eb851f26e6c5877f388c6 Mon Sep 17 00:00:00 2001 From: Ryan Price Date: Fri, 10 Mar 2017 02:06:07 -0500 Subject: [PATCH 053/276] tether attachment is not optional (#14910) --- tether-drop/tether-drop-tests.ts | 2 +- tether/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tether-drop/tether-drop-tests.ts b/tether-drop/tether-drop-tests.ts index cdfdf030f4..b6069bc76b 100644 --- a/tether-drop/tether-drop-tests.ts +++ b/tether-drop/tether-drop-tests.ts @@ -10,7 +10,7 @@ var d = new Drop({ constrainToWindow: true, constrainToScrollParent: true, classes: "", - tetherOptions: {}, + tetherOptions: {attachment: "bottom left"}, remove: true, target: yellowBox, beforeClose: () => true, diff --git a/tether/index.d.ts b/tether/index.d.ts index 302801f8aa..4a5b1cc2fd 100644 --- a/tether/index.d.ts +++ b/tether/index.d.ts @@ -21,7 +21,7 @@ declare class Tether { declare namespace Tether { interface ITetherOptions { - attachment?: string; + attachment: string; bodyElement?: HTMLElement; classes?: {[className: string]: boolean}; classPrefix?: string; From 8c005f6db9f37eb3cfff09ab0f6333766afe9b90 Mon Sep 17 00:00:00 2001 From: Chaz Clark Date: Fri, 10 Mar 2017 02:06:31 -0500 Subject: [PATCH 054/276] Add overlayStyle prop to RaisedButtonProps. (#14909) This is available per Material-UI docs to allow for styling the raised button's overlay. --- material-ui/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/material-ui/index.d.ts b/material-ui/index.d.ts index f2285f4809..2268215ae1 100644 --- a/material-ui/index.d.ts +++ b/material-ui/index.d.ts @@ -689,6 +689,7 @@ declare namespace __MaterialUI { onMouseUp?: React.MouseEventHandler<{}>; onTouchEnd?: React.TouchEventHandler<{}>; onTouchStart?: React.TouchEventHandler<{}>; + overlayStyle?: React.CSSProperties; primary?: boolean; rippleStyle?: React.CSSProperties; secondary?: boolean; From 0bd7a61bdfcc8252a39dc308ab9935dd3f2b8cc8 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 9 Mar 2017 23:07:42 -0800 Subject: [PATCH 055/276] Cleaned up docs for sinon-as-promised (#14908) --- sinon-as-promised/index.d.ts | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/sinon-as-promised/index.d.ts b/sinon-as-promised/index.d.ts index ab75217011..5efe4df979 100644 --- a/sinon-as-promised/index.d.ts +++ b/sinon-as-promised/index.d.ts @@ -6,17 +6,22 @@ import * as s from "sinon"; declare module "sinon" { - interface SinonStub { - - /** - * When called, the stub will return a "thenable" object which will return a promise for the provided value. Any Promises/A+ compliant library will handle this object properly. - */ - resolves(value:any):SinonStub; - - /** - * When called, the stub will return a thenable which ill return a reject promise with the provided err. If err is a string, it will be set as the message on an Error object. - */ - rejects(err:any):SinonStub; - } + interface SinonStub { + /** + * Causes the stub to resolve with the provided value. + * + * @param value Resolve value. + * @remarks Any Promises/A+ compliant library will handle this object properly. + */ + resolves(value: T): SinonStub; + /** + * Causes the stub to reject with the provided error. + * + * @param error Rejection error. + * @returns A thenable which will return a rejected promise with the provided error. + * @remarks If error is a string, it will be set as the message on an Error object. + */ + rejects(error: any): SinonStub; + } } From ff4dd92b0e626505c2efb4d45cbe944e3b8e7838 Mon Sep 17 00:00:00 2001 From: vilicvane Date: Fri, 10 Mar 2017 15:19:23 +0800 Subject: [PATCH 056/276] use PromiseLike instead of PromisesAPlus.Thenable (#14902) * use PromiseLike instead of PromisesAPlus.Thenable `PromisesAPlus.Thenable` is not compatible with TypeScript 2.2 `await` (though it should also been updated), but as there are already a bunch of declarations using `PromiseLike`... * update test --- chai-as-promised/chai-as-promised-tests.ts | 6 +- chai-as-promised/index.d.ts | 153 ++++++++++----------- 2 files changed, 78 insertions(+), 81 deletions(-) diff --git a/chai-as-promised/chai-as-promised-tests.ts b/chai-as-promised/chai-as-promised-tests.ts index 0fde03dfa3..7e22c575aa 100644 --- a/chai-as-promised/chai-as-promised-tests.ts +++ b/chai-as-promised/chai-as-promised-tests.ts @@ -1,5 +1,3 @@ - -/// /// import chai = require('chai'); @@ -12,7 +10,7 @@ class TestClass {} // ReSharper disable WrongExpressionStatement // BDD API (expect) -var thenableNum: PromisesAPlus.Thenable; +var thenableNum: PromiseLike; thenableNum = chai.expect(thenableNum).to.eventually.equal(3); thenableNum = chai.expect(thenableNum).to.eventually.have.property('foo'); thenableNum = chai.expect(thenableNum).to.become(3); @@ -56,7 +54,7 @@ Q.all([ ]).should.notify(() => console.log('done')); // Assert API -var thenableVoid: PromisesAPlus.Thenable; +var thenableVoid: PromiseLike; thenableVoid = chai.assert.eventually.equal(thenableNum, 4, 'Message'); thenableVoid = chai.assert.isFulfilled(thenableNum, "optional message"); thenableVoid = chai.assert.becomes(thenableNum, "foo", "optional message"); diff --git a/chai-as-promised/index.d.ts b/chai-as-promised/index.d.ts index b4f3ca405d..4c36eccb61 100644 --- a/chai-as-promised/index.d.ts +++ b/chai-as-promised/index.d.ts @@ -4,7 +4,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// declare module 'chai-as-promised' { function chaiAsPromised(chai: any, utils: any): void; @@ -27,7 +26,7 @@ declare namespace Chai { // Eventually does not have .then(), but PromisedAssertion have. interface Eventually extends PromisedLanguageChains, PromisedNumericComparison, PromisedTypeComparison { // From chai-as-promised - become(expected: PromisesAPlus.Thenable): PromisedAssertion; + become(expected: PromiseLike): PromisedAssertion; fulfilled: PromisedAssertion; rejected: PromisedAssertion; rejectedWith(expected: any, message?: string | RegExp): PromisedAssertion; @@ -74,7 +73,7 @@ declare namespace Chai { members: PromisedMembers; } - interface PromisedAssertion extends Eventually, PromisesAPlus.Thenable { + interface PromisedAssertion extends Eventually, PromiseLike { } interface PromisedLanguageChains { @@ -181,111 +180,111 @@ declare namespace Chai { // For Assert API interface Assert { eventually: PromisedAssert; - isFulfilled(promise: PromisesAPlus.Thenable, message?: string): PromisesAPlus.Thenable; - becomes(promise: PromisesAPlus.Thenable, expected: any, message?: string): PromisesAPlus.Thenable; - doesNotBecome(promise: PromisesAPlus.Thenable, expected: any, message?: string): PromisesAPlus.Thenable; - isRejected(promise: PromisesAPlus.Thenable, message?: string): PromisesAPlus.Thenable; - isRejected(promise: PromisesAPlus.Thenable, expected: any, message?: string): PromisesAPlus.Thenable; - isRejected(promise: PromisesAPlus.Thenable, match: RegExp, message?: string): PromisesAPlus.Thenable; - notify(fn: Function): PromisesAPlus.Thenable; + isFulfilled(promise: PromiseLike, message?: string): PromiseLike; + becomes(promise: PromiseLike, expected: any, message?: string): PromiseLike; + doesNotBecome(promise: PromiseLike, expected: any, message?: string): PromiseLike; + isRejected(promise: PromiseLike, message?: string): PromiseLike; + isRejected(promise: PromiseLike, expected: any, message?: string): PromiseLike; + isRejected(promise: PromiseLike, match: RegExp, message?: string): PromiseLike; + notify(fn: Function): PromiseLike; } export interface PromisedAssert { - fail(actual?: any, expected?: any, msg?: string, operator?: string): PromisesAPlus.Thenable; + fail(actual?: any, expected?: any, msg?: string, operator?: string): PromiseLike; - ok(val: any, msg?: string): PromisesAPlus.Thenable; - notOk(val: any, msg?: string): PromisesAPlus.Thenable; + ok(val: any, msg?: string): PromiseLike; + notOk(val: any, msg?: string): PromiseLike; - equal(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; - notEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; + equal(act: any, exp: any, msg?: string): PromiseLike; + notEqual(act: any, exp: any, msg?: string): PromiseLike; - strictEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; - notStrictEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; + strictEqual(act: any, exp: any, msg?: string): PromiseLike; + notStrictEqual(act: any, exp: any, msg?: string): PromiseLike; - deepEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; - notDeepEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; + deepEqual(act: any, exp: any, msg?: string): PromiseLike; + notDeepEqual(act: any, exp: any, msg?: string): PromiseLike; - isTrue(val: any, msg?: string): PromisesAPlus.Thenable; - isFalse(val: any, msg?: string): PromisesAPlus.Thenable; + isTrue(val: any, msg?: string): PromiseLike; + isFalse(val: any, msg?: string): PromiseLike; - isNull(val: any, msg?: string): PromisesAPlus.Thenable; - isNotNull(val: any, msg?: string): PromisesAPlus.Thenable; + isNull(val: any, msg?: string): PromiseLike; + isNotNull(val: any, msg?: string): PromiseLike; - isUndefined(val: any, msg?: string): PromisesAPlus.Thenable; - isDefined(val: any, msg?: string): PromisesAPlus.Thenable; + isUndefined(val: any, msg?: string): PromiseLike; + isDefined(val: any, msg?: string): PromiseLike; - isFunction(val: any, msg?: string): PromisesAPlus.Thenable; - isNotFunction(val: any, msg?: string): PromisesAPlus.Thenable; + isFunction(val: any, msg?: string): PromiseLike; + isNotFunction(val: any, msg?: string): PromiseLike; - isObject(val: any, msg?: string): PromisesAPlus.Thenable; - isNotObject(val: any, msg?: string): PromisesAPlus.Thenable; + isObject(val: any, msg?: string): PromiseLike; + isNotObject(val: any, msg?: string): PromiseLike; - isArray(val: any, msg?: string): PromisesAPlus.Thenable; - isNotArray(val: any, msg?: string): PromisesAPlus.Thenable; + isArray(val: any, msg?: string): PromiseLike; + isNotArray(val: any, msg?: string): PromiseLike; - isString(val: any, msg?: string): PromisesAPlus.Thenable; - isNotString(val: any, msg?: string): PromisesAPlus.Thenable; + isString(val: any, msg?: string): PromiseLike; + isNotString(val: any, msg?: string): PromiseLike; - isNumber(val: any, msg?: string): PromisesAPlus.Thenable; - isNotNumber(val: any, msg?: string): PromisesAPlus.Thenable; + isNumber(val: any, msg?: string): PromiseLike; + isNotNumber(val: any, msg?: string): PromiseLike; - isBoolean(val: any, msg?: string): PromisesAPlus.Thenable; - isNotBoolean(val: any, msg?: string): PromisesAPlus.Thenable; + isBoolean(val: any, msg?: string): PromiseLike; + isNotBoolean(val: any, msg?: string): PromiseLike; - typeOf(val: any, type: string, msg?: string): PromisesAPlus.Thenable; - notTypeOf(val: any, type: string, msg?: string): PromisesAPlus.Thenable; + typeOf(val: any, type: string, msg?: string): PromiseLike; + notTypeOf(val: any, type: string, msg?: string): PromiseLike; - instanceOf(val: any, type: Function, msg?: string): PromisesAPlus.Thenable; - notInstanceOf(val: any, type: Function, msg?: string): PromisesAPlus.Thenable; + instanceOf(val: any, type: Function, msg?: string): PromiseLike; + notInstanceOf(val: any, type: Function, msg?: string): PromiseLike; - include(exp: string, inc: any, msg?: string): PromisesAPlus.Thenable; - include(exp: any[], inc: any, msg?: string): PromisesAPlus.Thenable; + include(exp: string, inc: any, msg?: string): PromiseLike; + include(exp: any[], inc: any, msg?: string): PromiseLike; - notInclude(exp: string, inc: any, msg?: string): PromisesAPlus.Thenable; - notInclude(exp: any[], inc: any, msg?: string): PromisesAPlus.Thenable; + notInclude(exp: string, inc: any, msg?: string): PromiseLike; + notInclude(exp: any[], inc: any, msg?: string): PromiseLike; - match(exp: any, re: RegExp, msg?: string): PromisesAPlus.Thenable; - notMatch(exp: any, re: RegExp, msg?: string): PromisesAPlus.Thenable; + match(exp: any, re: RegExp, msg?: string): PromiseLike; + notMatch(exp: any, re: RegExp, msg?: string): PromiseLike; - property(obj: Object, prop: string, msg?: string): PromisesAPlus.Thenable; - notProperty(obj: Object, prop: string, msg?: string): PromisesAPlus.Thenable; - deepProperty(obj: Object, prop: string, msg?: string): PromisesAPlus.Thenable; - notDeepProperty(obj: Object, prop: string, msg?: string): PromisesAPlus.Thenable; + property(obj: Object, prop: string, msg?: string): PromiseLike; + notProperty(obj: Object, prop: string, msg?: string): PromiseLike; + deepProperty(obj: Object, prop: string, msg?: string): PromiseLike; + notDeepProperty(obj: Object, prop: string, msg?: string): PromiseLike; - propertyVal(obj: Object, prop: string, val: any, msg?: string): PromisesAPlus.Thenable; - propertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromisesAPlus.Thenable; + propertyVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; + propertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; - deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): PromisesAPlus.Thenable; - deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromisesAPlus.Thenable; + deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; + deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; - lengthOf(exp: any, len: number, msg?: string): PromisesAPlus.Thenable; + lengthOf(exp: any, len: number, msg?: string): PromiseLike; //alias frenzy - throw(fn: Function, msg?: string): PromisesAPlus.Thenable; - throw(fn: Function, regExp: RegExp): PromisesAPlus.Thenable; - throw(fn: Function, errType: Function, msg?: string): PromisesAPlus.Thenable; - throw(fn: Function, errType: Function, regExp: RegExp): PromisesAPlus.Thenable; + throw(fn: Function, msg?: string): PromiseLike; + throw(fn: Function, regExp: RegExp): PromiseLike; + throw(fn: Function, errType: Function, msg?: string): PromiseLike; + throw(fn: Function, errType: Function, regExp: RegExp): PromiseLike; - throws(fn: Function, msg?: string): PromisesAPlus.Thenable; - throws(fn: Function, regExp: RegExp): PromisesAPlus.Thenable; - throws(fn: Function, errType: Function, msg?: string): PromisesAPlus.Thenable; - throws(fn: Function, errType: Function, regExp: RegExp): PromisesAPlus.Thenable; + throws(fn: Function, msg?: string): PromiseLike; + throws(fn: Function, regExp: RegExp): PromiseLike; + throws(fn: Function, errType: Function, msg?: string): PromiseLike; + throws(fn: Function, errType: Function, regExp: RegExp): PromiseLike; - Throw(fn: Function, msg?: string): PromisesAPlus.Thenable; - Throw(fn: Function, regExp: RegExp): PromisesAPlus.Thenable; - Throw(fn: Function, errType: Function, msg?: string): PromisesAPlus.Thenable; - Throw(fn: Function, errType: Function, regExp: RegExp): PromisesAPlus.Thenable; + Throw(fn: Function, msg?: string): PromiseLike; + Throw(fn: Function, regExp: RegExp): PromiseLike; + Throw(fn: Function, errType: Function, msg?: string): PromiseLike; + Throw(fn: Function, errType: Function, regExp: RegExp): PromiseLike; - doesNotThrow(fn: Function, msg?: string): PromisesAPlus.Thenable; - doesNotThrow(fn: Function, regExp: RegExp): PromisesAPlus.Thenable; - doesNotThrow(fn: Function, errType: Function, msg?: string): PromisesAPlus.Thenable; - doesNotThrow(fn: Function, errType: Function, regExp: RegExp): PromisesAPlus.Thenable; + doesNotThrow(fn: Function, msg?: string): PromiseLike; + doesNotThrow(fn: Function, regExp: RegExp): PromiseLike; + doesNotThrow(fn: Function, errType: Function, msg?: string): PromiseLike; + doesNotThrow(fn: Function, errType: Function, regExp: RegExp): PromiseLike; - operator(val: any, operator: string, val2: any, msg?: string): PromisesAPlus.Thenable; - closeTo(act: number, exp: number, delta: number, msg?: string): PromisesAPlus.Thenable; + operator(val: any, operator: string, val2: any, msg?: string): PromiseLike; + closeTo(act: number, exp: number, delta: number, msg?: string): PromiseLike; - sameMembers(set1: any[], set2: any[], msg?: string): PromisesAPlus.Thenable; - includeMembers(set1: any[], set2: any[], msg?: string): PromisesAPlus.Thenable; + sameMembers(set1: any[], set2: any[], msg?: string): PromiseLike; + includeMembers(set1: any[], set2: any[], msg?: string): PromiseLike; - ifError(val: any, msg?: string): PromisesAPlus.Thenable; + ifError(val: any, msg?: string): PromiseLike; } } From 1f7df95edbd642715d537a46212f3f540ae0d558 Mon Sep 17 00:00:00 2001 From: Sergei Dorogin Date: Fri, 10 Mar 2017 10:20:21 +0300 Subject: [PATCH 057/276] Historyjs: added missed methods, arguments and fields (#14899) * Historyjs: changed: * pushState: added queue arg (optional) * replaceState: added queue arg (optional) * getState: added friendly, create args (optional) added: * method getStateId * method getStateById * method setTitle * method clearQueue * method clearAllIntervals * method getRootUrl * field emulated HistroyState: added: * field hashedUrl * field cleanUrl * history.js: added missed return types --- history.js/index.d.ts | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/history.js/index.d.ts b/history.js/index.d.ts index 5a24bd5d73..13d66b8cf6 100644 --- a/history.js/index.d.ts +++ b/history.js/index.d.ts @@ -20,9 +20,11 @@ interface Historyjs { enabled: boolean; - pushState(data: any, title: string, url: string): void; - replaceState(data: any, title: string, url: string): void; - getState(): HistoryState; + pushState(data: any, title: string, url: string, queue?: boolean): boolean; + replaceState(data: any, title: string, url: string, queue?: boolean): boolean; + getState(friendly?: boolean, create?: boolean): HistoryState; + getStateId (passedState: HistoryState): string; + getStateById (id: string): HistoryState; getStateByIndex(index: number): HistoryState; getCurrentIndex(): number; getHash(): string; @@ -37,12 +39,30 @@ interface Historyjs { debug(...messages: any[]): void; options: HistoryOptions; + + /** + * History.setTitle(title) + * Applies the title to the document + * @param {HistoryState} newState + * @return {Boolean} + */ + setTitle (newState: HistoryState): boolean + clearQueue(): Historyjs; + clearAllIntervals(): void; + getRootUrl(): string; + + emulated: { + hashChange?: any; + pushState?: any; + } } interface HistoryState { data?: any; title?: string; url: string; + hashedUrl?: string; + cleanUrl?: string; } interface HistoryOptions { @@ -56,6 +76,4 @@ interface HistoryOptions { initialTitle?: string; html4Mode?: boolean; delayInit?: number; - - } From 637e92c863a3b575b2865d37a59786b28193bee0 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 9 Mar 2017 23:21:23 -0800 Subject: [PATCH 058/276] ng-stomp: Fix in typescript@next (#14898) * Don't use a global `Headers` interface or it will be merged with the one in `lib.d.ts` --- ng-stomp/index.d.ts | 41 ++++++++++------------ ng-stomp/ng-stomp-tests.ts | 72 +++++++++++++++----------------------- ng-stomp/tslint.json | 6 ++++ 3 files changed, 53 insertions(+), 66 deletions(-) create mode 100644 ng-stomp/tslint.json diff --git a/ng-stomp/index.d.ts b/ng-stomp/index.d.ts index d686031bbf..3a91a64844 100644 --- a/ng-stomp/index.d.ts +++ b/ng-stomp/index.d.ts @@ -1,36 +1,31 @@ -// Type definitions for ngStomp +// Type definitions for ngStomp 0.2 // Project: https://github.com/beevelop/ng-stomp // Definitions by: Lukasz Potapczuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + /// - interface ngStomp { - sock:any; - stomp:any; - debug:any; - off: any; + sock: any; + stomp: any; + debug: any; + off: any; - setDebug:(callback:Function)=> void; - - connect: (endpoint:string, headers?:Headers)=> angular.IHttpPromise; - - disconnect: (callback:()=>void) => angular.IHttpPromise; - - subscribe: (destination:string, callback:(payload:string, headers:Headers, res:Function)=>void, headers?:Headers, scope?:any) => any; - - unsubscribe: () => any; - - send: (destination:string, body:any, headers:Headers)=> any; - - } - - interface Headers { - [key: string]: any; - } + setDebug(callback: Function): void; + connect(endpoint: string, headers?: ngStomp.Headers): angular.IHttpPromise; + disconnect(callback: () => void): angular.IHttpPromise; + subscribe(destination: string, callback: (payload: string, headers: ngStomp.Headers, res: Function) => void, headers?: ngStomp.Headers, scope?: any): any; + unsubscribe(): any; + send(destination: string, body: any, headers: ngStomp.Headers): any; +} +declare namespace ngStomp { + interface Headers { + [key: string]: any; + } +} diff --git a/ng-stomp/ng-stomp-tests.ts b/ng-stomp/ng-stomp-tests.ts index b579a3aa06..c1b662d1a5 100644 --- a/ng-stomp/ng-stomp-tests.ts +++ b/ng-stomp/ng-stomp-tests.ts @@ -1,48 +1,34 @@ -/// +class test { + constructor(private ngstomp: ngStomp) { + const connectHeaders = { + Auth: "user", + Accept: "lol" + }; -namespace ngStompTesting { + ngstomp.connect('/endpoint', connectHeaders) + // frame = CONNECTED headers + .then(function (frame) { + this.subscription = ngstomp.subscribe('/dest', function (payload, headers, res) { + this.payload = payload; + }, { + headers: "are awesome" + }); - "use strict"; - var ngStompTest = "ngStompTest"; + // Unsubscribe + this.subscription.unsubscribe(); - class test { - constructor(private ngstomp:ngStomp) { - var connectHeaders ={ - "Auth": "user", - "Accept": "lol" - }; + // Send message + ngstomp.send('/dest', { + message: 'body' + }, { + priority: 9, + custom: 42 //Custom Headers + }); - ngstomp.connect('/endpoint', connectHeaders) - - - // frame = CONNECTED headers - .then(function (frame) { - - this.subscription = ngstomp.subscribe('/dest', function (payload, headers, res) { - this.payload = payload; - }, { - "headers": "are awesome" - }); - - // Unsubscribe - this.subscription.unsubscribe(); - - // Send message - ngstomp.send('/dest', { - message: 'body' - }, { - priority: 9, - custom: 42 //Custom Headers - }); - - // Disconnect - ngstomp.disconnect(function () { - - }); - }); - } - - } - - angular.module("app").controller(ngStompTest, test); + // Disconnect + ngstomp.disconnect(() => {}); + }); + } } + +angular.module("app").controller("ngStompTest", test); diff --git a/ng-stomp/tslint.json b/ng-stomp/tslint.json new file mode 100644 index 0000000000..2ab0c36fa8 --- /dev/null +++ b/ng-stomp/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "../tslint.json", + "rules": { + "forbidden-types": false + } +} \ No newline at end of file From f630485bb188f5e5625c5b9f1921a19b8ddac5b3 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 9 Mar 2017 23:21:45 -0800 Subject: [PATCH 059/276] Fix more lint errors in tests (#14903) --- is-array/is-array-tests.ts | 2 +- jimp/jimp-tests.ts | 65 +-- jquery.tools/jquery.tools-tests.ts | 11 +- ltx/ltx-tests.ts | 4 +- node-xmpp-client/node-xmpp-client-tests.ts | 6 +- phonon/phonon-tests.ts | 408 +++++++++--------- promised-temp/promised-temp-tests.ts | 3 +- .../protractor-browser-logs-tests.ts | 22 +- xmpp-jid/xmpp-jid-tests.ts | 2 +- 9 files changed, 258 insertions(+), 265 deletions(-) diff --git a/is-array/is-array-tests.ts b/is-array/is-array-tests.ts index 9a8e252e05..327c2ea3d0 100644 --- a/is-array/is-array-tests.ts +++ b/is-array/is-array-tests.ts @@ -7,7 +7,7 @@ isArray(true); isArray([]); isArray({}); -var x = {} +var x = {}; if (isArray(x)) { x.push(0); } diff --git a/jimp/jimp-tests.ts b/jimp/jimp-tests.ts index fd1ed1d2b7..a312cd4586 100644 --- a/jimp/jimp-tests.ts +++ b/jimp/jimp-tests.ts @@ -1,4 +1,4 @@ -import Jimp = require('jimp') +import Jimp = require('jimp'); // All code below is from node-jimp document Jimp.read("lenna.png", (err, data) => { @@ -36,20 +36,20 @@ Jimp.read("http://www.example.com/path/to/lenna.jpg", (err, image) => { // do stuff with the image (if no exception) }); -var image = new Jimp(1, 2) -var w = 0 -var h = 0 -var x = 0 -var y = 0 -var f = 0 -var src = '' -var horz = Jimp.HORIZONTAL_ALIGN_CENTER -var vert = Jimp.VERTICAL_ALIGN_BOTTOM -var deg = 90 -var val = 0.5 -var hex = 0xFFFFFFFF -var r = 0 -var n = 1 +var image = new Jimp(1, 2); +var w = 0; +var h = 0; +var x = 0; +var y = 0; +var f = 0; +var src = ''; +var horz = Jimp.HORIZONTAL_ALIGN_CENTER; +var vert = Jimp.VERTICAL_ALIGN_BOTTOM; +var deg = 90; +var val = 0.5; +var hex = 0xFFFFFFFF; +var r = 0; +var n = 1; /* Resize */ image.contain(w, h); // scale the image to the given width and height, some parts of the image may be letter boxed image.cover(w, h); // scale the image to the given width and height, some parts of the image may be clipped @@ -72,6 +72,7 @@ image.mask(src, x, y); // masks the image with another Jimp image at x, /* Flip and rotate */ image.flip(horz, vert); // flip the image horizontally or vertically image.mirror(horz, vert); // an alias for flip + // rotate the image clockwise by a number of degrees. // Optionally, a resize mode can be passed. // If `false` is passed as the second parameter, @@ -92,7 +93,7 @@ image.normalize(); // normalize the channels in an image image.fade(f); // an alternative to opacity, fades the image by a factor 0 - 1. 0 will haven no effect. 1 will turn the image image.opacity(f); // multiply the alpha channel by each pixel by the factor f, 0 - 1 image.opaque(); // set the alpha channel on every pixel to fully opaque -image.background(hex); // set the default new pixel colour (e.g. 0xFFFFFFFF or 0x00000000) for by some operations (e.g. image.contain and +image.background(hex); // set the default new pixel colour (e.g. 0xFFFFFFFF or 0x00000000) for by some operations (e.g. image.contain and /* Blurs */ image.gaussian(r); // Gaussian blur the image by r pixels (VERY slow) @@ -111,15 +112,15 @@ image.resize(250, 250, Jimp.RESIZE_BEZIER); image.contain(250, 250, Jimp.HORIZONTAL_ALIGN_LEFT | Jimp.VERTICAL_ALIGN_TOP); -var path = '' -var str = '' -var width = 0 +var path = ''; +var str = ''; +var width = 0; Jimp.loadFont(path).then(font => { // load font from .fnt file image.print(font, x, y, str); // print a message on an image image.print(font, x, y, str, width); // print a message on an image with text wrapped at width }); -var cb = (err: Error, data: any) => {} +var cb = (err: Error, data: any) => {}; Jimp.loadFont(path, cb); // using a callback pattern Jimp.loadFont(Jimp.FONT_SANS_32_BLACK).then(font => { @@ -129,16 +130,16 @@ Jimp.loadFont(Jimp.FONT_SANS_32_BLACK).then(font => { image.write(path, cb); // Node-style callback will be fired when write is successful var file = "new_name." + image.getExtension(); -image.write(file) +image.write(file); -var mime = 'image/png' +var mime = 'image/png'; image.getBuffer(mime, cb); // Node-style callback will be fired with result image.getBase64(mime, cb); // Node-style callback will be fired with result image.quality(n); // set the quality of saved JPEG, 0 - 100 -var bool = true -var number = 0 +var bool = true; +var number = 0; image.rgba(bool); // set whether PNGs are saved as RGBA (true, default) or RGB (false) image.filterType(number); // set the filter type for the saved PNG image.deflateLevel(number); // set the deflate level for the saved PNG @@ -149,11 +150,11 @@ image.color([ { apply: 'lighten', params: [ 50 ] }, { apply: 'xor', params: [ '#06D' ] } ]); - image.convolution([ +image.convolution([ [-2, -1, 0], [-1, 1, 1], [ 0, 1, 2] - ]) +]); image.scan(0, 0, image.bitmap.width, image.bitmap.height, function(x, y, idx) { // x, y is the position of this pixel on the image // idx is the position start position of this rgba tuple in the bitmap Buffer @@ -170,9 +171,9 @@ image.scan(0, 0, image.bitmap.width, image.bitmap.height, function(x, y, idx) { image.getPixelColor(x, y); // returns the colour of that pixel e.g. 0xFFFFFFFF image.setPixelColor(hex, x, y); // sets the colour of that pixel -var g = 0 -var b = 0 -var a = 0 +var g = 0; +var b = 0; +var a = 0; Jimp.rgbaToInt(r, g, b, a); // e.g. converts 255, 255, 255, 255 to 0xFFFFFFFF Jimp.intToRGBA(hex); // e.g. converts 0xFFFFFFFF to {r: 255, g: 255, b: 255, a:255} @@ -187,11 +188,11 @@ var image = new Jimp(256, 256, 0xFF0000FF, (err, image) => { image.hash(); // aHgG4GgoFjA image.hash(2); // 1010101011010000101010000100101010010000011001001001010011100100 -var image1 = new Jimp(0, 1) -var image2 = new Jimp(0, 1) +var image1 = new Jimp(0, 1); +var image2 = new Jimp(0, 1); Jimp.distance(image1, image2); // returns a number 0-1, where 0 means the two images are perceived to be identical -var threshold = 0 +var threshold = 0; var diff = Jimp.diff(image1, image2, threshold); // threshold ranges 0-1 (default: 0.1) diff.image; // a Jimp image showing differences diff.percent; // the proportion of different pixels (0-1), where 0 means the images are pixel identical diff --git a/jquery.tools/jquery.tools-tests.ts b/jquery.tools/jquery.tools-tests.ts index f8a4e39f90..0a435ccf02 100644 --- a/jquery.tools/jquery.tools-tests.ts +++ b/jquery.tools/jquery.tools-tests.ts @@ -40,7 +40,7 @@ $("#prompt form").submit(function(this: JQuery, e: JQueryEventObject) {   // close the overlay triggers.eq(1).overlay().close(); - //or more straightforward: + // or more straightforward: triggers.data('overlay').close();   // get user input @@ -53,7 +53,7 @@ $("#prompt form").submit(function(this: JQuery, e: JQueryEventObject) { return e.preventDefault(); }); -$.tools.overlay.addEffect('', function() {}, function() {}); +$.tools.overlay.addEffect('', () => {}, () => {}); /* custom effects */ $.tools.overlay.addEffect("myEffect", function(position, done) { @@ -101,8 +101,7 @@ $(function() { mask: 'darkred', effect: 'apple',   - onBeforeLoad: function() { -  + onBeforeLoad() { // grab wrapper element inside content var wrap = this.getOverlay().find(".contentWrap");   @@ -113,7 +112,7 @@ $(function() { }); }); -$(function() { +$(() => { // positions for each overlay var positions = [ [0, 530], @@ -169,7 +168,7 @@ $.tools.overlay.addEffect("drop", function(css, done) { /* closing animation */ }, function(done) { this.getOverlay().animate( - {top:'-=55', opacity:0, width:'-=20'}, 300, 'drop', + { top: '-=55', opacity: 0, width: '-=20' }, 300, 'drop', function(this: JQuery) { $(this).hide(); done.call(null); diff --git a/ltx/ltx-tests.ts b/ltx/ltx-tests.ts index a207efb4b7..9e924cbe60 100644 --- a/ltx/ltx-tests.ts +++ b/ltx/ltx-tests.ts @@ -2,13 +2,13 @@ import * as ltx from './index'; ltx.parse(''); -let p = new ltx.Parser(); +const p = new ltx.Parser(); p.on('tree', (ignored: any) => {}); p.on('error', (ignored: any) => {}); -let el = new ltx.Element('root').c('children'); +const el = new ltx.Element('root').c('children'); el.c('child', {age: 5}).t('Hello').up() .c('child', {age: 7}).t('Hello').up() .c('child', {age: 99}).t('Hello').up(); diff --git a/node-xmpp-client/node-xmpp-client-tests.ts b/node-xmpp-client/node-xmpp-client-tests.ts index 734067738e..0f7a4205ac 100644 --- a/node-xmpp-client/node-xmpp-client-tests.ts +++ b/node-xmpp-client/node-xmpp-client-tests.ts @@ -1,6 +1,6 @@ import {Client} from './index'; -let client = new Client({ +const client = new Client({ jid: 'user@example.com', password: 'password' }); @@ -10,10 +10,10 @@ client.connect(); client.on('online', () => {}); client.on('stanza', stanza => { - let _ = stanza; + const _ = stanza; }); -let stanza = new Client.Stanza('chat', {}) +const stanza = new Client.Stanza('chat', {}) .c('show').t('chat').up() .c('status').t('message'); client.send(stanza); diff --git a/phonon/phonon-tests.ts b/phonon/phonon-tests.ts index 0d5df50b4e..b817fef45b 100644 --- a/phonon/phonon-tests.ts +++ b/phonon/phonon-tests.ts @@ -19,23 +19,22 @@ phonon.options({ }); phonon.navigator().on({ - page: 'pagename', - content: 'content.html', - preventClose: false, - readyDelay: 1 -}, function(activity) { - activity.onCreate(function() {}); - activity.onReady(function() {}); - activity.onTransitionEnd(function() {}); - activity.onClose(function(self) {}); - activity.onHidden(function() {}); - activity.onHashChanged(function(req1, req2) {}); - activity.onTabChanged(function() {}) + page: 'pagename', + content: 'content.html', + preventClose: false, + readyDelay: 1 +}, activity => { + activity.onCreate(() => {}); + activity.onReady(() => {}); + activity.onTransitionEnd(() => {}); + activity.onClose(self => {}); + activity.onHidden(() => {}); + activity.onHashChanged((req1, req2) => {}); + activity.onTabChanged(() => {}); }); -phonon.navigator().onPage('home').addEvent('create', function () { -}); -phonon.navigator().onPage('home').addEvent('close', function (api) { +phonon.navigator().onPage('home').addEvent('create', () => {}); +phonon.navigator().onPage('home').addEvent('close', api => { api.close(); }); @@ -47,11 +46,11 @@ page = phonon.navigator().previousPage; let ev = document.createEvent(''); -document.on('pagecreated', function(event) { - console.log('global state pagecreated: ' + event.detail.page) +document.on('pagecreated', event => { + console.log('global state pagecreated: ' + event.detail.page); }); -document.on('pagehash', function(event) { - console.log('global state pagehash: ' + event.detail.page) +document.on('pagehash', event => { + console.log('global state pagehash: ' + event.detail.page); console.log(event.detail.req[0]); console.log(event.detail.req[1]); console.log(event.detail.req[2]); @@ -60,13 +59,13 @@ document.on('pagehash', function(event) { // Code examples from http://phonon.quarkdev.com/docs/i18n let element = document.createElement(''); phonon.i18n().bind(); -phonon.i18n().bind(function() {}); +phonon.i18n().bind(() => {}); phonon.i18n().bind(element); -phonon.i18n().bind(element, function() {}); +phonon.i18n().bind(element, () => {}); -phonon.i18n().getAll(function(json) {}); -phonon.i18n().get('my_key', function(value) {}); -phonon.i18n().get(['my_key_1', 'my_key_two'], function(values) {}); +phonon.i18n().getAll(json => {}); +phonon.i18n().get('my_key', value => {}); +phonon.i18n().get(['my_key_1', 'my_key_two'], values => {}); phonon.updateLocale('new-language'); phonon.i18n().setPreference("fr"); @@ -86,10 +85,10 @@ var req = phonon.ajax({ 'header-name1': 'value1', 'header-name2': 'value2' }, - success: function(res, xhr) { + success(res, xhr) { console.log(res); }, - error: function(res, flagError, xhr) { + error(res, flagError, xhr) { console.error(flagError); console.log(res); } @@ -104,14 +103,14 @@ let browsername: string = phonon.browser.name; let browserVersion: string = phonon.browser.version; // Code examples from http://phonon.quarkdev.com/docs/events -element.on('tap', function() {}); -phonon.onReady(function() {}); -document.querySelectorAll('.elements').on('tap', function() {}); +element.on('tap', () => {}); +phonon.onReady(() => {}); +document.querySelectorAll('.elements').on('tap', () => {}); -element.off('tap', function() {}); -document.querySelectorAll('.elements').off('tap', function() {}); +element.off('tap', () => {}); +document.querySelectorAll('.elements').off('tap', () => {}); -document.on('pageopened', function(evt) { +document.on('pageopened', evt => { console.log(evt.detail.page + ' is opened'); }); @@ -128,22 +127,22 @@ phonon.sidePanel('#side-panel-id').close(); // Code examples from http://phonon.quarkdev.com/docs/dialogs let pAlert = phonon.alert("text", "title", true, "textOk"); -pAlert.on('confirm', function() {}); +pAlert.on('confirm', () => {}); var pconfirm = phonon.confirm("text", "title", true, "textOk", "textCancel"); -pconfirm.on('confirm', function() {}) -pconfirm.on('cancel', function() {}); +pconfirm.on('confirm', () => {}); +pconfirm.on('cancel', () => {}); let pPrompt = phonon.prompt("text", "title", true, "textOk", "textCancel"); -pPrompt.on('confirm', function(inputValue) {}) -pPrompt.on('cancel', function() {}); +pPrompt.on('confirm', inputValue => {}); +pPrompt.on('cancel', () => {}); phonon.indicator("title", true); let myDialog = phonon.dialog('#my-dialog'); myDialog.open(); myDialog.close(); -myDialog.on('confirm', function() {}); +myDialog.on('confirm', () => {}); // Code examples from http://phonon.quarkdev.com/docs/notifications let notif = phonon.notif('Hello', 3000, true, 'CANCEL'); @@ -168,7 +167,7 @@ popover.setList([ value: 'tg' } ]); -popover.setList(['a', 'b', 'c'], function (item) { +popover.setList(['a', 'b', 'c'], item => { var text = typeof item === 'string' ? item : item.text; var value = typeof item === 'string' ? item : item.value; return '
  • ' + text + '
  • '; @@ -180,18 +179,18 @@ popover.attachButton(element, true); popover.openFrom('.button-for-popover'); popover.openFrom(element); -popover.onItemChanged(function (data) { - console.log('onItemChanged') - console.error(data) +popover.onItemChanged(data => { + console.log('onItemChanged'); + console.error(data); }); -element.on('itemchanged', function(event) { +element.on('itemchanged', event => { console.log(event.detail); }); popover = phonon.popover() .setList(['a', 'b', 'c']) .attachButton('.my-button', true) - .onItemChanged(function (data) { + .onItemChanged(data => { console.log(data); }).openFrom('.my-button'); @@ -220,39 +219,39 @@ phonon.options({ let app = phonon.navigator(); app.on({page: 'home', preventClose: false, content: null}); -app.on({page: 'pagetwo', preventClose: true, content: 'pagetwo.html', readyDelay: 1}, function(activity) { +app.on({page: 'pagetwo', preventClose: true, content: 'pagetwo.html', readyDelay: 1}, activity => { let action: string | null = null; - var onAction = function(evt: any) { + var onAction = (evt: any) => { var target = evt.target; action = 'ok'; - if(target.getAttribute('data-order') === 'order') { + if (target.getAttribute('data-order') === 'order') { phonon.alert('Thank you for your order!', 'Dear customer'); } else { phonon.alert('Your order has been canceled.', 'Dear customer'); } }; - activity.onCreate(function() { - let order = document.querySelector('.order'); + activity.onCreate(() => { + const order = document.querySelector('.order'); if (order != null) { order.on('tap', onAction); } - let cancel = document.querySelector('.cancel'); + const cancel = document.querySelector('.cancel'); if (cancel != null) { cancel.on('tap', onAction); } }); - activity.onClose(function(self) { - if(action !== null) { + activity.onClose(self => { + if (action !== null) { self.close(); } else { phonon.alert('Before leaving this page, you must perform an action.', 'Action required'); } }); - activity.onHidden(function() { + activity.onHidden(() => { action = null; }); - activity.onHashChanged(function(pizza) { - let pizzaElt = document.querySelector('.pizza'); + activity.onHashChanged(pizza => { + const pizzaElt = document.querySelector('.pizza'); if (pizzaElt != null) { pizzaElt.textContent = pizza; } @@ -262,66 +261,66 @@ app.start(); // Code example from http://phonon.quarkdev.com/App/public/phonon/kitchen-sink/index.html phonon.options({ - navigator: { - defaultPage: 'home', - animatePages: true, - templateRootDirectory: 'contents/', - enableBrowserBackButton: true // should be disabled on Cordova - }, - i18n: { - directory: 'lang/', - localeFallback: 'en', - localePreferred: 'en-US' - } + navigator: { + defaultPage: 'home', + animatePages: true, + templateRootDirectory: 'contents/', + enableBrowserBackButton: true // should be disabled on Cordova + }, + i18n: { + directory: 'lang/', + localeFallback: 'en', + localePreferred: 'en-US' + } }); var app2 = phonon.navigator(); app2.on({page: 'home', content: 'home.html'}); -app2.on({page: 'pagedialog', content: 'pagedialog.html'}, function(activity) { - activity.onCreate(function() { - let showAlert = document.querySelector('#show-alert'); - if (showAlert) { - showAlert.on('tap', function() { - phonon.alert('Example', 'Hello'); - }); - } +app2.on({page: 'pagedialog', content: 'pagedialog.html'}, activity => { + activity.onCreate(() => { + const showAlert = document.querySelector('#show-alert'); + if (showAlert) { + showAlert.on('tap', () => { + phonon.alert('Example', 'Hello'); + }); + } - let showConfirm = document.querySelector('#show-confirm'); - if (showConfirm) { - showConfirm.on('tap', function() { - let confirm = phonon.confirm('Example', 'Hello'); - confirm.on('confirm', function() { - phonon.alert('Confirmed!'); - }); - confirm.on('cancel', function(value) { - phonon.alert('Canceled!'); - }); - }); - } + const showConfirm = document.querySelector('#show-confirm'); + if (showConfirm) { + showConfirm.on('tap', () => { + const confirm = phonon.confirm('Example', 'Hello'); + confirm.on('confirm', () => { + phonon.alert('Confirmed!'); + }); + confirm.on('cancel', value => { + phonon.alert('Canceled!'); + }); + }); + } - let showPrompt = document.querySelector('#show-prompt'); - if (showPrompt) { - showPrompt.on('tap', function() { - var prompt = phonon.prompt('Example', 'Hello'); - prompt.on('confirm', function(value) { - phonon.alert(value, 'Inserted Value'); + const showPrompt = document.querySelector('#show-prompt'); + if (showPrompt) { + showPrompt.on('tap', () => { + var prompt = phonon.prompt('Example', 'Hello'); + prompt.on('confirm', value => { + phonon.alert(value, 'Inserted Value'); + }); + prompt.on('cancel', () => { + phonon.alert('Prompt Canceled'); + }); }); - prompt.on('cancel', function() { - phonon.alert('Prompt Canceled'); - }); - }); - } + } - let showIndicator = document.querySelector('#show-indicator'); - if (showIndicator) { - showIndicator.on('tap', function() { - let indicator = phonon.indicator('Please wait 3 seconds', false); - window.setTimeout(function() { - indicator.close(); - }, 3000); - }); - } - }); + const showIndicator = document.querySelector('#show-indicator'); + if (showIndicator) { + showIndicator.on('tap', () => { + const indicator = phonon.indicator('Please wait 3 seconds', false); + window.setTimeout(() => { + indicator.close(); + }, 3000); + }); + } + }); }); app2.on({page: 'pageform', content: 'pageform.html'}); @@ -331,69 +330,66 @@ app2.on({page: 'pagegrid', content: 'pagegrid.html'}); app2.on({page: 'pagelist', content: 'pagelist.html'}); app2.on({page: 'pageaccordion', content: 'pageaccordion.html'}); -app2.on({page: 'pagenotif', content: 'pagenotif.html', readyDelay: 500}, function(activity) { +app2.on({page: 'pagenotif', content: 'pagenotif.html', readyDelay: 500}, activity => { + activity.onCreate(() => { + const showAutoNotif = document.querySelector('#show-auto-notif'); + if (showAutoNotif) { + showAutoNotif.on('tap', () => { + phonon.notif('HELLO', 3000, false); + }); + } - activity.onCreate(function() { - let showAutoNotif = document.querySelector('#show-auto-notif'); - if (showAutoNotif) { - showAutoNotif.on('tap', function() { - phonon.notif('HELLO', 3000, false); - }); - } + const showNotif = document.querySelector('#show-notif'); + if (showNotif) { + showNotif.on('tap', () => { + phonon.notif('#notif-example').show(); + }); + } - let showNotif = document.querySelector('#show-notif'); - if (showNotif) { - showNotif.on('tap', function() { - phonon.notif('#notif-example').show(); - }); - } + const showNotifButton = document.querySelector('#show-notif-button'); + if (showNotifButton) { + showNotifButton.on('tap', () => { + phonon.notif('HELLO', 3000, true, 'Bye'); + }); + } + }); - let showNotifButton = document.querySelector('#show-notif-button'); - if (showNotifButton) { - showNotifButton.on('tap', function() { - phonon.notif('HELLO', 3000, true, 'Bye'); - }); - } - }); - - activity.onReady(function() { - phonon.notif('Welcome!', 3000, true); - - }); + activity.onReady(() => { + phonon.notif('Welcome!', 3000, true); + }); }); app2.on({page: 'pagepanel', content: 'pagepanel.html'}); app2.on({page: 'pagepopover', content: 'pagepopover.html'}); -app2.on({page: 'pagepreloader', content: 'pagepreloader.html'}, function(activity) { +app2.on({page: 'pagepreloader', content: 'pagepreloader.html'}, activity => { + activity.onReady(() => { + const myCircle = document.querySelector('#my-circle'); + if (myCircle) { + phonon.preloader(myCircle).show(); + } + const myDeterminate = document.querySelector('#my-determinate'); + if (myDeterminate) { + phonon.preloader(myDeterminate).show(); + } + }); - activity.onReady(function() { - let myCircle = document.querySelector('#my-circle'); - if (myCircle) { - phonon.preloader(myCircle).show(); - } - let myDeterminate = document.querySelector('#my-determinate'); - if (myDeterminate) { - phonon.preloader(myDeterminate).show(); - } - }); - - activity.onHidden(function() { - let myCircle = document.querySelector('#my-circle'); - if (myCircle) { - phonon.preloader(myCircle).hide(); - } - let myDeterminate = document.querySelector('#my-determinate'); - if (myDeterminate) { - phonon.preloader(myDeterminate).hide(); - } - }); + activity.onHidden(() => { + const myCircle = document.querySelector('#my-circle'); + if (myCircle) { + phonon.preloader(myCircle).hide(); + } + const myDeterminate = document.querySelector('#my-determinate'); + if (myDeterminate) { + phonon.preloader(myDeterminate).hide(); + } + }); }); app2.on({page: 'pagesidepanel', content: 'pagesidepanel.html'}); app2.on({page: 'pagetable', content: 'pagetable.html'}); -app2.on({page: 'pagetabs', content: 'pagetabs.html'}, function(activity) { - activity.onTabChanged(function(tabNumber) { - let tab = document.querySelector('.tab-number'); +app2.on({page: 'pagetabs', content: 'pagetabs.html'}, activity => { + activity.onTabChanged(tabNumber => { + const tab = document.querySelector('.tab-number'); if (tab) { tab.innerHTML = tabNumber + ""; } @@ -417,29 +413,27 @@ phonon.options({ }, i18n: null }); -phonon.navigator().on({ page: 'home' }, function(activity) { - activity.onReady(function(){ - // input where user typed words to query - let input = document.querySelector( '#searchJS' ); +phonon.navigator().on({ page: 'home' }, activity => { + activity.onReady(() => { + // input where user typed words to query + const input = document.querySelector( '#searchJS' ); let list = ''; // external autocomplete var req = phonon.ajax({ method: "GET", - url: 'https://restcountries.eu/rest/v1/lang/en', - dataType: "json", - success: function( res, xhr ){ - list = res.map( function(i: any){ - return i.name; - }); - // initialize autocomplete + url: 'https://restcountries.eu/rest/v1/lang/en', + dataType: "json", + success(res, xhr) { + list = res.map((i: any) => i.name); + // initialize autocomplete if (input) { - phonon.autocomplete( input, {list:list} ); + phonon.autocomplete(input, {list}); } - }, - error: function( res, flagError, xhr ){ + }, + error(res, flagError, xhr) { console.error(flagError); - console.log(res); - } + console.log(res); + } }); }); }); @@ -457,23 +451,23 @@ phonon.options({ }); let app3 = phonon.navigator(); -app3.on({page: 'home', content: null}, function(activity) { - activity.onCreate(function() { +app3.on({page: 'home', content: null}, activity => { + activity.onCreate(() => { let element = document.querySelector('#show-alert'); if (element) { - element.on('tap', function() { + element.on('tap', () => { phonon.alert('Example', 'Hello'); }); } element = document.querySelector('#show-confirm'); if (element) { - element.on('tap', function() { + element.on('tap', () => { var confirm = phonon.confirm('Example', 'Hello'); - confirm.on('confirm', function() { + confirm.on('confirm', () => { phonon.alert('Confirmed!'); }); - confirm.on('cancel', function(value) { + confirm.on('cancel', value => { phonon.alert('Canceled!'); }); }); @@ -481,12 +475,12 @@ app3.on({page: 'home', content: null}, function(activity) { element = document.querySelector('#show-prompt'); if (element) { - element.on('tap', function() { + element.on('tap', () => { var prompt = phonon.prompt('Example', 'Hello'); - prompt.on('confirm', function(value) { + prompt.on('confirm', value => { phonon.alert(value, 'Inserted Value'); }); - prompt.on('cancel', function() { + prompt.on('cancel', () => { phonon.alert('Prompt Canceled'); }); }); @@ -494,11 +488,11 @@ app3.on({page: 'home', content: null}, function(activity) { element = document.querySelector('#show-indicator'); if (element) { - element.on('tap', function() { + element.on('tap', () => { var indicator = phonon.indicator('Please wait 3 seconds', false); - window.setTimeout(function() { + window.setTimeout(() => { indicator.close(); - },3000); + }, 3000); }); } }); @@ -516,27 +510,27 @@ let elSetEnUs = document.querySelector('.set-en-us'); let defaultLocale = 'fr'; function setupHTML() { - let pref = (phonon.i18n().getPreference() ? phonon.i18n().getPreference() : 'not used'); - if (elPrefLang) { - elPrefLang.textContent = 'Preferred language : ' + pref; - } - if (elLang) { - elLang.textContent = 'Locale language : ' + phonon.i18n().getLocale(); - } - if (elDefault) { - elDefault.textContent = 'Default language : ' + defaultLocale; - } + const pref = (phonon.i18n().getPreference() ? phonon.i18n().getPreference() : 'not used'); + if (elPrefLang) { + elPrefLang.textContent = 'Preferred language : ' + pref; + } + if (elLang) { + elLang.textContent = 'Locale language : ' + phonon.i18n().getLocale(); + } + if (elDefault) { + elDefault.textContent = 'Default language : ' + defaultLocale; + } - // The parameter is optional, if you pass nothing, i18n will bind all the document - phonon.i18n().bind(); + // The parameter is optional, if you pass nothing, i18n will bind all the document + phonon.i18n().bind(); } -var setPreference = function (evt: any) { - var target = evt.target; - var lang = target.getAttribute('data-l'); - if(lang) { - phonon.updateLocale(lang); - } +var setPreference = (evt: any) => { + var target = evt.target; + var lang = target.getAttribute('data-l'); + if (lang) { + phonon.updateLocale(lang); + } }; if (elSetFr) { @@ -553,9 +547,9 @@ phonon.options({ defaultPage: 'home', }, i18n: { - directory: 'res/lang/', - localeFallback: defaultLocale, - localePreferred: 'en' + directory: 'res/lang/', + localeFallback: defaultLocale, + localePreferred: 'en' } }); setupHTML(); diff --git a/promised-temp/promised-temp-tests.ts b/promised-temp/promised-temp-tests.ts index 2b77184e25..ebe0a51517 100644 --- a/promised-temp/promised-temp-tests.ts +++ b/promised-temp/promised-temp-tests.ts @@ -9,8 +9,7 @@ function testCleanup() { temp.cleanup().then((result: boolean | Stats) => { if (typeof result === "boolean") { const x = result === true; - } - else { + } else { const { files, dirs } = result; files.toPrecision(4); } diff --git a/protractor-browser-logs/protractor-browser-logs-tests.ts b/protractor-browser-logs/protractor-browser-logs-tests.ts index 8e2e0ac015..75af9eb039 100644 --- a/protractor-browser-logs/protractor-browser-logs-tests.ts +++ b/protractor-browser-logs/protractor-browser-logs-tests.ts @@ -4,7 +4,7 @@ import * as webdriver from 'selenium-webdriver'; import Entry = webdriver.logging.Entry; function colored(entries: Entry[]) { - let colors: any = { INFO: 35 /* magenta */, WARNING: 33 /* yellow */, SEVERE: 31 /* red */}; + const colors: any = { INFO: 35 /* magenta */, WARNING: 33 /* yellow */, SEVERE: 31 /* red */}; entries.forEach((entry: Entry) => { console.log('\u001b[' + (colors[entry.level.name] || 37) + 'm' + [entry.level.name, entry.message].join(': ') + '\u001b[39m'); }); @@ -17,7 +17,7 @@ function testCreateFunction() { } function testLogLevels() { - let logs = browserLogs(browser); + const logs = browserLogs(browser); logs.ignore(logs.ERROR); logs.expect(logs.WARNING); @@ -27,48 +27,48 @@ function testLogLevels() { } function testPredicateFunctions() { - let logs = browserLogs(browser); + const logs = browserLogs(browser); logs.ignore(logs.or(logs.ERROR, logs.WARNING)); logs.expect(logs.and(logs.DEBUG, logs.INFO)); } function testRegExp() { - let logs = browserLogs(browser); + const logs = browserLogs(browser); logs.ignore(/foo/i); logs.expect(new RegExp('/foo/i')); } function testString() { - let logs = browserLogs(browser); + const logs = browserLogs(browser); logs.ignore('foo'); logs.expect('foo'); } function testMatchFunction() { - let logs = browserLogs(browser); - let filter = (entry: Entry) => entry.message === "foo"; + const logs = browserLogs(browser); + const filter = (entry: Entry) => entry.message === "foo"; logs.ignore(filter); logs.expect(filter); } function testReset() { - let logs = browserLogs(browser); + const logs = browserLogs(browser); logs.reset(); } function testLogs() { - let logs = browserLogs(browser); + const logs = browserLogs(browser); - let entries: Entry[] = logs.logs(); + const entries: Entry[] = logs.logs(); } function testVerify() { - let logs = browserLogs(browser); + const logs = browserLogs(browser); logs.verify(); } diff --git a/xmpp-jid/xmpp-jid-tests.ts b/xmpp-jid/xmpp-jid-tests.ts index 6b33b2c349..2514d5fb8a 100644 --- a/xmpp-jid/xmpp-jid-tests.ts +++ b/xmpp-jid/xmpp-jid-tests.ts @@ -36,5 +36,5 @@ addr.getResource(); // rabbithole addr.toString(); // alice@wonderland.net/rabbithole addr.bare(); // returns a JID without resource -let some_jid = new JID('is', 'a', 'test'); +const some_jid = new JID('is', 'a', 'test'); addr.equals(some_jid); // returns true if the two JIDs are equal, false otherwise From 62c57736f132e94682649f77b02391e47be5986e Mon Sep 17 00:00:00 2001 From: Anton Kandybo Date: Fri, 10 Mar 2017 09:22:10 +0200 Subject: [PATCH 060/276] Added ProgressPlugin definition (#14897) --- webpack/index.d.ts | 4 ++++ webpack/webpack-tests.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index 0eb787a9b0..28d1b33b40 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -747,6 +747,10 @@ declare namespace webpack { constructor(request: any); } + class ProgressPlugin extends Plugin { + constructor(options?: (percentage: number, msg: string) => void); + } + class ProvidePlugin extends Plugin { constructor(definitions: {[key: string]: any}); } diff --git a/webpack/webpack-tests.ts b/webpack/webpack-tests.ts index 483e175f38..ce9d42d71b 100644 --- a/webpack/webpack-tests.ts +++ b/webpack/webpack-tests.ts @@ -400,6 +400,7 @@ plugin = new webpack.WatchIgnorePlugin(paths); plugin = new webpack.LoaderOptionsPlugin({ debug: true }); +plugin = new webpack.ProgressPlugin((percent: number, message: string) => {}); // // http://webpack.github.io/docs/node.js-api.html From 5720c5ef6b8e9b4e939ce0b6e41d79d1356e0509 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Fri, 10 Mar 2017 08:22:49 +0100 Subject: [PATCH 061/276] feat(stylelint): add typings for `stylelint` (#14896) * feat(stylelint): add typings for `stylelint` * fix(styelint): fix lint issues * set `strictNullChecks` to true * remove redundent namespace * rename iterfaces * update tests * feat(stylelint): add formatters * fix naming convention --- stylelint/index.d.ts | 44 ++++++++++++++++++++++++++++++++++++ stylelint/stylelint-tests.ts | 18 +++++++++++++++ stylelint/tsconfig.json | 23 +++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 stylelint/index.d.ts create mode 100644 stylelint/stylelint-tests.ts create mode 100644 stylelint/tsconfig.json diff --git a/stylelint/index.d.ts b/stylelint/index.d.ts new file mode 100644 index 0000000000..2ec479d2e1 --- /dev/null +++ b/stylelint/index.d.ts @@ -0,0 +1,44 @@ +// Type definitions for stylelint 7.9 +// Project: https://github.com/stylelint/stylelint +// Definitions by: Alan Agius +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface LinterOptions { + code?: string; + codeFilename?: string; + config?: JSON; + configBasedir?: string; + configFile?: string; + configOverrides?: JSON; + files?: string | string[]; + formatter?: "json" | "string" | "verbose"; + ignoreDisables?: boolean; + reportNeedlessDisables?: boolean; + ignorePath?: boolean; + syntax?: "scss" | "less" | "sugarss"; + customSyntax?: string; +} + +export interface LinterResult { + errored: boolean; + output: string; + postcssResults: any[]; + results: LintResult[]; +} + +export interface LintResult { + source: string; + errored: boolean | undefined; + ignored: boolean | undefined; + warnings: string[]; + deprecations: string[]; + invalidOptionWarnings: any[]; +} + +export namespace formatters { + function json(results: LintResult[]): string; + function string(results: LintResult[]): string; + function verbose(results: LintResult[]): string; +} + +export function lint(options?: LinterOptions): Promise; diff --git a/stylelint/stylelint-tests.ts b/stylelint/stylelint-tests.ts new file mode 100644 index 0000000000..0eeb0bdec8 --- /dev/null +++ b/stylelint/stylelint-tests.ts @@ -0,0 +1,18 @@ +import { LinterOptions, lint, LintResult, LinterResult } from "stylelint"; + +const options: LinterOptions = { + code: "div { color: red }", + files: ["**/**.scss"], + formatter: "json", + ignoreDisables: true, + reportNeedlessDisables: true, + ignorePath: true, + syntax: "scss" +}; + +lint(options).then((x: LinterResult) => { + const err: boolean = x.errored; + const output: string = x.output; + const postcssResults: any[] = x.postcssResults; + const results: LintResult[] = x.results; +}); diff --git a/stylelint/tsconfig.json b/stylelint/tsconfig.json new file mode 100644 index 0000000000..d57b85c2b3 --- /dev/null +++ b/stylelint/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "stylelint-tests.ts" + ] +} From 603a182210c675f00c62d39b320b2f1d251aec6d Mon Sep 17 00:00:00 2001 From: Sergei Dorogin Date: Fri, 10 Mar 2017 10:23:26 +0300 Subject: [PATCH 062/276] handlebars: added partials/decorators fields and registerDecorator/unregisterDecorator methods (#14895) --- handlebars/index.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/handlebars/index.d.ts b/handlebars/index.d.ts index 96b0491040..d3ab2c80e3 100644 --- a/handlebars/index.d.ts +++ b/handlebars/index.d.ts @@ -10,6 +10,9 @@ declare namespace Handlebars { export function registerPartial(name: string, str: any): void; export function unregisterHelper(name: string): void; export function unregisterPartial(name: string): void; + export function registerDecorator(name: string, fn: Function): void; + export function unregisterDecorator(name: string): void; + export function K(): void; export function createFrame(object: any): any; export function Exception(message: string): void; @@ -26,7 +29,9 @@ declare namespace Handlebars { export var Utils: typeof hbs.Utils; export var logger: Logger; export var templates: HandlebarsTemplates; - export var helpers: any; + export var helpers: { [name: string]: Function }; + export var partials: { [name: string]: any }; + export var decorators: { [name: string]: Function }; export function registerDecorator(name: string, fn: Function): void; export function registerDecorator(obj: {[name: string] : Function}): void; From 389dc0cb777d2d2cfeb2bdd2b2239dfd6c729e17 Mon Sep 17 00:00:00 2001 From: Peter Briers Date: Fri, 10 Mar 2017 08:26:24 +0100 Subject: [PATCH 063/276] defaults should be a static member (#14893) --- chart.js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart.js/index.d.ts b/chart.js/index.d.ts index 08781f4463..425bf96b81 100644 --- a/chart.js/index.d.ts +++ b/chart.js/index.d.ts @@ -20,7 +20,7 @@ declare class Chart { getElementsAtEvent: (e: any) => {}[]; getDatasetAtEvent: (e: any) => {}[]; - defaults: { + static defaults: { global: Chart.ChartOptions; } } From 27eae2e5992d30161c44e013cce8ec7cb7baee63 Mon Sep 17 00:00:00 2001 From: prezi-csoszig Date: Fri, 10 Mar 2017 08:27:38 +0100 Subject: [PATCH 064/276] In pdfkit/index.d.ts fixing bufferedPageRange (#14890) PdfKit document has method bufferedPageRange() instead of bufferedPageRanges(). @see https://github.com/devongovett/pdfkit/blob/v0.8.0/docs/guide.pdf Page 5 @see https://github.com/devongovett/pdfkit/blob/63d6e5020f0b3efa3005286476a29905f8d5e843/lib/document.coffee#L107 --- pdfkit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdfkit/index.d.ts b/pdfkit/index.d.ts index 8bd1c7014e..053aa7f029 100644 --- a/pdfkit/index.d.ts +++ b/pdfkit/index.d.ts @@ -269,7 +269,7 @@ declare namespace PDFKit { new (options?: PDFDocumentOptions): PDFDocument; addPage(options?: PDFDocumentOptions): PDFDocument; - bufferedPageRanges(): { start: number; count: number }; + bufferedPageRange(): { start: number; count: number }; switchToPage(n?: number): PDFPage; flushPages(): void; ref(data: {}): PDFKitReference; From 16a70ebb0d516ae625d1c4f405027f67a0fc78d4 Mon Sep 17 00:00:00 2001 From: Mantas Marcinkus Date: Fri, 10 Mar 2017 07:29:32 +0000 Subject: [PATCH 065/276] Creating rc-slider typescript definition file (#14887) * Initial * Rc-slider typings * Adhering to linting rules * linting rules * Tests * Fixing tests and missed commit stuff * Referencing react instead of importing it * Undoing last change * Marks types fixed * Test fix * Review changes. Added tests to Handle --- rc-slider/README.md | 13 +++ rc-slider/index.d.ts | 156 ++++++++++++++++++++++++++++++++++ rc-slider/rc-slider-tests.tsx | 48 +++++++++++ rc-slider/tsconfig.json | 24 ++++++ rc-slider/tslint.json | 3 + 5 files changed, 244 insertions(+) create mode 100644 rc-slider/README.md create mode 100644 rc-slider/index.d.ts create mode 100644 rc-slider/rc-slider-tests.tsx create mode 100644 rc-slider/tsconfig.json create mode 100644 rc-slider/tslint.json diff --git a/rc-slider/README.md b/rc-slider/README.md new file mode 100644 index 0000000000..7000e34358 --- /dev/null +++ b/rc-slider/README.md @@ -0,0 +1,13 @@ +# Installation +> `npm install --save @types/rc-select` + +# Summary +This package contains type definitions for rc-slider (https://github.com/react-component/slider). + +Additional Details + * Last updated: Tue, 24 Feb 2017 + * Dependencies: react + * Global values: none + +# Credits +These definitions were written by Marcinkus Mantas diff --git a/rc-slider/index.d.ts b/rc-slider/index.d.ts new file mode 100644 index 0000000000..704412eda6 --- /dev/null +++ b/rc-slider/index.d.ts @@ -0,0 +1,156 @@ +// Type definitions for rc-slider 6.1 +// Project: https://github.com/react-component/slider +// Definitions by: Marcinkus Mantas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import * as React from 'react'; + +declare namespace RcSliderClass { + export interface Marks { + [number: number]: JSX.Element | string | { style: any, label: string | JSX.Element }; + } + + export interface CommonApiProps { + /** + * Additional CSS class for the root DOM node + * @default '' + */ + className?: string; + /** + * The minimum value of the slider + * @default 0 + */ + min?: number; + /** + * The maximum value of the slider + * @default 100 + */ + max?: number; + /** + * Marks on the slider. The key determines the position, and the value determines what will show. + * If you want to set the style of a specific mark point, the value should be an object which contains style and label properties. + * @default '{}' | {number: { style, label }} + */ + marks?: Marks; + /** + * Value to be added or subtracted on each step the slider makes. Must be greater than zero, and max - min should be evenly divisible by the step value. + * @default 1 + */ + step?: number; + /** + * If vertical is true, the slider will be vertical. + * @default false + */ + vertical?: boolean; + /** + * A handle generator which could be used to customized handle. + */ + handle?(props: any): React.ReactNode; + /** + * If the value is true, it means a continuous value interval, otherwise, it is a independent value. + * @default true + */ + included?: boolean; + /** + * If true, handles can't be moved. + * @default false + */ + disabled?: boolean; + /** + * When the step value is greater than 1, you can set the dots to true if you want to render the slider with dots. + * @default false + */ + dots?: boolean; + /** + * onBeforeChange will be triggered when ontouchstart or onmousedown is triggered. + */ + onBeforeChange?: (value: any) => any | undefined; + /** + * onChange will be triggered while the value of Slider changing. + */ + onChange?: (value: any) => any | undefined; + /** + * onAfterChange will be triggered when ontouchend or onmouseup is triggered. + */ + onAfterChange?: (value: any) => any | undefined; + + /** + * @deprecated in version ^6.0.0. Use rc-tooltip + * Tooltip transition class name + */ + tipTransitionName?: string; + + /** + * @deprecated in version ^6.0.0. Use rc-tooltip + * Tooltip formatter + */ + tipFormatter?: ((value: any) => any | undefined) | null; + } + + interface SliderProps extends CommonApiProps { + /** + * Set initial value of slider. + * @default 0 + */ + defaultValue?: number; + /** + * Set current value of slider. + */ + value?: number; + } + + + export interface RangeProps extends CommonApiProps { + /** + * Set initial positions of handles. + * @default [0,0] + */ + defaultValue?: number[]; + /** + * Set current positions of handles. + */ + value?: number[]; + /** + * Determine how many ranges to render, and multiple handles will be rendered (number + 1). + * @default 1 + */ + count?: number; + /** + * allowCross could be set as true to allow those handles to cross. + * @default true + */ + allowCross?: boolean; + /** + * pushable could be set as true to allow pushing of surrounding handles when moving an handle. When set to a number, the number will be the minimum ensured distance between handles. + * @default true + */ + pushable?: boolean; + } + + export interface HandleProps extends CommonApiProps { + /** + * Class name + */ + className: string; + /** + * Styling if true, then bottom: {offset} else left: {offset} + * @default False + */ + vertical: boolean; + /** + * Styling option offset + */ + offset: number; + } +} + +declare class RcSliderClass extends React.Component { } + +declare namespace RcSliderClass { + class Range extends React.Component { } + class Handle extends React.Component { } +} + + +export = RcSliderClass; diff --git a/rc-slider/rc-slider-tests.tsx b/rc-slider/rc-slider-tests.tsx new file mode 100644 index 0000000000..f6e2442558 --- /dev/null +++ b/rc-slider/rc-slider-tests.tsx @@ -0,0 +1,48 @@ +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; +import * as Slider from 'rc-slider'; +import { Range, Handle } from 'rc-slider'; + +ReactDOM.render( + , + document.querySelector('.app') +); + +ReactDOM.render( + , + document.querySelector('.another-app') +); +ReactDOM.render( + { return }} + included={true} + disabled={false} + dots={true} + onBeforeChange={() => { }} + onChange={() => { }} + onAfterChange={() => { }} + defaultValue={0.1} + value={0.1} + />, + document.querySelector('.another-app') +); + +ReactDOM.render( + , + document.querySelector('.app') +); \ No newline at end of file diff --git a/rc-slider/tsconfig.json b/rc-slider/tsconfig.json new file mode 100644 index 0000000000..d6a3a4e288 --- /dev/null +++ b/rc-slider/tsconfig.json @@ -0,0 +1,24 @@ + { + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "rc-slider-tests.tsx" + ] +} \ No newline at end of file diff --git a/rc-slider/tslint.json b/rc-slider/tslint.json new file mode 100644 index 0000000000..fdc7cdc370 --- /dev/null +++ b/rc-slider/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} \ No newline at end of file From ddef2004bc26a72452a8ccd50f00741ad955e2ca Mon Sep 17 00:00:00 2001 From: Edward Hinkle Date: Thu, 9 Mar 2017 23:31:52 -0800 Subject: [PATCH 066/276] xml2js - Prevent error when using Parser's event emitter (#14884) * Make Parser extend event emitter Fixing error: error TS2339: Property 'on' does not exist on type 'Parser'. * Update authorship * Add test for event emitter --- xml2js/index.d.ts | 6 ++++-- xml2js/xml2js-tests.ts | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/xml2js/index.d.ts b/xml2js/index.d.ts index 6dd10acce4..12d2488cbe 100644 --- a/xml2js/index.d.ts +++ b/xml2js/index.d.ts @@ -1,12 +1,14 @@ // Type definitions for node-xml2js // Project: https://github.com/Leonidas-from-XIV/node-xml2js -// Definitions by: Michel Salib , Jason McNeil , Christopher Currens +// Definitions by: Michel Salib , Jason McNeil , Christopher Currens , Edward Hinkle // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// export = xml2js; +import * as events from 'events' + declare namespace xml2js { function parseString(xml: convertableToString, callback: (err: any, result: any) => void): void; function parseString(xml: convertableToString, options: OptionsV2, callback: (err: any, result: any) => void): void; @@ -21,7 +23,7 @@ declare namespace xml2js { buildObject(rootObj: any): string; } - class Parser { + class Parser extends events.EventEmitter { constructor(options?: OptionsV2); parseString(str: convertableToString, cb?: Function): void; reset(): void; diff --git a/xml2js/xml2js-tests.ts b/xml2js/xml2js-tests.ts index 62324b6908..8ee7b7ce25 100644 --- a/xml2js/xml2js-tests.ts +++ b/xml2js/xml2js-tests.ts @@ -69,6 +69,11 @@ var outString = builder.buildObject({ var parser = new xml2js.Parser(); +parser.on('end', (result: any) => { + console.log("Parser Finished"); + return; +}); + var v1Defaults = xml2js.defaults['0.1']; v1Defaults.async = true; From 99197751bd418c2b5e5d2c6b88dc8f9286316775 Mon Sep 17 00:00:00 2001 From: YYC <395976266@qq.com> Date: Fri, 10 Mar 2017 15:36:37 +0800 Subject: [PATCH 067/276] feat: update wonder-commonlib,wonder-frp dts file; add wonder.js dts file (#14873) * feat: update wonder-commonlib,wonder-frp dts file feat: add wonder.js dts file * fix: change module to "commonjs" * fix: try pass ci --- wonder-commonlib/index.d.ts | 304 +- wonder-commonlib/wonder-commonlib-tests.ts | 4 +- wonder-frp/index.d.ts | 1366 +++++---- wonder-frp/wonder-frp-tests.ts | 4 +- wonder.js/index.d.ts | 2955 ++++++++++++++++++++ wonder.js/tsconfig.json | 23 + wonder.js/wonder.js-tests.ts | 4 + 7 files changed, 3902 insertions(+), 758 deletions(-) create mode 100644 wonder.js/index.d.ts create mode 100644 wonder.js/tsconfig.json create mode 100644 wonder.js/wonder.js-tests.ts diff --git a/wonder-commonlib/index.d.ts b/wonder-commonlib/index.d.ts index 1cad038d52..267d86538d 100644 --- a/wonder-commonlib/index.d.ts +++ b/wonder-commonlib/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for wonder-commonlib 0.1.1 +// Type definitions for wonder-commonlib 0.2.0 // Project: https://github.com/yyc-git/Wonder-CommonLib // Definitions by: YYC // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,96 +6,31 @@ /// -declare module wdCb { - class JudgeUtils { - static isArray(arr: any): boolean; - static isArrayExactly(arr: any): boolean; - static isNumber(num: any): boolean; - static isNumberExactly(num: any): boolean; - static isString(str: any): boolean; - static isStringExactly(str: any): boolean; - static isBoolean(bool: any): boolean; - static isDom(obj: any): boolean; - static isObject(obj: any): boolean; - static isDirectObject(obj: any): boolean; - static isHostMethod(object: any, property: any): boolean; - static isNodeJs(): boolean; - static isFunction(func: any): boolean; - } +// Generated by dts-bundle v0.7.2 + +declare module 'wonder-commonlib/dist/es2015' { + export { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export { $BREAK, $REMOVE } from "wonder-commonlib/dist/es2015/global/Const"; + export { root } from "wonder-commonlib/dist/es2015/global/Variable"; + export { Hash } from "wonder-commonlib/dist/es2015/Hash"; + export { List } from "wonder-commonlib/dist/es2015/List"; + export { Log } from "wonder-commonlib/dist/es2015/Log"; + export { Queue } from "wonder-commonlib/dist/es2015/Queue"; + export { Stack } from "wonder-commonlib/dist/es2015/Stack"; + export { AjaxUtils } from "wonder-commonlib/dist/es2015/utils/AjaxUtils"; + export { ArrayUtils } from "wonder-commonlib/dist/es2015/utils/ArrayUtils"; + export { ConvertUtils } from "wonder-commonlib/dist/es2015/utils/ConvertUtils"; + export { DomQuery } from "wonder-commonlib/dist/es2015/utils/DomQuery"; + export { EventUtils } from "wonder-commonlib/dist/es2015/utils/EventUtils"; + export { ExtendUtils } from "wonder-commonlib/dist/es2015/utils/ExtendUtils"; + export { FunctionUtils } from "wonder-commonlib/dist/es2015/utils/FunctionUtils"; + export { JudgeUtils } from "wonder-commonlib/dist/es2015/utils/JudgeUtils"; + export { PathUtils } from "wonder-commonlib/dist/es2015/utils/PathUtils"; } -declare var global:NodeJS.Global,window:Window; - -declare module wdCb { - var root: any; -} - -declare module wdCb { -} - -declare module wdCb { - const $BREAK: { - break: boolean; - }; - const $REMOVE: any; -} - -declare module wdCb { - class Log { - static info: { - INVALID_PARAM: string; - helperFunc: (...args: any[]) => string; - assertion: (...args: any[]) => any; - FUNC_INVALID: (...args: any[]) => any; - FUNC_MUST: (...args: any[]) => any; - FUNC_MUST_BE: (...args: any[]) => any; - FUNC_MUST_NOT_BE: (...args: any[]) => any; - FUNC_SHOULD: (...args: any[]) => any; - FUNC_SHOULD_NOT: (...args: any[]) => any; - FUNC_SUPPORT: (...args: any[]) => any; - FUNC_NOT_SUPPORT: (...args: any[]) => any; - FUNC_MUST_DEFINE: (...args: any[]) => any; - FUNC_MUST_NOT_DEFINE: (...args: any[]) => any; - FUNC_UNKNOW: (...args: any[]) => any; - FUNC_EXPECT: (...args: any[]) => any; - FUNC_UNEXPECT: (...args: any[]) => any; - FUNC_EXIST: (...args: any[]) => any; - FUNC_NOT_EXIST: (...args: any[]) => any; - FUNC_ONLY: (...args: any[]) => any; - FUNC_CAN_NOT: (...args: any[]) => any; - }; - static log(...messages: any[]): void; - static assert(cond: any, ...messages: any[]): void; - static error(cond: any, ...message: any[]): any; - static warn(...message: any[]): void; - private static _exec(consoleMethod, args, sliceBegin?); - } -} - -declare module wdCb { - class List { - protected children: Array; - getCount(): number; - hasChild(child: any): boolean; - hasChildWithFunc(func: Function): boolean; - getChildren(): T[]; - getChild(index: number): T; - addChild(child: T): this; - addChildren(arg: Array | List | any): this; - setChildren(children: Array): this; - unShiftChild(child: T): void; - removeAllChildren(): this; - forEach(func: Function, context?: any): this; - toArray(): T[]; - protected copyChildren(): T[]; - protected removeChildHelper(arg: any): Array; - private _forEach(arr, func, context?); - private _removeChild(arr, func); - } -} - -declare module wdCb { - class Collection extends List { +declare module 'wonder-commonlib/dist/es2015/Collection' { + import { List } from "wonder-commonlib/dist/es2015/List"; + export class Collection extends List { static create(children?: any[]): Collection; constructor(children?: Array); clone(): any; @@ -109,17 +44,28 @@ declare module wdCb { sort(func: (a: T, b: T) => any, isSortSelf?: boolean): Collection; map(func: (value: T, index: number) => any): Collection; removeRepeatItems(): Collection; - hasRepeatItems(): false; + hasRepeatItems(): boolean; } } -declare module wdCb { - class Hash { +declare module 'wonder-commonlib/dist/es2015/global/Const' { + export const $BREAK: { + break: boolean; + }; + export const $REMOVE: any; +} + +declare module 'wonder-commonlib/dist/es2015/global/Variable' { + export var root: any; +} + +declare module 'wonder-commonlib/dist/es2015/Hash' { + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export class Hash { static create(children?: {}): Hash; constructor(children?: { [s: string]: T; }); - private _children; getChildren(): { [s: string]: T; }; @@ -151,8 +97,60 @@ declare module wdCb { } } -declare module wdCb { - class Queue extends List { +declare module 'wonder-commonlib/dist/es2015/List' { + export class List { + protected children: Array; + getCount(): number; + hasChild(child: any): boolean; + hasChildWithFunc(func: Function): boolean; + getChildren(): T[]; + getChild(index: number): T; + addChild(child: T): this; + addChildren(arg: Array | List | any): this; + setChildren(children: Array): this; + unShiftChild(child: T): void; + removeAllChildren(): this; + forEach(func: Function, context?: any): this; + toArray(): T[]; + protected copyChildren(): T[]; + protected removeChildHelper(arg: any): Array; + } +} + +declare module 'wonder-commonlib/dist/es2015/Log' { + export class Log { + static info: { + INVALID_PARAM: string; + helperFunc: (...args: any[]) => string; + assertion: (...args: any[]) => any; + FUNC_INVALID: (...args: any[]) => any; + FUNC_MUST: (...args: any[]) => any; + FUNC_MUST_BE: (...args: any[]) => any; + FUNC_MUST_NOT_BE: (...args: any[]) => any; + FUNC_SHOULD: (...args: any[]) => any; + FUNC_SHOULD_NOT: (...args: any[]) => any; + FUNC_SUPPORT: (...args: any[]) => any; + FUNC_NOT_SUPPORT: (...args: any[]) => any; + FUNC_MUST_DEFINE: (...args: any[]) => any; + FUNC_MUST_NOT_DEFINE: (...args: any[]) => any; + FUNC_UNKNOW: (...args: any[]) => any; + FUNC_EXPECT: (...args: any[]) => any; + FUNC_UNEXPECT: (...args: any[]) => any; + FUNC_EXIST: (...args: any[]) => any; + FUNC_NOT_EXIST: (...args: any[]) => any; + FUNC_ONLY: (...args: any[]) => any; + FUNC_CAN_NOT: (...args: any[]) => any; + }; + static log(...messages: any[]): void; + static assert(cond: any, ...messages: any[]): void; + static error(cond: any, ...message: any[]): any; + static warn(...message: any[]): void; + } +} + +declare module 'wonder-commonlib/dist/es2015/Queue' { + import { List } from "wonder-commonlib/dist/es2015/List"; + export class Queue extends List { static create(children?: any[]): Queue; constructor(children?: Array); readonly front: T; @@ -163,8 +161,10 @@ declare module wdCb { } } -declare module wdCb { - class Stack extends List { +declare module 'wonder-commonlib/dist/es2015/Stack' { + import { List } from "wonder-commonlib/dist/es2015/List"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export class Stack extends List { static create(children?: any[]): Stack; constructor(children?: Array); readonly top: T; @@ -182,71 +182,33 @@ declare module wdCb { sort(func: (a: T, b: T) => any, isSortSelf?: boolean): Collection; map(func: (value: T, index: number) => any): Collection; removeRepeatItems(): Collection; - hasRepeatItems(): false; + hasRepeatItems(): boolean; } } -declare module wdCb { - class AjaxUtils { +declare module 'wonder-commonlib/dist/es2015/utils/AjaxUtils' { + export class AjaxUtils { static ajax(conf: any): void; - private static _createAjax(error); - private static _isLocalFile(status); - private static _isSoundFile(dataType); } } -declare module wdCb { - class ArrayUtils { +declare module 'wonder-commonlib/dist/es2015/utils/ArrayUtils' { + export class ArrayUtils { static removeRepeatItems(arr: Array, isEqual?: (a: any, b: any) => boolean): any[]; static contain(arr: Array, ele: any): boolean; } } -declare module wdCb { - class ConvertUtils { +declare module 'wonder-commonlib/dist/es2015/utils/ConvertUtils' { + export class ConvertUtils { static toString(obj: any): string; - private static _convertCodeToString(fn); } } -declare module wdCb { - class EventUtils { - static bindEvent(context: any, func: any): (event: any) => any; - static addEvent(dom: any, eventName: any, handler: any): void; - static removeEvent(dom: any, eventName: any, handler: any): void; - } -} - -declare module wdCb { - class ExtendUtils { - static extendDeep(parent: any, child?: any, filter?: (val: any, i: any) => boolean): any; - static extend(destination: any, source: any): any; - static copyPublicAttri(source: any): {}; - } -} - -declare module wdCb { - class PathUtils { - static basename(path: string, ext?: string): string; - static changeExtname(pathStr: string, extname: string): string; - static changeBasename(pathStr: string, basename: string, isSameExt?: boolean): string; - static extname(path: string): string; - static dirname(path: string): string; - private static _splitPath(fileName); - } -} - -declare module wdCb { - class FunctionUtils { - static bind(object: any, func: Function): () => any; - } -} - -declare module wdCb { - class DomQuery { +declare module 'wonder-commonlib/dist/es2015/utils/DomQuery' { + export class DomQuery { static create(eleStr: string): any; static create(dom: HTMLElement): any; - private _doms; constructor(eleStr: string); constructor(dom: HTMLElement); get(index: any): HTMLElement; @@ -258,14 +220,56 @@ declare module wdCb { attr(name: string): any; attr(name: string, value: string): any; text(str?: string): string; - private _isDomEleStr(eleStr); - private _buildDom(eleStr); - private _buildDom(dom); - private _createElement(eleStr); } } -declare module "wonder-commonlib" { - export = wdCb; +declare module 'wonder-commonlib/dist/es2015/utils/EventUtils' { + export class EventUtils { + static bindEvent(context: any, func: any): (event: any) => any; + static addEvent(dom: any, eventName: any, handler: any): void; + static removeEvent(dom: any, eventName: any, handler: any): void; + } +} + +declare module 'wonder-commonlib/dist/es2015/utils/ExtendUtils' { + export class ExtendUtils { + static extendDeep(parent: any, child?: any, filter?: (val: any, i: any) => boolean): any; + static extend(destination: any, source: any): any; + static copyPublicAttri(source: any): {}; + } +} + +declare module 'wonder-commonlib/dist/es2015/utils/FunctionUtils' { + export class FunctionUtils { + static bind(object: any, func: Function): () => any; + } +} + +declare module 'wonder-commonlib/dist/es2015/utils/JudgeUtils' { + export class JudgeUtils { + static isArray(arr: any): boolean; + static isArrayExactly(arr: any): boolean; + static isNumber(num: any): boolean; + static isNumberExactly(num: any): boolean; + static isString(str: any): boolean; + static isStringExactly(str: any): boolean; + static isBoolean(bool: any): boolean; + static isDom(obj: any): boolean; + static isObject(obj: any): boolean; + static isDirectObject(obj: any): boolean; + static isHostMethod(object: any, property: any): boolean; + static isNodeJs(): boolean; + static isFunction(func: any): boolean; + } +} + +declare module 'wonder-commonlib/dist/es2015/utils/PathUtils' { + export class PathUtils { + static basename(path: string, ext?: string): string; + static changeExtname(pathStr: string, extname: string): string; + static changeBasename(pathStr: string, basename: string, isSameExt?: boolean): string; + static extname(path: string): string; + static dirname(path: string): string; + } } diff --git a/wonder-commonlib/wonder-commonlib-tests.ts b/wonder-commonlib/wonder-commonlib-tests.ts index c22d61c11d..852f768f01 100644 --- a/wonder-commonlib/wonder-commonlib-tests.ts +++ b/wonder-commonlib/wonder-commonlib-tests.ts @@ -1,6 +1,6 @@ -import wdCb = require("wonder-commonlib"); +import {Collection} from "wonder-commonlib/dist/es2015/Collection"; -var list = wdCb.Collection.create(); +var list = Collection.create(); list.addChild(1); diff --git a/wonder-frp/index.d.ts b/wonder-frp/index.d.ts index 00910bc80d..e68e019ead 100644 --- a/wonder-frp/index.d.ts +++ b/wonder-frp/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for wonder-frp 0.1.1 +// Type definitions for wonder-frp 0.2.0 // Project: https://github.com/yyc-git/Wonder-FRP // Definitions by: YYC // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,173 +6,119 @@ /// /// -declare module wdFrp { - class JudgeUtils extends wdCb.JudgeUtils { +// Generated by dts-bundle v0.7.2 +// Dependencies for this module: +// ../../wonder-commonlib/dist/es2015/utils/JudgeUtils +// ../../wonder-commonlib/dist/es2015/Collection + +declare module 'wonder-frp/dist/es2015' { + export { JudgeUtils } from "wonder-frp/dist/es2015/JudgeUtils"; + export { fromNodeCallback, fromStream, fromReadableStream, fromWritableStream, fromTransformStream } from "wonder-frp/dist/es2015/binding/nodejs/NodeOperator"; + export { Entity } from "wonder-frp/dist/es2015/core/Entity"; + export { Main } from "wonder-frp/dist/es2015/core/Main"; + export { Observer } from "wonder-frp/dist/es2015/core/Observer"; + export { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + export { Stream } from "wonder-frp/dist/es2015/core/Stream"; + export { assert, requireCheck, ensure, requireGetter, requireSetter, ensureGetter, ensureSetter, invariant } from "wonder-frp/dist/es2015/definition/typescript/decorator/contract"; + export { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export { InnerSubscription } from "wonder-frp/dist/es2015/Disposable/InnerSubscription"; + export { InnerSubscriptionGroup } from "wonder-frp/dist/es2015/Disposable/InnerSubscriptionGroup"; + export { SingleDisposable } from "wonder-frp/dist/es2015/Disposable/SingleDisposable"; + export { FilterState } from "wonder-frp/dist/es2015/enum/FilterState"; + export { createStream, fromArray, fromPromise, fromEventPattern, interval, intervalRequest, timeout, empty, callFunc, judge, defer, just } from "wonder-frp/dist/es2015/global/Operator"; + export { root } from "wonder-frp/dist/es2015/global/Variable"; + export { AnonymousObserver } from "wonder-frp/dist/es2015/observer/AnonymousObserver"; + export { AutoDetachObserver } from "wonder-frp/dist/es2015/observer/AutoDetachObserver"; + export { ConcatObserver } from "wonder-frp/dist/es2015/observer/ConcatObserver"; + export { DoObserver } from "wonder-frp/dist/es2015/observer/DoObserver"; + export { FilterObserver } from "wonder-frp/dist/es2015/observer/FilterObserver"; + export { FilterWithStateObserver } from "wonder-frp/dist/es2015/observer/FilterWithStateObserver"; + export { IgnoreElementsObserver } from "wonder-frp/dist/es2015/observer/IgnoreElementsObserver"; + export { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export { ISubjectObserver } from "wonder-frp/dist/es2015/observer/ISubjectObserver"; + export { MapObserver } from "wonder-frp/dist/es2015/observer/MapObserver"; + export { MergeAllObserver } from "wonder-frp/dist/es2015/observer/MergeAllObserver"; + export { MergeObserver } from "wonder-frp/dist/es2015/observer/MergeObserver"; + export { SkipUntilOtherObserver } from "wonder-frp/dist/es2015/observer/SkipUntilOtherObserver"; + export { SkipUntilSourceObserver } from "wonder-frp/dist/es2015/observer/SkipUntilSourceObserver"; + export { SubjectObserver } from "wonder-frp/dist/es2015/observer/SubjectObserver"; + export { TakeUntilObserver } from "wonder-frp/dist/es2015/observer/TakeUntilObserver"; + export { AnonymousStream } from "wonder-frp/dist/es2015/stream/AnonymousStream"; + export { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + export { ConcatStream } from "wonder-frp/dist/es2015/stream/ConcatStream"; + export { DeferStream } from "wonder-frp/dist/es2015/stream/DeferStream"; + export { DoStream } from "wonder-frp/dist/es2015/stream/DoStream"; + export { FilterStream } from "wonder-frp/dist/es2015/stream/FilterStream"; + export { FilterWithStateStream } from "wonder-frp/dist/es2015/stream/FilterWithStateStream"; + export { FromArrayStream } from "wonder-frp/dist/es2015/stream/FromArrayStream"; + export { FromEventPatternStream } from "wonder-frp/dist/es2015/stream/FromEventPatternStream"; + export { FromPromiseStream } from "wonder-frp/dist/es2015/stream/FromPromiseStream"; + export { IgnoreElementsStream } from "wonder-frp/dist/es2015/stream/IgnoreElementsStream"; + export { IntervalRequestStream } from "wonder-frp/dist/es2015/stream/IntervalRequestStream"; + export { IntervalStream } from "wonder-frp/dist/es2015/stream/IntervalStream"; + export { MapStream } from "wonder-frp/dist/es2015/stream/MapStream"; + export { MergeAllStream } from "wonder-frp/dist/es2015/stream/MergeAllStream"; + export { MergeStream } from "wonder-frp/dist/es2015/stream/MergeStream"; + export { RepeatStream } from "wonder-frp/dist/es2015/stream/RepeatStream"; + export { SkipUntilStream } from "wonder-frp/dist/es2015/stream/SkipUntilStream"; + export { TakeUntilStream } from "wonder-frp/dist/es2015/stream/TakeUntilStream"; + export { TimeoutStream } from "wonder-frp/dist/es2015/stream/TimeoutStream"; + export { GeneratorSubject } from "wonder-frp/dist/es2015/subject/GeneratorSubject"; + export { Subject } from "wonder-frp/dist/es2015/subject/Subject"; + export { ActionType } from "wonder-frp/dist/es2015/testing/ActionType"; + export { MockObserver } from "wonder-frp/dist/es2015/testing/MockObserver"; + export { MockPromise } from "wonder-frp/dist/es2015/testing/MockPromise"; + export { Record } from "wonder-frp/dist/es2015/testing/Record"; + export { TestScheduler } from "wonder-frp/dist/es2015/testing/TestScheduler"; + export { TestStream } from "wonder-frp/dist/es2015/testing/TestStream"; + //import "./extend/root"; + //import "./global/init"; +} + +declare module 'wonder-frp/dist/es2015/JudgeUtils' { + import { JudgeUtils as JudgeUtils$ } from "wonder-commonlib/dist/es2015/utils/JudgeUtils"; + import { Entity } from "wonder-frp/dist/es2015/core/Entity"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class JudgeUtils extends JudgeUtils$ { static isPromise(obj: any): boolean; static isEqual(ob1: Entity, ob2: Entity): boolean; static isIObserver(i: IObserver): () => any; } } -declare module wdFrp { - var fromNodeCallback: (func: Function, context?: any) => (...funcArgs: any[]) => AnonymousStream; - var fromStream: (stream: any, finishEventName?: string) => AnonymousStream; - var fromReadableStream: (stream: any) => AnonymousStream; - var fromWritableStream: (stream: any) => AnonymousStream; - var fromTransformStream: (stream: any) => AnonymousStream; +declare module 'wonder-frp/dist/es2015/binding/nodejs/NodeOperator' { + import { AnonymousStream } from "wonder-frp/dist/es2015/stream/AnonymousStream"; + export var fromNodeCallback: (func: Function, context?: any) => (...funcArgs: any[]) => AnonymousStream; + export var fromStream: (stream: any, finishEventName?: string) => AnonymousStream; + export var fromReadableStream: (stream: any) => AnonymousStream; + export var fromWritableStream: (stream: any) => AnonymousStream; + export var fromTransformStream: (stream: any) => AnonymousStream; } -declare module wdFrp { - abstract class Entity { +declare module 'wonder-frp/dist/es2015/core/Entity' { + export abstract class Entity { static UID: number; - private _uid; uid: string; constructor(uidPre: string); } } -declare module wdFrp { - class Main { +declare module 'wonder-frp/dist/es2015/core/Main' { + export class Main { static isTest: boolean; } } -declare module wdFrp { - function assert(cond: boolean, message?: string): void; - function require(InFunc: any): (target: any, name: any, descriptor: any) => any; - function ensure(OutFunc: any): (target: any, name: any, descriptor: any) => any; - function requireGetter(InFunc: any): (target: any, name: any, descriptor: any) => any; - function requireSetter(InFunc: any): (target: any, name: any, descriptor: any) => any; - function ensureGetter(OutFunc: any): (target: any, name: any, descriptor: any) => any; - function ensureSetter(OutFunc: any): (target: any, name: any, descriptor: any) => any; - function invariant(func: any): (target: any) => void; -} - -declare module wdFrp { - interface IDisposable { - dispose(): void; - } -} - -declare module wdFrp { - class SingleDisposable extends Entity implements IDisposable { - static create(disposeHandler?: Function): SingleDisposable; - private _disposeHandler; - private _isDisposed; - constructor(disposeHandler: Function); - setDisposeHandler(handler: Function): void; - dispose(): void; - } -} - -declare module wdFrp { - class GroupDisposable extends Entity implements IDisposable { - static create(disposable?: IDisposable): GroupDisposable; - private _group; - private _isDisposed; - constructor(disposable?: IDisposable); - add(disposable: IDisposable): this; - remove(disposable: IDisposable): this; - dispose(): void; - } -} - -declare module wdFrp { - interface IObserver extends IDisposable { - next(value: any): any; - error(error: any): any; - completed(): any; - } -} - -declare module wdFrp { - class InnerSubscription implements IDisposable { - static create(subject: Subject | GeneratorSubject, observer: Observer): InnerSubscription; - private _subject; - private _observer; - constructor(subject: Subject | GeneratorSubject, observer: Observer); - dispose(): void; - } -} - -declare module wdFrp { - class InnerSubscriptionGroup implements IDisposable { - static create(): InnerSubscriptionGroup; - private _container; - addChild(child: IDisposable): void; - dispose(): void; - } -} - -declare var global:NodeJS.Global,window:Window; -declare module wdFrp { - var root: any; -} - -declare module wdFrp { -} - -declare module wdFrp { -} - -declare module wdFrp { -} - -declare module wdFrp { - abstract class Stream extends Entity { - scheduler: Scheduler; - subscribeFunc: (observer: IObserver) => Function | void; - constructor(subscribeFunc: any); - abstract subscribe(arg1: Function | Observer | Subject, onError?: Function, onCompleted?: Function): IDisposable; - buildStream(observer: IObserver): IDisposable; - do(onNext?: Function, onError?: Function, onCompleted?: Function): DoStream; - map(selector: Function): MapStream; - flatMap(selector: Function): MergeAllStream; - concatMap(selector: Function): any; - mergeAll(): MergeAllStream; - concatAll(): any; - skipUntil(otherStream: Stream): SkipUntilStream; - takeUntil(otherStream: Stream): TakeUntilStream; - take(count?: number): AnonymousStream; - takeLast(count?: number): AnonymousStream; - takeWhile(predicate: (value: any, index: number, source: Stream) => boolean, thisArg?: this): AnonymousStream; - lastOrDefault(defaultValue?: any): AnonymousStream; - filter(predicate: (value: any) => boolean, thisArg?: this): any; - filterWithState(predicate: (value: any) => boolean, thisArg?: this): any; - concat(streamArr: Array): any; - concat(...otherStream: any[]): any; - merge(maxConcurrent: number): any; - merge(streamArr: Array): any; - merge(...otherStreams: any[]): any; - repeat(count?: number): RepeatStream; - ignoreElements(): IgnoreElementsStream; - protected handleSubject(subject: any): boolean; - private _isSubject(subject); - private _setSubject(subject); - } -} - -declare module wdFrp { - class Scheduler { - static create(...args: any[]): Scheduler; - private _requestLoopId; - requestLoopId: any; - publishRecursive(observer: IObserver, initial: any, action: Function): void; - publishInterval(observer: IObserver, initial: any, interval: number, action: Function): number; - publishIntervalRequest(observer: IObserver, action: Function): void; - publishTimeout(observer: IObserver, time: number, action: Function): number; - } -} - -declare module wdFrp { - abstract class Observer extends Entity implements IObserver { - private _isDisposed; +declare module 'wonder-frp/dist/es2015/core/Observer' { + import { Entity } from "wonder-frp/dist/es2015/core/Entity"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export abstract class Observer extends Entity implements IObserver { isDisposed: boolean; protected onUserNext: Function; protected onUserError: Function; protected onUserCompleted: Function; - private _isStop; - private _disposable; constructor(observer: IObserver); constructor(onNext: Function, onError: Function, onCompleted: Function); next(value: any): any; @@ -186,26 +132,627 @@ declare module wdFrp { } } -declare module wdFrp { - class Subject implements IObserver { - static create(): Subject; - private _source; - source: Stream; - private _observer; - subscribe(arg1?: Function | Observer, onError?: Function, onCompleted?: Function): IDisposable; - next(value: any): void; - error(error: any): void; - completed(): void; - start(): void; - remove(observer: Observer): void; +declare module 'wonder-frp/dist/es2015/core/Scheduler' { + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class Scheduler { + static create(...args: any[]): Scheduler; + requestLoopId: any; + publishRecursive(observer: IObserver, initial: any, action: Function): void; + publishInterval(observer: IObserver, initial: any, interval: number, action: Function): number; + publishIntervalRequest(observer: IObserver, action: Function): void; + publishTimeout(observer: IObserver, time: number, action: Function): number; + } +} + +declare module 'wonder-frp/dist/es2015/core/Stream' { + import { Entity } from "wonder-frp/dist/es2015/core/Entity"; + import { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { Subject } from "wonder-frp/dist/es2015/subject/Subject"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export abstract class Stream extends Entity { + scheduler: Scheduler; + subscribeFunc: (observer: IObserver) => Function | void; + constructor(subscribeFunc: any); + abstract subscribe(arg1: Function | Observer | Subject, onError?: Function, onCompleted?: Function): IDisposable; + buildStream(observer: IObserver): IDisposable; + do(onNext?: Function, onError?: Function, onCompleted?: Function): any; + map(selector: Function): any; + flatMap(selector: Function): any; + concatMap(selector: Function): any; + mergeAll(): any; + concatAll(): any; + skipUntil(otherStream: Stream): any; + takeUntil(otherStream: Stream): any; + take(count?: number): any; + takeLast(count?: number): any; + takeWhile(predicate: (value: any, index: number, source: Stream) => boolean, thisArg?: this): any; + lastOrDefault(defaultValue?: any): any; + filter(predicate: (value: any) => boolean, thisArg?: this): any; + filterWithState(predicate: (value: any) => boolean, thisArg?: this): any; + concat(streamArr: Array): any; + concat(...otherStream: any[]): any; + merge(maxConcurrent: number): any; + merge(streamArr: Array): any; + merge(...otherStreams: any[]): any; + repeat(count?: number): any; + ignoreElements(): any; + protected handleSubject(subject: any): boolean; + } +} + +declare module 'wonder-frp/dist/es2015/definition/typescript/decorator/contract' { + export function assert(cond: boolean, message?: string): void; + export function requireCheck(InFunc: any): (target: any, name: any, descriptor: any) => any; + export function ensure(OutFunc: any): (target: any, name: any, descriptor: any) => any; + export function requireGetter(InFunc: any): (target: any, name: any, descriptor: any) => any; + export function requireSetter(InFunc: any): (target: any, name: any, descriptor: any) => any; + export function ensureGetter(OutFunc: any): (target: any, name: any, descriptor: any) => any; + export function ensureSetter(OutFunc: any): (target: any, name: any, descriptor: any) => any; + export function invariant(func: any): (target: any) => void; +} + +declare module 'wonder-frp/dist/es2015/Disposable/GroupDisposable' { + import { Entity } from "wonder-frp/dist/es2015/core/Entity"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class GroupDisposable extends Entity implements IDisposable { + static create(disposable?: IDisposable): GroupDisposable; + constructor(disposable?: IDisposable); + add(disposable: IDisposable): this; + remove(disposable: IDisposable): this; dispose(): void; } } -declare module wdFrp { - class GeneratorSubject extends Entity implements IObserver { +declare module 'wonder-frp/dist/es2015/Disposable/IDisposable' { + export interface IDisposable { + dispose(): void; + } +} + +declare module 'wonder-frp/dist/es2015/Disposable/InnerSubscription' { + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + import { Subject } from "wonder-frp/dist/es2015/subject/Subject"; + import { GeneratorSubject } from "wonder-frp/dist/es2015/subject/GeneratorSubject"; + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + export class InnerSubscription implements IDisposable { + static create(subject: Subject | GeneratorSubject, observer: Observer): InnerSubscription; + constructor(subject: Subject | GeneratorSubject, observer: Observer); + dispose(): void; + } +} + +declare module 'wonder-frp/dist/es2015/Disposable/InnerSubscriptionGroup' { + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class InnerSubscriptionGroup implements IDisposable { + static create(): InnerSubscriptionGroup; + addChild(child: IDisposable): void; + dispose(): void; + } +} + +declare module 'wonder-frp/dist/es2015/Disposable/SingleDisposable' { + import { Entity } from "wonder-frp/dist/es2015/core/Entity"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class SingleDisposable extends Entity implements IDisposable { + static create(disposeHandler?: Function): SingleDisposable; + constructor(disposeHandler: Function); + setDisposeHandler(handler: Function): void; + dispose(): void; + } +} + +declare module 'wonder-frp/dist/es2015/enum/FilterState' { + export enum FilterState { + TRIGGER = 0, + ENTER = 1, + LEAVE = 2, + } +} + +declare module 'wonder-frp/dist/es2015/global/Operator' { + import { AnonymousStream } from "wonder-frp/dist/es2015/stream/AnonymousStream"; + import { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + import { FromArrayStream } from "wonder-frp/dist/es2015/stream/FromArrayStream"; + import { FromPromiseStream } from "wonder-frp/dist/es2015/stream/FromPromiseStream"; + import { FromEventPatternStream } from "wonder-frp/dist/es2015/stream/FromEventPatternStream"; + import { IntervalStream } from "wonder-frp/dist/es2015/stream/IntervalStream"; + import { IntervalRequestStream } from "wonder-frp/dist/es2015/stream/IntervalRequestStream"; + import { TimeoutStream } from "wonder-frp/dist/es2015/stream/TimeoutStream"; + import { DeferStream } from "wonder-frp/dist/es2015/stream/DeferStream"; + export class Operator { + static empty(): AnonymousStream; + static createStream(subscribeFunc: any): AnonymousStream; + static fromArray(array: Array, scheduler?: Scheduler): FromArrayStream; + } + export var createStream: typeof Operator.createStream; + export var empty: typeof Operator.empty; + export var fromArray: typeof Operator.fromArray; + export var fromPromise: (promise: any, scheduler?: Scheduler) => FromPromiseStream; + export var fromEventPattern: (addHandler: Function, removeHandler: Function) => FromEventPatternStream; + export var interval: (interval: any, scheduler?: Scheduler) => IntervalStream; + export var intervalRequest: (scheduler?: Scheduler) => IntervalRequestStream; + export var timeout: (time: any, scheduler?: Scheduler) => TimeoutStream; + export var callFunc: (func: Function, context?: any) => AnonymousStream; + export var judge: (condition: Function, thenSource: Function, elseSource: Function) => any; + export var defer: (buildStreamFunc: Function) => DeferStream; + export var just: (returnValue: any) => AnonymousStream; +} + +declare module 'wonder-frp/dist/es2015/global/Variable' { + export var root: any; +} + +declare module 'wonder-frp/dist/es2015/observer/AnonymousObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + export class AnonymousObserver extends Observer { + static create(onNext: Function, onError: Function, onCompleted: Function): AnonymousObserver; + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/AutoDetachObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class AutoDetachObserver extends Observer { + static create(observer: IObserver): any; + static create(onNext: Function, onError: Function, onCompleted: Function): any; + dispose(): void; + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/ConcatObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class ConcatObserver extends Observer { + static create(currentObserver: IObserver, startNextStream: Function): ConcatObserver; + protected currentObserver: any; + constructor(currentObserver: IObserver, startNextStream: Function); + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/DoObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class DoObserver extends Observer { + static create(currentObserver: IObserver, prevObserver: IObserver): DoObserver; + constructor(currentObserver: IObserver, prevObserver: IObserver); + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/FilterObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + export class FilterObserver extends Observer { + static create(prevObserver: IObserver, predicate: (value: any, index?: number, source?: Stream) => boolean, source: Stream): FilterObserver; + constructor(prevObserver: IObserver, predicate: (value: any) => boolean, source: Stream); + protected prevObserver: IObserver; + protected source: Stream; + protected i: number; + protected predicate: (value: any, index?: number, source?: Stream) => boolean; + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/FilterWithStateObserver' { + import { FilterObserver } from "wonder-frp/dist/es2015/observer/FilterObserver"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + export class FilterWithStateObserver extends FilterObserver { + static create(prevObserver: IObserver, predicate: (value: any, index?: number, source?: Stream) => boolean, source: Stream): FilterWithStateObserver; + protected onNext(value: any): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/IgnoreElementsObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class IgnoreElementsObserver extends Observer { + static create(currentObserver: IObserver): IgnoreElementsObserver; + constructor(currentObserver: IObserver); + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/IObserver' { + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export interface IObserver extends IDisposable { + next(value: any): any; + error(error: any): any; + completed(): any; + } +} + +declare module 'wonder-frp/dist/es2015/observer/ISubjectObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + export interface ISubjectObserver { + addChild(observer: Observer): any; + removeChild(observer: Observer): any; + } +} + +declare module 'wonder-frp/dist/es2015/observer/MapObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class MapObserver extends Observer { + static create(currentObserver: IObserver, selector: Function): MapObserver; + constructor(currentObserver: IObserver, selector: Function); + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/MergeAllObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class MergeAllObserver extends Observer { + static create(currentObserver: IObserver, streamGroup: Collection, groupDisposable: GroupDisposable): MergeAllObserver; + constructor(currentObserver: IObserver, streamGroup: Collection, groupDisposable: GroupDisposable); + done: boolean; + currentObserver: IObserver; + protected onNext(innerSource: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/MergeObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class MergeObserver extends Observer { + static create(currentObserver: IObserver, maxConcurrent: number, streamGroup: Collection, groupDisposable: GroupDisposable): MergeObserver; + constructor(currentObserver: IObserver, maxConcurrent: number, streamGroup: Collection, groupDisposable: GroupDisposable); + done: boolean; + currentObserver: IObserver; + activeCount: number; + q: Array; + handleSubscribe(innerSource: any): void; + protected onNext(innerSource: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/SkipUntilOtherObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SkipUntilStream } from "wonder-frp/dist/es2015/stream/SkipUntilStream"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class SkipUntilOtherObserver extends Observer { + static create(prevObserver: IObserver, skipUntilStream: SkipUntilStream): SkipUntilOtherObserver; + otherDisposable: IDisposable; + constructor(prevObserver: IObserver, skipUntilStream: SkipUntilStream); + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/SkipUntilSourceObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SkipUntilStream } from "wonder-frp/dist/es2015/stream/SkipUntilStream"; + export class SkipUntilSourceObserver extends Observer { + static create(prevObserver: IObserver, skipUntilStream: SkipUntilStream): SkipUntilSourceObserver; + constructor(prevObserver: IObserver, skipUntilStream: SkipUntilStream); + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/SubjectObserver' { + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + export class SubjectObserver implements IObserver { + observers: Collection; + isEmpty(): boolean; + next(value: any): void; + error(error: any): void; + completed(): void; + addChild(observer: Observer): void; + removeChild(observer: Observer): void; + dispose(): void; + setDisposable(disposable: IDisposable): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/TakeUntilObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class TakeUntilObserver extends Observer { + static create(prevObserver: IObserver): TakeUntilObserver; + constructor(prevObserver: IObserver); + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/stream/AnonymousStream' { + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { Subject } from "wonder-frp/dist/es2015/subject/Subject"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class AnonymousStream extends Stream { + static create(subscribeFunc: Function): AnonymousStream; + constructor(subscribeFunc: Function); + buildStream(observer: IObserver): IDisposable; + subscribe(subject: Subject): IDisposable; + subscribe(observer: IObserver): IDisposable; + subscribe(onNext: (value: any) => void): IDisposable; + subscribe(onNext: (value: any) => void, onError: (e: any) => void): IDisposable; + subscribe(onNext: (value: any) => void, onError: (e: any) => void, onComplete: () => void): IDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/BaseStream' { + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { Subject } from "wonder-frp/dist/es2015/subject/Subject"; + export abstract class BaseStream extends Stream { + abstract subscribeCore(observer: IObserver): IDisposable; + subscribe(arg1: Function | Observer | Subject, onError?: any, onCompleted?: any): IDisposable; + buildStream(observer: IObserver): IDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/ConcatStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class ConcatStream extends BaseStream { + static create(sources: Array): ConcatStream; + constructor(sources: Array); + subscribeCore(observer: IObserver): GroupDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/DeferStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class DeferStream extends BaseStream { + static create(buildStreamFunc: Function): DeferStream; + constructor(buildStreamFunc: Function); + subscribeCore(observer: IObserver): GroupDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/DoStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class DoStream extends BaseStream { + static create(source: Stream, onNext?: Function, onError?: Function, onCompleted?: Function): DoStream; + constructor(source: Stream, onNext: Function, onError: Function, onCompleted: Function); + subscribeCore(observer: IObserver): IDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/FilterStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class FilterStream extends BaseStream { + static create(source: Stream, predicate: (value: any, index?: number, source?: Stream) => boolean, thisArg: any): FilterStream; + constructor(source: Stream, predicate: (value: any, index?: number, source?: Stream) => boolean, thisArg: any); + predicate: (value: any, index?: number, source?: Stream) => boolean; + subscribeCore(observer: IObserver): IDisposable; + internalFilter(predicate: (value: any, index?: number, source?: Stream) => boolean, thisArg: any): Stream; + protected createObserver(observer: IObserver): Observer; + protected createStreamForInternalFilter(source: Stream, innerPredicate: any, thisArg: any): Stream; + } +} + +declare module 'wonder-frp/dist/es2015/stream/FilterWithStateStream' { + import { FilterStream } from "wonder-frp/dist/es2015/stream/FilterStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { FilterWithStateObserver } from "wonder-frp/dist/es2015/observer/FilterWithStateObserver"; + export class FilterWithStateStream extends FilterStream { + static create(source: Stream, predicate: (value: any, index?: number, source?: Stream) => boolean, thisArg: any): FilterWithStateStream; + protected createObserver(observer: IObserver): FilterWithStateObserver; + protected createStreamForInternalFilter(source: Stream, innerPredicate: any, thisArg: any): Stream; + } +} + +declare module 'wonder-frp/dist/es2015/stream/FromArrayStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SingleDisposable } from "wonder-frp/dist/es2015/Disposable/SingleDisposable"; + export class FromArrayStream extends BaseStream { + static create(array: Array, scheduler: Scheduler): FromArrayStream; + constructor(array: Array, scheduler: Scheduler); + subscribeCore(observer: IObserver): SingleDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/FromEventPatternStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SingleDisposable } from "wonder-frp/dist/es2015/Disposable/SingleDisposable"; + export class FromEventPatternStream extends BaseStream { + static create(addHandler: Function, removeHandler: Function): FromEventPatternStream; + constructor(addHandler: Function, removeHandler: Function); + subscribeCore(observer: IObserver): SingleDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/FromPromiseStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SingleDisposable } from "wonder-frp/dist/es2015/Disposable/SingleDisposable"; + export class FromPromiseStream extends BaseStream { + static create(promise: any, scheduler: Scheduler): FromPromiseStream; + constructor(promise: any, scheduler: Scheduler); + subscribeCore(observer: IObserver): SingleDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/IgnoreElementsStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class IgnoreElementsStream extends BaseStream { + static create(source: Stream): IgnoreElementsStream; + constructor(source: Stream); + subscribeCore(observer: IObserver): IDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/IntervalRequestStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SingleDisposable } from "wonder-frp/dist/es2015/Disposable/SingleDisposable"; + export class IntervalRequestStream extends BaseStream { + static create(scheduler: Scheduler): IntervalRequestStream; + constructor(scheduler: Scheduler); + subscribeCore(observer: IObserver): SingleDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/IntervalStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SingleDisposable } from "wonder-frp/dist/es2015/Disposable/SingleDisposable"; + export class IntervalStream extends BaseStream { + static create(interval: number, scheduler: Scheduler): IntervalStream; + constructor(interval: number, scheduler: Scheduler); + initWhenCreate(): void; + subscribeCore(observer: IObserver): SingleDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/MapStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class MapStream extends BaseStream { + static create(source: Stream, selector: Function): MapStream; + constructor(source: Stream, selector: Function); + subscribeCore(observer: IObserver): IDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/MergeAllStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class MergeAllStream extends BaseStream { + static create(source: Stream): MergeAllStream; + constructor(source: Stream); + subscribeCore(observer: IObserver): GroupDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/MergeStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class MergeStream extends BaseStream { + static create(source: Stream, maxConcurrent: number): MergeStream; + constructor(source: Stream, maxConcurrent: number); + subscribeCore(observer: IObserver): GroupDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/RepeatStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class RepeatStream extends BaseStream { + static create(source: Stream, count: number): RepeatStream; + constructor(source: Stream, count: number); + subscribeCore(observer: IObserver): GroupDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/SkipUntilStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class SkipUntilStream extends BaseStream { + static create(source: Stream, otherSteam: Stream): SkipUntilStream; + isOpen: boolean; + constructor(source: Stream, otherStream: Stream); + subscribeCore(observer: IObserver): GroupDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/TakeUntilStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class TakeUntilStream extends BaseStream { + static create(source: Stream, otherSteam: Stream): TakeUntilStream; + constructor(source: Stream, otherStream: Stream); + subscribeCore(observer: IObserver): GroupDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/TimeoutStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SingleDisposable } from "wonder-frp/dist/es2015/Disposable/SingleDisposable"; + export class TimeoutStream extends BaseStream { + static create(time: number, scheduler: Scheduler): TimeoutStream; + constructor(time: number, scheduler: Scheduler); + subscribeCore(observer: IObserver): SingleDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/subject/GeneratorSubject' { + import { Entity } from "wonder-frp/dist/es2015/core/Entity"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class GeneratorSubject extends Entity implements IObserver { static create(): GeneratorSubject; - private _isStart; isStart: boolean; constructor(); observer: any; @@ -228,426 +775,39 @@ declare module wdFrp { } } -declare module wdFrp { - class AnonymousObserver extends Observer { - static create(onNext: Function, onError: Function, onCompleted: Function): AnonymousObserver; - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class AutoDetachObserver extends Observer { - static create(observer: IObserver): any; - static create(onNext: Function, onError: Function, onCompleted: Function): any; - dispose(): void; - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class MapObserver extends Observer { - static create(currentObserver: IObserver, selector: Function): MapObserver; - private _currentObserver; - private _selector; - constructor(currentObserver: IObserver, selector: Function); - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class DoObserver extends Observer { - static create(currentObserver: IObserver, prevObserver: IObserver): DoObserver; - private _currentObserver; - private _prevObserver; - constructor(currentObserver: IObserver, prevObserver: IObserver); - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class MergeAllObserver extends Observer { - static create(currentObserver: IObserver, streamGroup: wdCb.Collection, groupDisposable: GroupDisposable): MergeAllObserver; - constructor(currentObserver: IObserver, streamGroup: wdCb.Collection, groupDisposable: GroupDisposable); - done: boolean; - currentObserver: IObserver; - private _streamGroup; - private _groupDisposable; - protected onNext(innerSource: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class MergeObserver extends Observer { - static create(currentObserver: IObserver, maxConcurrent: number, streamGroup: wdCb.Collection, groupDisposable: GroupDisposable): MergeObserver; - constructor(currentObserver: IObserver, maxConcurrent: number, streamGroup: wdCb.Collection, groupDisposable: GroupDisposable); - done: boolean; - currentObserver: IObserver; - activeCount: number; - q: Array; - private _maxConcurrent; - private _groupDisposable; - private _streamGroup; - handleSubscribe(innerSource: any): void; - protected onNext(innerSource: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - private _isReachMaxConcurrent(); - } -} - -declare module wdFrp { - class TakeUntilObserver extends Observer { - static create(prevObserver: IObserver): TakeUntilObserver; - private _prevObserver; - constructor(prevObserver: IObserver); - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class SkipUntilSourceObserver extends Observer { - static create(prevObserver: IObserver, skipUntilStream: SkipUntilStream): SkipUntilSourceObserver; - private _prevObserver; - private _skipUntilStream; - constructor(prevObserver: IObserver, skipUntilStream: SkipUntilStream); - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class SkipUntilOtherObserver extends Observer { - static create(prevObserver: IObserver, skipUntilStream: SkipUntilStream): SkipUntilOtherObserver; - otherDisposable: IDisposable; - private _prevObserver; - private _skipUntilStream; - constructor(prevObserver: IObserver, skipUntilStream: SkipUntilStream); - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class ConcatObserver extends Observer { - static create(currentObserver: IObserver, startNextStream: Function): ConcatObserver; - protected currentObserver: any; - private _startNextStream; - constructor(currentObserver: IObserver, startNextStream: Function); - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - interface ISubjectObserver { - addChild(observer: Observer): any; - removeChild(observer: Observer): any; - } -} - -declare module wdFrp { - class SubjectObserver implements IObserver { - observers: wdCb.Collection; - private _disposable; - isEmpty(): boolean; +declare module 'wonder-frp/dist/es2015/subject/Subject' { + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class Subject implements IObserver { + static create(): Subject; + source: Stream; + subscribe(arg1?: Function | Observer, onError?: Function, onCompleted?: Function): IDisposable; next(value: any): void; error(error: any): void; completed(): void; - addChild(observer: Observer): void; - removeChild(observer: Observer): void; + start(): void; + remove(observer: Observer): void; dispose(): void; - setDisposable(disposable: IDisposable): void; } } -declare module wdFrp { - class IgnoreElementsObserver extends Observer { - static create(currentObserver: IObserver): IgnoreElementsObserver; - private _currentObserver; - constructor(currentObserver: IObserver); - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; +declare module 'wonder-frp/dist/es2015/testing/ActionType' { + export enum ActionType { + NEXT = 0, + ERROR = 1, + COMPLETED = 2, } } -declare module wdFrp { - class FilterObserver extends Observer { - static create(prevObserver: IObserver, predicate: (value: any, index?: number, source?: Stream) => boolean, source: Stream): FilterObserver; - constructor(prevObserver: IObserver, predicate: (value: any) => boolean, source: Stream); - protected prevObserver: IObserver; - protected source: Stream; - protected i: number; - protected predicate: (value: any, index?: number, source?: Stream) => boolean; - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class FilterWithStateObserver extends FilterObserver { - static create(prevObserver: IObserver, predicate: (value: any, index?: number, source?: Stream) => boolean, source: Stream): FilterWithStateObserver; - private _isTrigger; - protected onNext(value: any): void; - } -} - -declare module wdFrp { - abstract class BaseStream extends Stream { - abstract subscribeCore(observer: IObserver): IDisposable; - subscribe(arg1: Function | Observer | Subject, onError?: any, onCompleted?: any): IDisposable; - buildStream(observer: IObserver): IDisposable; - } -} - -declare module wdFrp { - class DoStream extends BaseStream { - static create(source: Stream, onNext?: Function, onError?: Function, onCompleted?: Function): DoStream; - private _source; - private _observer; - constructor(source: Stream, onNext: Function, onError: Function, onCompleted: Function); - subscribeCore(observer: IObserver): IDisposable; - } -} - -declare module wdFrp { - class MapStream extends BaseStream { - static create(source: Stream, selector: Function): MapStream; - private _source; - private _selector; - constructor(source: Stream, selector: Function); - subscribeCore(observer: IObserver): IDisposable; - } -} - -declare module wdFrp { - class FromArrayStream extends BaseStream { - static create(array: Array, scheduler: Scheduler): FromArrayStream; - private _array; - constructor(array: Array, scheduler: Scheduler); - subscribeCore(observer: IObserver): SingleDisposable; - } -} - -declare module wdFrp { - class FromPromiseStream extends BaseStream { - static create(promise: any, scheduler: Scheduler): FromPromiseStream; - private _promise; - constructor(promise: any, scheduler: Scheduler); - subscribeCore(observer: IObserver): SingleDisposable; - } -} - -declare module wdFrp { - class FromEventPatternStream extends BaseStream { - static create(addHandler: Function, removeHandler: Function): FromEventPatternStream; - private _addHandler; - private _removeHandler; - constructor(addHandler: Function, removeHandler: Function); - subscribeCore(observer: IObserver): SingleDisposable; - } -} - -declare module wdFrp { - class AnonymousStream extends Stream { - static create(subscribeFunc: Function): AnonymousStream; - constructor(subscribeFunc: Function); - subscribe(subject: Subject): IDisposable; - subscribe(observer: IObserver): IDisposable; - subscribe(onNext: (value: any) => void): IDisposable; - subscribe(onNext: (value: any) => void, onError: (e: any) => void): IDisposable; - subscribe(onNext: (value: any) => void, onError: (e: any) => void, onComplete: () => void): IDisposable; - } -} - -declare module wdFrp { - class IntervalStream extends BaseStream { - static create(interval: number, scheduler: Scheduler): IntervalStream; - private _interval; - constructor(interval: number, scheduler: Scheduler); - initWhenCreate(): void; - subscribeCore(observer: IObserver): SingleDisposable; - } -} - -declare module wdFrp { - class IntervalRequestStream extends BaseStream { - static create(scheduler: Scheduler): IntervalRequestStream; - private _isEnd; - constructor(scheduler: Scheduler); - subscribeCore(observer: IObserver): SingleDisposable; - } -} - -declare module wdFrp { - class TimeoutStream extends BaseStream { - static create(time: number, scheduler: Scheduler): TimeoutStream; - private _time; - constructor(time: number, scheduler: Scheduler); - subscribeCore(observer: IObserver): SingleDisposable; - } -} - -declare module wdFrp { - class MergeAllStream extends BaseStream { - static create(source: Stream): MergeAllStream; - constructor(source: Stream); - private _source; - private _observer; - subscribeCore(observer: IObserver): GroupDisposable; - } -} - -declare module wdFrp { - class MergeStream extends BaseStream { - static create(source: Stream, maxConcurrent: number): MergeStream; - constructor(source: Stream, maxConcurrent: number); - private _source; - private _maxConcurrent; - subscribeCore(observer: IObserver): GroupDisposable; - } -} - -declare module wdFrp { - class TakeUntilStream extends BaseStream { - static create(source: Stream, otherSteam: Stream): TakeUntilStream; - private _source; - private _otherStream; - constructor(source: Stream, otherStream: Stream); - subscribeCore(observer: IObserver): GroupDisposable; - } -} - -declare module wdFrp { - class SkipUntilStream extends BaseStream { - static create(source: Stream, otherSteam: Stream): SkipUntilStream; - isOpen: boolean; - private _source; - private _otherStream; - constructor(source: Stream, otherStream: Stream); - subscribeCore(observer: IObserver): GroupDisposable; - } -} - -declare module wdFrp { - class ConcatStream extends BaseStream { - static create(sources: Array): ConcatStream; - private _sources; - constructor(sources: Array); - subscribeCore(observer: IObserver): GroupDisposable; - } -} - -declare module wdFrp { - class RepeatStream extends BaseStream { - static create(source: Stream, count: number): RepeatStream; - private _source; - private _count; - constructor(source: Stream, count: number); - subscribeCore(observer: IObserver): GroupDisposable; - } -} - -declare module wdFrp { - class IgnoreElementsStream extends BaseStream { - static create(source: Stream): IgnoreElementsStream; - private _source; - constructor(source: Stream); - subscribeCore(observer: IObserver): IDisposable; - } -} - -declare module wdFrp { - class DeferStream extends BaseStream { - static create(buildStreamFunc: Function): DeferStream; - private _buildStreamFunc; - constructor(buildStreamFunc: Function); - subscribeCore(observer: IObserver): GroupDisposable; - } -} - -declare module wdFrp { - class FilterStream extends BaseStream { - static create(source: Stream, predicate: (value: any, index?: number, source?: Stream) => boolean, thisArg: any): FilterStream; - constructor(source: Stream, predicate: (value: any, index?: number, source?: Stream) => boolean, thisArg: any); - predicate: (value: any, index?: number, source?: Stream) => boolean; - private _source; - subscribeCore(observer: IObserver): IDisposable; - internalFilter(predicate: (value: any, index?: number, source?: Stream) => boolean, thisArg: any): Stream; - protected createObserver(observer: IObserver): Observer; - protected createStreamForInternalFilter(source: Stream, innerPredicate: any, thisArg: any): Stream; - private _innerPredicate(predicate, self); - } -} - -declare module wdFrp { - class FilterWithStateStream extends FilterStream { - static create(source: Stream, predicate: (value: any, index?: number, source?: Stream) => boolean, thisArg: any): FilterWithStateStream; - protected createObserver(observer: IObserver): FilterWithStateObserver; - protected createStreamForInternalFilter(source: Stream, innerPredicate: any, thisArg: any): Stream; - } -} - -declare module wdFrp { - var createStream: (subscribeFunc: any) => AnonymousStream; - var fromArray: (array: any[], scheduler?: Scheduler) => FromArrayStream; - var fromPromise: (promise: any, scheduler?: Scheduler) => FromPromiseStream; - var fromEventPattern: (addHandler: Function, removeHandler: Function) => FromEventPatternStream; - var interval: (interval: any, scheduler?: Scheduler) => IntervalStream; - var intervalRequest: (scheduler?: Scheduler) => IntervalRequestStream; - var timeout: (time: any, scheduler?: Scheduler) => TimeoutStream; - var empty: () => AnonymousStream; - var callFunc: (func: Function, context?: any) => AnonymousStream; - var judge: (condition: Function, thenSource: Function, elseSource: Function) => any; - var defer: (buildStreamFunc: Function) => DeferStream; - var just: (returnValue: any) => AnonymousStream; -} - -declare module wdFrp { - enum FilterState { - TRIGGER = 0, - ENTER = 1, - LEAVE = 2, - } -} - -declare module wdFrp { - class Record { - static create(time: number, value: any, actionType?: ActionType, comparer?: Function): Record; - private _time; - time: number; - private _value; - value: number; - private _actionType; - actionType: ActionType; - private _comparer; - constructor(time: any, value: any, actionType: ActionType, comparer: Function); - equals(other: any): any; - } -} - -declare module wdFrp { - class MockObserver extends Observer { +declare module 'wonder-frp/dist/es2015/testing/MockObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { TestScheduler } from "wonder-frp/dist/es2015/testing/TestScheduler"; + import { Record } from "wonder-frp/dist/es2015/testing/Record"; + export class MockObserver extends Observer { static create(scheduler: TestScheduler): MockObserver; - private _messages; messages: [Record]; - private _scheduler; constructor(scheduler: TestScheduler); protected onNext(value: any): void; protected onError(error: any): void; @@ -657,39 +817,50 @@ declare module wdFrp { } } -declare module wdFrp { - class MockPromise { +declare module 'wonder-frp/dist/es2015/testing/MockPromise' { + import { TestScheduler } from "wonder-frp/dist/es2015/testing/TestScheduler"; + import { Record } from "wonder-frp/dist/es2015/testing/Record"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class MockPromise { static create(scheduler: TestScheduler, messages: [Record]): MockPromise; - private _messages; - private _scheduler; constructor(scheduler: TestScheduler, messages: [Record]); then(successCb: Function, errorCb: Function, observer: IObserver): void; } } -declare module wdFrp { - class TestScheduler extends Scheduler { +declare module 'wonder-frp/dist/es2015/testing/Record' { + import { ActionType } from "wonder-frp/dist/es2015/testing/ActionType"; + export class Record { + static create(time: number, value: any, actionType?: ActionType, comparer?: Function): Record; + time: number; + value: number; + actionType: ActionType; + constructor(time: any, value: any, actionType: ActionType, comparer: Function); + equals(other: any): any; + } +} + +declare module 'wonder-frp/dist/es2015/testing/TestScheduler' { + import { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + import { Record } from "wonder-frp/dist/es2015/testing/Record"; + import { MockObserver } from "wonder-frp/dist/es2015/testing/MockObserver"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { TestStream } from "wonder-frp/dist/es2015/testing/TestStream"; + import { MockPromise } from "wonder-frp/dist/es2015/testing/MockPromise"; + export class TestScheduler extends Scheduler { static next(tick: any, value: any): Record; static error(tick: any, error: any): Record; static completed(tick: any): Record; static create(isReset?: boolean): TestScheduler; constructor(isReset: boolean); - private _clock; clock: number; - private _isReset; - private _isDisposed; - private _timerMap; - private _streamMap; - private _subscribedTime; - private _disposedTime; - private _observer; setStreamMap(observer: IObserver, messages: [Record]): void; remove(observer: Observer): void; publishRecursive(observer: MockObserver, initial: any, recursiveFunc: Function): void; publishInterval(observer: IObserver, initial: any, interval: number, action: Function): number; publishIntervalRequest(observer: IObserver, action: Function): number; publishTimeout(observer: IObserver, time: number, action: Function): number; - private _setClock(); startWithTime(create: Function, subscribedTime: number, disposedTime: number): MockObserver; startWithSubscribe(create: any, subscribedTime?: number): MockObserver; startWithDispose(create: any, disposedTime?: number): MockObserver; @@ -699,33 +870,20 @@ declare module wdFrp { createObserver(): MockObserver; createResolvedPromise(time: number, value: any): MockPromise; createRejectPromise(time: number, error: any): MockPromise; - private _getMinAndMaxTime(); - private _exec(time, map); - private _runStream(time); - private _runAt(time, callback); - private _tick(time); } } -declare module wdFrp { - enum ActionType { - NEXT = 0, - ERROR = 1, - COMPLETED = 2, - } -} - -declare module wdFrp { - class TestStream extends BaseStream { +declare module 'wonder-frp/dist/es2015/testing/TestStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Record } from "wonder-frp/dist/es2015/testing/Record"; + import { TestScheduler } from "wonder-frp/dist/es2015/testing/TestScheduler"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SingleDisposable } from "wonder-frp/dist/es2015/Disposable/SingleDisposable"; + export class TestStream extends BaseStream { static create(messages: [Record], scheduler: TestScheduler): TestStream; scheduler: TestScheduler; - private _messages; constructor(messages: [Record], scheduler: TestScheduler); subscribeCore(observer: IObserver): SingleDisposable; } } -declare module "wonder-frp" { - export = wdFrp; -} - diff --git a/wonder-frp/wonder-frp-tests.ts b/wonder-frp/wonder-frp-tests.ts index 3efceed43f..ef7ea2672b 100644 --- a/wonder-frp/wonder-frp-tests.ts +++ b/wonder-frp/wonder-frp-tests.ts @@ -1,5 +1,5 @@ -import wdFrp = require("wonder-frp"); +import {fromArray} from "wonder-frp/dist/es2015/global/Operator"; -wdFrp.fromArray([1,2,3]) +fromArray([1,2,3]) .subscribe(function(){ }); diff --git a/wonder.js/index.d.ts b/wonder.js/index.d.ts new file mode 100644 index 0000000000..839fc0fb8c --- /dev/null +++ b/wonder.js/index.d.ts @@ -0,0 +1,2955 @@ +// Type definitions for wonder.js 0.1.0 +// Project: https://github.com/yyc-git/Wonder.js +// Definitions by: YYC +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + + +// Generated by dts-bundle v0.7.2 +// Dependencies for this module: +// ../../wonder-commonlib/dist/es2015/Hash +// ../../wonder-commonlib/dist/es2015/Collection +// ../../wonder-frp/dist/es2015/stream/FromEventPatternStream +// ../../wonder-commonlib/dist/es2015/utils/ArrayUtils +// ../../wonder-commonlib/dist/es2015/utils/JudgeUtils +// ../../wonder-commonlib/dist/es2015/Log + +declare module 'wonder.js/dist/es2015' { + export { Camera } from "wonder.js/dist/es2015/component/camera/Camera"; + export { BasicCameraController } from "wonder.js/dist/es2015/component/camera/controller/basic/BasicCameraController"; + export { CameraController } from "wonder.js/dist/es2015/component/camera/controller/CameraController"; + export { PerspectiveCamera } from "wonder.js/dist/es2015/component/camera/PerspectiveCamera"; + export { ComponentInitOrderTable } from "wonder.js/dist/es2015/component/data/ComponentInitOrderTable"; + export { BoxGeometry } from "wonder.js/dist/es2015/component/geometry/BoxGeometry"; + export { BasicBufferContainer } from "wonder.js/dist/es2015/component/geometry/data/BasicBufferContainer"; + export { BasicGeometryData } from "wonder.js/dist/es2015/component/geometry/data/BasicGeometryData"; + export { BufferContainer } from "wonder.js/dist/es2015/component/geometry/data/BufferContainer"; + export { CommonBufferContainer } from "wonder.js/dist/es2015/component/geometry/data/CommonBufferContainer"; + export { GeometryData } from "wonder.js/dist/es2015/component/geometry/data/GeometryData"; + export { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + export { GeometryUtils } from "wonder.js/dist/es2015/component/geometry/GeometryUtils"; + export { MeshRenderer } from "wonder.js/dist/es2015/component/renderer/MeshRenderer"; + export { RendererComponent } from "wonder.js/dist/es2015/component/renderer/RendererComponent"; + export { ETransformState } from "wonder.js/dist/es2015/component/transform/ETransformState"; + export { ThreeDTransform } from "wonder.js/dist/es2015/component/transform/ThreeDTransform"; + export { Transform } from "wonder.js/dist/es2015/component/transform/Transform"; + export { DebugConfig } from "wonder.js/dist/es2015/config/DebugConfig"; + export { Component } from "wonder.js/dist/es2015/core/Component"; + export { Director } from "wonder.js/dist/es2015/core/Director"; + export { Entity } from "wonder.js/dist/es2015/core/Entity"; + export { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + export { ComponentManager } from "wonder.js/dist/es2015/core/entityObject/manager/ComponentManager"; + export { EntityObjectManager } from "wonder.js/dist/es2015/core/entityObject/manager/EntityObjectManager"; + export { BufferTable, BufferTableKey } from "wonder.js/dist/es2015/core/entityObject/scene/cache/BufferTable"; + export { ProgramTable } from "wonder.js/dist/es2015/core/entityObject/scene/cache/ProgramTable"; + export { GameObjectScene } from "wonder.js/dist/es2015/core/entityObject/scene/gameObjectScene/GameObjectScene"; + export { Scene } from "wonder.js/dist/es2015/core/entityObject/scene/Scene"; + export { SceneDispatcher } from "wonder.js/dist/es2015/core/entityObject/scene/SceneDispatcher"; + export { Main } from "wonder.js/dist/es2015/core/Main"; + export { MainData } from "wonder.js/dist/es2015/core/data/MainData"; + export { cacheGetter, cache, cacheBufferForBufferContainer, cacheBufferForBufferContainerWithFuncParam } from "wonder.js/dist/es2015/definition/typescript/decorator/cache"; + export { cloneAttributeAsBasicType, cloneAttributeAsCloneable, cloneAttributeAsCustomType, CloneUtils, CloneType } from "wonder.js/dist/es2015/definition/typescript/decorator/clone"; + export { assert, describe, it, requireCheck, ensure, requireGetterAndSetter, requireGetter, requireSetter, ensureGetterAndSetter, ensureGetter, ensureSetter, invariant } from "wonder.js/dist/es2015/definition/typescript/decorator/contract"; + export { execOnlyOnce } from "wonder.js/dist/es2015/definition/typescript/decorator/control"; + export { registerClass } from "wonder.js/dist/es2015/definition/typescript/decorator/registerClass"; + export { singleton } from "wonder.js/dist/es2015/definition/typescript/decorator/singleton"; + export { virtual } from "wonder.js/dist/es2015/definition/typescript/decorator/virtual"; + export { root } from "wonder.js/dist/es2015/definition/Variable"; + export { DeviceManager, EDepthFunction, ESide, EPolygonOffsetMode, EBlendFunc, EBlendEquation, EBlendType, ECanvasType } from "wonder.js/dist/es2015/device/DeviceManager"; + export { EScreenSize } from "wonder.js/dist/es2015/device/EScreenSize"; + export { GPUDetector, EGPUPrecision } from "wonder.js/dist/es2015/device/GPUDetector"; + export { CustomEventBinder } from "wonder.js/dist/es2015/event/binder/CustomEventBinder"; + export { CustomEventRegister } from "wonder.js/dist/es2015/event/binder/CustomEventRegister"; + export { DomEventBinder } from "wonder.js/dist/es2015/event/binder/DomEventBinder"; + export { DomEventRegister } from "wonder.js/dist/es2015/event/binder/DomEventRegister"; + export { EventBinder } from "wonder.js/dist/es2015/event/binder/EventBinder"; + export { EventRegister } from "wonder.js/dist/es2015/event/binder/EventRegister"; + export { CustomEventDispatcher } from "wonder.js/dist/es2015/event/dispatcher/CustomEventDispatcher"; + export { DomEventDispatcher } from "wonder.js/dist/es2015/event/dispatcher/DomEventDispatcher"; + export { EventDispatcher } from "wonder.js/dist/es2015/event/dispatcher/EventDispatcher"; + export { EEngineEvent } from "wonder.js/dist/es2015/event/EEngineEvent"; + export { EventManager } from "wonder.js/dist/es2015/event/EventManager"; + export { EventBinderFactory } from "wonder.js/dist/es2015/event/factory/EventBinderFactory"; + export { EventDispatcherFactory } from "wonder.js/dist/es2015/event/factory/EventDispatcherFactory"; + export { EventHandlerFactory } from "wonder.js/dist/es2015/event/factory/EventHandlerFactory"; + export { CustomEventHandler } from "wonder.js/dist/es2015/event/handler/CustomEventHandler"; + export { DomEventHandler } from "wonder.js/dist/es2015/event/handler/DomEventHandler"; + export { EventHandler } from "wonder.js/dist/es2015/event/handler/EventHandler"; + export { KeyboardEventHandler } from "wonder.js/dist/es2015/event/handler/KeyboardEventHandler"; + export { MouseEventHandler } from "wonder.js/dist/es2015/event/handler/MouseEventHandler"; + export { PointEventHandler } from "wonder.js/dist/es2015/event/handler/PointEventHandler"; + export { TouchEventHandler } from "wonder.js/dist/es2015/event/handler/TouchEventHandler"; + export { CustomEvent } from "wonder.js/dist/es2015/event/object/CustomEvent"; + export { DomEvent } from "wonder.js/dist/es2015/event/object/DomEvent"; + export { EEventPhase } from "wonder.js/dist/es2015/event/object/EEventPhase"; + export { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + export { EMouseButton } from "wonder.js/dist/es2015/event/object/EMouseButton"; + export { Event } from "wonder.js/dist/es2015/event/object/Event"; + export { EEventName, EventNameHandler } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + export { EventTable } from "wonder.js/dist/es2015/event/object/EventTable"; + export { KeyboardEvent } from "wonder.js/dist/es2015/event/object/KeyboardEvent"; + export { MouseEvent } from "wonder.js/dist/es2015/event/object/MouseEvent"; + export { MousePointEvent } from "wonder.js/dist/es2015/event/object/MousePointEvent"; + export { PointEvent } from "wonder.js/dist/es2015/event/object/PointEvent"; + export { TouchEvent } from "wonder.js/dist/es2015/event/object/TouchEvent"; + export { TouchPointEvent } from "wonder.js/dist/es2015/event/object/TouchPointEvent"; + export { CustomEventListenerMap } from "wonder.js/dist/es2015/event/structure/CustomEventListenerMap"; + export { DomEventListenerMap } from "wonder.js/dist/es2015/event/structure/DomEventListenerMap"; + export { EventListenerMap } from "wonder.js/dist/es2015/event/structure/EventListenerMap"; + export { EventUtils } from "wonder.js/dist/es2015/event/utils/EventUtils"; + export { BasicMaterial } from "wonder.js/dist/es2015/material/BasicMaterial"; + export { EngineMaterial } from "wonder.js/dist/es2015/material/EngineMaterial"; + export { Material } from "wonder.js/dist/es2015/material/Material"; + export { ShaderManager } from "wonder.js/dist/es2015/material/ShaderManager"; + export { StandardBasicMaterial } from "wonder.js/dist/es2015/material/StandardBasicMaterial"; + export { DEG_TO_RAD, RAD_TO_DEG } from "wonder.js/dist/es2015/math/Global"; + export { Matrix3 } from "wonder.js/dist/es2015/math/Matrix3"; + export { Matrix4 } from "wonder.js/dist/es2015/math/Matrix4"; + export { Quaternion } from "wonder.js/dist/es2015/math/Quaternion"; + export { Vector2 } from "wonder.js/dist/es2015/math/Vector2"; + export { Vector3 } from "wonder.js/dist/es2015/math/Vector3"; + export { Vector4 } from "wonder.js/dist/es2015/math/Vector4"; + export { ArrayBuffer } from "wonder.js/dist/es2015/renderer/buffer/ArrayBuffer"; + export { Buffer } from "wonder.js/dist/es2015/renderer/buffer/Buffer"; + export { BufferDataTable } from "wonder.js/dist/es2015/renderer/buffer/BufferDataTable"; + export { CommonBuffer } from "wonder.js/dist/es2015/renderer/buffer/CommonBuffer"; + export { EBufferDataType } from "wonder.js/dist/es2015/renderer/buffer/EBufferDataType"; + export { EBufferType } from "wonder.js/dist/es2015/renderer/buffer/EBufferType"; + export { EBufferUsage } from "wonder.js/dist/es2015/renderer/buffer/EBufferUsage"; + export { ElementBuffer } from "wonder.js/dist/es2015/renderer/buffer/ElementBuffer"; + export { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + export { RenderCommand } from "wonder.js/dist/es2015/renderer/command/RenderCommand"; + export { SingleDrawCommand } from "wonder.js/dist/es2015/renderer/command/SingleDrawCommand"; + export { EDrawMode } from "wonder.js/dist/es2015/renderer/EDrawMode"; + export { GlUtils } from "wonder.js/dist/es2015/renderer/GlUtils"; + export { GLSLDataSender } from "wonder.js/dist/es2015/renderer/program/GLSLDataSender"; + export { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + export { Renderer } from "wonder.js/dist/es2015/renderer/renderer/Renderer"; + export { WebGLRenderer } from "wonder.js/dist/es2015/renderer/renderer/WebGLRenderer"; + export { BasicMaterialColorShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/basic/BasicMaterialColorShaderLib"; + export { BasicShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/basic/BasicShaderLib"; + export { EndBasicShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/basic/EndBasicShaderLib"; + export { CommonShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/common/CommonShaderLib"; + export { EndShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/common/EndShaderLib"; + export { VerticeCommonShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/common/VerticeCommonShaderLib"; + export { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + export { ShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/ShaderLib"; + export { CommonShader } from "wonder.js/dist/es2015/renderer/shader/shader/CommonShader"; + export { EngineShader } from "wonder.js/dist/es2015/renderer/shader/shader/EngineShader"; + export { Shader } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + export { EngineShaderSourceBuilder } from "wonder.js/dist/es2015/renderer/shader/sourceBuilder/EngineShaderSourceBuilder"; + export { ShaderSourceBuilder } from "wonder.js/dist/es2015/renderer/shader/sourceBuilder/ShaderSourceBuilder"; + export { EVariableCategory } from "wonder.js/dist/es2015/renderer/shader/variable/EVariableCategory"; + export { EVariableSemantic } from "wonder.js/dist/es2015/renderer/shader/variable/EVariableSemantic"; + export { EVariableType } from "wonder.js/dist/es2015/renderer/shader/variable/EVariableType"; + export { VariableLib } from "wonder.js/dist/es2015/renderer/shader/variable/VariableLib"; + export { VariableNameTable } from "wonder.js/dist/es2015/renderer/shader/variable/VariableNameTable"; + export { VariableTypeTable } from "wonder.js/dist/es2015/renderer/shader/variable/VariableTypeTable"; + export { BasicState } from "wonder.js/dist/es2015/renderer/state/BasicState"; + export { WebGLState } from "wonder.js/dist/es2015/renderer/state/WebGLState"; + export { Color } from "wonder.js/dist/es2015/structure/Color"; + export { Face3 } from "wonder.js/dist/es2015/structure/Face3"; + export { Point } from "wonder.js/dist/es2015/structure/Point"; + export { RectRegion } from "wonder.js/dist/es2015/structure/RectRegion"; + export { ViewWebGL } from "wonder.js/dist/es2015/structure/View"; + export { ArrayUtils } from "wonder.js/dist/es2015/utils/ArrayUtils"; + export { BufferUtils } from "wonder.js/dist/es2015/utils/BufferUtils"; + export { ClassUtils } from "wonder.js/dist/es2015/utils/ClassUtils"; + export { JudgeUtils } from "wonder.js/dist/es2015/utils/JudgeUtils"; + export { Log } from "wonder.js/dist/es2015/utils/Log"; + export { MathUtils } from "wonder.js/dist/es2015/utils/MathUtils"; + export { RenderUtils } from "wonder.js/dist/es2015/utils/RenderUtils"; + export { ShaderLibUtils } from "wonder.js/dist/es2015/utils/ShaderLibUtils"; + export { SortUtils } from "wonder.js/dist/es2015/utils/SortUtils"; + export { CommonTimeController } from "wonder.js/dist/es2015/utils/time/CommonTimeController"; + export { DirectorTimeController } from "wonder.js/dist/es2015/utils/time/DirectorTimeController"; + export { TimeController } from "wonder.js/dist/es2015/utils/time/TimeController"; + export { CompileConfig } from "wonder.js/dist/es2015/config/CompileConfig"; +} + +declare module 'wonder.js/dist/es2015/component/camera/Camera' { + import { Matrix4 } from "wonder.js/dist/es2015/math/Matrix4"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + export abstract class Camera { + readonly cameraToWorldMatrix: Matrix4; + worldToCameraMatrix: Matrix4; + near: number; + far: number; + pMatrix: Matrix4; + entityObject: GameObject; + protected pMatrixDirty: boolean; + init(): void; + dispose(): void; + clone(): this; + update(elapsed: number): void; + protected abstract updateProjectionMatrix(): any; + protected getInvViewProjMat(): Matrix4; + } +} + +declare module 'wonder.js/dist/es2015/component/camera/controller/basic/BasicCameraController' { + import { CameraController } from "wonder.js/dist/es2015/component/camera/controller/CameraController"; + import { Camera } from "wonder.js/dist/es2015/component/camera/Camera"; + export class BasicCameraController extends CameraController { + static create(cameraComponent: Camera): BasicCameraController; + } +} + +declare module 'wonder.js/dist/es2015/component/camera/controller/CameraController' { + import "wonder-frp/dist/es2015/stream/MergeAllStream"; + import { Component } from "wonder.js/dist/es2015/core/Component"; + import { Camera } from "wonder.js/dist/es2015/component/camera/Camera"; + import { Matrix4 } from "wonder.js/dist/es2015/math/Matrix4"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + export abstract class CameraController extends Component { + constructor(cameraComponent: Camera); + readonly cameraToWorldMatrix: Matrix4; + readonly worldToCameraMatrix: Matrix4; + pMatrix: Matrix4; + entityObject: GameObject; + camera: Camera; + init(): void; + update(elapsed: number): void; + dispose(): void; + clone(): this; + protected bindClearCacheEvent(): void; + protected disposeClearCacheEvent(): void; + } +} + +declare module 'wonder.js/dist/es2015/component/camera/PerspectiveCamera' { + import { Camera } from "wonder.js/dist/es2015/component/camera/Camera"; + export class PerspectiveCamera extends Camera { + static create(): PerspectiveCamera; + fovy: number; + aspect: number; + zoomIn(speed: number, min?: number): void; + zoomOut(speed: number, max?: number): void; + protected updateProjectionMatrix(): void; + } +} + +declare module 'wonder.js/dist/es2015/component/data/ComponentInitOrderTable' { + import { Component } from "wonder.js/dist/es2015/core/Component"; + export class ComponentInitOrderTable { + static getOrder(component: Component): 4 | 5; + } +} + +declare module 'wonder.js/dist/es2015/component/geometry/BoxGeometry' { + import { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + import { Face3 } from "wonder.js/dist/es2015/structure/Face3"; + export class BoxGeometry extends Geometry { + static create(): BoxGeometry; + width: number; + height: number; + depth: number; + widthSegments: number; + heightSegments: number; + depthSegments: number; + computeData(): { + vertices: any[]; + faces: Face3[]; + }; + } +} + +declare module 'wonder.js/dist/es2015/component/geometry/data/BasicBufferContainer' { + import { CommonBufferContainer } from "wonder.js/dist/es2015/component/geometry/data/CommonBufferContainer"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + export class BasicBufferContainer extends CommonBufferContainer { + static create(entityObject: GameObject): BasicBufferContainer; + } +} + +declare module 'wonder.js/dist/es2015/component/geometry/data/BasicGeometryData' { + import { GeometryData } from "wonder.js/dist/es2015/component/geometry/data/GeometryData"; + import { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + export class BasicGeometryData extends GeometryData { + static create(geometry: Geometry): BasicGeometryData; + } +} + +declare module 'wonder.js/dist/es2015/component/geometry/data/BufferContainer' { + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + import { GeometryData } from "wonder.js/dist/es2015/component/geometry/data/GeometryData"; + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + import { Buffer } from "wonder.js/dist/es2015/renderer/buffer/Buffer"; + import { EBufferDataType } from "wonder.js/dist/es2015/renderer/buffer/EBufferDataType"; + import { EBufferType } from "wonder.js/dist/es2015/renderer/buffer/EBufferType"; + import { EBufferUsage } from "wonder.js/dist/es2015/renderer/buffer/EBufferUsage"; + export abstract class BufferContainer { + constructor(entityObject: GameObject); + geometryData: GeometryData; + protected entityObject: GameObject; + protected container: Hash; + createBuffersFromGeometryData(): void; + removeCache(type: EBufferDataType): any; + removeCache(name: string): any; + getChild(type: EBufferDataType): any; + getChild(type: EBufferDataType, dataName: string): any; + init(): void; + dispose(): void; + protected abstract getVertice(type: EBufferDataType): any; + protected createOnlyOnceAndUpdateArrayBuffer(bufferAttriName: string, data: Array, size: number, type?: EBufferType, offset?: number, usage?: EBufferUsage): void; + protected createOnlyOnceAndUpdateElememntBuffer(bufferAttriName: string, data: Array, type?: EBufferType, offset?: number, usage?: EBufferUsage): void; + protected hasData(data: Array | null): boolean; + } +} + +declare module 'wonder.js/dist/es2015/component/geometry/data/CommonBufferContainer' { + import { BufferContainer } from "wonder.js/dist/es2015/component/geometry/data/BufferContainer"; + import { BasicGeometryData } from "wonder.js/dist/es2015/component/geometry/data/BasicGeometryData"; + import { ArrayBuffer } from "wonder.js/dist/es2015/renderer/buffer/ArrayBuffer"; + import { EBufferDataType } from "wonder.js/dist/es2015/renderer/buffer/EBufferDataType"; + export abstract class CommonBufferContainer extends BufferContainer { + geometryData: BasicGeometryData; + protected getVertice(type: EBufferDataType): ArrayBuffer; + } +} + +declare module 'wonder.js/dist/es2015/component/geometry/data/GeometryData' { + import { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + import { Face3 } from "wonder.js/dist/es2015/structure/Face3"; + export abstract class GeometryData { + constructor(geometry: Geometry); + vertices: Array; + readonly indices: Array; + faces: Array; + protected geometry: Geometry; + dispose(): void; + protected onChangeFace(): void; + } +} + +declare module 'wonder.js/dist/es2015/component/geometry/Geometry' { + import { Component } from "wonder.js/dist/es2015/core/Component"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + import { BufferContainer } from "wonder.js/dist/es2015/component/geometry/data/BufferContainer"; + import { EDrawMode } from "wonder.js/dist/es2015/renderer/EDrawMode"; + import { GeometryData } from "wonder.js/dist/es2015/component/geometry/data/GeometryData"; + import { BasicGeometryData } from "wonder.js/dist/es2015/component/geometry/data/BasicGeometryData"; + import { Face3 } from "wonder.js/dist/es2015/structure/Face3"; + export abstract class Geometry extends Component { + material: Material; + readonly geometryData: GeometryData; + entityObject: GameObject; + buffers: BufferContainer; + drawMode: EDrawMode; + abstract computeData(): GeometryDataType; + init(): void; + dispose(): void; + createBuffersFromGeometryData(): void; + protected createBufferContainer(): BufferContainer; + protected createGeometryData(computedData: GeometryDataType): GeometryData; + protected createBasicGeometryData(computedData: GeometryDataType): BasicGeometryData; + } + export type GeometryDataType = { + vertices: Array; + faces?: Array; + }; +} + +declare module 'wonder.js/dist/es2015/component/geometry/GeometryUtils' { + import { Face3 } from "wonder.js/dist/es2015/structure/Face3"; + import { Vector3 } from "wonder.js/dist/es2015/math/Vector3"; + export class GeometryUtils { + static convertToFaces(indices: Array, normals?: Array): Array; + static hasData(data: any): boolean; + static getThreeComponent(sourceData: Array, index: number): Vector3; + static iterateThreeComponent(dataArr: Array, iterator: (v: Vector3) => void): void; + static setThreeComponent(targetData: Array, sourceData: Vector3, index: number): any; + static setThreeComponent(targetData: Array, sourceData: Array, index: number): any; + } +} + +declare module 'wonder.js/dist/es2015/component/renderer/MeshRenderer' { + import { RendererComponent } from "wonder.js/dist/es2015/component/renderer/RendererComponent"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + import { Renderer } from "wonder.js/dist/es2015/renderer/renderer/Renderer"; + import { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + export class MeshRenderer extends RendererComponent { + static create(): MeshRenderer; + entityObject: GameObject; + render(renderer: Renderer, target: GameObject, camera: GameObject): void; + protected createDrawCommand(target: GameObject, geometry: Geometry, camera: GameObject): QuadCommand; + } +} + +declare module 'wonder.js/dist/es2015/component/renderer/RendererComponent' { + import { Component } from "wonder.js/dist/es2015/core/Component"; + import { Renderer } from "wonder.js/dist/es2015/renderer/renderer/Renderer"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + export abstract class RendererComponent extends Component { + abstract render(renderer: Renderer, target: EntityObject, camera: GameObject): any; + } +} + +declare module 'wonder.js/dist/es2015/component/transform/ETransformState' { + export enum ETransformState { + ISTRANSLATE, + ISROTATE, + ISSCALE, + ISLOCALTRANSLATE, + ISLOCALROTATE, + ISLOCALSCALE, + } +} + +declare module 'wonder.js/dist/es2015/component/transform/ThreeDTransform' { + import { Transform } from "wonder.js/dist/es2015/component/transform/Transform"; + import { Matrix4 } from "wonder.js/dist/es2015/math/Matrix4"; + import { Vector3 } from "wonder.js/dist/es2015/math/Vector3"; + import { Quaternion } from "wonder.js/dist/es2015/math/Quaternion"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { Matrix3 } from "wonder.js/dist/es2015/math/Matrix3"; + import { ETransformState } from "wonder.js/dist/es2015/component/transform/ETransformState"; + export class ThreeDTransform extends Transform { + static create(): ThreeDTransform; + localToWorldMatrix: Matrix4; + readonly normalMatrix: Matrix3; + position: Vector3; + rotation: Quaternion; + scale: Vector3; + eulerAngles: Vector3; + localPosition: Vector3; + localRotation: Quaternion; + localEulerAngles: Vector3; + localScale: Vector3; + readonly up: Vector3; + readonly right: Vector3; + readonly forward: any; + dirtyWorld: boolean; + protected p_parent: ThreeDTransform; + protected children: Collection; + sync(): void; + translateLocal(translation: Vector3): any; + translateLocal(x: number, y: number, z: number): any; + translate(translation: Vector3): any; + translate(x: number, y: number, z: number): any; + rotate(eulerAngles: Vector3): any; + rotate(x: number, y: number, z: number): any; + rotateLocal(eulerAngles: Vector3): any; + rotateLocal(x: number, y: number, z: number): any; + rotateAround(angle: number, center: Vector3, axis: Vector3): any; + rotateAround(angle: number, centerX: number, centerY: number, centerZ: number, axisX: number, axisY: number, axisZ: number): any; + lookAt(target: Vector3): any; + lookAt(targetX: number, targetY: number, targetZ: number): any; + lookAt(target: Vector3, up: Vector3): any; + lookAt(targetX: number, targetY: number, targetZ: number, upX: number, upY: number, upZ: number): any; + protected clearCache(): void; + protected handleWhenSetTransformState(transformState?: ETransformState): void; + } +} + +declare module 'wonder.js/dist/es2015/component/transform/Transform' { + import { Component } from "wonder.js/dist/es2015/core/Component"; + import { ETransformState } from "wonder.js/dist/es2015/component/transform/ETransformState"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export abstract class Transform extends Component { + protected p_parent: Transform; + parent: Transform; + isTransform: boolean; + isTranslate: boolean; + isRotate: boolean; + isScale: boolean; + isLocalTranslate: boolean; + isLocalRotate: boolean; + isLocalScale: boolean; + dirtyLocal: boolean; + protected children: Collection; + init(): void; + dispose(): void; + addChild(child: Transform): void; + removeChild(child: Transform): void; + setChildrenTransformState(state: boolean): any; + setChildrenTransformState(transformState: ETransformState, state: boolean): any; + protected abstract clearCache(): void; + protected handleWhenSetTransformState(transformState?: ETransformState): void; + protected setParent(parent: Transform): void; + protected getMatrix(syncMethod: string, matrixAttriName: string): T; + } +} + +declare module 'wonder.js/dist/es2015/config/DebugConfig' { + export var DebugConfig: { + isTest: boolean; + debugCollision: boolean; + showDebugPanel: boolean; + }; +} + +declare module 'wonder.js/dist/es2015/core/Component' { + import { Entity } from "wonder.js/dist/es2015/core/Entity"; + import { Transform } from "wonder.js/dist/es2015/component/transform/Transform"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export abstract class Component extends Entity { + readonly transform: Transform; + entityObject: EntityObject; + init(): void; + dispose(): void; + clone(): any; + addToObject(entityObject: EntityObject, isShareComponent?: boolean): void; + addToComponentContainer(): void; + removeFromObject(entityObject: EntityObject): void; + removeFromComponentContainer(): void; + } +} + +declare module 'wonder.js/dist/es2015/core/Director' { + import "wonder-frp/dist/es2015/stream/ConcatStream"; + import "wonder-frp/dist/es2015/stream/IgnoreElementsStream"; + import "wonder-frp/dist/es2015/extend/root"; + import { SceneDispatcher } from "wonder.js/dist/es2015/core/entityObject/scene/SceneDispatcher"; + import { Renderer } from "wonder.js/dist/es2015/renderer/renderer/Renderer"; + export class Director { + static getInstance(): any; + readonly gameTime: number; + readonly fps: number; + readonly isNormal: boolean; + readonly isStop: boolean; + readonly isPause: boolean; + readonly isTimeChange: boolean; + readonly elapsed: number; + readonly view: any; + scene: SceneDispatcher; + renderer: Renderer; + initWhenCreate(): void; + start(): void; + stop(): void; + pause(): void; + resume(): void; + getDeltaTime(): number; + } +} + +declare module 'wonder.js/dist/es2015/core/Entity' { + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export abstract class Entity { + constructor(); + uid: number; + data: any; + addTag(tag: string): void; + removeTag(tag: string): void; + getTagList(): Collection; + hasTag(tag: string): boolean; + containTag(tag: string): boolean; + } +} + +declare module 'wonder.js/dist/es2015/core/entityObject/EntityObject' { + import { Entity } from "wonder.js/dist/es2015/core/Entity"; + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { CustomEventRegisterData } from "wonder.js/dist/es2015/event/binder/CustomEventRegister"; + import { ComponentManager } from "wonder.js/dist/es2015/core/entityObject/manager/ComponentManager"; + import { Component } from "wonder.js/dist/es2015/core/Component"; + import { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + import { Renderer } from "wonder.js/dist/es2015/renderer/renderer/Renderer"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + import { Transform } from "wonder.js/dist/es2015/component/transform/Transform"; + export abstract class EntityObject extends Entity { + bubbleParent: EntityObject; + componentDirty: boolean; + readonly transform: Transform; + name: string; + parent: EntityObject; + customEventMap: Hash>; + protected componentManager: ComponentManager; + initWhenCreate(): void; + clone(config?: CloneEntityObjectConfigData): any; + init(): this; + dispose(): void; + hasChild(child: EntityObject): boolean; + addChild(child: EntityObject): EntityObject; + getChildren(): Collection; + removeChild(child: EntityObject): EntityObject; + forEach(func: (entityObject: EntityObject, index: number) => void): this; + getComponent(_class: any): T; + hasComponent(component: Component): boolean; + hasComponent(_class: Function): boolean; + addComponent(component: Component, isShareComponent?: boolean): this; + removeComponent(component: Component): any; + removeComponent(_class: Function): any; + forEachComponent(func: (component: Component) => void): this; + render(renderer: Renderer, camera: GameObject): void; + update(elapsed: number): void; + clearCache(): void; + getGeometry(): Geometry; + protected abstract createTransform(): Transform; + protected afterInitChildren(): void; + protected getRenderList(): Collection; + } + export type CloneEntityObjectConfigData = { + cloneChildren?: boolean; + shareGeometry?: boolean; + cloneGeometry?: boolean; + }; +} + +declare module 'wonder.js/dist/es2015/core/entityObject/gameObject/GameObject' { + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { ThreeDTransform } from "wonder.js/dist/es2015/component/transform/ThreeDTransform"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export class GameObject extends EntityObject { + static create(): GameObject; + transform: ThreeDTransform; + parent: GameObject; + renderGroup: number; + renderPriority: number; + isVisible: boolean; + protected children: Collection; + initWhenCreate(): void; + protected createTransform(): ThreeDTransform; + protected getRenderList(): Collection; + } +} + +declare module 'wonder.js/dist/es2015/core/entityObject/manager/ComponentManager' { + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { Transform } from "wonder.js/dist/es2015/component/transform/Transform"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { RendererComponent } from "wonder.js/dist/es2015/component/renderer/RendererComponent"; + import { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + import { Component } from "wonder.js/dist/es2015/core/Component"; + export class ComponentManager { + static create(entityObject: EntityObject): ComponentManager; + constructor(entityObject: EntityObject); + transform: Transform; + init(): void; + dispose(): void; + removeAllComponent(): Collection; + getComponent(_class: any): T; + getComponents(): Collection; + findComponentByUid(uid: number): any; + forEachComponent(func: (component: Component) => void): this; + hasComponent(component: Component): boolean; + hasComponent(_class: Function): boolean; + addComponent(component: Component, isShareComponent?: boolean): this; + removeComponent(component: Component): any; + removeComponent(_class: Function): any; + getComponentCount(_class: Function): number; + getGeometry(): Geometry; + getRendererComponent(): RendererComponent; + } +} + +declare module 'wonder.js/dist/es2015/core/entityObject/manager/EntityObjectManager' { + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export class EntityObjectManager { + static create(entityObject: EntityObject): EntityObjectManager; + constructor(entityObject: EntityObject); + init(): void; + dispose(): void; + hasChild(child: EntityObject): boolean; + addChild(child: EntityObject): this; + addChildren(children: EntityObject): any; + addChildren(children: Array): any; + addChildren(children: Collection): any; + forEach(func: (entityObject: EntityObject, index: number) => void): this; + filter(func: (entityObject: EntityObject) => boolean): Collection; + sort(func: (a: EntityObject, b: EntityObject) => any, isSortSelf?: boolean): Collection; + getChildren(): Collection; + getAllChildren(): Collection; + getChild(index: number): any; + findChildByUid(uid: number): any; + findChildByTag(tag: string): any; + findChildByName(name: string): any; + findChildrenByName(name: string): Collection; + removeChild(child: EntityObject): this; + removeAllChildren(): void; + } +} + +declare module 'wonder.js/dist/es2015/core/entityObject/scene/cache/BufferTable' { + import { ElementBuffer } from "wonder.js/dist/es2015/renderer/buffer/ElementBuffer"; + import { Buffer } from "wonder.js/dist/es2015/renderer/buffer/Buffer"; + export class BufferTable { + static lastBindedArrayBufferListUidStr: string; + static lastBindedElementBuffer: ElementBuffer; + static bindIndexBuffer(indexBuffer: ElementBuffer): void; + static hasBuffer(key: string): boolean; + static addBuffer(key: string, buffer: Buffer): void; + static getBuffer(key: string): T; + static dispose(): void; + static clearAll(): void; + static resetBindedArrayBuffer(): void; + static resetBindedElementBuffer(): void; + } + export enum BufferTableKey { + PROCEDURAL_VERTEX, + PROCEDURAL_INDEX, + } +} + +declare module 'wonder.js/dist/es2015/core/entityObject/scene/cache/ProgramTable' { + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + export class ProgramTable { + static lastUsedProgram: Program; + static hasProgram(key: string): boolean; + static addProgram(key: string, program: Program): void; + static getProgram(key: string): Program; + static dispose(): void; + static clearAll(): void; + } +} + +declare module 'wonder.js/dist/es2015/core/entityObject/scene/gameObjectScene/GameObjectScene' { + import { Scene } from "wonder.js/dist/es2015/core/entityObject/scene/Scene"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { Renderer } from "wonder.js/dist/es2015/renderer/renderer/Renderer"; + export class GameObjectScene extends Scene { + static create(): GameObjectScene; + currentCamera: any; + addChild(child: GameObject): GameObject; + update(elapsed: number): void; + render(renderer: Renderer): void; + protected getRenderList(): Collection; + protected createTransform(): any; + } +} + +declare module 'wonder.js/dist/es2015/core/entityObject/scene/Scene' { + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export abstract class Scene extends EntityObject { + } +} + +declare module 'wonder.js/dist/es2015/core/entityObject/scene/SceneDispatcher' { + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + import { GameObjectScene } from "wonder.js/dist/es2015/core/entityObject/scene/gameObjectScene/GameObjectScene"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export class SceneDispatcher extends EntityObject { + static create(): SceneDispatcher; + currentCamera: GameObject; + name: string; + gameObjectScene: GameObjectScene; + addChild(child: EntityObject): EntityObject; + dispose(): void; + hasChild(child: EntityObject): boolean; + addChildren(children: EntityObject): any; + addChildren(children: Array): any; + addChildren(children: Collection): any; + getChildren(): Collection; + protected createTransform(): any; + } +} + +declare module 'wonder.js/dist/es2015/core/Main' { + import { EScreenSize } from "wonder.js/dist/es2015/device/EScreenSize"; + export class Main { + static setConfig({canvasId, isTest, screenSize, useDevicePixelRatio, contextConfig}: { + canvasId?: null; + isTest?: boolean; + screenSize?: EScreenSize; + useDevicePixelRatio?: boolean; + contextConfig?: { + options: { + alpha: boolean; + depth: boolean; + stencil: boolean; + antialias: boolean; + premultipliedAlpha: boolean; + preserveDrawingBuffer: boolean; + }; + }; + }): typeof Main; + static init(): typeof Main; + } +} + +declare module 'wonder.js/dist/es2015/core/data/MainData' { + import { EScreenSize } from "wonder.js/dist/es2015/device/EScreenSize"; + import { RectRegion } from "wonder.js/dist/es2015/structure/RectRegion"; + export class MainData { + static isTest: boolean; + static screenSize: EScreenSize & RectRegion; + } + export type ContextConfigData = { + options: { + alpha: boolean; + depth: boolean; + stencil: boolean; + antialias: boolean; + premultipliedAlpha: boolean; + preserveDrawingBuffer: boolean; + }; + }; +} + +declare module 'wonder.js/dist/es2015/definition/typescript/decorator/cache' { + export function cacheGetter(judgeFunc: () => boolean, returnCacheValueFunc: () => any, setCacheFunc: (returnVal: any) => void): (target: any, name: any, descriptor: any) => any; + export function cache(judgeFunc: any, returnCacheValueFunc: any, setCacheFunc: any): (target: any, name: any, descriptor: any) => any; + export function cacheBufferForBufferContainer(): (target: any, name: any, descriptor: any) => any; + export function cacheBufferForBufferContainerWithFuncParam(setDataNameFuncName: string): (target: any, name: any, descriptor: any) => any; +} + +declare module 'wonder.js/dist/es2015/definition/typescript/decorator/clone' { + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export function cloneAttributeAsBasicType(configData?: CloneAttributeAsBasicTypeConfigData): (target: any, memberName: string | symbol) => void; + export function cloneAttributeAsCloneable(configData?: CloneAttributeAsCloneableConfigData): (target: any, memberName: string | symbol) => void; + export function cloneAttributeAsCustomType(cloneFunc: (source: any, target: any, memberName: string, cloneData: any) => void, configData?: CloneAttributeAsCustomTypeConfigData): (target: any, memberName: string | symbol) => void; + export class CloneUtils { + static clone(sourceInstance: T, cloneData?: any, createDataArr?: Array, target?: any): T; + static cloneArray(arr: Array | null, isDeep?: boolean): any; + static markNotClone(entityObject: EntityObject): void; + static isNotClone(entityObject: EntityObject): boolean; + } + export type CloneAttributeAsBasicTypeConfigData = { + order?: number; + }; + export type CloneAttributeAsCloneableConfigData = { + order?: number; + }; + export type CloneAttributeAsCustomTypeConfigData = { + order?: number; + }; + export enum CloneType { + CLONEABLE = 0, + BASIC = 1, + CUSTOM = 2, + } +} + +declare module 'wonder.js/dist/es2015/definition/typescript/decorator/contract' { + export function assert(cond: boolean, message?: string): void; + export function describe(message: string, func: Function, preCondition?: Function, context?: any): void; + export function it(message: string, func: Function, context?: any): void; + export function requireCheck(inFunc: any): (target: any, name: any, descriptor: any) => any; + export function ensure(outFunc: any): (target: any, name: any, descriptor: any) => any; + export function requireGetterAndSetter(inGetterFunc: any, inSetterFunc: any): (target: any, name: any, descriptor: any) => any; + export function requireGetter(inFunc: any): (target: any, name: any, descriptor: any) => any; + export function requireSetter(inFunc: any): (target: any, name: any, descriptor: any) => any; + export function ensureGetterAndSetter(outGetterFunc: any, outSetterFunc: any): (target: any, name: any, descriptor: any) => any; + export function ensureGetter(outFunc: any): (target: any, name: any, descriptor: any) => any; + export function ensureSetter(outFunc: any): (target: any, name: any, descriptor: any) => any; + export function invariant(func: any): (target: any) => void; +} + +declare module 'wonder.js/dist/es2015/definition/typescript/decorator/control' { + export function execOnlyOnce(flagName: string): (target: any, name: any, descriptor: any) => any; +} + +declare module 'wonder.js/dist/es2015/definition/typescript/decorator/registerClass' { + export function registerClass(className: string): (_class: any) => void; +} + +declare module 'wonder.js/dist/es2015/definition/typescript/decorator/singleton' { + export function singleton(isInitWhenCreate?: boolean): (target: any) => void; +} + +declare module 'wonder.js/dist/es2015/definition/typescript/decorator/virtual' { + export function virtual(target: any, name: any, descriptor: any): any; +} + +declare module 'wonder.js/dist/es2015/definition/Variable' { + export var root: any; +} + +declare module 'wonder.js/dist/es2015/device/DeviceManager' { + import { Vector2 } from "wonder.js/dist/es2015/math/Vector2"; + import { IView } from "wonder.js/dist/es2015/structure/View"; + import { ContextConfigData } from "wonder.js/dist/es2015/core/data/MainData"; + import { RectRegion } from "wonder.js/dist/es2015/structure/RectRegion"; + export class DeviceManager { + static getInstance(): any; + scissorTest: boolean; + setScissor(x: number, y: number, width: number, height: number): void; + setViewport(x: number, y: number, width: number, height: number): void; + getViewport(): RectRegion; + depthTest: boolean; + depthFunc: EDepthFunction; + side: ESide; + polygonOffset: Vector2; + polygonOffsetMode: EPolygonOffsetMode; + depthWrite: boolean; + blend: boolean; + alphaToCoverage: boolean; + view: IView; + gl: WebGLRenderingContext; + contextConfig: ContextConfigData; + setBlendFunc(blendSrc: EBlendFunc, blendDst: EBlendFunc): void; + setBlendEquation(blendEquation: EBlendEquation): void; + setBlendFuncSeparate(blendFuncSeparate: Array): void; + setBlendEquationSeparate(blendEquationSeparate: Array): void; + setColorWrite(writeRed: any, writeGreen: any, writeBlue: any, writeAlpha: any): void; + clear(options: any): void; + createGL(canvasId: string, contextConfig: ContextConfigData, useDevicePixelRatio: boolean): void; + setScreen(): void; + setHardwareScaling(level: number): void; + setPixelRatio(pixelRatio: number): void; + getPixelRatio(): number; + } + export enum EDepthFunction { + NEVER, + ALWAYS, + LESS, + LEQUAL, + EQUAL, + GEQUAL, + GREATER, + NOTEQUAL, + } + export enum ESide { + NONE = 0, + BOTH = 1, + BACK = 2, + FRONT = 3, + } + export enum EPolygonOffsetMode { + NONE = 0, + IN = 1, + OUT = 2, + CUSTOM = 3, + } + export enum EBlendFunc { + ZERO, + ONE, + SRC_COLOR, + ONE_MINUS_SRC_COLOR, + DST_COLOR, + ONE_MINUS_DST_COLOR, + SRC_ALPHA, + SRC_ALPHA_SATURATE, + ONE_MINUS_SRC_ALPHA, + DST_ALPHA, + ONE_MINUS_DST_ALPH, + } + export enum EBlendEquation { + ADD, + SUBTRACT, + REVERSE_SUBTRAC, + } + export enum EBlendType { + NONE = 0, + NORMAL = 1, + ADDITIVE = 2, + ADDITIVEALPHA = 3, + MULTIPLICATIVE = 4, + PREMULTIPLIED = 5, + } + export enum ECanvasType { + TwoDUI, + } + export type CanvasMapData = { + canvas: HTMLCanvasElement; + context: CanvasRenderingContext2D; + }; +} + +declare module 'wonder.js/dist/es2015/device/EScreenSize' { + export enum EScreenSize { + FULL = 0, + } +} + +declare module 'wonder.js/dist/es2015/device/GPUDetector' { + export class GPUDetector { + static getInstance(): any; + readonly gl: any; + maxTextureUnit: number; + maxTextureSize: number; + maxCubemapTextureSize: number; + maxAnisotropy: number; + maxBoneCount: number; + extensionCompressedTextureS3TC: any; + extensionTextureFilterAnisotropic: any; + extensionInstancedArrays: any; + extensionUintIndices: boolean; + extensionDepthTexture: boolean; + extensionVAO: any; + extensionStandardDerivatives: boolean; + precision: number; + detect(): void; + } + export enum EGPUPrecision { + HIGHP = 0, + MEDIUMP = 1, + LOWP = 2, + } +} + +declare module 'wonder.js/dist/es2015/event/binder/CustomEventBinder' { + import { EventBinder } from "wonder.js/dist/es2015/event/binder/EventBinder"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export class CustomEventBinder extends EventBinder { + static getInstance(): any; + on(eventName: EEventName | string, handler: Function): void; + on(eventName: EEventName | string, handler: Function, priority: number): void; + on(target: EntityObject, eventName: EEventName | string, handler: Function): void; + on(target: EntityObject, eventName: EEventName | string, handler: Function, priority: number): void; + off(): void; + off(eventName: EEventName | string): void; + off(target: EntityObject): void; + off(eventName: EEventName | string, handler: Function): void; + off(target: EntityObject, eventName: EEventName | string): void; + off(target: EntityObject, eventName: EEventName | string, handler: Function): void; + } +} + +declare module 'wonder.js/dist/es2015/event/binder/CustomEventRegister' { + import { EventRegister } from "wonder.js/dist/es2015/event/binder/EventRegister"; + import { CustomEventListenerMap } from "wonder.js/dist/es2015/event/structure/CustomEventListenerMap"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export class CustomEventRegister extends EventRegister { + static getInstance(): any; + protected listenerMap: CustomEventListenerMap; + register(eventName: EEventName, handler: Function, originHandler: Function, domHandler: Function, priority: number): any; + register(target: EntityObject, eventName: EEventName, handler: Function, originHandler: Function, domHandler: Function, priority: number): any; + remove(eventName: EEventName): any; + remove(target: EntityObject): any; + remove(eventName: EEventName, handler: Function): any; + remove(uid: number, eventName: EEventName): any; + remove(target: EntityObject, eventName: EEventName): any; + remove(target: EntityObject, eventName: EEventName, handler: Function): any; + setBubbleParent(target: EntityObject, parent: EntityObject): void; + } + export type CustomEventRegisterData = { + target: EntityObject; + originHandler: Function; + handler: Function; + domHandler: Function; + priority: number; + }; +} + +declare module 'wonder.js/dist/es2015/event/binder/DomEventBinder' { + import { EventBinder } from "wonder.js/dist/es2015/event/binder/EventBinder"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + export class DomEventBinder extends EventBinder { + static getInstance(): any; + on(eventName: EEventName | string, handler: Function): void; + on(eventName: EEventName | string, handler: Function, priority: number): void; + on(dom: HTMLElement, eventName: EEventName | string, handler: Function): void; + on(dom: HTMLElement, eventName: EEventName | string, handler: Function, priority: number): void; + off(): void; + off(eventName: EEventName | string): void; + off(dom: HTMLElement): void; + off(eventName: EEventName | string, handler: Function): void; + off(dom: HTMLElement, eventName: EEventName): void; + off(dom: HTMLElement, eventName: EEventName, handler: Function): void; + } +} + +declare module 'wonder.js/dist/es2015/event/binder/DomEventRegister' { + import { EventRegister } from "wonder.js/dist/es2015/event/binder/EventRegister"; + import { DomEventListenerMap } from "wonder.js/dist/es2015/event/structure/DomEventListenerMap"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export class DomEventRegister extends EventRegister { + static getInstance(): any; + protected listenerMap: DomEventListenerMap; + register(dom: HTMLElement, eventName: EEventName, eventData: Hash, handler: Function, originHandler: Function, domHandler: Function, priority: number): void; + remove(eventName: EEventName): any; + remove(eventName: EEventName, handler: Function): any; + remove(dom: HTMLElement, eventName: EEventName): any; + remove(dom: HTMLElement, eventName: EEventName, handler: Function): any; + isBinded(dom: HTMLElement, eventName: EEventName): boolean; + getDomHandler(dom: HTMLElement, eventName: EEventName): Function; + } + export type DomEventRegisterData = { + dom?: HTMLElement; + target?: EntityObject; + eventData: Hash; + originHandler: Function; + handler: Function; + domHandler: Function; + priority: number; + }; +} + +declare module 'wonder.js/dist/es2015/event/binder/EventBinder' { + export abstract class EventBinder { + abstract on(...args: any[]): void; + abstract off(...args: any[]): void; + } +} + +declare module 'wonder.js/dist/es2015/event/binder/EventRegister' { + import { EventListenerMap } from "wonder.js/dist/es2015/event/structure/EventListenerMap"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export abstract class EventRegister { + protected abstract listenerMap: EventListenerMap; + abstract register(...args: any[]): void; + abstract remove(...args: any[]): any; + getEventRegisterDataList(eventName: EEventName): any; + getEventRegisterDataList(currentTarget: EntityObject, eventName: EEventName): any; + getEventRegisterDataList(dom: HTMLElement, eventName: EEventName): any; + forEachAll(func: (list: Collection, eventName: EEventName) => void): void; + forEachEventName(func: (list: Collection, eventName: EEventName) => void): void; + clear(): void; + getChild(target: EntityObject): any; + getChild(dom: HTMLElement): any; + getChild(target: EntityObject, eventName: EEventName): any; + getChild(dom: HTMLElement, eventName: EEventName): any; + } + export type EventRegisterData = { + originHandler: Function; + handler: Function; + domHandler: Function; + priority: number; + }; +} + +declare module 'wonder.js/dist/es2015/event/dispatcher/CustomEventDispatcher' { + import { EventDispatcher } from "wonder.js/dist/es2015/event/dispatcher/EventDispatcher"; + import { Event } from "wonder.js/dist/es2015/event/object/Event"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export class CustomEventDispatcher extends EventDispatcher { + static getInstance(): any; + trigger(event: Event): boolean; + trigger(event: Event, userData: any): boolean; + trigger(target: EntityObject, event: Event): boolean; + trigger(target: EntityObject, event: Event, notSetTarget: boolean): boolean; + trigger(target: EntityObject, event: Event, userData: any): boolean; + trigger(target: EntityObject, event: Event, userData: any, notSetTarget: boolean): boolean; + emit(target: EntityObject, eventObject: Event, userData?: any): void; + broadcast(target: EntityObject, eventObject: Event, userData?: any): void; + } +} + +declare module 'wonder.js/dist/es2015/event/dispatcher/DomEventDispatcher' { + import { EventDispatcher } from "wonder.js/dist/es2015/event/dispatcher/EventDispatcher"; + import { Event } from "wonder.js/dist/es2015/event/object/Event"; + export class DomEventDispatcher extends EventDispatcher { + static getInstance(): any; + trigger(event: Event): void; + trigger(dom: HTMLElement, event: Event): void; + } +} + +declare module 'wonder.js/dist/es2015/event/dispatcher/EventDispatcher' { + export abstract class EventDispatcher { + abstract trigger(...args: any[]): any; + } +} + +declare module 'wonder.js/dist/es2015/event/EEngineEvent' { + export enum EEngineEvent { + STARTLOOP, + ENDLOOP, + POINT_TAP, + POINT_DOWN, + POINT_UP, + POINT_MOVE, + POINT_OVER, + POINT_OUT, + POINT_SCALE, + POINT_DRAG, + TRANSFORM_TRANSLATE, + TRANSFORM_ROTATE, + TRANSFORM_SCALE, + } +} + +declare module 'wonder.js/dist/es2015/event/EventManager' { + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { EEngineEvent } from "wonder.js/dist/es2015/event/EEngineEvent"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { Event } from "wonder.js/dist/es2015/event/object/Event"; + import { FromEventPatternStream } from "wonder-frp/dist/es2015/stream/FromEventPatternStream"; + export class EventManager { + static on(eventName: EEventName | EEngineEvent | string, handler: Function): void; + static on(eventName: EEventName | EEngineEvent | string, handler: Function, priority: number): void; + static on(target: EntityObject, eventName: EEventName | EEngineEvent | string, handler: Function): void; + static on(dom: HTMLElement, eventName: EEventName | EEngineEvent | string, handler: Function): void; + static on(target: EntityObject, eventName: EEventName | EEngineEvent | string, handler: Function, priority: number): void; + static on(dom: HTMLElement, eventName: EEventName | EEngineEvent | string, handler: Function, priority: number): void; + static off(): void; + static off(eventName: EEventName | EEngineEvent | string): void; + static off(target: EntityObject): void; + static off(dom: HTMLElement): void; + static off(eventName: EEventName | EEngineEvent | string, handler: Function): void; + static off(target: EntityObject, eventName: EEventName | EEngineEvent | string): void; + static off(dom: HTMLElement, eventName: EEventName): void; + static off(target: EntityObject, eventName: EEventName | EEngineEvent | string, handler: Function): void; + static off(dom: HTMLElement, eventName: EEventName, handler: Function): void; + static trigger(event: Event): void; + static trigger(event: Event, userData: any): void; + static trigger(target: EntityObject, event: Event): void; + static trigger(dom: HTMLElement, event: Event): void; + static trigger(target: EntityObject, event: Event, userData: any): void; + static trigger(target: EntityObject, event: Event, userData: any, notSetTarget: boolean): void; + static broadcast(target: EntityObject, event: Event): any; + static broadcast(target: EntityObject, event: Event, userData: any): any; + static emit(target: EntityObject, event: Event): any; + static emit(target: EntityObject, event: Event, userData: any): any; + static fromEvent(eventName: EEventName | EEngineEvent | string): FromEventPatternStream; + static fromEvent(eventName: EEventName | EEngineEvent | string, priority: number): FromEventPatternStream; + static fromEvent(target: EntityObject, eventName: EEventName | EEngineEvent | string): FromEventPatternStream; + static fromEvent(dom: HTMLElement, eventName: EEventName | EEngineEvent | string): FromEventPatternStream; + static fromEvent(target: EntityObject, eventName: EEventName | EEngineEvent | string, priority: number): FromEventPatternStream; + static fromEvent(dom: HTMLElement, eventName: EEventName | EEngineEvent | string, priority: number): FromEventPatternStream; + static setBubbleParent(target: EntityObject, parent: any): void; + } +} + +declare module 'wonder.js/dist/es2015/event/factory/EventBinderFactory' { + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + export class EventBinderFactory { + static createEventBinder(eventName: EEventName): any; + } +} + +declare module 'wonder.js/dist/es2015/event/factory/EventDispatcherFactory' { + import { Event } from "wonder.js/dist/es2015/event/object/Event"; + export class EventDispatcherFactory { + static createEventDispatcher(event: Event): any; + } +} + +declare module 'wonder.js/dist/es2015/event/factory/EventHandlerFactory' { + import { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + export class EventHandlerFactory { + static createEventHandler(eventType: EEventType): any; + } +} + +declare module 'wonder.js/dist/es2015/event/handler/CustomEventHandler' { + import { EventHandler } from "wonder.js/dist/es2015/event/handler/EventHandler"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { Event } from "wonder.js/dist/es2015/event/object/Event"; + export class CustomEventHandler extends EventHandler { + static getInstance(): any; + on(eventName: string, handler: Function, priority: number): void; + on(target: EntityObject, eventName: string, handler: Function, priority: number): void; + off(eventName: string): void; + off(uid: number, eventName: string): void; + off(eventName: string, handler: Function): void; + off(target: EntityObject, eventName: string, handler: Function): void; + trigger(event: Event): boolean; + trigger(event: Event, userData: any): boolean; + trigger(target: EntityObject, event: Event, notSetTarget: boolean): boolean; + trigger(target: EntityObject, event: Event, userData: any, notSetTarget: boolean): boolean; + } +} + +declare module 'wonder.js/dist/es2015/event/handler/DomEventHandler' { + import { EventHandler } from "wonder.js/dist/es2015/event/handler/EventHandler"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { Event } from "wonder.js/dist/es2015/event/object/Event"; + import { IEventData } from "wonder.js/dist/es2015/event/interface/IEventData"; + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + export abstract class DomEventHandler extends EventHandler { + off(): void; + off(eventName: EEventName): void; + off(eventName: EEventName, handler: Function): void; + off(dom: HTMLElement, eventName: EEventName): void; + off(dom: HTMLElement, eventName: EEventName, handler: Function): void; + trigger(event: Event): void; + trigger(dom: HTMLElement, event: Event): void; + protected abstract triggerDomEvent(dom: HTMLElement, event: IEventData, eventName: EEventName): any; + protected abstract addEngineHandler(eventName: EEventName, handler: Function): any; + protected abstract getDefaultDom(): HTMLElement; + protected abstract createEventData(): Hash; + protected clearHandler(): void; + protected buildDomHandler(dom: HTMLElement, eventName: EEventName): (event: any) => any; + protected handler(dom: HTMLElement, eventName: EEventName, handler: Function, priority: number): void; + } +} + +declare module 'wonder.js/dist/es2015/event/handler/EventHandler' { + export abstract class EventHandler { + abstract on(...args: any[]): any; + abstract off(...args: any[]): any; + abstract trigger(...args: any[]): any; + } +} + +declare module 'wonder.js/dist/es2015/event/handler/KeyboardEventHandler' { + import { DomEventHandler } from "wonder.js/dist/es2015/event/handler/DomEventHandler"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { KeyboardEvent } from "wonder.js/dist/es2015/event/object/KeyboardEvent"; + import { IKeyboardEventData } from "wonder.js/dist/es2015/event/interface/IEventData"; + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + export class KeyboardEventHandler extends DomEventHandler { + static getInstance(): any; + on(eventName: EEventName, handler: (event: KeyboardEvent) => void, priority: number): any; + on(dom: HTMLElement, eventName: EEventName, handler: (event: KeyboardEvent) => void, priority: number): any; + protected triggerDomEvent(dom: HTMLElement, event: IKeyboardEventData, eventName: EEventName): void; + protected getDefaultDom(): HTMLElement; + protected addEngineHandler(eventName: EEventName, handler: (event: KeyboardEvent) => void): any; + protected createEventData(): Hash; + } +} + +declare module 'wonder.js/dist/es2015/event/handler/MouseEventHandler' { + import { PointEventHandler } from "wonder.js/dist/es2015/event/handler/PointEventHandler"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { MouseEvent } from "wonder.js/dist/es2015/event/object/MouseEvent"; + import { IMouseEventData } from "wonder.js/dist/es2015/event/interface/IEventData"; + export class MouseEventHandler extends PointEventHandler { + static getInstance(): any; + protected addEngineHandler(eventName: EEventName, handler: (event: MouseEvent) => void): any; + protected createEventObject(dom: HTMLElement, event: IMouseEventData, eventName: EEventName): MouseEvent; + } +} + +declare module 'wonder.js/dist/es2015/event/handler/PointEventHandler' { + import { DomEventHandler } from "wonder.js/dist/es2015/event/handler/DomEventHandler"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { DomEvent } from "wonder.js/dist/es2015/event/object/DomEvent"; + import { IEventData } from "wonder.js/dist/es2015/event/interface/IEventData"; + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + import { MouseEvent } from "wonder.js/dist/es2015/event/object/MouseEvent"; + import { TouchEvent } from "wonder.js/dist/es2015/event/object/TouchEvent"; + export abstract class PointEventHandler extends DomEventHandler { + on(eventName: EEventName, handler: (event: DomEvent) => void, priority: number): any; + on(dom: HTMLElement, eventName: EEventName, handler: (event: DomEvent) => void, priority: number): any; + protected abstract createEventObject(dom: HTMLElement, event: IEventData, eventName: EEventName): DomEvent; + protected getDefaultDom(): HTMLElement; + protected triggerDomEvent(dom: HTMLElement, event: IEventData, eventName: EEventName): void; + protected createEventData(): Hash; + protected handleMove(handler: (event: MouseEvent | TouchEvent) => void): (event: MouseEvent | TouchEvent, eventData: Hash) => void; + } +} + +declare module 'wonder.js/dist/es2015/event/handler/TouchEventHandler' { + import { PointEventHandler } from "wonder.js/dist/es2015/event/handler/PointEventHandler"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { TouchEvent } from "wonder.js/dist/es2015/event/object/TouchEvent"; + import { ITouchEventData } from "wonder.js/dist/es2015/event/interface/IEventData"; + export class TouchEventHandler extends PointEventHandler { + static getInstance(): any; + protected addEngineHandler(eventName: EEventName, handler: (event: TouchEvent) => void): any; + protected createEventObject(dom: HTMLElement, event: ITouchEventData, eventName: EEventName): TouchEvent; + } +} + +declare module 'wonder.js/dist/es2015/event/object/CustomEvent' { + import { Event } from "wonder.js/dist/es2015/event/object/Event"; + import { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + import { DomEvent } from "wonder.js/dist/es2015/event/object/DomEvent"; + export class CustomEvent extends Event { + static create(eventName: string): any; + static create(eventName: string, userData: any): any; + constructor(eventName: string); + constructor(eventName: string, userData: any); + readonly type: EEventType; + userData: any; + copyPublicAttri(destination: any, source: any): any; + clone(): CustomEvent; + getDataFromDomEvent(event: DomEvent): void; + } +} + +declare module 'wonder.js/dist/es2015/event/object/DomEvent' { + import { Event } from "wonder.js/dist/es2015/event/object/Event"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { CustomEvent } from "wonder.js/dist/es2015/event/object/CustomEvent"; + export abstract class DomEvent extends Event { + constructor(event: any, eventName: EEventName); + event: any; + preventDefault(): void; + getDataFromCustomEvent(event: CustomEvent): void; + } +} + +declare module 'wonder.js/dist/es2015/event/object/EEventPhase' { + export enum EEventPhase { + BROADCAST = 0, + EMIT = 1, + } +} + +declare module 'wonder.js/dist/es2015/event/object/EEventType' { + export enum EEventType { + MOUSE = 0, + TOUCH = 1, + POINT = 2, + KEYBOARD = 3, + CUSTOM = 4, + } +} + +declare module 'wonder.js/dist/es2015/event/object/EMouseButton' { + export enum EMouseButton { + LEFT = 0, + RIGHT = 1, + CENTER = 2, + } +} + +declare module 'wonder.js/dist/es2015/event/object/Event' { + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + import { EEngineEvent } from "wonder.js/dist/es2015/event/EEngineEvent"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { EEventPhase } from "wonder.js/dist/es2015/event/object/EEventPhase"; + export abstract class Event { + protected constructor(eventName: EEventName); + readonly abstract type: EEventType; + name: string | EEventName | EEngineEvent; + target: HTMLElement | EntityObject; + currentTarget: HTMLElement | EntityObject; + isStopPropagation: boolean; + phase: EEventPhase; + abstract clone(): any; + stopPropagation(): void; + protected copyMember(destination: Event, source: Event, memberArr: [any]): Event; + } +} + +declare module 'wonder.js/dist/es2015/event/object/EventNameHandler' { + export enum EEventName { + CLICK, + MOUSEOVER, + MOUSEUP, + MOUSEOUT, + MOUSEMOVE, + MOUSEDOWN, + MOUSEWHEEL, + MOUSEDRAG, + TOUCHUP, + TOUCHMOVE, + TOUCHDOWN, + KEYDOWN, + KEYUP, + KEYPRESS, + } + export class EventNameHandler { + static handleEventName(domEventName: EEventName): any; + } +} + +declare module 'wonder.js/dist/es2015/event/object/EventTable' { + import { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + export class EventTable { + static getEventType(eventName: EEventName): EEventType; + } +} + +declare module 'wonder.js/dist/es2015/event/object/KeyboardEvent' { + import { DomEvent } from "wonder.js/dist/es2015/event/object/DomEvent"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { IKeyboardEventData } from "wonder.js/dist/es2015/event/interface/IEventData"; + import { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + export class KeyboardEvent extends DomEvent { + static create(event: any, eventName: EEventName): KeyboardEvent; + event: IKeyboardEventData; + readonly ctrlKey: number; + readonly altKey: number; + readonly shiftKey: number; + readonly metaKey: number; + readonly keyCode: number; + readonly key: any; + readonly type: EEventType; + keyState: any; + clone(): KeyboardEvent; + } +} + +declare module 'wonder.js/dist/es2015/event/object/MouseEvent' { + import { DomEvent } from "wonder.js/dist/es2015/event/object/DomEvent"; + import { IMouseEventData } from "wonder.js/dist/es2015/event/interface/IEventData"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { Point } from "wonder.js/dist/es2015/structure/Point"; + import { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + export class MouseEvent extends DomEvent { + static create(event: IMouseEventData, eventName: EEventName): MouseEvent; + event: IMouseEventData; + location: Point; + locationInView: Point; + button: number; + readonly wheel: number; + readonly movementDelta: { + x: any; + y: any; + }; + readonly type: EEventType; + lastX: number; + lastY: number; + clone(): MouseEvent; + } +} + +declare module 'wonder.js/dist/es2015/event/object/MousePointEvent' { + import { PointEvent } from "wonder.js/dist/es2015/event/object/PointEvent"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { MouseEvent } from "wonder.js/dist/es2015/event/object/MouseEvent"; + import { Point } from "wonder.js/dist/es2015/structure/Point"; + export class MousePointEvent extends PointEvent { + static create(eventName: EEventName): MousePointEvent; + eventObj: MouseEvent; + location: Point; + locationInView: Point; + button: number; + readonly wheel: number; + readonly movementDelta: { + x: any; + y: any; + }; + getDataFromEventObj(e: MouseEvent): void; + clone(): any; + } +} + +declare module 'wonder.js/dist/es2015/event/object/PointEvent' { + import { DomEvent } from "wonder.js/dist/es2015/event/object/DomEvent"; + import { IPointEventData } from "wonder.js/dist/es2015/event/interface/IEventData"; + import { Point } from "wonder.js/dist/es2015/structure/Point"; + import { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + import { MouseEvent } from "wonder.js/dist/es2015/event/object/MouseEvent"; + import { TouchEvent } from "wonder.js/dist/es2015/event/object/TouchEvent"; + export abstract class PointEvent extends DomEvent { + event: IPointEventData; + abstract location: Point; + abstract locationInView: Point; + abstract button: number | null; + readonly abstract wheel: number | null; + readonly abstract movementDelta: Point; + lastX: number; + lastY: number; + readonly type: EEventType; + eventObj: MouseEvent | TouchEvent; + abstract getDataFromEventObj(eventObj: TouchEvent | MouseEvent): void; + protected cloneHelper(eventObj: PointEvent): PointEvent; + } +} + +declare module 'wonder.js/dist/es2015/event/object/TouchEvent' { + import { DomEvent } from "wonder.js/dist/es2015/event/object/DomEvent"; + import { ITouchEventData, ITouchData } from "wonder.js/dist/es2015/event/interface/IEventData"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { Point } from "wonder.js/dist/es2015/structure/Point"; + import { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + export class TouchEvent extends DomEvent { + static create(event: ITouchEventData, eventName: EEventName): TouchEvent; + event: ITouchEventData; + location: Point; + readonly touchData: ITouchData; + locationInView: Point; + readonly movementDelta: { + x: any; + y: any; + }; + readonly type: EEventType; + lastX: number; + lastY: number; + clone(): TouchEvent; + } +} + +declare module 'wonder.js/dist/es2015/event/object/TouchPointEvent' { + import { PointEvent } from "wonder.js/dist/es2015/event/object/PointEvent"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { TouchEvent } from "wonder.js/dist/es2015/event/object/TouchEvent"; + import { Point } from "wonder.js/dist/es2015/structure/Point"; + export class TouchPointEvent extends PointEvent { + static create(eventName: EEventName): TouchPointEvent; + eventObj: TouchEvent; + location: Point; + locationInView: Point; + readonly wheel: any; + readonly movementDelta: { + x: any; + y: any; + }; + button: number; + getDataFromEventObj(e: TouchEvent): void; + clone(): any; + } +} + +declare module 'wonder.js/dist/es2015/event/structure/CustomEventListenerMap' { + import { EventListenerMap } from "wonder.js/dist/es2015/event/structure/EventListenerMap"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { CustomEventRegisterData } from "wonder.js/dist/es2015/event/binder/CustomEventRegister"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + export class CustomEventListenerMap extends EventListenerMap { + static create(): CustomEventListenerMap; + hasChild(target: EntityObject): boolean; + appendChild(eventName: EEventName, data: any): any; + appendChild(target: EntityObject, eventName: EEventName, data: any): any; + forEachAll(func: (list: Collection, eventName: EEventName) => void): void; + forEachEventName(func: (list: Collection, eventName: EEventName) => void): void; + clear(): void; + getChild(eventName: EEventName): Collection; + getChild(target: EntityObject): Collection; + getChild(target: EntityObject, eventName: EEventName): Collection; + removeChild(eventName: EEventName): void; + removeChild(target: EntityObject): void; + removeChild(eventName: EEventName, handler: Function): void; + removeChild(uid: number, eventName: EEventName): void; + removeChild(target: EntityObject, eventName: EEventName): void; + removeChild(target: EntityObject, eventName: EEventName, handler: Function): void; + protected buildFirstLevelKey(target: EntityObject): any; + protected buildFirstLevelKey(uid: number): any; + } +} + +declare module 'wonder.js/dist/es2015/event/structure/DomEventListenerMap' { + import { EventListenerMap } from "wonder.js/dist/es2015/event/structure/EventListenerMap"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { DomEventRegisterData } from "wonder.js/dist/es2015/event/binder/DomEventRegister"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + export class DomEventListenerMap extends EventListenerMap { + static create(): DomEventListenerMap; + hasChild(dom: HTMLElement, eventName: EEventName): boolean; + appendChild(dom: HTMLElement, eventName: EEventName, data: any): void; + forEachAll(func: (list: Collection, eventName: EEventName) => void): void; + forEachEventName(func: (list: Collection, eventName: EEventName) => void): void; + clear(): void; + getChild(dom: HTMLElement): Collection; + getChild(dom: HTMLElement, eventName: EEventName): Collection; + removeChild(eventName: EEventName): Collection; + removeChild(eventName: EEventName, handler: Function): Collection; + removeChild(dom: HTMLElement, eventName: EEventName): Collection; + removeChild(dom: HTMLElement, eventName: EEventName, handler: Function): Collection; + protected buildFirstLevelKey(dom: HTMLElement): string; + } + export type DomEventOffData = { + dom: HTMLElement; + eventName: EEventName; + domHandler: Function; + }; +} + +declare module 'wonder.js/dist/es2015/event/structure/EventListenerMap' { + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export abstract class EventListenerMap { + abstract getChild(...args: any[]): Collection; + abstract removeChild(...args: any[]): any; + abstract hasChild(...args: any[]): boolean; + abstract appendChild(...args: any[]): void; + abstract forEachAll(func: (list: Collection, eventName: EEventName) => void): void; + abstract forEachEventName(func: (list: Collection, eventName: EEventName) => void): void; + abstract clear(): void; + protected abstract buildFirstLevelKey(target: EntityObject | HTMLElement): string; + protected buildSecondLevelKey(eventName: EEventName): string; + } +} + +declare module 'wonder.js/dist/es2015/event/utils/EventUtils' { + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export class EventUtils { + static isEvent(arg: any): boolean; + static isEntityObject(arg: EntityObject): boolean; + } +} + +declare module 'wonder.js/dist/es2015/material/BasicMaterial' { + import { StandardBasicMaterial } from "wonder.js/dist/es2015/material/StandardBasicMaterial"; + export class BasicMaterial extends StandardBasicMaterial { + static create(): BasicMaterial; + } +} + +declare module 'wonder.js/dist/es2015/material/EngineMaterial' { + import { Material } from "wonder.js/dist/es2015/material/Material"; + import { Shader } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + export abstract class EngineMaterial extends Material { + init(): void; + protected addShaderLib(): void; + protected createShader(): Shader; + } +} + +declare module 'wonder.js/dist/es2015/material/Material' { + import { Color } from "wonder.js/dist/es2015/structure/Color"; + import { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { Shader } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + export abstract class Material { + readonly program: Program; + color: Color; + readonly shader: Shader; + geometry: Geometry; + clone(): this; + initWhenCreate(): void; + init(): void; + dispose(): void; + updateShader(quadCmd: QuadCommand): void; + protected abstract createShader(): Shader; + } +} + +declare module 'wonder.js/dist/es2015/material/ShaderManager' { + import { Material } from "wonder.js/dist/es2015/material/Material"; + import { Shader } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + export class ShaderManager { + static create(material: Material): ShaderManager; + constructor(material: Material); + readonly shader: Shader; + setShader(shader: Shader): void; + init(): void; + dispose(): void; + update(quadCmd: QuadCommand): void; + } +} + +declare module 'wonder.js/dist/es2015/material/StandardBasicMaterial' { + import { EngineMaterial } from "wonder.js/dist/es2015/material/EngineMaterial"; + export abstract class StandardBasicMaterial extends EngineMaterial { + opacity: number; + alphaTest: number; + protected addExtendShaderLib(): void; + protected addShaderLib(): void; + } +} + +declare module 'wonder.js/dist/es2015/math/Global' { + export const DEG_TO_RAD: number; + export const RAD_TO_DEG: number; +} + +declare module 'wonder.js/dist/es2015/math/Matrix3' { + import { Vector2 } from "wonder.js/dist/es2015/math/Vector2"; + export class Matrix3 { + static create(mat: Float32Array): Matrix3; + static create(): Matrix3; + constructor(mat: Float32Array); + constructor(); + a: number; + c: number; + b: number; + d: number; + tx: number; + ty: number; + values: Float32Array; + setIdentity(): Matrix3; + invert(): Matrix3; + multiplyScalar(s: number): this; + multiplyVector2(vector: Vector2): Vector2; + multiplyPoint(vector: Vector2): Vector2; + multiply(matrix: Matrix3): this; + transpose(): Matrix3; + clone(): Matrix3; + cloneToArray(array: Float32Array, offset?: number): Matrix3; + set(matrix: Matrix3): this; + setTS(t: Vector2, s: Vector2): void; + rotate(angle: number): this; + setRotation(angle: number): this; + translate(x: number, y: number): void; + setPosition(x: number, y: number): void; + scale(x: number, y: number): this; + setScale(x: number, y: number): this; + getTranslation(): Vector2; + getScale(): Vector2; + getRotation(): number; + getSkew(): Vector2; + } +} + +declare module 'wonder.js/dist/es2015/math/Matrix4' { + import { Matrix3 } from "wonder.js/dist/es2015/math/Matrix3"; + import { Vector3 } from "wonder.js/dist/es2015/math/Vector3"; + import { Vector4 } from "wonder.js/dist/es2015/math/Vector4"; + import { Quaternion } from "wonder.js/dist/es2015/math/Quaternion"; + export class Matrix4 { + static create(mat: Float32Array): Matrix4; + static create(): Matrix4; + constructor(mat: Float32Array); + constructor(); + values: Float32Array; + push(): void; + pop(): void; + set(initialM11: number, initialM12: number, initialM13: number, initialM14: number, initialM21: number, initialM22: number, initialM23: number, initialM24: number, initialM31: number, initialM32: number, initialM33: number, initialM34: number, initialM41: number, initialM42: number, initialM43: number, initialM44: number): any; + set(matrix: Matrix4): any; + setIdentity(): Matrix4; + invert(): Matrix4; + invertTo3x3(): Matrix3; + transpose(): Matrix4; + setTranslate(x: any, y: any, z: any): Matrix4; + translate(x: any, y: any, z: any): Matrix4; + setRotate(angle: number, x: number, y: number, z: number): Matrix4; + rotate(angle: any, vector3: Vector3): Matrix4; + rotate(angle: any, x: any, y: any, z: any): Matrix4; + setScale(x: any, y: any, z: any): Matrix4; + scale(x: any, y: any, z: any): Matrix4; + setLookAt(eye: Vector3, center: Vector3, up: Vector3): Matrix4; + setLookAt(eyeX: number, eyeY: number, eyeZ: number, centerX: number, centerY: number, centerZ: number, upX: number, upY: number, upZ: number): Matrix4; + lookAt(eye: Vector3, center: Vector3, up: Vector3): Matrix4; + lookAt(eyeX: number, eyeY: number, eyeZ: number, centerX: number, centerY: number, centerZ: number, upX: number, upY: number, upZ: number): Matrix4; + setOrtho(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4; + ortho(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4; + setPerspective(fovy: number, aspect: number, near: number, far: number): Matrix4; + perspective(fovy: number, aspect: number, near: number, far: number): Matrix4; + applyMatrix(other: Matrix4, notChangeSelf?: boolean): Matrix4; + multiply(matrix: Matrix4): Matrix4; + multiply(matrix1: Matrix4, matrix2: Matrix4): Matrix4; + multiplyVector4(vector: Vector4): Vector4; + multiplyVector3(vector: Vector3): Vector3; + multiplyPoint(vector: Vector3): Vector3; + clone(): Matrix4; + cloneToArray(array: Float32Array, offset?: number): Matrix4; + getX(): Vector3; + getY(): Vector3; + getZ(): Vector3; + getTranslation(): Vector3; + getScale(): Vector3; + getRotation(): Quaternion; + getEulerAngles(): any; + setTRS(t: Vector3, r: Quaternion, s: Vector3): this; + } +} + +declare module 'wonder.js/dist/es2015/math/Quaternion' { + import { Vector3 } from "wonder.js/dist/es2015/math/Vector3"; + import { Matrix4 } from "wonder.js/dist/es2015/math/Matrix4"; + export class Quaternion { + static create(x?: number, y?: number, z?: number, w?: number): Quaternion; + constructor(x?: number, y?: number, z?: number, w?: number); + x: number; + y: number; + z: number; + w: number; + setFromEulerAngles(eulerAngles: Vector3): this; + multiply(rhs: Quaternion): any; + multiply(rhs1: Quaternion, rhs2: Quaternion): any; + setFromMatrix(matrix: Matrix4): this; + setFromAxisAngle(angle: number, axis: Vector3): this; + invert(): this; + conjugate(): this; + clone(): Quaternion; + normalize(): this; + length(): any; + multiplyVector3(vector: Vector3): Vector3; + set(x: number, y: number, z: number, w: number): void; + sub(quat: Quaternion): this; + getEulerAngles(): any; + slerp(left: Quaternion, right: Quaternion, amount: number): Quaternion; + } +} + +declare module 'wonder.js/dist/es2015/math/Vector2' { + export class Vector2 { + static create(x: any, y: any): Vector2; + static create(): Vector2; + constructor(x: any, y: any); + constructor(); + x: number; + y: number; + values: Float32Array; + set(x: number, y: number): void; + add(v: Vector2): this; + mul(v: Vector2): this; + isEqual(v: Vector2): boolean; + clone(): Vector2; + } +} + +declare module 'wonder.js/dist/es2015/math/Vector3' { + import { Vector4 } from "wonder.js/dist/es2015/math/Vector4"; + import { Matrix3 } from "wonder.js/dist/es2015/math/Matrix3"; + import { Matrix4 } from "wonder.js/dist/es2015/math/Matrix4"; + export class Vector3 { + static up: any; + static forward: any; + static right: any; + static create(x: number, y: number, z: number): Vector3; + static create(): Vector3; + constructor(x: number, y: number, z: number); + constructor(); + x: number; + y: number; + z: number; + values: Float32Array; + normalize(): Vector3; + isZero(): boolean; + scale(scalar: number): any; + scale(x: number, y: number, z: number): any; + set(v: Vector3): any; + set(x: number, y: number, z: number): any; + sub(v: Vector3): Vector3; + sub2(v1: Vector3, v2: Vector3): this; + add(v: Vector3): this; + add2(v1: Vector3, v2: Vector3): this; + mul(v: Vector3): this; + mul2(v1: Vector3, v2: Vector3): this; + reverse(): Vector3; + clone(): Vector3; + toVector4(): Vector4; + length(): any; + cross(lhs: Vector3, rhs: Vector3): this; + lerp(lhs: Vector3, rhs: Vector3, alpha: number): this; + dot(rhs: any): number; + calAngleCos(v1: Vector3): number; + min(v: Vector3): this; + max(v: Vector3): this; + isEqual(v: Vector3): boolean; + toArray(): number[]; + applyMatrix3(m: Matrix3): this; + applyMatrix4(m: Matrix4): this; + distanceTo(v: Vector3): any; + distanceToSquared(v: Vector3): number; + } +} + +declare module 'wonder.js/dist/es2015/math/Vector4' { + import { Vector3 } from "wonder.js/dist/es2015/math/Vector3"; + export class Vector4 { + static create(x: any, y: any, z: any, w: any): any; + static create(): any; + constructor(x: any, y: any, z: any, w: any); + constructor(); + x: number; + y: number; + z: number; + w: number; + values: Float32Array; + normalize(): Vector4; + isEqual(v: Vector4): boolean; + clone(): Vector4; + toVector3(): Vector3; + lengthManhattan(): any; + multiplyScalar(scalar: number): this; + dot(v: Vector4): number; + set(x: number, y: number, z: number, w: number): void; + protected copyHelper(vector4: Vector4): any; + } +} + +declare module 'wonder.js/dist/es2015/renderer/buffer/ArrayBuffer' { + import { CommonBuffer } from "wonder.js/dist/es2015/renderer/buffer/CommonBuffer"; + import { EBufferType } from "wonder.js/dist/es2015/renderer/buffer/EBufferType"; + import { EBufferUsage } from "wonder.js/dist/es2015/renderer/buffer/EBufferUsage"; + export class ArrayBuffer extends CommonBuffer { + static create(data: Array, size: number, type?: EBufferType, usage?: EBufferUsage): ArrayBuffer; + size: number; + data: Float32Array; + initWhenCreate(data: Array, size: number, type: EBufferType, usage: EBufferUsage): any; + resetData(data: Array, size?: number, type?: EBufferType, offset?: number): this; + } +} + +declare module 'wonder.js/dist/es2015/renderer/buffer/Buffer' { + import { Entity } from "wonder.js/dist/es2015/core/Entity"; + export abstract class Buffer extends Entity { + buffer: any; + abstract resetData(data: any, ...args: any[]): void; + dispose(): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/buffer/BufferDataTable' { + import { EBufferDataType } from "wonder.js/dist/es2015/renderer/buffer/EBufferDataType"; + export class BufferDataTable { + static getGeometryDataName(type: EBufferDataType): string; + } +} + +declare module 'wonder.js/dist/es2015/renderer/buffer/CommonBuffer' { + import { Buffer } from "wonder.js/dist/es2015/renderer/buffer/Buffer"; + import { EBufferType } from "wonder.js/dist/es2015/renderer/buffer/EBufferType"; + import { EBufferUsage } from "wonder.js/dist/es2015/renderer/buffer/EBufferUsage"; + export abstract class CommonBuffer extends Buffer { + type: EBufferType; + count: number; + usage: EBufferUsage; + protected resetBufferData(glBufferTargetStr: string, typedData: any, offset?: number): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/buffer/EBufferDataType' { + export enum EBufferDataType { + VERTICE, + INDICE, + } +} + +declare module 'wonder.js/dist/es2015/renderer/buffer/EBufferType' { + export enum EBufferType { + BYTE, + UNSIGNED_BYTE, + SHORT, + UNSIGNED_SHORT, + INT, + UNSIGNED_INT, + FLOAT, + } +} + +declare module 'wonder.js/dist/es2015/renderer/buffer/EBufferUsage' { + export enum EBufferUsage { + STREAM_DRAW, + STATIC_DRAW, + DYNAMIC_DRAW, + } +} + +declare module 'wonder.js/dist/es2015/renderer/buffer/ElementBuffer' { + import { CommonBuffer } from "wonder.js/dist/es2015/renderer/buffer/CommonBuffer"; + import { EBufferType } from "wonder.js/dist/es2015/renderer/buffer/EBufferType"; + import { EBufferUsage } from "wonder.js/dist/es2015/renderer/buffer/EBufferUsage"; + export class ElementBuffer extends CommonBuffer { + static create(data: Array, type?: EBufferType, usage?: EBufferUsage): ElementBuffer; + readonly typeSize: number; + data: Uint16Array | Uint32Array; + initWhenCreate(data: Array, type: EBufferType, usage: EBufferUsage): any; + resetData(data: Array, type?: EBufferType, offset?: number): this; + } +} + +declare module 'wonder.js/dist/es2015/renderer/command/QuadCommand' { + import { RenderCommand } from "wonder.js/dist/es2015/renderer/command/RenderCommand"; + import { Matrix4 } from "wonder.js/dist/es2015/math/Matrix4"; + import { BufferContainer } from "wonder.js/dist/es2015/component/geometry/data/BufferContainer"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + export abstract class QuadCommand extends RenderCommand { + readonly program: Program; + readonly mvpMatrix: Matrix4; + readonly vpMatrix: Matrix4; + mMatrix: Matrix4; + vMatrix: Matrix4; + pMatrix: Matrix4; + buffers: BufferContainer; + material: Material; + target: GameObject; + sortId: number; + execute(): void; + protected abstract draw(material: Material): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/command/RenderCommand' { + import { WebGLState } from "wonder.js/dist/es2015/renderer/state/WebGLState"; + import { EDrawMode } from "wonder.js/dist/es2015/renderer/EDrawMode"; + import { ElementBuffer } from "wonder.js/dist/es2015/renderer/buffer/ElementBuffer"; + import { ArrayBuffer } from "wonder.js/dist/es2015/renderer/buffer/ArrayBuffer"; + export abstract class RenderCommand { + webglState: WebGLState; + drawMode: EDrawMode; + abstract execute(): void; + init(): void; + dispose(): void; + protected drawElements(indexBuffer: ElementBuffer): void; + protected drawArray(vertexBuffer: ArrayBuffer): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/command/SingleDrawCommand' { + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { Matrix3 } from "wonder.js/dist/es2015/math/Matrix3"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + export class SingleDrawCommand extends QuadCommand { + static create(): SingleDrawCommand; + normalMatrix: Matrix3; + protected draw(material: Material): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/EDrawMode' { + export enum EDrawMode { + POINTS, + LINES, + LINE_LOOP, + LINE_STRIP, + TRIANGLES, + TRIANGLE_STRIP, + TRANGLE_FAN, + } +} + +declare module 'wonder.js/dist/es2015/renderer/GlUtils' { + export class GlUtils { + static drawElements(mode: any, count: number, type: any, offset: number): void; + static drawArrays(mode: any, first: number, count: number): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/program/GLSLDataSender' { + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { ArrayBuffer } from "wonder.js/dist/es2015/renderer/buffer/ArrayBuffer"; + import { Color } from "wonder.js/dist/es2015/structure/Color"; + import { Matrix3 } from "wonder.js/dist/es2015/math/Matrix3"; + import { Matrix4 } from "wonder.js/dist/es2015/math/Matrix4"; + export class GLSLDataSender { + static create(program: Program): GLSLDataSender; + constructor(program: Program); + sendFloat1(name: string, data: any): void; + sendFloat2(name: string, data: any): void; + sendFloat3(name: string, data: any): void; + sendFloat4(name: string, data: any): void; + sendVector2(name: string, data: any): void; + sendVector3(name: string, data: any): void; + sendVector4(name: string, data: any): void; + sendColor3(name: string, data: Color): void; + sendNum1(name: string, data: number): void; + sendMatrix3(name: string, data: Matrix3): void; + sendMatrix4(name: string, data: Matrix4): void; + sendMatrix4Array(name: string, data: Array | Float32Array): void; + sendSampleArray(name: string, data: Array): void; + getUniformLocation(name: string): any; + addBufferToToSendList(pos: number, buffer: ArrayBuffer): void; + sendAllBufferData(): void; + clearBufferList(): void; + sendBuffer(pos: number, buffer: ArrayBuffer): void; + disableVertexAttribArray(): void; + clearAllCache(): void; + dispose(): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/program/Program' { + import { Entity } from "wonder.js/dist/es2015/core/Entity"; + import { EVariableType } from "wonder.js/dist/es2015/renderer/shader/variable/EVariableType"; + import { ArrayBuffer } from "wonder.js/dist/es2015/renderer/buffer/ArrayBuffer"; + import { Shader } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + export class Program extends Entity { + static create(): Program; + glProgram: any; + use(): void; + getAttribLocation(name: string): any; + getUniformLocation(name: string): any; + sendUniformData(name: string, type: EVariableType, data: any): void; + sendAttributeBuffer(name: string, type: EVariableType, buffer: ArrayBuffer): void; + sendStructureData(name: string, type: EVariableType, data: any): void; + sendFloat1(name: string, data: any): void; + sendFloat2(name: string, data: any): void; + sendFloat3(name: string, data: any): void; + sendFloat4(name: string, data: any): void; + sendVector2(name: string, data: any): void; + sendVector3(name: string, data: any): void; + sendVector4(name: string, data: any): void; + sendColor3(name: string, data: any): void; + sendNum1(name: string, data: any): void; + sendMatrix3(name: string, data: any): void; + sendMatrix4(name: string, data: any): void; + sendMatrix4Array(name: string, data: Float32Array): void; + sendSampleArray(name: string, data: any): void; + sendAllBufferData(): void; + initWithShader(shader: Shader): this; + dispose(): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/renderer/Renderer' { + import { WebGLState } from "wonder.js/dist/es2015/renderer/state/WebGLState"; + import { RenderCommand } from "wonder.js/dist/es2015/renderer/command/RenderCommand"; + export abstract class Renderer { + webglState: WebGLState; + abstract addCommand(command: RenderCommand): void; + abstract hasCommand(): boolean; + abstract render(): void; + abstract clear(): void; + init(): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/renderer/WebGLRenderer' { + import { Renderer } from "wonder.js/dist/es2015/renderer/renderer/Renderer"; + import { RenderCommand } from "wonder.js/dist/es2015/renderer/command/RenderCommand"; + import { Color } from "wonder.js/dist/es2015/structure/Color"; + export class WebGLRenderer extends Renderer { + static create(): WebGLRenderer; + addCommand(command: RenderCommand): void; + hasCommand(): boolean; + clear(): void; + render(): void; + init(): void; + setClearColor(color: Color): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/lib/basic/BasicMaterialColorShaderLib' { + import { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { BasicMaterial } from "wonder.js/dist/es2015/material/BasicMaterial"; + import { GLSLChunk } from "wonder.js/dist/es2015/renderer/shader/chunk/ShaderChunk"; + export class BasicMaterialColorShaderLib extends EngineShaderLib { + static create(): BasicMaterialColorShaderLib; + vsChunk: GLSLChunk; + fsChunk: GLSLChunk; + sendShaderVariables(program: Program, cmd: QuadCommand, material: BasicMaterial): void; + setShaderDefinition(cmd: QuadCommand, material: BasicMaterial): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/lib/basic/BasicShaderLib' { + import { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { BasicMaterial } from "wonder.js/dist/es2015/material/BasicMaterial"; + import { GLSLChunk } from "wonder.js/dist/es2015/renderer/shader/chunk/ShaderChunk"; + export class BasicShaderLib extends EngineShaderLib { + static create(): BasicShaderLib; + vsChunk: GLSLChunk; + fsChunk: GLSLChunk; + sendShaderVariables(program: Program, cmd: QuadCommand, material: BasicMaterial): void; + setShaderDefinition(cmd: QuadCommand, material: BasicMaterial): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/lib/basic/EndBasicShaderLib' { + import { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { StandardBasicMaterial } from "wonder.js/dist/es2015/material/StandardBasicMaterial"; + import { GLSLChunk } from "wonder.js/dist/es2015/renderer/shader/chunk/ShaderChunk"; + export class EndBasicShaderLib extends EngineShaderLib { + static create(): EndBasicShaderLib; + vsChunk: GLSLChunk; + fsChunk: GLSLChunk; + setShaderDefinition(cmd: QuadCommand, material: StandardBasicMaterial): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/lib/common/CommonShaderLib' { + import { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { EngineMaterial } from "wonder.js/dist/es2015/material/EngineMaterial"; + import { GLSLChunk } from "wonder.js/dist/es2015/renderer/shader/chunk/ShaderChunk"; + export class CommonShaderLib extends EngineShaderLib { + static create(): CommonShaderLib; + vsChunk: GLSLChunk; + fsChunk: GLSLChunk; + sendShaderVariables(program: Program, cmd: QuadCommand, material: EngineMaterial): void; + setShaderDefinition(cmd: QuadCommand, material: EngineMaterial): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/lib/common/EndShaderLib' { + import { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { EngineMaterial } from "wonder.js/dist/es2015/material/EngineMaterial"; + import { GLSLChunk } from "wonder.js/dist/es2015/renderer/shader/chunk/ShaderChunk"; + export class EndShaderLib extends EngineShaderLib { + static create(): EndShaderLib; + vsChunk: GLSLChunk; + fsChunk: GLSLChunk; + sendShaderVariables(program: Program, cmd: QuadCommand, material: EngineMaterial): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/lib/common/VerticeCommonShaderLib' { + import { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { EngineMaterial } from "wonder.js/dist/es2015/material/EngineMaterial"; + import { GLSLChunk } from "wonder.js/dist/es2015/renderer/shader/chunk/ShaderChunk"; + export class VerticeCommonShaderLib extends EngineShaderLib { + static create(): VerticeCommonShaderLib; + vsChunk: GLSLChunk; + fsChunk: GLSLChunk; + sendShaderVariables(program: Program, cmd: QuadCommand, material: EngineMaterial): void; + setShaderDefinition(cmd: QuadCommand, material: EngineMaterial): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib' { + import { ShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/ShaderLib"; + import { EngineShader } from "wonder.js/dist/es2015/renderer/shader/shader/EngineShader"; + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + import { ShaderVariable } from "wonder.js/dist/es2015/renderer/shader/variable/VariableLib"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { RenderCommand } from "wonder.js/dist/es2015/renderer/command/RenderCommand"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { GLSLChunk } from "wonder.js/dist/es2015/renderer/shader/chunk/ShaderChunk"; + export abstract class EngineShaderLib extends ShaderLib { + shader: EngineShader; + abstract vsChunk: GLSLChunk; + abstract fsChunk: GLSLChunk; + attributes: Hash; + uniforms: Hash; + vsSourceTop: string; + vsSourceDefine: string; + vsSourceVarDeclare: string; + vsSourceFuncDeclare: string; + vsSourceFuncDefine: string; + vsSourceBody: string; + vsSource: string; + fsSourceTop: string; + fsSourceDefine: string; + fsSourceVarDeclare: string; + fsSourceFuncDeclare: string; + fsSourceFuncDefine: string; + fsSourceBody: string; + fsSource: string; + vsSourceDefineList: Collection; + fsSourceDefineList: Collection; + vsSourceExtensionList: Collection; + fsSourceExtensionList: Collection; + setShaderDefinition(cmd: RenderCommand, material: Material): void; + protected sendAttributeBuffer(program: Program, name: string, data: any): void; + protected sendUniformData(program: Program, name: string, data: any): void; + protected getVsChunk(): any; + protected getVsChunk(chunk: GLSLChunk): any; + protected getFsChunk(): any; + protected getFsChunk(chunk: GLSLChunk): any; + protected setVsSource(vs: GLSLChunk | string, operator?: string): void; + protected setFsSource(fs: GLSLChunk | string, operator?: string): void; + protected addAttributeVariable(variableArr: Array): void; + protected addUniformVariable(variableArr: Array): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/lib/ShaderLib' { + import { Shader } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { RenderCommand } from "wonder.js/dist/es2015/renderer/command/RenderCommand"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + export abstract class ShaderLib { + shader: Shader; + sendShaderVariables(program: Program, cmd: RenderCommand, material: Material): void; + init(): void; + dispose(): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/shader/CommonShader' { + import { EngineShader } from "wonder.js/dist/es2015/renderer/shader/shader/EngineShader"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + export class CommonShader extends EngineShader { + static create(): CommonShader; + update(cmd: QuadCommand, material: Material): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/shader/EngineShader' { + import { Shader } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + import { EngineShaderSourceBuilder } from "wonder.js/dist/es2015/renderer/shader/sourceBuilder/EngineShaderSourceBuilder"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + import { RenderCommand } from "wonder.js/dist/es2015/renderer/command/RenderCommand"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + import { ShaderSourceBuilder } from "wonder.js/dist/es2015/renderer/shader/sourceBuilder/ShaderSourceBuilder"; + export abstract class EngineShader extends Shader { + protected sourceBuilder: EngineShaderSourceBuilder; + protected libs: Collection; + protected buildDefinitionData(cmd: RenderCommand, material: Material): void; + protected createShaderSourceBuilder(): ShaderSourceBuilder; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/shader/Shader' { + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { ShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/ShaderLib"; + import { ShaderSourceBuilder } from "wonder.js/dist/es2015/renderer/shader/sourceBuilder/ShaderSourceBuilder"; + import { RenderCommand } from "wonder.js/dist/es2015/renderer/command/RenderCommand"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + import { EVariableType } from "wonder.js/dist/es2015/renderer/shader/variable/EVariableType"; + export abstract class Shader { + attributes: Hash; + uniforms: Hash; + vsSource: string; + fsSource: string; + readonly dirty: boolean; + readonly program: Program; + libDirty: boolean; + definitionDataDirty: boolean; + protected libs: Collection; + protected sourceBuilder: ShaderSourceBuilder; + abstract update(cmd: RenderCommand, material: Material): any; + createVsShader(): any; + createFsShader(): any; + init(material: Material): void; + dispose(): void; + hasLib(lib: ShaderLib): any; + hasLib(_class: Function): any; + addLib(lib: ShaderLib): void; + addShaderLibToTop(lib: ShaderLib): void; + getLib(libClass: Function): ShaderLib; + getLibs(): Collection; + removeLib(lib: ShaderLib): any; + removeLib(func: Function): any; + removeAllLibs(): void; + sortLib(func: (a: ShaderLib, b: ShaderLib) => any): void; + protected abstract createShaderSourceBuilder(): ShaderSourceBuilder; + protected abstract buildDefinitionData(cmd: RenderCommand, material: Material): void; + protected judgeRefreshShader(cmd: RenderCommand, material: Material): void; + } + export type ShaderData = { + type: EVariableType; + value?: any; + textureId?: string; + }; +} + +declare module 'wonder.js/dist/es2015/renderer/shader/sourceBuilder/EngineShaderSourceBuilder' { + import { ShaderSourceBuilder, SourceDefine } from "wonder.js/dist/es2015/renderer/shader/sourceBuilder/ShaderSourceBuilder"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + export class EngineShaderSourceBuilder extends ShaderSourceBuilder { + static create(): EngineShaderSourceBuilder; + vsSourceTop: string; + vsSourceDefine: string; + vsSourceVarDeclare: string; + vsSourceFuncDeclare: string; + vsSourceFuncDefine: string; + vsSourceBody: string; + fsSourceTop: string; + fsSourceDefine: string; + fsSourceVarDeclare: string; + fsSourceFuncDeclare: string; + fsSourceFuncDefine: string; + fsSourceBody: string; + vsSourceDefineList: Collection; + fsSourceDefineList: Collection; + vsSourceExtensionList: Collection; + fsSourceExtensionList: Collection; + build(libs: Collection): void; + clearShaderDefinition(): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/sourceBuilder/ShaderSourceBuilder' { + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + import { ShaderData } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + export abstract class ShaderSourceBuilder { + attributes: Hash; + uniforms: Hash; + vsSource: string; + fsSource: string; + abstract build(...args: any[]): void; + abstract clearShaderDefinition(): void; + dispose(): void; + protected convertAttributesData(): void; + } + export type SourceDefine = { + name: string; + value: any; + }; +} + +declare module 'wonder.js/dist/es2015/renderer/shader/variable/EVariableCategory' { + export enum EVariableCategory { + ENGINE, + CUSTOM, + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/variable/EVariableSemantic' { + export enum EVariableSemantic { + POSITION, + NORMAL, + TEXCOORD, + TANGENT, + COLOR, + MODEL, + VIEW, + PROJECTION, + MODEL_VIEW, + MODEL_VIEW_PROJECTION, + MODEL_INVERSE, + VIEW_INVERSE, + PROJECTION_INVERSE, + MODEL_VIEW_INVERSE, + MODEL_VIEW_PROJECTION_INVERSE, + MODEL_INVERSE_TRANSPOSE, + MODEL_VIEW_INVERSE_TRANSPOSE, + VIEWPORT, + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/variable/EVariableType' { + export enum EVariableType { + FLOAT_1, + FLOAT_2, + FLOAT_3, + FLOAT_4, + VECTOR_2, + VECTOR_3, + VECTOR_4, + COLOR_3, + FLOAT_MAT3, + FLOAT_MAT4, + BUFFER, + SAMPLER_CUBE, + SAMPLER_2D, + NUMBER_1, + STRUCTURE, + STRUCTURES, + SAMPLER_ARRAY, + FLOAT_MAT4_ARRAY, + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/variable/VariableLib' { + import { EVariableType } from "wonder.js/dist/es2015/renderer/shader/variable/EVariableType"; + export class VariableLib { + static a_position: ShaderVariable; + static a_positionVec2: ShaderVariable; + static a_currentFramePosition: ShaderVariable; + static a_nextFramePosition: ShaderVariable; + static a_normal: ShaderVariable; + static a_currentFrameNormal: ShaderVariable; + static a_nextFrameNormal: ShaderVariable; + static a_color: ShaderVariable; + static a_texCoord: ShaderVariable; + static a_tangent: ShaderVariable; + static u_color: ShaderVariable; + static u_mMatrix: ShaderVariable; + static u_vMatrix: ShaderVariable; + static u_pMatrix: ShaderVariable; + static u_mvpMatrix: ShaderVariable; + static u_vpMatrix: ShaderVariable; + static u_normalMatrix: ShaderVariable; + static u_samplerCube0: ShaderVariable; + static u_sampler2D0: ShaderVariable; + static u_sampler2D1: ShaderVariable; + static u_lightMapSampler: ShaderVariable; + static u_diffuseMapSampler: ShaderVariable; + static u_diffuseMap1Sampler: ShaderVariable; + static u_diffuseMap2Sampler: ShaderVariable; + static u_diffuseMap3Sampler: ShaderVariable; + static u_specularMapSampler: ShaderVariable; + static u_emissionMapSampler: ShaderVariable; + static u_normalMapSampler: ShaderVariable; + static u_reflectionMapSampler: ShaderVariable; + static u_refractionMapSampler: ShaderVariable; + static u_cameraPos: ShaderVariable; + static u_refractionRatio: ShaderVariable; + static u_reflectivity: ShaderVariable; + static u_map0SourceRegion: ShaderVariable; + static u_map1SourceRegion: ShaderVariable; + static u_diffuseMapSourceRegion: ShaderVariable; + static u_map0RepeatRegion: ShaderVariable; + static u_map1RepeatRegion: ShaderVariable; + static u_diffuseMapRepeatRegion: ShaderVariable; + static u_combineMode: ShaderVariable; + static u_mixRatio: ShaderVariable; + static u_lightMapIntensity: ShaderVariable; + static u_diffuse: ShaderVariable; + static u_specular: ShaderVariable; + static u_emission: ShaderVariable; + static u_shininess: ShaderVariable; + static u_lightModel: ShaderVariable; + static u_isBothSide: ShaderVariable; + static u_opacity: ShaderVariable; + static u_ambient: ShaderVariable; + static u_directionLights: ShaderVariable; + static u_pointLights: ShaderVariable; + static u_vpMatrixFromLight: ShaderVariable; + static u_lightPos: ShaderVariable; + static u_farPlane: ShaderVariable; + static u_interpolation: ShaderVariable; + static u_tilesHeightNumber: ShaderVariable; + static u_tilesWidthNumber: ShaderVariable; + static u_amplitude: ShaderVariable; + static u_jointColor: ShaderVariable; + static u_time: ShaderVariable; + static u_speed: ShaderVariable; + static u_shift: ShaderVariable; + static u_alphaThreshold: ShaderVariable; + static u_fireColor: ShaderVariable; + static u_layerHeightDatas: ShaderVariable; + static u_layerSampler2Ds: ShaderVariable; + static u_herb1Color: ShaderVariable; + static u_herb2Color: ShaderVariable; + static u_herb3Color: ShaderVariable; + static u_groundColor: ShaderVariable; + static u_ampScale: ShaderVariable; + static u_woodColor: ShaderVariable; + static u_roadColor: ShaderVariable; + static u_skyColor: ShaderVariable; + static u_cloudColor: ShaderVariable; + static u_brickColor: ShaderVariable; + static u_waveData: ShaderVariable; + static u_windMatrix: ShaderVariable; + static u_bumpMapSampler: ShaderVariable; + static u_bumpMap1Sampler: ShaderVariable; + static u_bumpMap2Sampler: ShaderVariable; + static u_bumpMap3Sampler: ShaderVariable; + static u_levelData: ShaderVariable; + static a_mVec4_0: ShaderVariable; + static a_mVec4_1: ShaderVariable; + static a_mVec4_2: ShaderVariable; + static a_mVec4_3: ShaderVariable; + static a_normalVec4_0: ShaderVariable; + static a_normalVec4_1: ShaderVariable; + static a_normalVec4_2: ShaderVariable; + static u_isRenderListEmpty: ShaderVariable; + static u_isReflectionRenderListEmpty: ShaderVariable; + static u_isRefractionRenderListEmpty: ShaderVariable; + static u_bitmapSampler: ShaderVariable; + static a_page: ShaderVariable; + static u_pageSampler2Ds: ShaderVariable; + static u_mixMapSampler: ShaderVariable; + static u_diffuseMap1RepeatRegion: ShaderVariable; + static u_diffuseMap2RepeatRegion: ShaderVariable; + static u_diffuseMap3RepeatRegion: ShaderVariable; + static u_grassMapDatas: ShaderVariable; + static a_quadIndex: ShaderVariable; + static u_grassMapSampler: ShaderVariable; + static u_windData: ShaderVariable; + static a_vertexIndex: ShaderVariable; + static u_grassRangeWidth: ShaderVariable; + static u_grassRangeHeight: ShaderVariable; + static u_terrainRangeWidth: ShaderVariable; + static u_terrainRangeHeight: ShaderVariable; + static u_terrainMinHeight: ShaderVariable; + static u_terrainMaxHeight: ShaderVariable; + static u_terrainSubdivisions: ShaderVariable; + static u_terrainScaleY: ShaderVariable; + static u_terrainPositionY: ShaderVariable; + static u_heightMapSampler: ShaderVariable; + static u_lightColor: ShaderVariable; + static a_jointIndice: ShaderVariable; + static a_jointWeight: ShaderVariable; + static u_jointMatrices: ShaderVariable; + } + export type ShaderVariable = { + type: EVariableType; + value: any; + }; +} + +declare module 'wonder.js/dist/es2015/renderer/shader/variable/VariableNameTable' { + export class VariableNameTable { + static getVariableName(name: string): string; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/variable/VariableTypeTable' { + import { EVariableType } from "wonder.js/dist/es2015/renderer/shader/variable/EVariableType"; + export class VariableTypeTable { + static getVariableType(type: EVariableType): string; + } +} + +declare module 'wonder.js/dist/es2015/renderer/state/BasicState' { + import { WebGLState } from "wonder.js/dist/es2015/renderer/state/WebGLState"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + export class BasicState extends WebGLState { + static create(): BasicState; + setState(material: Material): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/state/WebGLState' { + import { Material } from "wonder.js/dist/es2015/material/Material"; + export abstract class WebGLState { + abstract setState(material: Material): void; + } +} + +declare module 'wonder.js/dist/es2015/structure/Color' { + import { Vector3 } from "wonder.js/dist/es2015/math/Vector3"; + export class Color { + static create(colorVal?: string): Color; + dirty: boolean; + r: number; + g: number; + b: number; + a: number; + initWhenCreate(colorVal?: string): void; + toVector3(): Vector3; + toVector4(): any; + toString(): string; + clone(): Color; + isEqual(color: Color): boolean; + } +} + +declare module 'wonder.js/dist/es2015/structure/Face3' { + import { Vector3 } from "wonder.js/dist/es2015/math/Vector3"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export class Face3 { + static create(aIndex: number, bIndex: number, cIndex: number, faceNormal?: Vector3, vertexNormals?: Collection): Face3; + constructor(aIndex: number, bIndex: number, cIndex: number, faceNormal: Vector3, vertexNormals: Collection); + faceNormal: Vector3; + aIndex: number; + bIndex: number; + cIndex: number; + vertexNormals: Collection; + clone(): this; + hasFaceNormal(): boolean; + hasVertexNormal(): boolean; + } +} + +declare module 'wonder.js/dist/es2015/structure/Point' { + export class Point { + x: number; + y: number; + constructor(x?: number, y?: number); + static create(x?: number, y?: number): Point; + } +} + +declare module 'wonder.js/dist/es2015/structure/RectRegion' { + import { Vector4 } from "wonder.js/dist/es2015/math/Vector4"; + export class RectRegion extends Vector4 { + width: number; + height: number; + clone(): RectRegion; + isNotEmpty(): boolean; + } +} + +declare module 'wonder.js/dist/es2015/structure/View' { + import { ContextConfigData } from "wonder.js/dist/es2015/core/data/MainData"; + export class ViewWebGL implements IView { + static create(view: any): ViewWebGL; + constructor(dom: any); + readonly offset: { + x: any; + y: any; + }; + readonly dom: any; + width: number; + height: number; + styleWidth: string; + styleHeight: string; + x: number; + y: number; + initCanvas(): void; + getContext(contextConfig: ContextConfigData): WebGLRenderingContext; + } + export interface IView { + offset: { + x: number; + y: number; + }; + x: number; + y: number; + width: number; + height: number; + styleWidth: string; + styleHeight: string; + dom: any; + getContext(contextConfig: ContextConfigData): WebGLRenderingContext; + initCanvas(): void; + } +} + +declare module 'wonder.js/dist/es2015/utils/ArrayUtils' { + import { ArrayUtils as ArrayUtils$ } from "wonder-commonlib/dist/es2015/utils/ArrayUtils"; + export class ArrayUtils extends ArrayUtils$ { + static hasRepeatItems(arr: Array): boolean; + static contain(arr: Array, item: any): boolean; + } +} + +declare module 'wonder.js/dist/es2015/utils/BufferUtils' { + import { EVariableType } from "wonder.js/dist/es2015/renderer/shader/variable/EVariableType"; + import { ArrayBuffer } from "wonder.js/dist/es2015/renderer/buffer/ArrayBuffer"; + export class BufferUtils { + static convertArrayToArrayBuffer(type: EVariableType, value: Array): ArrayBuffer; + } +} + +declare module 'wonder.js/dist/es2015/utils/ClassUtils' { + export class ClassUtils { + static getClassNameByInstance(obj: any): any; + static addClass(className: string, _class: any): void; + static addClassNameAttributeToClass(className: string, _class: any): void; + static getClass(className: string): any; + } +} + +declare module 'wonder.js/dist/es2015/utils/JudgeUtils' { + import { JudgeUtils as JudgeUtils$ } from "wonder-commonlib/dist/es2015/utils/JudgeUtils"; + import { Entity } from "wonder.js/dist/es2015/core/Entity"; + import { Component } from "wonder.js/dist/es2015/core/Component"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export class JudgeUtils extends JudgeUtils$ { + static isView(obj: any): boolean; + static isEqual(target1: any, target2: any): boolean; + static isPowerOfTwo(value: number): boolean; + static isFloatArray(data: any): boolean; + static isInterface(target: any, memberOfInterface: string): boolean; + static isSelf(self: Entity, entityObject: Entity): boolean; + static isComponenet(component: Component): boolean; + static isDom(obj: any): boolean; + static isCollection(list: Collection): boolean; + static isClass(objInstance: any, className: string): boolean; + } +} + +declare module 'wonder.js/dist/es2015/utils/Log' { + import { Log as Log$ } from "wonder-commonlib/dist/es2015/Log"; + export class Log extends Log$ { + } +} + +declare module 'wonder.js/dist/es2015/utils/MathUtils' { + export class MathUtils { + static clamp(num: number, below: number, up: number): number; + static bigThan(num: number, below: number): number; + static generateZeroToOne(): number; + static generateMinToMax(min: number, max: number): number; + static generateInteger(min: number, max: number): number; + static mod(a: number, b: number): number; + static maxFloorIntegralMultiple(a: number, b: number): number; + } +} + +declare module 'wonder.js/dist/es2015/utils/RenderUtils' { + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + export class RenderUtils { + static getGameObjectRenderList(sourceList: Collection): Collection; + } +} + +declare module 'wonder.js/dist/es2015/utils/ShaderLibUtils' { + import { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + import { Shader } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + export class ShaderLibUtils { + static addVerticeShaderLib(geometry: Geometry, shader: Shader): void; + } +} + +declare module 'wonder.js/dist/es2015/utils/SortUtils' { + export class SortUtils { + static insertSort(targetArr: Array, compareFunc: (a: any, b: any) => boolean, isChangeSelf?: boolean): Array; + static quickSort(targetArr: Array, compareFunc: (a: any, b: any) => boolean, isChangeSelf?: boolean): Array; + } +} + +declare module 'wonder.js/dist/es2015/utils/time/CommonTimeController' { + import { TimeController } from "wonder.js/dist/es2015/utils/time/TimeController"; + export class CommonTimeController extends TimeController { + static create(): CommonTimeController; + protected getNow(): any; + } +} + +declare module 'wonder.js/dist/es2015/utils/time/DirectorTimeController' { + import { TimeController } from "wonder.js/dist/es2015/utils/time/TimeController"; + export class DirectorTimeController extends TimeController { + static create(): DirectorTimeController; + gameTime: number; + fps: number; + isTimeChange: boolean; + deltaTime: number; + tick(time: number): void; + start(): void; + resume(): void; + protected getNow(): any; + } +} + +declare module 'wonder.js/dist/es2015/utils/time/TimeController' { + export abstract class TimeController { + elapsed: number; + pauseElapsed: number; + pauseTime: number; + startTime: number; + start(): void; + stop(): void; + pause(): void; + resume(): void; + computeElapseTime(time: number): number; + protected abstract getNow(): any; + } +} + +declare module 'wonder.js/dist/es2015/config/CompileConfig' { + export var CompileConfig: { + isCompileTest: boolean; + closeContractTest: boolean; + }; +} + +declare module 'wonder.js/dist/es2015/event/interface/IEventData' { + export interface IEventData { + returnValue: boolean; + preventDefault: () => void; + } + export interface IKeyboardEventData extends IEventData { + ctrlKey: number; + altKey: number; + shiftKey: number; + metaKey: number; + keyCode: number; + } + export interface IMouseEventData extends IEventData { + clientX: number; + clientY: number; + pageX: number; + pageY: number; + button: number; + detail?: number; + wheelDelta?: number; + movementX?: number; + webkitMovementX?: number; + mozMovementX?: number; + movementY?: number; + webkitMovementY?: number; + mozMovementY?: number; + target: HTMLElement; + currentTarget: HTMLElement; + } + export interface ITouchEventData extends IEventData { + touches: Array; + changedTouches: Array; + targetTouches: Array; + target: HTMLElement; + currentTarget: HTMLElement | null; + } + export interface ITouchData { + clientX: number; + clientY: number; + identifier: number; + pageX: number; + pageY: number; + screenX: number; + screenY: number; + radiusX: number; + radiusY: number; + rotationAngle: number; + force: number; + target: HTMLElement; + } + export interface IPointEventData extends IEventData { + clientX: number; + clientY: number; + pageX: number; + pageY: number; + button?: number; + detail?: number; + wheelDelta?: number; + movementX?: number; + webkitMovementX?: number; + mozMovementX?: number; + movementY?: number; + webkitMovementY?: number; + mozMovementY?: number; + target: HTMLElement; + currentTarget: HTMLElement | null; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/chunk/ShaderChunk' { + export const empty: GLSLChunk; + export const NULL: number; + export const basic_materialColor_fragment: GLSLChunk; + export const end_basic_fragment: GLSLChunk; + export const common_define: GLSLChunk; + export const common_fragment: GLSLChunk; + export const common_function: GLSLChunk; + export const common_vertex: GLSLChunk; + export const highp_fragment: GLSLChunk; + export const lowp_fragment: GLSLChunk; + export const mediump_fragment: GLSLChunk; + export type GLSLChunk = { + top?: string; + define?: string; + varDeclare?: string; + funcDeclare?: string; + funcDefine?: string; + body?: string; + }; +} + diff --git a/wonder.js/tsconfig.json b/wonder.js/tsconfig.json new file mode 100644 index 0000000000..0fdebb2ebc --- /dev/null +++ b/wonder.js/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "wonder.js-tests.ts" + ] +} \ No newline at end of file diff --git a/wonder.js/wonder.js-tests.ts b/wonder.js/wonder.js-tests.ts new file mode 100644 index 0000000000..eb486e6a48 --- /dev/null +++ b/wonder.js/wonder.js-tests.ts @@ -0,0 +1,4 @@ +import {Director} from "wonder.js/dist/es2015/core/Director"; + +console.log(Director.getInstance()); + From afb8c9e50ae5a062181b7e705e51900e226a745f Mon Sep 17 00:00:00 2001 From: Karol Janyst Date: Fri, 10 Mar 2017 16:37:16 +0900 Subject: [PATCH 068/276] Add boolean to value types (#14874) --- react-select/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react-select/index.d.ts b/react-select/index.d.ts index c011b78e0e..beed5858ff 100644 --- a/react-select/index.d.ts +++ b/react-select/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-select v1.0.0 +// Type definitions for react-select 1.0 // Project: https://github.com/JedWatson/react-select // Definitions by: ESQUIBET Hugo , Gilad Gray , Izaak Baker , Tadas Dailyda , Mark Vujevits , Mike Deverell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -23,7 +23,7 @@ declare namespace ReactSelectClass { /** Text for rendering */ label?: string; /** Value for searching */ - value?: string | number; + value?: string | number | boolean; /** * Allow this option to be cleared * @default true From a971970e9309319a194bad5962a47a526907ee75 Mon Sep 17 00:00:00 2001 From: Umar Nizamani Date: Fri, 10 Mar 2017 08:37:58 +0100 Subject: [PATCH 069/276] Updated Cheerio definitions to 0.22 (#14878) --- cheerio/cheerio-tests.ts | 8 ++++++++ cheerio/index.d.ts | 14 ++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/cheerio/cheerio-tests.ts b/cheerio/cheerio-tests.ts index 5b1f6511ec..1c0848eef7 100644 --- a/cheerio/cheerio-tests.ts +++ b/cheerio/cheerio-tests.ts @@ -55,6 +55,10 @@ var $multiEl = $('selector', 'selector', 'selector'); $el.attr('id'); $el.attr('id', 'favorite').html(); +// props +$el.prop('style') +$el.prop('style', 'none').html() + // data $el.data(); $el.data('apple-color'); @@ -86,6 +90,7 @@ $el.is(() => { */ // serializeArray $('
    ').serializeArray(); +$('
    ').serialize(); /** * Traversing @@ -217,6 +222,9 @@ $el.eq(0).addBack('.class').length * Manipulation */ +$('
  • Plum
  • ').appendTo($el) +$el.prependTo($('
  • Plum
  • ')) + // .append( content, [content, ...] ) $el.append('
  • Plum
  • ').html(); $el.append('
  • Plum
  • ', '
  • Plum
  • ').html(); diff --git a/cheerio/index.d.ts b/cheerio/index.d.ts index e94eb1a68c..f3615674f5 100644 --- a/cheerio/index.d.ts +++ b/cheerio/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Cheerio v0.17.0 +// Type definitions for Cheerio v0.22.0 // Project: https://github.com/cheeriojs/cheerio -// Definitions by: Bret Little , VILIC VANE , Wayne Maurer +// Definitions by: Bret Little , VILIC VANE , Wayne Maurer , Umar Nizamani // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface Cheerio { @@ -47,10 +47,11 @@ interface Cheerio { is(func: (index: number, element: CheerioElement) => boolean): boolean; // Form + serialize(): string; serializeArray(): {name: string, value: string}[]; // Traversing - + find(selector: string): Cheerio; find(element: Cheerio): Cheerio; @@ -60,6 +61,9 @@ interface Cheerio { parentsUntil(element: CheerioElement, filter?: string): Cheerio; parentsUntil(element: Cheerio, filter?: string): Cheerio; + prop(name: string): any; + prop(name: string, value: any): Cheerio; + closest(): Cheerio; closest(selector: string): Cheerio; @@ -126,6 +130,8 @@ interface Cheerio { addBack(filter: string):Cheerio; // Manipulation + appendTo(target: Cheerio) : Cheerio + prependTo(target: Cheerio) : Cheerio append(content: string, ...contents: any[]): Cheerio; append(content: Document, ...contents: any[]): Cheerio; @@ -266,4 +272,4 @@ declare var cheerio:CheerioAPI; declare module "cheerio" { export = cheerio; -} +} \ No newline at end of file From 8d1cf56e258d0f4a25f564fc6e82fdd305a3f16a Mon Sep 17 00:00:00 2001 From: Christian Kotzbauer Date: Fri, 10 Mar 2017 08:38:54 +0100 Subject: [PATCH 070/276] updated extended-listbox to 2.0.0 (#14879) --- extended-listbox/extended-listbox-tests.ts | 54 +--------------------- extended-listbox/index.d.ts | 37 +-------------- 2 files changed, 2 insertions(+), 89 deletions(-) diff --git a/extended-listbox/extended-listbox-tests.ts b/extended-listbox/extended-listbox-tests.ts index 0ca2f862b1..dfa51ffebf 100644 --- a/extended-listbox/extended-listbox-tests.ts +++ b/extended-listbox/extended-listbox-tests.ts @@ -1,5 +1,4 @@ - - +/// var $test = $("#test"); @@ -126,54 +125,3 @@ instance.onItemEnterPressed((event: ListboxEvent) => { instance.onItemDoubleClicked((event: ListboxEvent) => { console.log(event.args); }); - - - -/////// LEGACY API /////// - -// Add string item -instance.target.listbox("addItem", "Test2"); - - -// Add item -var item: ListboxItem = {}; -item.selected = true; -item.disabled = false; -item.childItems = ["Test4"]; -item.groupHeader = false; -item.id = "ouetioreit"; -item.index = 0; -item.text = "Test3"; -var id: string = instance.target.listbox("addItem", item); - - -// Remove item -instance.target.listbox("removeItem", id); - - -// Get item -var i: ListboxItem = instance.target.listbox("getItem", id); - - -// Get items -var allItems: ListboxItem[] = instance.target.listbox("getItems"); - - -// Move item up -var newIndex: number = instance.target.listbox("moveItemUp", i.id); - - -// Move item down -newIndex = instance.target.listbox("moveItemDown", i.id); - - -// Clear selection -instance.target.listbox("clearSelection"); - - -// Enable -instance.target.listbox("enable", false); - - -// Destroy -instance.target.listbox("destroy"); diff --git a/extended-listbox/index.d.ts b/extended-listbox/index.d.ts index eb5f0eec04..3f3527b903 100644 --- a/extended-listbox/index.d.ts +++ b/extended-listbox/index.d.ts @@ -1,10 +1,8 @@ -// Type definitions for extended-listbox 1.1.x +// Type definitions for extended-listbox 2.0.x // Project: https://github.com/code-chris/extended-listbox // Definitions by: Christian Kotzbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - interface ListboxItem { /** display text */ text?: string; @@ -147,37 +145,4 @@ interface JQuery { /** constructs a new instance of Listbox on the given DOM item */ listbox(options: ListBoxOptions): ExtendedListboxInstance|ExtendedListboxInstance[]; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'addItem'): string; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'removeItem'): void; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'destroy'): void; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'getItem'): ListboxItem; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'getItems'): ListboxItem[]; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'moveItemUp'): number; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'moveItemDown'): number; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'clearSelection'): void; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'enable'): void; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: string): any; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: string, methodParameter: any): any; } From ea797116776923778906e56929b626727e09bdf4 Mon Sep 17 00:00:00 2001 From: Christian Kotzbauer Date: Fri, 10 Mar 2017 08:39:31 +0100 Subject: [PATCH 071/276] Added aurelia-knockout 2.0.0 (#14880) * added aurelia-knockout 2.0.0 * fixed tslint errors in aurelia-knockout --- aurelia-knockout/aurelia-knockout-tests.ts | 11 +++++++++++ aurelia-knockout/index.d.ts | 19 ++++++++++++++++++ aurelia-knockout/tsconfig.json | 23 ++++++++++++++++++++++ aurelia-knockout/tslint.json | 1 + 4 files changed, 54 insertions(+) create mode 100644 aurelia-knockout/aurelia-knockout-tests.ts create mode 100644 aurelia-knockout/index.d.ts create mode 100644 aurelia-knockout/tsconfig.json create mode 100644 aurelia-knockout/tslint.json diff --git a/aurelia-knockout/aurelia-knockout-tests.ts b/aurelia-knockout/aurelia-knockout-tests.ts new file mode 100644 index 0000000000..6944ab5889 --- /dev/null +++ b/aurelia-knockout/aurelia-knockout-tests.ts @@ -0,0 +1,11 @@ + +export class ViewModel { + + constructor(private knockoutBindable: KnockoutBindable) { + } + + activate(settings: any): void { + this.knockoutBindable.applyBindableValues(settings, this); + this.knockoutBindable.applyBindableValues(settings, this, true); + } +} diff --git a/aurelia-knockout/index.d.ts b/aurelia-knockout/index.d.ts new file mode 100644 index 0000000000..2ccec60b46 --- /dev/null +++ b/aurelia-knockout/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for aurelia-knockout 2.0 +// Project: https://github.com/code-chris/aurelia-knockout +// Definitions by: Christian Kotzbauer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare interface KnockoutBindable { + + /** + * Applys all values from a data object (usually the activation data) to the corresponding instance fields + * in the current view model if they are marked as @bindable. By default all matching values from the data object + * are applied. To only apply observable values set the last parameter to `true`. Subscriptions are created + * for all Knockout observables in the data object to update the view-model values respectively. + * + * @param data - the data object + * @param target - the target view model + * @param applyOnlyObservables - `true` if only observable values should be applied, false by default. + */ + applyBindableValues(data: any, target: any, applyOnlyObservables?: boolean): void; +} diff --git a/aurelia-knockout/tsconfig.json b/aurelia-knockout/tsconfig.json new file mode 100644 index 0000000000..aa45dc1157 --- /dev/null +++ b/aurelia-knockout/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "aurelia-knockout-tests.ts" + ] +} diff --git a/aurelia-knockout/tslint.json b/aurelia-knockout/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/aurelia-knockout/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 79246be8c7c62b02adcc42cd88d05f9d2186158f Mon Sep 17 00:00:00 2001 From: Wayne Date: Fri, 10 Mar 2017 02:40:14 -0500 Subject: [PATCH 072/276] Add declaration for csvtojson (#14881) * Added declaration for csvtojson * Updated indent formatting to meet DT standards * Fixed tslint issues * Fixed issue with Converter class incorrectly extending Transform --- csvtojson/csvtojson-tests.ts | 114 +++++++++++++++ csvtojson/index.d.ts | 276 +++++++++++++++++++++++++++++++++++ csvtojson/tsconfig.json | 22 +++ csvtojson/tslint.json | 1 + 4 files changed, 413 insertions(+) create mode 100644 csvtojson/csvtojson-tests.ts create mode 100644 csvtojson/index.d.ts create mode 100644 csvtojson/tsconfig.json create mode 100644 csvtojson/tslint.json diff --git a/csvtojson/csvtojson-tests.ts b/csvtojson/csvtojson-tests.ts new file mode 100644 index 0000000000..4368d00494 --- /dev/null +++ b/csvtojson/csvtojson-tests.ts @@ -0,0 +1,114 @@ +import csv = require('csvtojson'); +import fs = require('fs'); + +// From documentation on project home page -> https://github.com/Keyang/node-csvtojson + +///////////////////////////// +// From CSV String +const csvStr: string = `1,2,3 +4,5,6 +7,8,9`; + +// event emitter version using factory function +csv({ noheader: true }) + .fromString(csvStr) + .on('csv', (csvRow: string[]) => { // this func will be called 3 times + console.log(csvRow); // => [1,2,3] , [4,5,6] , [7,8,9] + }) + .on('done', () => { + //parsing finished + }); + +// event emitter version using Converter class +new csv.Converter({ noheader: true }) + .fromString(csvStr) + .on('csv', (csvRow: string[]) => { // this func will be called 3 times + console.log(csvRow); // => [1,2,3] , [4,5,6] , [7,8,9] + }) + .on('done', () => { + //parsing finished + }); + +// callback version using Converter class +new csv.Converter({ noheader: true }) + .fromString(csvStr, (err, result) => { + console.log(JSON.stringify(result)); + }); + +// callback version using factory function +csv({ noheader: true }) + .fromString(csvStr, (err, result) => { + console.log(JSON.stringify(result)); + }); + +///////////////////////////// +// From CSV File +const filePath = './test.csv'; + +// event emitter version using factory function +csv() + .fromFile(filePath) + .on('json', (jsonObj: any) => { + console.log(JSON.stringify(jsonObj)); + }) + .on('done', (error: any) => { + console.log('end'); + }); + +// event emitter version using Converter class +new csv.Converter() + .fromFile(filePath) + .on('json', (jsonObj: any) => { + console.log(JSON.stringify(jsonObj)); + }) + .on('done', (error: any) => { + console.log('end'); + }); + +// callback version using factory function +csv() + .fromFile(filePath, (err, result) => { + console.log(JSON.stringify(result)); + }); + +// callback version using Converter class +new csv.Converter() + .fromFile(filePath, (err, result) => { + console.log(JSON.stringify(result)); + }); + +///////////////////////////// +// From CSV Stream + +const stream = fs.createReadStream(filePath); + +// event emitter version using factory function +csv().fromStream(stream) + .on('json', (jsonObj: any) => { + console.log(JSON.stringify(jsonObj)); + }) + .on('done', (error: any) => { + console.log('end'); + }); + +// event emitter version using Converter class +new csv.Converter() + .fromStream(stream) + .on('json', (jsonObj: any) => { + console.log(JSON.stringify(jsonObj)); + }) + .on('done', (error: any) => { + console.log('end'); + }); + +// callback version using factory function +csv() + .fromStream(stream, (err, result) => { + console.log(JSON.stringify(result)); + }); + +// callback version using Converter class +new csv.Converter() + .fromStream(stream, (err, result) => { + console.log(JSON.stringify(result)); + }); diff --git a/csvtojson/index.d.ts b/csvtojson/index.d.ts new file mode 100644 index 0000000000..9ba01212c7 --- /dev/null +++ b/csvtojson/index.d.ts @@ -0,0 +1,276 @@ +// Type definitions for csvtojson 1.1 +// Project: https://github.com/Keyang/node-csvtojson +// Definitions by: Eric Byers , Wayne Carson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as stream from 'stream'; + +declare namespace csvtojson { + + /** + * Stream options + */ + type StreamOptions = stream.TransformOptions; + + /** + * Converter options + */ + interface ConverterOptions { + + /** + * Delimiter used for seperating columns. Use "auto" if delimiter is unknown in advance, + * in this case, delimiter will be auto-detected (by best attempt). Use an array to give + * a list of potential delimiters e.g. [",","|","$"]. (default: ",") + */ + delimiter?: string | string[]; + + /** + * If a column contains delimiter, it is able to use quote character to surround the column + * content. e.g. "hello, world" wont be split into two columns while parsing. Set to "off" + * will ignore all quotes. (default: " (double quote)) + */ + quote?: string; + + /** + * Indicate if parser trim off spaces surrounding column content. e.g. " content " will be + * trimmed to "content". (default: true) + */ + trim?: boolean; + + /** + * This parameter turns on and off whether check field type. (default: true) + */ + checkType?: boolean; + + /** + * Stringify the stream output to JSON array. This is useful when pipe output to a file + * which expects stringified JSON array. (default: false and only stringified JSON (without []) + * will be pushed to downstream) + */ + toArrayString?: boolean; + + /** + * Ignore the empty value in CSV columns. If a column value is not giving, set this to true to + * skip them. (default: false) + */ + ignoreEmpty?: boolean; + + /** + * Number of worker processes. The worker process will use multi-cores to help process CSV data. + * Set to number of cores to improve the performance of processing large CSV file. Keep 1 for + * small csv files. (default: 1) + */ + workerNum?: number; + + /** + * Indicating CSV data has no header row and first row is data row. (default: false) + */ + noheader?: boolean; + + /** + * An array to specify the headers of CSV data. If noheader is false, this value will override + * CSV header row. Example: ["my field","name"] (default: null) + */ + headers?: string[]; + + /** + * Don't interpret dots (.) and square brackets in header fields as nested object or array identifiers + * at all (treat them like regular characters for JSON field identifiers). (default: false) + */ + flatKeys?: boolean; + + /** + * The max character a CSV row could have. 0 means infinite. If max number exceeded, parser will emit + * "error" of "row_exceed". if a possibly corrupted CSV data provided, give it a number like 65535 + * so the parser wont consume memory. (default: 0) + */ + maxRowLength?: number; + + /** + * Whether or not to check if the column number of a row is the same as headers. If column number + * mismatched headers number, an error of "mismatched_column" will be emitted. (default: false) + */ + checkColumn?: boolean; + + /** + * End of line character. If omitted, parser will attempt retrieve it from first chunk of CSV data. + * If no valid eol found, then operation system eol will be used. + */ + eol?: string; + + /** + * Escape character used in quoted column. Default is double quote (") according to RFC4108. Change + * to back slash (\) or other chars for your own case. (default: " (double quote)) + */ + escape?: string; + + /** + * This parameter instructs the parser to include only those columns as specified by an array of + * column indexes. Example: [0,2,3] will parse and include only columns 0, 2, and 3 in the JSON output. + */ + includeColumns?: number[]; + + /** + * This parameter instructs the parser to ignore columns as specified by an array of column indexes. + * Example: [1,3,5] will ignore columns 1, 3, and 5 and will not return them in the JSON output. + */ + ignoreColumns?: number[]; + + /** + * Deprecated. Use workerNum instead. + */ + fork?: number; + } + + /** + * Callback function for handling result of parse. + */ + type ParseResultHandler = (err: any, result: any) => void; + + /** + * Event handler for "json" events. + */ + type JsonEventHandler = (jsonObj: any, rowNumber: number) => void; + + /** + * Event handler for "csv" events. + */ + type CsvEventHandler = (csvRow: string[], rowNumber: number) => void; + + /** + * Event handler for "data" events. + */ + type DataEventHandler = (data: any) => void; + + /** + * Event handler for "error" events. + */ + type ErrorEventHandler = (err: any) => void; + + /** + * Event handler for "record_parsed" events. + */ + type RecordParsedEventHandler = (jsonObj: any, csvRoe: string[], rowNumber: number) => void; + + /** + * Event handler for "end" events. + */ + type EndEventHandler = () => void; + + /** + * Event handler for "end_parsed" events. + */ + type EndParsedEventHandler = (jsonObjArray: any[]) => void; + + /** + * Event handler for "done" events. + */ + type DoneEventHandler = (err: any) => void; + + /** + * Converts provided CSV input to a JSON object. + */ + class Converter extends stream.Transform { + + /** + * Initializes a new instance of a Converter + * @param {ConverterOptions} options converter options + * @param {StreamOptions} streamOptions stream options + */ + constructor(options?: ConverterOptions, streamOptions?: StreamOptions); + + /** + * Reads in a CSV from a string. + * @param {string} str the string to convert + * @return {Converter} returns this object for chaining + */ + fromString(str: string): this + + /** + * Reads in a CSV from a string. + * @param {string} str the string to convert + * @param {ParseResultHandler} callback callback function to handle result or error + */ + fromString(str: string, callback: ParseResultHandler): void; + + /** + * Reads in a CSV from a file. + * @param {string} filePath the path to the CSV file + * @return {Converter} returns this object for chaining + */ + fromFile(filePath: string): this + + /** + * Reads in a CSV from a file. + * @param {string} filePath the path to the CSV file + * @param {ParseResultHandler} callback callback function to handle result or error + */ + fromFile(filePath: string, callback: ParseResultHandler): void; + + /** + * Reads in a CSV from a stream. + * @param {Stream} stream the stream + * @return {Converter} returns this object for chaining + */ + fromStream(stream: NodeJS.ReadableStream): this + + /** + * Reads in a CSV from a stream. + * @param {Stream} stream the stream + * @param {ParseResultHandler} callback callback function to handle result or error + */ + fromStream(stream: stream.Stream, callback: ParseResultHandler): void; + + /** + * Adds a listener function to the end of the listeners array for an event. + * Available events: + * - json + * - csv + * - data + * - error + * - record_parsed + * - end + * - end_parsed + * - done + * @param {Event} event name of event + * @param {Function} listener listener function + * @return {this} returns this object for chaining + */ + // tslint:disable-next-line:forbidden-types + on(event: string, listener: Function | JsonEventHandler | CsvEventHandler | DataEventHandler | ErrorEventHandler + | RecordParsedEventHandler | EndEventHandler | EndParsedEventHandler | DoneEventHandler): this; + + /** + * Transform objects after CSV parsing but before result being emitted or pushed downstream. + * @param {Function} callback transform function + * @return {this} returns this object for chaining + */ + transf(callback: (jsonObj: any, csvRow: string[], rowNumber: number) => void): this; + + /** + * The function in preRawData will be called directly with the string from upper stream. + * @param {Function} callback callback function + * @return {this} returns this object for chaining + */ + preRawData(callback: (csvRawData: string, cb: (newData: any) => void) => void): this; + + /** + * The function is called each time a file line being found in csv stream. + * @param {Function} callback callback function + * @return {this} returns this object for chaining + */ + preFileLine(callback: (line: string, rowNumber: number) => string): this; + } +} + +/** + * Factory function which creates an instance of a Converter object. + * @param {ConverterOptions} options converter options + * @param {StreamOptions} streamOptions stream options + * @return {csvtojson.Converter} Converter object + */ +declare function csvtojson(options?: csvtojson.ConverterOptions, streamOptions?: csvtojson.StreamOptions): csvtojson.Converter; + +export = csvtojson; diff --git a/csvtojson/tsconfig.json b/csvtojson/tsconfig.json new file mode 100644 index 0000000000..81ec6a66a2 --- /dev/null +++ b/csvtojson/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "csvtojson-tests.ts" + ] +} diff --git a/csvtojson/tslint.json b/csvtojson/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/csvtojson/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From b00b86d7197ed3217557fc6e88657c19a8b67f55 Mon Sep 17 00:00:00 2001 From: Anton Kandybo Date: Fri, 10 Mar 2017 09:57:24 +0200 Subject: [PATCH 073/276] Enable dt-header tslint rule --- compression-webpack-plugin/tslint.json | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/compression-webpack-plugin/tslint.json b/compression-webpack-plugin/tslint.json index 02312e1c7d..70cee1ba88 100644 --- a/compression-webpack-plugin/tslint.json +++ b/compression-webpack-plugin/tslint.json @@ -1,7 +1,4 @@ { - "extends": "../tslint.json", - "rules": { - "dt-header": false - } - } + "extends": "../tslint.json" +} \ No newline at end of file From 9e069e784e7a5bc12f1abacd71b319a9f02f1c8b Mon Sep 17 00:00:00 2001 From: Anton Kandybo Date: Fri, 10 Mar 2017 10:13:16 +0200 Subject: [PATCH 074/276] Using require syntax in tests --- .../compression-webpack-plugin-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compression-webpack-plugin/compression-webpack-plugin-tests.ts b/compression-webpack-plugin/compression-webpack-plugin-tests.ts index 4ee93c78b7..3939bf5847 100644 --- a/compression-webpack-plugin/compression-webpack-plugin-tests.ts +++ b/compression-webpack-plugin/compression-webpack-plugin-tests.ts @@ -1,5 +1,5 @@ -import { Configuration } from 'webpack' -import * as CompressionPlugin from 'compression-webpack-plugin' +import { Configuration } from 'webpack'; +import CompressionPlugin = require('compression-webpack-plugin'); const c: Configuration = { plugins: [ From 911335f7fe972e349f402ce229627095b38ab020 Mon Sep 17 00:00:00 2001 From: Anton Kandybo Date: Fri, 10 Mar 2017 10:14:53 +0200 Subject: [PATCH 075/276] Remove patch version --- compression-webpack-plugin/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compression-webpack-plugin/index.d.ts b/compression-webpack-plugin/index.d.ts index cf65f55300..536a77b8e9 100644 --- a/compression-webpack-plugin/index.d.ts +++ b/compression-webpack-plugin/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for compression-webpack-plugin 0.3.2 +// Type definitions for compression-webpack-plugin 0.3 // Project: https://github.com/webpack-contrib/compression-webpack-plugin // Definitions by: Anton Kandybo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 75c72afe968d4df30a27f600183144cb301320f3 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 10 Mar 2017 07:08:34 -0800 Subject: [PATCH 076/276] fine-uploader: Provides its own types (#14983) --- fine-uploader/index.d.ts | 346 ----------------------------- fine-uploader/test/blobs.ts | 9 - fine-uploader/test/callbacks.ts | 59 ----- fine-uploader/test/camera.ts | 14 -- fine-uploader/test/chunking.ts | 26 --- fine-uploader/test/core.ts | 17 -- fine-uploader/test/cors.ts | 13 -- fine-uploader/test/deleteFile.ts | 28 --- fine-uploader/test/extraButtons.ts | 23 -- fine-uploader/test/form.ts | 13 -- fine-uploader/test/message.ts | 21 -- fine-uploader/test/method.ts | 140 ------------ fine-uploader/test/paste.ts | 14 -- fine-uploader/test/request.ts | 32 --- fine-uploader/test/resume.ts | 15 -- fine-uploader/test/retry.ts | 15 -- fine-uploader/test/scaling.ts | 29 --- fine-uploader/test/session.ts | 26 --- fine-uploader/test/text.ts | 13 -- fine-uploader/test/validation.ts | 22 -- fine-uploader/test/workarounds.ts | 13 -- fine-uploader/tsconfig.json | 42 ---- fine-uploader/tslint.json | 1 - notNeededPackages.json | 6 + 24 files changed, 6 insertions(+), 931 deletions(-) delete mode 100644 fine-uploader/index.d.ts delete mode 100644 fine-uploader/test/blobs.ts delete mode 100644 fine-uploader/test/callbacks.ts delete mode 100644 fine-uploader/test/camera.ts delete mode 100644 fine-uploader/test/chunking.ts delete mode 100644 fine-uploader/test/core.ts delete mode 100644 fine-uploader/test/cors.ts delete mode 100644 fine-uploader/test/deleteFile.ts delete mode 100644 fine-uploader/test/extraButtons.ts delete mode 100644 fine-uploader/test/form.ts delete mode 100644 fine-uploader/test/message.ts delete mode 100644 fine-uploader/test/method.ts delete mode 100644 fine-uploader/test/paste.ts delete mode 100644 fine-uploader/test/request.ts delete mode 100644 fine-uploader/test/resume.ts delete mode 100644 fine-uploader/test/retry.ts delete mode 100644 fine-uploader/test/scaling.ts delete mode 100644 fine-uploader/test/session.ts delete mode 100644 fine-uploader/test/text.ts delete mode 100644 fine-uploader/test/validation.ts delete mode 100644 fine-uploader/test/workarounds.ts delete mode 100644 fine-uploader/tsconfig.json delete mode 100644 fine-uploader/tslint.json diff --git a/fine-uploader/index.d.ts b/fine-uploader/index.d.ts deleted file mode 100644 index dab4e720ea..0000000000 --- a/fine-uploader/index.d.ts +++ /dev/null @@ -1,346 +0,0 @@ -// Type definitions for FineUploader for 5.11 -// Project: http://fineuploader.com/ -// Definitions by: Bradford Wagner -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace qq { - interface BlobsOptions { - defaultName?: string; - } - - interface CameraOptions { - button?: HTMLElement; - ios?: boolean; - } - - interface ChunkingOptions { - concurrent?: ChunkingConcurrentOptions; - enabled?: boolean; // default false - mandatory?: boolean; // default false - partSize?: number; // default 2,000,000 - paramNames?: ChunkingParamNames; - success?: ChunkingSuccess; - } - - interface ChunkingConcurrentOptions { - enabled?: boolean; // default false - } - - interface ChunkingParamNames { - chunkSize?: string; // default: qqchunksize - partByteOffset?: string; // default: qqpartbyteoffset - partIndex?: string; // default: qqpartindex - totalParts?: string; // default: qqtotalparts - } - - interface ChunkingSuccess { - endpoint?: string | null; // default: null - } - - interface CorsOptions { - allowXdr?: boolean; // default: false - expected?: boolean; // default: false - sendCredentials: boolean; // default: false - } - - interface DeleteFileOptions { - customHeader?: H; // default: {} - enabled?: boolean; // default false - endpoint?: string; // default: /server/upload - method?: string; // default: DELETE - params?: P; // default: {} - } - - interface ExtraButtonsOptions { - element: HTMLElement | undefined; // default: undefined - fileInputTitle?: string; // default: file input - folders?: boolean; // default: false - multiple?: boolean; // default: true - validation?: V; // default: 'validation' - } - - interface FormOptions { - element?: string | HTMLElement; // default: qq-form - autoUpload?: boolean; // default: false - interceptSubmit?: boolean; // default: true - } - - interface MessagesOptions { - emptyError?: string; // default: {file} is empty, please select files again without it. - maxHeightImageError?: string; // default: Image is too tall. - maxWidthImageError?: string; // default: Image is too wide. - minHeightImageError?: string; // default: Image is not tall enough. - minWidthImageError?: string; // default: Image is not wide enough. - minSizeError?: string; // default: {file} is too small, minimum file size is {minSizeLimit}. - noFilesError?: string; // default: No files to upload. - onLeave?: string; // default: The files are being uploaded, if you leave now the upload will be canceled. - retryFailTooManyItemsError?: string; // default: Too many items ({netItems}) would be uploaded. Item limit is {itemLimit}. - typeError?: string; // default: {file} has an invalid extension. Valid extension(s): {extensions}. - // tslint:disable-next-line:max-line-length - unsupportedBrowserIos8Safari?: string; // default: Unrecoverable error - this browser does not permit file uploading of any kind due to serious bugs in iOS8 Safari. Please use iOS8 Chrome until Apple fixes these issues. - } - - interface PasteOptions { - defaultName?: string; // default: pasted_image - targetElement?: HTMLElement | null; // default: null - } - - interface ResumeOptions { - recordsExpireIn?: number; // default: 7 - enabled?: boolean; // default: false - paramNames?: ResumeParamNameOptions; - } - - interface ResumeParamNameOptions { - resuming: string; // default: qqresume - } - - interface RetryOptions { - autoAttemptDelay?: number; // default: 5 - enableAuto?: boolean; // default: false - maxAutoAttempts?: number; // default: 3 - preventRetryResponseProperty?: string; // default: preventRetry - } - - interface RequestOptions { - customHeaders?: H; // default: {} - endpoint?: string; // default: /server/upload - filenameParam?: string; // default: qqfilename - forceMultipart?: boolean; // default: true - inputName?: string; // default: qqfile - method?: string; // default: POST - params?: P; // default: {} - paramsInBody?: boolean; // default: true - uuid?: string; // default: qquuid - totalFileSizeName?: string; // default: qqtotalfilesize - } - - interface ScalingOptions { - customResizer?: ( - blob: File | Blob, - height: number, - image: HTMLImageElement, - sourceCanvas: HTMLCanvasElement, - targetCanvas: HTMLCanvasElement, - width: number) => Promise | undefined; // default: undefined - defaultQuality?: number; // default: 80 - defaultType?: string | null; // default: null - failureText?: string; // default: Failed to scale - includeExif?: boolean; // default: false - orient?: boolean; // default: true - sendOriginal?: boolean; // default: false - sizes?: Size[]; // default: [] - } - - /** - * From Documentation: - * An array containing size objects that describe scaled versions of each submitted image that should be generated and uploaded. - * A size object should usually contain a name String property (which will be appended to the file name of the scaled file), and must always contain a maxSize integer property. - * A type MIME string property is optional. - */ - interface Size { - name: string; - maxSize: number; - type?: string; - } - - interface SessionOptions { - customHeaders?: H; // default: {} - endpoint?: string | null; // default: null - params?: P; // default: {} - refreshOnReset?: boolean; // default: true - } - - interface TextOptions { - defaultResponseError?: string; // default: Upload failure reason unknown - fileInputTitle?: string; // default: file input - sizeSymbols?: string[]; // default: ['kB', 'MB', 'GB', 'TB', 'PB', 'EB'] - } - - interface ValidationOptions { - acceptFiles?: MimeType[] | null; // default: null - allowedExtensions?: string[]; // default: [] - itemLimit?: number; // default: 0 - minSizeLimit?: number; // default: 0 - sizeLimit?: number; // default: 0 - stopOnFirstInvalidFile?: boolean; // default: true - image?: ValidationImageOptions; - } - - interface ValidationImageOptions { - maxHeight?: number; // default: 0 - maxWidth?: number; // default: 0 - minWidth?: number; // default: 0 - minHeight?: number; // default: 0 - } - - interface WorkaroundOptions { - iosEmptyVideos?: boolean; // default: true - ios8BrowserCrash?: boolean; // default: false - ios8SafariUploads?: boolean; // default: true - } - - interface ChunkData { - partIndex: number; - startByte: number; - endByte: number; - totalParts: number; - } - - interface ValidateMetadata { - name: string; - size?: number; - } - - interface CallbackOptions { - onAutoRetry?: (id: number, name: string, attemptNumber: number) => void; - onCancel?: (id: number, name: string) => void; - onComplete?: (id: number, name: string, responseJSON: T, xhr: XMLHttpRequest) => void; // ignore xhr: XDomainRequest as it is not compatible for all versions of TypeScript - onAllComplete?: (succeeded: number[], failed: number[]) => void; - onDelete?: (id: number) => void; - onDeleteComplete?: (id: number, xhr: XMLHttpRequest, isError: boolean) => void; // ignore xhr: XDomainRequest as it is not compatible for all versions of TypeScript - onError?: (id: number, name: string, errorReason: string, xhr: XMLHttpRequest) => void; // ignore xhr: XDomainRequest as it is not compatible for all versions of TypeScript - onManualRetry?: (id: number, name: string) => boolean; // return false to prevent this and all future retries - onPasteReceived?: (blob: Blob) => void; - onProgress?: (id: number, name: string, uploadedBytes: number, totalBytes: number) => void; - onResume?: (id: number, name: string, chunkData: T) => void; - onSessionRequestComplete?: (response: T[], success: boolean, xhrOrXdr: XMLHttpRequest) => void; // ignore xhr: XDomainRequest as it is not compatible for all versions of TypeScript - onStatusChange?: (id: number, oldStatus: string, newStatus: string) => void; - onSubmit?: (id: number, name: string) => void; - onSubmitDelete?: (id: number) => void; - onSubmitted?: (id: number, name: string) => void; - onTotalProgress?: (totalUploadedBytes: number, totalBytes: number) => void; - onUpload?: (id: number, name: string) => void; - onUploadChunk?: (id: number, name: string, chunkData: ChunkData) => void; - // ignore xhr: XDomainRequest as it is not compatible for all versions of TypeScript - onUploadChunkSuccess?: (id: number, chunkData: ChunkData, responseJSON: T, xhr: XMLHttpRequest) => void; - onValidate?: (data: ValidateMetadata, buttonContainer: HTMLElement) => void; - onValidateBatch?: (fileOrBlobDataArray: ValidateMetadata[], buttomContainer: HTMLElement) => void; - } - - interface BasicOptions { - // core options - autoUpload?: boolean; // default true - button?: HTMLElement; - debug?: boolean; - disableCancelForFormUploads?: boolean; - formatFileName?: (rawFileName: string) => string; // rawFilename to display filename - maxConnections?: number; - multiple?: boolean; - - blobs?: BlobsOptions; - camera?: CameraOptions; - chunking?: ChunkingOptions; - cors?: CorsOptions; - deleteFile?: DeleteFileOptions; - extraButtons?: ExtraButtonsOptions; - form?: FormOptions; - messages?: MessagesOptions; - paste?: PasteOptions; - resume?: ResumeOptions; - retry?: RetryOptions; - request?: RequestOptions; - scaling?: ScalingOptions; - session?: SessionOptions; - text?: TextOptions; - validation?: ValidationOptions; - workarounds?: WorkaroundOptions; - - callbacks?: CallbackOptions; - } - - interface BlobWrapper { - blob: Blob; - name: string; - } - - interface CanvasWrapper { - canvas: HTMLCanvasElement; - name: string; - quality: number; // 1-100 - type: MimeType; - } - - interface ResizeInfo { - blob: File | Blob; - height: number; - image: HTMLImageElement; - sourceCanvas: HTMLCanvasElement; - targetCanvas: HTMLCanvasElement; - width: number; - } - - interface ResumableItem { - name: string; - uuid: string; - partIdx: number; - } - - interface FilterOption { - id?: number; - uuid?: string; - originalName?: string; - name?: string; - status?: string; - size?: number; - } - - interface ScaleImageOptions { - maxSize: number; - orient?: boolean; // default: true - type?: string; // default: type or reference image - quality?: number; // 0-100 - default: 80 - includeExif?: boolean; // default: false - customResizer?: (resizeInfo: ResizeInfo) => Promise; - } - - class FineUploaderBasic { - constructor(options: BasicOptions) - - addFiles(files: File[] | HTMLInputElement[] | Blob[] | BlobWrapper[] | HTMLCanvasElement[] | CanvasWrapper[] | FileList, params: T, endpoint: string): void; - addInitialFiles(initialFiles: T[]): void; - cancel(id: number): void; - cancelAll(): void; - clearStoredFiles(): void; - continueUpload(id: number): boolean; // true if successful - deleteFile(id: number): void; - - /** - * TODO: need someone who has used this to update the returned promise related fields - */ - drawThumbnail(id: number, targetContainer: HTMLElement, maxSize: number, fromServer: boolean, customResizer: (resizeInfo: ResizeInfo) => Promise): Promise - getButton(id: number): HTMLElement; - getFile(id: number): File | Blob; - getInProgress(): number; - getName(id: number): string; - getParentId(scaledFileId: number): number; - getRemainingAllowedItems(): number; - getResumableFilesData(): ResumableItem[]; - getSize(id: number): number; - getUploads(filter: FilterOption): T | T[]; - getUuid(id: number): string; - log(message: string, level: string): void; - pauseUpload(id: number): boolean; // true if successful - reset(): void; - retry(id: number): void; - scaleImage(id: number, options: ScaleImageOptions): Promise; - setCustomHeaders(customHeaders: H, id: number): void; - setEndpoint(path: string, identifier: number | HTMLElement): void; - setDeleteFileCustomHeaders(customHeaders: H, id: number): void; - setDeleteFileEndpoint(path: string, identifier: number | HTMLElement): void; - setDeleteFileParams

    (params: P, id: number): void; - setItemLimit(newItemLimit: number): void; - setForm(formElementOrId: HTMLFormElement | string): void; - setName(id: number, name: string): void; - setParams

    (params: P, id: number): void; - setUuid(id: number, uuid: string): void; - uploadStoredFiles(): void; // throws NoFilesError - - // ui - addExtraDropzone(element: HTMLElement): void; - getDropTarget(id: number): HTMLElement; - getId(element: HTMLElement): number; - getItemByFileId(id: number): HTMLElement; - removeExtraDropzone(element: HTMLElement): void; - } -} diff --git a/fine-uploader/test/blobs.ts b/fine-uploader/test/blobs.ts deleted file mode 100644 index 99e5355460..0000000000 --- a/fine-uploader/test/blobs.ts +++ /dev/null @@ -1,9 +0,0 @@ -function testBlob() { - const config: qq.BasicOptions = { - blobs: { - defaultName: "hi.png" - } - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/callbacks.ts b/fine-uploader/test/callbacks.ts deleted file mode 100644 index eba85ad2a0..0000000000 --- a/fine-uploader/test/callbacks.ts +++ /dev/null @@ -1,59 +0,0 @@ -class CallbacksTest { - constructor(private opts: qq.CallbackOptions) { - - } - - testCallbacks() { - const opts = this.opts; - - interface CustomType { - myTypeOfClass: string; - } - - opts.onAutoRetry = (id, name, attemptNumber) => {}; - - opts.onCancel = (id, name) => {}; - - opts.onComplete = (id: number, name: string, responseJSON: CustomType, xhr: XMLHttpRequest) => {}; - - opts.onAllComplete = (succeeded, failed) => {}; - - opts.onDelete = (id) => {}; - - opts.onDeleteComplete = (id, xhr, isError) => {}; - - opts.onError = (id, name, errorReason, xhr) => {}; - - opts.onManualRetry = (id, name) => { - return true; - }; - - opts.onPasteReceived = (blob) => {}; - - opts.onProgress = (id, name, uploadedBytes, totalBytes) => {}; - - opts.onResume = (id: number, name: string, chunkData: CustomType) => {}; - - opts.onSessionRequestComplete = (response: CustomType[], success: boolean, xhrOrXdr: XMLHttpRequest) => {}; - - opts.onStatusChange = (id, oldStatus, newStatus) => {}; - - opts.onSubmit = (id, name) => {}; - - opts.onSubmitDelete = (id) => {}; - - opts.onSubmitted = (id, name) => {}; - - opts.onTotalProgress = (totalUploadedBytes, totalBytes) => {}; - - opts.onUpload = (id, name) => {}; - - opts.onUploadChunk = (id, name, chunkData) => {}; - - opts.onUploadChunkSuccess = (id: number, chunkData: qq.ChunkData, responseJSON: CustomType, xhr: XMLHttpRequest) => {}; - - opts.onValidate = (data, buttonContainer) => {}; - - opts.onValidateBatch = (fileOrBlobDataArray, buttonContaine) => {}; - } -} diff --git a/fine-uploader/test/camera.ts b/fine-uploader/test/camera.ts deleted file mode 100644 index b42a080778..0000000000 --- a/fine-uploader/test/camera.ts +++ /dev/null @@ -1,14 +0,0 @@ -function cameraTest() { - const cameraButton = new HTMLButtonElement(); - - const cameraOptions: qq.CameraOptions = { - button: cameraButton, - ios: false - }; - - const config: qq.BasicOptions = { - camera: cameraOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/chunking.ts b/fine-uploader/test/chunking.ts deleted file mode 100644 index 386dd67738..0000000000 --- a/fine-uploader/test/chunking.ts +++ /dev/null @@ -1,26 +0,0 @@ -function chunkingTest() { - - const chunkingOptions: qq.ChunkingOptions = { - concurrent: { - enabled: false - }, - enabled: true, - mandatory: true, - partSize: 1000000, - paramNames: { - chunkSize: "chunkSize", - partByteOffset: "partByteOffset", - partIndex: "partIndex", - totalParts: "totalParts" - }, - success: { - endpoint: "/some/web/endpoint/yaySuccesss" - } - }; - - const config: qq.BasicOptions = { - chunking: chunkingOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/core.ts b/fine-uploader/test/core.ts deleted file mode 100644 index dbc06e95d6..0000000000 --- a/fine-uploader/test/core.ts +++ /dev/null @@ -1,17 +0,0 @@ -function testCore() { - const button: HTMLElement = new HTMLButtonElement(); - - const config: qq.BasicOptions = { - autoUpload: true, - button, - debug: true, - disableCancelForFormUploads: true, - formatFileName: (rawFileName: string) => { - return "hi"; - }, - maxConnections: 10, - multiple: true - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/cors.ts b/fine-uploader/test/cors.ts deleted file mode 100644 index 771b210208..0000000000 --- a/fine-uploader/test/cors.ts +++ /dev/null @@ -1,13 +0,0 @@ -function corsTest() { - const corsOptions: qq.CorsOptions = { - allowXdr: true, - expected: true, - sendCredentials: true - }; - - const config: qq.BasicOptions = { - cors: corsOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/deleteFile.ts b/fine-uploader/test/deleteFile.ts deleted file mode 100644 index 49c3e68890..0000000000 --- a/fine-uploader/test/deleteFile.ts +++ /dev/null @@ -1,28 +0,0 @@ -function deleteFileTest() { - interface CustomHeader { - myOption: string; - } - - interface CustomParams { - myParam: string; - } - - const deleteFileOptions: qq.DeleteFileOptions = { - customHeader: { - myOption: "ewwww" - }, - enabled: true, - endpoint: "/my/server/location/delete", - method: "POST", - params: { - myParam: "u" - } - }; - - - const config: qq.BasicOptions = { - deleteFile: deleteFileOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/extraButtons.ts b/fine-uploader/test/extraButtons.ts deleted file mode 100644 index eef709bea8..0000000000 --- a/fine-uploader/test/extraButtons.ts +++ /dev/null @@ -1,23 +0,0 @@ -function extraButtons() { - interface Validation { - myValue: string; - } - - const element: HTMLElement = new HTMLElement(); - - const extraButtonOptions: qq.ExtraButtonsOptions = { - element, - fileInputTitle: "inputTitle", - folders: true, - multiple: false, - validation: { - myValue: "ew" - } - }; - - const config: qq.BasicOptions = { - extraButtons: extraButtonOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/form.ts b/fine-uploader/test/form.ts deleted file mode 100644 index ccc08b69a1..0000000000 --- a/fine-uploader/test/form.ts +++ /dev/null @@ -1,13 +0,0 @@ -function formTest() { - const formOptions: qq.FormOptions = { - element: "qq-form", - autoUpload: true, - interceptSubmit: true - }; - - const config: qq.BasicOptions = { - form: formOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/message.ts b/fine-uploader/test/message.ts deleted file mode 100644 index 726584bf7b..0000000000 --- a/fine-uploader/test/message.ts +++ /dev/null @@ -1,21 +0,0 @@ -function messageTest() { - const messageOptions: qq.MessagesOptions = { - emptyError: "emptyError", - maxHeightImageError: "maxHeightImageError", - maxWidthImageError: "error occurred", - minHeightImageError: "error occurred", - minWidthImageError: "error occurred", - minSizeError: "error occurred", - noFilesError: "error occurred", - onLeave: "error occurred", - retryFailTooManyItemsError: "error occurred", - typeError: "error occurred", - unsupportedBrowserIos8Safari: "error occurred" - }; - - const config: qq.BasicOptions = { - messages: messageOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/method.ts b/fine-uploader/test/method.ts deleted file mode 100644 index 1adb13db81..0000000000 --- a/fine-uploader/test/method.ts +++ /dev/null @@ -1,140 +0,0 @@ -class TestMethods { - constructor(private uploader: qq.FineUploaderBasic) { - } - - testAddFiles() { - interface ParamType { - field: string; - } - - const params: ParamType = { - field: 'hiiiii' - }; - - this.uploader.addFiles( - new FileList(), - params, - "/my/happy/endpoint" - ); - } - - testAddInitialFiles() { - interface InitialFiles { - myField: number; - } - - const initialFiles: InitialFiles[] = [{ - myField: 1324 - }]; - - this.uploader.addInitialFiles(initialFiles); - } - - testDrawThumbnail() { - const promise: Promise = this.uploader.drawThumbnail( - 1234, - new HTMLElement(), - 1234565, - false, - (resizeInfo) => { - return new Promise(() => { - return new Blob(); - }); - } - ); - } - - testGetUploads() { - interface ResponseType { - hi: string; - } - const response: ResponseType | ResponseType[] = this.uploader.getUploads({ - status: "proggresssssssesees" - }); - } - - testSetCustomHeaders() { - interface CustomHeader { - customField: number; - } - - this.uploader.setCustomHeaders({ - customField: 1234 - }, 1234); - } - - testSetDeleteCustomHeaders() { - interface CustomHeader { - customField: number; - } - - this.uploader.setDeleteFileCustomHeaders({ - customField: 1234 - }, 1234); - } - - testSetDeleteFileParams() { - interface CustomParams { - paramField: boolean; - } - this.uploader.setDeleteFileParams({ - paramField: false - }, 1234); - } - - testSetParams() { - interface CustomParams { - customParams: number; - } - - this.uploader.setParams({ - customParams: 1234 - }, 1234); - } - - bulkTests() { - this.uploader.cancel(1); - this.uploader.cancelAll(); - this.uploader.clearStoredFiles(); - const shouldContinue: boolean = this.uploader.continueUpload(1234); - this.uploader.deleteFile(1234); - const elem: HTMLElement = this.uploader.getButton(1234); - const fileOrBlob: File | Blob = this.uploader.getFile(1234); - let num: number = this.uploader.getInProgress(); - let s: string = this.uploader.getName(1234); - num = this.uploader.getParentId(1234); - num = this.uploader.getRemainingAllowedItems(); - const resumables: qq.ResumableItem[] = this.uploader.getResumableFilesData(); - num = this.uploader.getSize(1234); - s = this.uploader.getUuid(1234); - this.uploader.log("why am i doing this?", "info"); - const b: boolean = this.uploader.pauseUpload(1234); - this.uploader.reset(); - this.uploader.retry(1234); - const blobPromise: Promise = this.uploader.scaleImage(1234, { - maxSize: 20, - orient: false, - type: "png", - quality: 10, - includeExif: false, - }); - this.uploader.setEndpoint("/my/path/is/my/own", 1234); - this.uploader.setEndpoint("/my/path/is/my/own", new HTMLElement()); - this.uploader.setDeleteFileEndpoint("/some/path", 1234); - this.uploader.setDeleteFileEndpoint("/some/path", new HTMLElement()); - this.uploader.setItemLimit(1234); - this.uploader.setForm(new HTMLFormElement()); - this.uploader.setForm("myFormElement"); - this.uploader.setName(1234, "myCustomName"); - this.uploader.setUuid(1234, "12341234"); - this.uploader.uploadStoredFiles(); - } - - uiTests() { - this.uploader.addExtraDropzone(new HTMLElement()); - let elem: HTMLElement = this.uploader.getDropTarget(1234); - const n: number = this.uploader.getId(elem); - elem = this.uploader.getItemByFileId(n); - this.uploader.removeExtraDropzone(elem); - } -} diff --git a/fine-uploader/test/paste.ts b/fine-uploader/test/paste.ts deleted file mode 100644 index 9b3c7d9007..0000000000 --- a/fine-uploader/test/paste.ts +++ /dev/null @@ -1,14 +0,0 @@ -function pasteTest() { - const targetElement: HTMLElement = new HTMLElement(); - - const pasteOptions: qq.PasteOptions = { - defaultName: "pasted_image", - targetElement - }; - - const config: qq.BasicOptions = { - paste: pasteOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/request.ts b/fine-uploader/test/request.ts deleted file mode 100644 index 54b29c9be9..0000000000 --- a/fine-uploader/test/request.ts +++ /dev/null @@ -1,32 +0,0 @@ -function requestTest() { - interface CustomHeader { - customHeader: string; - } - - interface CustomParam { - customParam: boolean; - } - - const requestOptions: qq.RequestOptions = { - customHeaders: { - customHeader: "my custom header hehehehee" - }, - endpoint: "/my/custom/endpoint", - filenameParam: "newFilenameParam", - forceMultipart: true, - inputName: "filenameParamMapping", - method: "POST", - params: { - customParam: false - }, - paramsInBody: false, - uuid: "asdf123456", - totalFileSizeName: "totalFileSize" - }; - - const config: qq.BasicOptions = { - request: requestOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} \ No newline at end of file diff --git a/fine-uploader/test/resume.ts b/fine-uploader/test/resume.ts deleted file mode 100644 index dc588d19f5..0000000000 --- a/fine-uploader/test/resume.ts +++ /dev/null @@ -1,15 +0,0 @@ -function resumeTest() { - const resumeOptions: qq.ResumeOptions = { - recordsExpireIn: 10, - enabled: true, - paramNames: { - resuming: "ew you" - } - }; - - const config: qq.BasicOptions = { - resume: resumeOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/retry.ts b/fine-uploader/test/retry.ts deleted file mode 100644 index 85c9f71af3..0000000000 --- a/fine-uploader/test/retry.ts +++ /dev/null @@ -1,15 +0,0 @@ -function retryTest() { - - const retryOptions: qq.RetryOptions = { - autoAttemptDelay: 1, - enableAuto: true, - maxAutoAttempts: 32, - preventRetryResponseProperty: "preventRetry" - }; - - const config: qq.BasicOptions = { - retry: retryOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} \ No newline at end of file diff --git a/fine-uploader/test/scaling.ts b/fine-uploader/test/scaling.ts deleted file mode 100644 index 5e8ff3dc51..0000000000 --- a/fine-uploader/test/scaling.ts +++ /dev/null @@ -1,29 +0,0 @@ -function scalingTest() { - const scalingOptions: qq.ScalingOptions = { - customResizer: (blob, height, image, sourceCanvas, targetCanvas, width) => { - const promise = new Promise(() => { - return blob; - }); - return promise; - }, - defaultQuality: 10, - defaultType: "JPEG", - failureText: "you have failed me for the last time", - includeExif: true, - orient: false, - sendOriginal: true, - sizes: [ - { - maxSize: 10, - name: "i am added to name", - type: "mime type" - } - ] - }; - - const config: qq.BasicOptions = { - scaling: scalingOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/session.ts b/fine-uploader/test/session.ts deleted file mode 100644 index 7d8d6069b9..0000000000 --- a/fine-uploader/test/session.ts +++ /dev/null @@ -1,26 +0,0 @@ -function sessionTest() { - interface CustomHeader { - customHeader: string; - } - - interface CustomParam { - customParam: boolean; - } - - const sessionOptions: qq.SessionOptions = { - customHeaders: { - customHeader: "customHeader" - }, - endpoint: "/mysession/endpoint", - params: { - customParam: false - }, - refreshOnReset: false - }; - - const config: qq.BasicOptions = { - session: sessionOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/text.ts b/fine-uploader/test/text.ts deleted file mode 100644 index e83ddb4bcf..0000000000 --- a/fine-uploader/test/text.ts +++ /dev/null @@ -1,13 +0,0 @@ -function textTest() { - const textOptions: qq.TextOptions = { - defaultResponseError: "you have failed me for the last time", - fileInputTitle: "file input title", - sizeSymbols: ['kb'] - }; - - const config: qq.BasicOptions = { - text: textOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/validation.ts b/fine-uploader/test/validation.ts deleted file mode 100644 index 60324157f9..0000000000 --- a/fine-uploader/test/validation.ts +++ /dev/null @@ -1,22 +0,0 @@ -function validationTest() { - - const validationOptions: qq.ValidationOptions = { - acceptFiles: [new MimeType()], - allowedExtensions: ['csv, xls'], - itemLimit: 5, - sizeLimit: 10000000, - stopOnFirstInvalidFile: false, - image: { - maxHeight: 10, - maxWidth: 10, - minHeight: 1, - minWidth: 1 - } - }; - - const config: qq.BasicOptions = { - validation: validationOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/workarounds.ts b/fine-uploader/test/workarounds.ts deleted file mode 100644 index 42fa5ceee7..0000000000 --- a/fine-uploader/test/workarounds.ts +++ /dev/null @@ -1,13 +0,0 @@ -function workaroundsTest() { - const workaroundOptions: qq.WorkaroundOptions = { - iosEmptyVideos: false, - ios8BrowserCrash: false, - ios8SafariUploads: false - }; - - const config: qq.BasicOptions = { - workarounds: workaroundOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/tsconfig.json b/fine-uploader/tsconfig.json deleted file mode 100644 index c02e485091..0000000000 --- a/fine-uploader/tsconfig.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "files": [ - "index.d.ts", - "test/blobs.ts", - "test/camera.ts", - "test/chunking.ts", - "test/core.ts", - "test/cors.ts", - "test/deleteFile.ts", - "test/extraButtons.ts", - "test/form.ts", - "test/message.ts", - "test/paste.ts", - "test/resume.ts", - "test/retry.ts", - "test/request.ts", - "test/scaling.ts", - "test/session.ts", - "test/text.ts", - "test/validation.ts", - "test/workarounds.ts", - "test/method.ts", - "test/callbacks.ts" - ], - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - } -} \ No newline at end of file diff --git a/fine-uploader/tslint.json b/fine-uploader/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/fine-uploader/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/notNeededPackages.json b/notNeededPackages.json index c8b59ea072..fce0ef50f0 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -323,6 +323,12 @@ "typingsPackageName": "antd", "sourceRepoURL": "https://github.com/ant-design/ant-design", "asOfVersion": "1.0.0" + }, + { + "libraryName": "FineUploader", + "typingsPackageName": "fine-uploader", + "sourceRepoURL": "http://fineuploader.com/", + "asOfVersion": "5.14.0" } ] } \ No newline at end of file From 1c2f3aec5d538a64d980bd94b71913467ad4dde8 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 10 Mar 2017 07:23:35 -0800 Subject: [PATCH 077/276] Fix chai-enzyme tests (#15106) --- chai-enzyme/chai-enzyme-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chai-enzyme/chai-enzyme-tests.tsx b/chai-enzyme/chai-enzyme-tests.tsx index 7e7ef027ed..a75e99c756 100644 --- a/chai-enzyme/chai-enzyme-tests.tsx +++ b/chai-enzyme/chai-enzyme-tests.tsx @@ -34,7 +34,7 @@ expect(wrapper).to.have.ref("test"); expect(wrapper).to.be.selected(); expect(wrapper).to.have.tagName("div"); expect(wrapper).to.have.text(""); -expect(wrapper).to.have.Type(Test); +expect(wrapper).to.have.type(Test); expect(wrapper).to.have.value("test"); expect(wrapper).to.have.attr("test", "test"); expect(wrapper).to.have.data("test", "Test"); From 51b64c3c15bdcc72c124b940f9dd6792da992116 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 10 Mar 2017 07:46:20 -0800 Subject: [PATCH 078/276] Remove unnecessary references in test files. (#14900) --- acorn/acorn-tests.ts | 2 - amplify/amplify-tests.ts | 3 - .../angular-bootstrap-calendar-tests.ts | 3 - .../angular-feature-flags-tests.ts | 2 - angular-hotkeys/angular-hotkeys-tests.ts | 2 - angular-jwt/angular-jwt-tests.ts | 2 - angular-modal/angular-modal-tests.ts | 2 - archiver/archiver-tests.ts | 3 - atom/atom-tests.ts | 1 - auth0/auth0-tests.ts | 2 - autosize/autosize-tests.ts | 2 - aws-lambda/aws-lambda-tests.ts | 2 - babel-template/babel-template-tests.ts | 3 - babel-traverse/babel-traverse-tests.ts | 2 - babylon/babylon-tests.ts | 5 - .../backbone.layoutmanager-tests.ts | 4 +- backbone/backbone-tests.ts | 2 - bardjs/bardjs-tests.ts | 3 - batch-stream/batch-stream-tests.ts | 2 - .../bazinga-translator-tests.ts | 2 - bezier-js/bezier-js-tests.ts | 2 - bingmaps/bingmaps-tests.ts | 7 - bit-array/bit-array-tests.ts | 2 - blob-stream/blob-stream-tests.ts | 3 - blue-tape/blue-tape-tests.ts | 1 - bluebird-retry/bluebird-retry-tests.ts | 2 - bootpag/bootpag-tests.ts | 2 - .../bootstrap-datepicker-tests.ts | 1 - .../bootstrap-maxlength-tests.ts | 2 - bootstrap-notify/bootstrap-notify-tests.ts | 3 - bootstrap-select/bootstrap-select-tests.ts | 2 - bootstrap-slider/bootstrap-slider-tests.ts | 3 - bootstrap-switch/bootstrap-switch-tests.ts | 7 +- .../bootstrap-touchspin-tests.ts | 5 +- .../bootstrap-validator-tests.ts | 2 - .../bootstrap.v3.datetimepicker-tests.ts | 2 - bootstrap/bootstrap-tests.ts | 3 - browser-resolve/browser-resolve-tests.ts | 2 - .../business-rules-engine-tests.ts | 1 - cachefactory/cachefactory-tests.ts | 2 - cal-heatmap/cal-heatmap-tests.ts | 2 - cassandra-driver/cassandra-driver-tests.ts | 2 - cbor/cbor-tests.ts | 2 - chai-as-promised/chai-as-promised-tests.ts | 2 - chai-enzyme/chai-enzyme-tests.tsx | 4 - chai-spies/chai-spies-tests.ts | 3 - chocolatechipjs/chocolatechipjs-tests.ts | 15 +- cliff/cliff-tests.ts | 1 - co-body/co-body-tests.ts | 3 - coinstring/coinstring-tests.ts | 3 - connect-redis/connect-redis-tests.ts | 2 - cookies/cookies-tests.ts | 2 - .../cordova-plugin-battery-status-tests.ts | 2 - .../cordova-plugin-camera-tests.ts | 2 - .../cordova-plugin-contacts-tests.ts | 2 - .../cordova-plugin-device-motion-tests.ts | 2 - ...cordova-plugin-device-orientation-tests.ts | 2 - .../cordova-plugin-device-tests.ts | 2 - .../cordova-plugin-dialogs-tests.ts | 2 - .../cordova-plugin-file-transfer-tests.ts | 2 - .../cordova-plugin-file-tests.ts | 1 - .../cordova-plugin-globalization-tests.ts | 2 - .../cordova-plugin-inappbrowser-tests.ts | 2 - .../cordova-plugin-keyboard-tests.ts | 2 - .../cordova-plugin-media-capture-tests.ts | 2 - .../cordova-plugin-media-tests.ts | 2 - ...ordova-plugin-network-information-tests.ts | 2 - .../cordova-plugin-splashscreen-tests.ts | 2 - .../cordova-plugin-statusbar-tests.ts | 3 - .../cordova-plugin-vibration-tests.ts | 2 - .../cordova-plugin-websql-tests.ts | 3 - cryptojs/test/md5-tests.ts | 3 - .../css-modules-require-hook-tests.ts | 1 - csv-stringify/csv-stringify-tests.ts | 2 - cybozulabs-md5/cybozulabs-md5-tests.ts | 2 - d3.cloud.layout/d3.cloud.layout-tests.ts | 78 ++++---- d3kit/d3kit-tests.ts | 6 +- d3kit/v1/d3kit-tests.ts | 3 - .../datatables.net-buttons-tests.ts | 4 - .../datatables.net-fixedheader-tests.ts | 3 - .../datatables.net-select-tests.ts | 3 - datatables.net/datatables.net-tests.ts | 3 - dw-bxslider-4/dw-bxslider-4-tests.ts | 3 - dynatable/dynatable-tests.ts | 2 - ecurve/ecurve-tests.ts | 2 - ej.web.all/ej.web.all-tests.ts | 178 +++++++++--------- ej.web.all/index.d.ts | 2 +- .../electron-devtools-installer-tests.ts | 2 - ember/v1/ember-tests.ts | 3 - esprima/esprima-tests.ts | 3 - falcor-express/falcor-express-tests.ts | 4 - fancybox/fancybox-tests.ts | 3 - featherlight/featherlight-tests.ts | 2 - fixed-data-table/fixed-data-table-tests.tsx | 3 - flickity/flickity-tests.ts | 8 +- foundation-sites/foundation-sites-tests.ts | 8 - foundation/foundation-tests.ts | 3 - from/from-tests.ts | 3 - fs-ext/fs-ext-tests.ts | 9 +- .../fs-extra-promise-es6-tests.ts | 4 +- fs-extra-promise/fs-extra-promise-tests.ts | 3 - fs-extra/fs-extra-tests.ts | 3 - ftp/ftp-tests.ts | 9 +- fullcalendar/fullcalendar-tests.ts | 3 +- fullcalendar/v1/fullcalendar-tests.ts | 4 +- gijgo/gijgo-tests.ts | 1 - gldatepicker/gldatepicker-tests.ts | 2 - gm/gm-tests.ts | 3 - .../gregorian-calendar-tests.ts | 3 - gridfs-stream/gridfs-stream-tests.ts | 4 - gulp-babel/gulp-babel-tests.ts | 2 - gulp-cheerio/gulp-cheerio-tests.ts | 4 - gulp-dtsm/gulp-dtsm-tests.ts | 3 - gulp-help/gulp-help-tests.ts | 4 - gulp-html-replace/gulp-html-replace-tests.ts | 4 - gulp-useref/gulp-useref-tests.ts | 2 - hammerjs/v1/hammerjs-tests.ts | 3 - hystrixjs/hystrixjs-tests.ts | 3 - .../i18next-browser-languagedetector-tests.ts | 2 - .../i18next-xhr-backend-tests.ts | 3 - ibm-mobilefirst/ibm-mobilefirst-tests.ts | 4 +- .../imagemagick-native-tests.ts | 3 - imagemagick/imagemagick-tests.ts | 3 - jasmine-expect/jasmine-expect-tests.ts | 3 - jasmine-jquery/jasmine-jquery-tests.ts | 4 - jasmine-matchers/jasmine-matchers-tests.ts | 3 - joi/v6/joi-tests.ts | 1 - jqgrid/jqgrid-tests.ts | 2 - jqrangeslider/jqrangeslider-tests.ts | 6 +- jquery-ajax-chain/jquery-ajax-chain-tests.ts | 5 +- jquery-alertable/jquery-alertable-tests.ts | 3 - .../jquery-backstretch-tests.ts | 2 - jquery-cropbox/jquery-cropbox-tests.ts | 8 +- .../jquery-easy-loading-tests.ts | 3 - .../jquery-handsontable-tests.ts | 3 - .../jquery-jsonrpcclient-tests.ts | 2 - jquery-mockjax/jquery-mockjax-tests.ts | 1 - jquery-steps/index.d.ts | 5 +- jquery-steps/jquery-steps-tests.ts | 3 - jquery-timeentry/jquery-timeentry-tests.ts | 2 - jquery-urlparam/jquery-urlparam-tests.ts | 3 - jquery.ajaxfile/jquery.ajaxfile-tests.ts | 4 - .../jquery.are-you-sure-tests.ts | 7 - jquery.base64/jquery.base64-tests.ts | 3 - jquery.cleditor/jquery.cleditor-tests.ts | 2 - jquery.color/jquery.color-tests.ts | 2 - jquery.colorbox/jquery.colorbox-tests.ts | 2 - jquery.cookie/jquery.cookie-tests.ts | 2 - .../jquery.customselect-tests.ts | 3 - jquery.cycle/jquery.cycle-tests.ts | 8 +- jquery.cycle2/jquery.cycle2-tests.ts | 2 - jquery.finger/jquery.finger-tests.ts | 2 - jquery.flagstrap/jquery.flagstrap-tests.ts | 15 +- jquery.form/jquery.form-tests.ts | 152 ++++++++------- jquery.jnotify/jquery.jnotify-tests.ts | 2 - jquery.joyride/jquery.joyride-tests.ts | 3 - jquery.jsignature/jquery.jsignature-tests.ts | 6 +- jquery.leanmodal/jquery.leanmodal-tests.ts | 3 - .../jquery.livestampjs-tests.ts | 1 - jquery.menuaim/jquery.menuaim-tests.ts | 2 - jquery.mmenu/jquery.mmenu-tests.ts | 4 - jquery.payment/index.d.ts | 2 + jquery.payment/jquery.payment-tests.ts | 3 - .../jquery.pjax.falsandtru-tests.ts | 3 - jquery.pjax/jquery.pjax-tests.ts | 3 - .../jquery.placeholder-tests.ts | 2 - jquery.pnotify/jquery.pnotify-tests.ts | 3 - .../jquery.prettyphoto-tests.ts | 5 - jquery.qrcode/jquery.qrcode-tests.ts | 2 - jquery.rowgrid/jquery.rowgrid-tests.ts | 6 +- jquery.scrollto/jquery.scrollto-tests.ts | 2 - .../jquery.simplemodal-tests.ts | 2 - .../jquery.simplepagination-tests.ts | 2 - jquery.slimscroll/jquery.slimscroll-tests.ts | 2 - .../jquery.tagsmanager-tests.ts | 3 - jquery.timeago/jquery.timeago-tests.ts | 2 - jquery.timepicker/jquery.timepicker-tests.ts | 2 - jquery.timer/jquery.timer-tests.ts | 51 +++-- jquery.tipsy/jquery.tipsy-tests.ts | 2 - jquery.tools/jquery.tools-tests.ts | 2 - .../jquery.total-storage-tests.ts | 7 - jquery.transit/jquery.transit-tests.ts | 2 - .../jquery.ui.datetimepicker-tests.ts | 5 +- jquery.validation/jquery.validation-tests.ts | 5 +- jquery.watermark/jquery.watermark-tests.ts | 2 - jquery.window/jquery.window-tests.ts | 8 +- jquerymobile/jquerymobile-tests.ts | 3 - jqueryui/jqueryui-tests.ts | 3 - jsonwebtoken/jsonwebtoken-tests.ts | 12 +- jsrender/jsrender-tests.ts | 2 - jsx-chai/jsx-chai-tests.ts | 2 - kendo-ui/kendo-ui-tests.ts | 3 - klaw/klaw-tests.ts | 3 - .../knockout-amd-helpers-tests.ts | 3 - .../knockout-transformations-tests.ts | 3 - knockout.kogrid/knockout.kogrid-tests.ts | 52 +++-- knockout.mapping/knockout.mapping-tests.ts | 3 - .../knockout.projections-tests.ts | 5 - knockout.punches/knockout.punches-tests.ts | 3 - knockstrap/knockstrap-tests.ts | 6 - ko.plus/ko.plus-tests.ts | 29 +-- koa-logger/koa-logger-tests.ts | 2 - kolite/kolite-tests.ts | 3 - kue/kue-tests.ts | 2 - leaflet-curve/leaflet-curve-tests.ts | 2 - leaflet-draw/leaflet-draw-tests.ts | 2 - libpq/libpq-tests.ts | 1 - magicsuggest/magicsuggest-tests.ts | 2 - mailcheck/mailcheck-tests.ts | 2 - markitup/markitup-tests.ts | 3 - maskedinput/maskedinput-tests.ts | 7 - material-ui/material-ui-tests.tsx | 5 - mcustomscrollbar/mcustomscrollbar-tests.ts | 3 - md5/md5-tests.ts | 10 +- meteor-roles/meteor-roles-tests.ts | 3 - metismenu/metismenu-tests.ts | 2 - mssql/mssql-tests.ts | 2 - mu2/mu2-tests.ts | 3 - multiparty/multiparty-tests.ts | 2 - mz/mz-tests.ts | 3 - n3/n3-tests.ts | 4 +- ng-command/ng-command-tests.ts | 2 - ng-dialog/ng-dialog-tests.ts | 1 - ng-grid/ng-grid-tests.ts | 2 - ng-notify/ng-notify-tests.ts | 2 - ngprogress-lite/ngprogress-lite-tests.ts | 3 - node-hue-api/node-hue-api-tests.ts | 2 - node-int64/node-int64-tests.ts | 4 - .../node-mysql-wrapper-tests.ts | 4 - nouislider/v7/nouislider-tests.ts | 3 - npm/npm-tests.ts | 3 - on-finished/on-finished-tests.ts | 2 - onoff/onoff-tests.ts | 2 - openui5/openui5-tests.ts | 4 - oracledb/oracledb-tests.ts | 2 - owlcarousel/owlcarousel-tests.ts | 3 - passport-beam/passport-beam-tests.ts | 2 - passport-http/passport-http-tests.ts | 2 - paymentrequest/paymentrequest-tests.ts | 2 - peerjs/peerjs-tests.ts | 2 - phantomcss/index.d.ts | 2 +- phantomcss/phantomcss-tests.ts | 10 +- phonon/phonon-tests.ts | 2 - piwik-tracker/piwik-tracker-tests.ts | 20 +- pkcs11js/pkcs11js-tests.ts | 2 - pouchdb-find/pouchdb-find-tests.ts | 2 - .../pouchdb-replication-tests.ts | 2 - project-oxford/project-oxford-tests.ts | 3 - promised-temp/promised-temp-tests.ts | 3 - promptly/promptly-tests.ts | 2 - radius/radius-tests.ts | 3 - rangyinputs/rangyinputs-tests.ts | 2 - raty/raty-tests.ts | 4 - rc-select/rc-select-tests.ts | 9 +- react-bootstrap/react-bootstrap-tests.tsx | 6 - react-datagrid/react-datagrid-tests.tsx | 3 - .../react-dnd-html5-backend-tests.ts | 2 - react-dnd/UNUSED_FILES.txt | 1 - react-dnd/react-dnd-test-backend.d.ts | 20 -- react-dnd/react-dnd-tests.ts | 15 +- react-dropzone/react-dropzone-tests.tsx | 2 - react-helmet/react-helmet-tests.tsx | 3 - react-infinite/react-infinite-tests.tsx | 3 - .../react-input-calendar-tests.tsx | 3 - react-intl/react-intl-tests.tsx | 2 - react-intl/v1/react-intl-tests.tsx | 2 - react-mixin/react-mixin-tests.tsx | 3 - react-native/test/animated.tsx | 2 - react-native/test/index.tsx | 11 +- .../react-onclickoutside-tests.tsx | 5 - .../react-props-decorators-tests.ts | 3 - .../react-router-bootstrap-tests.tsx | 10 +- react-scroll/react-scroll-tests.tsx | 2 - react-spinkit/react-spinkit-tests.tsx | 3 - react-tabs/react-tabs-tests.ts | 4 - react-tagcloud/react-tagcloud-tests.tsx | 5 - react-widgets/react-widgets-tests.tsx | 9 +- readdir-stream/readdir-stream-tests.ts | 3 - redux-debounced/redux-debounced-tests.ts | 2 - .../redux-devtools-dock-monitor-tests.tsx | 2 - .../redux-devtools-log-monitor-tests.tsx | 2 - redux-devtools/redux-devtools-tests.tsx | 3 - resolve/resolve-tests.ts | 2 - rx.wamp/rx.wamp-tests.ts | 3 - s3-upload-stream/s3-upload-stream-tests.ts | 3 - sax/sax-tests.ts | 2 - seamless/seamless-tests.ts | 2 - select2/select2-tests.ts | 3 - selectize/selectize-tests.ts | 3 - shelljs/shelljs-tests.ts | 6 - sinon-as-promised/sinon-as-promised-tests.ts | 2 - sinon-mongoose/sinon-mongoose-tests.ts | 2 - slick-carousel/slick-carousel-tests.ts | 4 - slickgrid/test/index.ts | 3 - socket.io-redis/socket.io-redis-tests.ts | 2 - socket.io.users/socket.io.users-tests.ts | 4 - source-list-map/source-list-map-tests.ts | 1 - spectrum/spectrum-tests.ts | 3 - split/split-tests.ts | 3 - sql.js/sql.js-tests.ts | 3 - ss-utils/ss-utils-tests.ts | 15 +- static-eval/static-eval-tests.ts | 2 - stream-to-array/stream-to-array-tests.ts | 3 - stylus/stylus-tests.ts | 10 +- superagent/superagent-tests.ts | 3 - .../supertest-as-promised-tests.ts | 6 +- tapable/tapable-tests.ts | 2 - tape/tape-tests.ts | 3 - tar/tar-tests.ts | 2 - tether-drop/tether-drop-tests.ts | 1 - .../test/canvas/canvas_camera_orthographic.ts | 3 - three/test/canvas/canvas_geometry_cube.ts | 3 - .../canvas/canvas_interactive_cubes_tween.ts | 2 - .../test/canvas/canvas_lights_pointlights.ts | 3 - three/test/canvas/canvas_materials.ts | 3 - three/test/canvas/canvas_particles_floor.ts | 3 - three/test/css3d/css3d_periodictable.ts | 2 - three/test/css3d/css3d_sprites.ts | 2 - three/test/examples/controls/vrcontrols.ts | 2 - three/test/examples/ctm/ctmloader.ts | 2 - three/test/examples/detector.ts | 4 - three/test/examples/effects/vreffect.ts | 2 - three/test/examples/octree.ts | 2 - three/test/math/test_unit_math.ts | 3 - three/test/webgl/webgl_animation_cloth.ts | 3 - .../webgl/webgl_animation_skinning_morph.ts | 3 - three/test/webgl/webgl_buffergeometry.ts | 3 - three/test/webgl/webgl_camera.ts | 3 - three/test/webgl/webgl_custom_attributes.ts | 3 - three/test/webgl/webgl_geometries.ts | 3 - three/test/webgl/webgl_helpers.ts | 3 - three/test/webgl/webgl_interactive_cubes.ts | 3 - .../webgl_interactive_raycasting_points.ts | 3 - three/test/webgl/webgl_lensflares.ts | 3 - three/test/webgl/webgl_lights_hemisphere.ts | 3 - three/test/webgl/webgl_lines_colors.ts | 3 - three/test/webgl/webgl_loader_awd.ts | 3 - three/test/webgl/webgl_materials.ts | 3 - three/test/webgl/webgl_morphtargets.ts | 3 - three/test/webgl/webgl_points_billboards.ts | 3 - three/test/webgl/webgl_postprocessing.ts | 3 - three/test/webgl/webgl_shader.ts | 3 - three/test/webgl/webgl_sprites.ts | 3 - through2/through2-tests.ts | 3 - through2/v0/through2-tests.ts | 3 - typeahead/typeahead-tests.ts | 2 - uuid-1345/uuid-1345-tests.ts | 3 - valerie/valerie-tests.ts | 12 -- validator/validator-tests.ts | 3 - vex-js/vex-js-tests.ts | 1 - vinyl/vinyl-tests.ts | 4 - voronoi-diagram/voronoi-diagram-tests.ts | 2 - wake_on_lan/wake_on_lan-tests.ts | 3 - webgme/webgme-tests.ts | 72 ++++--- webpack-sources/webpack-sources-tests.ts | 2 - x-editable/x-editable-tests.ts | 7 - xmlpoke/xmlpoke-tests.ts | 4 - xrm/v7/xrm-tests.ts | 2 - 358 files changed, 392 insertions(+), 1381 deletions(-) delete mode 100644 react-dnd/UNUSED_FILES.txt delete mode 100644 react-dnd/react-dnd-test-backend.d.ts diff --git a/acorn/acorn-tests.ts b/acorn/acorn-tests.ts index bda6844c84..72ca71d2f6 100644 --- a/acorn/acorn-tests.ts +++ b/acorn/acorn-tests.ts @@ -1,5 +1,3 @@ -/// - import acorn = require('acorn'); import * as ESTree from 'estree'; diff --git a/amplify/amplify-tests.ts b/amplify/amplify-tests.ts index edf2988122..b4f98ccd5b 100644 --- a/amplify/amplify-tests.ts +++ b/amplify/amplify-tests.ts @@ -1,6 +1,3 @@ - -/// - import amplify = require("amplify"); // Copied examples directly from AmplifyJs site diff --git a/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts b/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts index 4ff5b4cf19..1efc5d0391 100644 --- a/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts +++ b/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts @@ -1,6 +1,3 @@ -/// -/// - var myApp = angular.module('testModule'); interface MyAppScope extends ng.IScope { diff --git a/angular-feature-flags/angular-feature-flags-tests.ts b/angular-feature-flags/angular-feature-flags-tests.ts index 8ca17e4962..ac956dd657 100644 --- a/angular-feature-flags/angular-feature-flags-tests.ts +++ b/angular-feature-flags/angular-feature-flags-tests.ts @@ -1,5 +1,3 @@ -/// - import * as angular from "angular"; let myApp = angular.module('myApp', ['feature-flags']); diff --git a/angular-hotkeys/angular-hotkeys-tests.ts b/angular-hotkeys/angular-hotkeys-tests.ts index 1f87ecefdf..c0bd9b974d 100644 --- a/angular-hotkeys/angular-hotkeys-tests.ts +++ b/angular-hotkeys/angular-hotkeys-tests.ts @@ -1,5 +1,3 @@ -/// - var scope: ng.IScope; var hotkeyProvider: ng.hotkeys.HotkeysProvider; var hotkeyObj: ng.hotkeys.Hotkey; diff --git a/angular-jwt/angular-jwt-tests.ts b/angular-jwt/angular-jwt-tests.ts index b20b2eea9d..88b177ba74 100644 --- a/angular-jwt/angular-jwt-tests.ts +++ b/angular-jwt/angular-jwt-tests.ts @@ -1,5 +1,3 @@ -/// - var app = angular.module("angular-jwt-tests", ["angular-jwt"]); var $jwtHelper: ng.jwt.IJwtHelper; diff --git a/angular-modal/angular-modal-tests.ts b/angular-modal/angular-modal-tests.ts index 5be313840b..edb4d7e6ef 100644 --- a/angular-modal/angular-modal-tests.ts +++ b/angular-modal/angular-modal-tests.ts @@ -1,5 +1,3 @@ -/// - var btfModal: angularModal.AngularModalFactory; // Using template URL diff --git a/archiver/archiver-tests.ts b/archiver/archiver-tests.ts index d79b29f079..f186fb9bcb 100644 --- a/archiver/archiver-tests.ts +++ b/archiver/archiver-tests.ts @@ -1,6 +1,3 @@ - -/// - import Archiver = require('archiver'); import FS = require('fs'); diff --git a/atom/atom-tests.ts b/atom/atom-tests.ts index 37b2fb314c..1b141fb492 100644 --- a/atom/atom-tests.ts +++ b/atom/atom-tests.ts @@ -1,5 +1,4 @@ /// -/// import path = require("path"); import _atom = require("atom"); diff --git a/auth0/auth0-tests.ts b/auth0/auth0-tests.ts index 502a72eec1..24a4aad87d 100644 --- a/auth0/auth0-tests.ts +++ b/auth0/auth0-tests.ts @@ -1,5 +1,3 @@ -/// - import * as auth0 from 'auth0'; const management = new auth0.ManagementClient({ diff --git a/autosize/autosize-tests.ts b/autosize/autosize-tests.ts index a7eea57a62..fa0988be24 100644 --- a/autosize/autosize-tests.ts +++ b/autosize/autosize-tests.ts @@ -1,5 +1,3 @@ -/// - // from a NodeList autosize(document.querySelectorAll('textarea')); diff --git a/aws-lambda/aws-lambda-tests.ts b/aws-lambda/aws-lambda-tests.ts index fb09beda8a..7b0fe45180 100644 --- a/aws-lambda/aws-lambda-tests.ts +++ b/aws-lambda/aws-lambda-tests.ts @@ -1,5 +1,3 @@ -/// - var str: string = "any string"; var date: Date = new Date(); var anyObj: any = { abc: 123 }; diff --git a/babel-template/babel-template-tests.ts b/babel-template/babel-template-tests.ts index b5d4547188..31e3bd44d9 100644 --- a/babel-template/babel-template-tests.ts +++ b/babel-template/babel-template-tests.ts @@ -1,7 +1,4 @@ - /// -/// - // Example from https://github.com/babel/babel/tree/master/packages/babel-template import template = require('babel-template'); diff --git a/babel-traverse/babel-traverse-tests.ts b/babel-traverse/babel-traverse-tests.ts index 3779852c5f..98afbbc0a7 100644 --- a/babel-traverse/babel-traverse-tests.ts +++ b/babel-traverse/babel-traverse-tests.ts @@ -1,5 +1,3 @@ - -/// /// diff --git a/babylon/babylon-tests.ts b/babylon/babylon-tests.ts index bb95625935..769d635e89 100644 --- a/babylon/babylon-tests.ts +++ b/babylon/babylon-tests.ts @@ -1,8 +1,3 @@ - -/// -/// - - // Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babylon import * as babylon from "babylon"; declare function assert(expr: boolean): void; diff --git a/backbone.layoutmanager/backbone.layoutmanager-tests.ts b/backbone.layoutmanager/backbone.layoutmanager-tests.ts index fe11ce9b18..edddb8352b 100644 --- a/backbone.layoutmanager/backbone.layoutmanager-tests.ts +++ b/backbone.layoutmanager/backbone.layoutmanager-tests.ts @@ -1,5 +1,3 @@ -/// - import * as Backbone from 'backbone'; // Example code. @@ -26,7 +24,7 @@ class View extends Backbone.Layout { "mouseleave": "removeElement" } } - + wrapElement(): void { this.$el.wrap(""); } diff --git a/backbone/backbone-tests.ts b/backbone/backbone-tests.ts index accdb93979..c074ac57e5 100644 --- a/backbone/backbone-tests.ts +++ b/backbone/backbone-tests.ts @@ -1,5 +1,3 @@ -/// - function test_events() { var object = new Backbone.Events(); diff --git a/bardjs/bardjs-tests.ts b/bardjs/bardjs-tests.ts index 2d312634ca..91172b7255 100644 --- a/bardjs/bardjs-tests.ts +++ b/bardjs/bardjs-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as angular from 'angular'; import 'angular-mocks'; diff --git a/batch-stream/batch-stream-tests.ts b/batch-stream/batch-stream-tests.ts index d3195466e8..4554530072 100644 --- a/batch-stream/batch-stream-tests.ts +++ b/batch-stream/batch-stream-tests.ts @@ -1,5 +1,3 @@ -/// - import fs = require('fs'); import BatchStream = require('batch-stream'); diff --git a/bazinga-translator/bazinga-translator-tests.ts b/bazinga-translator/bazinga-translator-tests.ts index 8c5d1dafa8..3856ff22a1 100644 --- a/bazinga-translator/bazinga-translator-tests.ts +++ b/bazinga-translator/bazinga-translator-tests.ts @@ -1,5 +1,3 @@ -/// - Translator.fallback = 'en'; Translator.defaultDomain = 'messages'; diff --git a/bezier-js/bezier-js-tests.ts b/bezier-js/bezier-js-tests.ts index f5fba4d947..003b6e1c45 100644 --- a/bezier-js/bezier-js-tests.ts +++ b/bezier-js/bezier-js-tests.ts @@ -1,5 +1,3 @@ -/// - function test() { var bezierjs: typeof BezierJs; diff --git a/bingmaps/bingmaps-tests.ts b/bingmaps/bingmaps-tests.ts index 239e33094a..e83ff89aba 100644 --- a/bingmaps/bingmaps-tests.ts +++ b/bingmaps/bingmaps-tests.ts @@ -1,10 +1,3 @@ -/// -/// -/// -/// -/// -/// - namespace BingMapsTests { // An interactive set of Bing Maps AJAX control usages can be found at http://www.bingmapsportal.com/isdk/ajaxv7 diff --git a/bit-array/bit-array-tests.ts b/bit-array/bit-array-tests.ts index 7c1ff57b1b..7d50de143c 100644 --- a/bit-array/bit-array-tests.ts +++ b/bit-array/bit-array-tests.ts @@ -1,5 +1,3 @@ -/// - import BitArray = require("bit-array"); const a = new BitArray(32); diff --git a/blob-stream/blob-stream-tests.ts b/blob-stream/blob-stream-tests.ts index b9174859f9..40f9888788 100644 --- a/blob-stream/blob-stream-tests.ts +++ b/blob-stream/blob-stream-tests.ts @@ -1,6 +1,3 @@ - -/// - var bl = require('blob-stream'); var blob = bl.toBlob(); diff --git a/blue-tape/blue-tape-tests.ts b/blue-tape/blue-tape-tests.ts index 92b2641115..c34bc6e32c 100644 --- a/blue-tape/blue-tape-tests.ts +++ b/blue-tape/blue-tape-tests.ts @@ -1,4 +1,3 @@ -/// /// import tape = require('blue-tape'); diff --git a/bluebird-retry/bluebird-retry-tests.ts b/bluebird-retry/bluebird-retry-tests.ts index b63b360160..eb3260a007 100644 --- a/bluebird-retry/bluebird-retry-tests.ts +++ b/bluebird-retry/bluebird-retry-tests.ts @@ -1,5 +1,3 @@ - -/// import Promise = require('bluebird'); import retry = require('bluebird-retry'); diff --git a/bootpag/bootpag-tests.ts b/bootpag/bootpag-tests.ts index 6a5503f9f8..a0a2a78cc3 100644 --- a/bootpag/bootpag-tests.ts +++ b/bootpag/bootpag-tests.ts @@ -1,5 +1,3 @@ -/// - var pagerSelector = ".bootpager"; var $pager = $(pagerSelector); diff --git a/bootstrap-datepicker/bootstrap-datepicker-tests.ts b/bootstrap-datepicker/bootstrap-datepicker-tests.ts index cedc28c93c..372967ec21 100644 --- a/bootstrap-datepicker/bootstrap-datepicker-tests.ts +++ b/bootstrap-datepicker/bootstrap-datepicker-tests.ts @@ -1,4 +1,3 @@ -/// function tests_simple() { $('#datepicker').datepicker(); $('#datepicker').datepicker({ diff --git a/bootstrap-maxlength/bootstrap-maxlength-tests.ts b/bootstrap-maxlength/bootstrap-maxlength-tests.ts index 32255bc66b..92c3f1b57e 100644 --- a/bootstrap-maxlength/bootstrap-maxlength-tests.ts +++ b/bootstrap-maxlength/bootstrap-maxlength-tests.ts @@ -1,5 +1,3 @@ -/// - // Examples from the projects github page $('input[maxlength]').maxlength(); diff --git a/bootstrap-notify/bootstrap-notify-tests.ts b/bootstrap-notify/bootstrap-notify-tests.ts index 5ae4f2ffc1..2977d39abf 100644 --- a/bootstrap-notify/bootstrap-notify-tests.ts +++ b/bootstrap-notify/bootstrap-notify-tests.ts @@ -1,6 +1,3 @@ - -/// - //Test for bootstrap-notify v3.1.3 //Copied example directly from Bootstrap-notify site diff --git a/bootstrap-select/bootstrap-select-tests.ts b/bootstrap-select/bootstrap-select-tests.ts index e2e8c88560..55900b3ab7 100644 --- a/bootstrap-select/bootstrap-select-tests.ts +++ b/bootstrap-select/bootstrap-select-tests.ts @@ -1,5 +1,3 @@ -/// - $(".selectpicker").selectpicker({ actionsBox: true, container: "body", diff --git a/bootstrap-slider/bootstrap-slider-tests.ts b/bootstrap-slider/bootstrap-slider-tests.ts index 98701cedc3..df143d4c72 100644 --- a/bootstrap-slider/bootstrap-slider-tests.ts +++ b/bootstrap-slider/bootstrap-slider-tests.ts @@ -1,6 +1,3 @@ -/// - - $(function() { // examples from http://seiyria.github.io/bootstrap-slider/ diff --git a/bootstrap-switch/bootstrap-switch-tests.ts b/bootstrap-switch/bootstrap-switch-tests.ts index 539399a78e..65fafff2e9 100644 --- a/bootstrap-switch/bootstrap-switch-tests.ts +++ b/bootstrap-switch/bootstrap-switch-tests.ts @@ -1,9 +1,6 @@ -/// - - function test_cases() { $('#switch').bootstrapSwitch(); - + $('#switch').bootstrapSwitch({ state: false }); @@ -15,7 +12,7 @@ function test_cases() { //var mySwitch = $('#switch').get(0); //mySwitch.toggleAnimate(); - + $('#switch').bootstrapSwitch('state', true, true); $('#switch').bootstrapSwitch('state') === true; diff --git a/bootstrap-touchspin/bootstrap-touchspin-tests.ts b/bootstrap-touchspin/bootstrap-touchspin-tests.ts index c8a6a713f9..7d1ea73437 100644 --- a/bootstrap-touchspin/bootstrap-touchspin-tests.ts +++ b/bootstrap-touchspin/bootstrap-touchspin-tests.ts @@ -1,6 +1,3 @@ -/// - - $(function () { // Example 1 from http://www.virtuosoft.eu/code/bootstrap-touchspin/ $("input[name='demo1']").TouchSpin({ @@ -26,7 +23,7 @@ $(function () { $("input[name='demo_vertical']").TouchSpin({ verticalbuttons: true }); - + // Example 4 from http://www.virtuosoft.eu/code/bootstrap-touchspin/ $("input[name='demo_vertical2']").TouchSpin({ verticalbuttons: true, diff --git a/bootstrap-validator/bootstrap-validator-tests.ts b/bootstrap-validator/bootstrap-validator-tests.ts index 07d4753ed1..e43a094184 100644 --- a/bootstrap-validator/bootstrap-validator-tests.ts +++ b/bootstrap-validator/bootstrap-validator-tests.ts @@ -1,5 +1,3 @@ -/// - $('#myForm').validator(); $('#myForm').validator('update'); $('#myForm').validator('validate'); diff --git a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts index 3373bdb9e8..575f72b7cb 100644 --- a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts +++ b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts @@ -1,5 +1,3 @@ -/// - import * as moment from "moment"; const dp = $("#picker").datetimepicker().data("DateTimePicker"); diff --git a/bootstrap/bootstrap-tests.ts b/bootstrap/bootstrap-tests.ts index cef85d5d42..cd786b41a7 100644 --- a/bootstrap/bootstrap-tests.ts +++ b/bootstrap/bootstrap-tests.ts @@ -1,6 +1,3 @@ -/// - - $('body').off('.data-api'); $('body').off('.alert.data-api'); diff --git a/browser-resolve/browser-resolve-tests.ts b/browser-resolve/browser-resolve-tests.ts index 2225f7754c..7d08de726f 100644 --- a/browser-resolve/browser-resolve-tests.ts +++ b/browser-resolve/browser-resolve-tests.ts @@ -1,5 +1,3 @@ -/// - import * as browserResolve from 'browser-resolve'; function basic_test_async(callback: (err?: Error, resolved?: string) => void) { diff --git a/business-rules-engine/business-rules-engine-tests.ts b/business-rules-engine/business-rules-engine-tests.ts index 3ffbe2948c..4ae31155f2 100644 --- a/business-rules-engine/business-rules-engine-tests.ts +++ b/business-rules-engine/business-rules-engine-tests.ts @@ -1,4 +1,3 @@ -/// import * as Validators from 'business-rules-engine/node-validators'; import Validation = require("business-rules-engine"); diff --git a/cachefactory/cachefactory-tests.ts b/cachefactory/cachefactory-tests.ts index 73397dd8bf..32eeb63257 100644 --- a/cachefactory/cachefactory-tests.ts +++ b/cachefactory/cachefactory-tests.ts @@ -1,5 +1,3 @@ -/// - CacheFactory.get('test'); CacheFactory.createCache('test', { diff --git a/cal-heatmap/cal-heatmap-tests.ts b/cal-heatmap/cal-heatmap-tests.ts index 47020b811c..ff0e3c0d06 100644 --- a/cal-heatmap/cal-heatmap-tests.ts +++ b/cal-heatmap/cal-heatmap-tests.ts @@ -1,6 +1,4 @@ - /// -/// var cal = new CalHeatMap(); cal.init(); diff --git a/cassandra-driver/cassandra-driver-tests.ts b/cassandra-driver/cassandra-driver-tests.ts index 9feee249ac..e5d8f2ab60 100644 --- a/cassandra-driver/cassandra-driver-tests.ts +++ b/cassandra-driver/cassandra-driver-tests.ts @@ -1,5 +1,3 @@ -/// - import * as cassandra from 'cassandra-driver'; import * as util from 'util'; diff --git a/cbor/cbor-tests.ts b/cbor/cbor-tests.ts index e1a7abb9cf..eb84201b97 100644 --- a/cbor/cbor-tests.ts +++ b/cbor/cbor-tests.ts @@ -1,5 +1,3 @@ -/// - import cbor = require('cbor'); import assert = require('assert'); import fs = require('fs'); diff --git a/chai-as-promised/chai-as-promised-tests.ts b/chai-as-promised/chai-as-promised-tests.ts index 7e22c575aa..d9f681769b 100644 --- a/chai-as-promised/chai-as-promised-tests.ts +++ b/chai-as-promised/chai-as-promised-tests.ts @@ -1,5 +1,3 @@ -/// - import chai = require('chai'); import chaiAsPromised = require('chai-as-promised'); import Q = require('q'); diff --git a/chai-enzyme/chai-enzyme-tests.tsx b/chai-enzyme/chai-enzyme-tests.tsx index a75e99c756..8fc64e2711 100644 --- a/chai-enzyme/chai-enzyme-tests.tsx +++ b/chai-enzyme/chai-enzyme-tests.tsx @@ -1,7 +1,3 @@ -/// -/// -/// - import * as React from "react"; import * as chaiEnzyme from "chai-enzyme"; import { expect } from "chai"; diff --git a/chai-spies/chai-spies-tests.ts b/chai-spies/chai-spies-tests.ts index 7ac0610e4d..326b1e0137 100644 --- a/chai-spies/chai-spies-tests.ts +++ b/chai-spies/chai-spies-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as chai from 'chai'; import * as spies from 'chai-spies'; import * as Mocha from 'mocha'; diff --git a/chocolatechipjs/chocolatechipjs-tests.ts b/chocolatechipjs/chocolatechipjs-tests.ts index 465ea2b0a9..7036358aed 100644 --- a/chocolatechipjs/chocolatechipjs-tests.ts +++ b/chocolatechipjs/chocolatechipjs-tests.ts @@ -1,4 +1,3 @@ -/// // ChocolateChipStatic -- DOM creation, etc. $(function() { alert('Ready to do stuff!'); @@ -282,7 +281,7 @@ fetch('../controllers/php-post.php', { }, body: formData }) -.then($.json) +.then($.json) .then(function(data: any): any { if(data.email_check == "valid"){ $("#message_ajax").html("

    " + data.email + " is a valid e-mail address. Thank you, " + data.name + ".
    "); @@ -300,12 +299,12 @@ interface putData { var putData = $('#fileText').val(); fetch('../controllers/php-put.php', { method: 'put', - headers: { - "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" + headers: { + "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" }, body: putData }) -.then($.json) +.then($.json) .then(function(data:any): any { console.dir(data.base); $("#message_ajax").append('

    ' + data.result + '

    '); @@ -324,12 +323,12 @@ interface deleteData { var file = $('#fileName').val(); fetch('../controllers/php-delete.php', { method: 'delete', - headers: { - "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" + headers: { + "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" }, body: file }) -.then($.json) +.then($.json) .then(function(data: any): any { $("#message_ajax").html("
    DELETE was sent to the server successfully.
    "); $("#message_ajax").append('

    ' + data.result + '

    '); diff --git a/cliff/cliff-tests.ts b/cliff/cliff-tests.ts index 9217d9a38a..e69de29bb2 100644 --- a/cliff/cliff-tests.ts +++ b/cliff/cliff-tests.ts @@ -1 +0,0 @@ -/// \ No newline at end of file diff --git a/co-body/co-body-tests.ts b/co-body/co-body-tests.ts index 6011632399..944cadd394 100644 --- a/co-body/co-body-tests.ts +++ b/co-body/co-body-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as koa from 'koa'; import * as parse from 'co-body'; diff --git a/coinstring/coinstring-tests.ts b/coinstring/coinstring-tests.ts index ab11a44fb7..1cc3fb9a42 100644 --- a/coinstring/coinstring-tests.ts +++ b/coinstring/coinstring-tests.ts @@ -1,8 +1,5 @@ -/// - import cs = require('coinstring'); - var privateKeyHex = "1184cd2cdd640ca42cfc3a091c51d549b2f016d454b2774019c2b2d2e08529fd"; var privateKeyHexBuf = new Buffer(privateKeyHex, 'hex'); var version = 0x80; // Bitcoin private key diff --git a/connect-redis/connect-redis-tests.ts b/connect-redis/connect-redis-tests.ts index ed21f3b4be..3c50074117 100644 --- a/connect-redis/connect-redis-tests.ts +++ b/connect-redis/connect-redis-tests.ts @@ -1,5 +1,3 @@ -/// - import * as connectRedis from "connect-redis"; import * as session from "express-session"; diff --git a/cookies/cookies-tests.ts b/cookies/cookies-tests.ts index 30e07d3000..5a2ad1e4a7 100644 --- a/cookies/cookies-tests.ts +++ b/cookies/cookies-tests.ts @@ -1,5 +1,3 @@ -/// - import * as Cookies from 'cookies'; import * as http from 'http'; diff --git a/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts b/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts index 4dafa2e966..1c62521293 100644 --- a/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts +++ b/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts @@ -1,5 +1,3 @@ -/// - window.addEventListener('batterystatus', (ev: BatteryStatusEvent) => { console.log('Battery level is ' + ev.level); }); diff --git a/cordova-plugin-camera/cordova-plugin-camera-tests.ts b/cordova-plugin-camera/cordova-plugin-camera-tests.ts index 00edf02b0a..2f1b661775 100644 --- a/cordova-plugin-camera/cordova-plugin-camera-tests.ts +++ b/cordova-plugin-camera/cordova-plugin-camera-tests.ts @@ -1,5 +1,3 @@ -/// - navigator.camera.getPicture( (data: string) => { alert('Got photo!'); }, (message: string)=> { alert('Failed!: ' + message); }, diff --git a/cordova-plugin-contacts/cordova-plugin-contacts-tests.ts b/cordova-plugin-contacts/cordova-plugin-contacts-tests.ts index c50912c3ba..26243ab43a 100644 --- a/cordova-plugin-contacts/cordova-plugin-contacts-tests.ts +++ b/cordova-plugin-contacts/cordova-plugin-contacts-tests.ts @@ -1,5 +1,3 @@ -/// - var contact: Contact = navigator.contacts.create({ nickname: 'John Smith', displayName: 'John Smith', diff --git a/cordova-plugin-device-motion/cordova-plugin-device-motion-tests.ts b/cordova-plugin-device-motion/cordova-plugin-device-motion-tests.ts index 17b1e49930..1b335beaf7 100644 --- a/cordova-plugin-device-motion/cordova-plugin-device-motion-tests.ts +++ b/cordova-plugin-device-motion/cordova-plugin-device-motion-tests.ts @@ -1,5 +1,3 @@ -/// - navigator.accelerometer.getCurrentAcceleration( (acc: Acceleration) => { console.log('X: ' + acc.x + 'Y: ' + acc.y + 'Z: ' + acc.z); }, () => { alert('Error!'); }); diff --git a/cordova-plugin-device-orientation/cordova-plugin-device-orientation-tests.ts b/cordova-plugin-device-orientation/cordova-plugin-device-orientation-tests.ts index 097a66e99e..ab025d5fbf 100644 --- a/cordova-plugin-device-orientation/cordova-plugin-device-orientation-tests.ts +++ b/cordova-plugin-device-orientation/cordova-plugin-device-orientation-tests.ts @@ -1,5 +1,3 @@ -/// - navigator.compass.getCurrentHeading( (heading: CompassHeading)=> { console.log('Got heading to ' + heading.magneticHeading); }, (error: CompassError)=> { alert('Error! ' + error.code); }, diff --git a/cordova-plugin-device/cordova-plugin-device-tests.ts b/cordova-plugin-device/cordova-plugin-device-tests.ts index 450eadb1f0..cb894785c2 100644 --- a/cordova-plugin-device/cordova-plugin-device-tests.ts +++ b/cordova-plugin-device/cordova-plugin-device-tests.ts @@ -1,3 +1 @@ -/// - console.log(JSON.stringify(device)); \ No newline at end of file diff --git a/cordova-plugin-dialogs/cordova-plugin-dialogs-tests.ts b/cordova-plugin-dialogs/cordova-plugin-dialogs-tests.ts index dd9396f36f..498d7d1000 100644 --- a/cordova-plugin-dialogs/cordova-plugin-dialogs-tests.ts +++ b/cordova-plugin-dialogs/cordova-plugin-dialogs-tests.ts @@ -1,4 +1,2 @@ -/// - navigator.notification.alert('Alert!', () => { alert('You\'re alerted'); }, 'Alert', 'Ok'); navigator.notification.confirm('Are you ok?', (choice: number) => { alert('Your choice is ' + choice); }); diff --git a/cordova-plugin-file-transfer/cordova-plugin-file-transfer-tests.ts b/cordova-plugin-file-transfer/cordova-plugin-file-transfer-tests.ts index 4050b2c4aa..eec24db2e0 100644 --- a/cordova-plugin-file-transfer/cordova-plugin-file-transfer-tests.ts +++ b/cordova-plugin-file-transfer/cordova-plugin-file-transfer-tests.ts @@ -1,5 +1,3 @@ -/// - var file = new FileTransfer(); file.onprogress = (ev: ProgressEvent) => { diff --git a/cordova-plugin-file/cordova-plugin-file-tests.ts b/cordova-plugin-file/cordova-plugin-file-tests.ts index bd9d7de672..37538434e3 100644 --- a/cordova-plugin-file/cordova-plugin-file-tests.ts +++ b/cordova-plugin-file/cordova-plugin-file-tests.ts @@ -1,5 +1,4 @@ /// -/// function fsaccessor(fs: FileSystem) { console.log('FS root is: ' + fs.root.name); diff --git a/cordova-plugin-globalization/cordova-plugin-globalization-tests.ts b/cordova-plugin-globalization/cordova-plugin-globalization-tests.ts index 0a58703a32..4b80f2ff72 100644 --- a/cordova-plugin-globalization/cordova-plugin-globalization-tests.ts +++ b/cordova-plugin-globalization/cordova-plugin-globalization-tests.ts @@ -1,5 +1,3 @@ -/// - navigator.globalization.dateToString(new Date(), (date) => { console.log(JSON.stringify(date)); }, (error) => { alert(error.message); }, diff --git a/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts b/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts index 43b0d28153..cef288c921 100644 --- a/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts +++ b/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts @@ -1,5 +1,3 @@ -/// - // InAppBrowser plugin //---------------------------------------------------------------------- diff --git a/cordova-plugin-keyboard/cordova-plugin-keyboard-tests.ts b/cordova-plugin-keyboard/cordova-plugin-keyboard-tests.ts index 3dce2776bf..767eaa6ed2 100644 --- a/cordova-plugin-keyboard/cordova-plugin-keyboard-tests.ts +++ b/cordova-plugin-keyboard/cordova-plugin-keyboard-tests.ts @@ -1,5 +1,3 @@ -/// - Keyboard.shrinkView(true); Keyboard.shrinkView(false); Keyboard.hideFormAccessoryBar(true); diff --git a/cordova-plugin-media-capture/cordova-plugin-media-capture-tests.ts b/cordova-plugin-media-capture/cordova-plugin-media-capture-tests.ts index 8bd56c714f..91fdefa74f 100644 --- a/cordova-plugin-media-capture/cordova-plugin-media-capture-tests.ts +++ b/cordova-plugin-media-capture/cordova-plugin-media-capture-tests.ts @@ -1,5 +1,3 @@ -/// - console.log('Supported audio modes are: ' + JSON.stringify(navigator.device.capture.supportedAudioModes)); navigator.device.capture.captureAudio( diff --git a/cordova-plugin-media/cordova-plugin-media-tests.ts b/cordova-plugin-media/cordova-plugin-media-tests.ts index 76e39c8d7b..1c00c850e5 100644 --- a/cordova-plugin-media/cordova-plugin-media-tests.ts +++ b/cordova-plugin-media/cordova-plugin-media-tests.ts @@ -1,5 +1,3 @@ -/// - // Media and Media Capture //---------------------------------------------------------------------- diff --git a/cordova-plugin-network-information/cordova-plugin-network-information-tests.ts b/cordova-plugin-network-information/cordova-plugin-network-information-tests.ts index 702aeb5714..0c4bfd7a2d 100644 --- a/cordova-plugin-network-information/cordova-plugin-network-information-tests.ts +++ b/cordova-plugin-network-information/cordova-plugin-network-information-tests.ts @@ -1,5 +1,3 @@ -/// - var connType = navigator.connection.type; if (connType == Connection.WIFI) { console.log('Congratulations, you\'re with fast Internet!'); diff --git a/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts b/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts index d24720eb1d..5938396ad4 100644 --- a/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts +++ b/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts @@ -1,4 +1,2 @@ -/// - navigator.splashscreen.show(); navigator.splashscreen.hide(); \ No newline at end of file diff --git a/cordova-plugin-statusbar/cordova-plugin-statusbar-tests.ts b/cordova-plugin-statusbar/cordova-plugin-statusbar-tests.ts index 9d22ca912c..623211d6c6 100644 --- a/cordova-plugin-statusbar/cordova-plugin-statusbar-tests.ts +++ b/cordova-plugin-statusbar/cordova-plugin-statusbar-tests.ts @@ -1,6 +1,3 @@ -/// - - var statusBar: StatusBar = window.StatusBar; statusBar.overlaysWebView(true); statusBar.overlaysWebView(false); diff --git a/cordova-plugin-vibration/cordova-plugin-vibration-tests.ts b/cordova-plugin-vibration/cordova-plugin-vibration-tests.ts index b34cd23675..33cdb43436 100644 --- a/cordova-plugin-vibration/cordova-plugin-vibration-tests.ts +++ b/cordova-plugin-vibration/cordova-plugin-vibration-tests.ts @@ -1,5 +1,3 @@ -/// - var notification: Notification; notification.vibrate(100); diff --git a/cordova-plugin-websql/cordova-plugin-websql-tests.ts b/cordova-plugin-websql/cordova-plugin-websql-tests.ts index 8679b3d5c3..c6299a489c 100644 --- a/cordova-plugin-websql/cordova-plugin-websql-tests.ts +++ b/cordova-plugin-websql/cordova-plugin-websql-tests.ts @@ -1,6 +1,3 @@ -/// - - var db = window.openDatabase('Test', '0.1', 'test', 1024 * 1024 * 5); db.transaction( (tx: SqlTransaction) => { diff --git a/cryptojs/test/md5-tests.ts b/cryptojs/test/md5-tests.ts index d44496aae5..4063750d7d 100644 --- a/cryptojs/test/md5-tests.ts +++ b/cryptojs/test/md5-tests.ts @@ -1,6 +1,3 @@ -/// - - YUI.add('algo-md5-test', function (Y) { var C = CryptoJS; diff --git a/css-modules-require-hook/css-modules-require-hook-tests.ts b/css-modules-require-hook/css-modules-require-hook-tests.ts index 0e2e366f96..ea80474dc5 100644 --- a/css-modules-require-hook/css-modules-require-hook-tests.ts +++ b/css-modules-require-hook/css-modules-require-hook-tests.ts @@ -1,4 +1,3 @@ -/// /// import * as hook from 'css-modules-require-hook'; diff --git a/csv-stringify/csv-stringify-tests.ts b/csv-stringify/csv-stringify-tests.ts index bd6873affb..a05f35d368 100644 --- a/csv-stringify/csv-stringify-tests.ts +++ b/csv-stringify/csv-stringify-tests.ts @@ -1,5 +1,3 @@ -/// - import stringify = require("csv-stringify"); let stream: stringify.Stringifier; diff --git a/cybozulabs-md5/cybozulabs-md5-tests.ts b/cybozulabs-md5/cybozulabs-md5-tests.ts index 7572ed9124..2163b6e8c9 100644 --- a/cybozulabs-md5/cybozulabs-md5-tests.ts +++ b/cybozulabs-md5/cybozulabs-md5-tests.ts @@ -1,5 +1,3 @@ -/// - var hash: string; hash = CybozuLabs.MD5.calc("abc"); hash = CybozuLabs.MD5.calc("abc", CybozuLabs.MD5.BY_ASCII); diff --git a/d3.cloud.layout/d3.cloud.layout-tests.ts b/d3.cloud.layout/d3.cloud.layout-tests.ts index b2e0349cd4..862b7f0d82 100644 --- a/d3.cloud.layout/d3.cloud.layout-tests.ts +++ b/d3.cloud.layout/d3.cloud.layout-tests.ts @@ -1,42 +1,40 @@ -/// +interface ICompTextSize{ + text:string; + size:number; + x?:number; + y?:number; + rotate?:number; +} - interface ICompTextSize{ - text:string; - size:number; - x?:number; - y?:number; - rotate?:number; - } +var fill = d3.scale.category20(); +d3.layout.cloud().size([300, 300]) + .words([ + "Hello", "world", "normally", "you", "want", "more", "words", + "than", "this"].map(function(d:string) { + return {text: d, size: 10 + Math.random() * 90}; + })) + .padding(5) + .rotate(function() { return ~~(Math.random() * 2) * 90; }) + .font("Impact") + .fontSize(function(d:ICompTextSize) { return d.size; }) + .on("end", draw) + .start(); - - var fill = d3.scale.category20(); - d3.layout.cloud().size([300, 300]) - .words([ - "Hello", "world", "normally", "you", "want", "more", "words", - "than", "this"].map(function(d:string) { - return {text: d, size: 10 + Math.random() * 90}; - })) - .padding(5) - .rotate(function() { return ~~(Math.random() * 2) * 90; }) - .font("Impact") - .fontSize(function(d:ICompTextSize) { return d.size; }) - .on("end", draw) - .start(); - function draw(words:ICompTextSize[]) { - d3.select("body").append("svg") - .attr("width", 300) - .attr("height", 300) - .append("g") - .attr("transform", "translate(150,150)") - .selectAll("text") - .data(words) - .enter().append("text") - .style("font-size", function(d:ICompTextSize) { return d.size + "px"; }) - .style("font-family", "Impact") - .style("fill", function(d:ICompTextSize, i:number) { return fill(i); }) - .attr("text-anchor", "middle") - .attr("transform", function(d:ICompTextSize) { - return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")"; - }) - .text(function(d:ICompTextSize) { return d.text; }); - } +function draw(words:ICompTextSize[]) { + d3.select("body").append("svg") + .attr("width", 300) + .attr("height", 300) + .append("g") + .attr("transform", "translate(150,150)") + .selectAll("text") + .data(words) + .enter().append("text") + .style("font-size", function(d:ICompTextSize) { return d.size + "px"; }) + .style("font-family", "Impact") + .style("fill", function(d:ICompTextSize, i:number) { return fill(i); }) + .attr("text-anchor", "middle") + .attr("transform", function(d:ICompTextSize) { + return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")"; + }) + .text(function(d:ICompTextSize) { return d.text; }); +} diff --git a/d3kit/d3kit-tests.ts b/d3kit/d3kit-tests.ts index c8a447ecda..e1a92d41b9 100644 --- a/d3kit/d3kit-tests.ts +++ b/d3kit/d3kit-tests.ts @@ -1,5 +1,3 @@ -/// - function test_abstract_chart() { let el: Element, chart: d3kit.AbstractChart, @@ -86,8 +84,8 @@ function test_svgchart() { options: d3kit.ChartOptions, margins: d3kit.ChartMargin, offsets: [number, number], - svg: d3.Selection, - rootg: d3.Selection, + svg: d3.Selection, + rootg: d3.Selection, layers: d3kit.LayerOrganizer; // create a div, append to body, return Node as type Element diff --git a/d3kit/v1/d3kit-tests.ts b/d3kit/v1/d3kit-tests.ts index d49891822b..9ffb7ca2ba 100644 --- a/d3kit/v1/d3kit-tests.ts +++ b/d3kit/v1/d3kit-tests.ts @@ -1,9 +1,6 @@ -/// /// /// -/* jshint expr: true */ - var expect = chai.expect; describe('Skeleton', function(){ var element: Element, $element: d3.Selection, $svg: d3.Selection, skeleton: d3kit.Skeleton; diff --git a/datatables.net-buttons/datatables.net-buttons-tests.ts b/datatables.net-buttons/datatables.net-buttons-tests.ts index 2dcdd26ff4..6acbbeaf8a 100644 --- a/datatables.net-buttons/datatables.net-buttons-tests.ts +++ b/datatables.net-buttons/datatables.net-buttons-tests.ts @@ -1,7 +1,3 @@ -/// -/// - - $(document).ready(function () { var config: DataTables.Settings = diff --git a/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts b/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts index 949bca825c..561b968ba9 100644 --- a/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts +++ b/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts @@ -1,6 +1,3 @@ -/// -/// - $(document).ready(() => { var config: DataTables.Settings = { // FixedHeader extension options diff --git a/datatables.net-select/datatables.net-select-tests.ts b/datatables.net-select/datatables.net-select-tests.ts index aa1851931c..5d8fdd8dc6 100644 --- a/datatables.net-select/datatables.net-select-tests.ts +++ b/datatables.net-select/datatables.net-select-tests.ts @@ -1,6 +1,3 @@ -/// -/// - $(document).ready(() => { var config: DataTables.Settings = { // Select extension options diff --git a/datatables.net/datatables.net-tests.ts b/datatables.net/datatables.net-tests.ts index 0134581ee1..c4a8fcaf3e 100644 --- a/datatables.net/datatables.net-tests.ts +++ b/datatables.net/datatables.net-tests.ts @@ -1,6 +1,3 @@ -/// - - $(document).ready(function () { //#region "Language" diff --git a/dw-bxslider-4/dw-bxslider-4-tests.ts b/dw-bxslider-4/dw-bxslider-4-tests.ts index e20f748a5d..57092d642f 100644 --- a/dw-bxslider-4/dw-bxslider-4-tests.ts +++ b/dw-bxslider-4/dw-bxslider-4-tests.ts @@ -1,6 +1,3 @@ -/// - - // examples from http://bxslider.com/examples $(document).ready(function() { diff --git a/dynatable/dynatable-tests.ts b/dynatable/dynatable-tests.ts index acba41092a..e727c209c1 100644 --- a/dynatable/dynatable-tests.ts +++ b/dynatable/dynatable-tests.ts @@ -1,5 +1,3 @@ -/// - // Using the global setup option // ============================= $.dynatableSetup({ features: { pushState: false }, dataset: { perPageDefault: 5, perPageOptions: [2, 5, 10] } }); diff --git a/ecurve/ecurve-tests.ts b/ecurve/ecurve-tests.ts index c2214c6905..ced84ef8aa 100644 --- a/ecurve/ecurve-tests.ts +++ b/ecurve/ecurve-tests.ts @@ -1,5 +1,3 @@ -/// - import ecurve = require('ecurve'); import crypto = require('crypto'); diff --git a/ej.web.all/ej.web.all-tests.ts b/ej.web.all/ej.web.all-tests.ts index 63928f47cc..eaf6c2b4e3 100644 --- a/ej.web.all/ej.web.all-tests.ts +++ b/ej.web.all/ej.web.all-tests.ts @@ -1,7 +1,3 @@ -/// -/// - - /* tslint:disable */ module AccordionComponent { @@ -24,7 +20,7 @@ module AccordionComponent { }); } - + module AutocompleteComponent{ var carList = [ @@ -48,15 +44,15 @@ module AutocompleteComponent{ "Triumph Spitfire", "Toyota 2000GT", "Volvo P1800", "Volkswagen Shirako" ]; - $(function () { - var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { + $(function () { + var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { width: "100%", watermarkText: "Select a car", dataSource: carList, enableAutoFill: true, showPopupButton: true, multiSelectMode: "delimiter" - }); + }); }); } @@ -154,7 +150,7 @@ module ButtonComponent { }); }); } - + @@ -170,7 +166,7 @@ module ChartComponent { range: { min: 25, max: 50, interval: 5 }, labelFormat: "{value}%", title: { text: "Efficiency" }, - + }, commonSeriesOptions: { @@ -185,28 +181,28 @@ module ChartComponent { }, visible: true }, - border : {width: 2} - }, - series: + border : {width: 2} + }, + series: [ { - points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, - { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], + points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, + { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], name: 'India' - }, + }, { - points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, - { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], + points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, + { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], name: 'Germany' }, { - points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, - { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], + points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, + { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], name: 'England' - }, + }, { - points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, - { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], + points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, + { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], name: 'France' } ], @@ -294,7 +290,7 @@ module circulargaugecomponent { backgroundColor: "#f5b43f", border: { color: "#f5b43f" } }] - }] + }] }); }); } @@ -381,7 +377,7 @@ $(function () { createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) ] }); - + }); function createNode(option: ej.datavisualization.Diagram.Node) { @@ -406,7 +402,7 @@ function createLabel(options : any) { return options; } - + module DialogComponent { $(function () { @@ -456,7 +452,7 @@ module digitalgaugecomponent { } - + @@ -476,12 +472,12 @@ module DropDownListComponent { enableFilterSearch: true, caseSensitiveSearch: true, enableIncrementalSearch: true, - enablePopupResize: true, + enablePopupResize: true, delimiterChar: ";", multiSelectMode: ej.MultiSelectMode.Delimiter, maxPopupHeight: "300px", - minPopupHeight: "150px", - maxPopupWidth: "500px", + minPopupHeight: "150px", + maxPopupWidth: "500px", minPopupWidth: "350px", showCheckbox: true, showRoundedCorner: true @@ -517,7 +513,7 @@ module GanttComponent { dataSource: (window).projectData, allowColumnResize: true, allowSorting: true, - allowSelection: true, + allowSelection: true, enableContextMenu: true, taskIdMapping: "taskID", allowDragAndDrop: true, @@ -558,7 +554,7 @@ module GanttComponent { treeColumnIndex: 1, isResponsive: true, }); -}); +}); } @@ -674,7 +670,7 @@ module KanbanComponent { }); } - + module lineargaugecomponent { @@ -700,14 +696,14 @@ module lineargaugecomponent { backgroundColor: "#E94649", border: { color: "#E94649" }, startWidth: 4, endWidth: 4 }] - }] + }] }); }); } - - + + module ListBoxComponent { $(function () { @@ -717,12 +713,12 @@ module ListBoxComponent { }); } - + module ListviewComponent { $(function () { var listviewInstance = new ej.ListView($("#defaultlistview"), { - enableCheckMark: true, + enableCheckMark: true, width: 400 }); }); @@ -987,7 +983,7 @@ module MenuComponent { - + module NavigationDrawerComponent { $(function () { @@ -1027,7 +1023,7 @@ module PivotChartOlap { $(function () { var sample = new ej.PivotChart($("#PivotChart"),{ dataSource: { - data: "http://bi.syncfusion.com/olap/msmdpump.dll", + data: "http://bi.syncfusion.com/olap/msmdpump.dll", catalog: "Adventure Works DW 2008 SE", cube: "Adventure Works", rows: [ @@ -1195,7 +1191,7 @@ module PivotGaugeOlap { length: 120, width: 7 }, - { + { type: "marker", markerType: "diamond", distanceFromScale: 5, @@ -1224,7 +1220,7 @@ module PivotGaugeOlap { distanceFromScale: -5, backgroundColor: "#fc0606", border: { color: "#fc0606" } - }, + }, { distanceFromScale: -5 }], @@ -1242,7 +1238,7 @@ module PivotGaugeOlap { }] }] }); - }); + }); } @@ -1316,7 +1312,7 @@ module PivotGaugeRelational { length: 120, width: 7 }, - { + { type: "marker", markerType: "diamond", distanceFromScale: 5, @@ -1345,7 +1341,7 @@ module PivotGaugeRelational { distanceFromScale: -5, backgroundColor: "#fc0606", border: { color: "#fc0606" } - }, + }, { distanceFromScale: -5 }], @@ -1363,7 +1359,7 @@ module PivotGaugeRelational { }] }] }); - }); + }); } @@ -1398,7 +1394,7 @@ module PivotGridOlap { ], filters:[] }, - enableGroupingBar: true, + enableGroupingBar: true, pivotTableFieldListID:"PivotSchemaDesigner" }); $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); @@ -1449,7 +1445,7 @@ module PivotGridRelational { fieldCaption: "State" } ], - columns: + columns: [{ fieldName: "Product", fieldCaption: "Product" @@ -1467,10 +1463,10 @@ module PivotGridRelational { ], filters:[] }, - enableGroupingBar: true, + enableGroupingBar: true, pivotTableFieldListID:"PivotSchemaDesigner" }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); } @@ -1611,7 +1607,7 @@ function redo(e: any) { } - + module RadialSliderComponent { $(function () { @@ -1644,7 +1640,7 @@ module rangecomponent { fill: '#69D2E7' } ]; - } + } }); }); @@ -1696,7 +1692,7 @@ module RatingComponent { shapeWidth: 25, showTooltip: true }); - + var sample2 = new ej.Rating($("#halfRating"),{ precision: ej.Rating.Precision.Half, value: 3.5, @@ -1727,7 +1723,7 @@ module RatingComponent { shapeHeight: 25, shapeWidth: 25, showTooltip: true - }); + }); }); } @@ -1760,7 +1756,7 @@ module RibbonComponent { toolTip: "Pin the Ribbon" }, applicationTab: { - type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } + type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } }, tabs: [{ id: "home", text: "HOME", groups: [{ @@ -1837,7 +1833,7 @@ module RibbonComponent { width: 60, isBig: false } - }] + }] }, { text: "Font", alignType: "rows", content: [{ @@ -2116,7 +2112,7 @@ module RibbonComponent { groups: [{ id: "zoomin", text: "Zoom In", - toolTip: "Zoom In", + toolTip: "Zoom In", buttonSettings: { width: 58, contentType: ej.ContentType.TextAndImage, @@ -2127,7 +2123,7 @@ module RibbonComponent { { id: "zoomout", text: "Zoom Out", - toolTip: "Zoom Out", + toolTip: "Zoom Out", buttonSettings: { width: 70, contentType: ej.ContentType.TextAndImage, @@ -2138,7 +2134,7 @@ module RibbonComponent { { id: "fullscreen", text: "Full Screen", - toolTip: "Full Screen", + toolTip: "Full Screen", buttonSettings: { width: 73, contentType: ej.ContentType.TextAndImage, @@ -2367,7 +2363,7 @@ module RibbonComponent { } ] } - ], + ], create: function createControl(args) { var ribbon = $("#defaultRibbon").data("ejRibbon"); $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); @@ -2383,7 +2379,7 @@ function colorHandler(args:any) { - + module RotatorComponent { $(function () { @@ -2546,7 +2542,7 @@ module ScheduleComponent { } }); }); -} +} @@ -2729,9 +2725,9 @@ module piesparkline4 { }); } - - + + module SplitterComponent { @@ -2766,7 +2762,7 @@ $(function () { pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" }, sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete: () => { + loadComplete: () => { var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; if (!(spreadsheet).isImport) { spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); @@ -2790,13 +2786,13 @@ var default_data: Array = [ { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 70 }, { Category : "Employees", Country : "USA", JobDescription : "Management", EmployeesCount : 40 }, { Category : "Employees", Country : "USA", JobDescription : "Accounts", EmployeesCount : 60 }, - + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 43 }, { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 125}, { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 60 }, { Category : "Employees", Country : "India", JobDescription : "HR Executives", EmployeesCount : 70 }, { Category : "Employees", Country : "India", JobDescription : "Accounts", EmployeesCount : 45 }, - + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Executive", EmployeesCount : 30 }, { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, { Category : "Employees", Country : "Germany", JobDescription : "Marketing", EmployeesCount : 50 }, @@ -2805,13 +2801,13 @@ var default_data: Array = [ { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, { Category : "Employees", Country : "Germany", JobDescription : "Management", EmployeesCount : 33 }, { Category : "Employees", Country : "Germany", JobDescription : "Accounts", EmployeesCount : 55 }, - + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 45 }, { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 96 }, { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, { Category : "Employees", Country : "UK", JobDescription : "HR Executives", EmployeesCount : 60 }, { Category : "Employees", Country : "UK", JobDescription: "Accounts", EmployeesCount: 30 }, - + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, @@ -2821,7 +2817,7 @@ var default_data: Array = [ module sunburstcomponent { $(function () { var sunburstsample = new ej.SunburstChart($("#Sunburst"), { - valueMemberPath: "EmployeesCount", + valueMemberPath: "EmployeesCount", levels: [ {groupMemberPath: "Country"}, {groupMemberPath: "JobDescription"}, @@ -2860,8 +2856,8 @@ module TabComponent { module TagCloudComponent { - - + + var websiteCollection = [ { text: "Google", url: "http://www.google.com", frequency: 12 }, { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, @@ -2892,7 +2888,7 @@ module TagCloudComponent { text: "text", url: "url", frequency: "frequency" } }); - + }); } @@ -2932,7 +2928,7 @@ module EditorComponent { - + module TileViewComponent { $(function () { @@ -2943,38 +2939,38 @@ module TileViewComponent { imageUrl:'content/images/tile/windows/people_1.png' }); var tile2 = new ej.Tile($("#tile2"), { - imagePosition:"center", + imagePosition:"center", tileSize:"small", - imageUrl:'content/images/tile/windows/alerts.png', - + imageUrl:'content/images/tile/windows/alerts.png', + }); var tile3 = new ej.Tile($("#tile3"), { - imagePosition:"center", + imagePosition:"center", tileSize:"small", - imageUrl:'content/images/tile/windows/bing.png', + imageUrl:'content/images/tile/windows/bing.png', }); var tile4 = new ej.Tile($("#tile4"), { tileSize:"small", - imageUrl:'content/images/tile/windows/camera.png', + imageUrl:'content/images/tile/windows/camera.png', }); var tile5 = new ej.Tile($("#tile5"), { - imagePosition:"center", + imagePosition:"center", tileSize:"small", - imageUrl:'content/images/tile/windows/messages.png', + imageUrl:'content/images/tile/windows/messages.png', }); var tile6 = new ej.Tile($("#tile6"), { - imagePosition:"center", + imagePosition:"center", tileSize:"medium", - imageUrl:'content/images/tile/windows/games.png', + imageUrl:'content/images/tile/windows/games.png', caption:{text:"Play"} }); - var tile7 = new ej.Tile($("#tile7"), { + var tile7 = new ej.Tile($("#tile7"), { tileSize:"medium", imageUrl:'content/images/tile/windows/map.png', caption:{text:"Maps"} }); var tile8 = new ej.Tile($("#tile8"), { - imagePosition:"fill", + imagePosition:"fill", tileSize:"wide", imageUrl:'content/images/tile/windows/sports.png', caption:{text:"Sports"} @@ -3026,7 +3022,7 @@ module TimePickerComponent { module ToolbarComponent { - + $(function () { var sample = new ej.Toolbar($("#editingToolbar"),{ width: "100%", @@ -3045,7 +3041,7 @@ module ToolbarComponent { module TooltipComponent { - + $(function () { var sample1 = new ej.Tooltip($("#link1"),{ @@ -3140,7 +3136,7 @@ module TreeGridComponent { isResponsive: true, }); }); -} +} @@ -3185,7 +3181,7 @@ module treemapcomponent { - + module TreeViewComponent { $(function () { @@ -3202,7 +3198,7 @@ module TreeViewComponent { module UploadboxComponent { - + $(function () { var sample = new ej.Uploadbox($("#UploadDefault"),{ saveUrl: "uploadbox/saveFiles.ashx", diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 356eb6af40..5d3a48af93 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// /*! * filename: ej.web.all.d.ts diff --git a/electron-devtools-installer/electron-devtools-installer-tests.ts b/electron-devtools-installer/electron-devtools-installer-tests.ts index a923e2b20e..a453221698 100644 --- a/electron-devtools-installer/electron-devtools-installer-tests.ts +++ b/electron-devtools-installer/electron-devtools-installer-tests.ts @@ -1,5 +1,3 @@ -/// - import installExtension, { EMBER_INSPECTOR, REACT_DEVELOPER_TOOLS, BACKBONE_DEBUGGER, JQUERY_DEBUGGER, diff --git a/ember/v1/ember-tests.ts b/ember/v1/ember-tests.ts index 25ca3e3cc5..103fb0146e 100644 --- a/ember/v1/ember-tests.ts +++ b/ember/v1/ember-tests.ts @@ -1,6 +1,3 @@ -/// - - var App : any; App = Em.Application.create(); diff --git a/esprima/esprima-tests.ts b/esprima/esprima-tests.ts index d7c748d3b8..60b54e0679 100644 --- a/esprima/esprima-tests.ts +++ b/esprima/esprima-tests.ts @@ -1,6 +1,3 @@ -/// - - import esprima = require('esprima'); import * as ESTree from 'estree'; diff --git a/falcor-express/falcor-express-tests.ts b/falcor-express/falcor-express-tests.ts index f4a4ed8b52..c76a61f901 100644 --- a/falcor-express/falcor-express-tests.ts +++ b/falcor-express/falcor-express-tests.ts @@ -1,7 +1,3 @@ - -/// -/// - import express = require('express'); import Router = require('falcor-router'); import falcorExpress = require('falcor-express') diff --git a/fancybox/fancybox-tests.ts b/fancybox/fancybox-tests.ts index 2d5743c950..eac3f31771 100644 --- a/fancybox/fancybox-tests.ts +++ b/fancybox/fancybox-tests.ts @@ -1,6 +1,3 @@ -/// - - $('.fancybox').fancybox(); $('.fancybox').fancybox({ padding: 0, diff --git a/featherlight/featherlight-tests.ts b/featherlight/featherlight-tests.ts index 4d609d3475..e241a30990 100644 --- a/featherlight/featherlight-tests.ts +++ b/featherlight/featherlight-tests.ts @@ -1,7 +1,5 @@ // Tests by: Kaur Kuut -/// - // Every option as default var defaultOptions = { namespace: 'featherlight', diff --git a/fixed-data-table/fixed-data-table-tests.tsx b/fixed-data-table/fixed-data-table-tests.tsx index 7dfac22230..f57ff3d946 100644 --- a/fixed-data-table/fixed-data-table-tests.tsx +++ b/fixed-data-table/fixed-data-table-tests.tsx @@ -1,6 +1,3 @@ - -/// - import * as React from "react"; import {Table, Cell, Column, CellProps} from "fixed-data-table"; diff --git a/flickity/flickity-tests.ts b/flickity/flickity-tests.ts index b98315285f..b4ecf51997 100644 --- a/flickity/flickity-tests.ts +++ b/flickity/flickity-tests.ts @@ -4,11 +4,9 @@ // Definitions: https://github.com/clmcgrath/ /// -/// //jQuery tests - var $flickity: JQuery = $("#flickity-selector").flickity( { initialIndex: 0, @@ -105,15 +103,15 @@ flikty2.destroy(); flikty2.reloadCells(); //event handlers -flikty2.on(FlickityEvents.cellSelect, (evt, ele) => { +flikty2.on("cellSelect", (evt, ele) => { //do something }); -flikty2.off(FlickityEvents.cellSelect, (evt, ele, pntr, vctr) => { +flikty2.off("cellSelect", (evt, ele, pntr, vctr) => { //do something }); -flikty2.once(FlickityEvents.cellSelect, (evt, ele, pntr) => { +flikty2.once("cellSelect", (evt, ele, pntr) => { //do something }); diff --git a/foundation-sites/foundation-sites-tests.ts b/foundation-sites/foundation-sites-tests.ts index 4932f01624..2e90071c7d 100644 --- a/foundation-sites/foundation-sites-tests.ts +++ b/foundation-sites/foundation-sites-tests.ts @@ -1,11 +1,3 @@ -// Tests for type definitions for Foundation Sites v6.0.4 -// Project: http://foundation.zurb.com/ -// Definitions by: Sam Vloeberghs -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - - $(document).foundation(); $(document).foundation('method5'); $(document).foundation(['method', 'method2']); diff --git a/foundation/foundation-tests.ts b/foundation/foundation-tests.ts index 913bd0ee1b..33f8530589 100644 --- a/foundation/foundation-tests.ts +++ b/foundation/foundation-tests.ts @@ -1,6 +1,3 @@ -/// - - function empty_callback() : void {} function plugin_list() { diff --git a/from/from-tests.ts b/from/from-tests.ts index b46bdf66f1..e73a4915a0 100644 --- a/from/from-tests.ts +++ b/from/from-tests.ts @@ -1,6 +1,3 @@ - -/// - import from = require('from'); var rs: NodeJS.ReadableStream; diff --git a/fs-ext/fs-ext-tests.ts b/fs-ext/fs-ext-tests.ts index baba88f092..0c774589bc 100644 --- a/fs-ext/fs-ext-tests.ts +++ b/fs-ext/fs-ext-tests.ts @@ -1,19 +1,16 @@ - -/// - import fs = require('fs-ext'); var num:number; var str:string; -//from node.js 'fs' module +//from node.js 'fs' module fs.appendFileSync(str, "data"); -fs.flock(num, str, (err)=>{ +fs.flock(num, str, (err)=>{ }); fs.flockSync(num, str); -fs.fcntl(num, str, num, (err, res)=>{ +fs.fcntl(num, str, num, (err, res)=>{ }); fs.fcntl(num, str, (err, res)=>{ }); diff --git a/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts b/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts index 12623c54b1..46e623207a 100644 --- a/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts +++ b/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts @@ -1,5 +1,3 @@ -/// - import fs = require('fs-extra-promise-es6'); import stream = require('stream'); @@ -145,7 +143,7 @@ strArr = fs.readdirSync(path); fs.close(fd, errorCallback); fs.closeSync(fd); fs.open(path, flags, modeStr, (err: Error, fd: number) => { - + }); num = fs.openSync(path, flags, modeStr); fs.utimes(path, atime, mtime, errorCallback); diff --git a/fs-extra-promise/fs-extra-promise-tests.ts b/fs-extra-promise/fs-extra-promise-tests.ts index 112a27109c..28bdd26120 100644 --- a/fs-extra-promise/fs-extra-promise-tests.ts +++ b/fs-extra-promise/fs-extra-promise-tests.ts @@ -1,6 +1,3 @@ - -/// - import fs = require('fs-extra-promise'); import stream = require('stream'); diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts index 896d6411f7..f06ec098a8 100644 --- a/fs-extra/fs-extra-tests.ts +++ b/fs-extra/fs-extra-tests.ts @@ -1,6 +1,3 @@ - -/// - import fs = require('fs-extra'); import * as Path from 'path' diff --git a/ftp/ftp-tests.ts b/ftp/ftp-tests.ts index 6e5e7d37a9..4d78104940 100644 --- a/ftp/ftp-tests.ts +++ b/ftp/ftp-tests.ts @@ -1,6 +1,3 @@ - -/// - import Client = require("ftp"); import fs = require("fs"); @@ -8,8 +5,8 @@ var c = new Client(); c.on('ready', (): void => { c.get('foo.txt', function(err: Error, stream: NodeJS.ReadableStream): void { if (err) throw err; - stream.once('close', function(): void { - c.end(); + stream.once('close', function(): void { + c.end(); }); stream.pipe(fs.createWriteStream('foo.local-copy.txt')); }); @@ -25,4 +22,4 @@ c.connect({ }); - + diff --git a/fullcalendar/fullcalendar-tests.ts b/fullcalendar/fullcalendar-tests.ts index 7640c85db6..63328a9cef 100644 --- a/fullcalendar/fullcalendar-tests.ts +++ b/fullcalendar/fullcalendar-tests.ts @@ -1,5 +1,4 @@ -/// -/// +/// import * as FullCalendar from 'fullcalendar'; import * as moment from 'moment'; diff --git a/fullcalendar/v1/fullcalendar-tests.ts b/fullcalendar/v1/fullcalendar-tests.ts index 56a9eb0024..ede55bc0b1 100644 --- a/fullcalendar/v1/fullcalendar-tests.ts +++ b/fullcalendar/v1/fullcalendar-tests.ts @@ -1,6 +1,4 @@ -/// -/// -/// +/// // All examples from http://arshaw.com/fullcalendar/docs/ diff --git a/gijgo/gijgo-tests.ts b/gijgo/gijgo-tests.ts index 5731732295..6e624ad4f6 100644 --- a/gijgo/gijgo-tests.ts +++ b/gijgo/gijgo-tests.ts @@ -1,5 +1,4 @@ /// -/// // Grid $(() => { diff --git a/gldatepicker/gldatepicker-tests.ts b/gldatepicker/gldatepicker-tests.ts index d133a5f823..974c1da8a7 100644 --- a/gldatepicker/gldatepicker-tests.ts +++ b/gldatepicker/gldatepicker-tests.ts @@ -1,5 +1,3 @@ -/// - $('input').glDatePicker(); $('#example2').glDatePicker( { diff --git a/gm/gm-tests.ts b/gm/gm-tests.ts index 2189d9064d..e8bf5787cd 100644 --- a/gm/gm-tests.ts +++ b/gm/gm-tests.ts @@ -1,6 +1,3 @@ - -/// - import gm = require('gm'); import stream = require('stream'); diff --git a/gregorian-calendar/gregorian-calendar-tests.ts b/gregorian-calendar/gregorian-calendar-tests.ts index a7b11cf21d..096933ed2b 100644 --- a/gregorian-calendar/gregorian-calendar-tests.ts +++ b/gregorian-calendar/gregorian-calendar-tests.ts @@ -1,9 +1,6 @@ -/// - import GregorianCalendar = require('gregorian-calendar'); import GregorianCalendarFormat = require('gregorian-calendar-format'); - let cal = new GregorianCalendar(); cal.set(2016, 7, 27, 0, 0, 0, 0); diff --git a/gridfs-stream/gridfs-stream-tests.ts b/gridfs-stream/gridfs-stream-tests.ts index 1ed4e97006..8086245722 100644 --- a/gridfs-stream/gridfs-stream-tests.ts +++ b/gridfs-stream/gridfs-stream-tests.ts @@ -1,7 +1,3 @@ - - -/// - // Samples from: // https://github.com/aheckmann/gridfs-stream diff --git a/gulp-babel/gulp-babel-tests.ts b/gulp-babel/gulp-babel-tests.ts index b705c68850..4cd6ff0467 100644 --- a/gulp-babel/gulp-babel-tests.ts +++ b/gulp-babel/gulp-babel-tests.ts @@ -1,5 +1,3 @@ -/// - import babel = require('gulp-babel'); var x: NodeJS.ReadWriteStream = babel(); diff --git a/gulp-cheerio/gulp-cheerio-tests.ts b/gulp-cheerio/gulp-cheerio-tests.ts index 464abccead..e2d3bfe267 100644 --- a/gulp-cheerio/gulp-cheerio-tests.ts +++ b/gulp-cheerio/gulp-cheerio-tests.ts @@ -1,7 +1,3 @@ - - -/// - import cheerio = require('gulp-cheerio'); import gulp = require('gulp'); import Vinyl = require('vinyl'); diff --git a/gulp-dtsm/gulp-dtsm-tests.ts b/gulp-dtsm/gulp-dtsm-tests.ts index 54e12eff6a..dafc6b3468 100644 --- a/gulp-dtsm/gulp-dtsm-tests.ts +++ b/gulp-dtsm/gulp-dtsm-tests.ts @@ -1,6 +1,3 @@ - -/// - import * as dtsm from 'gulp-dtsm'; import * as gulp from 'gulp'; diff --git a/gulp-help/gulp-help-tests.ts b/gulp-help/gulp-help-tests.ts index 5d11bc23b7..ae7d0846e7 100644 --- a/gulp-help/gulp-help-tests.ts +++ b/gulp-help/gulp-help-tests.ts @@ -1,7 +1,3 @@ -/// - -'use strict'; - import gulpHelp = require('gulp-help'); var gulp = gulpHelp(require('gulp')); diff --git a/gulp-html-replace/gulp-html-replace-tests.ts b/gulp-html-replace/gulp-html-replace-tests.ts index 568fb481fd..9a21a53b84 100644 --- a/gulp-html-replace/gulp-html-replace-tests.ts +++ b/gulp-html-replace/gulp-html-replace-tests.ts @@ -1,7 +1,3 @@ - - -/// - import * as gulp from 'gulp'; import * as htmlreplace from 'gulp-html-replace'; diff --git a/gulp-useref/gulp-useref-tests.ts b/gulp-useref/gulp-useref-tests.ts index 1f1a152be0..9f2bd409d5 100644 --- a/gulp-useref/gulp-useref-tests.ts +++ b/gulp-useref/gulp-useref-tests.ts @@ -1,5 +1,3 @@ -/// - import * as gulp from 'gulp'; import * as useref from 'gulp-useref'; diff --git a/hammerjs/v1/hammerjs-tests.ts b/hammerjs/v1/hammerjs-tests.ts index bb006241fe..60d990c0bd 100644 --- a/hammerjs/v1/hammerjs-tests.ts +++ b/hammerjs/v1/hammerjs-tests.ts @@ -1,6 +1,3 @@ -/// - - // plugin check if (!Hammer.HAS_TOUCHEVENTS && !Hammer.HAS_POINTEREVENTS) { Hammer.plugins.fakeMultitouch(); diff --git a/hystrixjs/hystrixjs-tests.ts b/hystrixjs/hystrixjs-tests.ts index b7f10a27d8..676015be06 100644 --- a/hystrixjs/hystrixjs-tests.ts +++ b/hystrixjs/hystrixjs-tests.ts @@ -1,6 +1,3 @@ - -/// - import hystrixjs = require('hystrixjs'); import q = require('q'); diff --git a/i18next-browser-languagedetector/i18next-browser-languagedetector-tests.ts b/i18next-browser-languagedetector/i18next-browser-languagedetector-tests.ts index bca7aee3b7..9f36a7d538 100644 --- a/i18next-browser-languagedetector/i18next-browser-languagedetector-tests.ts +++ b/i18next-browser-languagedetector/i18next-browser-languagedetector-tests.ts @@ -1,5 +1,3 @@ -/// - import * as i18next from 'i18next'; import LngDetector from 'i18next-browser-languagedetector'; diff --git a/i18next-xhr-backend/i18next-xhr-backend-tests.ts b/i18next-xhr-backend/i18next-xhr-backend-tests.ts index b4e71467f1..9c12809271 100644 --- a/i18next-xhr-backend/i18next-xhr-backend-tests.ts +++ b/i18next-xhr-backend/i18next-xhr-backend-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as i18next from 'i18next'; import XHR from 'i18next-xhr-backend'; diff --git a/ibm-mobilefirst/ibm-mobilefirst-tests.ts b/ibm-mobilefirst/ibm-mobilefirst-tests.ts index 92dbee824d..498c9c3d7f 100644 --- a/ibm-mobilefirst/ibm-mobilefirst-tests.ts +++ b/ibm-mobilefirst/ibm-mobilefirst-tests.ts @@ -1,5 +1,3 @@ -/// - // Tests // Test WL.Client @@ -126,7 +124,7 @@ WL.SimpleDialog.show( WL.Logger.debug("First button pressed"); } }]); - + // Test WL.TabBar // iOS var creditTab = WL.TabBar.addItem("CREDIT", function() { diff --git a/imagemagick-native/imagemagick-native-tests.ts b/imagemagick-native/imagemagick-native-tests.ts index c872634ab2..94d8fd05bb 100644 --- a/imagemagick-native/imagemagick-native-tests.ts +++ b/imagemagick-native/imagemagick-native-tests.ts @@ -1,6 +1,3 @@ - -/// - import imagemagick = require('imagemagick-native'); import fs = require('fs'); diff --git a/imagemagick/imagemagick-tests.ts b/imagemagick/imagemagick-tests.ts index 87ead6307a..5bc9d9cc93 100644 --- a/imagemagick/imagemagick-tests.ts +++ b/imagemagick/imagemagick-tests.ts @@ -1,6 +1,3 @@ - -/// - import imagemagick = require('imagemagick'); import child_process = require('child_process'); diff --git a/jasmine-expect/jasmine-expect-tests.ts b/jasmine-expect/jasmine-expect-tests.ts index 7753cc7381..e64f9198bf 100644 --- a/jasmine-expect/jasmine-expect-tests.ts +++ b/jasmine-expect/jasmine-expect-tests.ts @@ -1,6 +1,3 @@ -/// - - // Taken directly from the test directory of the original repo declare var describeWhenNotArray: (arr: string) => void; diff --git a/jasmine-jquery/jasmine-jquery-tests.ts b/jasmine-jquery/jasmine-jquery-tests.ts index 67b349d45e..2e507d85fd 100644 --- a/jasmine-jquery/jasmine-jquery-tests.ts +++ b/jasmine-jquery/jasmine-jquery-tests.ts @@ -1,7 +1,3 @@ -/// -/// - - describe("Jasmine jQuery extension", () => { it("Adds jQuery matchers", () => { expect($('
    ')).toBe('div'); diff --git a/jasmine-matchers/jasmine-matchers-tests.ts b/jasmine-matchers/jasmine-matchers-tests.ts index dc92e809dc..4ef032062d 100644 --- a/jasmine-matchers/jasmine-matchers-tests.ts +++ b/jasmine-matchers/jasmine-matchers-tests.ts @@ -14,9 +14,6 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/// - - describe('toBeArray', function () { describe('matches', function () { it('should pass for []', function () { diff --git a/joi/v6/joi-tests.ts b/joi/v6/joi-tests.ts index 265bbd045c..03ca5ffac0 100644 --- a/joi/v6/joi-tests.ts +++ b/joi/v6/joi-tests.ts @@ -1,4 +1,3 @@ -/// /// import Joi = require('joi'); diff --git a/jqgrid/jqgrid-tests.ts b/jqgrid/jqgrid-tests.ts index 7354f527dc..832a94d909 100644 --- a/jqgrid/jqgrid-tests.ts +++ b/jqgrid/jqgrid-tests.ts @@ -2,8 +2,6 @@ // Definitions by: Lokesh Peta // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - var mydata: any[] = []; $('#jqGrid') diff --git a/jqrangeslider/jqrangeslider-tests.ts b/jqrangeslider/jqrangeslider-tests.ts index 1af815806f..cb6b417656 100644 --- a/jqrangeslider/jqrangeslider-tests.ts +++ b/jqrangeslider/jqrangeslider-tests.ts @@ -1,5 +1,3 @@ -/// - // Arrows $("#arrowsExample").rangeSlider({ arrows: false }); $("#arrowsExample").editRangeSlider({ arrows: false }); @@ -133,7 +131,7 @@ $("#rulersExample").rangeSlider({ next: function(val){ return val + 10; }, stop: function(val){ return false; }, label: function(val){ return val; }, - format: function(tickContainer, tickStart, tickEnd){ + format: function(tickContainer, tickStart, tickEnd){ tickContainer.addClass("myCustomClass"); } }, @@ -179,7 +177,7 @@ $("#rangeExample").dateRangeSlider({ // Symmetric Positionning $("#symmetricExample").rangeSlider({ symmetricPositionning: true, - range: {min: 0} + range: {min: 0} }); // Type $("#typeExample").editRangeSlider({type: "number"}); diff --git a/jquery-ajax-chain/jquery-ajax-chain-tests.ts b/jquery-ajax-chain/jquery-ajax-chain-tests.ts index e5cbb8a26f..56ea354543 100644 --- a/jquery-ajax-chain/jquery-ajax-chain-tests.ts +++ b/jquery-ajax-chain/jquery-ajax-chain-tests.ts @@ -1,6 +1,3 @@ -/// -/// - function test_public_methods(): void { let ajaxChain: ajaxChain.JQueryAjaxChain, @@ -171,7 +168,7 @@ function test_optional_parameters(): void { }, hasCache: function (xmlResponse): XMLDocument { - + let $tempXmlResponse: JQuery, itemId: String; diff --git a/jquery-alertable/jquery-alertable-tests.ts b/jquery-alertable/jquery-alertable-tests.ts index a61dca01b4..61d6e2c06c 100644 --- a/jquery-alertable/jquery-alertable-tests.ts +++ b/jquery-alertable/jquery-alertable-tests.ts @@ -1,6 +1,3 @@ -/// -/// - // // Examples from https://github.com/claviska/jquery-alertable // diff --git a/jquery-backstretch/jquery-backstretch-tests.ts b/jquery-backstretch/jquery-backstretch-tests.ts index 7220458769..22835b4e43 100644 --- a/jquery-backstretch/jquery-backstretch-tests.ts +++ b/jquery-backstretch/jquery-backstretch-tests.ts @@ -1,5 +1,3 @@ -/// - var backstretch = jQuery.backstretch(['image.png'], { centeredX: false, centeredY: false, diff --git a/jquery-cropbox/jquery-cropbox-tests.ts b/jquery-cropbox/jquery-cropbox-tests.ts index ddc5389625..eadb754088 100644 --- a/jquery-cropbox/jquery-cropbox-tests.ts +++ b/jquery-cropbox/jquery-cropbox-tests.ts @@ -1,5 +1,3 @@ -/// - var cropboxWithDefaultSettings = $("#element").cropbox(); var cropboxOptions: jQueryCropBox.CropboxOptions = { @@ -38,7 +36,7 @@ cropboxWithOptions.getBlob(); cropboxWithOptions.remove(); cropboxWithOptions.on("cropbox",(e: Event, data: any, img: jQueryCropBox.Cropbox) => { - - //DoStuff - + + //DoStuff + }); diff --git a/jquery-easy-loading/jquery-easy-loading-tests.ts b/jquery-easy-loading/jquery-easy-loading-tests.ts index 7a59d3d617..ece98fd6d0 100644 --- a/jquery-easy-loading/jquery-easy-loading-tests.ts +++ b/jquery-easy-loading/jquery-easy-loading-tests.ts @@ -1,6 +1,3 @@ - -/// - function test_options() { const jqElement: JQuery = $("body").loading({ diff --git a/jquery-handsontable/jquery-handsontable-tests.ts b/jquery-handsontable/jquery-handsontable-tests.ts index 267ab30d8a..a2e10b4827 100644 --- a/jquery-handsontable/jquery-handsontable-tests.ts +++ b/jquery-handsontable/jquery-handsontable-tests.ts @@ -1,6 +1,3 @@ -/// - - var data = [ ["", "Maserati", "Mazda", "Mercedes", "Mini", "Mitsubishi"], ["2009", 0, 2941, 4303, 354, 5814], diff --git a/jquery-jsonrpcclient/jquery-jsonrpcclient-tests.ts b/jquery-jsonrpcclient/jquery-jsonrpcclient-tests.ts index f680dbb688..0e42508202 100644 --- a/jquery-jsonrpcclient/jquery-jsonrpcclient-tests.ts +++ b/jquery-jsonrpcclient/jquery-jsonrpcclient-tests.ts @@ -1,5 +1,3 @@ -/// - var foo = new $.JsonRpcClient({ ajaxUrl: '/backend/jsonrpc' }); foo.call( 'bar', ['A parameter', 'B parameter'], diff --git a/jquery-mockjax/jquery-mockjax-tests.ts b/jquery-mockjax/jquery-mockjax-tests.ts index 7688645f8e..3090a1c3cc 100644 --- a/jquery-mockjax/jquery-mockjax-tests.ts +++ b/jquery-mockjax/jquery-mockjax-tests.ts @@ -1,4 +1,3 @@ -/// /// class Tests { diff --git a/jquery-steps/index.d.ts b/jquery-steps/index.d.ts index 6abe640417..7670245480 100644 --- a/jquery-steps/index.d.ts +++ b/jquery-steps/index.d.ts @@ -1,8 +1,9 @@ // Type definitions for jQuery Steps v1.1.1 // Project: http://www.jquery-steps.com/ -// Definitions by: Joseph Blank +// Definitions by: Joseph Blank , Nicholas Wong // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Updated by: Nicholas Wong + +/// interface JQuery { steps(param?: JQuerySteps.Settings): JQuerySteps.JQuerySteps; diff --git a/jquery-steps/jquery-steps-tests.ts b/jquery-steps/jquery-steps-tests.ts index 35346d1f7b..6659212e20 100644 --- a/jquery-steps/jquery-steps-tests.ts +++ b/jquery-steps/jquery-steps-tests.ts @@ -1,6 +1,3 @@ -/// -/// - var labels: JQuerySteps.LabelSettings = { cancel: 'Cancel', current: 'Current:', diff --git a/jquery-timeentry/jquery-timeentry-tests.ts b/jquery-timeentry/jquery-timeentry-tests.ts index ccfe0794a3..8910487c65 100644 --- a/jquery-timeentry/jquery-timeentry-tests.ts +++ b/jquery-timeentry/jquery-timeentry-tests.ts @@ -1,5 +1,3 @@ -/// - var selector = '#example'; // basic diff --git a/jquery-urlparam/jquery-urlparam-tests.ts b/jquery-urlparam/jquery-urlparam-tests.ts index a8ca144bb3..8d855e0e35 100644 --- a/jquery-urlparam/jquery-urlparam-tests.ts +++ b/jquery-urlparam/jquery-urlparam-tests.ts @@ -1,4 +1 @@ -/// - - console.log($.urlParam('variable')); diff --git a/jquery.ajaxfile/jquery.ajaxfile-tests.ts b/jquery.ajaxfile/jquery.ajaxfile-tests.ts index 364220325a..73bc6662dc 100644 --- a/jquery.ajaxfile/jquery.ajaxfile-tests.ts +++ b/jquery.ajaxfile/jquery.ajaxfile-tests.ts @@ -1,7 +1,3 @@ - -/// -/// - function testRawApi(){ var inputElement:HTMLInputElement = null; var resultPromise = AjaxFile.send({ diff --git a/jquery.are-you-sure/jquery.are-you-sure-tests.ts b/jquery.are-you-sure/jquery.are-you-sure-tests.ts index cd400f90c1..37cb487602 100644 --- a/jquery.are-you-sure/jquery.are-you-sure-tests.ts +++ b/jquery.are-you-sure/jquery.are-you-sure-tests.ts @@ -1,10 +1,3 @@ -// Type definitions for jquery.are-you-sure.js -// Project: https://github.com/codedance/jquery.AreYouSure -// Definitions by: Jon Egerton -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - //Use defaults $("test").areYouSure(); diff --git a/jquery.base64/jquery.base64-tests.ts b/jquery.base64/jquery.base64-tests.ts index 447a917620..c9c6955716 100644 --- a/jquery.base64/jquery.base64-tests.ts +++ b/jquery.base64/jquery.base64-tests.ts @@ -1,6 +1,3 @@ -/// - - var encoded = $.base64.encode(""); $.base64.decode(encoded); diff --git a/jquery.cleditor/jquery.cleditor-tests.ts b/jquery.cleditor/jquery.cleditor-tests.ts index 7fe997c4c5..b4f4917551 100644 --- a/jquery.cleditor/jquery.cleditor-tests.ts +++ b/jquery.cleditor/jquery.cleditor-tests.ts @@ -1,5 +1,3 @@ -/// - // cribbed from http://premiumsoftware.net/CLEditor/GettingStarted $(document).ready(function () { $("#input").cleditor(); }); diff --git a/jquery.color/jquery.color-tests.ts b/jquery.color/jquery.color-tests.ts index c94a1cffed..e1439f4cd4 100644 --- a/jquery.color/jquery.color-tests.ts +++ b/jquery.color/jquery.color-tests.ts @@ -1,5 +1,3 @@ -/// - var color = $.Color("rgba(255, 255, 255, 0.4)"); var color1 = $.Color({red: 255, green: 255, blue: 255}); var color2 = $.Color({hue: 359, saturation: 0.5, lightness: 0.5}); diff --git a/jquery.colorbox/jquery.colorbox-tests.ts b/jquery.colorbox/jquery.colorbox-tests.ts index 66d54240db..3c05f213c9 100644 --- a/jquery.colorbox/jquery.colorbox-tests.ts +++ b/jquery.colorbox/jquery.colorbox-tests.ts @@ -1,5 +1,3 @@ -/// - //Image gallery var gallery : JQuery = $('a.gallery').colorbox({ rel: 'gal' }); diff --git a/jquery.cookie/jquery.cookie-tests.ts b/jquery.cookie/jquery.cookie-tests.ts index e93d29110c..998d7bf2df 100644 --- a/jquery.cookie/jquery.cookie-tests.ts +++ b/jquery.cookie/jquery.cookie-tests.ts @@ -1,5 +1,3 @@ -/// - class TestObject { text: string; value: number; diff --git a/jquery.customselect/jquery.customselect-tests.ts b/jquery.customselect/jquery.customselect-tests.ts index b0dc9554a9..5cb28a9f05 100644 --- a/jquery.customselect/jquery.customselect-tests.ts +++ b/jquery.customselect/jquery.customselect-tests.ts @@ -1,6 +1,3 @@ -/// - - class CustomSelectOptions implements JQueryCustomSelectOption { "customClass": string; "mapClass": boolean; diff --git a/jquery.cycle/jquery.cycle-tests.ts b/jquery.cycle/jquery.cycle-tests.ts index e93be101f6..df8ed24b22 100644 --- a/jquery.cycle/jquery.cycle-tests.ts +++ b/jquery.cycle/jquery.cycle-tests.ts @@ -1,5 +1,3 @@ -/// - // As basic as it can be $('#element').cycle(); @@ -284,7 +282,7 @@ $('#s2').cycle({ $('#slideshow2').cycle({ fx: 'scrollLeft,scrollDown,scrollRight,scrollUp', randomizeEffects: false, - easing: 'easeInBack' // easing supported via the easing plugin + easing: 'easeInBack' // easing supported via the easing plugin }); // Another Advanced "pager" Demo @@ -294,7 +292,7 @@ $('#slideshow').cycle({ timeout: 0, pager: '#nav', pagerAnchorBuilder: function (idx, slide) { - // return selector string for existing anchor + // return selector string for existing anchor return '#nav li:eq(' + idx + ') a'; } }); @@ -304,7 +302,7 @@ $('#slideshow').cycle({ slideExpr: 'img' }); // Defeating IE's ClearType bug $('#slideshow').cycle({ - cleartype: false // disable cleartype corrections + cleartype: false // disable cleartype corrections }); // Using the 'nowrap' option (manual slideshow) diff --git a/jquery.cycle2/jquery.cycle2-tests.ts b/jquery.cycle2/jquery.cycle2-tests.ts index 0e16629a3e..9d88e92532 100644 --- a/jquery.cycle2/jquery.cycle2-tests.ts +++ b/jquery.cycle2/jquery.cycle2-tests.ts @@ -1,5 +1,3 @@ -/// - // basic $('#element').cycle(); diff --git a/jquery.finger/jquery.finger-tests.ts b/jquery.finger/jquery.finger-tests.ts index 3f35e7322c..c4734610b2 100644 --- a/jquery.finger/jquery.finger-tests.ts +++ b/jquery.finger/jquery.finger-tests.ts @@ -1,5 +1,3 @@ -/// - $.Finger.doubleTapInterval = 400; $.Finger.flickDuration = 250; $.Finger.pressDuration = 100; diff --git a/jquery.flagstrap/jquery.flagstrap-tests.ts b/jquery.flagstrap/jquery.flagstrap-tests.ts index 3bfcf0294e..6d262dc17f 100644 --- a/jquery.flagstrap/jquery.flagstrap-tests.ts +++ b/jquery.flagstrap/jquery.flagstrap-tests.ts @@ -1,14 +1,11 @@ -/// -/// - class TestObject { - + } $(function () { - // basic test - // written in according to basic example from documentation - var htmlSelect = '
    ' + + // basic test + // written in according to basic example from documentation + var htmlSelect = '' + '
    ' + '
    ' + '
    ' + @@ -21,7 +18,7 @@ $(function () { console.log('characters count: ' + $('#flagstrap').html().length + '\n' + $('#flagstrap').html()); // options test - // options -> data attributes + // options -> data attributes // written in according to options -> data attributes example from documentation htmlSelect = '' + '
    ' + @@ -42,7 +39,7 @@ $(function () { console.log('\n\ncharacters count: ' + $('#flagstrap2').html().length + '\n' + $('#flagstrap2').html()); // options test - // options -> instance options + // options -> instance options // written in according to options -> instance options example from documentation htmlSelect = '' + '
    ' + diff --git a/jquery.form/jquery.form-tests.ts b/jquery.form/jquery.form-tests.ts index f115a97f57..c4d3d636bf 100644 --- a/jquery.form/jquery.form-tests.ts +++ b/jquery.form/jquery.form-tests.ts @@ -1,5 +1,3 @@ -/// - // Basic usage jQuery('#myFormId').ajaxForm(); @@ -30,112 +28,112 @@ jQuery.fn.ajaxSubmit.debug = true; // ajaxForm -// bind form using 'ajaxForm' +// bind form using 'ajaxForm' $('#myForm1').ajaxForm({ - target: '#output1', // target element(s) to be updated with server response + target: '#output1', // target element(s) to be updated with server response beforeSubmit: function (formData, jqForm, options) { // pre-submit callback - // formData is an array; here we use $.param to convert it to a string to display it - // but the form plugin does this for you automatically when it submits the data + // formData is an array; here we use $.param to convert it to a string to display it + // but the form plugin does this for you automatically when it submits the data var queryString = $.param(formData); - // jqForm is a jQuery object encapsulating the form element. To access the - // DOM element for the form do this: - // var formElement = jqForm[0]; + // jqForm is a jQuery object encapsulating the form element. To access the + // DOM element for the form do this: + // var formElement = jqForm[0]; alert('About to submit: \n\n' + queryString); - // here we could return false to prevent the form from being submitted; - // returning anything other than false will allow the form submit to continue + // here we could return false to prevent the form from being submitted; + // returning anything other than false will allow the form submit to continue return true; }, success: function (responseText, statusText, xhr) { // post-submit callback - // for normal html responses, the first argument to the success callback - // is the XMLHttpRequest object's responseText property - - // if the ajaxForm method was passed an Options Object with the dataType - // property set to 'xml' then the first argument to the success callback - // is the XMLHttpRequest object's responseXML property - - // if the ajaxForm method was passed an Options Object with the dataType - // property set to 'json' then the first argument to the success callback - // is the json data object returned by the server - + // for normal html responses, the first argument to the success callback + // is the XMLHttpRequest object's responseText property + + // if the ajaxForm method was passed an Options Object with the dataType + // property set to 'xml' then the first argument to the success callback + // is the XMLHttpRequest object's responseXML property + + // if the ajaxForm method was passed an Options Object with the dataType + // property set to 'json' then the first argument to the success callback + // is the json data object returned by the server + alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + '\n\nThe output div should have already been updated with the responseText.'); } - // other available options: - //url: url // override for form's 'action' attribute - //type: type // 'get' or 'post', override for form's 'method' attribute - //dataType: null // 'xml', 'script', or 'json' (expected server response type) - //clearForm: true // clear all form fields after successful submit - //resetForm: true // reset the form after successful submit + // other available options: + //url: url // override for form's 'action' attribute + //type: type // 'get' or 'post', override for form's 'method' attribute + //dataType: null // 'xml', 'script', or 'json' (expected server response type) + //clearForm: true // clear all form fields after successful submit + //resetForm: true // reset the form after successful submit - // $.ajax options can be used here too, for example: - //timeout: 3000 + // $.ajax options can be used here too, for example: + //timeout: 3000 }); // ajaxSubmit $('#myForm2').ajaxSubmit({ - target: '#output2', // target element(s) to be updated with server response + target: '#output2', // target element(s) to be updated with server response beforeSubmit: function (formData, jqForm, options) { // pre-submit callback - // formData is an array; here we use $.param to convert it to a string to display it - // but the form plugin does this for you automatically when it submits the data + // formData is an array; here we use $.param to convert it to a string to display it + // but the form plugin does this for you automatically when it submits the data var queryString = $.param(formData); - // jqForm is a jQuery object encapsulating the form element. To access the - // DOM element for the form do this: - // var formElement = jqForm[0]; + // jqForm is a jQuery object encapsulating the form element. To access the + // DOM element for the form do this: + // var formElement = jqForm[0]; alert('About to submit: \n\n' + queryString); - // here we could return false to prevent the form from being submitted; - // returning anything other than false will allow the form submit to continue + // here we could return false to prevent the form from being submitted; + // returning anything other than false will allow the form submit to continue return true; }, success: function showResponse(responseText, statusText, xhr) { // post-submit callback - // for normal html responses, the first argument to the success callback - // is the XMLHttpRequest object's responseText property + // for normal html responses, the first argument to the success callback + // is the XMLHttpRequest object's responseText property - // if the ajaxSubmit method was passed an Options Object with the dataType - // property set to 'xml' then the first argument to the success callback - // is the XMLHttpRequest object's responseXML property + // if the ajaxSubmit method was passed an Options Object with the dataType + // property set to 'xml' then the first argument to the success callback + // is the XMLHttpRequest object's responseXML property - // if the ajaxSubmit method was passed an Options Object with the dataType - // property set to 'json' then the first argument to the success callback - // is the json data object returned by the server + // if the ajaxSubmit method was passed an Options Object with the dataType + // property set to 'json' then the first argument to the success callback + // is the json data object returned by the server alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + '\n\nThe output div should have already been updated with the responseText.'); } - // other available options: - //url: url // override for form's 'action' attribute - //type: type // 'get' or 'post', override for form's 'method' attribute - //dataType: null // 'xml', 'script', or 'json' (expected server response type) - //clearForm: true // clear all form fields after successful submit - //resetForm: true // reset the form after successful submit + // other available options: + //url: url // override for form's 'action' attribute + //type: type // 'get' or 'post', override for form's 'method' attribute + //dataType: null // 'xml', 'script', or 'json' (expected server response type) + //clearForm: true // clear all form fields after successful submit + //resetForm: true // reset the form after successful submit - // $.ajax options can be used here too, for example: - //timeout: 3000 + // $.ajax options can be used here too, for example: + //timeout: 3000 }); // Validation $('#myForm2').ajaxForm({ beforeSubmit: function (formData, jqForm, options) { - // formData is an array of objects representing the name and value of each field - // that will be sent to the server; it takes the following form: - // - // [ - // { name: username, value: valueOfUsernameInput }, - // { name: password, value: valueOfPasswordInput } - // ] - // - // To validate, we can examine the contents of this array to see if the - // username and password fields have values. If either value evaluates - // to false then we return false from this method. + // formData is an array of objects representing the name and value of each field + // that will be sent to the server; it takes the following form: + // + // [ + // { name: username, value: valueOfUsernameInput }, + // { name: password, value: valueOfPasswordInput } + // ] + // + // To validate, we can examine the contents of this array to see if the + // username and password fields have values. If either value evaluates + // to false then we return false from this method. for (var i = 0; i < formData.length; i++) { if (!formData[i].value) { @@ -150,13 +148,13 @@ $('#myForm2').ajaxForm({ // JSON $('#jsonForm').ajaxForm({ - // dataType identifies the expected content type of the server response + // dataType identifies the expected content type of the server response dataType: 'json', - // success identifies the function to invoke when the server response - // has been received + // success identifies the function to invoke when the server response + // has been received success: function (data) { - // 'data' is the json object returned from the server + // 'data' is the json object returned from the server alert(data.message); } }); @@ -164,14 +162,14 @@ $('#jsonForm').ajaxForm({ // XML $('#xmlForm').ajaxForm({ - // dataType identifies the expected content type of the server response + // dataType identifies the expected content type of the server response dataType: 'xml', - // success identifies the function to invoke when the server response - // has been received + // success identifies the function to invoke when the server response + // has been received success: function (responseXML) { - // 'responseXML' is the XML document returned by the server; we use - // jQuery to extract the content of the message node from the XML doc + // 'responseXML' is the XML document returned by the server; we use + // jQuery to extract the content of the message node from the XML doc var message = $('message', responseXML).text(); alert(message); } @@ -180,11 +178,11 @@ $('#xmlForm').ajaxForm({ // HTML $('#htmlForm').ajaxForm({ - // target identifies the element(s) to update with the server response + // target identifies the element(s) to update with the server response target: '#htmlExampleTarget', - // success identifies the function to invoke when the server response - // has been received; here we apply a fade-in effect to the new content + // success identifies the function to invoke when the server response + // has been received; here we apply a fade-in effect to the new content success: function () { $('#htmlExampleTarget').fadeIn('slow'); } diff --git a/jquery.jnotify/jquery.jnotify-tests.ts b/jquery.jnotify/jquery.jnotify-tests.ts index b5ad3927e2..f38a99760a 100644 --- a/jquery.jnotify/jquery.jnotify-tests.ts +++ b/jquery.jnotify/jquery.jnotify-tests.ts @@ -1,5 +1,3 @@ -/// - $(document).ready(function () { $('#StatusBar').jnotifyInizialize({ oneAtTime: true diff --git a/jquery.joyride/jquery.joyride-tests.ts b/jquery.joyride/jquery.joyride-tests.ts index f0a51b5270..c7324dd6c9 100644 --- a/jquery.joyride/jquery.joyride-tests.ts +++ b/jquery.joyride/jquery.joyride-tests.ts @@ -1,6 +1,3 @@ -/// - - var options: JoyrideOptions; options.autoStart = true; options.postStepCallback = (index, tip)=> { diff --git a/jquery.jsignature/jquery.jsignature-tests.ts b/jquery.jsignature/jquery.jsignature-tests.ts index 5ec4bc486d..58d73fe24b 100644 --- a/jquery.jsignature/jquery.jsignature-tests.ts +++ b/jquery.jsignature/jquery.jsignature-tests.ts @@ -1,8 +1,6 @@ -/// - /* * Taken from the tests section on jSignature - */ + */ $(document).ready(function () { var $sigdiv = $('#signature'); @@ -10,7 +8,7 @@ $(document).ready(function () { $sigdiv.jSignature(); $sigdiv.jSignature("reset"); - + var data = $sigdiv.jSignature("getData", "svgbase64"); $sigdiv.jSignature("setData", "data:" + data); diff --git a/jquery.leanmodal/jquery.leanmodal-tests.ts b/jquery.leanmodal/jquery.leanmodal-tests.ts index fb6c4ae344..1884cb25d9 100644 --- a/jquery.leanmodal/jquery.leanmodal-tests.ts +++ b/jquery.leanmodal/jquery.leanmodal-tests.ts @@ -1,6 +1,3 @@ -/// - - class LeanModalOptions implements JQueryLeanModalOption { top : number; overlay : number; diff --git a/jquery.livestampjs/jquery.livestampjs-tests.ts b/jquery.livestampjs/jquery.livestampjs-tests.ts index dc713819c9..6b5bd01835 100644 --- a/jquery.livestampjs/jquery.livestampjs-tests.ts +++ b/jquery.livestampjs/jquery.livestampjs-tests.ts @@ -1,4 +1,3 @@ -/// import * as moment from 'moment'; $('#test1').livestamp(new Date('June 18, 1987')); diff --git a/jquery.menuaim/jquery.menuaim-tests.ts b/jquery.menuaim/jquery.menuaim-tests.ts index e2a1b36aff..01baa59e03 100644 --- a/jquery.menuaim/jquery.menuaim-tests.ts +++ b/jquery.menuaim/jquery.menuaim-tests.ts @@ -1,5 +1,3 @@ -/// - $('div').menuAim({ activate: function () { }, deactivate: function () { }, diff --git a/jquery.mmenu/jquery.mmenu-tests.ts b/jquery.mmenu/jquery.mmenu-tests.ts index 385f479507..a08f4371ec 100644 --- a/jquery.mmenu/jquery.mmenu-tests.ts +++ b/jquery.mmenu/jquery.mmenu-tests.ts @@ -1,7 +1,3 @@ -/// -/// - - // -------------------------------------------------------- // ---------------- TEST DEFAULT OPTIONS ------------------ // -------------------------------------------------------- diff --git a/jquery.payment/index.d.ts b/jquery.payment/index.d.ts index 341e695a9a..88ecd255a5 100644 --- a/jquery.payment/index.d.ts +++ b/jquery.payment/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Eric J. Smith , John Rutherford // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + declare namespace JQueryPayment { interface Payment { diff --git a/jquery.payment/jquery.payment-tests.ts b/jquery.payment/jquery.payment-tests.ts index db02b96d90..9eaad853cb 100644 --- a/jquery.payment/jquery.payment-tests.ts +++ b/jquery.payment/jquery.payment-tests.ts @@ -1,6 +1,3 @@ -/// -/// - $.payment.cards.push({ // Card type, as returned by $.payment.cardType. type: 'mastercard', diff --git a/jquery.pjax.falsandtru/jquery.pjax.falsandtru-tests.ts b/jquery.pjax.falsandtru/jquery.pjax.falsandtru-tests.ts index 8bfb91a27e..b215b02b35 100644 --- a/jquery.pjax.falsandtru/jquery.pjax.falsandtru-tests.ts +++ b/jquery.pjax.falsandtru/jquery.pjax.falsandtru-tests.ts @@ -1,6 +1,3 @@ - -/// - function test_pjax() { $.pjax(); } diff --git a/jquery.pjax/jquery.pjax-tests.ts b/jquery.pjax/jquery.pjax-tests.ts index 25422922d8..91cc9391a2 100644 --- a/jquery.pjax/jquery.pjax-tests.ts +++ b/jquery.pjax/jquery.pjax-tests.ts @@ -1,6 +1,3 @@ - -/// - function test_fn_pjax() { $(document).pjax("a"); $(document).pjax("a", "#pjax-container"); diff --git a/jquery.placeholder/jquery.placeholder-tests.ts b/jquery.placeholder/jquery.placeholder-tests.ts index edaf3ea111..04c526b352 100644 --- a/jquery.placeholder/jquery.placeholder-tests.ts +++ b/jquery.placeholder/jquery.placeholder-tests.ts @@ -1,5 +1,3 @@ -/// - $('input').placeholder(); // specify custom class diff --git a/jquery.pnotify/jquery.pnotify-tests.ts b/jquery.pnotify/jquery.pnotify-tests.ts index 41cd7d3fda..f1b8ffb73e 100644 --- a/jquery.pnotify/jquery.pnotify-tests.ts +++ b/jquery.pnotify/jquery.pnotify-tests.ts @@ -1,6 +1,3 @@ -/// - - function test_pnotify() { diff --git a/jquery.prettyphoto/jquery.prettyphoto-tests.ts b/jquery.prettyphoto/jquery.prettyphoto-tests.ts index 4fcbf9ecdf..888d68ada4 100644 --- a/jquery.prettyphoto/jquery.prettyphoto-tests.ts +++ b/jquery.prettyphoto/jquery.prettyphoto-tests.ts @@ -1,8 +1,3 @@ -// Tests for prettyPhoto library - -/// - - // JQUERY $('#id').prettyPhoto(); diff --git a/jquery.qrcode/jquery.qrcode-tests.ts b/jquery.qrcode/jquery.qrcode-tests.ts index a634bd6f07..d007b203da 100644 --- a/jquery.qrcode/jquery.qrcode-tests.ts +++ b/jquery.qrcode/jquery.qrcode-tests.ts @@ -1,5 +1,3 @@ -/// - // Examples from website (note: the examples use color instead of fill, which is not supported) $('.container').qrcode(); diff --git a/jquery.rowgrid/jquery.rowgrid-tests.ts b/jquery.rowgrid/jquery.rowgrid-tests.ts index ba3e5f822d..3f1427c94a 100644 --- a/jquery.rowgrid/jquery.rowgrid-tests.ts +++ b/jquery.rowgrid/jquery.rowgrid-tests.ts @@ -1,12 +1,10 @@ -/// - /* * Test different options */ var options = { - minMargin: 10, - maxMargin: 35, + minMargin: 10, + maxMargin: 35, itemSelector: ".item" }; diff --git a/jquery.scrollto/jquery.scrollto-tests.ts b/jquery.scrollto/jquery.scrollto-tests.ts index 303ce0cd01..fcdc2f50bb 100644 --- a/jquery.scrollto/jquery.scrollto-tests.ts +++ b/jquery.scrollto/jquery.scrollto-tests.ts @@ -1,5 +1,3 @@ -/// - $('div').scrollTo(340); $('div').scrollTo('+=340px', { axis: 'y' }); diff --git a/jquery.simplemodal/jquery.simplemodal-tests.ts b/jquery.simplemodal/jquery.simplemodal-tests.ts index 8e73e057cc..0784f0eeeb 100644 --- a/jquery.simplemodal/jquery.simplemodal-tests.ts +++ b/jquery.simplemodal/jquery.simplemodal-tests.ts @@ -1,7 +1,5 @@ // Tests taken from documentation: http://www.ericmmartin.com/projects/simplemodal/ -/// - // Chained call with no options $("#sample").modal(); diff --git a/jquery.simplepagination/jquery.simplepagination-tests.ts b/jquery.simplepagination/jquery.simplepagination-tests.ts index b35a6f42a0..075fe02628 100644 --- a/jquery.simplepagination/jquery.simplepagination-tests.ts +++ b/jquery.simplepagination/jquery.simplepagination-tests.ts @@ -1,5 +1,3 @@ -/// - var selector = '#elementId'; $(function () { diff --git a/jquery.slimscroll/jquery.slimscroll-tests.ts b/jquery.slimscroll/jquery.slimscroll-tests.ts index 0d4be5af94..a0368d07e9 100644 --- a/jquery.slimscroll/jquery.slimscroll-tests.ts +++ b/jquery.slimscroll/jquery.slimscroll-tests.ts @@ -1,5 +1,3 @@ -/// - $("div").slimScroll(); $("div").slimScroll({ diff --git a/jquery.tagsmanager/jquery.tagsmanager-tests.ts b/jquery.tagsmanager/jquery.tagsmanager-tests.ts index 33af6a8b7b..26a75e8310 100644 --- a/jquery.tagsmanager/jquery.tagsmanager-tests.ts +++ b/jquery.tagsmanager/jquery.tagsmanager-tests.ts @@ -1,6 +1,3 @@ -/// - - var options: ITagsManagerOptions = { prefilled: ["Pisa", "Rome"], CapitalizeFirstLetter: true, diff --git a/jquery.timeago/jquery.timeago-tests.ts b/jquery.timeago/jquery.timeago-tests.ts index 2a852331be..f77b40b121 100644 --- a/jquery.timeago/jquery.timeago-tests.ts +++ b/jquery.timeago/jquery.timeago-tests.ts @@ -1,5 +1,3 @@ -/// - // Basic usage var jQueryElement: JQuery = jQuery("abbr.timeago").timeago(); diff --git a/jquery.timepicker/jquery.timepicker-tests.ts b/jquery.timepicker/jquery.timepicker-tests.ts index cbb14dfe7c..52329cf11a 100644 --- a/jquery.timepicker/jquery.timepicker-tests.ts +++ b/jquery.timepicker/jquery.timepicker-tests.ts @@ -1,5 +1,3 @@ -/// - var beforeShowCallback, onSelectCallback, onCloseCallback, onHourShow, onMinuteShow; $('#timepicker').timepicker({ timeSeparator: ':', diff --git a/jquery.timer/jquery.timer-tests.ts b/jquery.timer/jquery.timer-tests.ts index e5d1cdaa3a..1c6653bfdb 100644 --- a/jquery.timer/jquery.timer-tests.ts +++ b/jquery.timer/jquery.timer-tests.ts @@ -1,31 +1,28 @@ -/// +// Create the timer +$("body").timer( + function () { + console.log("This function just got called"); + }, 10000, true +); +$("body").timer.set({ time: 5000 }); // Change the time from 10000 millseconds to 5000 milliseconds +$("body").timer.toggle(false); // Reset the timer +$("body").timer.stop(); // Stop the timer +$("body").timer.play(); // Start / play the timer - // Create the timer - $("body").timer( - function () { - console.log("This function just got called"); - }, 10000, true - ); +// #region Outputting if timer is active or not +var isTimerActive = $("body").timer.isActive; // Define boolean isActive as isTimerActive +if (isTimerActive == true){ + console.log("Timer is active!"); +} +else{ + console.log("Timer is not active!"); +} +// #endregion - $("body").timer.set({ time: 5000 }); // Change the time from 10000 millseconds to 5000 milliseconds - $("body").timer.toggle(false); // Reset the timer - $("body").timer.stop(); // Stop the timer - $("body").timer.play(); // Start / play the timer +// #region Get time remaining +console.log("Time remaining on timer: " + $("body").timer.remaining.toString); +// #endregion - // #region Outputting if timer is active or not - var isTimerActive = $("body").timer.isActive; // Define boolean isActive as isTimerActive - if (isTimerActive == true){ - console.log("Timer is active!"); - } - else{ - console.log("Timer is not active!"); - } - // #endregion - - // #region Get time remaining - console.log("Time remaining on timer: " + $("body").timer.remaining.toString); - // #endregion - - $("body").timer.stop(); // Stop the timer once more for the purpose of the tests (to test once()) - $("body").timer.once(1000); // Run the timer ONCE in 1 second \ No newline at end of file +$("body").timer.stop(); // Stop the timer once more for the purpose of the tests (to test once()) +$("body").timer.once(1000); // Run the timer ONCE in 1 second \ No newline at end of file diff --git a/jquery.tipsy/jquery.tipsy-tests.ts b/jquery.tipsy/jquery.tipsy-tests.ts index e307e5d364..09ba7f2d68 100644 --- a/jquery.tipsy/jquery.tipsy-tests.ts +++ b/jquery.tipsy/jquery.tipsy-tests.ts @@ -1,5 +1,3 @@ -/// - // basic $('#example-1').tipsy(); diff --git a/jquery.tools/jquery.tools-tests.ts b/jquery.tools/jquery.tools-tests.ts index 0a435ccf02..443425e76b 100644 --- a/jquery.tools/jquery.tools-tests.ts +++ b/jquery.tools/jquery.tools-tests.ts @@ -1,5 +1,3 @@ -/// - /* from documentation at http://jquerytools.github.io/documentation/overlay/index.html */ $("img[rel]").overlay(); diff --git a/jquery.total-storage/jquery.total-storage-tests.ts b/jquery.total-storage/jquery.total-storage-tests.ts index 0a23dd67cf..37ebb1ca73 100644 --- a/jquery.total-storage/jquery.total-storage-tests.ts +++ b/jquery.total-storage/jquery.total-storage-tests.ts @@ -1,10 +1,3 @@ -// Type definitions for jQueryTotalStorage 1.1.2 -// Project: https://github.com/Upstatement/jquery-total-storage -// Definitions by: Jeremy Brooks -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - //direct call $.totalStorage("test_key1", "test_value"); var val1:string = $.totalStorage("test_key"); diff --git a/jquery.transit/jquery.transit-tests.ts b/jquery.transit/jquery.transit-tests.ts index 2a672ec979..4f3b41f228 100644 --- a/jquery.transit/jquery.transit-tests.ts +++ b/jquery.transit/jquery.transit-tests.ts @@ -1,5 +1,3 @@ -/// - class TransitOptions implements JQueryTransitOptions { opacity: number; duration: number; diff --git a/jquery.ui.datetimepicker/jquery.ui.datetimepicker-tests.ts b/jquery.ui.datetimepicker/jquery.ui.datetimepicker-tests.ts index 44996637da..00ba4fe297 100644 --- a/jquery.ui.datetimepicker/jquery.ui.datetimepicker-tests.ts +++ b/jquery.ui.datetimepicker/jquery.ui.datetimepicker-tests.ts @@ -1,9 +1,6 @@ -/// - - // basic no options $('#datetimepicker').datetimepicker({ - + }); // basic with some options diff --git a/jquery.validation/jquery.validation-tests.ts b/jquery.validation/jquery.validation-tests.ts index 0b2de520f2..68062d6e1c 100644 --- a/jquery.validation/jquery.validation-tests.ts +++ b/jquery.validation/jquery.validation-tests.ts @@ -1,6 +1,4 @@ -/// -/// - +/// function test_validate() { $("#commentForm").validate(); @@ -264,4 +262,3 @@ function test_static_methods() { jQuery.validator.format('{0} {1}', 'a', 2); jQuery.validator.format('{0} {1}', ['a', 2]); } - \ No newline at end of file diff --git a/jquery.watermark/jquery.watermark-tests.ts b/jquery.watermark/jquery.watermark-tests.ts index 225ba0a482..e92ec0df11 100644 --- a/jquery.watermark/jquery.watermark-tests.ts +++ b/jquery.watermark/jquery.watermark-tests.ts @@ -1,5 +1,3 @@ -/// - $('#inputId').watermark('Required information'); $('#inputId').watermark('Required information', { className: 'myClassName' }); $('#inputId').watermark('Search', { useNative: false }); diff --git a/jquery.window/jquery.window-tests.ts b/jquery.window/jquery.window-tests.ts index 4b1b9b6eb2..15021cad7d 100644 --- a/jquery.window/jquery.window-tests.ts +++ b/jquery.window/jquery.window-tests.ts @@ -1,5 +1,3 @@ -/// - function example_1() { $.window({ title: "Cyclops Studio", @@ -20,13 +18,13 @@ function example_2() { function example_3() { // prepare customerized static attributes, see static attributes - // Note: you should call this method before starting to create window instances, or windows might display wrong. + // Note: you should call this method before starting to create window instances, or windows might display wrong. $.window.prepare({ dock: 'bottom', // change the dock direction: 'left', 'right', 'top', 'bottom' animationSpeed: 200, // set animation speed minWinLong: 180 // set minimized window long dimension width in pixel }); - + // limit window within body $.window({ icon: 'http://www.fstoke.me/favicon.ico', @@ -51,7 +49,7 @@ function example_3() { x: 80, y: 80 }); - + // assign the dock area $.window.prepare({ dock: 'bottom', // change the dock direction: 'left', 'right', 'top', 'bottom' diff --git a/jquerymobile/jquerymobile-tests.ts b/jquerymobile/jquerymobile-tests.ts index 105edc3f88..e7fbf3bfff 100644 --- a/jquerymobile/jquerymobile-tests.ts +++ b/jquerymobile/jquerymobile-tests.ts @@ -1,6 +1,3 @@ -/// - - function test_api() { $.mobile.changePage("about/us.html", { transition: "slideup" }); $.mobile.changePage("searchresults.php", { diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index 2cce742f86..5755738622 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -1,6 +1,3 @@ -/// - - function test_draggable() { $("#draggable").draggable({ axis: "y" }); diff --git a/jsonwebtoken/jsonwebtoken-tests.ts b/jsonwebtoken/jsonwebtoken-tests.ts index 4a939becbc..e591f31159 100644 --- a/jsonwebtoken/jsonwebtoken-tests.ts +++ b/jsonwebtoken/jsonwebtoken-tests.ts @@ -1,10 +1,8 @@ -/** - * Test suite created by Maxime LUCE - * +/** + * Test suite created by Maxime LUCE + * * Created by using code samples from https://github.com/auth0/node-jsonwebtoken. - */ - -/// + */ import jwt = require("jsonwebtoken"); import fs = require("fs"); @@ -49,7 +47,7 @@ jwt.verify(token, 'shhhhh', function(err, decoded) { // invalid token jwt.verify(token, 'wrong-secret', function(err, decoded) { - // err + // err // decoded undefined }); diff --git a/jsrender/jsrender-tests.ts b/jsrender/jsrender-tests.ts index d728f968ae..7b5bf5a525 100644 --- a/jsrender/jsrender-tests.ts +++ b/jsrender/jsrender-tests.ts @@ -1,5 +1,3 @@ -/// - $.views.converters("upper", function(val) { return val.toUpperCase(); }); diff --git a/jsx-chai/jsx-chai-tests.ts b/jsx-chai/jsx-chai-tests.ts index d421ae0874..48c49e7b25 100644 --- a/jsx-chai/jsx-chai-tests.ts +++ b/jsx-chai/jsx-chai-tests.ts @@ -1,5 +1,3 @@ -/// - import chai = require('chai'); import jsxChai = require('jsx-chai'); diff --git a/kendo-ui/kendo-ui-tests.ts b/kendo-ui/kendo-ui-tests.ts index d1cc528edb..0b79f87954 100644 --- a/kendo-ui/kendo-ui-tests.ts +++ b/kendo-ui/kendo-ui-tests.ts @@ -1,6 +1,3 @@ -/// - - var is = { string: (msg: string) => { return true; diff --git a/klaw/klaw-tests.ts b/klaw/klaw-tests.ts index 312af220ff..acd8b2fcbf 100644 --- a/klaw/klaw-tests.ts +++ b/klaw/klaw-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as klaw from "klaw"; const path = require('path'); diff --git a/knockout-amd-helpers/knockout-amd-helpers-tests.ts b/knockout-amd-helpers/knockout-amd-helpers-tests.ts index d2773dee12..5b9c2983b5 100644 --- a/knockout-amd-helpers/knockout-amd-helpers-tests.ts +++ b/knockout-amd-helpers/knockout-amd-helpers-tests.ts @@ -1,8 +1,5 @@ // Tests for knockout.projections.d.ts -/// - - //The baseDir is used in building the path to use in the require statement. If your modules live in the modules directory, then you can specify it globally here. ko.bindingHandlers.module.baseDir = "blub"; diff --git a/knockout-transformations/knockout-transformations-tests.ts b/knockout-transformations/knockout-transformations-tests.ts index c8e93fc20e..6725f4f209 100644 --- a/knockout-transformations/knockout-transformations-tests.ts +++ b/knockout-transformations/knockout-transformations-tests.ts @@ -1,6 +1,3 @@ -/// - - // Test map var sourceItems: KnockoutObservableArray = ko.observableArray([1, 2, 3, 4, 5]); var squares: KnockoutObservableArray = sourceItems.map(function (x) { return x * x; }); diff --git a/knockout.kogrid/knockout.kogrid-tests.ts b/knockout.kogrid/knockout.kogrid-tests.ts index 8abe83d36d..ba36e78e9f 100644 --- a/knockout.kogrid/knockout.kogrid-tests.ts +++ b/knockout.kogrid/knockout.kogrid-tests.ts @@ -1,33 +1,27 @@ -/// +export interface IGridItem { + name: string; +} +export class Tests { + public items: KnockoutObservableArray; + public selectedItems: KnockoutObservableArray; + public gridOptionsAlarms: kg.GridOptions; -namespace KoGridTests -{ - export interface IGridItem { - name: string; - } + constructor() { + this.items = ko.observableArray(); + this.selectedItems = ko.observableArray(); + this.gridOptionsAlarms = this.createDefaultGridOptions(this.items, this.selectedItems); + } - export class Tests { - public items: KnockoutObservableArray; - public selectedItems: KnockoutObservableArray; - public gridOptionsAlarms: kg.GridOptions; - - constructor() { - this.items = ko.observableArray(); - this.selectedItems = ko.observableArray(); - this.gridOptionsAlarms = this.createDefaultGridOptions(this.items, this.selectedItems); - } - - public createDefaultGridOptions(dataArray: KnockoutObservableArray, selectedItems: KnockoutObservableArray): kg.GridOptions { - return { - data: dataArray, - displaySelectionCheckbox: false, - footerVisible: false, - multiSelect: false, - showColumnMenu: false, - plugins: null, - selectedItems: selectedItems - }; - } - } + public createDefaultGridOptions(dataArray: KnockoutObservableArray, selectedItems: KnockoutObservableArray): kg.GridOptions { + return { + data: dataArray, + displaySelectionCheckbox: false, + footerVisible: false, + multiSelect: false, + showColumnMenu: false, + plugins: null, + selectedItems: selectedItems + }; + } } diff --git a/knockout.mapping/knockout.mapping-tests.ts b/knockout.mapping/knockout.mapping-tests.ts index 7b1a9aca8d..6262f36275 100644 --- a/knockout.mapping/knockout.mapping-tests.ts +++ b/knockout.mapping/knockout.mapping-tests.ts @@ -1,6 +1,3 @@ - -/// - var inputJSON = '{ name: "foo" }'; var inputData = { name: 'foo' }; var inputModel = { name: 'bar' }; diff --git a/knockout.projections/knockout.projections-tests.ts b/knockout.projections/knockout.projections-tests.ts index c0899c81ee..bc8a505484 100644 --- a/knockout.projections/knockout.projections-tests.ts +++ b/knockout.projections/knockout.projections-tests.ts @@ -1,8 +1,3 @@ -// Tests for knockout.projections.d.ts - -/// - - // Test map var sourceItems = ko.observableArray([1, 2, 3, 4, 5]); var squares = sourceItems.map(function (x) { return x * x; }); diff --git a/knockout.punches/knockout.punches-tests.ts b/knockout.punches/knockout.punches-tests.ts index 1de89ca570..2eccd25d37 100644 --- a/knockout.punches/knockout.punches-tests.ts +++ b/knockout.punches/knockout.punches-tests.ts @@ -1,6 +1,3 @@ -/// - - function test_enable() { ko.punches.enableAll(); } diff --git a/knockstrap/knockstrap-tests.ts b/knockstrap/knockstrap-tests.ts index 2033252de2..2fb58fbaf7 100644 --- a/knockstrap/knockstrap-tests.ts +++ b/knockstrap/knockstrap-tests.ts @@ -1,9 +1,3 @@ -/// -/// -/// - - - // test unique id var adaskoUnitqueId: string = ko.utils.uniqueId('adaskothebeast'); diff --git a/ko.plus/ko.plus-tests.ts b/ko.plus/ko.plus-tests.ts index cbb86d3122..d3472c0d82 100644 --- a/ko.plus/ko.plus-tests.ts +++ b/ko.plus/ko.plus-tests.ts @@ -1,30 +1,9 @@ - -/// - -// Tests for ko.plus.d.ts -// Project: https://github.com/stevegreatrex/ko.plus -// Definitions by: Howard Richards -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/* - Version 1.0 - initial commit - - Version 1.1 - added test for makeEditable - - Version 1.2 - amended callback on commmand.fail() method - accepts response, - status and message values - - Note: Typescript version 1.4 or higher is required for union types - and type declarations -*/ - function CommandTests() { - // initalize command with an execute method var cmd1 = ko.command(() => { return "Hello cmd1"; }); - + // initialize command and add done and fail callbacks var cmd2 = ko.command(() => { return "Hello cmd2"; @@ -56,7 +35,7 @@ function CommandTests() { // test execute the command cmd1(); - + // test properties of the commmand var isRunning = cmd1.isRunning(); var failed = cmd1.failed(); @@ -75,7 +54,7 @@ function EditableTests() { var edit3 = ko.editable({ test: true }); // with anything var edit4 = ko.editable(1); // with union types - var edit5 = ko.editable("test"); + var edit5 = ko.editable("test"); ko.editable.makeEditable(this); @@ -119,7 +98,7 @@ function EditableArrayTests() { function SortableTests() { - // sorting is added via an extender, there are no .d.ts + // sorting is added via an extender, there are no .d.ts // types for this at present var sort1 = ko.observableArray([1, 2, 3]).extend({ sortable: true }); diff --git a/koa-logger/koa-logger-tests.ts b/koa-logger/koa-logger-tests.ts index f2d17ba090..502c33255d 100644 --- a/koa-logger/koa-logger-tests.ts +++ b/koa-logger/koa-logger-tests.ts @@ -1,5 +1,3 @@ -/// - import * as koa from 'koa'; import * as logger from 'koa-logger'; diff --git a/kolite/kolite-tests.ts b/kolite/kolite-tests.ts index 539c284861..2ce3cbd0f0 100644 --- a/kolite/kolite-tests.ts +++ b/kolite/kolite-tests.ts @@ -1,6 +1,3 @@ -/// -/// - function test_activityDefaults() { ko.bindingHandlers.activity.defaultOptions = { activityClass: 'fa fa-spinner fa-spin', diff --git a/kue/kue-tests.ts b/kue/kue-tests.ts index a66dc4384c..aa61ff2f6a 100644 --- a/kue/kue-tests.ts +++ b/kue/kue-tests.ts @@ -1,5 +1,3 @@ -/// - import kue = require('kue'); // create our job queue diff --git a/leaflet-curve/leaflet-curve-tests.ts b/leaflet-curve/leaflet-curve-tests.ts index ec2461cbd2..3d8b319e63 100644 --- a/leaflet-curve/leaflet-curve-tests.ts +++ b/leaflet-curve/leaflet-curve-tests.ts @@ -1,5 +1,3 @@ -/// - var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmAttrib = '© OpenStreetMap contributors', osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}), diff --git a/leaflet-draw/leaflet-draw-tests.ts b/leaflet-draw/leaflet-draw-tests.ts index 4260eac263..6373687a03 100644 --- a/leaflet-draw/leaflet-draw-tests.ts +++ b/leaflet-draw/leaflet-draw-tests.ts @@ -1,5 +1,3 @@ -/// - var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmAttrib = '© OpenStreetMap contributors', osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}), diff --git a/libpq/libpq-tests.ts b/libpq/libpq-tests.ts index 8a9aced3c3..5736577e67 100644 --- a/libpq/libpq-tests.ts +++ b/libpq/libpq-tests.ts @@ -1,4 +1,3 @@ -/// /// import {Buffer} from 'buffer'; diff --git a/magicsuggest/magicsuggest-tests.ts b/magicsuggest/magicsuggest-tests.ts index 46cb799d25..96a513a7b9 100644 --- a/magicsuggest/magicsuggest-tests.ts +++ b/magicsuggest/magicsuggest-tests.ts @@ -1,5 +1,3 @@ -/// - function basicTest() { $('#magicSuggest').magicSuggest(); } diff --git a/mailcheck/mailcheck-tests.ts b/mailcheck/mailcheck-tests.ts index 07fc473893..971ecf8218 100644 --- a/mailcheck/mailcheck-tests.ts +++ b/mailcheck/mailcheck-tests.ts @@ -1,5 +1,3 @@ -/// - import MC = require('mailcheck'); var domains = ['gmail.com', 'aol.com']; diff --git a/markitup/markitup-tests.ts b/markitup/markitup-tests.ts index f8b12d3c00..b8a7675529 100644 --- a/markitup/markitup-tests.ts +++ b/markitup/markitup-tests.ts @@ -1,6 +1,3 @@ -/// - - // https://github.com/markitup/1.x/blob/master/markitup/sets/default/set.js var mySettings = { onShiftEnter: { diff --git a/maskedinput/maskedinput-tests.ts b/maskedinput/maskedinput-tests.ts index 6d620ce1b9..99c1ecb8bb 100644 --- a/maskedinput/maskedinput-tests.ts +++ b/maskedinput/maskedinput-tests.ts @@ -1,10 +1,3 @@ -// Type definitions for Masked Input plugin for jQuery -// Project: http://digitalbush.com/projects/masked-input-plugin -// Definitions by: Lokesh Peta -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - $("#test").mask("9:000"); $("#test").mask("9:000", { numeric: true }); diff --git a/material-ui/material-ui-tests.tsx b/material-ui/material-ui-tests.tsx index 06f75abe9a..0ea5a72352 100644 --- a/material-ui/material-ui-tests.tsx +++ b/material-ui/material-ui-tests.tsx @@ -1,8 +1,3 @@ -/// -/// -/// -/// - import * as React from 'react'; import {Component, PropTypes} from 'react'; import * as ReactDOM from 'react-dom'; diff --git a/mcustomscrollbar/mcustomscrollbar-tests.ts b/mcustomscrollbar/mcustomscrollbar-tests.ts index aecb236286..f00cd5a491 100644 --- a/mcustomscrollbar/mcustomscrollbar-tests.ts +++ b/mcustomscrollbar/mcustomscrollbar-tests.ts @@ -1,6 +1,3 @@ -/// - - class SimpleTest { element: JQuery; diff --git a/md5/md5-tests.ts b/md5/md5-tests.ts index 427a93486a..924c9b8d91 100644 --- a/md5/md5-tests.ts +++ b/md5/md5-tests.ts @@ -1,5 +1,3 @@ -/// - import fs = require("fs"); import md5 = require("md5"); /** @@ -7,7 +5,7 @@ import md5 = require("md5"); * md5(message) * message -- String or Buffer * returns String - * + * * Usage **************************************************** * var md5 = require('md5'); * @@ -15,10 +13,10 @@ import md5 = require("md5"); **************************************************** * This will print the following * 78e731027d8fd50ed642340b7c9a63b3 - * + * * It supports buffers, too - **************************************************** - * var fs = require('fs'); * + **************************************************** + * var fs = require('fs'); * * var md5 = require('md5'); * * * * fs.readFile('example.txt', function(err, buf) { * diff --git a/meteor-roles/meteor-roles-tests.ts b/meteor-roles/meteor-roles-tests.ts index 8f73f13208..50552c82ff 100644 --- a/meteor-roles/meteor-roles-tests.ts +++ b/meteor-roles/meteor-roles-tests.ts @@ -1,6 +1,3 @@ -/// - - import * as _ from 'underscore'; /** diff --git a/metismenu/metismenu-tests.ts b/metismenu/metismenu-tests.ts index eb17270021..64aa809cf7 100644 --- a/metismenu/metismenu-tests.ts +++ b/metismenu/metismenu-tests.ts @@ -1,5 +1,3 @@ -/// - $('#menu').metisMenu(); $('.metismenu').metisMenu({toggle: false}); diff --git a/mssql/mssql-tests.ts b/mssql/mssql-tests.ts index 52ae6f953c..764f6da8e1 100644 --- a/mssql/mssql-tests.ts +++ b/mssql/mssql-tests.ts @@ -1,5 +1,3 @@ -/// - import sql = require('mssql'); interface Entity{ diff --git a/mu2/mu2-tests.ts b/mu2/mu2-tests.ts index dc960f20d7..d85e1463b9 100644 --- a/mu2/mu2-tests.ts +++ b/mu2/mu2-tests.ts @@ -1,6 +1,3 @@ - -/// - import mu2 = require('mu2'); import stream = require('stream'); diff --git a/multiparty/multiparty-tests.ts b/multiparty/multiparty-tests.ts index be49092189..839ca92882 100644 --- a/multiparty/multiparty-tests.ts +++ b/multiparty/multiparty-tests.ts @@ -1,5 +1,3 @@ - -/// import multiparty = require('multiparty'); import http = require('http'); import util = require('util'); diff --git a/mz/mz-tests.ts b/mz/mz-tests.ts index 8246eecbab..7eda9f28bf 100644 --- a/mz/mz-tests.ts +++ b/mz/mz-tests.ts @@ -1,7 +1,4 @@ /// -/// - - import assert = require('assert') import fs = require('mz/fs') diff --git a/n3/n3-tests.ts b/n3/n3-tests.ts index a7e529bc7d..13247dfdb2 100644 --- a/n3/n3-tests.ts +++ b/n3/n3-tests.ts @@ -1,5 +1,3 @@ -/// - import * as N3 from "n3"; import * as fs from "fs"; import * as stream from "stream"; @@ -26,7 +24,7 @@ function test_serialize() { }); } -/** +/** The following tests are taken from ... https://github.com/RubenVerborgh/N3.js/blob/master/README.md */ diff --git a/ng-command/ng-command-tests.ts b/ng-command/ng-command-tests.ts index c6eb344ed7..32f9bef158 100644 --- a/ng-command/ng-command-tests.ts +++ b/ng-command/ng-command-tests.ts @@ -1,5 +1,3 @@ -/// - var app = angular.module('testModule', ['ng-command']); class CommandTestController { diff --git a/ng-dialog/ng-dialog-tests.ts b/ng-dialog/ng-dialog-tests.ts index 6c867f422d..b66ed173b7 100644 --- a/ng-dialog/ng-dialog-tests.ts +++ b/ng-dialog/ng-dialog-tests.ts @@ -1,4 +1,3 @@ -/// import * as angular from 'angular'; var app = angular.module('testModule', ['ngDialog']); diff --git a/ng-grid/ng-grid-tests.ts b/ng-grid/ng-grid-tests.ts index f14e9cb540..c6331fdc15 100644 --- a/ng-grid/ng-grid-tests.ts +++ b/ng-grid/ng-grid-tests.ts @@ -1,5 +1,3 @@ -/// - var options1: ngGrid.IGridOptions = { data: [{ 'Name': 'Bob' }, { 'Name': 'Jane' }] }; diff --git a/ng-notify/ng-notify-tests.ts b/ng-notify/ng-notify-tests.ts index e140cb6130..9f81d25e87 100644 --- a/ng-notify/ng-notify-tests.ts +++ b/ng-notify/ng-notify-tests.ts @@ -1,5 +1,3 @@ -/// - class NgNotifyTestController { static $inject = ['$scope', 'ngNotify']; diff --git a/ngprogress-lite/ngprogress-lite-tests.ts b/ngprogress-lite/ngprogress-lite-tests.ts index c7df7f9b6b..c4b903d78b 100644 --- a/ngprogress-lite/ngprogress-lite-tests.ts +++ b/ngprogress-lite/ngprogress-lite-tests.ts @@ -1,6 +1,3 @@ -/// - - var app = angular.module('testApp', ['ngProgressLite']); app.config( diff --git a/node-hue-api/node-hue-api-tests.ts b/node-hue-api/node-hue-api-tests.ts index 44903fa4da..44e24da9b1 100644 --- a/node-hue-api/node-hue-api-tests.ts +++ b/node-hue-api/node-hue-api-tests.ts @@ -1,5 +1,3 @@ -/// - import hue = require('node-hue-api'); hue.nupnpSearch().then(function (bridges) { diff --git a/node-int64/node-int64-tests.ts b/node-int64/node-int64-tests.ts index 16df3a00ca..3235efa3d8 100644 --- a/node-int64/node-int64-tests.ts +++ b/node-int64/node-int64-tests.ts @@ -1,9 +1,5 @@ -/// - // Play example copy - - // First, let's illustrate the problem ... (0x123456789).toString(16); //!! '123456789' // <- what we expect. diff --git a/node-mysql-wrapper/node-mysql-wrapper-tests.ts b/node-mysql-wrapper/node-mysql-wrapper-tests.ts index 5b67969ffe..2811292fe6 100644 --- a/node-mysql-wrapper/node-mysql-wrapper-tests.ts +++ b/node-mysql-wrapper/node-mysql-wrapper-tests.ts @@ -1,7 +1,3 @@ - -/// -/// - var express = require('express'); var app = express(); var server = require('http').createServer(app); diff --git a/nouislider/v7/nouislider-tests.ts b/nouislider/v7/nouislider-tests.ts index 0bb6023774..08f9ebd74d 100644 --- a/nouislider/v7/nouislider-tests.ts +++ b/nouislider/v7/nouislider-tests.ts @@ -1,6 +1,3 @@ - -/// - //basic var basicSlider = $("
    ").noUiSlider({ start: 80, diff --git a/npm/npm-tests.ts b/npm/npm-tests.ts index ccebbdb35a..8ca5f01887 100644 --- a/npm/npm-tests.ts +++ b/npm/npm-tests.ts @@ -4,9 +4,6 @@ * Created by using code samples from https://github.com/npm/npm#using-npm-programmatically. */ -/// - - import npm = require("npm"); npm.load({}, function (er) { diff --git a/on-finished/on-finished-tests.ts b/on-finished/on-finished-tests.ts index 57040531fc..081e2cd37b 100644 --- a/on-finished/on-finished-tests.ts +++ b/on-finished/on-finished-tests.ts @@ -1,5 +1,3 @@ -/// - import events = require('events'); import onFinished = require('on-finished'); diff --git a/onoff/onoff-tests.ts b/onoff/onoff-tests.ts index cd39dc4a8d..21b47e7f99 100644 --- a/onoff/onoff-tests.ts +++ b/onoff/onoff-tests.ts @@ -1,5 +1,3 @@ - -/// import * as onoff from 'onoff'; var led:onoff.Gpio = new onoff.Gpio(17, 'out'); diff --git a/openui5/openui5-tests.ts b/openui5/openui5-tests.ts index 8dc19922ee..bb411a9a1e 100644 --- a/openui5/openui5-tests.ts +++ b/openui5/openui5-tests.ts @@ -1,7 +1,3 @@ -/// -/// -/// - sap.ui.getCore().attachInit(function () { new sap.m.Text({ text: "Hello World" diff --git a/oracledb/oracledb-tests.ts b/oracledb/oracledb-tests.ts index 15446df243..b4d1cf5fe9 100644 --- a/oracledb/oracledb-tests.ts +++ b/oracledb/oracledb-tests.ts @@ -1,5 +1,3 @@ -/// - import * as OracleDB from 'oracledb'; OracleDB.getConnection( diff --git a/owlcarousel/owlcarousel-tests.ts b/owlcarousel/owlcarousel-tests.ts index 3d9ed9a69b..0d2e1b6118 100644 --- a/owlcarousel/owlcarousel-tests.ts +++ b/owlcarousel/owlcarousel-tests.ts @@ -1,6 +1,3 @@ -/// - - $(".className").owlCarousel(); $(".className").owlCarousel({ diff --git a/passport-beam/passport-beam-tests.ts b/passport-beam/passport-beam-tests.ts index edfa3f1396..4448dad045 100644 --- a/passport-beam/passport-beam-tests.ts +++ b/passport-beam/passport-beam-tests.ts @@ -1,5 +1,3 @@ -/// - /** * Created by AtlasDev on 4/10/2016. */ diff --git a/passport-http/passport-http-tests.ts b/passport-http/passport-http-tests.ts index 22a486e6ec..4a70d30b89 100644 --- a/passport-http/passport-http-tests.ts +++ b/passport-http/passport-http-tests.ts @@ -1,5 +1,3 @@ -/// - /** * Created by Christophe Vidal */ diff --git a/paymentrequest/paymentrequest-tests.ts b/paymentrequest/paymentrequest-tests.ts index 62c2721bfb..c8772b115c 100644 --- a/paymentrequest/paymentrequest-tests.ts +++ b/paymentrequest/paymentrequest-tests.ts @@ -1,5 +1,3 @@ -/// - /// Code examples derived from /// https://developers.google.com/web/fundamentals/discovery-and-monetization/payment-request/ diff --git a/peerjs/peerjs-tests.ts b/peerjs/peerjs-tests.ts index 373df3ba2f..2246e6a8fd 100644 --- a/peerjs/peerjs-tests.ts +++ b/peerjs/peerjs-tests.ts @@ -1,5 +1,3 @@ -/// - var peerByOption: PeerJs.Peer = new Peer({ key: 'peerKey', debug: 3, diff --git a/phantomcss/index.d.ts b/phantomcss/index.d.ts index 451c250372..688c706199 100644 --- a/phantomcss/index.d.ts +++ b/phantomcss/index.d.ts @@ -3,8 +3,8 @@ // Definitions by: Amaury Bauzac // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import { Casper } from 'casperjs'; /// +import { Casper } from 'casperjs'; declare global { namespace PhantomCSS { diff --git a/phantomcss/phantomcss-tests.ts b/phantomcss/phantomcss-tests.ts index 8478bbd323..ee16832fae 100644 --- a/phantomcss/phantomcss-tests.ts +++ b/phantomcss/phantomcss-tests.ts @@ -1,7 +1,3 @@ - -/// -/// - // phantomCSS 0.11.1 is based on resemblejs 1.2.1, phantomJS 1.9.2 , casperJS 1.1.0-DEV var options: PhantomCSS.PhantomCSSOptions = { @@ -39,8 +35,8 @@ var options: PhantomCSS.PhantomCSSOptions = { }); }, - fileNameGetter: function(root:string,filename:string){ - + fileNameGetter: function(root:string,filename:string){ + return root+filename; }, @@ -65,7 +61,7 @@ declare var phantomcss:PhantomCSS.PhantomCSS; phantomcss.turnOffAnimations(); phantomcss.init(options); -phantomcss.compareAll('exclude.test'); +phantomcss.compareAll('exclude.test'); phantomcss.compareMatched('include.test', 'exclude.test'); phantomcss.compareMatched( new RegExp('include.test'), new RegExp('exclude.test')); phantomcss.compareSession(); diff --git a/phonon/phonon-tests.ts b/phonon/phonon-tests.ts index b817fef45b..6b9851b642 100644 --- a/phonon/phonon-tests.ts +++ b/phonon/phonon-tests.ts @@ -1,5 +1,3 @@ -/// - // Code examples from http://phonon.quarkdev.com/docs/navigator phonon.options({ navigator: { diff --git a/piwik-tracker/piwik-tracker-tests.ts b/piwik-tracker/piwik-tracker-tests.ts index 3e7506d5fd..f1545a843a 100644 --- a/piwik-tracker/piwik-tracker-tests.ts +++ b/piwik-tracker/piwik-tracker-tests.ts @@ -1,22 +1,20 @@ -/// - // Example code taken from https://www.npmjs.com/package/piwik-tracker var PiwikTracker = require('piwik-tracker'); - -// Initialize with your site ID and Piwik URL + +// Initialize with your site ID and Piwik URL var piwik = new PiwikTracker(1, 'http://mywebsite.com/piwik.php'); - -// Optional: Respond to tracking errors + +// Optional: Respond to tracking errors piwik.on('error', function(err : Error) { console.log('error tracking request: ', err) }) - -// Track a request URL: -// Either as a simple string … + +// Track a request URL: +// Either as a simple string … piwik.track('http://example.com/track/this/url'); - -// … or provide further options: + +// … or provide further options: piwik.track({ url: 'http://example.com/track/this/url', action_name: 'This will be shown in your dashboard', diff --git a/pkcs11js/pkcs11js-tests.ts b/pkcs11js/pkcs11js-tests.ts index 52ffd4e8f8..30501be11f 100644 --- a/pkcs11js/pkcs11js-tests.ts +++ b/pkcs11js/pkcs11js-tests.ts @@ -1,5 +1,3 @@ -/// - import * as pkcs11js from "pkcs11js"; const libPath = "C:\\tmp\\rtpkcs11ecp.dll"; diff --git a/pouchdb-find/pouchdb-find-tests.ts b/pouchdb-find/pouchdb-find-tests.ts index 8d677276fc..bebdc58cc1 100644 --- a/pouchdb-find/pouchdb-find-tests.ts +++ b/pouchdb-find/pouchdb-find-tests.ts @@ -1,5 +1,3 @@ -/// - namespace PouchDBFindTests { function testFind() { diff --git a/pouchdb-replication/pouchdb-replication-tests.ts b/pouchdb-replication/pouchdb-replication-tests.ts index 6ff426bd0c..3cb6d6bc17 100644 --- a/pouchdb-replication/pouchdb-replication-tests.ts +++ b/pouchdb-replication/pouchdb-replication-tests.ts @@ -1,5 +1,3 @@ -/// - namespace PouchDBReplicationTests { /** @todo make some real tests */ diff --git a/project-oxford/project-oxford-tests.ts b/project-oxford/project-oxford-tests.ts index d04a77a762..ea2849d986 100644 --- a/project-oxford/project-oxford-tests.ts +++ b/project-oxford/project-oxford-tests.ts @@ -1,6 +1,3 @@ - -/// -/// /// import oxford = require("project-oxford"); diff --git a/promised-temp/promised-temp-tests.ts b/promised-temp/promised-temp-tests.ts index ebe0a51517..ec14855d8b 100644 --- a/promised-temp/promised-temp-tests.ts +++ b/promised-temp/promised-temp-tests.ts @@ -1,6 +1,3 @@ - -/// - import * as fs from "fs"; import temp from 'promised-temp'; import { AffixOptions, OpenFile, Stats } from "promised-temp"; diff --git a/promptly/promptly-tests.ts b/promptly/promptly-tests.ts index 05b8bf70ed..fbd1fd5bb7 100644 --- a/promptly/promptly-tests.ts +++ b/promptly/promptly-tests.ts @@ -1,5 +1,3 @@ -/// - import promptly = require('promptly'); process.stdin diff --git a/radius/radius-tests.ts b/radius/radius-tests.ts index c3b50db8ec..36e9ea618d 100644 --- a/radius/radius-tests.ts +++ b/radius/radius-tests.ts @@ -1,6 +1,3 @@ - -/// - import radius = require('radius'); var radius_secret: string = "shhhh" diff --git a/rangyinputs/rangyinputs-tests.ts b/rangyinputs/rangyinputs-tests.ts index cb627d85b1..14f769a9fe 100644 --- a/rangyinputs/rangyinputs-tests.ts +++ b/rangyinputs/rangyinputs-tests.ts @@ -1,5 +1,3 @@ -/// - let $obj: JQuery = $('meh'); let selection: RangyInputs.Selection = $obj.getSelection(); diff --git a/raty/raty-tests.ts b/raty/raty-tests.ts index bb2f731038..51b510b0a3 100644 --- a/raty/raty-tests.ts +++ b/raty/raty-tests.ts @@ -1,7 +1,3 @@ -/// - - - var $element: JQuery = $('
    '); $element.raty(); diff --git a/rc-select/rc-select-tests.ts b/rc-select/rc-select-tests.ts index f2ec85ae09..976d789c2c 100644 --- a/rc-select/rc-select-tests.ts +++ b/rc-select/rc-select-tests.ts @@ -1,10 +1,7 @@ - -/// - import React = require('react'); import RcSelect = require('rc-select'); -class Component extends React.Component { +class Component extends React.Component { private onChange(value: any) { console.log('selected', value); @@ -54,7 +51,7 @@ class Component extends React.Component { className: "option", disabled: true, key: "option-0", - value: "option-0" + value: "option-0" }; private createOptions(count: number) { @@ -75,7 +72,7 @@ class Component extends React.Component { let options = this.createOptions(10); - let optionGroup = React.createElement(RcSelect.OptGroup, this.defaultOptGroupProps, options); + let optionGroup = React.createElement(RcSelect.OptGroup, this.defaultOptGroupProps, options); let select = React.createElement(RcSelect.default, this.defaultSelectProps, optionGroup); diff --git a/react-bootstrap/react-bootstrap-tests.tsx b/react-bootstrap/react-bootstrap-tests.tsx index 987203fbf8..432636559b 100644 --- a/react-bootstrap/react-bootstrap-tests.tsx +++ b/react-bootstrap/react-bootstrap-tests.tsx @@ -1,9 +1,3 @@ -// React-Bootstrap Test -// ================================================================================ -/// - -// Imports -// -------------------------------------------------------------------------------- import * as React from 'react'; import { Component, CSSProperties } from 'react'; import { diff --git a/react-datagrid/react-datagrid-tests.tsx b/react-datagrid/react-datagrid-tests.tsx index 061be471f4..bdbca39f01 100644 --- a/react-datagrid/react-datagrid-tests.tsx +++ b/react-datagrid/react-datagrid-tests.tsx @@ -1,6 +1,3 @@ - -/// - import * as React from "react"; import ReactDataGrid = require("react-datagrid"); diff --git a/react-dnd-html5-backend/react-dnd-html5-backend-tests.ts b/react-dnd-html5-backend/react-dnd-html5-backend-tests.ts index 83ee1bc9ba..68703d062d 100644 --- a/react-dnd-html5-backend/react-dnd-html5-backend-tests.ts +++ b/react-dnd-html5-backend/react-dnd-html5-backend-tests.ts @@ -1,5 +1,3 @@ -"use strict"; - // Test adapted from the ReactDnD chess game tutorial: // http://gaearon.github.io/react-dnd/docs-tutorial.html diff --git a/react-dnd/UNUSED_FILES.txt b/react-dnd/UNUSED_FILES.txt deleted file mode 100644 index ff694923a2..0000000000 --- a/react-dnd/UNUSED_FILES.txt +++ /dev/null @@ -1 +0,0 @@ -react-dnd-test-backend.d.ts \ No newline at end of file diff --git a/react-dnd/react-dnd-test-backend.d.ts b/react-dnd/react-dnd-test-backend.d.ts deleted file mode 100644 index 095c890483..0000000000 --- a/react-dnd/react-dnd-test-backend.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Type definitions for React DnD HTML 5 Backend v2.0.0 -// Project: https://github.com/gaearon/react-dnd -// Definitions by: Asana -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare module "react-dnd-test-backend" { - class TestBackend { - setup(): void; - teardown(): void; - connectDragSource(): void; - connectDropTarget(): void; - simulateBeginDrag(sourceIds: __ReactDnd.Identifier[], options?: {}): void; - simulatePublishDragSource(): void; - simulateHover(targetIds: __ReactDnd.Identifier[], options?: {}): void; - simulateDrop(): void; - simulateEndDrag(): void; - } - - export { TestBackend as default }; -} diff --git a/react-dnd/react-dnd-tests.ts b/react-dnd/react-dnd-tests.ts index fdef2b727c..0aabefd26e 100644 --- a/react-dnd/react-dnd-tests.ts +++ b/react-dnd/react-dnd-tests.ts @@ -1,6 +1,3 @@ -/// -"use strict"; - // Test adapted from the ReactDnD chess game tutorial: // http://gaearon.github.io/react-dnd/docs-tutorial.html @@ -14,7 +11,17 @@ import DropTarget = ReactDnd.DropTarget; import DragLayer = ReactDnd.DragLayer; import DragDropContext = ReactDnd.DragDropContext; import HTML5Backend, { getEmptyImage, NativeTypes } from "react-dnd-html5-backend"; -import TestBackend from "react-dnd-test-backend"; +declare class TestBackend { + setup(): void; + teardown(): void; + connectDragSource(): void; + connectDropTarget(): void; + simulateBeginDrag(sourceIds: __ReactDnd.Identifier[], options?: {}): void; + simulatePublishDragSource(): void; + simulateHover(targetIds: __ReactDnd.Identifier[], options?: {}): void; + simulateDrop(): void; + simulateEndDrag(): void; +} // Game Component // ---------------------------------------------------------------------- diff --git a/react-dropzone/react-dropzone-tests.tsx b/react-dropzone/react-dropzone-tests.tsx index 322fd82e8c..ec6d5fa763 100644 --- a/react-dropzone/react-dropzone-tests.tsx +++ b/react-dropzone/react-dropzone-tests.tsx @@ -1,5 +1,3 @@ -/// -/// import * as React from 'react'; import * as Dropzone from 'react-dropzone'; diff --git a/react-helmet/react-helmet-tests.tsx b/react-helmet/react-helmet-tests.tsx index 3a4a3f09d7..e6b78955b3 100644 --- a/react-helmet/react-helmet-tests.tsx +++ b/react-helmet/react-helmet-tests.tsx @@ -1,6 +1,3 @@ - -/// - import * as React from 'react'; import * as Helmet from 'react-helmet'; diff --git a/react-infinite/react-infinite-tests.tsx b/react-infinite/react-infinite-tests.tsx index 807fc67498..ea68999afc 100644 --- a/react-infinite/react-infinite-tests.tsx +++ b/react-infinite/react-infinite-tests.tsx @@ -1,6 +1,3 @@ -/// -/// - import * as React from 'react'; import Infinite = require('react-infinite'); diff --git a/react-input-calendar/react-input-calendar-tests.tsx b/react-input-calendar/react-input-calendar-tests.tsx index aaab1dc398..4cd465d9c5 100644 --- a/react-input-calendar/react-input-calendar-tests.tsx +++ b/react-input-calendar/react-input-calendar-tests.tsx @@ -1,6 +1,3 @@ -/// -/// - import * as ReactInputCalendar from 'react-input-calendar'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; diff --git a/react-intl/react-intl-tests.tsx b/react-intl/react-intl-tests.tsx index 400879677f..d3477aaa11 100644 --- a/react-intl/react-intl-tests.tsx +++ b/react-intl/react-intl-tests.tsx @@ -3,8 +3,6 @@ * Updated by Fedor Nezhivoi */ -/// - import * as React from "react" import * as reactMixin from "react-mixin" diff --git a/react-intl/v1/react-intl-tests.tsx b/react-intl/v1/react-intl-tests.tsx index 6abebe36cd..c7834b6583 100644 --- a/react-intl/v1/react-intl-tests.tsx +++ b/react-intl/v1/react-intl-tests.tsx @@ -2,8 +2,6 @@ * Created by Bruno Grieder */ -/// - import * as React from 'react' import * as reactMixin from 'react-mixin' diff --git a/react-mixin/react-mixin-tests.tsx b/react-mixin/react-mixin-tests.tsx index 04f6f4b202..f275869a9e 100644 --- a/react-mixin/react-mixin-tests.tsx +++ b/react-mixin/react-mixin-tests.tsx @@ -1,6 +1,3 @@ - -/// - import reactMixin = require('react-mixin'); import * as React from 'react'; diff --git a/react-native/test/animated.tsx b/react-native/test/animated.tsx index 632f2c0151..3b3457384c 100644 --- a/react-native/test/animated.tsx +++ b/react-native/test/animated.tsx @@ -1,5 +1,3 @@ -/// - import * as React from 'react-native' import { diff --git a/react-native/test/index.tsx b/react-native/test/index.tsx index 6e05cdeabe..32bcbe931b 100644 --- a/react-native/test/index.tsx +++ b/react-native/test/index.tsx @@ -1,8 +1,4 @@ - /* - -Note: This must be compiled with the target set to ES6 - The content of index.io.js could be something like 'use strict'; @@ -12,13 +8,8 @@ The content of index.io.js could be something like AppRegistry.registerComponent('MopNative', () => Welcome); - For a list of complete Typescript examples: check https://github.com/bgrieder/RNTSExplorer - - */ - -/// - +*/ import * as React from 'react-native' import { diff --git a/react-onclickoutside/react-onclickoutside-tests.tsx b/react-onclickoutside/react-onclickoutside-tests.tsx index dabba332b1..fc782bb68c 100644 --- a/react-onclickoutside/react-onclickoutside-tests.tsx +++ b/react-onclickoutside/react-onclickoutside-tests.tsx @@ -1,8 +1,3 @@ -// React onClickOutside Test -// ================================================================================ - -// Imports -// -------------------------------------------------------------------------------- import * as React from "react" import { Component, StatelessComponent, MouseEvent } from "react" import { render } from "react-dom" diff --git a/react-props-decorators/react-props-decorators-tests.ts b/react-props-decorators/react-props-decorators-tests.ts index 562d4f3d12..654c2df98f 100644 --- a/react-props-decorators/react-props-decorators-tests.ts +++ b/react-props-decorators/react-props-decorators-tests.ts @@ -1,6 +1,3 @@ - -/// - import * as React from 'react'; import { propTypes, defaultProps } from 'react-props-decorators'; diff --git a/react-router-bootstrap/react-router-bootstrap-tests.tsx b/react-router-bootstrap/react-router-bootstrap-tests.tsx index d4f8733c03..7816933fe6 100644 --- a/react-router-bootstrap/react-router-bootstrap-tests.tsx +++ b/react-router-bootstrap/react-router-bootstrap-tests.tsx @@ -1,16 +1,8 @@ -// React-Router-Bootstrap Test -// ================================================================================ -/// -/// - -// Imports -// -------------------------------------------------------------------------------- import * as React from 'react'; import { Component, CSSProperties } from 'react'; import { Button } from 'react-bootstrap'; import { LinkContainer, IndexLinkContainer } from 'react-router-bootstrap' - export class ReactRouterBootstrapTest extends Component { callback() { alert('Callback: ' + JSON.stringify(arguments)); @@ -20,7 +12,7 @@ export class ReactRouterBootstrapTest extends Component { let style: CSSProperties = { padding: '50px' }; return (
    - +
    diff --git a/react-scroll/react-scroll-tests.tsx b/react-scroll/react-scroll-tests.tsx index b5d2fb2245..63db573722 100644 --- a/react-scroll/react-scroll-tests.tsx +++ b/react-scroll/react-scroll-tests.tsx @@ -1,5 +1,3 @@ -/// - import * as React from 'react'; import { Link, Element, scroller } from 'react-scroll'; diff --git a/react-spinkit/react-spinkit-tests.tsx b/react-spinkit/react-spinkit-tests.tsx index a163400601..8ceb7b0a89 100644 --- a/react-spinkit/react-spinkit-tests.tsx +++ b/react-spinkit/react-spinkit-tests.tsx @@ -1,6 +1,3 @@ - -/// - import * as Spinner from 'react-spinkit'; import * as React from 'react'; diff --git a/react-tabs/react-tabs-tests.ts b/react-tabs/react-tabs-tests.ts index b067987518..9998bcafbd 100644 --- a/react-tabs/react-tabs-tests.ts +++ b/react-tabs/react-tabs-tests.ts @@ -1,7 +1,3 @@ - -/// -/// - import React = require("react"); import ReactDOM = require("react-dom"); import { Tabs, TabList, Tab, TabPanel } from "react-tabs"; diff --git a/react-tagcloud/react-tagcloud-tests.tsx b/react-tagcloud/react-tagcloud-tests.tsx index d0594314bc..552cc20e2d 100644 --- a/react-tagcloud/react-tagcloud-tests.tsx +++ b/react-tagcloud/react-tagcloud-tests.tsx @@ -1,8 +1,3 @@ -/// -/// - - - // simple cloud import * as React from "react"; import * as ReactDOM from "react-dom"; diff --git a/react-widgets/react-widgets-tests.tsx b/react-widgets/react-widgets-tests.tsx index a108d8e513..0f66458c36 100644 --- a/react-widgets/react-widgets-tests.tsx +++ b/react-widgets/react-widgets-tests.tsx @@ -1,8 +1,3 @@ - -/// -/// - - import * as React from "react" import * as ReactDOM from "react-dom" @@ -45,10 +40,10 @@ class Test extends React.Component, {}> { itemComponent={itemComponent} />
    diff --git a/readdir-stream/readdir-stream-tests.ts b/readdir-stream/readdir-stream-tests.ts index f0a2dba78b..d808bc5b6d 100644 --- a/readdir-stream/readdir-stream-tests.ts +++ b/readdir-stream/readdir-stream-tests.ts @@ -1,6 +1,3 @@ - -/// - import readdir = require('readdir-stream'); var rs: NodeJS.ReadableStream; diff --git a/redux-debounced/redux-debounced-tests.ts b/redux-debounced/redux-debounced-tests.ts index f33050e394..ad83e40bc5 100644 --- a/redux-debounced/redux-debounced-tests.ts +++ b/redux-debounced/redux-debounced-tests.ts @@ -1,5 +1,3 @@ -/// - import { applyMiddleware } from 'redux'; import createDebounce from 'redux-debounced'; diff --git a/redux-devtools-dock-monitor/redux-devtools-dock-monitor-tests.tsx b/redux-devtools-dock-monitor/redux-devtools-dock-monitor-tests.tsx index 5a99ba665a..7e33588a41 100644 --- a/redux-devtools-dock-monitor/redux-devtools-dock-monitor-tests.tsx +++ b/redux-devtools-dock-monitor/redux-devtools-dock-monitor-tests.tsx @@ -1,5 +1,3 @@ -/// - import * as React from 'react' import DockMonitor from 'redux-devtools-dock-monitor' diff --git a/redux-devtools-log-monitor/redux-devtools-log-monitor-tests.tsx b/redux-devtools-log-monitor/redux-devtools-log-monitor-tests.tsx index 48a655bea2..477f4bbc55 100644 --- a/redux-devtools-log-monitor/redux-devtools-log-monitor-tests.tsx +++ b/redux-devtools-log-monitor/redux-devtools-log-monitor-tests.tsx @@ -1,5 +1,3 @@ -/// - import * as React from 'react' import LogMonitor from 'redux-devtools-log-monitor' diff --git a/redux-devtools/redux-devtools-tests.tsx b/redux-devtools/redux-devtools-tests.tsx index 10e20b7e87..695fbe60ff 100644 --- a/redux-devtools/redux-devtools-tests.tsx +++ b/redux-devtools/redux-devtools-tests.tsx @@ -1,6 +1,3 @@ -/// -/// - import * as React from 'react' import { compose, createStore, Reducer, Store, StoreEnhancerStoreCreator } from 'redux' import { Provider } from 'react-redux' diff --git a/resolve/resolve-tests.ts b/resolve/resolve-tests.ts index 3cac830c58..1f9f50b5ee 100644 --- a/resolve/resolve-tests.ts +++ b/resolve/resolve-tests.ts @@ -1,5 +1,3 @@ -/// - import * as fs from 'fs'; import * as resolve from 'resolve'; diff --git a/rx.wamp/rx.wamp-tests.ts b/rx.wamp/rx.wamp-tests.ts index 2b6d4c95bc..3bd6ddbffb 100644 --- a/rx.wamp/rx.wamp-tests.ts +++ b/rx.wamp/rx.wamp-tests.ts @@ -1,6 +1,3 @@ - -/// - import * as autobahn from "autobahn"; import {IWampEvent} from "rx.wamp"; diff --git a/s3-upload-stream/s3-upload-stream-tests.ts b/s3-upload-stream/s3-upload-stream-tests.ts index ef03000ad2..0f02beb63f 100644 --- a/s3-upload-stream/s3-upload-stream-tests.ts +++ b/s3-upload-stream/s3-upload-stream-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as fs from 'fs'; import * as S3Stream from 's3-upload-stream'; import * as AWS from 'aws-sdk'; diff --git a/sax/sax-tests.ts b/sax/sax-tests.ts index 4d9a90293d..5b11ab425e 100644 --- a/sax/sax-tests.ts +++ b/sax/sax-tests.ts @@ -1,5 +1,3 @@ -/// - import sax = require("sax"); import fs = require("fs"); diff --git a/seamless/seamless-tests.ts b/seamless/seamless-tests.ts index 4aa1ab3aba..40ba1868be 100644 --- a/seamless/seamless-tests.ts +++ b/seamless/seamless-tests.ts @@ -1,5 +1,3 @@ -/// - /* Create Parent Seamless IFrame */ $('#myiframe').seamless(); $('#myiframe').seamless({ diff --git a/select2/select2-tests.ts b/select2/select2-tests.ts index ade378ee71..c10b482cab 100644 --- a/select2/select2-tests.ts +++ b/select2/select2-tests.ts @@ -1,6 +1,3 @@ -/// - - $("#e9").select2(); $("#e2").select2({ placeholder: "Select a State", diff --git a/selectize/selectize-tests.ts b/selectize/selectize-tests.ts index b2ec9e0a29..10b12c91f2 100644 --- a/selectize/selectize-tests.ts +++ b/selectize/selectize-tests.ts @@ -1,6 +1,3 @@ -/// - - var $input = $(".test-input").selectize(); var testApi = $input[0].selectize; diff --git a/shelljs/shelljs-tests.ts b/shelljs/shelljs-tests.ts index 6c155e5aee..03f439af02 100644 --- a/shelljs/shelljs-tests.ts +++ b/shelljs/shelljs-tests.ts @@ -1,11 +1,5 @@ -// Tests for shelljs.d.ts -// Project: http://shelljs.org -// Definitions by: Niklas Mollenhauer -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Tests taken from documentation samples. -/// - import shell = require("shelljs"); if (!shell.which("git")) diff --git a/sinon-as-promised/sinon-as-promised-tests.ts b/sinon-as-promised/sinon-as-promised-tests.ts index 10602a3e8d..4663c1df12 100644 --- a/sinon-as-promised/sinon-as-promised-tests.ts +++ b/sinon-as-promised/sinon-as-promised-tests.ts @@ -1,5 +1,3 @@ -/// - function testResolve() { sinon.stub().resolves('test val'); } diff --git a/sinon-mongoose/sinon-mongoose-tests.ts b/sinon-mongoose/sinon-mongoose-tests.ts index b58a4e5e58..c64030240e 100644 --- a/sinon-mongoose/sinon-mongoose-tests.ts +++ b/sinon-mongoose/sinon-mongoose-tests.ts @@ -1,5 +1,3 @@ -/// - function testChain() { sinon.stub().chain('exec'); } diff --git a/slick-carousel/slick-carousel-tests.ts b/slick-carousel/slick-carousel-tests.ts index 5cb75a619d..3cf05a2e0c 100644 --- a/slick-carousel/slick-carousel-tests.ts +++ b/slick-carousel/slick-carousel-tests.ts @@ -1,7 +1,3 @@ -/// -/// - - // -------------------------------------------------------- // ------------------- WEBSITE EXAMPLE -------------------- // ---------- http://kenwheeler.github.io/slick/ ---------- diff --git a/slickgrid/test/index.ts b/slickgrid/test/index.ts index e6570c2985..d87bc2240c 100644 --- a/slickgrid/test/index.ts +++ b/slickgrid/test/index.ts @@ -1,6 +1,3 @@ -/// - - interface MyData extends Slick.SlickData { title: string; duration: string; diff --git a/socket.io-redis/socket.io-redis-tests.ts b/socket.io-redis/socket.io-redis-tests.ts index 28b0f9873f..6ced0b31de 100644 --- a/socket.io-redis/socket.io-redis-tests.ts +++ b/socket.io-redis/socket.io-redis-tests.ts @@ -1,5 +1,3 @@ -/// - import socketIO = require('socket.io'); import ioRedis = require('socket.io-redis'); import redis = require('redis'); diff --git a/socket.io.users/socket.io.users-tests.ts b/socket.io.users/socket.io.users-tests.ts index 565f6a7d7b..24557ef6c5 100644 --- a/socket.io.users/socket.io.users-tests.ts +++ b/socket.io.users/socket.io.users-tests.ts @@ -1,7 +1,3 @@ -/// - -/// - var express = require('express'); var app = express(); var httpServer = require('http').createServer(app); diff --git a/source-list-map/source-list-map-tests.ts b/source-list-map/source-list-map-tests.ts index 5fe932efc5..8c367d582c 100644 --- a/source-list-map/source-list-map-tests.ts +++ b/source-list-map/source-list-map-tests.ts @@ -1,4 +1,3 @@ -/// import * as slm from 'source-list-map'; const node = new slm.CodeNode('hello'); diff --git a/spectrum/spectrum-tests.ts b/spectrum/spectrum-tests.ts index e9bf388bbe..e52bd36ce9 100644 --- a/spectrum/spectrum-tests.ts +++ b/spectrum/spectrum-tests.ts @@ -1,6 +1,3 @@ -/// - - $("#picker").spectrum(); $("#picker").spectrum({ diff --git a/split/split-tests.ts b/split/split-tests.ts index 204a044b68..98308fbc10 100644 --- a/split/split-tests.ts +++ b/split/split-tests.ts @@ -1,6 +1,3 @@ - -/// - import stream = require("stream"); import split = require("split"); diff --git a/sql.js/sql.js-tests.ts b/sql.js/sql.js-tests.ts index 0829f7692a..52f44c7438 100644 --- a/sql.js/sql.js-tests.ts +++ b/sql.js/sql.js-tests.ts @@ -1,6 +1,3 @@ -/// - - import fs = require("fs"); import * as SQL from "sql.js"; diff --git a/ss-utils/ss-utils-tests.ts b/ss-utils/ss-utils-tests.ts index 71934fed54..9bbd30da9a 100644 --- a/ss-utils/ss-utils-tests.ts +++ b/ss-utils/ss-utils-tests.ts @@ -1,6 +1,3 @@ -/// - - declare var EventSource : ssutils.IEventSourceStatic; function test_ssutils() { @@ -13,7 +10,7 @@ function test_ssutils() { onHeartbeat: function(msg:ssutils.SSEHeartbeat, e:MessageEvent){}, onJoin: function(msg:ssutils.SSEJoin) {}, onLeave: function(msg:ssutils.SSELeave) {}, - onUpdate: function(msg:ssutils.SSEUpdate) {} + onUpdate: function(msg:ssutils.SSEUpdate) {} }, receivers: { tv: { @@ -26,7 +23,7 @@ function test_ssutils() { announce: function (msg:string) {} }) .on('customEvent', function (e, msg, msgEvent) { }); - + $.ss.handlers["changeChannel"]("home"); } @@ -39,7 +36,7 @@ function test_jQuery_functions(){ overrideMessages: true, messages: {"NotFound": "Not Found"}, errorFilter: function(errorMsg, errorCode, type){} - }); + }); $("form").applyValues({ "Key": "Value" }); @@ -58,8 +55,8 @@ function test_ssutils_Static(){ dateFmt = $.ss.dfmt(new Date(2001,1,1)); dateFmt = $.ss.dfmthm(new Date(2001,1,1)); dateFmt = $.ss.tfmt12(new Date(2001,1,1)); - var parts:string[] = $.ss.splitOnFirst("A;B;C",";"); - parts = $.ss.splitOnLast("A;B;C", ";"); + var parts:string[] = $.ss.splitOnFirst("A;B;C",";"); + parts = $.ss.splitOnLast("A;B;C", ";"); var selectedText = $.ss.getSelection(); var qs:{ [index: string]: string } = $.ss.queryString("http://google.com?a=b&c=d"); var relativePath = $.ss.createUrl("/path/to/{File}", {File:"file.js"}); @@ -69,7 +66,7 @@ function test_ssutils_Static(){ $.ss.normalize({"AA":1,"bB":2,"C":{"A":11,"B":22},"D":[1,2],"E":[{"A":111,"B":222}]}, true); $.ss.parseResponseStatus('{"message":"test"}'); $.ss.postJSON("/path/to/url", {json:"data"}, function(r:any) {}); - + $.ss.listenOn = "click onmousedown"; $.ss.eventReceivers = { "document": document }; $.ss.handlers["changeChannel"]("home"); diff --git a/static-eval/static-eval-tests.ts b/static-eval/static-eval-tests.ts index d4307c50f4..bfe30f723f 100644 --- a/static-eval/static-eval-tests.ts +++ b/static-eval/static-eval-tests.ts @@ -1,5 +1,3 @@ -/// - import evaluate = require('static-eval'); import esprima = require('esprima'); import * as ESTree from 'estree'; diff --git a/stream-to-array/stream-to-array-tests.ts b/stream-to-array/stream-to-array-tests.ts index c011f3e542..6b3ccc84fb 100644 --- a/stream-to-array/stream-to-array-tests.ts +++ b/stream-to-array/stream-to-array-tests.ts @@ -1,6 +1,3 @@ - -/// - import toArray = require('stream-to-array'); var rs: NodeJS.ReadableStream; diff --git a/stylus/stylus-tests.ts b/stylus/stylus-tests.ts index 7c5a8b1e45..248b6a9a04 100644 --- a/stylus/stylus-tests.ts +++ b/stylus/stylus-tests.ts @@ -1,13 +1,9 @@ -/** - * Test suite created by Maxime LUCE - * +/** + * Test suite created by Maxime LUCE + * * Created by using code samples from https://github.com/LearnBoost/stylus/blob/master/docs/js.md. */ -/// - - - import stylus = require("stylus"); var str = "This is a stylus test"; diff --git a/superagent/superagent-tests.ts b/superagent/superagent-tests.ts index 3252b01c96..3b8539ffe5 100644 --- a/superagent/superagent-tests.ts +++ b/superagent/superagent-tests.ts @@ -1,6 +1,3 @@ - -/// - // via: http://visionmedia.github.io/superagent/ import * as request from 'superagent'; diff --git a/supertest-as-promised/supertest-as-promised-tests.ts b/supertest-as-promised/supertest-as-promised-tests.ts index 35cbc68388..23e47ee319 100644 --- a/supertest-as-promised/supertest-as-promised-tests.ts +++ b/supertest-as-promised/supertest-as-promised-tests.ts @@ -29,12 +29,8 @@ request(app) // ... }); -describe("GET /kittens", () => { - it("should work", () => { - return request(app).get("/kittens").expect(200); - }); -}); +request(app).get("/kittens").expect(200); // Agents var agent = request.agent(app); diff --git a/tapable/tapable-tests.ts b/tapable/tapable-tests.ts index fce410defa..60e299b4a0 100644 --- a/tapable/tapable-tests.ts +++ b/tapable/tapable-tests.ts @@ -1,5 +1,3 @@ -/// - import Tapable = require('tapable'); class DllPlugin { diff --git a/tape/tape-tests.ts b/tape/tape-tests.ts index cc51d27ba1..9884ece458 100644 --- a/tape/tape-tests.ts +++ b/tape/tape-tests.ts @@ -1,6 +1,3 @@ - -/// - import tape = require("tape"); var name: string; diff --git a/tar/tar-tests.ts b/tar/tar-tests.ts index 08f304add9..d80e068ace 100644 --- a/tar/tar-tests.ts +++ b/tar/tar-tests.ts @@ -4,8 +4,6 @@ * Created by using code samples from https://github.com/npm/node-tar. */ -/// - import tar = require("tar"); import fs = require("fs"); diff --git a/tether-drop/tether-drop-tests.ts b/tether-drop/tether-drop-tests.ts index b6069bc76b..91df27a484 100644 --- a/tether-drop/tether-drop-tests.ts +++ b/tether-drop/tether-drop-tests.ts @@ -1,4 +1,3 @@ -/// import Drop = require("tether-drop"); var yellowBox = document.querySelector(".yellow"); diff --git a/three/test/canvas/canvas_camera_orthographic.ts b/three/test/canvas/canvas_camera_orthographic.ts index 78476a95b5..2beabf21f9 100644 --- a/three/test/canvas/canvas_camera_orthographic.ts +++ b/three/test/canvas/canvas_camera_orthographic.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/canvas_camera_orthographic.html () => { diff --git a/three/test/canvas/canvas_geometry_cube.ts b/three/test/canvas/canvas_geometry_cube.ts index 46f26b10c5..767ece34b0 100644 --- a/three/test/canvas/canvas_geometry_cube.ts +++ b/three/test/canvas/canvas_geometry_cube.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/canvas_geometry_cube.html () => { diff --git a/three/test/canvas/canvas_interactive_cubes_tween.ts b/three/test/canvas/canvas_interactive_cubes_tween.ts index 6d4cd3fce1..c7427cb07b 100644 --- a/three/test/canvas/canvas_interactive_cubes_tween.ts +++ b/three/test/canvas/canvas_interactive_cubes_tween.ts @@ -1,5 +1,3 @@ -/// -/// /// // https://github.com/mrdoob/three.js/blob/master/examples/canvas_interactive_cubes_tween.html diff --git a/three/test/canvas/canvas_lights_pointlights.ts b/three/test/canvas/canvas_lights_pointlights.ts index 6c028abcf8..55e91d27c8 100644 --- a/three/test/canvas/canvas_lights_pointlights.ts +++ b/three/test/canvas/canvas_lights_pointlights.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/canvas_lights_pointlights.html () => { diff --git a/three/test/canvas/canvas_materials.ts b/three/test/canvas/canvas_materials.ts index 21ca2b3ee1..9af83aff5d 100644 --- a/three/test/canvas/canvas_materials.ts +++ b/three/test/canvas/canvas_materials.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/canvas_materials.html () => { diff --git a/three/test/canvas/canvas_particles_floor.ts b/three/test/canvas/canvas_particles_floor.ts index 71e121e8d0..00d97b8e30 100644 --- a/three/test/canvas/canvas_particles_floor.ts +++ b/three/test/canvas/canvas_particles_floor.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/canvas_particles_floor.html () => { diff --git a/three/test/css3d/css3d_periodictable.ts b/three/test/css3d/css3d_periodictable.ts index 342455ff48..2d68cd2f53 100644 --- a/three/test/css3d/css3d_periodictable.ts +++ b/three/test/css3d/css3d_periodictable.ts @@ -1,6 +1,4 @@ -/// /// -/// // https://github.com/mrdoob/three.js/blob/master/examples/css3d_periodictable.html diff --git a/three/test/css3d/css3d_sprites.ts b/three/test/css3d/css3d_sprites.ts index 49177a9453..41cf22ad47 100644 --- a/three/test/css3d/css3d_sprites.ts +++ b/three/test/css3d/css3d_sprites.ts @@ -1,5 +1,3 @@ -/// -/// /// // https://github.com/mrdoob/three.js/blob/master/examples/css3d_sprites.html diff --git a/three/test/examples/controls/vrcontrols.ts b/three/test/examples/controls/vrcontrols.ts index 1d6e932a0e..2dbc5817da 100644 --- a/three/test/examples/controls/vrcontrols.ts +++ b/three/test/examples/controls/vrcontrols.ts @@ -1,5 +1,3 @@ -/// - var _vrControls = new THREE.VRControls(new THREE.Camera()); _vrControls.update(); diff --git a/three/test/examples/ctm/ctmloader.ts b/three/test/examples/ctm/ctmloader.ts index e35cffb6a4..68e4e28fc0 100644 --- a/three/test/examples/ctm/ctmloader.ts +++ b/three/test/examples/ctm/ctmloader.ts @@ -1,5 +1,3 @@ -/// - let _ctmloader = new THREE.CTMLoader(); _ctmloader.load('https://github.com/mrdoob/three.js/blob/master/examples/models/ctm/ben.ctm', (geo: any) => { console.log(geo.position); diff --git a/three/test/examples/detector.ts b/three/test/examples/detector.ts index b0960c723c..6260f34300 100644 --- a/three/test/examples/detector.ts +++ b/three/test/examples/detector.ts @@ -1,7 +1,3 @@ -/// -/// - - () => { if ( !Detector.canvas || !Detector.webgl || !Detector.workers || !Detector.fileapi ){ var errorElement = Detector.getWebGLErrorMessage(); diff --git a/three/test/examples/effects/vreffect.ts b/three/test/examples/effects/vreffect.ts index 67917a94ae..454d15fdf7 100644 --- a/three/test/examples/effects/vreffect.ts +++ b/three/test/examples/effects/vreffect.ts @@ -1,5 +1,3 @@ -/// - var _vrEffect: THREE.VREffect; _vrEffect = new THREE.VREffect(new THREE.WebGLRenderer({antialias: true}), (error) => { diff --git a/three/test/examples/octree.ts b/three/test/examples/octree.ts index de7de86ac7..d37ef7ba75 100644 --- a/three/test/examples/octree.ts +++ b/three/test/examples/octree.ts @@ -1,5 +1,3 @@ -/// - let _octree = new THREE.Octree({ underferred: false, depthMax: Infinity, diff --git a/three/test/math/test_unit_math.ts b/three/test/math/test_unit_math.ts index c70868b3d8..4a8e0a8c14 100644 --- a/three/test/math/test_unit_math.ts +++ b/three/test/math/test_unit_math.ts @@ -1,6 +1,3 @@ -/// -/// - declare function test(desc: string, body: () => void): void; declare function ok(cond: any, desc?: string): void; declare function deepEqual(a: T, b: T, desc?: string): void; diff --git a/three/test/webgl/webgl_animation_cloth.ts b/three/test/webgl/webgl_animation_cloth.ts index fff733c9c0..0c0ec76ace 100644 --- a/three/test/webgl/webgl_animation_cloth.ts +++ b/three/test/webgl/webgl_animation_cloth.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_animation_cloth.html () => { diff --git a/three/test/webgl/webgl_animation_skinning_morph.ts b/three/test/webgl/webgl_animation_skinning_morph.ts index df085e9ac4..fcea4bba08 100644 --- a/three/test/webgl/webgl_animation_skinning_morph.ts +++ b/three/test/webgl/webgl_animation_skinning_morph.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_sprites.html () => { diff --git a/three/test/webgl/webgl_buffergeometry.ts b/three/test/webgl/webgl_buffergeometry.ts index a747a17d50..0d4f1ee5dd 100644 --- a/three/test/webgl/webgl_buffergeometry.ts +++ b/three/test/webgl/webgl_buffergeometry.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_buffergeometry.html () => { diff --git a/three/test/webgl/webgl_camera.ts b/three/test/webgl/webgl_camera.ts index 66b60a7826..804aba771f 100644 --- a/three/test/webgl/webgl_camera.ts +++ b/three/test/webgl/webgl_camera.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_camera.html () => { diff --git a/three/test/webgl/webgl_custom_attributes.ts b/three/test/webgl/webgl_custom_attributes.ts index 89c25e62cf..c3a5bc6a36 100644 --- a/three/test/webgl/webgl_custom_attributes.ts +++ b/three/test/webgl/webgl_custom_attributes.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_custom_attributes.html () => { diff --git a/three/test/webgl/webgl_geometries.ts b/three/test/webgl/webgl_geometries.ts index 9b23dcfa1f..89e0af480c 100644 --- a/three/test/webgl/webgl_geometries.ts +++ b/three/test/webgl/webgl_geometries.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_geometries.html () => { diff --git a/three/test/webgl/webgl_helpers.ts b/three/test/webgl/webgl_helpers.ts index db8cba89a7..6b955968f4 100644 --- a/three/test/webgl/webgl_helpers.ts +++ b/three/test/webgl/webgl_helpers.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_helpers.html () => { diff --git a/three/test/webgl/webgl_interactive_cubes.ts b/three/test/webgl/webgl_interactive_cubes.ts index 74493a5285..87a9796813 100644 --- a/three/test/webgl/webgl_interactive_cubes.ts +++ b/three/test/webgl/webgl_interactive_cubes.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_interactive_cubes.html () => { diff --git a/three/test/webgl/webgl_interactive_raycasting_points.ts b/three/test/webgl/webgl_interactive_raycasting_points.ts index 6fdb24b6cc..ced8feb6c6 100644 --- a/three/test/webgl/webgl_interactive_raycasting_points.ts +++ b/three/test/webgl/webgl_interactive_raycasting_points.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_sprites.html () => { diff --git a/three/test/webgl/webgl_lensflares.ts b/three/test/webgl/webgl_lensflares.ts index 1d100507a0..1d42762571 100644 --- a/three/test/webgl/webgl_lensflares.ts +++ b/three/test/webgl/webgl_lensflares.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_lensflares.html () => { diff --git a/three/test/webgl/webgl_lights_hemisphere.ts b/three/test/webgl/webgl_lights_hemisphere.ts index 46dd9f7157..108419f4ad 100644 --- a/three/test/webgl/webgl_lights_hemisphere.ts +++ b/three/test/webgl/webgl_lights_hemisphere.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_lights_hemisphere.html () => { diff --git a/three/test/webgl/webgl_lines_colors.ts b/three/test/webgl/webgl_lines_colors.ts index 6b359b2d65..c7d68849f2 100644 --- a/three/test/webgl/webgl_lines_colors.ts +++ b/three/test/webgl/webgl_lines_colors.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_lines_colors.html () => { diff --git a/three/test/webgl/webgl_loader_awd.ts b/three/test/webgl/webgl_loader_awd.ts index 01f21a985e..d1752056fa 100644 --- a/three/test/webgl/webgl_loader_awd.ts +++ b/three/test/webgl/webgl_loader_awd.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_loader_awd.html () => { diff --git a/three/test/webgl/webgl_materials.ts b/three/test/webgl/webgl_materials.ts index f60da797ce..94f91b2fef 100644 --- a/three/test/webgl/webgl_materials.ts +++ b/three/test/webgl/webgl_materials.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_materials.html () => { diff --git a/three/test/webgl/webgl_morphtargets.ts b/three/test/webgl/webgl_morphtargets.ts index 5368dccb91..4dda732da7 100644 --- a/three/test/webgl/webgl_morphtargets.ts +++ b/three/test/webgl/webgl_morphtargets.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_morphtargets.html () => { diff --git a/three/test/webgl/webgl_points_billboards.ts b/three/test/webgl/webgl_points_billboards.ts index 11aa04270b..06fefa6744 100644 --- a/three/test/webgl/webgl_points_billboards.ts +++ b/three/test/webgl/webgl_points_billboards.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_particles_billboards.html () => { diff --git a/three/test/webgl/webgl_postprocessing.ts b/three/test/webgl/webgl_postprocessing.ts index 8c298d66a6..0c768eccea 100644 --- a/three/test/webgl/webgl_postprocessing.ts +++ b/three/test/webgl/webgl_postprocessing.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_postprocessing.html () => { diff --git a/three/test/webgl/webgl_shader.ts b/three/test/webgl/webgl_shader.ts index 249851d534..4a954d36ac 100644 --- a/three/test/webgl/webgl_shader.ts +++ b/three/test/webgl/webgl_shader.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_shader.html () => { diff --git a/three/test/webgl/webgl_sprites.ts b/three/test/webgl/webgl_sprites.ts index 8e71285fac..103d3065c3 100644 --- a/three/test/webgl/webgl_sprites.ts +++ b/three/test/webgl/webgl_sprites.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_sprites.html () => { diff --git a/through2/through2-tests.ts b/through2/through2-tests.ts index 0cc698d1d3..70a66e4b0e 100644 --- a/through2/through2-tests.ts +++ b/through2/through2-tests.ts @@ -1,6 +1,3 @@ - -/// - import stream = require('stream'); import through2 = require('through2'); diff --git a/through2/v0/through2-tests.ts b/through2/v0/through2-tests.ts index 9308908648..ae1c43a135 100644 --- a/through2/v0/through2-tests.ts +++ b/through2/v0/through2-tests.ts @@ -1,6 +1,3 @@ - -/// - import through2 = require('through2'); var rws: NodeJS.ReadWriteStream; diff --git a/typeahead/typeahead-tests.ts b/typeahead/typeahead-tests.ts index 4f50cb57e2..61d48b6aa9 100644 --- a/typeahead/typeahead-tests.ts +++ b/typeahead/typeahead-tests.ts @@ -1,5 +1,3 @@ -/// - function test_typeahead() { var options: Twitter.Typeahead.Options = {}; var dataset: Twitter.Typeahead.Dataset = { source: null }; diff --git a/uuid-1345/uuid-1345-tests.ts b/uuid-1345/uuid-1345-tests.ts index e3eef2c939..da0876de89 100644 --- a/uuid-1345/uuid-1345-tests.ts +++ b/uuid-1345/uuid-1345-tests.ts @@ -1,6 +1,3 @@ -/// - -'use strict'; import * as UUID from 'uuid-1345'; var uuid:string; diff --git a/valerie/valerie-tests.ts b/valerie/valerie-tests.ts index 227afc246b..b4f6efcdc9 100644 --- a/valerie/valerie-tests.ts +++ b/valerie/valerie-tests.ts @@ -1,15 +1,3 @@ - -/// - -// Tests for valerie.d.ts -// Project: https://github.com/davewatts/valerie -// Definitions by: Howard Richards -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/* - Checks the .d.ts definition work. Not a fully comprehensive set of tests yet. -*/ - /** * Simple enum for enum test */ diff --git a/validator/validator-tests.ts b/validator/validator-tests.ts index c4cee64661..48621f1acd 100644 --- a/validator/validator-tests.ts +++ b/validator/validator-tests.ts @@ -1,8 +1,5 @@ -/// - import * as validator from 'validator'; - /************************************************ * * * IMPORT TESTS * diff --git a/vex-js/vex-js-tests.ts b/vex-js/vex-js-tests.ts index d4af6e9e6a..2f89745157 100644 --- a/vex-js/vex-js-tests.ts +++ b/vex-js/vex-js-tests.ts @@ -1,4 +1,3 @@ -/// import vex = require("vex-js"); var vexContent = vex.open({ diff --git a/vinyl/vinyl-tests.ts b/vinyl/vinyl-tests.ts index bb705b7b2b..f9e71dd532 100644 --- a/vinyl/vinyl-tests.ts +++ b/vinyl/vinyl-tests.ts @@ -1,8 +1,4 @@ /// -/// -/// - -'use strict'; import * as fs from 'fs'; import * as path from 'path'; diff --git a/voronoi-diagram/voronoi-diagram-tests.ts b/voronoi-diagram/voronoi-diagram-tests.ts index 31b261e1ce..97f04a37de 100644 --- a/voronoi-diagram/voronoi-diagram-tests.ts +++ b/voronoi-diagram/voronoi-diagram-tests.ts @@ -1,5 +1,3 @@ -/// - import voronoi = require("voronoi-diagram"); const x: voronoi.Point = [1, 2]; diff --git a/wake_on_lan/wake_on_lan-tests.ts b/wake_on_lan/wake_on_lan-tests.ts index 3403d5c9fe..e8391a5765 100644 --- a/wake_on_lan/wake_on_lan-tests.ts +++ b/wake_on_lan/wake_on_lan-tests.ts @@ -1,6 +1,3 @@ - -/// - import wol = require('wake_on_lan'); wol.wake("20:DE:20:DE:20:DE"); diff --git a/webgme/webgme-tests.ts b/webgme/webgme-tests.ts index d009e936e4..e6f315a3ef 100644 --- a/webgme/webgme-tests.ts +++ b/webgme/webgme-tests.ts @@ -1,13 +1,9 @@ - -/// -/// - /** * In actual usage the MetaDataStr would most likely * be initialized with an import... - * + * import MetaDataStr = require("text!metadata.json"); - * + * * Which would require a declaration, like... * `text.d.ts` * @@ -26,7 +22,7 @@ import * as fs from "fs"; import * as stream from "stream"; import * as Common from "webgme/common"; -/** +/** * The following items are not created directly by the * plugin driver. * @@ -41,14 +37,14 @@ let destinationNode = new Common.Node(); /** * These tests are derived from... * https://github.com/webgme/webgme/wiki/GME-Core-API - * - * Nearly all core functions takes a CoreNode as its first argument. - * When using the Core API externally each CoreNode corresponds - * to one node/model in the project tree. - * To access data from the node the Core API should be used - * and the properties on the CoreNode itself should + * + * Nearly all core functions takes a CoreNode as its first argument. + * When using the Core API externally each CoreNode corresponds + * to one node/model in the project tree. + * To access data from the node the Core API should be used + * and the properties on the CoreNode itself should * not be accessed or modified directly. - * + * * Below follows a handpicked selection of basic core functions. */ @@ -111,7 +107,7 @@ function test_core_containment_traversal() { }); } -/** +/** * https://github.com/webgme/webgme/wiki/GME-Core-API#containment-methods */ function test_core_containment_methods() { @@ -158,7 +154,7 @@ function test_core_containment_methods() { // Here we have access to the node. }); - // Loading an entire sub-tree of nodes + // Loading an entire sub-tree of nodes // N.B. this requires all nodes to be loaded at the same time. // For larger models core.traverse is preferred. self.core.loadSubTree(node, (err, nodes) => { @@ -176,7 +172,7 @@ function test_core_containment_methods() { function test_core_pointers_connections() { - // + // let isConn = self.core.isConnection(connNode); // Get the path of the node that is pointed to, via 'src', from connNode. @@ -215,16 +211,16 @@ function test_core_pointers_connections() { /** * https://github.com/webgme/webgme/wiki/GME-Blob-Storage-API - * - * File-like objects/artifacts - * (which are neither a meta archetype model, nor an instance model) - * are stored separately from the WebGME meta-models and models. - * An example of such an artifact would be a resource - * file that is associated with a model + * + * File-like objects/artifacts + * (which are neither a meta archetype model, nor an instance model) + * are stored separately from the WebGME meta-models and models. + * An example of such an artifact would be a resource + * file that is associated with a model * (e.g., data for an instance model, or a generated artifact from analyzing a model). - * - * One reason for treating these objects differently is that they do not conform to the data model, - * and they might not be well-suited for storage in a database + * + * One reason for treating these objects differently is that they do not conform to the data model, + * and they might not be well-suited for storage in a database * (the Blob is suited to handle binary objects of any size and structure). */ @@ -242,22 +238,22 @@ function test_client_creating_an_instance() { /** * https://github.com/webgme/webgme/wiki/GME-Blob-Storage-API - * - * File-like objects/artifacts - * (which are neither a meta archetype model, nor an instance model) - * are stored separately from the WebGME meta-models and models. - * An example of such an artifact would be a resource - * file that is associated with a model + * + * File-like objects/artifacts + * (which are neither a meta archetype model, nor an instance model) + * are stored separately from the WebGME meta-models and models. + * An example of such an artifact would be a resource + * file that is associated with a model * (e.g., data for an instance model, or a generated artifact from analyzing a model). - * - * One reason for treating these objects differently is that they do not conform to the data model, - * and they might not be well-suited for storage in a database + * + * One reason for treating these objects differently is that they do not conform to the data model, + * and they might not be well-suited for storage in a database * (the Blob is suited to handle binary objects of any size and structure). */ -/** +/** * The following items are not created directly by the * plugin driver. * @@ -338,7 +334,7 @@ type DictionaryAny = { [key: string]: any }; /** * Visit the node and perform the function. * Related example using traverse. -* https://github.com/webgme/xmi-tools/blob/master/src/plugins/XMIExporter/XMIExporter.js#L430 +* https://github.com/webgme/xmi-tools/blob/master/src/plugins/XMIExporter/XMIExporter.js#L430 */ function test_core_containment_traversal_complete() { const BLANK = ""; @@ -382,7 +378,7 @@ function test_core_containment_traversal_complete() { /** * A filter mechanism to effectively eliminate containment branches. - * Any path included in the prune-list will be the root of a + * Any path included in the prune-list will be the root of a * pruned subtree. */ let pruneList: string[] = []; diff --git a/webpack-sources/webpack-sources-tests.ts b/webpack-sources/webpack-sources-tests.ts index 622f12cb8e..16c915516b 100644 --- a/webpack-sources/webpack-sources-tests.ts +++ b/webpack-sources/webpack-sources-tests.ts @@ -1,5 +1,3 @@ -/// - import { CachedSource, ConcatSource, diff --git a/x-editable/x-editable-tests.ts b/x-editable/x-editable-tests.ts index c4c03a46be..3c121b8528 100644 --- a/x-editable/x-editable-tests.ts +++ b/x-editable/x-editable-tests.ts @@ -1,10 +1,3 @@ -// Type definitions for X-Editable v1.5.1 -// Project: http://vitalets.github.io/x-editable/index.html -// Definitions by: Chris Kirby -// Definitions: https://github.com/sirkirby/DefinitelyTyped - -/// - // server post and response $('#username').editable({ success: function(response : any, newValue : any) { diff --git a/xmlpoke/xmlpoke-tests.ts b/xmlpoke/xmlpoke-tests.ts index 3c82b846a6..aba04c0962 100644 --- a/xmlpoke/xmlpoke-tests.ts +++ b/xmlpoke/xmlpoke-tests.ts @@ -1,7 +1,3 @@ -/// - -// tsc xmlpoke-tests.ts && node xmlpoke-tests.js - import * as xmlpoke from 'xmlpoke'; import * as assert from 'assert'; diff --git a/xrm/v7/xrm-tests.ts b/xrm/v7/xrm-tests.ts index 1b82805648..1c8288fae4 100644 --- a/xrm/v7/xrm-tests.ts +++ b/xrm/v7/xrm-tests.ts @@ -1,5 +1,3 @@ -/// - /// Demonstrate usage in the browser's window object window.Xrm.Utility.alertDialog( "message", () => {} ); From f0b18c41f7d00a0c7cc09541e7337c40f1381478 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 10 Mar 2017 07:56:11 -0800 Subject: [PATCH 079/276] mobservable provides its own types (#14776) --- mendixmodelsdk/index.d.ts | 182 ++++++++++++++++++++++++++++++- mobservable/index.d.ts | 178 ------------------------------ mobservable/mobservable-tests.ts | 56 ---------- mobservable/tsconfig.json | 25 ----- mobservable/tslint.json | 6 - notNeededPackages.json | 6 + 6 files changed, 187 insertions(+), 266 deletions(-) delete mode 100644 mobservable/index.d.ts delete mode 100644 mobservable/mobservable-tests.ts delete mode 100644 mobservable/tsconfig.json delete mode 100644 mobservable/tslint.json diff --git a/mendixmodelsdk/index.d.ts b/mendixmodelsdk/index.d.ts index 29192f4bc4..d75cdb97aa 100644 --- a/mendixmodelsdk/index.d.ts +++ b/mendixmodelsdk/index.d.ts @@ -207,8 +207,188 @@ limitations under the License. */ +// Outdated mobservable typings. +// TODO: Use the types bundled with mobservable. Or use mobx. + +interface _IMobservableStatic { + /** + * Turns an object, array or function into a reactive structure. + * @param value the value which should become observable. + */ + makeReactive: IMakeReactive; + + /** + * Extends an object with reactive capabilities. + * @param target the object to which reactive properties should be added + * @param properties the properties that should be added and made reactive + * @returns targer + */ + extendReactive(target: Object, properties: Object):Object; + + /** + * Returns true if the provided value is reactive. + * @param value object, function or array + * @param propertyName if propertyName is specified, checkes whether value.propertyName is reactive. + */ + isReactive(value: any, propertyName?:string): boolean; + + /** + * Can be used in combination with makeReactive / extendReactive. + * Enforces that a reference to 'value' is stored as property, + * but that 'value' itself is not turned into something reactive. + * Future assignments to the same property will inherit this behavior. + * @param value initial value of the reactive property that is being defined. + */ + asReference(value: any):{value:T}; + + /** + * ES6 / Typescript decorator which can to make class properties and getter functions reactive. + */ + observable(target: Object, key: string):any; // decorator / annotation + + /** + * Creates a reactive view and keeps it alive, so that the view is always + * updated if one of the dependencies changes, even when the view is not further used by something else. + * @param func The reactive view + * @param scope (optional) + * @returns disposer function, which can be used to stop the view from being updated in the future. + */ + observe(func: Mobservable.Lambda, scope?: any): Mobservable.Lambda; + + /** + * Deprecated, use mobservable.observe instead. + */ + sideEffect(func: Mobservable.Lambda, scope?: any): Mobservable.Lambda; + + /** + * Similar to 'observer', observes the given predicate until it returns true. + * Once it returns true, the 'effect' function is invoked an the observation is cancelled. + * @param predicate + * @param effect + * @param scope (optional) + * @returns disposer function to prematurely end the observer. + */ + observeUntil(predicate: ()=>boolean, effect: Mobservable.Lambda, scope?: any): Mobservable.Lambda; + + /** + * During a transaction no views are updated until the end of the transaction. + * The transaction will be run synchronously nonetheless. + * @param action a function that updates some reactive state + * @returns any value that was returned by the 'action' parameter. + */ + transaction(action: ()=>T): T; + + /** + * Converts a reactive structure into a non-reactive structure. + * Basically a deep-clone. + */ + toJSON(value: T): T; + + /** + * Sets the reporting level Defaults to 1. Use 0 for production or 2 for increased verbosity. + */ + logLevel: number; // 0 = production, 1 = development, 2 = debugging + + extras: { + getDependencyTree(thing:any, property?:string): Mobservable.IDependencyTree; + + getObserverTree(thing:any, property?:string): Mobservable.IObserverTree; + + trackTransitions(extensive?:boolean, onReport?:(lines:Mobservable.ITransitionEvent) => void) : Mobservable.Lambda; + } +} + +interface IMakeReactive { + (value: T[], opts?: Mobservable.IMakeReactiveOptions): Mobservable.IObservableArray; + (value: ()=>T, opts?: Mobservable.IMakeReactiveOptions): Mobservable.IObservableValue; + (value: T, opts?: Mobservable.IMakeReactiveOptions): Mobservable.IObservableValue; + (value: Object, opts?: Mobservable.IMakeReactiveOptions): T; +} + +interface IMobservableStatic extends _IMobservableStatic, IMakeReactive { +} + +declare namespace Mobservable { + interface IMakeReactiveOptions { + as?: string /* "auto" | "reference" | TODO: see #8 "structure" */ + scope?: Object, + context?: Object, + recurse?: boolean; + name?: string; + // protected: boolean TODO: see #9 + } + + export interface IContextInfoStruct { + object: Object; + name: string; + } + + export type IContextInfo = IContextInfoStruct | string; + + interface Lambda { + (): void; + name?: string; + } + + interface IObservable { + observe(callback: (...args: any[])=>void, fireImmediately?: boolean): Lambda; + } + + interface IObservableValue extends IObservable { + (): T; + (value: T):void; + observe(callback: (newValue: T, oldValue: T)=>void, fireImmediately?: boolean): Lambda; + } + + interface IObservableArray extends IObservable, Array { + spliceWithArray(index: number, deleteCount?: number, newItems?: T[]): T[]; + observe(listener: (changeData: IArrayChange|IArraySplice)=>void, fireImmediately?: boolean): Lambda; + clear(): T[]; + replace(newItems: T[]): T[]; + find(predicate: (item: T,index: number,array: IObservableArray)=>boolean,thisArg?: any,fromIndex?: number): T; + remove(value: T): boolean; + } + + interface IArrayChange { + type: string; // Always: 'update' + object: IObservableArray; + index: number; + oldValue: T; + } + + interface IArraySplice { + type: string; // Always: 'splice' + object: IObservableArray; + index: number; + removed: T[]; + addedCount: number; + } + + interface IDependencyTree { + id: number; + name: string; + context: any; + dependencies?: IDependencyTree[]; + } + + interface IObserverTree { + id: number; + name: string; + context: any; + observers?: IObserverTree[]; + listeners?: number; // amount of functions manually attached using an .observe method + } + + interface ITransitionEvent { + id: number; + name: string; + context: Object; + state: string; + changed: boolean; + newValue: string; + } +} -/// declare module "mendixmodelsdk" { namespace sdk { namespace internal { diff --git a/mobservable/index.d.ts b/mobservable/index.d.ts deleted file mode 100644 index 719eddaf31..0000000000 --- a/mobservable/index.d.ts +++ /dev/null @@ -1,178 +0,0 @@ -// Type definitions for mobservable 0.6 -// Project: https://mweststrate.github.io/mobservable -// Definitions by: Michel Weststrate -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace Mobservable { - interface Static extends MakeReactive { - /** - * Turns an object, array or function into a reactive structure. - * @param value the value which should become observable. - */ - makeReactive: MakeReactive; - - /** - * Extends an object with reactive capabilities. - * @param target the object to which reactive properties should be added - * @param properties the properties that should be added and made reactive - * @returns targer - */ - extendReactive(target: Object, properties: Object): Object; - - /** - * Returns true if the provided value is reactive. - * @param value object, function or array - * @param propertyName if propertyName is specified, checkes whether value.propertyName is reactive. - */ - isReactive(value: any, propertyName?: string): boolean; - - /** - * Can be used in combination with makeReactive / extendReactive. - * Enforces that a reference to 'value' is stored as property, - * but that 'value' itself is not turned into something reactive. - * Future assignments to the same property will inherit this behavior. - * @param value initial value of the reactive property that is being defined. - */ - asReference(value: any): {value: T}; - - /** - * ES6 / Typescript decorator which can to make class properties and getter functions reactive. - */ - observable(target: Object, key: string): any; // decorator / annotation - - /** - * Creates a reactive view and keeps it alive, so that the view is always - * updated if one of the dependencies changes, even when the view is not further used by something else. - * @param func The reactive view - * @param scope (optional) - * @returns disposer function, which can be used to stop the view from being updated in the future. - */ - observe(func: Mobservable.Lambda, scope?: any): Mobservable.Lambda; - - /** - * Deprecated, use mobservable.observe instead. - */ - sideEffect(func: Mobservable.Lambda, scope?: any): Mobservable.Lambda; - - /** - * Similar to 'observer', observes the given predicate until it returns true. - * Once it returns true, the 'effect' function is invoked an the observation is cancelled. - * @param predicate - * @param effect - * @param scope (optional) - * @returns disposer function to prematurely end the observer. - */ - observeUntil(predicate: () => boolean, effect: Mobservable.Lambda, scope?: any): Mobservable.Lambda; - - /** - * During a transaction no views are updated until the end of the transaction. - * The transaction will be run synchronously nonetheless. - * @param action a function that updates some reactive state - * @returns any value that was returned by the 'action' parameter. - */ - transaction(action: () => T): T; - - /** - * Converts a reactive structure into a non-reactive structure. - * Basically a deep-clone. - */ - toJSON(value: T): T; - - /** - * Sets the reporting level Defaults to 1. Use 0 for production or 2 for increased verbosity. - */ - logLevel: number; // 0 = production, 1 = development, 2 = debugging - - extras: { - getDependencyTree(thing: any, property?: string): Mobservable.DependencyTree; - - getObserverTree(thing: any, property?: string): Mobservable.ObserverTree; - - trackTransitions(extensive?: boolean, onReport?: (lines: Mobservable.TransitionEvent) => void): Mobservable.Lambda; - }; - } - - interface MakeReactive { - (value: T[], opts?: Mobservable.MakeReactiveOptions): Mobservable.ObservableArray; - (value: () => T, opts?: Mobservable.MakeReactiveOptions): Mobservable.ObservableValue; - (value: T, opts?: Mobservable.MakeReactiveOptions): Mobservable.ObservableValue; - (value: Object, opts?: Mobservable.MakeReactiveOptions): T; - } - - interface MakeReactiveOptions { - as?: string; /* "auto" | "reference" | TODO: see #8 "structure" */ - scope?: Object; - context?: Object; - recurse?: boolean; - name?: string; - // protected: boolean TODO: see #9 - } - - type ContextInfo = { object: Object; name: string } | string; - - interface Lambda { - (): void; - name?: string; - } - - interface Observable { - observe(callback: (...args: any[]) => void, fireImmediately?: boolean): Lambda; - } - - interface ObservableValue extends Observable { - (): T; - (value: T): void; - observe(callback: (newValue: T, oldValue: T) => void, fireImmediately?: boolean): Lambda; - } - - interface ObservableArray extends Observable, Array { - spliceWithArray(index: number, deleteCount?: number, newItems?: T[]): T[]; - observe(listener: (changeData: ArrayChange|ArraySplice) => void, fireImmediately?: boolean): Lambda; - clear(): T[]; - replace(newItems: T[]): T[]; - find(predicate: (item: T, index: number, array: ObservableArray) => boolean, thisArg?: any, fromIndex?: number): T; - remove(value: T): boolean; - } - - interface ArrayChange { - type: string; // Always: 'update' - object: ObservableArray; - index: number; - oldValue: T; - } - - interface ArraySplice { - type: string; // Always: 'splice' - object: ObservableArray; - index: number; - removed: T[]; - addedCount: number; - } - - interface DependencyTree { - id: number; - name: string; - context: any; - dependencies?: DependencyTree[]; - } - - interface ObserverTree { - id: number; - name: string; - context: any; - observers?: ObserverTree[]; - listeners?: number; // amount of functions manually attached using an .observe method - } - - interface TransitionEvent { - id: number; - name: string; - context: Object; - state: string; - changed: boolean; - newValue: string; - } -} - -declare const Mobservable: Mobservable.Static; -export = Mobservable; diff --git a/mobservable/mobservable-tests.ts b/mobservable/mobservable-tests.ts deleted file mode 100644 index 060f0d14b3..0000000000 --- a/mobservable/mobservable-tests.ts +++ /dev/null @@ -1,56 +0,0 @@ -import mobservable = require('mobservable'); -import {observable} from "mobservable"; - -var v = mobservable(3); -v.observe(() => {}); - -var a = mobservable([1, 2, 3]); - -class Order { - @observable price: number = 3; - @observable amount: number = 2; - @observable orders: string[] = []; - - @observable get total() { - return this.amount * this.price * (1 + this.orders.length); - } -} - -export function testObservable() { - var a = mobservable(3); - var b = mobservable(() => a() * 2); -} - -export function testAnnotations() { - var order1totals: number[] = []; - var order1 = new Order(); - var order2 = new Order(); - - var disposer = mobservable.observe(() => { - order1totals.push(order1.total); - }); - - order2.price = 4; - order1.amount = 1; - - order2.orders.push('bla'); - - order1.orders.splice(0, 0, 'boe', 'hoi'); - - disposer(); - order1.orders.pop(); -}; - -export function testTyping() { - var ar: mobservable.ObservableArray = mobservable.makeReactive([1, 2]); - ar.observe((d: mobservable.ArrayChange | mobservable.ArraySplice) => { - console.log(d.type); - }); - - var ar2: mobservable.ObservableArray = mobservable([1, 2]); - ar2.observe((d: mobservable.ArrayChange | mobservable.ArraySplice) => { - console.log(d.type); - }); - - var x: mobservable.ObservableValue = mobservable(3); -} \ No newline at end of file diff --git a/mobservable/tsconfig.json b/mobservable/tsconfig.json deleted file mode 100644 index cee6db4b01..0000000000 --- a/mobservable/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "experimentalDecorators": true, - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "mobservable-tests.ts" - ] -} \ No newline at end of file diff --git a/mobservable/tslint.json b/mobservable/tslint.json deleted file mode 100644 index f05741c59b..0000000000 --- a/mobservable/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "forbidden-types": false - } -} diff --git a/notNeededPackages.json b/notNeededPackages.json index fce0ef50f0..f0619f8e79 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -329,6 +329,12 @@ "typingsPackageName": "fine-uploader", "sourceRepoURL": "http://fineuploader.com/", "asOfVersion": "5.14.0" + }, + { + "libraryName": "mobservable", + "typingsPackageName": "mobservable", + "sourceRepoURL": "github.com/mweststrate/mobservable", + "asOfVersion": "1.2.5" } ] } \ No newline at end of file From e466571159287b9cbab031fc0b4f919a95694c12 Mon Sep 17 00:00:00 2001 From: voxmatt Date: Fri, 10 Mar 2017 10:29:12 -0800 Subject: [PATCH 080/276] a bunch of updates in response to code review --- react-relay/index.d.ts | 16 +++++++++------- react-relay/react-relay-tests.tsx | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/react-relay/index.d.ts b/react-relay/index.d.ts index 0f6dbba024..961acbccc2 100644 --- a/react-relay/index.d.ts +++ b/react-relay/index.d.ts @@ -7,6 +7,8 @@ declare module "react-relay" { import * as React from "react"; + type ClientMutationID = string; + /** Fragments are a hash of functions */ interface Fragments { [query: string]: ((variables?: RelayVariables) => string) @@ -40,13 +42,13 @@ declare module "react-relay" { class RelayMutationTransaction { applyOptimistic(): RelayMutationTransaction; - commit(): RelayMutationTransaction; + commit(): RelayMutationTransaction | null; recommit(): void; rollback(): void; getError(): Error; getStatus(): RelayMutationStatus; getHash(): string; - getID(): string; + getID(): ClientMutationID; } interface RelayMutationRequest { @@ -147,12 +149,12 @@ declare module "react-relay" { interface RelayProp { route: { name: string; }; // incomplete, also has params and queries - variables: any; - pendingVariables?: any; + variables: Object; + pendingVariables?: Object | null; setVariables(variables: Object, onReadyStateChange?: OnReadyStateChange): void; forceFetch(variables: Object, onReadyStateChange?: OnReadyStateChange): void; - hasOptimisticUpdate(record?: any): boolean; - getPendingTransactions(record?: any): RelayMutationTransaction[]; - commitUpdate?: (mutation: Mutation, callbacks?: StoreUpdateCallbacks) => any; + hasOptimisticUpdate(record: Object): boolean; + getPendingTransactions(record: Object): RelayMutationTransaction[]; + commitUpdate: (mutation: Mutation, callbacks?: StoreUpdateCallbacks) => any; } } diff --git a/react-relay/react-relay-tests.tsx b/react-relay/react-relay-tests.tsx index fa27f10c01..091909cabd 100644 --- a/react-relay/react-relay-tests.tsx +++ b/react-relay/react-relay-tests.tsx @@ -84,6 +84,7 @@ class StubbedArtwork extends React.Component { forceFetch: () => {}, hasOptimisticUpdate: () => false, getPendingTransactions: (): Relay.RelayMutationTransaction[] => undefined, + commitUpdate: () => {}, } } return From e31e8a857b42de4d54fd27780b12431cc1e7c92c Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Fri, 10 Mar 2017 14:14:59 -0800 Subject: [PATCH 081/276] Fix the `cookie` module definition (#15111) --- cookie/cookie-tests.ts | 4 +- cookie/index.d.ts | 118 ++++++++++++++++++++++++++++++++++++----- 2 files changed, 106 insertions(+), 16 deletions(-) diff --git a/cookie/cookie-tests.ts b/cookie/cookie-tests.ts index 2581a5c372..dd5be0f850 100644 --- a/cookie/cookie-tests.ts +++ b/cookie/cookie-tests.ts @@ -17,7 +17,7 @@ function test_parse(): void { } function test_options(): void { - var serializeOptions: CookieSerializeOptions = { + var serializeOptions: cookie.CookieSerializeOptions = { encode: (x: string) => x, path: '/', expires: new Date(), @@ -27,7 +27,7 @@ function test_options(): void { httpOnly: false }; - var parseOptios: CookieParseOptions = { + var parseOptios: cookie.CookieParseOptions = { decode: (x: string) => x }; } diff --git a/cookie/index.d.ts b/cookie/index.d.ts index 950796fa22..507eaee01d 100644 --- a/cookie/index.d.ts +++ b/cookie/index.d.ts @@ -1,28 +1,118 @@ -// Type definitions for cookie v0.1.2 +// Type definitions for cookie v0.3.0 // Project: https://github.com/jshttp/cookie // Definitions by: Pine Mizune // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface CookieSerializeOptions { - encode?: (val: string) => string; - path?: string; - expires?: Date; - maxAge?: number; + /** + * Specifies the value for the Domain Set-Cookie attribute. By default, no + * domain is set, and most clients will consider the cookie to apply to only + * the current domain. + */ domain?: string; - secure?: boolean; + /** + * Specifies a function that will be used to encode a cookie's value. Since + * value of a cookie has a limited character set (and must be a simple + * string), this function can be used to encode a value into a string suited + * for a cookie's value. + * + * The default function is the global `encodeURIComponent`, which will + * encode a JavaScript string into UTF-8 byte sequences and then URL-encode + * any that fall outside of the cookie range. + */ + encode?: (val: string) => string; + /** + * Specifies the `Date` object to be the value for the `Expires` + * `Set-Cookie` attribute. By default, no expiration is set, and most + * clients will consider this a "non-persistent cookie" and will delete it + * on a condition like exiting a web browser application. + * + * *Note* the cookie storage model specification states that if both + * `expires` and `maxAge` are set, then `maxAge` takes precedence, but it is + * possible not all clients by obey this, so if both are set, they should + * point to the same date and time. + */ + expires?: Date; + /** + * Specifies the boolean value for the `HttpOnly` `Set-Cookie` attribute. + * When truthy, the `HttpOnly` attribute is set, otherwise it is not. By + * default, the `HttpOnly` attribute is not set. + * + * *Note* be careful when setting this to true, as compliant clients will + * not allow client-side JavaScript to see the cookie in `document.cookie`. + */ httpOnly?: boolean; + /** + * Specifies the number (in seconds) to be the value for the `Max-Age` + * `Set-Cookie` attribute. The given number will be converted to an integer + * by rounding down. By default, no maximum age is set. + * + * *Note* the cookie storage model specification states that if both + * `expires` and `maxAge` are set, then `maxAge` takes precedence, but it is + * possible not all clients by obey this, so if both are set, they should + * point to the same date and time. + */ + maxAge?: number; + /** + * Specifies the value for the `Path` `Set-Cookie` attribute. By default, + * the path is considered the "default path". + */ + path?: string; + /** + * Specifies the boolean or string to be the value for the `SameSite` + * `Set-Cookie` attribute. + * + * - `true` will set the `SameSite` attribute to `Strict` for strict same + * site enforcement. + * - `false` will not set the `SameSite` attribute. + * - `'lax'` will set the `SameSite` attribute to Lax for lax same site + * enforcement. + * - `'strict'` will set the `SameSite` attribute to Strict for strict same + * site enforcement. + */ + sameSite?: boolean | 'lax' | 'strict'; + /** + * Specifies the boolean value for the `Secure` `Set-Cookie` attribute. When + * truthy, the `Secure` attribute is set, otherwise it is not. By default, + * the `Secure` attribute is not set. + * + * *Note* be careful when setting this to `true`, as compliant clients will + * not send the cookie back to the server in the future if the browser does + * not have an HTTPS connection. + */ + secure?: boolean; } interface CookieParseOptions { + /** + * Specifies a function that will be used to decode a cookie's value. Since + * the value of a cookie has a limited character set (and must be a simple + * string), this function can be used to decode a previously-encoded cookie + * value into a JavaScript string or other object. + * + * The default function is the global `decodeURIComponent`, which will decode + * any URL-encoded sequences into their byte representations. + * + * *Note* if an error is thrown from this function, the original, non-decoded + * cookie value will be returned as the cookie's value. + */ decode?: (val: string) => string; } -interface CookieStatic { - serialize(name: string, val: string, options?: CookieSerializeOptions): string; - parse(str: string, options?: CookieParseOptions): { [key: string]: string }; -} +/** + * Parse an HTTP Cookie header string and returning an object of all cookie + * name-value pairs. + * + * @param str the string representing a `Cookie` header value + * @param options object containing parsing options + */ +export function parse(str: string, options?: CookieParseOptions): { [key: string]: string }; -declare module "cookie" { - var cookie: CookieStatic; - export = cookie; -} +/** + * Serialize a cookie name-value pair into a `Set-Cookie` header string. + * + * @param name the name for the cookie + * @param val value to set the cookie to + * @param options object containing serialization options + */ +export function serialize(name: string, val: string, options?: CookieSerializeOptions): string; From 8dd753de5a1e97fe75d9d25df3d78c227c409309 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 10 Mar 2017 14:16:40 -0800 Subject: [PATCH 082/276] core-js: Lint and use "lib" to eliminate unnecessary code. (#15108) --- core-js/core-js-tests.ts | 10 +- core-js/index.d.ts | 937 ++------------------------------------- core-js/tsconfig.json | 5 +- core-js/tslint.json | 6 + 4 files changed, 56 insertions(+), 902 deletions(-) create mode 100644 core-js/tslint.json diff --git a/core-js/core-js-tests.ts b/core-js/core-js-tests.ts index 42cd770b86..0614b117b9 100644 --- a/core-js/core-js-tests.ts +++ b/core-js/core-js-tests.ts @@ -8,7 +8,7 @@ let s: string; let i: number; let b: boolean; let f: () => void; -let o: Object; +let o: {}; let r: RegExp; let sym: symbol; let e: Error; @@ -21,7 +21,7 @@ let arrayOfPoint3D: Point3D[]; let arrayOfSymbol: symbol[]; let arrayOfPropertyKey: PropertyKey[]; let arrayOfAny: any[]; -let arrayOfStringAny: [string, any][]; +let arrayOfStringAny: Array<[string, any]>; let arrayLikeOfAny: ArrayLike; let iterableOfPoint: Iterable; let iterableOfStringPoint: Iterable<[string, Point]>; @@ -57,7 +57,7 @@ let dictOfAny: Dict; // ############################################################################################# // ECMAScript 6: Object & Function -// Modules: es6.object.assign, es6.object.is, es6.object.set-prototype-of, +// Modules: es6.object.assign, es6.object.is, es6.object.set-prototype-of, // es6.object.to-string, es6.function.name and es6.function.has-instance. // ############################################################################################# @@ -88,8 +88,8 @@ arrayOfPoint = Array.of(point, point); // ############################################################################################# // ECMAScript 6: String & RegExp -// Modules: es6.string.from-code-point, es6.string.raw, es6.string.code-point-at, -// es6.string.ends-with, es6.string.includes, es6.string.repeat, +// Modules: es6.string.from-code-point, es6.string.raw, es6.string.code-point-at, +// es6.string.ends-with, es6.string.includes, es6.string.repeat, // es6.string.starts-with, and es6.regexp // ############################################################################################# diff --git a/core-js/index.d.ts b/core-js/index.d.ts index a0a10708d9..4191cd11aa 100644 --- a/core-js/index.d.ts +++ b/core-js/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for core-js v0.9.7 +// Type definitions for core-js 0.9 // Project: https://github.com/zloirock/core-js/ // Definitions by: Ron Buckton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /* ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,539 +19,12 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -declare type PropertyKey = string | number | symbol; - -// ############################################################################################# -// ECMAScript 6: Object & Function -// Modules: es6.object.assign, es6.object.is, es6.object.set-prototype-of, -// es6.object.to-string, es6.function.name and es6.function.has-instance. -// ############################################################################################# - -interface ObjectConstructor { - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source The source object from which to copy properties. - */ - assign(target: T, source: U): T & U; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source1 The first source object from which to copy properties. - * @param source2 The second source object from which to copy properties. - */ - assign(target: T, source1: U, source2: V): T & U & V; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source1 The first source object from which to copy properties. - * @param source2 The second source object from which to copy properties. - * @param source3 The third source object from which to copy properties. - */ - assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param sources One or more source objects from which to copy properties - */ - assign(target: any, ...sources: any[]): any; - - /** - * Returns true if the values are the same value, false otherwise. - * @param value1 The first value. - * @param value2 The second value. - */ - is(value1: any, value2: any): boolean; - - /** - * Sets the prototype of a specified object o to object proto or null. Returns the object o. - * @param o The object to change its prototype. - * @param proto The value of the new prototype or null. - * @remarks Requires `__proto__` support. - */ - setPrototypeOf(o: any, proto: any): any; -} - -interface Function { - /** - * Returns the name of the function. Function names are read-only and can not be changed. - */ - name: string; - - /** - * Determines if a constructor object recognizes an object as one of the - * constructor’s instances. - * @param value The object to test. - */ - [Symbol.hasInstance](value: any): boolean; -} - -// ############################################################################################# -// ECMAScript 6: Array -// Modules: es6.array.from, es6.array.of, es6.array.copy-within, es6.array.fill, es6.array.find, -// and es6.array.find-index -// ############################################################################################# - -interface Array { - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: T) => boolean, thisArg?: any): number; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: T, start?: number, end?: number): T[]; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): T[]; - - [Symbol.unscopables]: any; -} - -interface ArrayConstructor { - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - */ - from(arrayLike: ArrayLike): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - */ - from(iterable: Iterable): Array; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: T[]): Array; -} - -// ############################################################################################# -// ECMAScript 6: String & RegExp -// Modules: es6.string.from-code-point, es6.string.raw, es6.string.code-point-at, -// es6.string.ends-with, es6.string.includes, es6.string.repeat, -// es6.string.starts-with, and es6.regexp -// ############################################################################################# - -interface String { - /** - * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point - * value of the UTF-16 encoded code point starting at the string element at position pos in - * the String resulting from converting this object to a String. - * If there is no element at that position, the result is undefined. - * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. - */ - codePointAt(pos: number): number; - - /** - * Returns true if searchString appears as a substring of the result of converting this - * object to a String, at one or more positions that are - * greater than or equal to position; otherwise, returns false. - * @param searchString search string - * @param position If position is undefined, 0 is assumed, so as to search all of the String. - */ - includes(searchString: string, position?: number): boolean; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * endPosition – length(this). Otherwise returns false. - */ - endsWith(searchString: string, endPosition?: number): boolean; - - /** - * Returns a String value that is made from count copies appended together. If count is 0, - * T is the empty String is returned. - * @param count number of copies to append - */ - repeat(count: number): string; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * position. Otherwise returns false. - */ - startsWith(searchString: string, position?: number): boolean; -} - -interface StringConstructor { - /** - * Return the String value whose elements are, in order, the elements in the List elements. - * If length is 0, the empty string is returned. - */ - fromCodePoint(...codePoints: number[]): string; - - /** - * String.raw is intended for use as a tag function of a Tagged Template String. When called - * as such the first argument will be a well formed template call site object and the rest - * parameter will contain the substitution values. - * @param template A well-formed template string call site representation. - * @param substitutions A set of substitution values. - */ - raw(template: TemplateStringsArray, ...substitutions: any[]): string; -} - -interface RegExp { - /** - * Returns a string indicating the flags of the regular expression in question. This field is read-only. - * The characters in this string are sequenced and concatenated in the following order: - * - * - "g" for global - * - "i" for ignoreCase - * - "m" for multiline - * - "u" for unicode - * - "y" for sticky - * - * If no flags are set, the value is the empty string. - */ - flags: string; -} - -// ############################################################################################# -// ECMAScript 6: Number & Math -// Modules: es6.number.constructor, es6.number.statics, and es6.math -// ############################################################################################# - -interface NumberConstructor { - /** - * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 - * that is representable as a Number value, which is approximately: - * 2.2204460492503130808472633361816 x 10‍−‍16. - */ - EPSILON: number; - - /** - * Returns true if passed value is finite. - * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a - * number. Only finite values of the type number, result in true. - * @param number A numeric value. - */ - isFinite(number: number): boolean; - - /** - * Returns true if the value passed is an integer, false otherwise. - * @param number A numeric value. - */ - isInteger(number: number): boolean; - - /** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a - * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter - * to a number. Only values of the type number, that are also NaN, result in true. - * @param number A numeric value. - */ - isNaN(number: number): boolean; - - /** - * Returns true if the value passed is a safe integer. - * @param number A numeric value. - */ - isSafeInteger(number: number): boolean; - - /** - * The value of the largest integer n such that n and n + 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1. - */ - MAX_SAFE_INTEGER: number; - - /** - * The value of the smallest integer n such that n and n − 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). - */ - MIN_SAFE_INTEGER: number; - - /** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ - parseFloat(string: string): number; - - /** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ - parseInt(string: string, radix?: number): number; -} - -interface Math { - /** - * Returns the number of leading zero bits in the 32-bit binary representation of a number. - * @param x A numeric expression. - */ - clz32(x: number): number; - - /** - * Returns the result of 32-bit multiplication of two numbers. - * @param x First number - * @param y Second number - */ - imul(x: number, y: number): number; - - /** - * Returns the sign of the x, indicating whether x is positive, negative or zero. - * @param x The numeric expression to test - */ - sign(x: number): number; - - /** - * Returns the base 10 logarithm of a number. - * @param x A numeric expression. - */ - log10(x: number): number; - - /** - * Returns the base 2 logarithm of a number. - * @param x A numeric expression. - */ - log2(x: number): number; - - /** - * Returns the natural logarithm of 1 + x. - * @param x A numeric expression. - */ - log1p(x: number): number; - - /** - * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of - * the natural logarithms). - * @param x A numeric expression. - */ - expm1(x: number): number; - - /** - * Returns the hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cosh(x: number): number; - - /** - * Returns the hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sinh(x: number): number; - - /** - * Returns the hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tanh(x: number): number; - - /** - * Returns the inverse hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - acosh(x: number): number; - - /** - * Returns the inverse hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - asinh(x: number): number; - - /** - * Returns the inverse hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - atanh(x: number): number; - - /** - * Returns the square root of the sum of squares of its arguments. - * @param values Values to compute the square root for. - * If no arguments are passed, the result is +0. - * If there is only one argument, the result is the absolute value. - * If any argument is +Infinity or -Infinity, the result is +Infinity. - * If any argument is NaN, the result is NaN. - * If all arguments are either +0 or −0, the result is +0. - */ - hypot(...values: number[]): number; - - /** - * Returns the integral part of the a numeric expression, x, removing any fractional digits. - * If x is already an integer, the result is x. - * @param x A numeric expression. - */ - trunc(x: number): number; - - /** - * Returns the nearest single precision float representation of a number. - * @param x A numeric expression. - */ - fround(x: number): number; - - /** - * Returns an implementation-dependent approximation to the cube root of number. - * @param x A numeric expression. - */ - cbrt(x: number): number; -} - // ############################################################################################# // ECMAScript 6: Symbols // Modules: es6.symbol // ############################################################################################# -interface Symbol { - /** Returns a string representation of an object. */ - toString(): string; - - [Symbol.toStringTag]: string; -} - interface SymbolConstructor { - /** - * A reference to the prototype. - */ - prototype: Symbol; - - /** - * Returns a new unique Symbol value. - * @param description Description of the new Symbol object. - */ - (description?: string|number): symbol; - - /** - * Returns a Symbol object from the global symbol registry matching the given key if found. - * Otherwise, returns a new symbol with this key. - * @param key key to search for. - */ - for(key: string): symbol; - - /** - * Returns a key from the global symbol registry matching the given Symbol if found. - * Otherwise, returns a undefined. - * @param sym Symbol to find the key for. - */ - keyFor(sym: symbol): string; - - // Well-known Symbols - - /** - * A method that determines if a constructor object recognizes an object as one of the - * constructor’s instances. Called by the semantics of the instanceof operator. - */ - hasInstance: symbol; - - /** - * A Boolean value that if true indicates that an object should flatten to its array elements - * by Array.prototype.concat. - */ - isConcatSpreadable: symbol; - - /** - * A method that returns the default iterator for an object. Called by the semantics of the - * for-of statement. - */ - iterator: symbol; - - /** - * A regular expression method that matches the regular expression against a string. Called - * by the String.prototype.match method. - */ - match: symbol; - - /** - * A regular expression method that replaces matched substrings of a string. Called by the - * String.prototype.replace method. - */ - replace: symbol; - - /** - * A regular expression method that returns the index within a string that matches the - * regular expression. Called by the String.prototype.search method. - */ - search: symbol; - - /** - * A function valued property that is the constructor function that is used to create - * derived objects. - */ - species: symbol; - - /** - * A regular expression method that splits a string at the indices that match the regular - * expression. Called by the String.prototype.split method. - */ - split: symbol; - - /** - * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive - * abstract operation. - */ - toPrimitive: symbol; - - /** - * A String value that is used in the creation of the default string description of an object. - * Called by the built-in method Object.prototype.toString. - */ - toStringTag: symbol; - - /** - * An Object whose own property names are property names that are excluded from the with - * environment bindings of the associated objects. - */ - unscopables: symbol; - /** * Non-standard. Use simple mode for core-js symbols. See https://github.com/zloirock/core-js/#caveats-when-using-symbol-polyfill */ @@ -562,193 +36,6 @@ interface SymbolConstructor { userSetter(): void; } -declare var Symbol: SymbolConstructor; - -interface Object { - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: PropertyKey): boolean; - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: PropertyKey): boolean; -} - -interface ObjectConstructor { - /** - * Returns an array of all symbol properties found directly on object o. - * @param o Object to retrieve the symbols from. - */ - getOwnPropertySymbols(o: any): symbol[]; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not - * inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript - * object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor - * property. - */ - defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; -} - -interface Math { - [Symbol.toStringTag]: string; -} - -interface JSON { - [Symbol.toStringTag]: string; -} - -// ############################################################################################# -// ECMAScript 6: Collections -// Modules: es6.map, es6.set, es6.weak-map, and es6.weak-set -// ############################################################################################# - -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): Map; - size: number; -} - -interface MapConstructor { - new (): Map; - new (iterable: Iterable<[K, V]>): Map; - prototype: Map; -} - -declare var Map: MapConstructor; - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - size: number; -} - -interface SetConstructor { - new (): Set; - new (iterable: Iterable): Set; - prototype: Set; -} - -declare var Set: SetConstructor; - -interface WeakMap { - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): WeakMap; -} - -interface WeakMapConstructor { - new (): WeakMap; - new (iterable: Iterable<[K, V]>): WeakMap; - prototype: WeakMap; -} - -declare var WeakMap: WeakMapConstructor; - -interface WeakSet { - add(value: T): WeakSet; - delete(value: T): boolean; - has(value: T): boolean; -} - -interface WeakSetConstructor { - new (): WeakSet; - new (iterable: Iterable): WeakSet; - prototype: WeakSet; -} - -declare var WeakSet: WeakSetConstructor; - -// ############################################################################################# -// ECMAScript 6: Iterators -// Modules: es6.string.iterator, es6.array.iterator, es6.map, es6.set, web.dom.iterable -// ############################################################################################# - -interface IteratorResult { - done: boolean; - value?: T; -} - -interface Iterator { - next(value?: any): IteratorResult; - return?(value?: any): IteratorResult; - throw?(e?: any): IteratorResult; -} - -interface Iterable { - [Symbol.iterator](): Iterator; -} - -interface IterableIterator extends Iterator { - [Symbol.iterator](): IterableIterator; -} - -interface String { - /** Iterator */ - [Symbol.iterator](): IterableIterator; -} - -interface Array { - /** Iterator */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, T]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Map { - entries(): IterableIterator<[K, V]>; - keys(): IterableIterator; - values(): IterableIterator; - [Symbol.iterator](): IterableIterator<[K, V]>; -} - -interface Set { - entries(): IterableIterator<[T, T]>; - keys(): IterableIterator; - values(): IterableIterator; - [Symbol.iterator](): IterableIterator; -} - -interface NodeList { - [Symbol.iterator](): IterableIterator; -} - interface $for extends IterableIterator { of(callbackfn: (value: T, key: any) => void, thisArg?: any): void; array(): T[]; @@ -759,135 +46,6 @@ interface $for extends IterableIterator { declare function $for(iterable: Iterable): $for; -// ############################################################################################# -// ECMAScript 6: Promises -// Modules: es6.promise -// ############################################################################################# - -interface PromiseLike { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; -} - -/** - * Represents the completion of an asynchronous operation - */ -interface Promise { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): Promise; - - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: (reason: any) => T | PromiseLike): Promise; - catch(onrejected?: (reason: any) => void): Promise; -} - -interface PromiseConstructor { - /** - * A reference to the prototype. - */ - prototype: Promise; - - /** - * Creates a new Promise. - * @param executor A callback used to initialize the promise. This callback is passed two arguments: - * a resolve callback used resolve the promise with a value or the result of another promise, - * and a reject callback used to reject the promise with a provided reason or error. - */ - new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; - all(values: Iterable>): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: Iterable>): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new resolved promise for the provided value. - * @param value A promise. - * @returns A promise whose internal state matches the provided promise. - */ - resolve(value: T | PromiseLike): Promise; - - /** - * Creates a new resolved promise . - * @returns A resolved promise. - */ - resolve(): Promise; -} - -declare var Promise: PromiseConstructor; - -// ############################################################################################# -// ECMAScript 6: Reflect -// Modules: es6.reflect -// ############################################################################################# - -declare namespace Reflect { - function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; - function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; - function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; - function deleteProperty(target: any, propertyKey: PropertyKey): boolean; - function enumerate(target: any): IterableIterator; - function get(target: any, propertyKey: PropertyKey, receiver?: any): any; - function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; - function getPrototypeOf(target: any): any; - function has(target: any, propertyKey: PropertyKey): boolean; - function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; - function preventExtensions(target: any): boolean; - function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; - function setPrototypeOf(target: any, proto: any): boolean; -} - // ############################################################################################# // ECMAScript 7 // Modules: es7.array.includes, es7.string.at, es7.string.pad-start, es7.string.pad-end, @@ -895,19 +53,11 @@ declare namespace Reflect { // es7.map.to-json, and es7.set.to-json // ############################################################################################# -interface Array { - includes(value: T, fromIndex?: number): boolean; -} - interface String { at(index: number): string; - padStart(length: number, fillStr?: string): string; - padEnd(length: number, fillStr?: string): string; } -interface ObjectConstructor { - values(object: any): any[]; - entries(object: any): [string, any][]; +interface Object { getOwnPropertyDescriptors(object: any): PropertyDescriptorMap; } @@ -942,7 +92,7 @@ interface ArrayConstructor { * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(array: ArrayLike, ...items: (T[]| T)[]): T[]; + concat(array: ArrayLike, ...items: Array): T[]; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. @@ -969,19 +119,13 @@ interface ArrayConstructor { */ sort(array: ArrayLike, compareFn?: (a: T, b: T) => number): T[]; - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - */ - splice(array: ArrayLike, start: number): T[]; - /** * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. * @param start The zero-based location in the array from which to start removing elements. * @param deleteCount The number of elements to remove. * @param items Elements to insert into the array in place of the deleted elements. */ - splice(array: ArrayLike, start: number, deleteCount: number, ...items: T[]): T[]; + splice(array: ArrayLike, start: number, deleteCount?: number, ...items: T[]): T[]; /** * Inserts new elements at the start of an array. @@ -1005,14 +149,16 @@ interface ArrayConstructor { /** * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. + * @param callbackfn A function that accepts up to three arguments. + * The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ every(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; /** * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. + * @param callbackfn A function that accepts up to three arguments. + * The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ some(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; @@ -1039,30 +185,38 @@ interface ArrayConstructor { filter(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * Calls the specified callback function for all the elements in an array. + * The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. + * The first call to the callbackfn function provides this value as an argument instead of an array value. */ reduce(array: ArrayLike, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * Calls the specified callback function for all the elements in an array. + * The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. + * The first call to the callbackfn function provides this value as an argument instead of an array value. */ reduce(array: ArrayLike, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. + * The first call to the callbackfn function provides this value as an argument instead of an array value. */ reduceRight(array: ArrayLike, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. + * The first call to the callbackfn function provides this value as an argument instead of an array value. */ reduceRight(array: ArrayLike, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; @@ -1090,7 +244,7 @@ interface ArrayConstructor { * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ - find(array: ArrayLike, predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; + find(array: ArrayLike, predicate: (value: T, index: number, obj: T[]) => boolean, thisArg?: any): T; /** * Returns the index of the first element in the array where predicate is true, and undefined @@ -1125,8 +279,8 @@ interface ArrayConstructor { copyWithin(array: ArrayLike, target: number, start: number, end?: number): T[]; includes(array: ArrayLike, value: T, fromIndex?: number): boolean; - turn(array: ArrayLike, callbackfn: (memo: U, value: T, index: number, array: Array) => void, memo?: U): U; - turn(array: ArrayLike, callbackfn: (memo: Array, value: T, index: number, array: Array) => void, memo?: Array): Array; + turn(array: ArrayLike, callbackfn: (memo: U, value: T, index: number, array: T[]) => void, memo?: U): U; + turn(array: ArrayLike, callbackfn: (memo: T[], value: T, index: number, array: T[]) => void, memo?: T[]): T[]; } // ############################################################################################# @@ -1180,7 +334,7 @@ declare var log: Log; interface Dict { [key: string]: T; [key: number]: T; - //[key: symbol]: T; + // [key: symbol]: T; } interface DictConstructor { @@ -1257,12 +411,12 @@ interface Array { /** * Non-standard. */ - turn(callbackfn: (memo: U, value: T, index: number, array: Array) => void, memo?: U): U; + turn(callbackfn: (memo: U, value: T, index: number, array: T[]) => void, memo?: U): U; /** * Non-standard. */ - turn(callbackfn: (memo: Array, value: T, index: number, array: Array) => void, memo?: Array): Array; + turn(callbackfn: (memo: T[], value: T, index: number, array: T[]) => void, memo?: T[]): T[]; } // ############################################################################################# @@ -1313,10 +467,9 @@ declare namespace core { function get(target: any, propertyKey: PropertyKey, receiver?: any): any; function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; function getPrototypeOf(target: any): any; - function has(target: any, propertyKey: string): boolean; - function has(target: any, propertyKey: symbol): boolean; + function has(target: any, propertyKey: string | symbol): boolean; function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; + function ownKeys(target: any): PropertyKey[]; function preventExtensions(target: any): boolean; function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; function setPrototypeOf(target: any, proto: any): boolean; @@ -1324,10 +477,8 @@ declare namespace core { var Object: { getPrototypeOf(o: any): any; - getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; getOwnPropertyNames(o: any): string[]; create(o: any, properties?: PropertyDescriptorMap): any; - defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; defineProperties(o: any, properties: PropertyDescriptorMap): any; seal(o: T): T; freeze(o: T): T; @@ -1357,21 +508,18 @@ declare namespace core { }; var Array: { - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - from(arrayLike: ArrayLike): Array; - from(iterable: Iterable): Array; - of(...items: T[]): Array; + from(arrayLike: ArrayLike | Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; + from(arrayLike: ArrayLike | Iterable): T[]; + of(...items: T[]): T[]; push(array: ArrayLike, ...items: T[]): number; pop(array: ArrayLike): T; - concat(array: ArrayLike, ...items: (T[]| T)[]): T[]; + concat(array: ArrayLike, ...items: Array): T[]; join(array: ArrayLike, separator?: string): string; reverse(array: ArrayLike): T[]; shift(array: ArrayLike): T; slice(array: ArrayLike, start?: number, end?: number): T[]; sort(array: ArrayLike, compareFn?: (a: T, b: T) => number): T[]; - splice(array: ArrayLike, start: number): T[]; - splice(array: ArrayLike, start: number, deleteCount: number, ...items: T[]): T[]; + splice(array: ArrayLike, start: number, deleteCount?: number, ...items: T[]): T[]; unshift(array: ArrayLike, ...items: T[]): number; indexOf(array: ArrayLike, searchElement: T, fromIndex?: number): number; lastIndexOf(array: ArrayLike, earchElement: T, fromIndex?: number): number; @@ -1387,13 +535,13 @@ declare namespace core { entries(array: ArrayLike): IterableIterator<[number, T]>; keys(array: ArrayLike): IterableIterator; values(array: ArrayLike): IterableIterator; - find(array: ArrayLike, predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; + find(array: ArrayLike, predicate: (value: T, index: number, obj: T[]) => boolean, thisArg?: any): T; findIndex(array: ArrayLike, predicate: (value: T) => boolean, thisArg?: any): number; fill(array: ArrayLike, value: T, start?: number, end?: number): T[]; copyWithin(array: ArrayLike, target: number, start: number, end?: number): T[]; includes(array: ArrayLike, value: T, fromIndex?: number): boolean; - turn(array: ArrayLike, callbackfn: (memo: Array, value: T, index: number, array: Array) => void, memo?: Array): Array; - turn(array: ArrayLike, callbackfn: (memo: U, value: T, index: number, array: Array) => void, memo?: U): U; + turn(array: ArrayLike, callbackfn: (memo: T[], value: T, index: number, array: T[]) => void, memo?: T[]): T[]; + turn(array: ArrayLike, callbackfn: (memo: U, value: T, index: number, array: T[]) => void, memo?: U): U; }; var String: { @@ -1782,8 +930,7 @@ declare module "core-js/fn/function/has-instance" { var hasInstance: (value: any) => boolean; export = hasInstance; } -declare module "core-js/fn/function/name" -{ +declare module "core-js/fn/function/name" { } declare module "core-js/fn/function/part" { var part: typeof core.Function.part; diff --git a/core-js/tsconfig.json b/core-js/tsconfig.json index b37502a626..8c7007b563 100644 --- a/core-js/tsconfig.json +++ b/core-js/tsconfig.json @@ -2,8 +2,9 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "dom" + "es2017", + "dom", + "dom.iterable" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/core-js/tslint.json b/core-js/tslint.json new file mode 100644 index 0000000000..0f47deabb4 --- /dev/null +++ b/core-js/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "../tslint.json", + "rules": { + "forbidden-types": false + } +} \ No newline at end of file From 468026989e4bfb7ce52b708c9cdb6cca0b9c589c Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 10 Mar 2017 14:16:54 -0800 Subject: [PATCH 083/276] openfin: Remove BOM (#15107) --- openfin/openfin-tests.ts | 2 +- openfin/v15/openfin-tests.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/openfin/openfin-tests.ts b/openfin/openfin-tests.ts index 63a53f7cb5..cb08f60a62 100644 --- a/openfin/openfin-tests.ts +++ b/openfin/openfin-tests.ts @@ -1,4 +1,4 @@ -function test_application() { +function test_application() { let application: fin.OpenFinApplication; // constructor application = new fin.desktop.Application({ diff --git a/openfin/v15/openfin-tests.ts b/openfin/v15/openfin-tests.ts index 69b024ce90..c3c1ef1cc6 100644 --- a/openfin/v15/openfin-tests.ts +++ b/openfin/v15/openfin-tests.ts @@ -1,4 +1,3 @@ - function test_application() { let application: fin.OpenFinApplication; // constructor From f4fdcaca9c94f90442dcedb0c8a84399c47e731f Mon Sep 17 00:00:00 2001 From: denisname Date: Fri, 10 Mar 2017 23:21:11 +0100 Subject: [PATCH 084/276] jQuery improve typing (#15102) * jQuery improve typing Each callback returns nothing or boolean Each return its first argument isArray, isFunction and isWindow as type guards type has a more strict return type make unique generic functions * Add libs in angular-oauth2 tsconfig * Linting angular-oauth2 --- angular-oauth2/angular-oauth2-tests.ts | 2 +- angular-oauth2/tsconfig.json | 4 ++ jquery/index.d.ts | 35 +++++++------ jquery/jquery-tests.ts | 70 ++++++++++++++++++++------ 4 files changed, 78 insertions(+), 33 deletions(-) diff --git a/angular-oauth2/angular-oauth2-tests.ts b/angular-oauth2/angular-oauth2-tests.ts index 2b2328d5ee..042fe537aa 100644 --- a/angular-oauth2/angular-oauth2-tests.ts +++ b/angular-oauth2/angular-oauth2-tests.ts @@ -1,7 +1,7 @@ import * as angular from 'angular'; angular.module('angular-oauth2-test', ['angular-oauth2']) - .config(['OAuthProvider', function(OAuthProvider:angular.oauth2.OAuthProvider){ + .config(['OAuthProvider', (OAuthProvider: angular.oauth2.OAuthProvider) => { OAuthProvider.configure({ baseUrl: 'https://api.website.com', clientId: 'CLIENT_ID', diff --git a/angular-oauth2/tsconfig.json b/angular-oauth2/tsconfig.json index 717721bf79..e8a5250748 100644 --- a/angular-oauth2/tsconfig.json +++ b/angular-oauth2/tsconfig.json @@ -2,6 +2,10 @@ "compilerOptions": { "module": "commonjs", "target": "es6", + "lib": [ + "es6", + "dom" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/jquery/index.d.ts b/jquery/index.d.ts index 3a785530aa..0a47546193 100644 --- a/jquery/index.d.ts +++ b/jquery/index.d.ts @@ -1166,25 +1166,28 @@ interface JQueryStatic { * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. * * @param collection The object or array to iterate over. - * @param callback The function that will be executed on every object. + * @param callback The function that will be executed on every object. Will break the loop by returning false. + * @returns the first argument, the object that is iterated. * @see {@link https://api.jquery.com/jQuery.each/#jQuery-each-array-callback} */ each( collection: T[], - callback: (indexInArray: number, valueOfElement: T) => any - ): any; + callback: (indexInArray: number, valueOfElement: T) => boolean | void + ): T[]; /** * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. * * @param collection The object or array to iterate over. - * @param callback The function that will be executed on every object. + * @param callback The function that will be executed on every object. Will break the loop by returning false. + * @returns the first argument, the object that is iterated. * @see {@link https://api.jquery.com/jQuery.each/#jQuery-each-object-callback} */ - each( - collection: any, - callback: (indexInArray: any, valueOfElement: any) => any - ): any; + each( + collection: T, + // TODO: `(keyInObject: keyof T, valueOfElement: T[keyof T])`, when TypeScript 2.1 allowed in repository + callback: (keyInObject: string, valueOfElement: any) => boolean | void + ): T; /** * Merge the contents of two or more objects together into the first object. @@ -1240,7 +1243,7 @@ interface JQueryStatic { * @param obj Object to test whether or not it is an array. * @see {@link https://api.jquery.com/jQuery.isArray/} */ - isArray(obj: any): boolean; + isArray(obj: any): obj is Array; /** * Check to see if an object is empty (contains no enumerable properties). * @@ -1254,7 +1257,7 @@ interface JQueryStatic { * @param obj Object to test whether or not it is a function. * @see {@link https://api.jquery.com/jQuery.isFunction/} */ - isFunction(obj: any): boolean; + isFunction(obj: any): obj is Function; /** * Determines whether its argument is a number. * @@ -1275,7 +1278,7 @@ interface JQueryStatic { * @param obj Object to test whether or not it is a window. * @see {@link https://api.jquery.com/jQuery.isWindow/} */ - isWindow(obj: any): boolean; + isWindow(obj: any): obj is Window; /** * Check to see if a DOM node is within an XML document (or is an XML document). * @@ -1360,7 +1363,7 @@ interface JQueryStatic { * @param obj Object to get the internal JavaScript [[Class]] of. * @see {@link https://api.jquery.com/jQuery.type/} */ - type(obj: any): string; + type(obj: any): "array" | "boolean" | "date" | "error" | "function" | "null" | "number" | "object" | "regexp" | "string" | "symbol" | "undefined"; /** * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. @@ -1368,7 +1371,7 @@ interface JQueryStatic { * @param array The Array of DOM elements. * @see {@link https://api.jquery.com/jQuery.unique/} */ - unique(array: Element[]): Element[]; + unique(array: T[]): T[]; /** * Parses a string into an array of DOM nodes. @@ -3301,10 +3304,10 @@ interface JQuery { /** * Iterate over a jQuery object, executing a function for each matched element. * - * @param func A function to execute for each matched element. + * @param func A function to execute for each matched element. Can stop the loop by returning false. * @see {@link https://api.jquery.com/each/} */ - each(func: (index: number, elem: Element) => any): JQuery; + each(func: (index: number, elem: Element) => boolean | void): JQuery; /** * Retrieve one of the elements matched by the jQuery object. @@ -3457,7 +3460,7 @@ interface JQuery { * @param func A function used as a test for each element in the set. this is the current DOM element. * @see {@link https://api.jquery.com/filter/#filter-function} */ - filter(func: (index: number, element: Element) => any): JQuery; + filter(func: (index: number, element: Element) => boolean): JQuery; /** * Reduce the set of matched elements to those that match the selector or pass the function's test. * diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index e11a8b806f..d2d58aa2a2 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -100,16 +100,18 @@ function test_ajax() { if (getAllResponseHeaders()) { return getAllResponseHeaders(); } - var allHeaders = ""; - $(["Cache-Control", "Content-Language", "Content-Type", - "Expires", "Last-Modified", "Pragma"]).each(function (i, header_name) { - if (xhr.getResponseHeader(header_name)) { - allHeaders += header_name + ": " + xhr.getResponseHeader(header_name) + "\n"; - } - return allHeaders; - }); + var allHeaders = ""; + var headersFieldNames = ["Cache-Control", "Content-Language", "Content-Type", + "Expires", "Last-Modified", "Pragma"]; + $(headersFieldNames).each(function (i, header_name) { + if (xhr.getResponseHeader(header_name)) { + allHeaders += header_name + ": " + xhr.getResponseHeader(header_name) + "\n"; + } + }); + return allHeaders; }; + return xhr; }; $.ajax({ @@ -1392,9 +1394,24 @@ function test_detach() { } function test_each() { - $.each([52, 97], function (index, value) { + var numArray: number[]; + numArray = $.each([1, 2, 3, 4], function (index: number, value: number) { alert(index + ': ' + value); }); + numArray = $.each([1, 2, 3, 4], function (index: number, value: number) { + alert(index + ': ' + value); + return value < 2; + }); + + var res: {one: number, 2: string}; + res = $.each({ one: 1, 2: "two" }, function(key: string, value: any) { + alert(key + ': ' + value); + }); + res = $.each({ one: 1, 2: "two" }, function(key: string, value: any) { + alert(key + ': ' + value); + return key === "2"; + }); + var map = { 'flammable': 'inflammable', 'duh': 'no duh' @@ -1404,8 +1421,7 @@ function test_each() { }); var arr = ["one", "two", "three", "four", "five"]; var obj = { one: 1, two: 2, three: 3, four: 4, five: 5 }; - // TODO: Should not need explicit type annotation https://github.com/Microsoft/TypeScript/issues/10072 - jQuery.each(arr, function () { + jQuery.each(arr, function () { $("#" + this).text("Mine is " + this + "."); return (this != "three"); }); @@ -1482,9 +1498,10 @@ function test_error() { $(this).hide(); }) .attr("src", "missing.png"); + jQuery.error("Oups"); jQuery.error = (message?: string) => { console.error(message); return this; - } + }; } function test_eventParams() { @@ -1516,7 +1533,7 @@ function test_eventParams() { function propStopped(e) { var msg = ""; if (e.isPropagationStopped()) { - msg = "called" + msg = "called"; } else { msg = "not called"; } @@ -1703,11 +1720,11 @@ function test_fadeToggle() { function test_filter() { $('li').filter(':even').css('background-color', 'red'); $('li').filter(function (index) { - return index % 3 == 2; + return index % 3 === 2; }).css('background-color', 'red'); $("div").css("background", "#b4b0da") .filter(function (index) { - return index == 1 || $(this).attr("id") == "fourth"; + return index === 1 || $(this).attr("id") === "fourth"; }) .css("border", "3px double red"); $("div").filter(document.getElementById("unique")); @@ -1879,7 +1896,7 @@ function test_getJSON() { function (data) { $.each(data.items, function (i, item) { $("").attr("src", item.media.m).appendTo("#images"); - if (i == 3) return false; + if (i === "3") return false; }); }); $.getJSON("test.js", function (json) { @@ -2524,6 +2541,17 @@ function test_is() { }); } +function test_isTypeGuards() { + var foo: number[] | ((x: string) => number) | Window; + if (jQuery.isArray(foo)) { + foo.push(1515); + } else if (jQuery.isWindow(foo)) { + foo.close(); + } else if (jQuery.isFunction(foo)) { + foo("hello world"); + } +} + function test_isArray() { $("b").append("" + $.isArray([])); } @@ -2582,6 +2610,16 @@ function test_isXMLDoc() { jQuery.isXMLDoc(document.body); } +function test_unique() { + jQuery.unique($('div.foo, div.bar').get()); + jQuery.unique($('div.foo, div.bar').toArray()); + + var divs: HTMLDivElement[]; + var unique: HTMLDivElement[]; + unique = jQuery.unique(divs); + unique = jQuery.unique(divs); +} + function test_jQuery() { $('div.foo'); $('div.foo').click(function () { From fdffd336315881eefd466a6524ddc66e637a42c6 Mon Sep 17 00:00:00 2001 From: Conrad Wahlen Date: Fri, 10 Mar 2017 23:21:43 +0100 Subject: [PATCH 085/276] setFromSpherical return type corrected (#15101) --- three/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/three/index.d.ts b/three/index.d.ts index 46975498c3..ff962d17b7 100644 --- a/three/index.d.ts +++ b/three/index.d.ts @@ -4240,7 +4240,7 @@ declare namespace THREE { distanceToSquared(v: Vector3): number; distanceToManhattan(v: Vector3): number; - setFromSpherical(s: Spherical): Matrix3; + setFromSpherical(s: Spherical): Vector3; setFromMatrixPosition(m: Matrix4): Vector3; setFromMatrixScale(m: Matrix4): Vector3; setFromMatrixColumn(matrix: Matrix4, index: number): Vector3; From 0a5c482bc7b4a830644c6103640d391749517fae Mon Sep 17 00:00:00 2001 From: voxmatt Date: Fri, 10 Mar 2017 14:23:33 -0800 Subject: [PATCH 086/276] fixing tests and removing Object references --- react-relay/index.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/react-relay/index.d.ts b/react-relay/index.d.ts index 961acbccc2..a693527e3e 100644 --- a/react-relay/index.d.ts +++ b/react-relay/index.d.ts @@ -15,7 +15,7 @@ declare module "react-relay" { } interface CreateContainerOpts { - initialVariables?: Object + initialVariables?: any fragments: Fragments prepareVariables?(prevVariables: RelayVariables): RelayVariables } @@ -148,13 +148,13 @@ declare module "react-relay" { } interface RelayProp { - route: { name: string; }; // incomplete, also has params and queries - variables: Object; - pendingVariables?: Object | null; - setVariables(variables: Object, onReadyStateChange?: OnReadyStateChange): void; - forceFetch(variables: Object, onReadyStateChange?: OnReadyStateChange): void; - hasOptimisticUpdate(record: Object): boolean; - getPendingTransactions(record: Object): RelayMutationTransaction[]; + readonly route: { name: string; }; // incomplete, also has params and queries + readonly variables: any; + readonly pendingVariables?: any | null; + setVariables(variables: any, onReadyStateChange?: OnReadyStateChange): void; + forceFetch(variables: any, onReadyStateChange?: OnReadyStateChange): void; + hasOptimisticUpdate(record: any): boolean; + getPendingTransactions(record: any): RelayMutationTransaction[]; commitUpdate: (mutation: Mutation, callbacks?: StoreUpdateCallbacks) => any; } } From 5383957c388e0c7b69e72bed7b4ac935d2a00a3e Mon Sep 17 00:00:00 2001 From: Knuddels Date: Fri, 10 Mar 2017 23:30:12 +0100 Subject: [PATCH 087/276] fixed missing static modifier (#15098) --- knuddels-userapps-api/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knuddels-userapps-api/index.d.ts b/knuddels-userapps-api/index.d.ts index b388301f68..52183f832f 100644 --- a/knuddels-userapps-api/index.d.ts +++ b/knuddels-userapps-api/index.d.ts @@ -1541,7 +1541,7 @@ declare class KnuddelsServer { * Liefert ein ExternalServerAccess-Objekt, mit dem * andere Server angesteuert werden können. */ - getExternalServerAccess(): ExternalServerAccess; + static getExternalServerAccess(): ExternalServerAccess; /** * Aktualisiert die Liste der genutzten Hooks. Werden zur Laufzeit chatCommands oder App-Hooks (wie mayJoinChannel) dynamisch erzeugt oder gelöscht, so muss danach refreshHooks() * aufgerufen werden, damit diese Änderung wirksam wird. From 4b0194180f145b06c30ea76f36fb31ae06974fbb Mon Sep 17 00:00:00 2001 From: Andrey Kurdyumov Date: Sat, 11 Mar 2017 04:43:27 +0600 Subject: [PATCH 088/276] Add fitlers paramters to react-bootstrap-table (#14861) --- react-bootstrap-table/index.d.ts | 27 ++++++++- .../react-bootstrap-table-tests.tsx | 55 ++++++++++++++++++- 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/react-bootstrap-table/index.d.ts b/react-bootstrap-table/index.d.ts index 566019ab94..82384f0d9f 100644 --- a/react-bootstrap-table/index.d.ts +++ b/react-bootstrap-table/index.d.ts @@ -356,7 +356,7 @@ export interface Options { /** Background color on expanded rows. */ - expandRowBgColor?: string; + expandRowBgColor?: string; /** Assign a callback function which will be called when mouse enter into the table. */ @@ -568,6 +568,11 @@ export interface Editable { cols?: number; rows?: number; } +export type SetFilterCallback = (targetValue: any) => boolean; +export interface ApplyFilterParameter { + callback: SetFilterCallback; +} + export type FilterType = 'TextFilter' | 'RegexFilter' | 'SelectFilter' | 'NumberFilter' | 'DateFilter' | 'CustomFilter'; export interface Filter { /** @@ -590,6 +595,26 @@ export interface Filter { * Only work on NumberFilter. Accept an array which conatin the filter condition, like: ['<','>','='] */ numberComparators?: string[]; + + /** + * Options for the filter. + */ + options?: any; + + /** + * Comparison condition for the NumberFilter + */ + condition?: string; + + /** + * Get element which represent filter. + */ + getElement?: (filterHandler: (parameters?: ApplyFilterParameter) => void, filterParameters: any) => JSX.Element; + + /** + * Parameters for custom filter + */ + customFilterParameters?: any; } export interface TableHeaderColumn extends ComponentClass { } diff --git a/react-bootstrap-table/react-bootstrap-table-tests.tsx b/react-bootstrap-table/react-bootstrap-table-tests.tsx index 47682dd36a..2151f14c78 100644 --- a/react-bootstrap-table/react-bootstrap-table-tests.tsx +++ b/react-bootstrap-table/react-bootstrap-table-tests.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { render } from 'react-dom'; -import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table'; +import { BootstrapTable, TableHeaderColumn, ApplyFilterParameter } from 'react-bootstrap-table'; var products = [{ id: 1, @@ -27,3 +27,56 @@ render( , document.getElementById("app") ); + +const qualityType = { + 0: 'good', + 1: 'bad', + 2: 'unknown' +}; + +function enumFormatter(cell: any, row: any, enumObject: any) { + return enumObject[cell]; +} + +class SelectFilterWithDefaultValue extends React.Component { + render() { + return ( + + Product ID + Product Name + Product Quality + + ); + } +} + +class TextFilterWithCondition extends React.Component { + render() { + return ( + + Product ID + Product Name + Product Price + + ); + } +} + +function getCustomFilter(filterHandler: (parameters?: ApplyFilterParameter) => void, customFilterParameters: any) { + return ( +
    + ); +} + +class CustomFilter extends React.Component { + render() { + return ( + + Product ID + Product Name + Product Is In Stock + + ); + } +} From 62fdb1966ea605cf9a670d27f28c6d91f684e12d Mon Sep 17 00:00:00 2001 From: Michael McMullin Date: Fri, 10 Mar 2017 22:45:32 +0000 Subject: [PATCH 089/276] Add support for PlaceResult.opening_hours (#14859) --- googlemaps/index.d.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/googlemaps/index.d.ts b/googlemaps/index.d.ts index 60e0a92dfc..765b974bf6 100644 --- a/googlemaps/index.d.ts +++ b/googlemaps/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Google Maps JavaScript API 3.26 // Project: https://developers.google.com/maps/ -// Definitions by: Folia A/S , Chris Wrench , Kiarash Ghiaseddin , Grant Hutchins , Denis Atyasov +// Definitions by: Folia A/S , Chris Wrench , Kiarash Ghiaseddin , Grant Hutchins , Denis Atyasov , Michael McMullin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /* @@ -2224,6 +2224,22 @@ declare namespace google.maps { types: string[]; } + export interface OpeningHours { + open_now: boolean, + periods: OpeningPeriod[], + weekday_text: string[] + } + + export interface OpeningPeriod { + open: OpeningHoursTime, + close?: OpeningHoursTime + } + + export interface OpeningHoursTime { + day: number, + time: string + } + export interface PredictionTerm { offset: number; value: string; @@ -2290,6 +2306,7 @@ declare namespace google.maps { icon: string; international_phone_number: string; name: string; + opening_hours: OpeningHours; permanently_closed: boolean; photos: PlacePhoto[]; place_id: string; From 565751df4d8dcbf0af8a2fc40ce0fdd1526bdd9f Mon Sep 17 00:00:00 2001 From: Rich Buggy Date: Sat, 11 Mar 2017 09:46:22 +1100 Subject: [PATCH 090/276] Added SNS Message event and allow boolean/number vaues in Proxy Lambda header response (#14858) --- aws-lambda/aws-lambda-tests.ts | 35 ++++++++++++++++++++++++++++- aws-lambda/index.d.ts | 41 +++++++++++++++++++++++++++++++--- 2 files changed, 72 insertions(+), 4 deletions(-) diff --git a/aws-lambda/aws-lambda-tests.ts b/aws-lambda/aws-lambda-tests.ts index 7b0fe45180..1ffdb2980b 100644 --- a/aws-lambda/aws-lambda-tests.ts +++ b/aws-lambda/aws-lambda-tests.ts @@ -11,6 +11,12 @@ var clientContextClient: AWSLambda.ClientContextClient; var context: AWSLambda.Context; var identity: AWSLambda.CognitoIdentity; var proxyResult: AWSLambda.ProxyResult; +var snsEvt: AWSLambda.SNSEvent; +var snsEvtRecs: Array; +var snsEvtRec: AWSLambda.SNSEventRecord; +var snsMsg: AWSLambda.SNSMessage; +var snsMsgAttr: AWSLambda.SNSMessageAttribute; +var snsMsgAttrs: AWSLambda.SNSMessageAttributes; /* API Gateway Event */ str = apiGwEvt.body; @@ -42,9 +48,36 @@ str = apiGwEvt.requestContext.resourceId; str = apiGwEvt.requestContext.resourcePath; str = apiGwEvt.resource; +/* SNS Event */ +snsEvtRecs = snsEvt.Records; + +str = snsEvtRec.EventSource; +str = snsEvtRec.EventSubscriptionArn; +str = snsEvtRec.EventVersion; +snsMsg = snsEvtRec.Sns; + +str = snsMsg.SignatureVersion; +str = snsMsg.Timestamp; +str = snsMsg.Signature; +str = snsMsg.SigningCertUrl; +str = snsMsg.MessageId; +str = snsMsg.Message; +snsMsgAttrs = snsMsg.MessageAttributes; +str = snsMsg.Type; +str = snsMsg.UnsubscribeUrl; +str = snsMsg.TopicArn; +str = snsMsg.Subject; + +snsMsgAttrs["example"] = snsMsgAttr; + +str = snsMsgAttr.Type; +str = snsMsgAttr.Value; + /* Lambda Proxy Result */ num = proxyResult.statusCode; -str = proxyResult.headers["example"]; +proxyResult.headers["example"] = str; +proxyResult.headers["example"] = b; +proxyResult.headers["example"] = num; str = proxyResult.body /* Context */ diff --git a/aws-lambda/index.d.ts b/aws-lambda/index.d.ts index e8b70db7bd..83579b4d0d 100644 --- a/aws-lambda/index.d.ts +++ b/aws-lambda/index.d.ts @@ -39,6 +39,41 @@ interface APIGatewayEvent { resource: string; } +// SNS "event" +interface SNSMessageAttribute { + Type: string; + Value: string; +} + +interface SNSMessageAttributes { + [name: string]: SNSMessageAttribute; +} + +interface SNSMessage { + SignatureVersion: string; + Timestamp: string; + Signature: string; + SigningCertUrl: string; + MessageId: string; + Message: string; + MessageAttributes: SNSMessageAttributes; + Type: string; + UnsubscribeUrl: string; + TopicArn: string; + Subject: string; +} + +interface SNSEventRecord { + EventVersion: string; + EventSubscriptionArn: string; + EventSource: string; + Sns: SNSMessage; +} + +interface SNSEvent { + Records: Array; +} + // Context // http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html interface Context { @@ -97,7 +132,7 @@ interface ClientContextEnv { interface ProxyResult { statusCode: number; headers?: { - [header: string]: string; + [header: string]: boolean | number | string; }, body: string; } @@ -110,8 +145,8 @@ interface ProxyResult { * @param context – runtime information of the Lambda function that is executing. * @param callback – optional callback to return information to the caller, otherwise return value is null. */ -export type Handler = (event: any, context: Context, callback?: Callback) => void; -export type ProxyHandler = (event: APIGatewayEvent, context: Context, callback?: ProxyCallback) => void; +export type Handler = (event: any, context: Context, callback?: Callback) => void; +export type ProxyHandler = (event: APIGatewayEvent, context: Context, callback?: ProxyCallback) => void; /** * Optional callback parameter. From ade29a018c3115f2898fbe643290cf958c9f6f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Marenco?= Date: Fri, 10 Mar 2017 17:46:52 -0500 Subject: [PATCH 091/276] Add customEditor property (#14857) Hi! I was having this issue while using the library: ``` ERROR in [at-loader] frontend/src/components/modals/Upload.tsx:538:40 TS2339: Property 'customEditor' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes>...'. ``` It seems it is missing from the Definition file, so I just added it :). Hope it helps! --- react-bootstrap-table/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/react-bootstrap-table/index.d.ts b/react-bootstrap-table/index.d.ts index 82384f0d9f..9adfacf8c8 100644 --- a/react-bootstrap-table/index.d.ts +++ b/react-bootstrap-table/index.d.ts @@ -475,6 +475,13 @@ export interface TableHeaderColumnProps extends Props { This function taking one arguments: order which present the sort order currently. */ caretRender?: Function; + /** + Give an Object like following to able to customize your own editing component. + This Object should contain these two property: + getElement(REQUIRED): Accept a callback function and take two arguments: onUpdate and props. + customEditorParameters: Another extra data for custom cell edit component. + */ + customEditor?: {getElement: (onUpdate: any, props: any) => ReactElement, customEditorParameters?: Object} ; /** To customize the column. This callback function should return a String or a React Component. In addition, this function taking two argument: cell and row. From 20b7ef9c56451b7acec11bb261e191a8e0777f8a Mon Sep 17 00:00:00 2001 From: Derek Finlinson Date: Fri, 10 Mar 2017 15:47:39 -0700 Subject: [PATCH 092/276] Add setVisible to iFrame control (#14855) --- xrm/index.d.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/xrm/index.d.ts b/xrm/index.d.ts index 02bce0468e..67c5a8e778 100644 --- a/xrm/index.d.ts +++ b/xrm/index.d.ts @@ -1188,6 +1188,19 @@ declare namespace Xrm getVisible(): boolean; } + /** + * Interface for UI elements which can have the visibility value updated. + */ + export interface UiCanSetVisibleElement + { + /** + * Sets the visibility state. + * + * @param {boolean} visible true to show, false to hide. + */ + setVisible( visible: boolean ): void; + } + /** * Base interface for standard UI elements. */ @@ -2522,7 +2535,7 @@ declare namespace Xrm * * @sa FramedControl */ - export interface IframeControl extends FramedControl + export interface IframeControl extends FramedControl, UiCanSetVisibleElement { /** * Gets initial URL defined for the Iframe. From 3cfb266458c7bc4d05625b436164915ed494dd64 Mon Sep 17 00:00:00 2001 From: Matej Matiasko Date: Fri, 10 Mar 2017 23:52:32 +0100 Subject: [PATCH 093/276] Make success callback possible - cors (#14849) --- cors/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cors/index.d.ts b/cors/index.d.ts index ecad80d187..6c1fc3e4c3 100644 --- a/cors/index.d.ts +++ b/cors/index.d.ts @@ -10,7 +10,7 @@ import express = require('express'); type CustomOrigin = ( requestOrigin: string, - callback: (err: Error, allow?: boolean) => void + callback: (err: Error | null, allow?: boolean) => void ) => void; declare namespace e { From e849164bf3f4dbb27abab3819bbc2490c8922407 Mon Sep 17 00:00:00 2001 From: Adrian Ehrsam Date: Fri, 10 Mar 2017 23:53:22 +0100 Subject: [PATCH 094/276] Adds typing for navigo (npm package) (#14848) * Added typings for navigo * add missing header --- navigo/index.d.ts | 49 ++++++++++++++++ navigo/navigo-tests.ts | 123 +++++++++++++++++++++++++++++++++++++++++ navigo/tsconfig.json | 22 ++++++++ navigo/tslint.json | 1 + 4 files changed, 195 insertions(+) create mode 100644 navigo/index.d.ts create mode 100644 navigo/navigo-tests.ts create mode 100644 navigo/tsconfig.json create mode 100644 navigo/tslint.json diff --git a/navigo/index.d.ts b/navigo/index.d.ts new file mode 100644 index 0000000000..35c9f009f6 --- /dev/null +++ b/navigo/index.d.ts @@ -0,0 +1,49 @@ +// Type definitions for navigo 4.0 +// Project: https://github.com/krasimir/navigo +// Definitions by: Adrian Ehrsam +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface NavigoHooks { + before?: ((done: (suppress?: boolean) => void) => void); + after?: () => void; +} +type RouteHandler = ((parametersObj: any, query: string) => void) | { as: string; uses: (parametersObj: any) => void }; + +declare class Navigo { + + /** + * Constructs the router + * @param root The main URL of your application. + * @param useHash If useHash set to true then the router uses an old routing approach with hash in the URL. Navigo anyways falls back to this mode if there is no History API supported. + */ + constructor(root?: string | null, useHash?: boolean); + + + on(location: string, handler: RouteHandler, hooks?: NavigoHooks): Navigo; + on(location: RegExp, handler: (...parameters: string[]) => void, hooks?: NavigoHooks): Navigo; + on(routes: { [key: string]: RouteHandler }): Navigo; + + on(rootHandler: RouteHandler, hooks?: NavigoHooks): Navigo; + + notFound(handler: ((query: string) => void), hooks?: NavigoHooks): void; + + navigate(path: string, absolute?: boolean): void; + + updatePageLinks(): void; + + generate(path: string, params?: any): string; + + resolve(currentURL?: string): boolean; + + link(path: string): string; + + disableIfAPINotAvailable(): void; + + pause(): void; + + resume(): void; + + destroy(): void; +} +export = Navigo; +export as namespace Navigo; \ No newline at end of file diff --git a/navigo/navigo-tests.ts b/navigo/navigo-tests.ts new file mode 100644 index 0000000000..73ea91f416 --- /dev/null +++ b/navigo/navigo-tests.ts @@ -0,0 +1,123 @@ +import Navigo = require("navigo"); + +var root = null; +var useHash = false; + +var router = new Navigo(root, useHash); + +router + .on('/products/list', () => { + // display all the products + }) + .resolve(); + +router + .on(() => { + // show home page here + }) + .resolve(); + +router + .on({ + '/products/list': () => { + // do something + }, + '/products': () => { + // do something + } + }) + .resolve(); + +router + .on({ + 'products/:id': () => { + // do something + }, + 'products': () => { + // do something + }, + '*': () => { + // do something + } + }) + .resolve(); + + +router + .on('/user/:id/:action', (params: { id: string; action: string }) => { + // If we have http://site.com/user/42/save as a url then + // params.id = 42 + // params.action = save + }) + .resolve(); + +router + .on('/user/:id/:action', (params: { id: string; action: string }, query: string) => { + // If we have http://site.com/user/42/save?answer=42 as a url then + // params.id = 42 + // params.action = save + // query = answer=42 + }) + .resolve(); + +router.notFound((query: string) => { + // ... +}); + +router + .on(/users\/(\d+)\/(\w+)\/?/, (id: string, action: string) => { + // If we have http://site.com/user/42/save as a url then + // id = 42 + // action = save + }) + .resolve(); + +router + .on('/user/*', () => { + // This function will be called on every + // URL that starts with /user + }) + .resolve(); + +router.notFound(() => { + // called when there is path specified but + // there is no route matching +}); + +router.navigate('/products/list'); + +router.navigate('http://site.com/products/list', true); + +router = new Navigo('http://site.com/', true); +var handler = () => { + // do something +}; +router.on({ + '/trip/:tripId/edit': { as: 'trip.edit', uses: handler }, + '/trip/save': { as: 'trip.save', uses: handler }, + '/trip/:action/:tripId': { as: 'trip.action', uses: handler } +}); +var a: string = (router.generate('trip.edit', { tripId: 42 })); // --> /trip/42/edit +a = (router.generate('trip.action', { tripId: 42, action: 'save' })); // --> /trip/save/42 +a = (router.generate('trip.save')); // --> /trip/save + +router.pause(); +router.navigate('/en/products'); +router.resume(); // or .pause(false) + +router.on( + '/user/edit', + () => { + // show user edit page + }, + { + before: (done) => { + // doing some async operation + done(false); + done(); + }, + after: () => { + // do something + } + } +); diff --git a/navigo/tsconfig.json b/navigo/tsconfig.json new file mode 100644 index 0000000000..18a90350c6 --- /dev/null +++ b/navigo/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "navigo-tests.ts" + ] +} \ No newline at end of file diff --git a/navigo/tslint.json b/navigo/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/navigo/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 0e2384e4d350a397fd56a43017578f0664818d3f Mon Sep 17 00:00:00 2001 From: Klaus Sevensleeper Date: Fri, 10 Mar 2017 23:53:54 +0100 Subject: [PATCH 095/276] support strictNullChecks (#14844) better reflect the documented and implemented API --- query-string/index.d.ts | 2 +- query-string/query-string-tests.ts | 2 +- query-string/tsconfig.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/query-string/index.d.ts b/query-string/index.d.ts index 9cd6d8df1e..dcc9bfafb5 100644 --- a/query-string/index.d.ts +++ b/query-string/index.d.ts @@ -13,7 +13,7 @@ declare module "query-string" { * Leading ? or # are ignored, so you can pass location.search or location.hash directly. * @param str */ - export function parse(str: string): { [key: string]: string | string[] }; + export function parse(str: string): { [key: string]: string | string[] | null }; /** * Stringify an object into a query string, sorting the keys. diff --git a/query-string/query-string-tests.ts b/query-string/query-string-tests.ts index c39c2f4982..c5ec7b624d 100644 --- a/query-string/query-string-tests.ts +++ b/query-string/query-string-tests.ts @@ -21,7 +21,7 @@ namespace stringify_tests { } namespace parse_tests { - let result: { [key: string]: string | string[] }; + let result: { [key: string]: string | string[] | null }; result = qs.parse('?foo=bar'); result = qs.parse('#foo=bar'); result = qs.parse('&foo=bar&foo=baz'); diff --git a/query-string/tsconfig.json b/query-string/tsconfig.json index c0a4860fb8..3dd890dac3 100644 --- a/query-string/tsconfig.json +++ b/query-string/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" From 82bfe951e14affdf3adb685d55e37f542fa16841 Mon Sep 17 00:00:00 2001 From: Iain McGinniss Date: Fri, 10 Mar 2017 14:56:19 -0800 Subject: [PATCH 096/276] Fix definition to be compatible with TS 2.2 (#14837) TS 2.2 provides definitions for the fetch API directly in the dom library, and those definitions are slightly different from those that were provided in @types/whatwg-fetch. This change updates the webappsec-credential-management definitions to be compatible with TS 2.2, and drops the dependency on @types/whatwg-fetch. --- webappsec-credential-management/index.d.ts | 228 ++++++++++++++++----- 1 file changed, 172 insertions(+), 56 deletions(-) diff --git a/webappsec-credential-management/index.d.ts b/webappsec-credential-management/index.d.ts index 0c1c2b5e2d..491efb3829 100644 --- a/webappsec-credential-management/index.d.ts +++ b/webappsec-credential-management/index.d.ts @@ -1,10 +1,150 @@ -// Type definitions for W3C (WebAppSec) Credential Management API, Level 1, 0.0 +// Type definitions for W3C (WebAppSec) Credential Management API Level 1, 0.1 // Project: https://github.com/w3c/webappsec-credential-management // Definitions by: Iain McGinniss // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + // Spec: http://www.w3.org/TR/2016/WD-credential-management-1-20160425/ -/// +/* ************************ FETCH API DEFINITIONS ****************************** + * TS 2.2 introduced definitions for the fetch API in the dom library, but + * prior to that it was necessary to use the types defined in + * @types/whatwg-fetch. In order to support all versions of TS 2.x, the + * definitions for fetch from TS 2.2 dom are duplicated here. As long as these + * remain identical to the definitions in dom 2.2+, they cause no issues. + * + * One caveat to "identical" here is that type definitions cannot be duplicated, + * and so the "RequestInfo" type has been substituted for its expansion in + * the below definitions: + * + * type RequestInfo = Request|string; + * ************************************************************************** */ + +interface Request extends Object, Body { + readonly cache: string; + readonly credentials: string; + readonly destination: string; + readonly headers: Headers; + readonly integrity: string; + readonly keepalive: boolean; + readonly method: string; + readonly mode: string; + readonly redirect: string; + readonly referrer: string; + readonly referrerPolicy: string; + readonly type: string; + readonly url: string; + clone(): Request; +} + +declare var Request: { + prototype: Request; + new(input: Request | string, init?: RequestInit): Request; +}; + +interface Headers { + append(name: string, value: string): void; + delete(name: string): void; + forEach(callback: ForEachCallback): void; + get(name: string): string | null; + has(name: string): boolean; + set(name: string, value: string): void; +} + +declare var Headers: { + prototype: Headers; + new(init?: any): Headers; +}; + +interface Response extends Object, Body { + readonly body: ReadableStream | null; + readonly headers: Headers; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly type: string; + readonly url: string; + clone(): Response; +} + +declare var Response: { + prototype: Response; + new(body?: any, init?: ResponseInit): Response; +}; + +interface ResponseInit { + status?: number; + statusText?: string; + headers?: any; +} + +interface ReadableStream { + readonly locked: boolean; + cancel(): Promise; + getReader(): ReadableStreamReader; +} + +declare var ReadableStream: { + prototype: ReadableStream; + new(): ReadableStream; +}; + +interface ReadableStreamReader { + cancel(): Promise; + read(): Promise; + releaseLock(): void; +} + +declare var ReadableStreamReader: { + prototype: ReadableStreamReader; + new(): ReadableStreamReader; +}; + +interface Body { + readonly bodyUsed: boolean; + arrayBuffer(): Promise; + blob(): Promise; + json(): Promise; + text(): Promise; +} + +interface URLSearchParams { + /** + * Appends a specified key/value pair as a new search parameter. + */ + append(name: string, value: string): void; + /** + * Deletes the given search parameter, and its associated value, from the list of all search parameters. + */ + delete(name: string): void; + /** + * Returns the first value associated to the given search parameter. + */ + get(name: string): string | null; + /** + * Returns all the values association with a given search parameter. + */ + getAll(name: string): string[]; + /** + * Returns a Boolean indicating if such a search parameter exists. + */ + has(name: string): boolean; + /** + * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others. + */ + set(name: string, value: string): void; +} + +declare var URLSearchParams: { + prototype: URLSearchParams; + /** + * Constructor returning a URLSearchParams object. + */ + new (init?: string | URLSearchParams): URLSearchParams; +}; + +interface GlobalFetch { + fetch(input: Request|string, init?: RequestInit): Promise; +} /* ************************* FETCH MODIFICATIONS ******************************* * The credential management spec modifies fetch(), by adding a new @@ -16,78 +156,54 @@ * See: https://www.w3.org/TR/credential-management-1/#monkey-patching * ************************************************************************** */ -interface Window { - fetch(url: CMRequestInfo, init?: CMRequestInit): Promise; -} +declare function fetch( + input: Request|string, + init?: RequestInit|CMRequestInit): + Promise; -type CMRequestInfo = CMRequest|string; +interface GlobalFetch { + // variant for navigator.credentials monkey patching + fetch(url: Request|string, init?: CMRequestInit): Promise; +} /** - * Variant of {@link Request} that permits a {@code 'password'} value in the - * {@code credentials} property. + * Original definition from TS 2.2 dom. */ -interface CMRequest extends Body { - // the only modified property from RequestCredentials: - credentials: CMRequestCredentials; - - method: string; - url: string; - headers: Headers; - - type: RequestType; - destination: RequestDestination; - referrer: string; - referrerPolicy: ReferrerPolicy; - mode: RequestMode; - - cache: RequestCache; - redirect: RequestRedirect; - integrity: string; - - clone(): Request; +interface RequestInit { + method?: string; + headers?: any; + body?: any; + referrer?: string; + referrerPolicy?: string; + mode?: string; + credentials?: string; + cache?: string; + redirect?: string; + integrity?: string; + keepalive?: boolean; + window?: any; } -type CMRequestCredentials = RequestCredentials|'password'; - /** * Variant of {@link RequestInit} that permits a {@link PasswordCredential} to * be used in the {@code credentials} property. All other properties are * identical to {@link RequestInit}. */ interface CMRequestInit { - credentials?: PasswordCredential|CMRequestCredentials; - method?: string; - headers?: HeadersInit; - body?: BodyInit; + headers?: any; + body?: any; referrer?: string; - referrerPolicy?: ReferrerPolicy; - mode?: RequestMode; - - cache?: RequestCache; - redirect?: RequestRedirect; + referrerPolicy?: string; + mode?: string; + credentials?: PasswordCredential|string; + cache?: string; + redirect?: string; integrity?: string; + keepalive?: boolean; window?: any; } -/** - * URLSearchParams is not yet included in the core lib.d.ts declarations, so we - * include it here. - * The official definition should be included in TypeScript 2.2, at which point - * this can be removed. - * - * @see {@link https://github.com/Microsoft/TypeScript/issues/12517} - */ -declare class URLSearchParams { - constructor(init?: string|URLSearchParams); - append(name: string, value: string): void; - delete(name: string): void; - get(name: string): string|null; - getAll(name: string): string[]; - has(name: string): boolean; - set(name: string, value: string): void; -} - /* ***************** CREDENTIAL MANAGEMENT API DEFINITONS ******************* */ /** From a871ef4a1053ebd54b39c9924598d5dc54ff3710 Mon Sep 17 00:00:00 2001 From: mleko Date: Sat, 11 Mar 2017 00:01:02 +0100 Subject: [PATCH 097/276] Add qrcode.react definition (#14833) * Add qrcode.react definition * Remove patch version * Update to comply with contribution rules --- qrcode.react/index.d.ts | 22 ++++++++++++++++++++++ qrcode.react/qrcode.react-tests.tsx | 12 ++++++++++++ qrcode.react/tsconfig.json | 24 ++++++++++++++++++++++++ qrcode.react/tslint.json | 1 + 4 files changed, 59 insertions(+) create mode 100644 qrcode.react/index.d.ts create mode 100644 qrcode.react/qrcode.react-tests.tsx create mode 100644 qrcode.react/tsconfig.json create mode 100644 qrcode.react/tslint.json diff --git a/qrcode.react/index.d.ts b/qrcode.react/index.d.ts new file mode 100644 index 0000000000..c7a6b85d72 --- /dev/null +++ b/qrcode.react/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for qrcode.react 0.6 +// Project: https://github.com/zpao/qrcode.react +// Definitions by: Mleko +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +declare namespace qrcode { + export interface QRCodeProps { + value: string; + size?: number; + bgColor?: string; + fgColor?: string; + level?: "L"|"M"|"Q"|"H"; + } + + export type QRCode = React.ComponentClass; +} + +declare const qrcode: qrcode.QRCode; +export = qrcode; diff --git a/qrcode.react/qrcode.react-tests.tsx b/qrcode.react/qrcode.react-tests.tsx new file mode 100644 index 0000000000..ffae551b01 --- /dev/null +++ b/qrcode.react/qrcode.react-tests.tsx @@ -0,0 +1,12 @@ +import * as QRCode from "qrcode.react"; +import * as React from "react"; + +const qrcodes = [ + , + , + , + , + , + , + , +]; diff --git a/qrcode.react/tsconfig.json b/qrcode.react/tsconfig.json new file mode 100644 index 0000000000..c9938f0730 --- /dev/null +++ b/qrcode.react/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "qrcode.react-tests.tsx" + ] +} diff --git a/qrcode.react/tslint.json b/qrcode.react/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/qrcode.react/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From fd21da7d92a8b4f873ba000b2d566c712243198e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Menezes?= Date: Fri, 10 Mar 2017 20:02:04 -0300 Subject: [PATCH 098/276] Add gulp-batch declaration files (#14832) --- gulp-batch/gulp-batch-tests.ts | 8 ++++++++ gulp-batch/index.d.ts | 8 ++++++++ gulp-batch/tsconfig.json | 22 ++++++++++++++++++++++ gulp-batch/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 gulp-batch/gulp-batch-tests.ts create mode 100644 gulp-batch/index.d.ts create mode 100644 gulp-batch/tsconfig.json create mode 100644 gulp-batch/tslint.json diff --git a/gulp-batch/gulp-batch-tests.ts b/gulp-batch/gulp-batch-tests.ts new file mode 100644 index 0000000000..a1e305c03b --- /dev/null +++ b/gulp-batch/gulp-batch-tests.ts @@ -0,0 +1,8 @@ +import * as gulp from "gulp"; +import * as batch from "gulp-batch"; + +gulp.task('default', function() { + gulp.watch([ 'lib/**', 'test/**' ], batch((events: any, cb: any) => { + events.on('data', console.log).on('end', cb); + })); +}); diff --git a/gulp-batch/index.d.ts b/gulp-batch/index.d.ts new file mode 100644 index 0000000000..a3be8e252e --- /dev/null +++ b/gulp-batch/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for gulp-batch 1.0 +// Project: https://github.com/floatdrop/gulp-batch +// Definitions by: Alvaro Menezes , Vinicius Salomao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function batch(opts?: any, cb?: any, errorHandler?: any): (event: any) => void; +declare namespace batch { } +export = batch; diff --git a/gulp-batch/tsconfig.json b/gulp-batch/tsconfig.json new file mode 100644 index 0000000000..eb09ea4f9c --- /dev/null +++ b/gulp-batch/tsconfig.json @@ -0,0 +1,22 @@ +{ + "files": [ + "index.d.ts", + "gulp-batch-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} \ No newline at end of file diff --git a/gulp-batch/tslint.json b/gulp-batch/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/gulp-batch/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 12b1792ca088d1bcdd912988b88f552614005931 Mon Sep 17 00:00:00 2001 From: thisboyiscrazy Date: Fri, 10 Mar 2017 18:03:15 -0500 Subject: [PATCH 099/276] nedb-logger (#14826) * nedb-logger * nedb-logger --- nedb-logger/index.d.ts | 20 ++++++++++ nedb-logger/nedb-logger-tests.ts | 64 ++++++++++++++++++++++++++++++++ nedb-logger/tsconfig.json | 22 +++++++++++ nedb-logger/tslint.json | 1 + 4 files changed, 107 insertions(+) create mode 100644 nedb-logger/index.d.ts create mode 100644 nedb-logger/nedb-logger-tests.ts create mode 100644 nedb-logger/tsconfig.json create mode 100644 nedb-logger/tslint.json diff --git a/nedb-logger/index.d.ts b/nedb-logger/index.d.ts new file mode 100644 index 0000000000..4c47ee0dad --- /dev/null +++ b/nedb-logger/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for NeDB Logger 1.8 +// Project: https://github.com/louischatriot/nedb-logger +// Definitions by: Joe vanderstelt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = NeDBLoggerDataStore; +export as namespace NedbLogger; + +declare namespace NeDBLoggerDataStore { } +declare class NeDBLoggerDataStore { + + constructor(path?: string | {filename: string}); + + /** + * Insert a new document + * @param {Function} cb Optional callback, signature: err, insertedDoc + */ + insert(newDoc: T, cb?: (err: Error, document: T) => void): void; + +} diff --git a/nedb-logger/nedb-logger-tests.ts b/nedb-logger/nedb-logger-tests.ts new file mode 100644 index 0000000000..b6665ad44d --- /dev/null +++ b/nedb-logger/nedb-logger-tests.ts @@ -0,0 +1,64 @@ +/** + * Created by Joe Vanderstelt 2017-02-22. + */ + +/// + + +import * as es6styleimport from 'nedb-logger'; + +import Q = require('q'); +import nedblogger = require('nedb-logger'); + +class BaseCollection { + + private dataStore: nedblogger; + + constructor(dataStore: nedblogger) { + + this.dataStore = dataStore; + } + + insert(document: T): Q.Promise { + + var deferred = Q.defer(); + + this.dataStore.insert(document, function(err: Error, newDoc: T) { // Callback is optional + // newDoc is the newly inserted document, including its _id + if (err) { + deferred.reject(err); + } else { + deferred.resolve(newDoc); + } + }); + + return deferred.promise; + } + +} + +// Type 1: Persistent datastore with manual loading + +import Datastore = require('nedb-logger'); +var db = new Datastore({filename: 'path/to/datafile'}); + +var doc: any = { + hello: 'world' + , n: 5 + , today: new Date() + , nedbIsAwesome: true + , notthere: null + , notToBeSaved: undefined // Will not be saved + , fruits: ['apple', 'orange', 'pear'] + , infos: {name: 'nedb'} +}; + +db.insert(doc, function(err: Error, newDoc: any) { // Callback is optional + // newDoc is the newly inserted document, including its _id + // newDoc has no key called notToBeSaved since its value was undefined +}); + +db.insert([{a: 5}, {a: 42}], function(err: Error, newdocs: any[]) { + // Two documents were inserted in the database + // newDocs is an array with these documents, augmented with their _id +}); diff --git a/nedb-logger/tsconfig.json b/nedb-logger/tsconfig.json new file mode 100644 index 0000000000..917e72a038 --- /dev/null +++ b/nedb-logger/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "nedb-logger-tests.ts" + ] +} \ No newline at end of file diff --git a/nedb-logger/tslint.json b/nedb-logger/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/nedb-logger/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file From 75ffb8e47dfe51b8d4c1c33410e542f433c557c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksandar=20Rodi=C4=87?= Date: Sat, 11 Mar 2017 00:09:55 +0100 Subject: [PATCH 100/276] Changing 'scope' definition (#14810) current definition ```ts scope(options?: string | string[] | ScopeOptions | WhereOptions): this; ``` doesn't allow are valid calls. example from [documentation](http://docs.sequelizejs.com/en/latest/docs/scopes/): ```ts Project.scope('random', { method: ['accessLevel', 19]}).findAll(); ``` changing it to ```ts scope(options?: string | ScopeOptions | WhereOptions | Array): this; ``` should fix the issue since, according to the docs ```ts // These two are equivalent Project.scope('deleted', 'activeUsers').findAll(); Project.scope(['deleted', 'activeUsers']).findAll(); ``` --- sequelize/index.d.ts | 2 +- sequelize/sequelize-tests.ts | 5 ++++- sequelize/v3/index.d.ts | 2 +- sequelize/v3/sequelize-tests.ts | 5 ++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sequelize/index.d.ts b/sequelize/index.d.ts index ec41863261..c3dd68ec98 100644 --- a/sequelize/index.d.ts +++ b/sequelize/index.d.ts @@ -3671,7 +3671,7 @@ declare namespace sequelize { * @return Model A reference to the model, with the scope(s) applied. Calling scope again on the returned * model will clear the previous scope. */ - scope(options?: string | string[] | ScopeOptions | WhereOptions): this; + scope(options?: string | ScopeOptions | WhereOptions | Array): this; /** * Search for multiple instances. diff --git a/sequelize/sequelize-tests.ts b/sequelize/sequelize-tests.ts index 71e6203a82..ceff709a6b 100644 --- a/sequelize/sequelize-tests.ts +++ b/sequelize/sequelize-tests.ts @@ -853,11 +853,14 @@ User.schema( 'special' ).create( { age : 3 }, { logging : function( ) {} } ); User.getTableName(); User.addScope('lowAccess', { where : { parent_id : 2 } }); -User.addScope('lowAccess', function() { } ); User.addScope('lowAccess', { where : { parent_id : 2 } }, { override: true }); +User.addScope('lowAccessWithParam', function(id: number) { + return { where : { parent_id : id } } +} ); User.scope( 'lowAccess' ).count(); User.scope( { where : { parent_id : 2 } } ); +User.scope( [ 'lowAccess', { method: ['lowAccessWithParam', 2] }, { where : { parent_id : 2 } } ] ) User.findAll(); User.findAll( { where : { data : { employment : null } } } ); diff --git a/sequelize/v3/index.d.ts b/sequelize/v3/index.d.ts index fb73cd94bf..edb1bb2a6d 100644 --- a/sequelize/v3/index.d.ts +++ b/sequelize/v3/index.d.ts @@ -3648,7 +3648,7 @@ declare namespace sequelize { * @return Model A reference to the model, with the scope(s) applied. Calling scope again on the returned * model will clear the previous scope. */ - scope(options?: string | string[] | ScopeOptions | WhereOptions): this; + scope(options?: string | ScopeOptions | WhereOptions | Array): this; /** * Search for multiple instances. diff --git a/sequelize/v3/sequelize-tests.ts b/sequelize/v3/sequelize-tests.ts index ef90600e91..83c4536a71 100644 --- a/sequelize/v3/sequelize-tests.ts +++ b/sequelize/v3/sequelize-tests.ts @@ -840,11 +840,14 @@ User.schema( 'special' ).create( { age : 3 }, { logging : function( ) {} } ); User.getTableName(); User.addScope('lowAccess', { where : { parent_id : 2 } }); -User.addScope('lowAccess', function() { } ); User.addScope('lowAccess', { where : { parent_id : 2 } }, { override: true }); +User.addScope('lowAccessWithParam', function(id: number) { + return { where : { parent_id : id } } +} ); User.scope( 'lowAccess' ).count(); User.scope( { where : { parent_id : 2 } } ); +User.scope( [ 'lowAccess', { method: ['lowAccessWithParam', 2] }, { where : { parent_id : 2 } } ] ) User.findAll(); User.findAll( { where : { data : { employment : null } } } ); From a43da75444d2aae17adabcfc6c8809586afcb658 Mon Sep 17 00:00:00 2001 From: Chet Husk Date: Fri, 10 Mar 2017 17:17:36 -0600 Subject: [PATCH 101/276] allow numbers as the right hand side of a join equality (#14823) --- knex/index.d.ts | 2 +- knex/knex-tests.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/knex/index.d.ts b/knex/index.d.ts index 0627498962..660a8dfcb2 100644 --- a/knex/index.d.ts +++ b/knex/index.d.ts @@ -165,7 +165,7 @@ declare namespace Knex { interface Join { (raw: Raw): QueryBuilder; - (tableName: string, columns: { [key: string]: string | Raw }): QueryBuilder; + (tableName: string, columns: { [key: string]: string | number | Raw }): QueryBuilder; (tableName: string, callback: Function): QueryBuilder; (tableName: TableName, raw: Raw): QueryBuilder; (tableName: TableName, column1: string, column2: string): QueryBuilder; diff --git a/knex/knex-tests.ts b/knex/knex-tests.ts index 420aafd724..3d02a7924b 100644 --- a/knex/knex-tests.ts +++ b/knex/knex-tests.ts @@ -188,6 +188,10 @@ knex('users') .join('contacts', 'users.id', '=', 'contacts.user_id') .select('users.id', 'contacts.phone'); +knex('users') + .join('contacts', { 'users.id': 12355 }) + .select('users.id', 'contacts.phone'); + knex('users') .join('contacts', 'users.id', 'contacts.user_id') .select('users.id', 'contacts.phone'); From 253d42273d6d5d1bbf35c020f7dc05d1ce6cdd0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alu=C3=ADsio=20Augusto=20Silva=20Gon=C3=A7alves?= Date: Fri, 10 Mar 2017 20:18:53 -0300 Subject: [PATCH 102/276] Add type definitions for 'printf' (#14821) * Add definitions for 'printf' * Add "lib" to tsconfig.json * Fix link --- printf/index.d.ts | 10 ++++++++++ printf/printf-tests.ts | 9 +++++++++ printf/tsconfig.json | 22 ++++++++++++++++++++++ printf/tslint.json | 1 + 4 files changed, 42 insertions(+) create mode 100644 printf/index.d.ts create mode 100644 printf/printf-tests.ts create mode 100644 printf/tsconfig.json create mode 100644 printf/tslint.json diff --git a/printf/index.d.ts b/printf/index.d.ts new file mode 100644 index 0000000000..e136eed929 --- /dev/null +++ b/printf/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for printf 0.2 +// Project: https://github.com/adaltas/node-printf +// Definitions by: Aluísio Augusto Silva Gonçalves +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export = printf; +declare function printf(format: string, ...args: any[]): string; +declare function printf(writeStream: NodeJS.WritableStream, format: string, ...args: any[]): void; diff --git a/printf/printf-tests.ts b/printf/printf-tests.ts new file mode 100644 index 0000000000..d116d45f76 --- /dev/null +++ b/printf/printf-tests.ts @@ -0,0 +1,9 @@ +import printf = require("printf"); + +printf('%c', 0x7f).charCodeAt(0); +printf('%2$s: %1$O', {hello: 'Node'}, 'Test'); +printf('%(temperature)s %(crevace)ss', { + temperature: 'Hot', + crevace: 'Pocket', +}); +printf(process.stdout, '%2$s: %1$O', {hello: 'Node'}, 'Test'); diff --git a/printf/tsconfig.json b/printf/tsconfig.json new file mode 100644 index 0000000000..e937977428 --- /dev/null +++ b/printf/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "printf-tests.ts" + ] +} diff --git a/printf/tslint.json b/printf/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/printf/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From f38e6124589657e0f50a93f292d142a81c392d75 Mon Sep 17 00:00:00 2001 From: Aluan Haddad Date: Fri, 10 Mar 2017 18:25:58 -0500 Subject: [PATCH 103/276] =?UTF-8?q?SystemJS:=20refined=20typeof=20'transpi?= =?UTF-8?q?ler'=20option,=20added=20plugin-typescript=20specific=20?= =?UTF-8?q?=E2=80=A6=20(#14801)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * SystemJS: refined typeof 'transpiler' option, added plugin-typescript specific flags to typescriptOptions Refined typeof 'transpiler' option to only allow `false` as opposed to `boolean`. Added the `typescriptOptions` properties that are specific to plugin-typescript to typescriptOptions object. * lint and fix warnings --- systemjs/index.d.ts | 56 ++++++++++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/systemjs/index.d.ts b/systemjs/index.d.ts index 876e4fdb4d..cf37862975 100644 --- a/systemjs/index.d.ts +++ b/systemjs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for SystemJS 0.20.5 +// Type definitions for SystemJS 0.20 // Project: https://github.com/systemjs/systemjs // Definitions by: Ludovic HENIN , Nathan Walker , Giedrius Grabauskas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,9 +6,13 @@ declare namespace SystemJSLoader { - type ModulesList = { [bundleName: string]: Array }; + interface ModulesList { + [bundleName: string]: string[]; + } - type PackageList = { [packageName: string]: T }; + interface PackageList { + [packageName: string]: T; + } /** * The following module formats are supported: @@ -27,7 +31,7 @@ declare namespace SystemJSLoader { * Represents a module name for System.import that must resolve to either Traceur, Babel or TypeScript. * When set to traceur, babel or typescript, loading will be automatically configured as far as possible. */ - type Transpiler = "plugin-traceur" | "plugin-babel" | "plugin-typescript" | "traceur" | "babel" | "typescript" | boolean; + type Transpiler = "plugin-traceur" | "plugin-babel" | "plugin-typescript" | "traceur" | "babel" | "typescript" | false; type ConfigMap = PackageList>; @@ -49,7 +53,7 @@ declare namespace SystemJSLoader { * Dependencies to load before this module. Goes through regular paths and map normalization. * Only supported for the cjs, amd and global formats. */ - deps?: Array; + deps?: string[]; /** * A map of global names to module names that should be defined only for the execution of this module. @@ -225,13 +229,29 @@ declare namespace SystemJSLoader { * Sets the TypeScript transpiler options. */ //TODO: Import Typescript.CompilerOptions - typescriptOptions?: any; + typescriptOptions?: { + /** + * A boolean flag which instructs the plugin to load configuration from "tsconfig.json". + * To override the location of the file set this option to the path of the configuration file, + * which will be resolved using normal SystemJS resolution. + * Note: This setting is specific to plugin-typescript. + */ + tsconfig?: boolean | string, + /** + * A flag which controls whether the files are type-checked or simply transpiled. + * Set this option to "strict" to have the builds fail when compiler errors are encountered. + * Note: The strict option only affects builds and bundles via the SystemJS or JSPM Builder. + * Note: This setting is specific to plugin-typescript. + */ + typeCheck?: boolean | "strict", + [key: string]: any + }; } interface SystemJSSystemFields { env: string; loaderErrorStack: boolean; - packageConfigPaths: Array; + packageConfigPaths: string[]; pluginFirst: boolean; version: string; warnings: boolean; @@ -241,12 +261,12 @@ declare namespace SystemJSLoader { /** * For backwards-compatibility with AMD environments, set window.define = System.amdDefine. */ - amdDefine: Function; + amdDefine: (...args: any[]) => void; /** * For backwards-compatibility with AMD environments, set window.require = System.amdRequire. */ - amdRequire: Function; + amdRequire: (deps: string[], callback: (...modules: any[]) => void) => void; /** * SystemJS configuration helper function. @@ -257,7 +277,7 @@ declare namespace SystemJSLoader { /** * This represents the System base class, which can be extended or reinstantiated to create a custom System instance. */ - constructor: new() => System; + constructor: new () => System; /** * Deletes a module from the registry by normalized name. @@ -273,7 +293,7 @@ declare namespace SystemJSLoader { /** * Returns a clone of the internal SystemJS configuration in use. */ - getConfig(): Config + getConfig(): Config; /** * Returns whether a given module exists in the registry by normalized module name. @@ -303,15 +323,15 @@ declare namespace SystemJSLoader { /** * Declaration function for defining modules of the System.register polyfill module format. */ - register(name: string, deps: Array, declare: Function): void; - register(deps: Array, declare: Function): void; + register(name: string, deps: string[], declare: (...modules: any[]) => any): void; + register(deps: string[], declare: (...modules: any[]) => any): void; /** * Companion module format to System.register for non-ES6 modules. * Provides a