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 1e8255e7ef..2d0603b87c 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 @@ -27,6 +28,7 @@ export interface In { } export interface Network { + bech32?: string; bip32: { public: number; private: number; @@ -468,8 +470,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; @@ -483,8 +485,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: { @@ -497,10 +499,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: { @@ -516,7 +518,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: { @@ -537,8 +539,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: { @@ -552,7 +554,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: { 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; diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index 8422f3ec5c..b0838f9a8d 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. * @@ -4531,6 +4546,19 @@ interface JQuery extends Iterable on(events: string, 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. * @@ -4543,6 +4571,18 @@ 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. * @@ -4554,6 +4594,16 @@ interface JQuery extends Iterable */ on(events: string, 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; // tslint:disable-line:unified-signatures /** * Attach an event handler function for one or more events to the selected elements. * @@ -5565,7 +5615,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..47a85b80d2 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 @@ -3701,6 +3733,38 @@ function JQuery() { event; }); + // $ExpectType JQuery + $('table').on('myEvent', function(event: JQueryEventObject) { + // $ExpectType HTMLElement + this; + // $ExpectType JQueryEventObject + 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 @@ -5153,7 +5217,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 +5282,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 +5350,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 +5415,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) { 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); 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" } diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 481b37c0a3..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 @@ -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; 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(); 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; diff --git a/types/react-text-mask/index.d.ts b/types/react-text-mask/index.d.ts index 7ed81429e0..d598fcf711 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 // 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,15 +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; } export interface conformToMaskResult { conformedValue: string; meta: { - someCharsRejected: boolean + someCharsRejected: boolean; }; } 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. diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index 403036d378..0339a4ebb5 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 @@ -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: 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"; + 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 */ diff --git a/types/webpack/webpack-tests.ts b/types/webpack/webpack-tests.ts index ec5d0236a8..b7b9ca8913 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: webpack.compilation.Chunk) { + 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 {}