From e5545e729bb7b6c76816800e9d39ccdd21b147fa Mon Sep 17 00:00:00 2001 From: "Andrew Stiegmann (stieg)" Date: Thu, 18 Jan 2018 15:56:13 -1000 Subject: [PATCH 01/23] Add `usePushEach` flag to Mongoose Schema Options In order for devs to be able to work around the issues described in https://github.com/Automattic/mongoose/issues/5574 we need to be able to supply the `usePushEach` flag to the Mongoose SchemaOptions. This options functionality is described in https://github.com/Automattic/mongoose/issues/4455 and is required for anyone who modifies arrays inline who is using Mongoose 4 and MongoDB 3.6+ Testing: Copied changes to local project and verified compilation worked. --- types/mongoose/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 3e676b499f..ee703de783 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -815,6 +815,8 @@ declare module "mongoose" { typeKey?: string; /** defaults to false */ useNestedStrict?: boolean; + /** defaults to false */ + usePushEach?: boolean; /** defaults to true */ validateBeforeSave?: boolean; /** defaults to "__v" */ From 52ee72c24ca35d99bd876d20de674aef840b2b0b Mon Sep 17 00:00:00 2001 From: Danny Cochran Date: Fri, 8 Jun 2018 09:58:35 -0700 Subject: [PATCH 02/23] plugin function expects SuperAgentRequest the plugin function actually takes a SuperAgentRequest, which includes properties like url, method, cookies, and agent. --- types/superagent/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/superagent/index.d.ts b/types/superagent/index.d.ts index 7daf5f47dc..e5a52ce3cd 100644 --- a/types/superagent/index.d.ts +++ b/types/superagent/index.d.ts @@ -150,7 +150,7 @@ declare namespace request { write(data: string | Buffer, encoding?: string): this; } - type Plugin = (req: Request) => void; + type Plugin = (req: SuperAgentRequest) => void; interface ProgressEvent { direction: 'download' | 'upload'; From cdf9084e9a1278b23a490fa76008fbace96ee389 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Mon, 11 Jun 2018 16:36:14 -0700 Subject: [PATCH 03/23] Adding Dialog oject --- types/office-js/index.d.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index e4cb2bb0cc..926b344a88 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -624,6 +624,7 @@ declare namespace Office { */ closeContainer(): void; } + /** * Provides information about what Requirement Sets are supported in current environment. */ @@ -634,7 +635,26 @@ declare namespace Office { * @param minVersion - The minimum required version; e.g., "1.4". */ isSetSupported(name: string, minVersion?: number): boolean; -} + } + + /** + * The object that is returned when `UI.displayDialogAsync` is called. + */ + interface Dialog { + /** + * Called from a parent page to close the corresponding dialog box. + */ + close(): void; + /** + * Registers an event handler. The two supported events are: + * + * - DialogMessageReceived. Triggered when the dialog box sends a message to its parent. + * + * - DialogEventReceived. Triggered when the dialog box has been closed or otherwise unloaded. + */ + addEventHandler(eventType: Office.EventType, handler: Function): void; + } + /** * Provides options for how a dialog is displayed. */ From e628172bc5d322666e6f0837ba1adf7849bb6594 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 12 Jun 2018 12:34:24 -0700 Subject: [PATCH 04/23] add tests for SuperAgent request --- types/superagent/superagent-tests.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/types/superagent/superagent-tests.ts b/types/superagent/superagent-tests.ts index 66046759f1..46766f8d9e 100644 --- a/types/superagent/superagent-tests.ts +++ b/types/superagent/superagent-tests.ts @@ -390,3 +390,18 @@ request .then(response => { // reads 404 page as a successful response }); + +// Test that the "Plugin" type from "use" provides a SuperAgentRequest rather than a Request, +// which has additional properties. +const echoPlugin = (request: request.SuperAgentRequest) => { + req.url = '' + req.url; + req.cookies = '' + req.cookies; + if (req.method) { + req.url = '/echo' + } +}; + +request + .get('/echo') + .use(echoPlugin) + .end(); \ No newline at end of file From 7bf6b02b0e9a1139967ecb5079eacbe25465a4db Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 12 Jun 2018 12:38:22 -0700 Subject: [PATCH 05/23] add trailing newline --- types/superagent/superagent-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/superagent/superagent-tests.ts b/types/superagent/superagent-tests.ts index 46766f8d9e..b2e00c6698 100644 --- a/types/superagent/superagent-tests.ts +++ b/types/superagent/superagent-tests.ts @@ -404,4 +404,4 @@ const echoPlugin = (request: request.SuperAgentRequest) => { request .get('/echo') .use(echoPlugin) - .end(); \ No newline at end of file + .end(); From 9831f24f344177a787b2fc42ba8e46d5ff59c466 Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 13 Jun 2018 13:24:01 -0700 Subject: [PATCH 06/23] Switching to type rename --- types/office-js/index.d.ts | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 926b344a88..fc1e5fd974 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -637,24 +637,6 @@ declare namespace Office { isSetSupported(name: string, minVersion?: number): boolean; } - /** - * The object that is returned when `UI.displayDialogAsync` is called. - */ - interface Dialog { - /** - * Called from a parent page to close the corresponding dialog box. - */ - close(): void; - /** - * Registers an event handler. The two supported events are: - * - * - DialogMessageReceived. Triggered when the dialog box sends a message to its parent. - * - * - DialogEventReceived. Triggered when the dialog box has been closed or otherwise unloaded. - */ - addEventHandler(eventType: Office.EventType, handler: Function): void; - } - /** * Provides options for how a dialog is displayed. */ @@ -1048,11 +1030,11 @@ declare namespace Office { controlForegroundColor: string; } /** - * Dialog object returned as part of the displayDialogAsync callback. The object exposes methods for registering event handlers and closing the dialog + * The object that is returned when `UI.displayDialogAsync` is called. */ - interface DialogHandler { + interface Dialog { /** - * When called from an active add-in dialog, asynchronously closes the dialog. + * Called from a parent page to close the corresponding dialog box. */ close(): void; /** From 5431383a5123bda1b00130b0baf45e47a397032a Mon Sep 17 00:00:00 2001 From: Alex Jerabek Date: Wed, 13 Jun 2018 13:42:39 -0700 Subject: [PATCH 07/23] Embellishing comment --- types/office-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index a54b1fdff0..daedd2040d 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -1030,7 +1030,7 @@ declare namespace Office { controlForegroundColor: string; } /** - * The object that is returned when `UI.displayDialogAsync` is called. + * The object that is returned when `UI.displayDialogAsync` is called. It exposes methods for registering event handlers and closing the dialog. */ interface Dialog { /** From c37b9bf467d1d1302382ea74b35940b29e6394d0 Mon Sep 17 00:00:00 2001 From: Jonathan Ingram Date: Sat, 16 Jun 2018 13:06:41 +1000 Subject: [PATCH 08/23] Fix StripeProvider stripe prop --- types/react-stripe-elements/index.d.ts | 2 +- .../react-stripe-elements-tests.tsx | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/types/react-stripe-elements/index.d.ts b/types/react-stripe-elements/index.d.ts index e8e88757b2..6afd58d143 100644 --- a/types/react-stripe-elements/index.d.ts +++ b/types/react-stripe-elements/index.d.ts @@ -30,7 +30,7 @@ export namespace ReactStripeElements { interface StripeProviderOptions { stripeAccount?: string; } - type StripeProviderProps = { apiKey: string; stripe?: never; } & StripeProviderOptions | { apiKey?: never; stripe: StripeProps | null; } & StripeProviderOptions; + type StripeProviderProps = { apiKey: string; stripe?: never; } & StripeProviderOptions | { apiKey?: never; stripe: stripe.Stripe | null | null; } & StripeProviderOptions; interface StripeProps { createSource(sourceData?: SourceOptions): Promise; diff --git a/types/react-stripe-elements/react-stripe-elements-tests.tsx b/types/react-stripe-elements/react-stripe-elements-tests.tsx index ef1af5fa86..88b703b141 100644 --- a/types/react-stripe-elements/react-stripe-elements-tests.tsx +++ b/types/react-stripe-elements/react-stripe-elements-tests.tsx @@ -16,7 +16,6 @@ import ElementChangeResponse = stripe.elements.ElementChangeResponse; import ElementsOptions = stripe.elements.ElementsOptions; import ElementsCreateOptions = stripe.elements.ElementsCreateOptions; import PatchedTokenResponse = ReactStripeElements.PatchedTokenResponse; -import StripeProps = ReactStripeElements.StripeProps; const cardElementProps: ElementsOptions = { iconStyle: 'solid', @@ -185,7 +184,7 @@ const ElementsDefaultPropsTest: React.SFC = () => ( const TestStripeProviderProps1: React.SFC = () => ; const TestStripeProviderProps2: React.SFC<{ - stripe: StripeProps; + stripe: stripe.Stripe; }> = props => ; /** @@ -193,9 +192,22 @@ const TestStripeProviderProps2: React.SFC<{ * See: https://github.com/stripe/react-stripe-elements#props-shape */ const TestStripeProviderProps3: React.SFC<{ - stripe: StripeProps; + stripe: stripe.Stripe; }> = props => ; +/** + * End-to-end usage of loading stripe.js asynchronously. + * See: https://github.com/stripe/react-stripe-elements#loading-stripejs-asynchronously + */ +const TestStripeProviderProps4: React.SFC<{ + stripe: null | stripe.Stripe +}> = props => + + +
+ + ; + /** * StripeProvider should be able to accept options. * See: https://stripe.com/docs/stripe-js/reference#stripe-function for options. From 648d5ae0a6423695519387cdb4b1d2990e0ce884 Mon Sep 17 00:00:00 2001 From: Jonathan Ingram Date: Sat, 16 Jun 2018 22:14:07 +1000 Subject: [PATCH 09/23] Fix duplicate `| null` typo --- types/react-stripe-elements/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-stripe-elements/index.d.ts b/types/react-stripe-elements/index.d.ts index 6afd58d143..abc08cc3e1 100644 --- a/types/react-stripe-elements/index.d.ts +++ b/types/react-stripe-elements/index.d.ts @@ -30,7 +30,7 @@ export namespace ReactStripeElements { interface StripeProviderOptions { stripeAccount?: string; } - type StripeProviderProps = { apiKey: string; stripe?: never; } & StripeProviderOptions | { apiKey?: never; stripe: stripe.Stripe | null | null; } & StripeProviderOptions; + type StripeProviderProps = { apiKey: string; stripe?: never; } & StripeProviderOptions | { apiKey?: never; stripe: stripe.Stripe | null; } & StripeProviderOptions; interface StripeProps { createSource(sourceData?: SourceOptions): Promise; From d44f6de28b0e79a32048773e280b91aa83c718a4 Mon Sep 17 00:00:00 2001 From: ZaneHannanAU Date: Sun, 17 Jun 2018 21:17:11 +1000 Subject: [PATCH 10/23] Missing definitions in module "dns" Add loads of `Any*Record` blocks to fill it in as well. Missing definition for `dns.resolveAny` and `dns.resolve(domain, 'ANY')` in `@types/node` --- types/node/index.d.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 5d6b9e9d79..fd9656d3f8 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -25,6 +25,7 @@ // Alexander T. // Lishude // Andrew Makarov +// Zane Hannan AU // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** inspector module types */ @@ -2560,10 +2561,18 @@ declare module "dns" { ttl: number; } + export interface AnyRecordWithTtl extends RecordWithTtl { + type: "A" | "AAAA"; + } + export interface MxRecord { priority: number; exchange: string; } + + export interface AnyMxRecord extends MxRecord { + type: "MX"; + } export interface NaptrRecord { flags: string; @@ -2574,6 +2583,10 @@ declare module "dns" { preference: number; } + export interface AnyNaptrRecord extends NaptrRecord { + type: "NAPTR" + } + export interface SoaRecord { nsname: string; hostmaster: string; @@ -2584,6 +2597,10 @@ declare module "dns" { minttl: number; } + export interface AnySoaRecord extends SoaRecord { + type: "SOA"; + } + export interface SrvRecord { priority: number; weight: number; @@ -2591,9 +2608,14 @@ declare module "dns" { name: string; } + export interface AnySrvRecord extends SrvRecord { + type: "SRV"; + } + export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray) => void): void; export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; @@ -2637,6 +2659,7 @@ declare module "dns" { export function __promisify__(hostname: string, options?: ResolveOptions): Promise; } + export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray) => void): void; export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; From 915af93399f14eb05b415f69f02972703128046d Mon Sep 17 00:00:00 2001 From: ZaneHannanAU Date: Sun, 17 Jun 2018 21:33:58 +1000 Subject: [PATCH 11/23] make travis-ci not throw ```ci node failing: Error: /home/travis/build/DefinitelyTyped/DefinitelyTyped/types/node/index.d.ts:2567:1 ERROR: 2567:1 no-trailing-whitespace trailing whitespace ERROR: 2572:1 no-trailing-whitespace trailing whitespace ERROR: 2587:22 semicolon Missing semicolon at /home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/dtslint/bin/index.js:101:19 at Generator.next () at fulfilled (/home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/dtslint/bin/index.js:5:58) at ``` --- types/node/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index fd9656d3f8..2ed6aa0a58 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -2564,12 +2564,12 @@ declare module "dns" { export interface AnyRecordWithTtl extends RecordWithTtl { type: "A" | "AAAA"; } - + export interface MxRecord { priority: number; exchange: string; } - + export interface AnyMxRecord extends MxRecord { type: "MX"; } @@ -2584,7 +2584,7 @@ declare module "dns" { } export interface AnyNaptrRecord extends NaptrRecord { - type: "NAPTR" + type: "NAPTR"; } export interface SoaRecord { From 907c8276a33ed5c8cc245f3f167f0dd9981a5b12 Mon Sep 17 00:00:00 2001 From: Keith Kelly Date: Sun, 17 Jun 2018 17:46:43 -0400 Subject: [PATCH 12/23] Adds support for selection of different input and output streams --- types/inquirer/index.d.ts | 6 ++++- types/inquirer/inquirer-tests.ts | 44 ++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index d9258f7a48..16494ecb68 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -21,6 +21,9 @@ declare namespace inquirer { | Question | ReadonlyArray> | Rx.Observable>; + type OutputStreamOption = {output: NodeJS.WritableStream}; + type InputStreamOption = {input: NodeJS.ReadableStream}; + type StreamOptions = InputStreamOption | OutputStreamOption | (InputStreamOption & OutputStreamOption); interface Inquirer { restoreDefaultPrompts(): void; @@ -32,8 +35,9 @@ declare namespace inquirer { registerPrompt(name: string, prompt: PromptModule): void; /** * Create a new self-contained prompt module. + * @param opt Object specifying input and output streams for the prompt */ - createPromptModule(): PromptModule; + createPromptModule(opt?: StreamOptions): PromptModule; /** * Public CLI helper interface * @param questions Questions settings array diff --git a/types/inquirer/inquirer-tests.ts b/types/inquirer/inquirer-tests.ts index aa545adae0..85a81d761e 100644 --- a/types/inquirer/inquirer-tests.ts +++ b/types/inquirer/inquirer-tests.ts @@ -626,3 +626,47 @@ async function testAsyncPrompt(): Promise { } testAsyncPrompt(); + +/** + * Different prompt output example + */ + +"use strict"; +//var inquirer = require("../lib/inquirer"); + +var questions = [ + { + type: "input", + name: "first_name", + message: "What's your first name", + prefix: "1 - " + }, + { + type: "input", + name: "last_name", + message: "What's your last name", + default: function() { + return "Doe"; + }, + suffix: "!!" + }, + { + type: "input", + name: "phone", + message: "What's your phone number", + validate: function(value: string): string | boolean { + var pass = value.match( + /^([01]{1})?[\-\.\s]?\(?(\d{3})\)?[\-\.\s]?(\d{3})[\-\.\s]?(\d{4})\s?((?:#|ext\.?\s?|x\.?\s?){1}(?:\d+)?)?$/i + ); + if (pass) { + return true; + } else { + return "Please enter a valid phone number"; + } + } + } +]; + +inquirer.createPromptModule({ output: process.stderr })(questions, function(answers) { + console.log(JSON.stringify(answers, null, " ")); +}); From f8dbafddf56f0019d960dfb0f72a3a9202fb57a7 Mon Sep 17 00:00:00 2001 From: Keith Kelly Date: Sun, 17 Jun 2018 17:55:12 -0400 Subject: [PATCH 13/23] Adds kwkelly as contributor for inquirer --- types/inquirer/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index 16494ecb68..90697f2423 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -7,6 +7,7 @@ // Jason Dreyzehner // Synarque // Justin Rockwood +// Keith Kelly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From 9ba0229a929fe8fccdcacff0212822dcaec05ebd Mon Sep 17 00:00:00 2001 From: Keith Kelly Date: Sun, 17 Jun 2018 19:04:50 -0400 Subject: [PATCH 14/23] Changes NodeJS.WritableStream to NodeJS.WriteStream and NodeJS.ReadableStream to NodeJS.ReadStream to correctly type check process.stdin, process.stdout, and process.stderr --- types/inquirer/index.d.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index 90697f2423..9f23ad21aa 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -22,8 +22,12 @@ declare namespace inquirer { | Question | ReadonlyArray> | Rx.Observable>; - type OutputStreamOption = {output: NodeJS.WritableStream}; - type InputStreamOption = {input: NodeJS.ReadableStream}; + interface OutputStreamOption { + output: NodeJS.WriteStream + } + interface InputStreamOption { + input: NodeJS.ReadStream + } type StreamOptions = InputStreamOption | OutputStreamOption | (InputStreamOption & OutputStreamOption); interface Inquirer { @@ -38,7 +42,7 @@ declare namespace inquirer { * Create a new self-contained prompt module. * @param opt Object specifying input and output streams for the prompt */ - createPromptModule(opt?: StreamOptions): PromptModule; + createPromptModule(opt?: OutputStreamOption): PromptModule; /** * Public CLI helper interface * @param questions Questions settings array From 0fd0fa73ff572fa00d99f2ef7c1425d09f4f5d3d Mon Sep 17 00:00:00 2001 From: ZaneHannanAU Date: Mon, 18 Jun 2018 10:13:29 +1000 Subject: [PATCH 15/23] Add promisified version --- types/node/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 2ed6aa0a58..11a2d1d663 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -2629,6 +2629,7 @@ declare module "dns" { // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. export namespace resolve { export function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; + export function __promisify__(hostname: string, rrtype: "ANY"): Promise>; export function __promisify__(hostname: string, rrtype: "MX"): Promise; export function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; export function __promisify__(hostname: string, rrtype: "SOA"): Promise; From 6edbf642eea7f41085027dbf7c20fdba16f0b332 Mon Sep 17 00:00:00 2001 From: ZaneHannanAU Date: Mon, 18 Jun 2018 10:34:39 +1000 Subject: [PATCH 16/23] Add test for `resolve(hostname, "ANY")` Test for `resolveAny` not added as other tests for the same haven't been added. --- types/node/node-tests.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index c8f61b948a..329abeab29 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -3129,6 +3129,9 @@ namespace dns_tests { dns.resolve("nodejs.org", "AAAA", (err, addresses) => { const _addresses: string[] = addresses; }); + dns.resolve("nodejs.org", "ANY", (err, addresses) => { + const _addresses: ReadonlyArray = addresses; + }); dns.resolve("nodejs.org", "MX", (err, addresses) => { const _addresses: dns.MxRecord[] = addresses; }); From b3dfeb51e02406d81968dedf03f36d97fffd2c41 Mon Sep 17 00:00:00 2001 From: ZaneHannanAU Date: Mon, 18 Jun 2018 10:52:13 +1000 Subject: [PATCH 17/23] Add `AnyTxtRecord` --- types/node/index.d.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 11a2d1d663..83b63500cd 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -2612,10 +2612,15 @@ declare module "dns" { type: "SRV"; } + export interface AnyTxtRecord { + type: "TXT"; + entries: string[] + } + export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray) => void): void; + export function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray) => void): void; export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; @@ -2629,7 +2634,7 @@ declare module "dns" { // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. export namespace resolve { export function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; - export function __promisify__(hostname: string, rrtype: "ANY"): Promise>; + export function __promisify__(hostname: string, rrtype: "ANY"): Promise>; export function __promisify__(hostname: string, rrtype: "MX"): Promise; export function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; export function __promisify__(hostname: string, rrtype: "SOA"): Promise; @@ -2660,7 +2665,7 @@ declare module "dns" { export function __promisify__(hostname: string, options?: ResolveOptions): Promise; } - export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray) => void): void; + export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray) => void): void; export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; From 7521d75c2a5c1ca6c4481aa89df23f713ff67351 Mon Sep 17 00:00:00 2001 From: ZaneHannanAU Date: Mon, 18 Jun 2018 10:52:32 +1000 Subject: [PATCH 18/23] Fix references, add `AnyTxtRecord` --- types/node/node-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index 329abeab29..740866d475 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -3130,7 +3130,7 @@ namespace dns_tests { const _addresses: string[] = addresses; }); dns.resolve("nodejs.org", "ANY", (err, addresses) => { - const _addresses: ReadonlyArray = addresses; + const _addresses: ReadonlyArray = addresses; }); dns.resolve("nodejs.org", "MX", (err, addresses) => { const _addresses: dns.MxRecord[] = addresses; From 057d36c5884d8c7279303946309dee814d44b983 Mon Sep 17 00:00:00 2001 From: ZaneHannanAU Date: Mon, 18 Jun 2018 11:44:19 +1000 Subject: [PATCH 19/23] add a semicolon --- 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 83b63500cd..ade922bb34 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -2614,7 +2614,7 @@ declare module "dns" { export interface AnyTxtRecord { type: "TXT"; - entries: string[] + entries: string[]; } export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; From 169b2063839b313fcabd4e4cded0bfa26690d8b8 Mon Sep 17 00:00:00 2001 From: ZaneHannanAU Date: Mon, 18 Jun 2018 11:48:35 +1000 Subject: [PATCH 20/23] ... fix spelling mistake --- types/node/node-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index 740866d475..5f82a36672 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -3130,7 +3130,7 @@ namespace dns_tests { const _addresses: string[] = addresses; }); dns.resolve("nodejs.org", "ANY", (err, addresses) => { - const _addresses: ReadonlyArray = addresses; + const _addresses: ReadonlyArray = addresses; }); dns.resolve("nodejs.org", "MX", (err, addresses) => { const _addresses: dns.MxRecord[] = addresses; From 3177220fa4272a8c35ca658c8a250d44eb4ea01d Mon Sep 17 00:00:00 2001 From: Keith Kelly Date: Mon, 18 Jun 2018 12:22:12 -0400 Subject: [PATCH 21/23] Fixes typo so that input and output are both options in createPromptModule --- types/inquirer/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index 9f23ad21aa..d00c037c71 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -42,7 +42,7 @@ declare namespace inquirer { * Create a new self-contained prompt module. * @param opt Object specifying input and output streams for the prompt */ - createPromptModule(opt?: OutputStreamOption): PromptModule; + createPromptModule(opt?: StreamOptions): PromptModule; /** * Public CLI helper interface * @param questions Questions settings array From 48996f6e0bce1ee2855c1203d541a147f4e8d232 Mon Sep 17 00:00:00 2001 From: Jordan Van Walleghem Date: Mon, 18 Jun 2018 18:43:19 +0200 Subject: [PATCH 22/23] Fixed mongodb typings implicit any error --- types/mongodb/index.d.ts | 2 +- types/mongodb/tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 273a0716b2..8f8205799e 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -1252,7 +1252,7 @@ export class Cursor extends Readable { /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#limit */ limit(value: number): Cursor; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#map */ - map(transform: (T) => U): Cursor; + map(transform: (el: T) => U): Cursor; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#max */ max(max: number): Cursor; /** http://mongodb.github.io/node-mongodb-native/3.0/api/Cursor.html#maxAwaitTimeMS */ diff --git a/types/mongodb/tsconfig.json b/types/mongodb/tsconfig.json index 8ed16ed7e6..aae592b3bd 100644 --- a/types/mongodb/tsconfig.json +++ b/types/mongodb/tsconfig.json @@ -4,7 +4,7 @@ "lib": [ "es6" ], - "noImplicitAny": false, + "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, "strictFunctionTypes": true, From 031a3356f65a8f009e774bd112daf27552e28a68 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 18 Jun 2018 14:19:52 -0700 Subject: [PATCH 23/23] add semicolon --- types/superagent/superagent-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/superagent/superagent-tests.ts b/types/superagent/superagent-tests.ts index b2e00c6698..0c4b51f31e 100644 --- a/types/superagent/superagent-tests.ts +++ b/types/superagent/superagent-tests.ts @@ -397,7 +397,7 @@ const echoPlugin = (request: request.SuperAgentRequest) => { req.url = '' + req.url; req.cookies = '' + req.cookies; if (req.method) { - req.url = '/echo' + req.url = '/echo'; } };