From 1762c042d8ebbef3fd8a351799657d6329f7c3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hasan=20Tayyar=20BE=C5=9E=C4=B0K?= Date: Fri, 11 May 2018 10:12:12 +0200 Subject: [PATCH 01/28] open() is deprecated in mongoose >= 4.11.0 Breaking change in @Automattic/mongoose https://github.com/Automattic/mongoose/commit/dda165eebdb241397e9990440dc8e9c1f733db76#diff-259dec4414a400a6e895f16ff1d0ca3b --- types/mongoose/index.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 481b37c0a3..713448faec 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -190,6 +190,7 @@ declare module "mongoose" { /** * Opens the connection to MongoDB. + * @deprecated open() is deprecated in mongoose >= 4.11.0 * @param mongodb://uri or the host to which you are connecting * @param database database name * @param port database port @@ -200,6 +201,19 @@ declare module "mongoose" { */ open(connection_string: string, database?: string, port?: number, options?: ConnectionOpenOptions, callback?: (err: any) => void): any; + + /** + * Opens the connection to MongoDB. + * @param mongodb://uri or the host to which you are connecting + * @param database database name + * @param port database port + * @param options Mongoose forces the db option forceServerObjectId false and cannot be overridden. + * Mongoose defaults the server auto_reconnect options to true which can be overridden. + * See the node-mongodb-native driver instance for options that it understands. + * Options passed take precedence over options included in connection strings. + */ + openUri(connection_string: string, database?: string, port?: number, + options?: ConnectionOpenOptions, callback?: (err: any) => void): any; /** Helper for dropDatabase() */ dropDatabase(callback?: (err: any) => void): Promise; From b629667f8e17f6a9342898c71ff211eeec766b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hasan=20Tayyar=20BE=C5=9E=C4=B0K?= Date: Fri, 11 May 2018 10:59:00 +0200 Subject: [PATCH 02/28] types/mongoose version bump to 5.0.15 --- types/mongoose/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 713448faec..a28bfc6d84 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mongoose 5.0.14 +// Type definitions for Mongoose 5.0.15 // Project: http://mongoosejs.com/ // Definitions by: horiuchi // sindrenm From 44bfd4f2834db05d88aa05c9fb6712915934656f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hasan=20Tayyar=20BE=C5=9E=C4=B0K?= Date: Fri, 11 May 2018 10:59:17 +0200 Subject: [PATCH 03/28] add test for Connection.openUri --- types/mongoose/mongoose-tests.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index aaedb577d3..df4762c488 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -129,6 +129,12 @@ conn1.openSet('mongodb://localhost/test', 'db', { replset: null, mongos: true }, function (err) {}).then(cb).catch(cb); +conn1.openUri('mongodb://localhost/test', 'myDb', 27017, { + replset: null, + config: { + autoIndex: false + } +}, function (err) {}).open(''); conn1.close().catch(function (err) {}); conn1.collection('name').$format(999); conn1.model('myModel', new mongoose.Schema({}), 'myCol').find(); From 14458ce965c6a63d4e8665abbe7259ff118c033d Mon Sep 17 00:00:00 2001 From: Deividi Date: Fri, 11 May 2018 22:09:45 -0300 Subject: [PATCH 04/28] added render function --- types/react-text-mask/index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/react-text-mask/index.d.ts b/types/react-text-mask/index.d.ts index 7ed81429e0..6bdaba03bc 100644 --- a/types/react-text-mask/index.d.ts +++ b/types/react-text-mask/index.d.ts @@ -20,6 +20,9 @@ export interface MaskedInputProps extends React.InputHTMLAttributes false | string | { value: string, indexesOfPipedChars: number[] }; showMask?: boolean; + + render: (ref: MaskedInput, props: any) => any; + } export interface conformToMaskResult { From 16f2d8d59bb00b9e8e9368116f4c905441977b92 Mon Sep 17 00:00:00 2001 From: Deividi Date: Fri, 11 May 2018 22:24:05 -0300 Subject: [PATCH 05/28] Update index.d.ts --- types/react-text-mask/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-text-mask/index.d.ts b/types/react-text-mask/index.d.ts index 6bdaba03bc..843441d99a 100644 --- a/types/react-text-mask/index.d.ts +++ b/types/react-text-mask/index.d.ts @@ -21,7 +21,7 @@ export interface MaskedInputProps extends React.InputHTMLAttributes any; + render?: (ref: MaskedInput, props: any) => any; } From d53b06240780bb741a83f11f46b1e60c9ec4d80a Mon Sep 17 00:00:00 2001 From: cavarzan Date: Fri, 11 May 2018 22:39:54 -0300 Subject: [PATCH 06/28] fix lint --- types/react-text-mask/index.d.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/types/react-text-mask/index.d.ts b/types/react-text-mask/index.d.ts index 843441d99a..b2f3147667 100644 --- a/types/react-text-mask/index.d.ts +++ b/types/react-text-mask/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for react-text-mask 5.1 +// Type definitions for react-text-mask 5.4.1 // Project: https://github.com/text-mask/text-mask -// Definitions by: Guilherme Hübner +// Definitions by: Guilherme Hübner , Deividi Cavarzan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 -import * as React from "react"; +import * as React from 'react'; export type maskArray = Array; @@ -17,18 +17,17 @@ export interface MaskedInputProps extends React.InputHTMLAttributes false | string | { value: string, indexesOfPipedChars: number[] }; + pipe?: (conformedValue: string, config: any) => false | string | { value: string; indexesOfPipedChars: number[] }; showMask?: boolean; - - render?: (ref: MaskedInput, props: any) => any; + render?: (ref: MaskedInput, props: any) => any; } export interface conformToMaskResult { conformedValue: string; meta: { - someCharsRejected: boolean + someCharsRejected: boolean; }; } From ca07c3bfb46a6b5f2f02f49104f38188c1d6ecc1 Mon Sep 17 00:00:00 2001 From: Deividi Date: Fri, 11 May 2018 22:48:14 -0300 Subject: [PATCH 07/28] Update index.d.ts --- types/react-text-mask/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-text-mask/index.d.ts b/types/react-text-mask/index.d.ts index b2f3147667..d598fcf711 100644 --- a/types/react-text-mask/index.d.ts +++ b/types/react-text-mask/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-text-mask 5.4.1 +// Type definitions for react-text-mask 5.4 // Project: https://github.com/text-mask/text-mask // Definitions by: Guilherme Hübner , Deividi Cavarzan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From cef224b43ff060c8f5192aae022079c1a0841f66 Mon Sep 17 00:00:00 2001 From: Eugene Arshinov Date: Sat, 12 May 2018 18:55:15 +0300 Subject: [PATCH 08/28] Fix return type of `CKEDITOR.dom.element.getBogus` Dcoumentation link: https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_dom_element.html#method-getBogus --- types/ckeditor/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/ckeditor/index.d.ts b/types/ckeditor/index.d.ts index 3370479bff..ccc58b7f71 100644 --- a/types/ckeditor/index.d.ts +++ b/types/ckeditor/index.d.ts @@ -224,7 +224,7 @@ declare namespace CKEDITOR { focusPrevious(ignoreChildren?: boolean, indexToUse?: number): void; forEach(callback: (node: node) => void, type?: number, skipRoot?: boolean): void; getAttribute(name: string): string; - getBogus(): Object; + getBogus(): node|false; getChild(indices: number): node; getChild(indices: number[]): node; getChildCount(): number; From b92f5af5a1eeb100d1adf1bb2b0bd95bf689811b Mon Sep 17 00:00:00 2001 From: kento1218 Date: Mon, 14 May 2018 12:32:41 +0900 Subject: [PATCH 09/28] fix(bitcoinjs-lib): script templates * encodeStack should return Buffer[] * Signatures are assumed as Buffer, not ECSignature --- types/bitcoinjs-lib/bitcoinjs-lib-tests.ts | 19 +++++++++++++++++ types/bitcoinjs-lib/index.d.ts | 24 +++++++++++----------- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts index 669c00d77a..9576ba7289 100644 --- a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts +++ b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts @@ -41,3 +41,22 @@ bitcoin.address.toBase58Check(rsBase58Check.hash, rsBase58Check.version); bitcoin.address.toBech32(rsBech32.data, rsBech32.version, rsBech32.prefix); bitcoin.address.toOutputScript(address); bitcoin.address.toOutputScript(address, network); + +const redeemScript = bitcoin.script.multisig.output.encode( + 2, + [ + new Buffer('12345678901234567890123456789012'), + new Buffer('12345678901234567890123456789012'), + new Buffer('12345678901234567890123456789012'), + ] +); +bitcoin.script.scriptHash.input.encode( + bitcoin.script.multisig.input.encodeStack( + [ + new Buffer('12345678901234567890123456789012'), + new Buffer('12345678901234567890123456789012'), + ], + redeemScript, + ), + redeemScript, +); diff --git a/types/bitcoinjs-lib/index.d.ts b/types/bitcoinjs-lib/index.d.ts index 920df43d6e..a05c3532b6 100644 --- a/types/bitcoinjs-lib/index.d.ts +++ b/types/bitcoinjs-lib/index.d.ts @@ -467,8 +467,8 @@ export namespace script { check(script: Buffer, allowIncomplete: boolean): boolean; decode(buffer: Buffer): Array; decodeStack(stack: Buffer[], allowIncomplete: boolean): Array; - encode(signatures: ECSignature[], scriptPubKey: Buffer): Buffer; - encodeStack(signatures: ECSignature[], scriptPubKey: Buffer): ECSignature[]; + encode(signatures: Buffer[], scriptPubKey: Buffer): Buffer; + encodeStack(signatures: Buffer[], scriptPubKey: Buffer): Buffer[]; }; output: { check(script: Buffer, allowIncomplete: boolean): boolean; @@ -482,8 +482,8 @@ export namespace script { check(script: Buffer): boolean; decode(buffer: Buffer): Array; decodeStack(stack: Buffer[]): Array; - encode(signature: ECSignature): Buffer; - encodeStack(signature: ECSignature): ECSignature[]; + encode(signature: Buffer): Buffer; + encodeStack(signature: Buffer): Buffer[]; }; output: { @@ -496,10 +496,10 @@ export namespace script { const pubKeyHash: { input: { check(script: Buffer): boolean; - decode(buffer: Buffer): { signature: ECSignature; pubKey: Buffer }; - decodeStack(stack: Buffer[]): { signature: ECSignature; pubKey: Buffer }; - encode(signature: ECSignature, pubKey: Buffer): Buffer; - encodeStack(signature: ECSignature, pubKey: Buffer): [ECSignature, Buffer]; + decode(buffer: Buffer): { signature: Buffer; pubKey: Buffer }; + decodeStack(stack: Buffer[]): { signature: Buffer; pubKey: Buffer }; + encode(signature: Buffer, pubKey: Buffer): Buffer; + encodeStack(signature: Buffer, pubKey: Buffer): [Buffer, Buffer]; }; output: { @@ -515,7 +515,7 @@ export namespace script { decode(buffer: Buffer): { redeemScriptStack: Buffer[]; redeemScript: Buffer }; decodeStack(stack: Buffer[]): { redeemScriptStack: Buffer[]; redeemScript: Buffer }; encode(redeemScriptSig: Array, redeemScript: Buffer): Buffer; - encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer; + encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer[]; }; output: { @@ -536,8 +536,8 @@ export namespace script { const witnessPubKeyHash: { input: { check(script: Buffer): boolean; - decodeStack(stack: Buffer[]): { signature: ECSignature; pubKey: Buffer }; - encodeStack(signature: ECSignature, pubKey: Buffer): [ECSignature, Buffer]; + decodeStack(stack: Buffer[]): { signature: Buffer; pubKey: Buffer }; + encodeStack(signature: Buffer, pubKey: Buffer): [Buffer, Buffer]; }; output: { @@ -551,7 +551,7 @@ export namespace script { input: { check(script: Buffer, allowIncomplete: boolean): boolean; decodeStack(stack: Buffer[]): { redeemScriptStack: Buffer[]; redeemScript: Buffer }; - encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer; + encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer[]; }; output: { From 0ecc4bfaf6674f48ec495b630ea4d8d115eabcf8 Mon Sep 17 00:00:00 2001 From: kento1218 Date: Mon, 14 May 2018 15:30:33 +0900 Subject: [PATCH 10/28] fix(bitcoinjs-lib): bump. add author --- types/bitcoinjs-lib/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/bitcoinjs-lib/index.d.ts b/types/bitcoinjs-lib/index.d.ts index a05c3532b6..4efca7bd94 100644 --- a/types/bitcoinjs-lib/index.d.ts +++ b/types/bitcoinjs-lib/index.d.ts @@ -1,10 +1,11 @@ -// Type definitions for bitcoinjs-lib 3.3 +// Type definitions for bitcoinjs-lib 3.4 // Project: https://github.com/bitcoinjs/bitcoinjs-lib // Definitions by: Mohamed Hegazy // Daniel // Ron Buckton // Satana Charuwichitratana // Youssef GHOUBACH +// Kento // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Declaration file initially generated by dts-gen for bitcoinjs-lib 3.0.3 // based on the flow version found at https://github.com/flowtype/flow-typed/blob/master/definitions/npm/bitcoinjs-lib_v2.x.x/flow_v0.17.x-/bitcoinjs-lib_v2.x.x.js From 9ad6d029145bd16d582e017a5a5a70d9c90b4c42 Mon Sep 17 00:00:00 2001 From: Steve Hetzel Date: Mon, 14 May 2018 16:18:09 -0600 Subject: [PATCH 11/28] Adds 'success' and 'errors' properties to BatchResultInfo. Changes 'concurrencyMode' property to be optional since 'Parallel' is the default. Adds 'body' property to RequestInfo. Adds the ExecuteAnonymousResult interface. Changes Job.prototype.list() to return a BatchInfo[]. Adds tests. --- types/jsforce/batch.d.ts | 6 ++++-- types/jsforce/bulk.d.ts | 2 +- types/jsforce/connection.d.ts | 15 +++++++++++++-- types/jsforce/job.d.ts | 2 +- types/jsforce/jsforce-tests.ts | 27 ++++++++++++++++++++++++++- 5 files changed, 45 insertions(+), 7 deletions(-) diff --git a/types/jsforce/batch.d.ts b/types/jsforce/batch.d.ts index 94a24fa2cd..3314dcd33d 100644 --- a/types/jsforce/batch.d.ts +++ b/types/jsforce/batch.d.ts @@ -12,8 +12,10 @@ export interface BatchInfo { export interface BatchResultInfo { id: string; - batchId: string; - jobId: string; + batchId?: string; + jobId?: string; + success?: boolean; + errors?: string[]; } export class Batch extends Writable { diff --git a/types/jsforce/bulk.d.ts b/types/jsforce/bulk.d.ts index 51708f59f1..0356f1b9c6 100644 --- a/types/jsforce/bulk.d.ts +++ b/types/jsforce/bulk.d.ts @@ -8,7 +8,7 @@ import { Batch, BatchResultInfo } from './batch'; export interface BulkOptions { extIdField: string; - concurrencyMode: 'Serial' | 'Parallel'; + concurrencyMode?: 'Serial' | 'Parallel'; } type BulkLoadOperation = diff --git a/types/jsforce/connection.d.ts b/types/jsforce/connection.d.ts index 2283320912..27d79fdd5b 100644 --- a/types/jsforce/connection.d.ts +++ b/types/jsforce/connection.d.ts @@ -22,9 +22,10 @@ export interface PartialOAuth2Options { } export interface RequestInfo { + body?: string; + headers?: object; method?: string; url?: string; - headers?: object; } export interface ConnectionOptions extends PartialOAuth2Options { @@ -58,6 +59,16 @@ export abstract class RestApi { del(path: string, options: object, callback: () => object): Promise; } +export interface ExecuteAnonymousResult { + compiled: boolean; + compileProblem: string; + success: boolean; + line: number; + column: number; + exceptionMessage: string; + exceptionStackTrace: string; +} + export type ConnectionEvent = "refresh"; /** @@ -135,5 +146,5 @@ export class Tooling extends BaseConnection { _logger: any; // Specific to tooling - executeAnonymous(body: string, callback?: (err: Error, res: any) => void): Promise; + executeAnonymous(body: string, callback?: (err: Error, res: any) => void): Promise; } diff --git a/types/jsforce/job.d.ts b/types/jsforce/job.d.ts index bdad4bf564..519b8b6c10 100644 --- a/types/jsforce/job.d.ts +++ b/types/jsforce/job.d.ts @@ -19,6 +19,6 @@ export class Job extends EventEmitter { close(callback?: (err: Error, jobInfo: JobInfo) => void): Promise; createBatch(): Batch; info(callback?: (err: Error, jobInfo: JobInfo) => void): Promise; - list(callback?: (err: Error, jobInfo: BatchInfo) => void): Promise; + list(callback?: (err: Error, jobInfo: BatchInfo) => void): Promise; open(callback?: (err: Error, jobInfo: JobInfo) => void): Promise; } diff --git a/types/jsforce/jsforce-tests.ts b/types/jsforce/jsforce-tests.ts index 156b0d292b..0aa98d62d1 100644 --- a/types/jsforce/jsforce-tests.ts +++ b/types/jsforce/jsforce-tests.ts @@ -22,6 +22,14 @@ const salesforceConnection: sf.Connection = new sf.Connection({ salesforceConnection.sobject("Dummy").select(["thing", "other"]); +const requestInfo: sf.RequestInfo = { + body: '', + headers: {}, + method: '', + url: '' +}; +salesforceConnection.request(requestInfo); + // note the following should never compile: // salesforceConnection.sobject("Dummy").select(["lol"]); @@ -123,6 +131,17 @@ async function testAnalytics(conn: sf.Connection): Promise { }); } +async function testExecuteAnonymous(conn: sf.Connection): Promise { + const res: sf.ExecuteAnonymousResult = await salesforceConnection.tooling.executeAnonymous(''); + console.log('ExecuteAnonymousResult column: ' + res.column); + console.log('ExecuteAnonymousResult compiled: ' + res.compiled); + console.log('ExecuteAnonymousResult compileProblem: ' + res.compileProblem); + console.log('ExecuteAnonymousResult exceptionMessage: ' + res.exceptionMessage); + console.log('ExecuteAnonymousResult exceptionStackTrace: ' + res.exceptionStackTrace); + console.log('ExecuteAnonymousResult line: ' + res.line); + console.log('ExecuteAnonymousResult success: ' + res.success); +} + async function testMetadata(conn: sf.Connection): Promise { const md: sf.Metadata = conn.metadata; const m: sf.DescribeMetadataResult = await md.describe('34.0'); @@ -281,6 +300,7 @@ async function testChatter(conn: sf.Connection): Promise { await testAnalytics(salesforceConnection); await testChatter(salesforceConnection); await testMetadata(salesforceConnection); + await testExecuteAnonymous(salesforceConnection); })(); const oauth2 = new sf.OAuth2({ @@ -302,7 +322,7 @@ batch.on("queue", (batchInfo) => { // fired when batch request is queued in serv }); job.batch("batchId"); batch.poll(1000, 20000); -batch.on("response", (rets) => { +batch.on("response", (rets: sf.BatchResultInfo[]) => { for (let i = 0; i < rets.length; i++) { if (rets[i].success) { console.log(`# ${(i + 1)} loaded successfully, id = ${rets[i].id}`); @@ -312,6 +332,11 @@ batch.on("response", (rets) => { } }); +(async () => { + const batchInfos: sf.BatchInfo[] = await job.list(); + console.log('batchInfos:', batchInfos); +}); + salesforceConnection.streaming.topic("InvoiceStatementUpdates").subscribe((message) => { console.log('Event Type : ' + message.event.type); console.log('Event Created : ' + message.event.createdDate); From a351eaac271acd7f4f797d462a4555f4e780c28b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Machist=C3=A9=20Quintana?= Date: Mon, 14 May 2018 17:49:54 -0700 Subject: [PATCH 12/28] Add support for chunks filter function in SplitChunksPlugin --- types/webpack/index.d.ts | 4 ++-- types/webpack/webpack-tests.ts | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index 5be4abdcbd..4dcd7ce89e 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -560,7 +560,7 @@ declare namespace webpack { /** Assign modules to a cache group */ test?: ((...args: any[]) => boolean) | string | RegExp; /** Select chunks for determining cache group content (defaults to \"initial\", \"initial\" and \"all\" requires adding these chunks to the HTML) */ - chunks?: "initial" | "async" | "all"; + chunks?: "initial" | "async" | "all" | ((chunk: any, index?: number, chunks?: any[]) => boolean); /** Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group */ enforce?: boolean; /** Priority of this cache group */ @@ -580,7 +580,7 @@ declare namespace webpack { } interface SplitChunksOptions { /** Select chunks for determining shared modules (defaults to \"async\", \"initial\" and \"all\" requires adding these chunks to the HTML) */ - chunks?: "initial" | "async" | "all"; + chunks?: "initial" | "async" | "all" | ((chunk: any, index?: number, chunks?: any[]) => boolean); /** Minimal size for the created chunk */ minSize?: number; /** Minimum number of times a module has to be duplicated until it's considered for splitting */ diff --git a/types/webpack/webpack-tests.ts b/types/webpack/webpack-tests.ts index b42d836c0c..d617c45a17 100644 --- a/types/webpack/webpack-tests.ts +++ b/types/webpack/webpack-tests.ts @@ -607,6 +607,27 @@ configuration = { }, }; +configuration = { + mode: "production", + optimization: { + splitChunks: { + cacheGroups: { + common: { + name: 'common', + chunks(chunk: { name: string }) { + const allowedChunks = [ + 'renderer', + 'component-window', + ]; + return allowedChunks.indexOf(chunk.name) >= 0; + }, + minChunks: 2 + } + } + } + }, +}; + plugin = new webpack.SplitChunksPlugin({ chunks: "async", minChunks: 2 }); class SingleEntryDependency extends webpack.compilation.Dependency {} From 815129e0bb65899edc696a619554700dbbcc990e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Machist=C3=A9=20Quintana?= Date: Mon, 14 May 2018 18:03:37 -0700 Subject: [PATCH 13/28] Use a less strict function type for chunks --- types/webpack/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index 4dcd7ce89e..fb8469dfa5 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -560,7 +560,7 @@ declare namespace webpack { /** Assign modules to a cache group */ test?: ((...args: any[]) => boolean) | string | RegExp; /** Select chunks for determining cache group content (defaults to \"initial\", \"initial\" and \"all\" requires adding these chunks to the HTML) */ - chunks?: "initial" | "async" | "all" | ((chunk: any, index?: number, chunks?: any[]) => boolean); + chunks?: "initial" | "async" | "all" | ((chunk: any) => boolean); /** Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group */ enforce?: boolean; /** Priority of this cache group */ @@ -580,7 +580,7 @@ declare namespace webpack { } interface SplitChunksOptions { /** Select chunks for determining shared modules (defaults to \"async\", \"initial\" and \"all\" requires adding these chunks to the HTML) */ - chunks?: "initial" | "async" | "all" | ((chunk: any, index?: number, chunks?: any[]) => boolean); + chunks?: "initial" | "async" | "all" | ((chunk: any) => boolean); /** Minimal size for the created chunk */ minSize?: number; /** Minimum number of times a module has to be duplicated until it's considered for splitting */ From d1023531fa92cd749c3613ebd97ccab7aae06f67 Mon Sep 17 00:00:00 2001 From: Holger Jeromin Date: Tue, 15 May 2018 12:32:27 +0200 Subject: [PATCH 14/28] jquery: Add overload for on() handler --- types/jquery/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index 8422f3ec5c..d6f09cb54d 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -4553,7 +4553,7 @@ interface JQuery extends Iterable * @since 1.7 */ on(events: string, - handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + handler: JQuery.EventHandler | JQuery.EventHandlerBase> | ((event: JQueryEventObject) => void) | false): this; /** * Attach an event handler function for one or more events to the selected elements. * From afbcc5cfe0082bc9f64c9ed6f985a9358cd6f4b3 Mon Sep 17 00:00:00 2001 From: Holger Jeromin Date: Tue, 15 May 2018 14:20:56 +0200 Subject: [PATCH 15/28] adding test --- types/jquery/jquery-tests.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/types/jquery/jquery-tests.ts b/types/jquery/jquery-tests.ts index 5d6aaf0680..7375c5e814 100644 --- a/types/jquery/jquery-tests.ts +++ b/types/jquery/jquery-tests.ts @@ -3701,6 +3701,14 @@ function JQuery() { event; }); + // $ExpectType JQuery + $('table').on('myEvent', function(event: JQueryEventObject) { + // $ExpectType HTMLElement + this; + // $ExpectType JQueryEventObject + event; + }); + // $ExpectType JQuery $('table').on('myEvent', function(this: I1, event) { // $ExpectType I1 From c0c5afcf499dd1be30aed75e7e90f02c5fd6c903 Mon Sep 17 00:00:00 2001 From: Holger Jeromin Date: Tue, 15 May 2018 14:39:13 +0200 Subject: [PATCH 16/28] fixing tests --- types/jquery/index.d.ts | 12 +++++++++++- types/jquery/jquery-tests.ts | 24 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index d6f09cb54d..9f955ef9d2 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -4553,7 +4553,17 @@ interface JQuery extends Iterable * @since 1.7 */ on(events: string, - handler: JQuery.EventHandler | JQuery.EventHandlerBase> | ((event: JQueryEventObject) => void) | false): this; + handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/on/} + * @since 1.7 + */ + on(events: string, + handler: ((event: JQueryEventObject) => void)): this; /** * Attach an event handler function for one or more events to the selected elements. * diff --git a/types/jquery/jquery-tests.ts b/types/jquery/jquery-tests.ts index 7375c5e814..5beb6c1a6e 100644 --- a/types/jquery/jquery-tests.ts +++ b/types/jquery/jquery-tests.ts @@ -3709,6 +3709,30 @@ function JQuery() { event; }); + // $ExpectType JQuery + $('table').on('myEvent', function(event: JQueryInputEventObject) { + // $ExpectType HTMLElement + this; + // $ExpectType JQueryInputEventObject + event; + }); + + // $ExpectType JQuery + $('table').on('myEvent', function(event: JQueryMouseEventObject) { + // $ExpectType HTMLElement + this; + // $ExpectType JQueryMouseEventObject + event; + }); + + // $ExpectType JQuery + $('table').on('myEvent', function(event: JQueryKeyEventObject) { + // $ExpectType HTMLElement + this; + // $ExpectType JQueryKeyEventObject + event; + }); + // $ExpectType JQuery $('table').on('myEvent', function(this: I1, event) { // $ExpectType I1 From 68b3a85dfeb9e25cd7208658418c3b90561c2f27 Mon Sep 17 00:00:00 2001 From: Holger Jeromin Date: Tue, 15 May 2018 14:48:40 +0200 Subject: [PATCH 17/28] fixing trailing whitespace --- types/jquery/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index 9f955ef9d2..981993e2d7 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -4558,12 +4558,12 @@ interface JQuery extends Iterable * Attach an event handler function for one or more events to the selected elements. * * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param handler A function to execute when the event is triggered. + * @param handler A function to execute when the event is triggered. * @see {@link https://api.jquery.com/on/} * @since 1.7 */ on(events: string, - handler: ((event: JQueryEventObject) => void)): this; + handler: ((event: JQueryEventObject) => void)): this; /** * Attach an event handler function for one or more events to the selected elements. * From b4fed84066e23a469b91ef66ad0d7dc5ba44cb21 Mon Sep 17 00:00:00 2001 From: Holger Jeromin Date: Tue, 15 May 2018 15:34:55 +0200 Subject: [PATCH 18/28] add DocumentFragement to allowed jQuery objects --- types/jquery/index.d.ts | 2 +- types/jquery/jquery-tests.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index 8422f3ec5c..634771e4e7 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -5565,7 +5565,7 @@ interface Iterable { } declare namespace JQuery { type TypeOrArray = T | T[]; - type Node = Element | Text | Comment; + type Node = Element | Text | Comment | DocumentFragment; /** * A string is designated htmlString in jQuery documentation when it is used to represent one or more diff --git a/types/jquery/jquery-tests.ts b/types/jquery/jquery-tests.ts index 5d6aaf0680..0e68fcee2c 100644 --- a/types/jquery/jquery-tests.ts +++ b/types/jquery/jquery-tests.ts @@ -5153,7 +5153,7 @@ function JQuery() { function manipulation() { function after() { // $ExpectType JQuery - $('p').after('

', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()]); + $('p').after('

', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()], document.createDocumentFragment()); // $ExpectType JQuery $('p').after(function(index, html) { @@ -5218,7 +5218,7 @@ function JQuery() { function append() { // $ExpectType JQuery - $('p').append('

', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()]); + $('p').append('

', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()], document.createDocumentFragment()); // $ExpectType JQuery $('p').append(function(index, html) { @@ -5286,7 +5286,7 @@ function JQuery() { function before() { // $ExpectType JQuery - $('p').before('

', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()]); + $('p').before('

', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()], document.createDocumentFragment()); // $ExpectType JQuery $('p').before(function(index, html) { @@ -5351,7 +5351,7 @@ function JQuery() { function prepend() { // $ExpectType JQuery - $('p').prepend('

', new Element(), new Text(), $('p').contents(), [new Element(), new Text()], [new Element(), $('p').contents()]); + $('p').prepend('

', new Element(), new Text(), $('p').contents(), [new Element(), new Text()], [new Element(), $('p').contents()], document.createDocumentFragment()); // $ExpectType JQuery $('p').prepend(function(index, html) { From ab7ede4820deeb1a74f71ca41f0833b2626b0e4c Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Tue, 15 May 2018 12:16:26 -0700 Subject: [PATCH 19/28] fix(vision): fix incorrect interface extension --- types/vision/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/vision/index.d.ts b/types/vision/index.d.ts index 757d2a5383..1c4e2ddc33 100644 --- a/types/vision/index.d.ts +++ b/types/vision/index.d.ts @@ -242,7 +242,7 @@ declare module 'hapi' { } declare module 'hapi' { - interface RouteOptions { + interface HandlerDecorations { /** * The view handler can be used with routes registered in the same realm as the view manager. * The handler takes an options parameter that can be either a string or an object. From 6744394a0aa73230d72b0f72620e2d11952c14f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Machist=C3=A9=20Quintana?= Date: Tue, 15 May 2018 14:04:28 -0700 Subject: [PATCH 20/28] Bump webpack typings to v4.4.x --- 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 fb8469dfa5..89b12ef1dd 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for webpack 4.1 +// Type definitions for webpack 4.4 // Project: https://github.com/webpack/webpack // Definitions by: Qubo // Benjamin Lim From 3ef1d0d822b95e8eb4ab5be16d8afb62095bdc9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Machist=C3=A9=20Quintana?= Date: Tue, 15 May 2018 14:42:52 -0700 Subject: [PATCH 21/28] Use the actual compilation.Chunk type instead of any --- types/webpack/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index 89b12ef1dd..b49c235d30 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -560,7 +560,7 @@ declare namespace webpack { /** Assign modules to a cache group */ test?: ((...args: any[]) => boolean) | string | RegExp; /** Select chunks for determining cache group content (defaults to \"initial\", \"initial\" and \"all\" requires adding these chunks to the HTML) */ - chunks?: "initial" | "async" | "all" | ((chunk: any) => boolean); + chunks?: "initial" | "async" | "all" | ((chunk: compilation.Chunk) => boolean); /** Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group */ enforce?: boolean; /** Priority of this cache group */ @@ -580,7 +580,7 @@ declare namespace webpack { } interface SplitChunksOptions { /** Select chunks for determining shared modules (defaults to \"async\", \"initial\" and \"all\" requires adding these chunks to the HTML) */ - chunks?: "initial" | "async" | "all" | ((chunk: any) => boolean); + chunks?: "initial" | "async" | "all" | ((chunk: compilation.Chunk) => boolean); /** Minimal size for the created chunk */ minSize?: number; /** Minimum number of times a module has to be duplicated until it's considered for splitting */ From c1c69f49136c0b172e85babee8fff3b6a60b58f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Machist=C3=A9=20Quintana?= Date: Tue, 15 May 2018 14:44:42 -0700 Subject: [PATCH 22/28] Update chunks function test to use updated type --- types/webpack/webpack-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/webpack/webpack-tests.ts b/types/webpack/webpack-tests.ts index d617c45a17..3f99d4704f 100644 --- a/types/webpack/webpack-tests.ts +++ b/types/webpack/webpack-tests.ts @@ -614,7 +614,7 @@ configuration = { cacheGroups: { common: { name: 'common', - chunks(chunk: { name: string }) { + chunks(chunk: webpack.compilation.Chunk) { const allowedChunks = [ 'renderer', 'component-window', From 7007542e784f343a1d9e9a16ef7991a27f656bd6 Mon Sep 17 00:00:00 2001 From: Holger Jeromin Date: Wed, 16 May 2018 11:29:25 +0200 Subject: [PATCH 23/28] adding JQueryEventObject to all on handlers and fix tests --- types/jquery/index.d.ts | 44 ++++++++++++++++++++++++++++++++++-- types/jquery/jquery-tests.ts | 32 ++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index 981993e2d7..9aa6be68a2 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -4517,6 +4517,21 @@ interface JQuery extends Iterable selector: JQuery.Selector | null, data: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/on/} + * @since 1.7 + */ + on(events: string, + selector: JQuery.Selector | null, + data: TData, + handler: ((event: JQueryEventObject) => void)): this; // tslint:disable-line:unified-signatures /** * Attach an event handler function for one or more events to the selected elements. * @@ -4532,6 +4547,19 @@ interface JQuery extends Iterable selector: JQuery.Selector, handler: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the + * selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/on/} + * @since 1.7 + */ + on(events: string, + selector: JQuery.Selector, + handler: ((event: JQueryEventObject) => void)): this; // tslint:disable-line:unified-signatures + /** * Attach an event handler function for one or more events to the selected elements. * * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". @@ -4543,7 +4571,19 @@ interface JQuery extends Iterable on(events: string, data: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. + * @see {@link https://api.jquery.com/on/} + * @since 1.7 + */ + on(events: string, + data: TData, + handler: ((event: JQueryEventObject) => void)): this; // tslint:disable-line:unified-signatures +/** * Attach an event handler function for one or more events to the selected elements. * * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". @@ -4563,7 +4603,7 @@ interface JQuery extends Iterable * @since 1.7 */ on(events: string, - handler: ((event: JQueryEventObject) => void)): this; + handler: ((event: JQueryEventObject) => void)): this; // tslint:disable-line:unified-signatures /** * Attach an event handler function for one or more events to the selected elements. * diff --git a/types/jquery/jquery-tests.ts b/types/jquery/jquery-tests.ts index 5beb6c1a6e..0cceb359b5 100644 --- a/types/jquery/jquery-tests.ts +++ b/types/jquery/jquery-tests.ts @@ -3634,6 +3634,14 @@ function JQuery() { event; }); + // $ExpectType JQuery + $('table').on('myEvent', 'td', 'myData', function(event: JQueryEventObject) { + // $ExpectType HTMLElement + this; + // $ExpectType JQueryEventObject + event; + }); + // $ExpectType JQuery $('table').on('myEvent', 'td', 'myData', function(this: I1, event) { // $ExpectType I1 @@ -3650,6 +3658,14 @@ function JQuery() { event; }); + // $ExpectType JQuery + $('table').on('myEvent', null, 'myData', function(event: JQueryEventObject) { + // $ExpectType HTMLElement + this; + // $ExpectType JQueryEventObject + event; + }); + // $ExpectType JQuery $('table').on('myEvent', null, 'myData', function(this: I1, event) { // $ExpectType I1 @@ -3666,6 +3682,14 @@ function JQuery() { event; }); + // $ExpectType JQuery + $('table').on('myEvent', 'td', function(event: JQueryEventObject) { + // $ExpectType HTMLElement + this; + // $ExpectType JQueryEventObject + event; + }); + // $ExpectType JQuery $('table').on('myEvent', 'td', function(this: I1, event) { // $ExpectType I1 @@ -3685,6 +3709,14 @@ function JQuery() { event; }); + // $ExpectType JQuery + $('table').on('myEvent', 3, function(event: JQueryEventObject) { + // $ExpectType HTMLElement + this; + // $ExpectType JQueryEventObject + event; + }); + // $ExpectType JQuery $('table').on('myEvent', 3, function(this: I1, event) { // $ExpectType I1 From cda7bba75c60c9d7e6473db4981aa8b79eada7c4 Mon Sep 17 00:00:00 2001 From: Holger Jeromin Date: Wed, 16 May 2018 11:47:48 +0200 Subject: [PATCH 24/28] asterisks fix --- types/jquery/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index 9aa6be68a2..be4b2f2346 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -4559,7 +4559,7 @@ interface JQuery extends Iterable on(events: string, selector: JQuery.Selector, handler: ((event: JQueryEventObject) => void)): this; // tslint:disable-line:unified-signatures - /** + /** * Attach an event handler function for one or more events to the selected elements. * * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". @@ -4571,7 +4571,7 @@ interface JQuery extends Iterable on(events: string, data: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; - /** + /** * Attach an event handler function for one or more events to the selected elements. * * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". @@ -4583,7 +4583,7 @@ interface JQuery extends Iterable on(events: string, data: TData, handler: ((event: JQueryEventObject) => void)): this; // tslint:disable-line:unified-signatures -/** + /** * Attach an event handler function for one or more events to the selected elements. * * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". From 4461c0f21189a7677c450fd45d7642b01d722f25 Mon Sep 17 00:00:00 2001 From: islishude Date: Wed, 16 May 2018 20:12:20 +0800 Subject: [PATCH 25/28] feat(bitcoinjs-lib): add bech32 field to Network interface --- types/bitcoinjs-lib/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/bitcoinjs-lib/index.d.ts b/types/bitcoinjs-lib/index.d.ts index 1e8255e7ef..f099f77ecb 100644 --- a/types/bitcoinjs-lib/index.d.ts +++ b/types/bitcoinjs-lib/index.d.ts @@ -27,6 +27,7 @@ export interface In { } export interface Network { + bech32?: string, bip32: { public: number; private: number; From 7da1141f4ea59a19e51327d55e78620cbcfceae6 Mon Sep 17 00:00:00 2001 From: Oliver Joseph Ash Date: Wed, 16 May 2018 13:13:56 +0100 Subject: [PATCH 26/28] Node: add `undefined` to `ParsedUrlQuery` index signature --- types/node/index.d.ts | 2 +- types/node/v8/index.d.ts | 2 +- types/node/v9/index.d.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index b26ea63807..d964a41c43 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -991,7 +991,7 @@ declare module "querystring" { decodeURIComponent?: Function; } - interface ParsedUrlQuery { [key: string]: string | string[]; } + interface ParsedUrlQuery { [key: string]: string | string[] | undefined; } export function stringify(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string; export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index 32530306c2..27014e0cb0 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -895,7 +895,7 @@ declare module "querystring" { decodeURIComponent?: Function; } - interface ParsedUrlQuery { [key: string]: string | string[]; } + interface ParsedUrlQuery { [key: string]: string | string[] | undefined; } export function stringify(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string; export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; diff --git a/types/node/v9/index.d.ts b/types/node/v9/index.d.ts index e7112daa25..014fd9bac1 100644 --- a/types/node/v9/index.d.ts +++ b/types/node/v9/index.d.ts @@ -982,7 +982,7 @@ declare module "querystring" { decodeURIComponent?: Function; } - interface ParsedUrlQuery { [key: string]: string | string[]; } + interface ParsedUrlQuery { [key: string]: string | string[] | undefined; } export function stringify(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string; export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; From 47fab38e3261c07e8ed7867e215a7a8c8d0dd3f3 Mon Sep 17 00:00:00 2001 From: islishude Date: Wed, 16 May 2018 20:25:36 +0800 Subject: [PATCH 27/28] fix: fix typo --- types/bitcoinjs-lib/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/bitcoinjs-lib/index.d.ts b/types/bitcoinjs-lib/index.d.ts index f099f77ecb..a1870263e0 100644 --- a/types/bitcoinjs-lib/index.d.ts +++ b/types/bitcoinjs-lib/index.d.ts @@ -27,7 +27,7 @@ export interface In { } export interface Network { - bech32?: string, + bech32?: string; bip32: { public: number; private: number; From 51dfb8cc7a7b63c6f7f4af73a67e40af748dee9b Mon Sep 17 00:00:00 2001 From: Sagie Maoz Date: Wed, 16 May 2018 18:32:16 -0400 Subject: [PATCH 28/28] add types for @mapbox/geojson-area --- types/mapbox__geojson-area/index.d.ts | 12 ++++++++++ .../mapbox__geojson-area-tests.ts | 21 +++++++++++++++++ types/mapbox__geojson-area/tsconfig.json | 23 +++++++++++++++++++ types/mapbox__geojson-area/tslint.json | 1 + 4 files changed, 57 insertions(+) create mode 100644 types/mapbox__geojson-area/index.d.ts create mode 100644 types/mapbox__geojson-area/mapbox__geojson-area-tests.ts create mode 100644 types/mapbox__geojson-area/tsconfig.json create mode 100644 types/mapbox__geojson-area/tslint.json diff --git a/types/mapbox__geojson-area/index.d.ts b/types/mapbox__geojson-area/index.d.ts new file mode 100644 index 0000000000..5c622342d8 --- /dev/null +++ b/types/mapbox__geojson-area/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for @mapbox/geojson-area 0.2 +// Project: https://github.com/mapbox/geojson-area#readme +// Definitions by: Sagie Maoz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// tslint:disable-next-line no-single-declare-module +declare module "@mapbox/geojson-area" { + import { Geometry } from 'geojson'; + + function geometry(geo: Geometry): number; +} diff --git a/types/mapbox__geojson-area/mapbox__geojson-area-tests.ts b/types/mapbox__geojson-area/mapbox__geojson-area-tests.ts new file mode 100644 index 0000000000..b7d0803372 --- /dev/null +++ b/types/mapbox__geojson-area/mapbox__geojson-area-tests.ts @@ -0,0 +1,21 @@ +import { geometry } from '@mapbox/geojson-area'; + +// Using a polygon argument +// $ExpectType number +geometry({ + type: "Polygon", + coordinates: [ + [ + [170.0, 45.0], [180.0, 45.0] + ], [ + [-180.0, 45.0], [-170.0, 45.0] + ] + ] +}); + +// Using a point argument +// $ExpectType number +geometry({ + type: "Point", + coordinates: [12, 23] +}); diff --git a/types/mapbox__geojson-area/tsconfig.json b/types/mapbox__geojson-area/tsconfig.json new file mode 100644 index 0000000000..0009348b22 --- /dev/null +++ b/types/mapbox__geojson-area/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "mapbox__geojson-area-tests.ts" + ] +} diff --git a/types/mapbox__geojson-area/tslint.json b/types/mapbox__geojson-area/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mapbox__geojson-area/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }