From 246ddd52cff782412a25a597029099e53e1fdf43 Mon Sep 17 00:00:00 2001 From: David Philipson Date: Mon, 19 Jun 2017 12:02:45 -0700 Subject: [PATCH 01/55] Fixes to transducers-js types * Remove unnecessary type parameters * Update transduce() and reduce() to accept CompletingTransformers * Fix incorrect definition of transduce() * Fix incorrect definition of reduce() * Fix incorrect definition of completing() * Fix incorrect definition of wrap() * Fix incorrect definition of cat() * Fix overly strict definition of mapcat() * Make into() definition precise with overloads * Use es6 Iterables. * More precise typings for object iteration in reduce(), transduce(), and into() --- types/transducers-js/index.d.ts | 128 +++++++++++++------ types/transducers-js/transducers-js-tests.ts | 48 +++++++ 2 files changed, 137 insertions(+), 39 deletions(-) diff --git a/types/transducers-js/index.d.ts b/types/transducers-js/index.d.ts index cfed8fbbbe..3d9c6f7719 100644 --- a/types/transducers-js/index.d.ts +++ b/types/transducers-js/index.d.ts @@ -1,19 +1,9 @@ // Type definitions for transducers-js 0.4 // Project: https://github.com/cognitect-labs/transducers-js // Definitions by: Colin Kahn +// David Philipson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export interface IteratorResult { - done: boolean; - value?: T; -} - -export interface Iterator { - next(value?: any): IteratorResult; - return?(value?: any): IteratorResult; - throw?(e?: any): IteratorResult; -} - export interface Reduced { ['@@transducer/reduced']: boolean; ['@@transducer/value']: TResult; @@ -21,7 +11,7 @@ export interface Reduced { export type Reducer = (result: TResult, input: TInput) => TResult; -export type Transducer = (xf: Transformer) => Transformer; +export type Transducer = (xf: Transformer) => Transformer; export interface CompletingTransformer { ['@@transducer/init'](): TResult | void; @@ -66,7 +56,7 @@ export class Map implements Transformer(f: (x: TInput) => TOutput): Transducer; +export function map(f: (x: TInput) => TOutput): Transducer; export class Filter implements Transformer { constructor(pred: (x: TInput) => boolean, xf: Transformer); @@ -78,13 +68,13 @@ export class Filter implements Transformer { /** * Filtering transducer constructor */ -export function filter(pred: (x: TInput) => boolean): Transducer; +export function filter(pred: (x: TInput) => boolean): Transducer; /** * Similar to filter except the predicate is used to * eliminate values. */ -export function remove(pred: (x: TInput) => boolean): Transducer; +export function remove(pred: (x: TInput) => boolean): Transducer; export class Keep implements Transformer { constructor(f: (x: TInput) => any, xf: Transformer); @@ -97,7 +87,7 @@ export class Keep implements Transformer { * A keeping transducer. Keep inputs as long as the provided * function does not return null or undefined. */ -export function keep(f: (x: TInput) => any): Transducer; +export function keep(f: (x: TInput) => any): Transducer; export class KeepIndexed implements Transformer { constructor(f: (i: number, x: TInput) => any, xf: Transformer); @@ -110,7 +100,7 @@ export class KeepIndexed implements Transformer(f: (i: number, x: TInput) => any): Transducer; +export function keepIndexed(f: (i: number, x: TInput) => any): Transducer; export class Take implements Transformer { constructor(n: number, xf: Transformer); @@ -123,7 +113,7 @@ export class Take implements Transformer { * A take transducer constructor. Will take n values before * returning a reduced result. */ -export function take(n: number): Transducer; +export function take(n: number): Transducer; export class TakeWhile implements Transformer { constructor(pred: (n: TInput) => boolean, xf: Transformer); @@ -136,7 +126,7 @@ export class TakeWhile implements Transformer * Like the take transducer except takes as long as the pred * return true for inputs. */ -export function takeWhile(pred: (n: TInput) => boolean): Transducer; +export function takeWhile(pred: (n: TInput) => boolean): Transducer; export class TakeNth implements Transformer { constructor(n: number, xf: Transformer); @@ -148,7 +138,7 @@ export class TakeNth implements Transformer { /** * A transducer that takes every Nth input */ -export function takeNth(n: number): Transducer; +export function takeNth(n: number): Transducer; export class Drop implements Transformer { constructor(n: number, xf: Transformer); @@ -160,7 +150,7 @@ export class Drop implements Transformer { /** * A dropping transducer constructor */ -export function drop(n: number): Transducer; +export function drop(n: number): Transducer; export class DropWhile implements Transformer { constructor(pred: (input: TInput) => boolean, xf: Transformer); @@ -173,7 +163,7 @@ export class DropWhile implements Transformer * A dropping transducer that drop inputs as long as * pred is true. */ -export function dropWhile(pred: (input: TInput) => boolean): Transducer; +export function dropWhile(pred: (input: TInput) => boolean): Transducer; export class PartitionBy implements Transformer { constructor(f: (input: TInput) => any, xf: Transformer); @@ -187,7 +177,7 @@ export class PartitionBy implements Transformer(f: (input: TInput) => any): Transducer; +export function partitionBy(f: (input: TInput) => any): Transducer; export class PartitionAll implements Transformer { constructor(n: number, xf: Transformer); @@ -200,7 +190,7 @@ export class PartitionAll implements Transformer(n: number): Transducer; +export function partitionAll(n: number): Transducer; export class Completing implements CompletingTransformer { constructor(cf: (result: TResult) => TCompleteResult, xf: Transformer); @@ -213,7 +203,9 @@ export class Completing implements CompletingT * A completing transducer constructor. Useful to provide cleanup * logic at the end of a reduction/transduction. */ -export function completing(cf: (result: TResult) => TCompleteResult): CompletingTransformer; +export function completing( + xf: Transformer | Reducer, + cf: (result: TResult) => TCompleteResult): CompletingTransformer; export class Wrap implements Transformer { constructor(stepFn: Reducer, xf: Transformer); @@ -227,44 +219,102 @@ export class Wrap implements Transformer { * accumluation and the second argument is the next input and convert * it into a transducer transformer object. */ -export function wrap(stepFn: Reducer): Transducer; +export function wrap(stepFn: Reducer): Transformer; /** * Given a transformer return a concatenating transformer */ -export function cat(xf: Transformer): Transformer ; +export function cat(xf: Transformer): Transformer>; /** * A mapping concatenating transformer */ -export function mapcat(f: (arr: TInput[]) => TOutput[]): Transducer; +export function mapcat(f: (arr: TInput) => Iterable): Transducer; /** * Given a transducer, a builder function, an initial value * and a iterable collection - returns the reduction. */ export function transduce( - xf: Transducer, - f: Transformer | Reducer, + xf: Transducer, + f: Reducer, init: TResult, - coll: TInput[] | Iterator | string | Object): TResult; + coll: Iterable): TResult; +export function transduce( + xf: Transducer, + f: CompletingTransformer, + init: TResult, + coll: Iterable): TCompleteResult; +export function transduce( + xf: Transducer, + f: CompletingTransformer, + coll: Iterable): TCompleteResult; +// Overloads for object iteration. +export function transduce( + xf: Transducer<[string, TInput], TOutput>, + f: Reducer, + init: TResult, + coll: { [key: string]: TInput }): TResult; +export function transduce( + xf: Transducer<[string, TInput], TOutput>, + f: CompletingTransformer, + init: TResult, + coll: { [key: string]: TInput }): TCompleteResult; +export function transduce( + xf: Transducer<[string, TInput], TOutput>, + f: CompletingTransformer, + coll: { [key: string]: TInput }): TCompleteResult; /** * Given a transducer, an intial value and a * collection - returns the reduction. */ -export function reduce( - xf: Transducer, +export function reduce( + xf: Transformer | Reducer, init: TResult, - coll: TInput[] | Iterator | string | Object): TResult; + coll: Iterable): TResult; +export function reduce( + xf: CompletingTransformer, + init: TResult, + coll: Iterable): TCompleteResult; +// Overloads for object iteration. +export function reduce( + xf: Transformer | Reducer, + init: TResult, + coll: { [key: string]: TInput }): TResult; +export function reduce( + xf: CompletingTransformer, + init: TResult, + coll: { [key: string]: TInput }): TCompleteResult; /** * Reduce a value into the given empty value using a transducer. */ -export function into( - empty: TResult, - xf: Transducer, - coll: TInput[] | Iterator | string | Object): TResult; +export function into( + empty: TOutput[], + xf: Transducer, + coll: Iterable): TOutput[]; +export function into( + empty: string, + xf: Transducer, + coll: Iterable): string; +export function into( + empty: { [key: string]: TOutput }, + xf: Transducer, + coll: Iterable): { [key: string]: TOutput }; +// Overloads for object iteration. +export function into( + empty: TOutput[], + xf: Transducer<[string, TInput], TOutput>, + coll: { [key: string]: TInput }): TOutput[]; +export function into( + empty: string, + xf: Transducer<[string, TInput], string>, + coll: { [key: string]: TInput }): string; +export function into( + empty: { [key: string]: TOutput }, + xf: Transducer<[string, TInput], [string, TOutput]>, + coll: { [key: string]: TInput }): { [key: string]: TOutput }; /** * Convert a transducer transformer object into a function so @@ -272,7 +322,7 @@ export function into( * Underscore, lodash */ export function toFn( - xf: Transducer, + xf: Transducer, builder: Reducer | Transformer ): Reducer; diff --git a/types/transducers-js/transducers-js-tests.ts b/types/transducers-js/transducers-js-tests.ts index 634309a2b5..f39bf87384 100644 --- a/types/transducers-js/transducers-js-tests.ts +++ b/types/transducers-js/transducers-js-tests.ts @@ -124,3 +124,51 @@ function mapcatExample() { const xf = t.mapcat(reverse); t.into([], xf, [[3, 2, 1], [6, 5, 4]]); // [1, 2, 3, 4, 5, 6] } + +// Original tests + +function transduceExample() { + const { completing, transduce, wrap } = t; + const stringAppendFn = (acc: string, x: number) => acc + x; + const stringAppendTransformer = wrap(stringAppendFn); + const stringAppendThenLengthTransformer = completing( + stringAppendFn, + s => s.length, + ); + const lengthsString1: string = transduce( + t.map((s: string) => s.length), + stringAppendFn, + "", + ["a", "b"], + ); + const lengthsString2: string = transduce( + t.map((s: string) => s.length), + stringAppendTransformer, + "", + ["a", "b"], + ); + const lengthsStringLength: number = transduce( + t.map((s: string) => s.length), + stringAppendThenLengthTransformer, + "", + ["a", "b"], + ); +} + +function advancedIntoExample() { + const array: number[] = into([], t.map((s: string) => s.length), [ + "a", + "b", + ]); + const string: string = into("", t.map((s: string) => s + s), ["a", "b"]); + const object1: { [key: string]: number } = into( + {}, + t.map((s: string) => [s, s.length]), + ["a", "b"], + ); + const object2: { [key: string]: boolean } = into( + {}, + t.map((kv: [string, number]) => [kv[0], true]), + { a: 1, b: 2 } + ); +} From 23455c0bc57a16fd3a7d7ece4d18028929567f5c Mon Sep 17 00:00:00 2001 From: David Philipson Date: Wed, 21 Jun 2017 04:03:15 -0700 Subject: [PATCH 02/55] Fix toFn typing, tweak comp typing --- types/transducers-js/index.d.ts | 9 ++++++--- types/transducers-js/transducers-js-tests.ts | 8 ++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/types/transducers-js/index.d.ts b/types/transducers-js/index.d.ts index 3d9c6f7719..413cfbfef5 100644 --- a/types/transducers-js/index.d.ts +++ b/types/transducers-js/index.d.ts @@ -34,7 +34,10 @@ export function isReduced(x: any): boolean; /** * Function composition. Take N function and return their composition. */ -export function comp(...args: T[]): T; +// Infers correct return type when all arguments have same type. +export function comp any>(...args: T[]): T; +// Falls back to (any => any) when argument types differ. +export function comp(...args: Array<(x: any) => any>): (x: any) => any; /** * Take a predicate function and return its complement. @@ -323,8 +326,8 @@ export function into( */ export function toFn( xf: Transducer, - builder: Reducer | Transformer -): Reducer; + builder: Reducer | Transformer +): Reducer; /** * A transformer which simply returns the first input. diff --git a/types/transducers-js/transducers-js-tests.ts b/types/transducers-js/transducers-js-tests.ts index f39bf87384..7a82b595c8 100644 --- a/types/transducers-js/transducers-js-tests.ts +++ b/types/transducers-js/transducers-js-tests.ts @@ -172,3 +172,11 @@ function advancedIntoExample() { { a: 1, b: 2 } ); } + +function compExample() { + const fn1: t.Transducer = comp(map(inc), filter(isEven)); + const fn2: t.Transducer = comp( + filter(isEven), + map((x: number) => "" + x), + ); +} From c06dcc56c23293a9e3ef548a951574dd31455845 Mon Sep 17 00:00:00 2001 From: Damien Rajon Date: Wed, 21 Jun 2017 15:04:45 +0200 Subject: [PATCH 03/55] Add type definition for async.nexttick --- types/async.nexttick/async.nexttick-test.ts | 11 ++++++++++ types/async.nexttick/index.d.ts | 1 + types/async.nexttick/tsconfig.json | 24 +++++++++++++++++++++ types/async.nexttick/tslint.json | 3 +++ 4 files changed, 39 insertions(+) create mode 100644 types/async.nexttick/async.nexttick-test.ts create mode 100644 types/async.nexttick/index.d.ts create mode 100644 types/async.nexttick/tsconfig.json create mode 100644 types/async.nexttick/tslint.json diff --git a/types/async.nexttick/async.nexttick-test.ts b/types/async.nexttick/async.nexttick-test.ts new file mode 100644 index 0000000000..9d8acb33aa --- /dev/null +++ b/types/async.nexttick/async.nexttick-test.ts @@ -0,0 +1,11 @@ +import nextTick from 'async.nexttick'; + +function calledOnNextTick(a: string): number { + return parseInt(a, 10); +} + +const aString = 'Hi!'; + +nextTick(() => { + calledOnNextTick(aString); +}); diff --git a/types/async.nexttick/index.d.ts b/types/async.nexttick/index.d.ts new file mode 100644 index 0000000000..7db4a43d87 --- /dev/null +++ b/types/async.nexttick/index.d.ts @@ -0,0 +1 @@ +export default function nextTick(callback: () => void, ...args: any[]): void; diff --git a/types/async.nexttick/tsconfig.json b/types/async.nexttick/tsconfig.json new file mode 100644 index 0000000000..7bf5157ec4 --- /dev/null +++ b/types/async.nexttick/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "async.nexttick-test.ts" + ] +} + diff --git a/types/async.nexttick/tslint.json b/types/async.nexttick/tslint.json new file mode 100644 index 0000000000..4c3a548997 --- /dev/null +++ b/types/async.nexttick/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dtslint.json" +} From 1065599f86fa230995c7aa5bb6ac9ae08513dc9b Mon Sep 17 00:00:00 2001 From: David Philipson Date: Wed, 21 Jun 2017 15:10:21 -0700 Subject: [PATCH 04/55] Fix definition of Wrap --- types/transducers-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/transducers-js/index.d.ts b/types/transducers-js/index.d.ts index 413cfbfef5..66073d1cbc 100644 --- a/types/transducers-js/index.d.ts +++ b/types/transducers-js/index.d.ts @@ -211,7 +211,7 @@ export function completing( cf: (result: TResult) => TCompleteResult): CompletingTransformer; export class Wrap implements Transformer { - constructor(stepFn: Reducer, xf: Transformer); + constructor(stepFn: Reducer); ['@@transducer/init'](): TResult; ['@@transducer/step'](result: TResult, input: TInput): TResult; ['@@transducer/result'](result: TResult): TResult; From d4bdb400a0e12b615c4b2bd6d138d4723cf24231 Mon Sep 17 00:00:00 2001 From: David Philipson Date: Wed, 21 Jun 2017 18:27:55 -0700 Subject: [PATCH 05/55] More general Transducer definition --- types/transducers-js/index.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/types/transducers-js/index.d.ts b/types/transducers-js/index.d.ts index 66073d1cbc..83dbbe1573 100644 --- a/types/transducers-js/index.d.ts +++ b/types/transducers-js/index.d.ts @@ -11,7 +11,12 @@ export interface Reduced { export type Reducer = (result: TResult, input: TInput) => TResult; -export type Transducer = (xf: Transformer) => Transformer; +// Common case: Transducer = +// Transformer => Transformer. +export type Transducer = + ( + xf: CompletingTransformer + ) => CompletingTransformer; export interface CompletingTransformer { ['@@transducer/init'](): TResult | void; From 247d2506e083afe4ff89d41f412099b9617940c2 Mon Sep 17 00:00:00 2001 From: Sam Beran Date: Thu, 22 Jun 2017 11:29:24 -0500 Subject: [PATCH 06/55] Websocket: Use correct type for incoming message --- types/websocket/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/websocket/index.d.ts b/types/websocket/index.d.ts index 83d127c599..3b41a5f6da 100644 --- a/types/websocket/index.d.ts +++ b/types/websocket/index.d.ts @@ -181,7 +181,7 @@ export interface IExtension { export declare class request extends events.EventEmitter { /** A reference to the original Node HTTP request object */ - httpRequest: http.ClientRequest; + httpRequest: http.IncomingMessage; /** This will include the port number if a non-standard port is used */ host: string; /** A string containing the path that was requested by the client */ @@ -222,7 +222,7 @@ export declare class request extends events.EventEmitter { requestedProtocols: string[]; protocolFullCaseMap: { [key: string]: string }; - constructor(socket: net.Socket, httpRequest: http.ClientRequest, config: IServerConfig); + constructor(socket: net.Socket, httpRequest: http.IncomingMessage, config: IServerConfig); /** * After inspecting the `request` properties, call this function on the @@ -580,7 +580,7 @@ declare class client extends events.EventEmitter { declare class routerRequest extends events.EventEmitter { /** A reference to the original Node HTTP request object */ - httpRequest: http.ClientRequest; + httpRequest: http.IncomingMessage; /** A string containing the path that was requested by the client */ resource: string; /** Parsed resource, including the query string parameters */ From 45f22ec21e3b253c3264e2f28c8bf33a36a104bb Mon Sep 17 00:00:00 2001 From: David Philipson Date: Thu, 22 Jun 2017 18:05:21 -0700 Subject: [PATCH 07/55] Improve complement definition --- types/transducers-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/transducers-js/index.d.ts b/types/transducers-js/index.d.ts index 83dbbe1573..96fce6f671 100644 --- a/types/transducers-js/index.d.ts +++ b/types/transducers-js/index.d.ts @@ -47,7 +47,7 @@ export function comp(...args: Array<(x: any) => any>): (x: any) => any; /** * Take a predicate function and return its complement. */ -export function complement(f: Function): Function; +export function complement(f: (x: T) => boolean): (x: T) => boolean; /** * Identity function. From 468858a1f209f9d201ab14b988784a445c56690f Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Fri, 23 Jun 2017 11:44:07 +0100 Subject: [PATCH 08/55] Added ping method to MySQL IConnection --- types/mysql/index.d.ts | 2 ++ types/mysql/mysql-tests.ts | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/types/mysql/index.d.ts b/types/mysql/index.d.ts index 9212d59ef6..d98ef82216 100644 --- a/types/mysql/index.d.ts +++ b/types/mysql/index.d.ts @@ -58,6 +58,8 @@ interface IConnection { end(callback: (err: IError, ...args: any[]) => void): void; end(options: any, callback: (err: IError, ...args: any[]) => void): void; + ping(callback: (err: IError) => void): void; + destroy(): void; pause(): void; diff --git a/types/mysql/mysql-tests.ts b/types/mysql/mysql-tests.ts index a6d9afc07e..d2c44e21ee 100644 --- a/types/mysql/mysql-tests.ts +++ b/types/mysql/mysql-tests.ts @@ -148,6 +148,11 @@ connection.connect(function (err) { console.log('connected as id ' + connection.threadId); }); +connection.ping(function (err) { + if (err) throw err; + console.log('Ping was successful'); +}) + /// Pools var poolConfig = { From ae4c64b79ddc3acab27c88ea818151cf15f9fa64 Mon Sep 17 00:00:00 2001 From: Sergey Tregub Date: Fri, 23 Jun 2017 14:18:28 +0300 Subject: [PATCH 09/55] bsClass attribute missing for some components --- types/react-bootstrap/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/react-bootstrap/index.d.ts b/types/react-bootstrap/index.d.ts index 3030e7d6a5..a696c4ac6d 100644 --- a/types/react-bootstrap/index.d.ts +++ b/types/react-bootstrap/index.d.ts @@ -847,6 +847,7 @@ declare namespace ReactBootstrap { // interface BadgeProps extends React.HTMLProps { + bsClass?: string; pullRight?: boolean; } type Badge = React.ClassicComponent; @@ -908,6 +909,7 @@ declare namespace ReactBootstrap { responsive?: boolean; striped?: boolean; fill?: boolean; + bsClass?: string; } type Table = React.ClassicComponent; var Table: React.ClassicComponentClass; From 94b781d6ae6d4b668030641ee506983a6ef90b43 Mon Sep 17 00:00:00 2001 From: Mahdi Abedi Date: Fri, 23 Jun 2017 18:25:45 +0430 Subject: [PATCH 10/55] add parameter for RTL --- types/jquery.fancytree/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/jquery.fancytree/index.d.ts b/types/jquery.fancytree/index.d.ts index e2c79b0341..cea0b4c8e4 100644 --- a/types/jquery.fancytree/index.d.ts +++ b/types/jquery.fancytree/index.d.ts @@ -721,6 +721,8 @@ declare namespace Fancytree { restore?(event: JQueryEventObject, data: EventData): void; /** `data.node` was selected */ select?(event: JQueryEventObject, data: EventData): void; + /** Enable RTL version, default is false */ + rtl?: boolean; } interface FancytreeOptions extends FancytreeEvents { From d4a36a80865d85d8455626faa22a2f151e92203d Mon Sep 17 00:00:00 2001 From: Mahdi Abedi Date: Fri, 23 Jun 2017 18:32:17 +0430 Subject: [PATCH 11/55] add contributor name --- types/jquery.fancytree/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/jquery.fancytree/index.d.ts b/types/jquery.fancytree/index.d.ts index cea0b4c8e4..f4e6ac7be8 100644 --- a/types/jquery.fancytree/index.d.ts +++ b/types/jquery.fancytree/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for jquery.fancytree 2.7.0 // Project: https://github.com/mar10/fancytree // Definitions by: Peter Palotas +// Mahdi Abedi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From b0a675ccaad2cd33d5f08c5deebe07abaa4603f5 Mon Sep 17 00:00:00 2001 From: John J Czaplewski Date: Fri, 23 Jun 2017 12:04:17 -0500 Subject: [PATCH 12/55] Add maxTileCacheSize --- types/mapbox-gl/index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index 9438bfafac..46b5cd7d90 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -254,6 +254,9 @@ declare namespace mapboxgl { /** Initial zoom level */ zoom?: number; + + /** Maximum tile cache size for each layer. */ + maxTileCacheSize?: number; } export interface PaddingOptions { From 4ba0506fb710ac58cd141cd3e896d7ea287ea489 Mon Sep 17 00:00:00 2001 From: John J Czaplewski Date: Fri, 23 Jun 2017 12:08:09 -0500 Subject: [PATCH 13/55] Bump version number --- types/mapbox-gl/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index 46b5cd7d90..18ee4bbf1a 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mapbox GL JS v0.38.0 +// Type definitions for Mapbox GL JS v0.39.0 // Project: https://github.com/mapbox/mapbox-gl-js // Definitions by: Dominik Bruderer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 937b1fc4016d3d13c14f46f06fd3de372da71924 Mon Sep 17 00:00:00 2001 From: Yui T Date: Fri, 23 Jun 2017 10:50:13 -0700 Subject: [PATCH 14/55] Fix linting: line exceed max length of 200 --- types/react-native/index.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 06e777a270..5f9e6e3856 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -1,6 +1,10 @@ // Type definitions for react-native 0.44 // Project: https://github.com/facebook/react-native -// Definitions by: Eloy Durán , Fedor Nezhivoi , HuHuanming , Jeremi Stadler , Kyle Roach +// Definitions by: Eloy Durán +// Fedor Nezhivoi +// HuHuanming +// Jeremi Stadler +// Kyle Roach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From dddc76636954b1a3ddbdd827e08563f06743bbf3 Mon Sep 17 00:00:00 2001 From: Nicolas Voigt Date: Sat, 24 Jun 2017 14:35:27 +0200 Subject: [PATCH 15/55] setEncoding in stream interface --- types/node/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 131dbc96a1..2d15ee12c2 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -6,6 +6,7 @@ // Roberto Desideri // Christian Vaagland Tellnes // Wilco Bakker +// Nicolas Voigt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -307,7 +308,7 @@ declare namespace NodeJS { export interface ReadableStream extends EventEmitter { readable: boolean; read(size?: number): string | Buffer; - setEncoding(encoding: string | null): this; + setEncoding(encoding?: string): this; pause(): this; resume(): this; isPaused(): boolean; From 834287de2653a19b479a3715275f8cd750be595e Mon Sep 17 00:00:00 2001 From: Wouter Hardeman Date: Mon, 26 Jun 2017 10:06:33 +0200 Subject: [PATCH 16/55] Added types for react-sortable-tree 0.1 --- types/react-sortable-tree/index.d.ts | 120 ++++++++++++++++++ .../react-sortable-tree-tests.tsx | 66 ++++++++++ types/react-sortable-tree/tsconfig.json | 23 ++++ types/react-sortable-tree/tslint.json | 1 + .../utils/default-handlers.d.ts | 4 + .../utils/tree-data-utils.d.ts | 21 +++ 6 files changed, 235 insertions(+) create mode 100644 types/react-sortable-tree/index.d.ts create mode 100644 types/react-sortable-tree/react-sortable-tree-tests.tsx create mode 100644 types/react-sortable-tree/tsconfig.json create mode 100644 types/react-sortable-tree/tslint.json create mode 100644 types/react-sortable-tree/utils/default-handlers.d.ts create mode 100644 types/react-sortable-tree/utils/tree-data-utils.d.ts diff --git a/types/react-sortable-tree/index.d.ts b/types/react-sortable-tree/index.d.ts new file mode 100644 index 0000000000..961b218be4 --- /dev/null +++ b/types/react-sortable-tree/index.d.ts @@ -0,0 +1,120 @@ +// Type definitions for react-sortable-tree 0.1 +// Project: https://fritz-c.github.io/react-sortable-tree +// Definitions by: Wouter Hardeman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as React from 'react'; +import { ListProps, Index } from 'react-virtualized'; +import { ConnectDragSource, ConnectDragPreview, DragSourceMonitor } from 'react-dnd'; + +export * from './utils/tree-data-utils'; +export * from './utils/default-handlers'; + +export interface TreeItem { + title?: string; + subtitle?: string; + expanded?: boolean; + children: TreeItem[]; + [x: string]: any; +} + +export interface TreeNode { + node: TreeItem; +} + +export interface TreePath { + path: NumberArrayOrStringArray; +} + +export interface TreeIndex { + treeIndex: number; +} + +export interface FullTree { + treeData: TreeItem[]; +} + +export interface NodeData extends TreeNode, TreePath, TreeIndex {} + +export interface SearchData extends NodeData { + searchQuery: any; +} + +export interface ExtendedNodeData extends NodeData { + lowerSiblingsCounts: number[]; + isSearchMatch: boolean; + isSearchFocus: boolean; +} + +export interface OnVisibilityToggleData extends FullTree, TreeNode { + expanded: boolean; +} +export interface PreviousAnNextLocation { + prevPath: number[]; + prevParent: TreeItem; + prevTreeIndex: number; + nextPath: number[]; + nextParent: TreeItem; + nextTreeIndex: number; +} + +export type NodeRenderer = React.Component; + +export interface NodeRendererProps { + node: TreeItem; + path: NumberArrayOrStringArray; + treeIndex: number; + isSearchMatch: boolean; + isSearchFocus: boolean; + canDrag: boolean; + scaffoldBlockPxWidth: number; + toggleChildrenVisibility?(data: NodeData): void; + buttons?: any[]; + className?: string; + style?: {[index: string]: any}; + + connectDragPreview: ConnectDragPreview; + connectDragSource: ConnectDragSource; + parentNode?: {[index: string]: any}; + startDrag: any; + endDrag: any; + isDragging: boolean; + didDrop: boolean; + draggedNode?: {[index: string]: any}; + isOver: boolean; + canDrop?: boolean; +} + +type NumberArrayOrStringArray = string[] | number[]; + +export interface ReactSortableTreeProps { + treeData: TreeItem[]; + onChange(treeData: TreeItem[]): void; + style?: {[index: string]: any; }; + className?: string; + innerStyle?: {[index: string]: any; }; + maxDepth?: number; + searchMethod?(data: SearchData): boolean; + searchQuery?: string | any; + searchFocusOffset?: number; + searchFinishCallback?(matches: NodeData[]): void; + generateNodeProps?(data: ExtendedNodeData): {[index: string]: any}; + getNodeKey?(data: TreeNode & TreeIndex): string | number; + onMoveNode?(data: NodeData & FullTree): void; + onVisibilityToggle?(data: OnVisibilityToggleData): void; + canDrag?: ((data: ExtendedNodeData) => boolean) | boolean; + canDrop?(data: PreviousAnNextLocation & NodeData): boolean; + reactVirtualizedListProps?: ListProps; + rowHeight?: ((info: Index) => number) | number; + slideRegionSize?: number; + scaffoldBlockPxWidth?: number; + isVirtualized?: boolean; + nodeContentRenderer?: NodeRenderer; +} + +declare const SortableTree: React.ComponentClass; + +export const SortableTreeWithoutDndContext: React.ComponentClass; + +export default SortableTree; diff --git a/types/react-sortable-tree/react-sortable-tree-tests.tsx b/types/react-sortable-tree/react-sortable-tree-tests.tsx new file mode 100644 index 0000000000..21c18410e5 --- /dev/null +++ b/types/react-sortable-tree/react-sortable-tree-tests.tsx @@ -0,0 +1,66 @@ +import * as React from "react"; +import SortableTree, + { + SortableTreeWithoutDndContext, + defaultGetNodeKey, + NodeRenderer, + TreeItem, + defaultSearchMethod, + SearchData, + NodeData, + ExtendedNodeData, + FullTree, + OnVisibilityToggleData, + PreviousAnNextLocation + } from "react-sortable-tree"; +import { ListProps, ListRowRenderer } from "react-virtualized"; + +class Test extends React.Component { + render() { + const treeData = [ + { + title: "Title", subtitle: "Subtitle", children: [ + {title: "Child 1", subtitle: "Subtitle", children: []}, + {title: "Child 2", subtitle: "Subtitle", children: []} + ] + } + ]; + const reactVirtualizedListProps: ListProps = { + width: 100, height: 44, rowCount: 3, rowHeight: 44, rowRenderer: "test" as any as ListRowRenderer + }; + const nodeRenderer: NodeRenderer = "test" as any as NodeRenderer; + return ( +
+ {}} + style={{width: "100%"}} + className="test-class" + innerStyle={{backgroundColor: "#3A3A3A"}} + maxDepth={3} + searchMethod={defaultSearchMethod} + searchQuery={"Child 1"} + searchFocusOffset={1} + searchFinishCallback={(matches: NodeData[]) => { const firstTitle = matches[0].node.title; }} + generateNodeProps={(data: ExtendedNodeData) => ({buttons: [data.node.title]}) } + getNodeKey={defaultGetNodeKey} + onMoveNode={(data: NodeData & FullTree) => {}} + onVisibilityToggle={(data: OnVisibilityToggleData) => {}} + canDrag={true} + canDrop={(data: PreviousAnNextLocation & NodeData) => true} + reactVirtualizedListProps={reactVirtualizedListProps} + rowHeight={62} + slideRegionSize={100} + scaffoldBlockPxWidth={44} + isVirtualized={true} + nodeContentRenderer={nodeRenderer} + /> + {}} + style={{width: "100px"}} + /> +
+ ); + } +} diff --git a/types/react-sortable-tree/tsconfig.json b/types/react-sortable-tree/tsconfig.json new file mode 100644 index 0000000000..f82f976d38 --- /dev/null +++ b/types/react-sortable-tree/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "jsx": "react", + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-sortable-tree-tests.tsx" + ] +} diff --git a/types/react-sortable-tree/tslint.json b/types/react-sortable-tree/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-sortable-tree/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-sortable-tree/utils/default-handlers.d.ts b/types/react-sortable-tree/utils/default-handlers.d.ts new file mode 100644 index 0000000000..4d24792196 --- /dev/null +++ b/types/react-sortable-tree/utils/default-handlers.d.ts @@ -0,0 +1,4 @@ +import { TreeIndex, SearchData } from "../"; + +export function defaultGetNodeKey(data: TreeIndex): number; +export function defaultSearchMethod(data: SearchData): boolean; \ No newline at end of file diff --git a/types/react-sortable-tree/utils/tree-data-utils.d.ts b/types/react-sortable-tree/utils/tree-data-utils.d.ts new file mode 100644 index 0000000000..0446b00ed4 --- /dev/null +++ b/types/react-sortable-tree/utils/tree-data-utils.d.ts @@ -0,0 +1,21 @@ +import { FullTree, TreePath, TreeItem, TreeIndex, SearchData, NodeData, TreeNode } from "../"; + +type GetNodeKeyFunction = (data: TreeIndex & TreeNode) => string | number; +type WalkAndMapFunctionParameters = FullTree & {getNodeKey: GetNodeKeyFunction, callback: Function, ignoreCollapsed?: boolean} +type FlattenedData = (TreeNode & TreePath & {lowerSiblingsCounts: number[]})[]; + +export function getDescendantCount(data: TreeNode & {ignoreCollapsed?: boolean}): number; +export function getVisibleNodeCount(data: FullTree): number; +export function getVisibleNodeInfoAtIndex(data: FullTree & {targetIndex: number, getNodeKey: GetNodeKeyFunction}): TreeNode & TreePath & {lowerSiblingsCounts: number[]}; +export function walk(data: WalkAndMapFunctionParameters): void; +export function map(data: WalkAndMapFunctionParameters): TreeItem[]; +export function changeNodeAtPath(data: FullTree & TreePath & {newNode: Function | any, getNodeKey: GetNodeKeyFunction, ignoreCollapsed?: boolean}): TreeItem[]; +export function removeNodeAtPath(data: FullTree & TreePath & {getNodeKey: GetNodeKeyFunction, ignoreCollapsed?: boolean}): TreeItem[]; +export function getNodeAtPath(data: FullTree & TreePath & {getNodeKey: GetNodeKeyFunction, ignoreCollapsed?: boolean}): TreeItem | null; +export function addNodeUnderParent(data: FullTree & {newNode: TreeItem, parentKey?: number | string, getNodeKey: GetNodeKeyFunction, ignoreCollapsed?: boolean, expandParent?: boolean}): FullTree & TreeIndex; +export function insertNode(data: FullTree & {depth: number, newNode: TreeItem, minimumTreeIndex: number, ignoreCollapsed?: boolean, expandParent?: boolean, getNodeKey: GetNodeKeyFunction}): FullTree & TreeIndex & TreePath & {parentNode: TreeItem}; +export function getFlatDataFromTree(data: FullTree & {getNodeKey: GetNodeKeyFunction, ignoreCollapsed?: boolean}): (TreeNode & TreePath & {lowerSiblingsCounts: number[], parentNode: TreeItem})[]; +export function getTreeFromFlatData(data: {flatData: FlattenedData, getKey?: GetNodeKeyFunction, getParentKey?: GetNodeKeyFunction, rootKey?: string | number}): TreeItem[] +export function isDescendant(older: TreeItem, younger: TreeItem): boolean; +export function getDepth(node: TreeItem, depth?: number): number; +export function find(data: FullTree & {getNodeKey: GetNodeKeyFunction, searchQuery?: string | number, searchMethod: (data: SearchData) => boolean, searchFocusOffset?: number, expandAllMatchPaths?: boolean, expandFocusMatchPaths?: boolean}): {matches: NodeData[]} & FullTree; From 51995773e3f48b3e91df767a737e9b3727669a6d Mon Sep 17 00:00:00 2001 From: Wouter Hardeman Date: Mon, 26 Jun 2017 11:54:04 +0200 Subject: [PATCH 17/55] Fixed NodeRenderer type --- types/react-sortable-tree/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-sortable-tree/index.d.ts b/types/react-sortable-tree/index.d.ts index 961b218be4..a7805cd90e 100644 --- a/types/react-sortable-tree/index.d.ts +++ b/types/react-sortable-tree/index.d.ts @@ -59,7 +59,7 @@ export interface PreviousAnNextLocation { nextTreeIndex: number; } -export type NodeRenderer = React.Component; +export type NodeRenderer = React.ComponentClass; export interface NodeRendererProps { node: TreeItem; From 922fbf29014c072181ced556f570a09cac906de2 Mon Sep 17 00:00:00 2001 From: Wouter Hardeman Date: Mon, 26 Jun 2017 12:10:59 +0200 Subject: [PATCH 18/55] Fixed parent references for react-sortable-tree --- types/react-sortable-tree/utils/default-handlers.d.ts | 2 +- types/react-sortable-tree/utils/tree-data-utils.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-sortable-tree/utils/default-handlers.d.ts b/types/react-sortable-tree/utils/default-handlers.d.ts index 4d24792196..5b00de104d 100644 --- a/types/react-sortable-tree/utils/default-handlers.d.ts +++ b/types/react-sortable-tree/utils/default-handlers.d.ts @@ -1,4 +1,4 @@ -import { TreeIndex, SearchData } from "../"; +import { TreeIndex, SearchData } from 'react-sortable-tree'; export function defaultGetNodeKey(data: TreeIndex): number; export function defaultSearchMethod(data: SearchData): boolean; \ No newline at end of file diff --git a/types/react-sortable-tree/utils/tree-data-utils.d.ts b/types/react-sortable-tree/utils/tree-data-utils.d.ts index 0446b00ed4..84f68840c7 100644 --- a/types/react-sortable-tree/utils/tree-data-utils.d.ts +++ b/types/react-sortable-tree/utils/tree-data-utils.d.ts @@ -1,4 +1,4 @@ -import { FullTree, TreePath, TreeItem, TreeIndex, SearchData, NodeData, TreeNode } from "../"; +import { FullTree, TreePath, TreeItem, TreeIndex, SearchData, NodeData, TreeNode } from 'react-sortable-tree'; type GetNodeKeyFunction = (data: TreeIndex & TreeNode) => string | number; type WalkAndMapFunctionParameters = FullTree & {getNodeKey: GetNodeKeyFunction, callback: Function, ignoreCollapsed?: boolean} From 787dc502fa84b87234a84852c06d425658ef7332 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Mon, 26 Jun 2017 13:15:08 +0300 Subject: [PATCH 19/55] Added .withCredentials to CoreOptions Although not specified on the main page, as per https://github.com/request/request/blob/b12a6245d9acdb1e13c6486d427801e123fdafae/tests/browser/test.js we can see that this is part of the request module. More practically: local testing shows adding the {withCredentials:false} option allows us to create a request that accepts an "*" value for the Access-Control-Allow-Origin header. --- types/request/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/request/index.d.ts b/types/request/index.d.ts index fae6a2f65c..2cf7b08cf9 100644 --- a/types/request/index.d.ts +++ b/types/request/index.d.ts @@ -143,6 +143,7 @@ declare namespace request { gzip?: boolean; preambleCRLF?: boolean; postambleCRLF?: boolean; + withCredentials?: boolean; key?: Buffer; cert?: Buffer; passphrase?: string; From c326dd87d4549561c7008089b7a7022c91084898 Mon Sep 17 00:00:00 2001 From: Chigozirim C Date: Mon, 26 Jun 2017 18:36:35 -0500 Subject: [PATCH 20/55] node: Add cork and uncork type definitions Fixes: #16726 --- types/node/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 131dbc96a1..e9a40754d4 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -3823,6 +3823,8 @@ declare module "stream" { end(): void; end(chunk: any, cb?: Function): void; end(chunk: any, encoding?: string, cb?: Function): void; + cork(): void; + uncork(): void; /** * Event emitter From 135e6ac043cf15d01263c1d6db13c89faf676a38 Mon Sep 17 00:00:00 2001 From: Chigozirim C Date: Mon, 26 Jun 2017 18:36:35 -0500 Subject: [PATCH 21/55] node: Add cork and uncork type definitions Fixes: #16726 --- types/node/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 131dbc96a1..f76c3a7607 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -6,6 +6,7 @@ // Roberto Desideri // Christian Vaagland Tellnes // Wilco Bakker +// Chigozirim C. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -3823,6 +3824,8 @@ declare module "stream" { end(): void; end(chunk: any, cb?: Function): void; end(chunk: any, encoding?: string, cb?: Function): void; + cork(): void; + uncork(): void; /** * Event emitter @@ -3908,6 +3911,8 @@ declare module "stream" { end(): void; end(chunk: any, cb?: Function): void; end(chunk: any, encoding?: string, cb?: Function): void; + cork(): void; + uncork(): void; } export interface TransformOptions extends DuplexOptions { From 67bcf68325a56630a1d33aeebe41307770c6feeb Mon Sep 17 00:00:00 2001 From: Ruslan Voronkov Date: Mon, 26 Jun 2017 10:03:19 +0300 Subject: [PATCH 22/55] Move firstDay attribute out of days object *firstDay* attribute should be in calendar object --- types/kendo-ui/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/kendo-ui/index.d.ts b/types/kendo-ui/index.d.ts index 8c58c182be..733845e514 100644 --- a/types/kendo-ui/index.d.ts +++ b/types/kendo-ui/index.d.ts @@ -16,8 +16,8 @@ declare namespace kendo { names: string[]; namesAbbr: string[]; namesShort: string[]; - firstDay: number; }; + firstDay: number; months: { names: string[]; namesAbbr: string[]; From ffd486c5373bfbac125830746a57b5b5833b515e Mon Sep 17 00:00:00 2001 From: Paul Datsiuk Date: Tue, 27 Jun 2017 10:49:28 +0300 Subject: [PATCH 23/55] add typescript definition for browser-report --- types/browser-report/browser-report-tests.ts | 13 +++++ types/browser-report/index.d.ts | 56 ++++++++++++++++++++ types/browser-report/tsconfig.json | 22 ++++++++ 3 files changed, 91 insertions(+) create mode 100644 types/browser-report/browser-report-tests.ts create mode 100644 types/browser-report/index.d.ts create mode 100644 types/browser-report/tsconfig.json diff --git a/types/browser-report/browser-report-tests.ts b/types/browser-report/browser-report-tests.ts new file mode 100644 index 0000000000..11734d810c --- /dev/null +++ b/types/browser-report/browser-report-tests.ts @@ -0,0 +1,13 @@ +import 'browser-report'; + +function test_sync() { + var browserInfo = window.browserReportSync(); + console.log(browserInfo.browser.name); +} + +function test_async() { + window.browserReport((error, result) => { + console.log(result.ip + ' ' + result.browser.name); + debugger; + }); +} \ No newline at end of file diff --git a/types/browser-report/index.d.ts b/types/browser-report/index.d.ts new file mode 100644 index 0000000000..8c7dec2b5d --- /dev/null +++ b/types/browser-report/index.d.ts @@ -0,0 +1,56 @@ +// Type definitions for browser-report v2.2.9 +// Project: https://github.com/JTOne123/browser-report +// Definitions by: Paul Datsiuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Window { + browserReport(result: (error: ErrorEvent, report: ReportResult) => any): void; + browserReportSync(): ReportResult; +} + +interface ReportResult { + "browser": { + "name": (string), + "version": (string) + }, + "cookies": (boolean), + "flash": { + "version": (string) + }, + "ip": (string), + "country": { + "name": (string), + "code": (string), + "city": (string), + "latitude" : (string), + "longitude": (string), + "timezone": (string) + }, + "java": { + "version": (string) + }, + "lang": (Array), + "os": { + "name": (string), + "version": (string) + }, + "screen": { + "colors": (number), + "dppx": (number), + "height": (number), + "width": (number) + }, + "scripts": (boolean), + "timestamp": (string), + "userAgent": (string), + "viewport": { + "height": (number), + "layout": { + "height": (number), + "width": (number) + } + "width": (number), + "zoom": (number) + } + "websockets": (boolean) +} \ No newline at end of file diff --git a/types/browser-report/tsconfig.json b/types/browser-report/tsconfig.json new file mode 100644 index 0000000000..fa2a017bdd --- /dev/null +++ b/types/browser-report/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "browser-report-tests.ts" + ] +} \ No newline at end of file From 130cf981c3e8026d44ad835c396cccb51e7dc567 Mon Sep 17 00:00:00 2001 From: Paul Datsiuk Date: Tue, 27 Jun 2017 10:56:25 +0300 Subject: [PATCH 24/55] fix test --- types/browser-report/browser-report-tests.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/browser-report/browser-report-tests.ts b/types/browser-report/browser-report-tests.ts index 11734d810c..9f50b5b0f2 100644 --- a/types/browser-report/browser-report-tests.ts +++ b/types/browser-report/browser-report-tests.ts @@ -8,6 +8,5 @@ function test_sync() { function test_async() { window.browserReport((error, result) => { console.log(result.ip + ' ' + result.browser.name); - debugger; }); } \ No newline at end of file From 2a104b3dcc8c5e1d49987541033b9a33a5372e09 Mon Sep 17 00:00:00 2001 From: Paul Datsiuk Date: Tue, 27 Jun 2017 11:08:12 +0300 Subject: [PATCH 25/55] add dom lib --- types/browser-report/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/browser-report/tsconfig.json b/types/browser-report/tsconfig.json index fa2a017bdd..997b307339 100644 --- a/types/browser-report/tsconfig.json +++ b/types/browser-report/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, From 24803718e1608c107b005a2dd250ace4302f5796 Mon Sep 17 00:00:00 2001 From: Wouter Hardeman Date: Tue, 27 Jun 2017 10:09:30 +0200 Subject: [PATCH 26/55] Removed useless props and state from react-sortable-tree-tests --- types/react-sortable-tree/react-sortable-tree-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-sortable-tree/react-sortable-tree-tests.tsx b/types/react-sortable-tree/react-sortable-tree-tests.tsx index 21c18410e5..8b89db5196 100644 --- a/types/react-sortable-tree/react-sortable-tree-tests.tsx +++ b/types/react-sortable-tree/react-sortable-tree-tests.tsx @@ -15,7 +15,7 @@ import SortableTree, } from "react-sortable-tree"; import { ListProps, ListRowRenderer } from "react-virtualized"; -class Test extends React.Component { +class Test extends React.Component { render() { const treeData = [ { From d3641c0ab18b2cb2a40ac32c56c4c51bd9f92a76 Mon Sep 17 00:00:00 2001 From: Gyusun Yeom Date: Thu, 22 Jun 2017 18:27:38 +0900 Subject: [PATCH 27/55] add types for @mapbox/shelf-pack --- types/mapbox__shelf-pack/index.d.ts | 59 +++++++++++++++++++ .../mapbox__shelf-pack-tests.ts | 30 ++++++++++ types/mapbox__shelf-pack/tsconfig.json | 22 +++++++ types/mapbox__shelf-pack/tslint.json | 1 + 4 files changed, 112 insertions(+) create mode 100644 types/mapbox__shelf-pack/index.d.ts create mode 100644 types/mapbox__shelf-pack/mapbox__shelf-pack-tests.ts create mode 100644 types/mapbox__shelf-pack/tsconfig.json create mode 100644 types/mapbox__shelf-pack/tslint.json diff --git a/types/mapbox__shelf-pack/index.d.ts b/types/mapbox__shelf-pack/index.d.ts new file mode 100644 index 0000000000..3ef3ec3507 --- /dev/null +++ b/types/mapbox__shelf-pack/index.d.ts @@ -0,0 +1,59 @@ +// Type definitions for @mapbox/shelf-pack 3.0 +// Project: https://github.com/mapbox/shelf-pack +// Definitions by: Gyusun Yeom +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// tslint:disable-next-line no-single-declare-module +declare module "@mapbox/shelf-pack" { + export = ShelfPack; + + class ShelfPack { + constructor(width?: number, height?: number, options?: ShelfPack.CreateOption); + + pack(bins: Array, options?: ShelfPack.PackOption): ShelfPack.Bin[]; + packOne(w: number, h: number, id?: ShelfPack.ID): ShelfPack.Bin; + getBin(id: ShelfPack.ID): ShelfPack.Bin; + ref(bin: ShelfPack.Bin): number; + unref(bin: ShelfPack.Bin): number; + clear(): void; + resize(w: number, h: number): boolean; + + w: number; + h: number; + } + + namespace ShelfPack { + class Bin { + constructor(id: ID, x: number, y: number, w: number, h: number, maxw?: number, maxh?: number); + + id: ID; + x: number; + y: number; + w: number; + h: number; + } + + type ID = number | string; + interface Request { + id?: ID; + } + interface RequestShort extends Request { + w: number; + h: number; + } + interface RequestLong extends Request { + width: number; + height: number; + } + + interface PackOption { + /// If true , the supplied bin objects will be updated inplace with x and y properties + inPlace?: boolean; + } + + interface CreateOption { + /// If true , the sprite will automatically grow + autoResize?: boolean; + } + } +} diff --git a/types/mapbox__shelf-pack/mapbox__shelf-pack-tests.ts b/types/mapbox__shelf-pack/mapbox__shelf-pack-tests.ts new file mode 100644 index 0000000000..3baff984cb --- /dev/null +++ b/types/mapbox__shelf-pack/mapbox__shelf-pack-tests.ts @@ -0,0 +1,30 @@ +import * as ShelfPack from '@mapbox/shelf-pack'; + +let sprite = new ShelfPack(64, 64); + +for (let i = 0; i < 5; i++) { + const bin = sprite.packOne(32, 32); +} + +sprite.clear(); + +sprite.resize(128, 128); + +sprite = new ShelfPack(64, 64); + +[100, 101, 102].forEach(id => { + const bin = sprite.packOne(16, 16, id); +}); + +const bin102 = sprite.packOne(16, 16, 102); + +const bin101 = sprite.getBin(101); +sprite.ref(bin101); + +const bin100 = sprite.getBin(100); +sprite.unref(bin100); + +const bin103 = sprite.packOne(16, 15, 103); +sprite.unref(bin103); + +const bin104 = sprite.packOne(16, 16, 104); diff --git a/types/mapbox__shelf-pack/tsconfig.json b/types/mapbox__shelf-pack/tsconfig.json new file mode 100644 index 0000000000..540d660492 --- /dev/null +++ b/types/mapbox__shelf-pack/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", + "mapbox__shelf-pack-tests.ts" + ] +} diff --git a/types/mapbox__shelf-pack/tslint.json b/types/mapbox__shelf-pack/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mapbox__shelf-pack/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From abf87f7c822b61d78c2496fe26011c4657c3765a Mon Sep 17 00:00:00 2001 From: arminbaljic Date: Tue, 27 Jun 2017 11:03:49 +0200 Subject: [PATCH 28/55] Added type definitions for iframe-resizer --- types/iframe-resizer/iframe-resizer-tests.ts | 1 + types/iframe-resizer/index.d.ts | 184 +++++++++++++++++++ types/iframe-resizer/tsconfig.json | 25 +++ types/iframe-resizer/tslint.json | 1 + 4 files changed, 211 insertions(+) create mode 100644 types/iframe-resizer/iframe-resizer-tests.ts create mode 100644 types/iframe-resizer/index.d.ts create mode 100644 types/iframe-resizer/tsconfig.json create mode 100644 types/iframe-resizer/tslint.json diff --git a/types/iframe-resizer/iframe-resizer-tests.ts b/types/iframe-resizer/iframe-resizer-tests.ts new file mode 100644 index 0000000000..1996490390 --- /dev/null +++ b/types/iframe-resizer/iframe-resizer-tests.ts @@ -0,0 +1 @@ +import resizer = require('iframe-resizer'); diff --git a/types/iframe-resizer/index.d.ts b/types/iframe-resizer/index.d.ts new file mode 100644 index 0000000000..04ff130667 --- /dev/null +++ b/types/iframe-resizer/index.d.ts @@ -0,0 +1,184 @@ +// Type definitions for iframe-resizer +// Project: https://github.com/davidjbradshaw/iframe-resizer +// Definitions by: Armin Baljic +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'iframe-resizer' { + export interface IFrameObject { + close(): void; + moveToAnchor(anchor): void; + resize(): void; + sendMessage(message: any): void; + } + + export interface IFrameComponent extends HTMLIFrameElement { + iFrameResizer: IFrameObject + } + + export interface IFrameOptions { + /** + * When enabled changes to the Window size or the DOM will cause the iFrame to resize to the new content size. + * Disable if using size method with custom dimensions. + */ + autoResize?: boolean; + /** + * Override the body background style in the iFrame. + */ + bodyBackground?: string; + /** + * Override the default body margin style in the iFrame. A string can be any valid value for the + * CSS margin attribute, for example '8px 3em'. A number value is converted into px. + */ + bodyMargin?: number; + /** + * When set to true, only allow incoming messages from the domain listed in the src property of the iFrame tag. + * If your iFrame navigates between different domains, ports or protocols; then you will need to + * provide an array of URLs or disable this option. + */ + checkOrigin?: boolean; + /** + * When enabled in page linking inside the iFrame and from the iFrame to the parent page will be enabled. + */ + inPageLinks?: boolean; + /** + * Height calculation method. + */ + heightCalculationMethod?: string; + /** + * Set iFrame Id + */ + id?: string; + /** + * In browsers that don't support mutationObserver, such as IE10, the library falls back to using + * setInterval, to check for changes to the page size. + */ + interval?: number; + /** + * Setting the log option to true will make the scripts in both the host page and the iFrame output + * everything they do to the JavaScript console so you can see the communication between the two scripts. + */ + log?: boolean; + /** + * Set maximum height of iFrame. + */ + maxHeight?: number; + /** + * Set maximum width of iFrame. + */ + maxWidth?: number; + /** + * Set minimum height of iFrame. + */ + minHeight?: number; + /** + * Set minimum width of iFrame. + */ + minWidth?: number; + /** + * Listen for resize events from the parent page, or the iFrame. Select the 'child' value if the iFrame + * can be resized independently of the browser window. Selecting this value can cause issues with some + * height calculation methods on mobile devices. + */ + resizeFrom?: string; + /** + * Enable scroll bars in iFrame. + */ + scrolling?: boolean; + /** + * Resize iFrame to content height. + */ + sizeHeight?: boolean; + /** + * Resize iFrame to content width. + */ + sizeWidth?: boolean; + /** + * Set the number of pixels the iFrame content size has to change by, before triggering a resize of the iFrame. + */ + tolerance?: number; + /** + * Width calculation method. + */ + widthCalculationMethod?: string; + /** + * Called when iFrame is closed via parentIFrame.close() or iframe.iframeResizer.close() methods. + */ + closedCallback?: (iframeId: string) => void; + /** + * Initial setup callback function. + */ + initCallback?: (iframe: IFrameComponent) => void; + /** + * Receive message posted from iFrame with the parentIFrame.sendMessage() method. + */ + messageCallback?: (data: IFrameMessageData) => void; + /** + * Function called after iFrame resized. Passes in messageData object containing the iFrame, height, width + * and the type of event that triggered the iFrame to resize. + */ + resizedCallback?: (data: IFrameResizedData) => void; + /** + * Called before the page is repositioned after a request from the iFrame, due to either an in page link, + * or a direct request from either parentIFrame.scrollTo() or parentIFrame.scrollToOffset(). + * If this callback function returns false, it will stop the library from repositioning the page, so that + * you can implement your own animated page scrolling instead. + */ + scrollCallback?: (data: IFrameScrollData) => boolean; + } + + export interface IFramePageOptions { + /** + * This option allows you to restrict the domain of the parent page, + * to prevent other sites mimicking your parent page. + */ + targetOrigin?: string; + /** + * Receive message posted from the parent page with the iframe.iFrameResizer.sendMessage() method. + */ + messageCallback?: (message: any) => void; + /** + * This function is called once iFrame-Resizer has been initialized after receiving a call from the parent page. + */ + readyCallback?: () => void; + /** + * These option can be used to override the option set in the parent page + */ + heightCalculationMethod?: string; + /** + * These option can be used to override the option set in the parent page + */ + widthCalculationMethod?: string; + } + + export interface IFramePage { + autoResize(resize?: boolean): boolean; + close(): void; + getId(): string; + getPageInfo(callback: (data: any) => void | false): void; + scrollTo(x: number, y: number); + scrollToOffset(x: number, y: number); + sendMessage(message: any): void; + setHeightCalculationMethod(method: string): void; + size(customHeight?, customWidth?): void + } + + + export interface IFrameResizedData { + iframe: IFrameComponent; + height: number; + width: number; + type: string; + } + + export interface IFrameMessageData { + iframe: IFrameComponent; + message: string; + } + + export interface IFrameScrollData { + x: number; + y: number; + } + + export function iframeResizer(options: IFrameOptions, target: HTMLElement): IFrameComponent; +} \ No newline at end of file diff --git a/types/iframe-resizer/tsconfig.json b/types/iframe-resizer/tsconfig.json new file mode 100644 index 0000000000..ef96a6d33a --- /dev/null +++ b/types/iframe-resizer/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "exclude": [ + "node_modules" + ], + "files": [ + "index.d.ts", + "iframe-resizer-tests.ts" + ] +} \ No newline at end of file diff --git a/types/iframe-resizer/tslint.json b/types/iframe-resizer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/iframe-resizer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 3314dd9601333818b0cb63fd0c38082b4201d207 Mon Sep 17 00:00:00 2001 From: Arturs Vonda Date: Tue, 27 Jun 2017 12:13:01 +0300 Subject: [PATCH 29/55] Add missing methods for opening date picker dialog --- types/material-ui/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/material-ui/index.d.ts b/types/material-ui/index.d.ts index a7b13f2bb4..16c6b5dce7 100644 --- a/types/material-ui/index.d.ts +++ b/types/material-ui/index.d.ts @@ -942,6 +942,8 @@ declare namespace __MaterialUI { utils?: propTypes.utils; } export class DatePicker extends React.Component { + focus(): void; + openDialog(): void; } interface DatePickerDialogProps { From 6a66c72a8ed8ac56aba0e5da3220310215aee738 Mon Sep 17 00:00:00 2001 From: arminbaljic Date: Tue, 27 Jun 2017 11:27:34 +0200 Subject: [PATCH 30/55] Finished type definitions for iframe-resizer. --- types/iframe-resizer/iframe-resizer-tests.ts | 33 ++++++++++++- types/iframe-resizer/index.d.ts | 52 ++++++++++++-------- types/iframe-resizer/tsconfig.json | 5 +- types/iframe-resizer/tslint.json | 4 +- 4 files changed, 70 insertions(+), 24 deletions(-) diff --git a/types/iframe-resizer/iframe-resizer-tests.ts b/types/iframe-resizer/iframe-resizer-tests.ts index 1996490390..d127f8bf36 100644 --- a/types/iframe-resizer/iframe-resizer-tests.ts +++ b/types/iframe-resizer/iframe-resizer-tests.ts @@ -1 +1,32 @@ -import resizer = require('iframe-resizer'); +import {IFrameComponent, IFrameOptions, iframeResizer} from "iframe-resizer"; + +function testOne(): void { + let iframe: HTMLIFrameElement = document.createElement('iframe'); + let options: IFrameOptions = {log: true}; + let components: IFrameComponent[] = iframeResizer(options, iframe); + if (components) { + components.forEach(component => console.log(component.iFrameResizer)); + } else { + console.log("No components"); + } +} + +function testTwo(): void { + let iframe: HTMLIFrameElement = document.createElement('iframe'); + let components: IFrameComponent[] = iframeResizer({ + initCallback: () => { + console.log('Init'); + }, + closedCallback: () => { + console.log('Closed'); + } + }, iframe); + if (components) { + components.forEach(component => console.log(component.iFrameResizer)); + } else { + console.log("No components"); + } +} + +testOne(); +testTwo(); diff --git a/types/iframe-resizer/index.d.ts b/types/iframe-resizer/index.d.ts index 04ff130667..1a05833692 100644 --- a/types/iframe-resizer/index.d.ts +++ b/types/iframe-resizer/index.d.ts @@ -1,21 +1,26 @@ -// Type definitions for iframe-resizer +// Type definitions for iframe-resizer 3.5 // Project: https://github.com/davidjbradshaw/iframe-resizer // Definitions by: Armin Baljic // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// tslint:disable:prefer-method-signature +// tslint:disable-next-line:no-single-declare-module declare module 'iframe-resizer' { - export interface IFrameObject { + // tslint:disable-next-line:interface-name + interface IFrameObject { close(): void; - moveToAnchor(anchor): void; + moveToAnchor(anchor: string): void; resize(): void; sendMessage(message: any): void; } - export interface IFrameComponent extends HTMLIFrameElement { - iFrameResizer: IFrameObject + // tslint:disable-next-line:interface-name + interface IFrameComponent extends HTMLIFrameElement { + iFrameResizer: IFrameObject; } - export interface IFrameOptions { + // tslint:disable-next-line:interface-name + interface IFrameOptions { /** * When enabled changes to the Window size or the DOM will cause the iFrame to resize to the new content size. * Disable if using size method with custom dimensions. @@ -103,11 +108,11 @@ declare module 'iframe-resizer' { /** * Called when iFrame is closed via parentIFrame.close() or iframe.iframeResizer.close() methods. */ - closedCallback?: (iframeId: string) => void; + closedCallback?: (iframeId?: string) => void; /** * Initial setup callback function. */ - initCallback?: (iframe: IFrameComponent) => void; + initCallback?: (iframe?: IFrameComponent) => void; /** * Receive message posted from iFrame with the parentIFrame.sendMessage() method. */ @@ -126,7 +131,8 @@ declare module 'iframe-resizer' { scrollCallback?: (data: IFrameScrollData) => boolean; } - export interface IFramePageOptions { + // tslint:disable-next-line:interface-name + interface IFramePageOptions { /** * This option allows you to restrict the domain of the parent page, * to prevent other sites mimicking your parent page. @@ -150,35 +156,41 @@ declare module 'iframe-resizer' { widthCalculationMethod?: string; } - export interface IFramePage { + // tslint:disable-next-line:interface-name + interface IFramePage { autoResize(resize?: boolean): boolean; close(): void; getId(): string; getPageInfo(callback: (data: any) => void | false): void; - scrollTo(x: number, y: number); - scrollToOffset(x: number, y: number); - sendMessage(message: any): void; + scrollTo(x: number, y: number): void; + scrollToOffset(x: number, y: number): void; + sendMessage(message: any, targetOrigin: string): void; setHeightCalculationMethod(method: string): void; - size(customHeight?, customWidth?): void + setWidthCalculationMethod(method: string): void; + setTargetOrigin(targetOrigin: string): void; + size(customHeight: string, customWidth: string): void; } - - export interface IFrameResizedData { + // tslint:disable-next-line:interface-name + interface IFrameResizedData { iframe: IFrameComponent; height: number; width: number; type: string; } - export interface IFrameMessageData { + // tslint:disable-next-line:interface-name + interface IFrameMessageData { iframe: IFrameComponent; message: string; } - export interface IFrameScrollData { + // tslint:disable-next-line:interface-name + interface IFrameScrollData { x: number; y: number; } - export function iframeResizer(options: IFrameOptions, target: HTMLElement): IFrameComponent; -} \ No newline at end of file + function iframeResizer(options: IFrameOptions, target: HTMLElement): IFrameComponent[]; +} +// tslint:enable:prefer-method-signature diff --git a/types/iframe-resizer/tsconfig.json b/types/iframe-resizer/tsconfig.json index ef96a6d33a..d2b812a1f7 100644 --- a/types/iframe-resizer/tsconfig.json +++ b/types/iframe-resizer/tsconfig.json @@ -2,11 +2,12 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/iframe-resizer/tslint.json b/types/iframe-resizer/tslint.json index 3db14f85ea..30a1bdde2e 100644 --- a/types/iframe-resizer/tslint.json +++ b/types/iframe-resizer/tslint.json @@ -1 +1,3 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From 4ebb655fa656caf8319d44660a4c3b9d250d6a59 Mon Sep 17 00:00:00 2001 From: Nicolas Voigt Date: Tue, 27 Jun 2017 12:01:43 +0200 Subject: [PATCH 31/55] setEncoding argument to be mandatory --- types/node/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 2d15ee12c2..c6307a8a13 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -308,7 +308,7 @@ declare namespace NodeJS { export interface ReadableStream extends EventEmitter { readable: boolean; read(size?: number): string | Buffer; - setEncoding(encoding?: string): this; + setEncoding(encoding: string): this; pause(): this; resume(): this; isPaused(): boolean; From 6f9e67bb1813218a5c8497c7100140f39d26b935 Mon Sep 17 00:00:00 2001 From: Donald Pipowitch Date: Tue, 27 Jun 2017 13:01:41 +0200 Subject: [PATCH 32/55] Update index.d.ts --- types/webpack/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index cc686b93b0..24012bcd8b 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -504,7 +504,7 @@ declare namespace webpack { * Turns hints on/off. In addition, tells webpack to throw either an error or a warning when hints are * found. This property is set to "warning" by default. */ - hints?: 'warning' | 'error' | boolean; + hints?: 'warning' | 'error' | false; /** * An asset is any emitted file from webpack. This option controls when webpack emits a performance hint * based on individual asset size. The default value is 250000 (bytes). From d28f0c306c6390f0120272029f9ee42d1ef59709 Mon Sep 17 00:00:00 2001 From: Donald Pipowitch Date: Tue, 27 Jun 2017 13:06:05 +0200 Subject: [PATCH 33/55] Update index.d.ts --- types/webpack/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index cc686b93b0..26b95b01f4 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -1216,7 +1216,7 @@ declare namespace webpack { * Target of compilation. Passed from configuration options. * Example values: "web", "node" */ - target: 'web' | 'node' | string; + target: 'web' | 'webworker' | 'async-node' | 'node' | 'electron-main' | 'electron-renderer' | 'node-webkit' | string; /** * This boolean is set to true when this is compiled by webpack. From 909d2e994dc62b90da9f57ee5c84b2bdfd326e0c Mon Sep 17 00:00:00 2001 From: Uwe Quitter Date: Tue, 27 Jun 2017 15:45:52 +0200 Subject: [PATCH 34/55] Update index.d.ts In SelectRow interface type add an alternative type of number[] to the selected property. That resolves compiler errors if the key field of the row data is of type number. --- types/react-bootstrap-table/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-bootstrap-table/index.d.ts b/types/react-bootstrap-table/index.d.ts index 06e965c04b..1b80e670fa 100644 --- a/types/react-bootstrap-table/index.d.ts +++ b/types/react-bootstrap-table/index.d.ts @@ -157,7 +157,7 @@ export interface SelectRow { Give an array data to perform which rows you want to be selected when table loading. The content of array should be the rowkey which you want to be selected. */ - selected?: string[]; + selected?: string[] | number[]; /** if true, the radio/checkbox column will be hide. You can enable this attribute if you enable clickToSelect and you don't want to show the selection column. From e3f59cc5e8915383c54c92a9537d184438933eaf Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Tue, 27 Jun 2017 09:48:55 -0400 Subject: [PATCH 35/55] [angular] Add Document to JQueryStatic(). Add full header for JQLite definitions. --- types/angular/jqlite.d.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/types/angular/jqlite.d.ts b/types/angular/jqlite.d.ts index ee7d6acf1c..9702ee8f6d 100644 --- a/types/angular/jqlite.d.ts +++ b/types/angular/jqlite.d.ts @@ -1,3 +1,5 @@ +// Type definitions for jQuery 2.0 +// Project: http://jquery.com/ // Definitions by: Boris Yankov // Christian Hoffmeister // Steve Fenton @@ -19,6 +21,20 @@ // Dick van den Brink // Thomas Schulz // Leonard Thieu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ // Definitions copied from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/0480c5ec87fab41aa23047a02b27f0ea71aaf975/types/jquery/v2/index.d.ts @@ -664,7 +680,7 @@ interface JQuery { } interface JQueryStatic { - (element: string | Element): JQuery; + (element: string | Element | Document): JQuery; } /** From afb3c676648232deefc6e2aeba716947d3afc7dd Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Tue, 27 Jun 2017 10:05:00 -0400 Subject: [PATCH 36/55] [angular] types-publisher doesn't like a full header. --- types/angular/jqlite.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/angular/jqlite.d.ts b/types/angular/jqlite.d.ts index 9702ee8f6d..ee8eea9928 100644 --- a/types/angular/jqlite.d.ts +++ b/types/angular/jqlite.d.ts @@ -1,4 +1,3 @@ -// Type definitions for jQuery 2.0 // Project: http://jquery.com/ // Definitions by: Boris Yankov // Christian Hoffmeister From 1c4ffe1b607aa1ec76f6753580e8c667f4c8e595 Mon Sep 17 00:00:00 2001 From: Matt Lewis Date: Tue, 27 Jun 2017 15:08:50 +0100 Subject: [PATCH 37/55] webpack: remove myself from the authors list --- types/webpack/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index cc686b93b0..f1337e7c0d 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -1,7 +1,6 @@ // Type definitions for webpack 3.0 // Project: https://github.com/webpack/webpack // Definitions by: Qubo -// Matt Lewis // Benjamin Lim // Boris Cherny // Tommy Troy Lin From 968741c3b62aaf96ae2ce88e2e070fd43c027918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20Ksi=C4=99ski?= Date: Tue, 27 Jun 2017 16:36:13 +0200 Subject: [PATCH 38/55] Update Node interface methods for dockerode package --- types/dockerode/dockerode-tests.ts | 33 ++++++++++++++++++++++++++++++ types/dockerode/index.d.ts | 8 ++++++++ 2 files changed, 41 insertions(+) diff --git a/types/dockerode/dockerode-tests.ts b/types/dockerode/dockerode-tests.ts index 8dd9a380de..ef2ed924d1 100644 --- a/types/dockerode/dockerode-tests.ts +++ b/types/dockerode/dockerode-tests.ts @@ -145,3 +145,36 @@ secret.remove((err, response) => { secret.update((err, response) => { // NOOP }); + +const node = docker.getNode('nodeName'); +node.inspect((err, reponse) => { + // NOOP +}); + +node.inspect().then(response => { + // NOOP +}); + +node.update({}, (err, response) => { + // NOOP +}); + +node.update((err, response) => { + // NOOP +}); + +node.update({}).then(response => { + // NOOP; +}); + +node.remove({}, (err, response) => { + // NOOP +}); + +node.remove((err, response) => { + // NOOP +}); + +node.remove({}).then(response => { + // NOOP; +}); diff --git a/types/dockerode/index.d.ts b/types/dockerode/index.d.ts index ec2808cf3d..1b456e8f45 100644 --- a/types/dockerode/index.d.ts +++ b/types/dockerode/index.d.ts @@ -170,6 +170,14 @@ declare namespace Dockerode { inspect(callback: Callback): void; inspect(): Promise; + update(options: {}, callback: Callback): void; + update(callback: Callback): void; + update(options?: {}): Promise; + + remove(options: {}, callback: Callback): void; + remove(callback: Callback): void; + remove(options?: {}): Promise; + modem: any; id?: string; } From 123aa2984e6faccac17dc6a16b7480b446ae2e73 Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Tue, 27 Jun 2017 10:59:45 -0400 Subject: [PATCH 39/55] [DefinitelyTyped] Increase nProcesses from 1 to 4. (#17511) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1be6d06c89..8e734f2b89 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "scripts": { "compile-scripts": "tsc -p scripts", "not-needed": "node scripts/not-needed.js", - "test": "node node_modules/types-publisher/bin/tester/test.js --run-from-definitely-typed --nProcesses 1", + "test": "node node_modules/types-publisher/bin/tester/test.js --run-from-definitely-typed --nProcesses 4", "lint": "dtslint types" }, "devDependencies": { From 7bff99cf63c2516be2155bc321ff2ea04b28d650 Mon Sep 17 00:00:00 2001 From: Hussein Shabbir Date: Tue, 27 Jun 2017 21:00:24 +0400 Subject: [PATCH 40/55] Export the ReactDatePickerProps interface This is useful when wrapping the date picker in a custom component so that the props of the custom component can extend ReactDatePickerProps. --- types/react-datepicker/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-datepicker/index.d.ts b/types/react-datepicker/index.d.ts index f31f0316e1..aeb44be606 100644 --- a/types/react-datepicker/index.d.ts +++ b/types/react-datepicker/index.d.ts @@ -9,7 +9,7 @@ import * as React from "react"; import * as moment from "moment"; -interface ReactDatePickerProps { +export interface ReactDatePickerProps { autoComplete?: string; autoFocus?: boolean; calendarClassName?: string; From dc1ea691f9916fc5774b73e3e17a349ace77bf1e Mon Sep 17 00:00:00 2001 From: Ed Staub Date: Tue, 27 Jun 2017 13:36:34 -0400 Subject: [PATCH 41/55] Update formatError.d.ts See e.g. the flow definition in https://github.com/graphql/graphql-js/blob/master/src/error/formatError.js, where they are defined as optional. I'm no GraphQL expert; caveat emptor. --- types/graphql/error/formatError.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/graphql/error/formatError.d.ts b/types/graphql/error/formatError.d.ts index 712c68c77b..5b974d5461 100644 --- a/types/graphql/error/formatError.d.ts +++ b/types/graphql/error/formatError.d.ts @@ -8,11 +8,11 @@ export function formatError(error: GraphQLError): GraphQLFormattedError; export type GraphQLFormattedError = { message: string, - locations: Array, - path: Array + locations?: Array, + path?: Array }; export type GraphQLErrorLocation = { line: number, column: number -}; \ No newline at end of file +}; From 38c6c6691ee3b7c37ab294bcccc0f0a3458be16f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Par=C3=A9?= Date: Tue, 27 Jun 2017 14:09:51 -0400 Subject: [PATCH 42/55] fix typo --- types/mapbox-gl/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index 9438bfafac..59611440b3 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -173,7 +173,7 @@ declare namespace mapboxgl { keyboard: KeyboardHandler; - doublClickZoom: DoubleClickZoomHandler; + doubleClickZoom: DoubleClickZoomHandler; touchZoomRotate: TouchZoomRotateHandler; } From 0e32c73f0c36905de3a828371aa6f9487e9ccc7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ro=CC=81bert=20Kiss?= Date: Tue, 27 Jun 2017 21:13:04 +0200 Subject: [PATCH 43/55] node-hid: Add 'usagePage' and 'usage' properties to Device --- types/node-hid/index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/node-hid/index.d.ts b/types/node-hid/index.d.ts index 34afff06b1..e1196cf53e 100644 --- a/types/node-hid/index.d.ts +++ b/types/node-hid/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for node-hid 0.5 // Project: https://github.com/node-hid/node-hid#readme // Definitions by: Mohamed Hegazy +// Robert Kiss // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface Device { @@ -12,6 +13,8 @@ export interface Device { product: string; release: number; interface: number; + usagePage: number; + usage: number; } export class HID { From aa5ba74640cbf935fc995f900291f38c5896c152 Mon Sep 17 00:00:00 2001 From: Peter Jihoon Kim Date: Mon, 26 Jun 2017 22:35:09 -0700 Subject: [PATCH 44/55] [react-navigation] Fixed type definitions for NavigationActions.* --- types/react-navigation/index.d.ts | 66 ++++++++++++------- .../react-navigation-tests.tsx | 50 ++++++++++++-- 2 files changed, 86 insertions(+), 30 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 5286540963..1d07494104 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -4,6 +4,7 @@ // mhcgrq // fangpenlin // abrahambotros +// petejkim // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -188,46 +189,63 @@ export interface NavigationParams { [key: string]: any, } -export type NavigationNavigateAction = { - type: 'Navigation/NAVIGATE', +export interface NavigationNavigateActionPayload { routeName: string, params?: NavigationParams, // The action to run inside the sub-router action?: NavigationNavigateAction, -}; +} -export type NavigationBackAction = { - type: 'Navigation/BACK', +export interface NavigationNavigateAction extends NavigationNavigateActionPayload { + type: 'Navigation/NAVIGATE', +} + +export interface NavigationBackActionPayload { key?: string | null, -}; +} -export type NavigationSetParamsAction = { - type: 'Navigation/SET_PARAMS', +export interface NavigationBackAction extends NavigationBackActionPayload { + type: 'Navigation/BACK', +} +export interface NavigationSetParamsActionPayload { // The key of the route where the params should be set key: string, // The new params to merge into the existing route params params?: NavigationParams, -}; +} -export type NavigationInitAction = { - type: 'Navigation/INIT', +export interface NavigationSetParamsAction extends NavigationSetParamsActionPayload { + type: 'Navigation/SET_PARAMS', +} + +export interface NavigationInitActionPayload { params?: NavigationParams, -}; +} -export type NavigationResetAction = { - type: 'Navigation/RESET', +export interface NavigationInitAction extends NavigationInitActionPayload { + type: 'Navigation/INIT', +} + +export interface NavigationResetActionPayload { index: number, key?: string | null, actions: Array, -}; +} -export type NavigationUriAction = { - type: 'Navigation/URI', +export interface NavigationResetAction extends NavigationResetActionPayload { + type: 'Navigation/RESET', +} + +export interface NavigationUriActionPayload { uri: string, -}; +} + +export interface NavigationUriAction extends NavigationUriActionPayload { + type: 'Navigation/URI', +} export interface NavigationStackViewConfig { mode?: 'card' | 'modal', @@ -575,15 +593,13 @@ export const TabBarBottom: React.ComponentClass; /** * NavigationActions - * @todo Is this necessary, or can we remove? Not referenced anywhere else here, but it seems a - * recent commit or two touches these. Can anyone provide a strong use case for keeping this in? */ export namespace NavigationActions { - function init(options?: NavigationInitAction): NavigationInitAction; - function navigate(options: NavigationNavigateAction): NavigationNavigateAction; - function reset(options: NavigationResetAction): NavigationResetAction; - function back(options?: NavigationBackAction): NavigationBackAction; - function setParams(options: NavigationSetParamsAction): NavigationSetParamsAction; + export function init(options?: NavigationInitActionPayload): NavigationInitAction; + export function navigate(options: NavigationNavigateActionPayload): NavigationNavigateAction; + export function reset(options: NavigationResetActionPayload): NavigationResetAction; + export function back(options?: NavigationBackActionPayload): NavigationBackAction; + export function setParams(options: NavigationSetParamsActionPayload): NavigationSetParamsAction; } /** diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 835e63d756..1840fd7ccf 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -5,22 +5,28 @@ import { ViewStyle, } from 'react-native'; import { - addNavigationHelpers, + NavigationAction, + NavigationActions, + NavigationBackAction, + NavigationInitAction, + NavigationNavigateAction, + NavigationProp, + NavigationResetAction, NavigationRouteConfigMap, NavigationScreenProp, NavigationScreenProps, + NavigationSetParamsAction, NavigationStackAction, NavigationStackScreenOptions, NavigationTabScreenOptions, + NavigationTransitionProps, StackNavigator, StackNavigatorConfig, + TabBarTop, TabNavigator, TabNavigatorConfig, - TabBarTop, Transitioner, - NavigationProp, - NavigationAction, - NavigationTransitionProps, + addNavigationHelpers, } from 'react-navigation'; // Constants @@ -42,6 +48,7 @@ interface StartScreenNavigationParams { id: number, s: string, } + interface StartScreenProps extends NavigationScreenProps { } class StartScreen extends React.Component { render() { @@ -219,3 +226,36 @@ class CustomTransitioner extends React.Component return {} } } + +const initAction: NavigationInitAction = NavigationActions.init({ + params: { + foo: "bar" + } +}) + +const navigateAction: NavigationNavigateAction = NavigationActions.navigate({ + routeName: "FooScreen", + params: { + foo: "bar" + }, + action: NavigationActions.navigate({ routeName: "BarScreen" }) +}) + +const resetAction: NavigationResetAction = NavigationActions.reset({ + index: 0, + key: "foo", + actions: [ + NavigationActions.navigate({ routeName: "FooScreen" }) + ] +}) + +const backAction: NavigationBackAction = NavigationActions.back({ + key: "foo" +}) + +const setParamsAction: NavigationSetParamsAction = NavigationActions.setParams({ + key: "foo", + params: { + foo: "bar" + } +}) From 6f114653600265e936e1c88e8ebcc8776c53fc1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ro=CC=81bert=20Kiss?= Date: Tue, 27 Jun 2017 22:55:55 +0200 Subject: [PATCH 45/55] node-hid: set optional properties --- types/node-hid/index.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types/node-hid/index.d.ts b/types/node-hid/index.d.ts index e1196cf53e..92ffd4a60a 100644 --- a/types/node-hid/index.d.ts +++ b/types/node-hid/index.d.ts @@ -7,14 +7,14 @@ export interface Device { vendorId: number; productId: number; - path: string; - serialNumber: string; - manufacturer: string; - product: string; + path?: string; + serialNumber?: string; + manufacturer?: string; + product?: string; release: number; interface: number; - usagePage: number; - usage: number; + usagePage?: number; + usage?: number; } export class HID { From 86e255d38bf3add28248d1a795ede453b81e93ac Mon Sep 17 00:00:00 2001 From: Paul Datsiuk Date: Wed, 28 Jun 2017 00:15:03 +0300 Subject: [PATCH 46/55] parentheses was deleted --- types/browser-report/index.d.ts | 56 ++++++++++++++++----------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/types/browser-report/index.d.ts b/types/browser-report/index.d.ts index 8c7dec2b5d..c5852aae97 100644 --- a/types/browser-report/index.d.ts +++ b/types/browser-report/index.d.ts @@ -10,47 +10,47 @@ interface Window { interface ReportResult { "browser": { - "name": (string), - "version": (string) + "name": string, + "version": string }, - "cookies": (boolean), + "cookies": boolean, "flash": { - "version": (string) + "version": string }, - "ip": (string), + "ip": string, "country": { - "name": (string), - "code": (string), - "city": (string), - "latitude" : (string), - "longitude": (string), - "timezone": (string) + "name": string, + "code": string, + "city": string, + "latitude" : string, + "longitude": string, + "timezone": string }, "java": { - "version": (string) + "version": string }, - "lang": (Array), + "lang": Array, "os": { - "name": (string), - "version": (string) + "name": string, + "version": string }, "screen": { - "colors": (number), - "dppx": (number), - "height": (number), - "width": (number) + "colors": number, + "dppx": number, + "height": number, + "width": number }, - "scripts": (boolean), - "timestamp": (string), - "userAgent": (string), + "scripts": boolean, + "timestamp": string, + "userAgent": string, "viewport": { - "height": (number), + "height": number, "layout": { - "height": (number), - "width": (number) + "height": number, + "width": number } - "width": (number), - "zoom": (number) + "width": number, + "zoom": number } - "websockets": (boolean) + "websockets": boolean } \ No newline at end of file From b8fa44da6133029913edd27e4d14b8e916664305 Mon Sep 17 00:00:00 2001 From: Damien Rajon Date: Tue, 27 Jun 2017 23:22:51 +0200 Subject: [PATCH 47/55] Added header for async.nexttick definitions --- types/async.nexttick/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/async.nexttick/index.d.ts b/types/async.nexttick/index.d.ts index 7db4a43d87..8971239963 100644 --- a/types/async.nexttick/index.d.ts +++ b/types/async.nexttick/index.d.ts @@ -1 +1,6 @@ +// Type definitions for async.nexttick 0.5.2 +// Project: https://www.npmjs.com/package/async.nexttick +// Definitions by: Damien "pyrho" Rajon +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + export default function nextTick(callback: () => void, ...args: any[]): void; From 67b71f679b5e0c22340996549e87a4dcaaf7446b Mon Sep 17 00:00:00 2001 From: Sam Baxter Date: Tue, 27 Jun 2017 17:27:27 -0400 Subject: [PATCH 48/55] gapi.drive: refactor typings and fix bugs --- types/gapi.drive/index.d.ts | 510 +++++++++++++++++++----------------- 1 file changed, 273 insertions(+), 237 deletions(-) diff --git a/types/gapi.drive/index.d.ts b/types/gapi.drive/index.d.ts index ad8c64aa50..e0d4037ec9 100644 --- a/types/gapi.drive/index.d.ts +++ b/types/gapi.drive/index.d.ts @@ -6,8 +6,24 @@ /// -declare namespace gapi.client.drive { - export namespace files { +declare namespace gapi.client { + export module drive { + const files: { + get: (parameters: GetParameters) => HttpRequest; + patch: (parameters: PatchParameters) => HttpRequest; + copy: (parameters: CopyParameters) => HttpRequest; + delete: (parameters: DeleteParameters) => HttpRequest; + emptyTrash: () => HttpRequest; + export: (parameters: ExportParameters) => HttpRequest; + generateIds: (parameters: GenerateIdsParameters) => HttpRequest; + insert: (parameters: InsertParameters) => HttpRequest; + list: (parameters: ListParameters) => HttpRequest; + touch: (parameters: TouchParameters) => HttpRequest; + trash: (parameters: TrashParameters) => HttpRequest; + untrash: (parameters: UntrashParameters) => HttpRequest; + watch: (parameters: WatchParameters) => HttpRequest; + } + interface GetParameters { fileId: string; acknowledgeAbuse?: boolean; @@ -17,8 +33,6 @@ declare namespace gapi.client.drive { updateViewedDate?: boolean; } - export function get(parameters: GetParameters): HttpRequest; - interface PatchParameters { fileId: string; resource?: FileResource @@ -37,8 +51,6 @@ declare namespace gapi.client.drive { useContentAsIndexableText?: boolean; } - export function patch(parameters: PatchParameters): HttpRequest; - interface CopyParameters { fileId: string; resource?: FileResource; @@ -52,13 +64,39 @@ declare namespace gapi.client.drive { visibility?: string; } - export function copy(parameters: CopyParameters): HttpRequest; + interface DeleteParameters { + fileId: string; + supportsTeamDrives?: boolean; + } + + interface ExportParameters { + fileId: string; + mimeType: string; + } + + interface GenerateIdsParameters { + maxResults?: number; + space?: string; + } + + interface InsertParameters { + uploadType: string; + convert?: boolean; + ocr?: boolean; + ocrLanguage?: string; + pinned?: boolean; + supportsTeamDrives?: boolean; + timedTextLanguage?: string; + timedTextTrackName?: string; + usecontentAsIndexableText?: boolean; + visibility?: string; + } interface ListParameters { corpora?: string; corpus?: string; includeTeamDriveItems?: boolean; - maxResults: number; + maxResults?: number; orderBy?: string; pageToken?: string; projection?: string; @@ -68,28 +106,22 @@ declare namespace gapi.client.drive { teamDriveId?: string; } - export function list(parameters: ListParameters): HttpRequest; - interface TouchParameters { fileId: string; supportsTeamDrives?: boolean; } - export function touch(parameters: TouchParameters): HttpRequest; - interface TrashParameters { fileId: string; supportsTeamDrives?: boolean; } - export function trash(parameters: TrashParameters): HttpRequest; interface UntrashParameters { fileId: string; supportsTeamDrives?: boolean; } - export function untrash(parameters: UntrashParameters): HttpRequest; interface WatchParameters { fileId: string; @@ -98,239 +130,243 @@ declare namespace gapi.client.drive { supportsTeamDrives?: boolean; } - export function watch(parameters: WatchParameters): HttpRequest; - } - - export interface FileResource { - kind: 'drive#file'; - id?: string; - // etag - selfLink?: string; - webContentLink?: string; - webViewLink?: string; - alternateLink?: string; - embedLink?: string; - // openWithLinks - defaultOpenWithLink?: string; - iconLink?: string; - hasThumbnail?: boolean; - thumbnailLink?: string; - thumbnail?: { - image: Uint8Array; - mimType: string; - }; - title?: string; - mimeType?: string; - description?: string; - labels?: { - starred?: boolean; - hidden?: boolean; - trashed?: boolean; - restricted?: boolean; - viewed?: boolean; - modified?: boolean; - }; - createdDate?: Date; - modifiedDate?: Date; - modifiedByMeDate?: Date; - lastViewedByMeDate?: Date; - markedViewedByMeDate?: Date; - sharedWithMeDate?: Date; - version?: number; - sharingUser?: { - kind: 'drive#user'; - displayName?: string; - picture?: { - url: string; + interface FileResource { + kind: 'drive#file'; + id: string; + etag: string; + selfLink: string; + webContentLink: string; + webViewLink: string; + alternateLink: string; + embedLink: string; + // openWithLinks + defaultOpenWithLink: string; + iconLink: string; + hasThumbnail: boolean; + thumbnailLink: string; + thumbnail: { + image: Uint8Array; + mimType: string; }; - isAuthenticatedUser?: boolean; - permissionId?: string; - emailAddress?: string; - }; - parents?: ParentResource[]; - downloadUrl?: string; - // exportLinks - indexableText?: { - text: string; - }; - userPermission?: PermissionResource; - permissions?: PermissionResource[]; - hasAugmentedPermissions?: boolean; - originalFilename?: string; - fileExtension?: string; - fullFileExtension?: string; - md5Checksum?: string; - fileSize?: number; - quotaBytesUsed?: number; - ownerNames?: string[]; - owners?: { - kind: 'drive#user'; - displayName?: string; - picture?: { - url: string; + title: string; + mimeType: string; + description: string; + labels: { + starred: boolean; + hidden: boolean; + trashed: boolean; + restricted: boolean; + viewed: boolean; + modified: boolean; }; - isAuthenticatedUser?: boolean; - permissionId?: string; - emailAddress?: string; - }[]; - teamDriveId?: string; - lastModifyingUserName?: string; - lastModifyingUser?: { - kind: 'drive#user'; - displayName?: string; - picture?: { - url: string; + createdDate: Date; + modifiedDate: Date; + modifiedByMeDate: Date; + lastViewedByMeDate: Date; + markedViewedByMeDate: Date; + sharedWithMeDate: Date; + version: number; + sharingUser: { + kind: 'drive#user'; + displayName: string; + picture: { + url: string; + }; + isAuthenticatedUser: boolean; + permissionId: string; + emailAddress: string; }; - isAuthenticatedUser?: boolean; - permissionId?: string; - emailAddress?: string; - }; - ownedByMe?: boolean; - capabilities?: { - canAddChildren?: boolean; - canChangeRestrictedDownload?: boolean; - canComment?: boolean; - canCopy?: boolean; - canDelete?: boolean; - canDownload?: boolean; - canEdit?: boolean; - canListChildren?: boolean; - canMoveItemIntoTeamDrive?: boolean; - canMoveTeamDriveItem?: boolean; - canReadRevisions?: boolean; - canReadTeamDrive?: boolean; - canRemoveChildren?: boolean; - canRename?: boolean; - canShare?: boolean; - canTrash?: boolean; - canUntrash?: boolean; - }; - editable?: boolean; - canComment?: boolean; - canReadRevisions?: boolean; - shareable?: boolean; - copyable?: boolean; - writersCanShare?: boolean; - shared?: boolean; - explicitlyTrashed?: boolean; - trashingUser?: { - kind: 'drive#user'; - displayName?: string; - picture?: { - url: string; + parents: ParentResource[]; + downloadUrl: string; + // exportLinks + indexableText: { + text: string; }; - isAuthenticatedUser?: boolean; - permissionId?: string; - emailAddress?: string; - }; - trashedDate?: Date; - appDataContents?: boolean; - headRevisionId?: string; - properties?: PropertiesResource[]; - folderColorRgb?: string; - imageMediaMetadata?: { - width?: number; - height?: number; - rotation?: number; - location?: { - latitude?: number; - longitude?: number; - altitude?: number; + userPermission: PermissionResource; + permissions: PermissionResource[]; + hasAugmentedPermissions: boolean; + originalFilename: string; + fileExtension: string; + fullFileExtension: string; + md5Checksum: string; + fileSize: number; + quotaBytesUsed: number; + ownerNames: string[]; + owners: { + kind: 'drive#user'; + displayName: string; + picture: { + url: string; + }; + isAuthenticatedUser: boolean; + permissionId: string; + emailAddress: string; + }[]; + teamDriveId: string; + lastModifyingUserName: string; + lastModifyingUser: { + kind: 'drive#user'; + displayName: string; + picture: { + url: string; + }; + isAuthenticatedUser: boolean; + permissionId: string; + emailAddress: string; }; - date?: string; - cameraMake?: string; - cameraModel?: string; - exposureTime?: number; - aperture?: number; - flashUsed?: boolean; - focalLength?: number; - isoSpeed?: number; - meteringMode?: string; - sensor?: string; - exposureMode?: string; - colorSpace?: string; - whiteBalance?: string; - exposureBias?: number; - maxApertureValue?: number; - subjectDistance?: number; - lens?: string; - }; - videoMediaMetadata?: { - width?: number; - height?: number; - durationMillis?: number; - }; - spaces?: string[]; - isAppAuthorized?: boolean; - } + ownedByMe: boolean; + capabilities: { + canAddChildren: boolean; + canChangeRestrictedDownload: boolean; + canComment: boolean; + canCopy: boolean; + canDelete: boolean; + canDownload: boolean; + canEdit: boolean; + canListChildren: boolean; + canMoveItemIntoTeamDrive: boolean; + canMoveTeamDriveItem: boolean; + canReadRevisions: boolean; + canReadTeamDrive: boolean; + canRemoveChildren: boolean; + canRename: boolean; + canShare: boolean; + canTrash: boolean; + canUntrash: boolean; + }; + editable: boolean; + canComment: boolean; + canReadRevisions: boolean; + shareable: boolean; + copyable: boolean; + writersCanShare: boolean; + shared: boolean; + explicitlyTrashed: boolean; + trashingUser: { + kind: 'drive#user'; + displayName: string; + picture: { + url: string; + }; + isAuthenticatedUser: boolean; + permissionId: string; + emailAddress: string; + }; + trashedDate: Date; + appDataContents: boolean; + headRevisionId: string; + properties: PropertiesResource[]; + folderColorRgb: string; + imageMediaMetadata: { + width: number; + height: number; + rotation: number; + location: { + latitude: number; + longitude: number; + altitude: number; + }; + date: string; + cameraMake: string; + cameraModel: string; + exposureTime: number; + aperture: number; + flashUsed: boolean; + focalLength: number; + isoSpeed: number; + meteringMode: string; + sensor: string; + exposureMode: string; + colorSpace: string; + whiteBalance: string; + exposureBias: number; + maxApertureValue: number; + subjectDistance: number; + lens: string; + }; + videoMediaMetadata: { + width: number; + height: number; + durationMillis: number; + }; + spaces: string[]; + isAppAuthorized: boolean; + } - export interface FileListResource { - kind: 'drive#fileList'; - // etag - selfLink?: string; - nextPageToken?: string; - nextLink?: string; - incompleteSearch?: boolean; - items: FileResource[]; - } + interface FileListResource { + kind: 'drive#fileList'; + etag: string; + selfLink: string; + nextPageToken: string; + nextLink: string; + incompleteSearch: boolean; + items: FileResource[]; + } - export interface ParentResource { - kind: 'drive#parentReference'; - id?: string; - selfLink?: string; - parentLink?: string; - isRoot?: boolean; - } + interface ParentResource { + kind: 'drive#parentReference'; + id: string; + selfLink: string; + parentLink: string; + isRoot: boolean; + } - export interface PermissionResource { - kind: 'drive#permission'; - // etag - id?: string; - selfLink?: string; - name?: string; - emailAddress?: string; - domain?: string; - role?: string; - additionalRoles?: string[]; - type?: string; - value?: string; - authKey?: string; - withLink?: boolean; - photoLink?: string; - expirationDate?: Date; - teamDrivePermissionDetails?: { - teamDrivePermissionType?: string; - role?: string; - additionalRoles?: string[]; - inheritedFrom?: string; - inherited?: boolean; - }[]; - deleted?: boolean; - } + interface PermissionResource { + kind: 'drive#permission'; + etag: string; + id: string; + selfLink: string; + name: string; + emailAddress: string; + domain: string; + role: string; + additionalRoles: string[]; + type: string; + value: string; + authKey: string; + withLink: boolean; + photoLink: string; + expirationDate: Date; + teamDrivePermissionDetails: { + teamDrivePermissionType: string; + role: string; + additionalRoles: string[]; + inheritedFrom: string; + inherited: boolean; + }[]; + deleted: boolean; + } - export interface PropertiesResource { - kind: 'drive$property'; - // etag - selfLink?: string; - key?: string; - visibility?: string; - value?: string; - } + interface PropertiesResource { + kind: 'drive$property'; + etag: string; + selfLink: string; + key: string; + visibility: string; + value: string; + } - export interface WatchResource { - id?: string; - expiration?: number; - token?: string; - type?: string; - address?: string; - } + interface WatchResource { + id: string; + expiration: number; + token: string; + type: string; + address: string; + } - export interface ChannelResource { - kind: 'api#channel'; - id?: string; - resourceId?: string; - resourceUri?: string; - token?: string; - expiration?: number; + interface ChannelResource { + kind: 'api#channel'; + id: string; + resourceId: string; + resourceUri: string; + token: string; + expiration: number; + } + + interface IdsResource { + kind: 'drive#generatedIds'; + space: string; + ids: string[]; + } } } From 56fe50613524f1005ec89c229bb510241137593d Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Tue, 27 Jun 2017 17:30:57 -0400 Subject: [PATCH 49/55] [angular] Remove copyright header. --- types/angular/jqlite.d.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/types/angular/jqlite.d.ts b/types/angular/jqlite.d.ts index ee8eea9928..727e7718d7 100644 --- a/types/angular/jqlite.d.ts +++ b/types/angular/jqlite.d.ts @@ -22,19 +22,6 @@ // Leonard Thieu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/* ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ - // Definitions copied from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/0480c5ec87fab41aa23047a02b27f0ea71aaf975/types/jquery/v2/index.d.ts interface JQuery { From 7f6ae49875bdbdd9d2871a2c8d55319d048f3b9b Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Tue, 27 Jun 2017 14:33:28 -0700 Subject: [PATCH 50/55] Rename async.nexttick-test.ts to async.nexttick-tests.ts --- .../{async.nexttick-test.ts => async.nexttick-tests.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename types/async.nexttick/{async.nexttick-test.ts => async.nexttick-tests.ts} (100%) diff --git a/types/async.nexttick/async.nexttick-test.ts b/types/async.nexttick/async.nexttick-tests.ts similarity index 100% rename from types/async.nexttick/async.nexttick-test.ts rename to types/async.nexttick/async.nexttick-tests.ts From 6f62d6b556029db44b7e4b527f10efb70fa3bd7c Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Tue, 27 Jun 2017 14:33:53 -0700 Subject: [PATCH 51/55] Update tsconfig.json --- types/async.nexttick/tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/async.nexttick/tsconfig.json b/types/async.nexttick/tsconfig.json index 7bf5157ec4..16e1714611 100644 --- a/types/async.nexttick/tsconfig.json +++ b/types/async.nexttick/tsconfig.json @@ -1,4 +1,4 @@ -{ +s{ "compilerOptions": { "target": "es6", "module": "commonjs", @@ -18,7 +18,7 @@ }, "files": [ "index.d.ts", - "async.nexttick-test.ts" + "async.nexttick-tests.ts" ] } From 40a01c220ab44433ee014cea45daf7111a1718f5 Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Tue, 27 Jun 2017 15:01:08 -0700 Subject: [PATCH 52/55] Update tsconfig.json Typing is hard.... --- types/async.nexttick/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/async.nexttick/tsconfig.json b/types/async.nexttick/tsconfig.json index 16e1714611..68011bfd96 100644 --- a/types/async.nexttick/tsconfig.json +++ b/types/async.nexttick/tsconfig.json @@ -1,4 +1,4 @@ -s{ +{ "compilerOptions": { "target": "es6", "module": "commonjs", From 0439f1542d657c06e57e770fd2f9968a3a4cb4b6 Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Tue, 27 Jun 2017 15:14:01 -0700 Subject: [PATCH 53/55] Update tslint.json Fix up tslint.json --- types/async.nexttick/tslint.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/async.nexttick/tslint.json b/types/async.nexttick/tslint.json index 4c3a548997..d0858559ac 100644 --- a/types/async.nexttick/tslint.json +++ b/types/async.nexttick/tslint.json @@ -1,3 +1,3 @@ -{ - "extends": "dtslint/dtslint.json" +{ + "extends": "dtslint/dt.json" } From b684f1353171aaefa3e309e27faa44b1770164c5 Mon Sep 17 00:00:00 2001 From: Kevin Leung Date: Wed, 28 Jun 2017 06:21:16 +0800 Subject: [PATCH 54/55] [fabric] Lower case Boolean --- types/fabric/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/fabric/index.d.ts b/types/fabric/index.d.ts index 1596d7d428..96c4ec4e5a 100644 --- a/types/fabric/index.d.ts +++ b/types/fabric/index.d.ts @@ -3086,7 +3086,7 @@ interface ITextOptions extends IObjectOptions { textBackgroundColor?: string; path?: string; - useNative?: Boolean; + useNative?: boolean; text?: string; } export interface Text extends ITextOptions {} From 970140449f22ee0be56a225488bafc6b4bf61e98 Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Tue, 27 Jun 2017 15:26:30 -0700 Subject: [PATCH 55/55] Update index.d.ts --- types/async.nexttick/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/async.nexttick/index.d.ts b/types/async.nexttick/index.d.ts index 8971239963..22efd68fc7 100644 --- a/types/async.nexttick/index.d.ts +++ b/types/async.nexttick/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for async.nexttick 0.5.2 +// Type definitions for async.nexttick 0.5 // Project: https://www.npmjs.com/package/async.nexttick // Definitions by: Damien "pyrho" Rajon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped