From 55f32e23822c29c4fb3c46bba5357f8585a2a0f1 Mon Sep 17 00:00:00 2001 From: Rhys van der Waerden Date: Mon, 19 Nov 2018 10:59:20 +1100 Subject: [PATCH 01/20] Remove zopfli options https://github.com/webpack-contrib/compression-webpack-plugin/pull/65 --- types/compression-webpack-plugin/index.d.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/types/compression-webpack-plugin/index.d.ts b/types/compression-webpack-plugin/index.d.ts index a7b38383ef..b0416ca8b0 100644 --- a/types/compression-webpack-plugin/index.d.ts +++ b/types/compression-webpack-plugin/index.d.ts @@ -22,14 +22,6 @@ declare namespace CompressionPlugin { threshold?: number; minRatio?: number; - // zopfli options - verbose?: boolean; - verbose_more?: boolean; - numiterations?: number; - blocksplitting?: boolean; - blocksplittinglast?: boolean; - blocksplittingmax?: number; - // zlib options level?: number; flush?: number; From ceee1391c7e05e2c46eaef0deedfb8febe3ba432 Mon Sep 17 00:00:00 2001 From: Rhys van der Waerden Date: Mon, 19 Nov 2018 11:51:13 +1100 Subject: [PATCH 02/20] compression-webpack-plugin: Support custom algorithm Had to bump the TypeScript version to detect correct option type based on `algorithm` argument. --- .../compression-webpack-plugin-tests.ts | 53 ++++++++++++++++++- types/compression-webpack-plugin/index.d.ts | 37 ++++++++----- 2 files changed, 75 insertions(+), 15 deletions(-) diff --git a/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts b/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts index 423ca4cea7..e162a6bcb2 100644 --- a/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts +++ b/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts @@ -1,7 +1,9 @@ import { Configuration } from 'webpack'; import CompressionPlugin = require('compression-webpack-plugin'); -const c: Configuration = { +new CompressionPlugin(); + +const config: Configuration = { plugins: [ new CompressionPlugin({ asset: "[path].gz[query]", @@ -13,3 +15,52 @@ const c: Configuration = { }) ] }; + +const configDefaultAlgo = new CompressionPlugin({ + compressionOptions: { level: 7 } +}); + +const zlib: Configuration = { + plugins: [ + new CompressionPlugin({ + algorithm: "deflate", + compressionOptions: { + flush: 5, + windowBits: 20, + level: 7 + } + }) + ] +}; + +const badZlib: Configuration = { + plugins: [ + // $ExpectError + new CompressionPlugin({ + algorithm: "deflate", + compressionOptions: 5 + }) + ] +}; + +function customAlgorithm(input: string, options: number, callback: (err: Error, result: Buffer) => void) { +} + +const custom: Configuration = { + plugins: [ + new CompressionPlugin({ + algorithm: customAlgorithm, + compressionOptions: 5 + }) + ] +}; + +const badCustom: Configuration = { + plugins: [ + // $ExpectError + new CompressionPlugin({ + algorithm: customAlgorithm, + compressionOptions: { flush: 5 } + }) + ] +}; diff --git a/types/compression-webpack-plugin/index.d.ts b/types/compression-webpack-plugin/index.d.ts index b0416ca8b0..9c66248776 100644 --- a/types/compression-webpack-plugin/index.d.ts +++ b/types/compression-webpack-plugin/index.d.ts @@ -2,33 +2,42 @@ // Project: https://github.com/webpack-contrib/compression-webpack-plugin // Definitions by: Anton Kandybo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 import { Plugin } from 'webpack'; +import { ZlibOptions as ZlibCompressionOptions } from 'zlib'; export = CompressionPlugin; -declare class CompressionPlugin extends Plugin { - constructor(options?: CompressionPlugin.Options); +declare class CompressionPlugin extends Plugin { + constructor(options?: CompressionPlugin.Options); } declare namespace CompressionPlugin { - interface Options { + type AlgorithmCallback = (error: Error | null, result: Buffer) => void; + type Algorithm = (source: string, options: O, callback: AlgorithmCallback) => void; + + // NOTE: These are the compression algorithms exported by zlib. + type ZlibAlgorithm = 'deflate' | 'deflateRaw' | 'gzip'; + + interface BaseOptions { asset?: string; - algorithm?: string; cache?: boolean | string; test?: RegExp | RegExp[]; regExp?: RegExp | RegExp[]; threshold?: number; minRatio?: number; - - // zlib options - level?: number; - flush?: number; - chunkSize?: number; - windowBits?: number; - memLevel?: number; - strategy?: number; - dictionary?: any; } + + interface ZlibOptions extends BaseOptions { + algorithm?: ZlibAlgorithm; + compressionOptions?: ZlibCompressionOptions; + } + + interface CustomOptions extends BaseOptions { + algorithm: Algorithm; + compressionOptions?: O; + } + + type Options = ZlibOptions | CustomOptions; } From 3fc7e124637a16d269db2640fe40e9c4ddbc024a Mon Sep 17 00:00:00 2001 From: Rhys van der Waerden Date: Mon, 19 Nov 2018 11:56:16 +1100 Subject: [PATCH 03/20] compression-webpack-plugin: asset -> filename --- .../compression-webpack-plugin-tests.ts | 5 ++++- types/compression-webpack-plugin/index.d.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts b/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts index e162a6bcb2..44662c4177 100644 --- a/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts +++ b/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts @@ -6,7 +6,7 @@ new CompressionPlugin(); const config: Configuration = { plugins: [ new CompressionPlugin({ - asset: "[path].gz[query]", + filename: "[path].gz[query]", algorithm: "gzip", cache: true, test: /\.js$|\.html$/, @@ -20,6 +20,9 @@ const configDefaultAlgo = new CompressionPlugin({ compressionOptions: { level: 7 } }); +// $ExpectError +new CompressionPlugin({ asset: "[path].gz[query]" }); + const zlib: Configuration = { plugins: [ new CompressionPlugin({ diff --git a/types/compression-webpack-plugin/index.d.ts b/types/compression-webpack-plugin/index.d.ts index 9c66248776..4a6ccd290e 100644 --- a/types/compression-webpack-plugin/index.d.ts +++ b/types/compression-webpack-plugin/index.d.ts @@ -21,7 +21,7 @@ declare namespace CompressionPlugin { type ZlibAlgorithm = 'deflate' | 'deflateRaw' | 'gzip'; interface BaseOptions { - asset?: string; + filename?: string; cache?: boolean | string; test?: RegExp | RegExp[]; regExp?: RegExp | RegExp[]; From d74799987561f76db932b4bc40cfb814289101dc Mon Sep 17 00:00:00 2001 From: Rhys van der Waerden Date: Mon, 19 Nov 2018 12:08:39 +1100 Subject: [PATCH 04/20] compression-webpack-plugin: Update options - Add `include`/`exclude` - Remove `regExp` which was undocumented (possibly always wrong?) - Add `deleteOriginalAssets` - Prefer `ReadonlyArray` for string/regex options --- .../compression-webpack-plugin-tests.ts | 11 +++++++++-- types/compression-webpack-plugin/index.d.ts | 13 ++++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts b/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts index 44662c4177..a679b7f599 100644 --- a/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts +++ b/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts @@ -3,15 +3,22 @@ import CompressionPlugin = require('compression-webpack-plugin'); new CompressionPlugin(); +new CompressionPlugin({ + include: ["a"] as ReadonlyArray, + exclude: [/a/g] as ReadonlyArray, + test: "a", +}); + const config: Configuration = { plugins: [ new CompressionPlugin({ - filename: "[path].gz[query]", algorithm: "gzip", cache: true, + filename: "[path].gz[query]", + minRatio: 0.8, test: /\.js$|\.html$/, threshold: 10240, - minRatio: 0.8 + deleteOriginalAssets: true }) ] }; diff --git a/types/compression-webpack-plugin/index.d.ts b/types/compression-webpack-plugin/index.d.ts index 4a6ccd290e..8c399bbdd5 100644 --- a/types/compression-webpack-plugin/index.d.ts +++ b/types/compression-webpack-plugin/index.d.ts @@ -17,16 +17,19 @@ declare namespace CompressionPlugin { type AlgorithmCallback = (error: Error | null, result: Buffer) => void; type Algorithm = (source: string, options: O, callback: AlgorithmCallback) => void; - // NOTE: These are the compression algorithms exported by zlib. + // NOTE: These are the async compression algorithms on the zlib object. type ZlibAlgorithm = 'deflate' | 'deflateRaw' | 'gzip'; + type Pattern = string | RegExp | ReadonlyArray | ReadonlyArray; interface BaseOptions { - filename?: string; cache?: boolean | string; - test?: RegExp | RegExp[]; - regExp?: RegExp | RegExp[]; - threshold?: number; + deleteOriginalAssets?: boolean; + exclude?: Pattern; + filename?: string; + include?: Pattern; minRatio?: number; + test?: Pattern; + threshold?: number; } interface ZlibOptions extends BaseOptions { From 2087e1b9f13248e441fc923ab638a23bec69255c Mon Sep 17 00:00:00 2001 From: Rhys van der Waerden Date: Mon, 19 Nov 2018 12:09:14 +1100 Subject: [PATCH 05/20] compression-webpack-plugin: Add myself --- types/compression-webpack-plugin/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/compression-webpack-plugin/index.d.ts b/types/compression-webpack-plugin/index.d.ts index 8c399bbdd5..b03b655c69 100644 --- a/types/compression-webpack-plugin/index.d.ts +++ b/types/compression-webpack-plugin/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for compression-webpack-plugin 0.4 // Project: https://github.com/webpack-contrib/compression-webpack-plugin // Definitions by: Anton Kandybo +// Rhys van der Waerden // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 From f69b9883f0ab04fdb4c2d057f8a3b16ec288782e Mon Sep 17 00:00:00 2001 From: Rhys van der Waerden Date: Mon, 19 Nov 2018 12:13:49 +1100 Subject: [PATCH 06/20] compression-webpack-plugin: Bump version number --- types/compression-webpack-plugin/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/compression-webpack-plugin/index.d.ts b/types/compression-webpack-plugin/index.d.ts index b03b655c69..5d72f1fca8 100644 --- a/types/compression-webpack-plugin/index.d.ts +++ b/types/compression-webpack-plugin/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for compression-webpack-plugin 0.4 +// Type definitions for compression-webpack-plugin 2.0 // Project: https://github.com/webpack-contrib/compression-webpack-plugin // Definitions by: Anton Kandybo // Rhys van der Waerden From 4d019f2ef8d52b646c4e974fca498ecbd450335f Mon Sep 17 00:00:00 2001 From: Marko K Date: Tue, 20 Nov 2018 20:51:17 +0200 Subject: [PATCH 07/20] fix: allow StyleFunction for heatmap paint properties --- types/mapbox-gl/index.d.ts | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index 91fb68cd96..b45e1e8746 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -232,7 +232,7 @@ declare namespace mapboxgl { /** * The max number of pixels a user can shift the mouse pointer during a click for it to be * considered a valid click (as opposed to a mouse drag). - * + * * @default 3 */ clickTolerance?: number; @@ -242,7 +242,7 @@ declare namespace mapboxgl { * and Vector Tile web workers (this information is normally inaccessible from the main * Javascript thread). Information will be returned in a `resourceTiming` property of * relevant `data` events. - * + * * @default false */ collectResourceTiming?: boolean; @@ -250,7 +250,7 @@ declare namespace mapboxgl { /** * If `true`, symbols from multiple sources can collide with each other during collision * detection. If `false`, collision detection is run separately for the symbols in each source. - * + * * @default true */ crossSourceCollisions?: boolean; @@ -278,7 +278,7 @@ declare namespace mapboxgl { * Controls the duration of the fade-in/fade-out animation for label collisions, in milliseconds. * This setting affects all symbol layers. This setting does not affect the duration of runtime * styling transitions or raster tile cross-fading. - * + * * @default 300 */ fadeDuration?: number; @@ -297,14 +297,14 @@ declare namespace mapboxgl { * 'CJK Unified Ideographs' and 'Hangul Syllables' ranges. In these ranges, font settings from * the map's style will be ignored, except for font-weight keywords (light/regular/medium/bold). * The purpose of this option is to avoid bandwidth-intensive glyph server requests. - * + * * @default null */ localIdeographFontFamily?: string; /** * A string representing the position of the Mapbox wordmark on the map. - * + * * @default "bottom-left" */ logoPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'; @@ -324,14 +324,14 @@ declare namespace mapboxgl { /** * The initial pitch (tilt) of the map, measured in degrees away from the plane of the * screen (0-60). - * + * * @default 0 */ pitch?: number; /** * If `false`, the map's pitch (tilt) control with "drag to rotate" interaction will be disabled. - * + * * @default true */ pitchWithRotate?: boolean; @@ -339,14 +339,14 @@ declare namespace mapboxgl { /** * If `false`, the map won't attempt to re-request tiles once they expire per their HTTP * `cacheControl`/`expires` headers. - * + * * @default true */ refreshExpiredTiles?: boolean; /** * If `true`, multiple copies of the world will be rendered, when zoomed out. - * + * * @default true */ renderWorldCopies?: boolean; @@ -363,7 +363,7 @@ declare namespace mapboxgl { /** * A callback run before the Map makes a request for an external URL. The callback can be * used to modify the url, set headers, or set the credentials property for cross-origin requests. - * + * * @default null */ transformRequest?: TransformRequestFunction; @@ -377,13 +377,13 @@ declare namespace mapboxgl { /** * The maximum number of tiles stored in the tile cache for a given source. If omitted, the * cache will be dynamically sized based on the current viewport. - * + * * @default null */ maxTileCacheSize?: number; } - export type ResourceType = + export type ResourceType = | 'Unknown' | 'Style' | 'Source' @@ -692,7 +692,7 @@ declare namespace mapboxgl { clusterMaxZoom?: number; lineMetrics?: boolean; - + generateId?: boolean; } @@ -1476,13 +1476,13 @@ declare namespace mapboxgl { } export interface HeatmapPaint { - 'heatmap-radius'?: number | Expression; + 'heatmap-radius'?: number | StyleFunction | Expression; 'heatmap-radius-transition'?: Transition; 'heatmap-weight'?: number | StyleFunction | Expression; - 'heatmap-intensity'?: number | Expression; + 'heatmap-intensity'?: number | StyleFunction | Expression; 'heatmap-intensity-transition'?: Transition; - 'heatmap-color'?: string | Expression; - 'heatmap-opacity'?: number | Expression; + 'heatmap-color'?: string | StyleFunction | Expression; + 'heatmap-opacity'?: number | StyleFunction | Expression; 'heatmap-opacity-transition'?: Transition; } From 1bcbf71b93f09c4a7f29d7f60a18c6dc99d6aa4d Mon Sep 17 00:00:00 2001 From: Kamontat Chantrachirathumrong Date: Sat, 24 Nov 2018 15:54:45 +0100 Subject: [PATCH 08/20] Fix error in list type --- types/prompts/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/prompts/index.d.ts b/types/prompts/index.d.ts index 7aa3f2ea63..a10a7ba243 100644 --- a/types/prompts/index.d.ts +++ b/types/prompts/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/terkelg/prompts // Definitions by: Berkay GURSOY // Daniel Perez Alvarez +// Kamontat Chantrachirathumrong // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -47,6 +48,7 @@ declare namespace prompts { interface Choice { title: string; value: string; + disable?: boolean; } interface Options { @@ -58,7 +60,7 @@ declare namespace prompts { type: ValueOrFunc; name: ValueOrFunc; message?: ValueOrFunc; - initial?: string; + initial?: string | number; style?: string; format?: PrevCaller; validate?: PrevCaller; From a34223bc90cabd779bcbb14c2d9685206c52d87d Mon Sep 17 00:00:00 2001 From: Kamontat Chantrachirathumrong Date: Sat, 24 Nov 2018 15:57:20 +0100 Subject: [PATCH 09/20] [release] Increase prompts version 1.2 --- types/prompts/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/prompts/index.d.ts b/types/prompts/index.d.ts index a10a7ba243..447d67d557 100644 --- a/types/prompts/index.d.ts +++ b/types/prompts/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for prompts 1.1 +// Type definitions for prompts 1.2 // Project: https://github.com/terkelg/prompts // Definitions by: Berkay GURSOY // Daniel Perez Alvarez From a2c196471f30c373a6127ea47bc23c7973f0a454 Mon Sep 17 00:00:00 2001 From: Kamontat Chantrachirathumrong Date: Sat, 24 Nov 2018 16:00:36 +0100 Subject: [PATCH 10/20] [improve] Add boolean as initial message --- types/prompts/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/prompts/index.d.ts b/types/prompts/index.d.ts index 447d67d557..d68f63af8e 100644 --- a/types/prompts/index.d.ts +++ b/types/prompts/index.d.ts @@ -60,7 +60,7 @@ declare namespace prompts { type: ValueOrFunc; name: ValueOrFunc; message?: ValueOrFunc; - initial?: string | number; + initial?: string | number | boolean; style?: string; format?: PrevCaller; validate?: PrevCaller; From 218607fa1be6d4394178f76e9bc490fcc46e38b5 Mon Sep 17 00:00:00 2001 From: Kamontat Chantrachirathumrong Date: Sat, 24 Nov 2018 16:06:46 +0100 Subject: [PATCH 11/20] [improve] Add falsy type to skip the question --- types/prompts/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/prompts/index.d.ts b/types/prompts/index.d.ts index d68f63af8e..e4e2fbca80 100644 --- a/types/prompts/index.d.ts +++ b/types/prompts/index.d.ts @@ -57,7 +57,7 @@ declare namespace prompts { } interface PromptObject { - type: ValueOrFunc; + type: ValueOrFunc | Falsy; name: ValueOrFunc; message?: ValueOrFunc; initial?: string | number | boolean; @@ -86,6 +86,8 @@ declare namespace prompts { values: Answers, prompt: PromptObject ) => R; + + type Falsy = false | null | undefined; type ValueOrFunc = T | PrevCaller; } From 09832c50db44a2c8da4d4e330e0a61917fe32ec1 Mon Sep 17 00:00:00 2001 From: Kamontat Chantrachirathumrong Date: Sun, 25 Nov 2018 13:34:03 +0100 Subject: [PATCH 12/20] [fix] Remove trail space --- types/prompts/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/prompts/index.d.ts b/types/prompts/index.d.ts index e4e2fbca80..bfb08a8bd7 100644 --- a/types/prompts/index.d.ts +++ b/types/prompts/index.d.ts @@ -86,7 +86,7 @@ declare namespace prompts { values: Answers, prompt: PromptObject ) => R; - + type Falsy = false | null | undefined; type ValueOrFunc = T | PrevCaller; From 850c8337b5a1ccf88a967a69aad34959fcdfaa2a Mon Sep 17 00:00:00 2001 From: Kamontat Chantrachirathumrong Date: Wed, 28 Nov 2018 22:57:47 +0100 Subject: [PATCH 13/20] [improve] Improve type of prompts --- types/prompts/index.d.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/types/prompts/index.d.ts b/types/prompts/index.d.ts index bfb08a8bd7..0db58ea435 100644 --- a/types/prompts/index.d.ts +++ b/types/prompts/index.d.ts @@ -52,12 +52,12 @@ declare namespace prompts { } interface Options { - onSubmit: (prompt: PromptObject, answer: any, answers: any[]) => void; - onCancel: (prompt: PromptObject, answers: any) => void; + onSubmit?: (prompt: PromptObject, answer: any, answers: any[]) => void; + onCancel?: (prompt: PromptObject, answers: any) => void; } interface PromptObject { - type: ValueOrFunc | Falsy; + type: ValueOrFunc | Falsy; name: ValueOrFunc; message?: ValueOrFunc; initial?: string | number | boolean; @@ -89,5 +89,7 @@ declare namespace prompts { type Falsy = false | null | undefined; + type PromptType = "text" | "password" | "invisible" | "number" | "confirm" | "list" | "toggle" | "select" | "multiselect" | "autocomplete" | Falsy + type ValueOrFunc = T | PrevCaller; } From 2ac92c2d4c4947cb303d5e9aaa3160a0d6fd7352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Alvergnat?= Date: Sat, 17 Nov 2018 13:56:59 +0100 Subject: [PATCH 14/20] Fix return type of methods and arguments of create method --- types/mem-fs/index.d.ts | 6 +++--- types/mem-fs/mem-fs-tests.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/types/mem-fs/index.d.ts b/types/mem-fs/index.d.ts index 4b1d8c4d14..6ab2c43c88 100644 --- a/types/mem-fs/index.d.ts +++ b/types/mem-fs/index.d.ts @@ -10,13 +10,13 @@ import { Transform } from 'stream'; import * as File from 'vinyl'; export interface Store extends EventEmitter { - add: (file: File, content: string) => void; - each: (callback: (file: File, index: number) => void) => void; get: (filepath: string) => File; + add: (file: File) => this; + each: (callback: (file: File, index: number) => void) => this; stream: () => Transform; } -export function create(...args: any[]): Store; +export function create(): Store; export namespace memFs { } diff --git a/types/mem-fs/mem-fs-tests.ts b/types/mem-fs/mem-fs-tests.ts index 9605c65ef7..3b20f30891 100644 --- a/types/mem-fs/mem-fs-tests.ts +++ b/types/mem-fs/mem-fs-tests.ts @@ -3,6 +3,6 @@ import * as fs from 'mem-fs'; const store: fs.Store = fs.create(); const file = store.get('hello'); -store.add(file, 'hahahahah'); - -store.each(file => console.dir(store.get(file.path))); +const file2 = store.add(file) + .each(file => console.dir(store.get(file.path))) + .get('test'); From e16aad6c1749469a4d67573e7385ade64615c9e7 Mon Sep 17 00:00:00 2001 From: Akash Vishwakarma Date: Tue, 4 Dec 2018 18:01:01 +0530 Subject: [PATCH 15/20] local should be optional as per the Alt doc. As per the http://alt.js.org/docs/async/ document, the local function in the SourceModel Interface should be optional. --- types/alt/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/alt/index.d.ts b/types/alt/index.d.ts index 9094642e70..c95e1653b0 100644 --- a/types/alt/index.d.ts +++ b/types/alt/index.d.ts @@ -54,7 +54,7 @@ declare namespace AltJS { export type Source = {[name:string]: () => SourceModel}; export interface SourceModel { - local(state:any, ...args: any[]):any; + local?(state:any, ...args: any[]):any; remote(state:any, ...args: any[]):Promise; shouldFetch?(fetchFn:(...args:Array) => boolean):void; loading?:(args:any) => void; From 424a73f8091f58a51b1b1f9fb5e0d3f8cb778f7e Mon Sep 17 00:00:00 2001 From: Ryosuke Ishizue Date: Tue, 4 Dec 2018 22:30:54 +0900 Subject: [PATCH 16/20] fix return type of isFocused() --- types/ace/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/ace/index.d.ts b/types/ace/index.d.ts index 7faa5da4f8..cd20b57f05 100644 --- a/types/ace/index.d.ts +++ b/types/ace/index.d.ts @@ -1223,7 +1223,7 @@ declare namespace AceAjax { /** * Returns `true` if the current `textInput` is in focus. **/ - isFocused(): void; + isFocused(): boolean; /** * Blurs the current `textInput`. From f2733e26dfcb127c4dfe19f19211c8989c62f3b4 Mon Sep 17 00:00:00 2001 From: Kamontat Chantrachirathumrong Date: Thu, 6 Dec 2018 01:02:35 +0100 Subject: [PATCH 17/20] fix lint error --- types/prompts/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/prompts/index.d.ts b/types/prompts/index.d.ts index 0db58ea435..7dc3a928a7 100644 --- a/types/prompts/index.d.ts +++ b/types/prompts/index.d.ts @@ -89,7 +89,7 @@ declare namespace prompts { type Falsy = false | null | undefined; - type PromptType = "text" | "password" | "invisible" | "number" | "confirm" | "list" | "toggle" | "select" | "multiselect" | "autocomplete" | Falsy + type PromptType = "text" | "password" | "invisible" | "number" | "confirm" | "list" | "toggle" | "select" | "multiselect" | "autocomplete"; type ValueOrFunc = T | PrevCaller; } From 00f0ac3ca31598c7d723ec7c3dc58c1128c02e30 Mon Sep 17 00:00:00 2001 From: kiliw Date: Wed, 5 Dec 2018 11:06:45 +0100 Subject: [PATCH 18/20] Add ifElse overload to accept binary functions and link to ramda REPL. --- types/ramda/index.d.ts | 1 + types/ramda/ramda-tests.ts | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index a3bc51c8ca..b28b2ec540 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -1122,6 +1122,7 @@ declare namespace R { * of the condition predicate. */ ifElse(fn: Pred, onTrue: Arity1Fn, onFalse: Arity1Fn): Arity1Fn; + ifElse(fn: Pred, onTrue: Arity2Fn, onFalse: Arity2Fn): Arity2Fn; /** * Increments its argument. diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index 2f68808d17..495fe3dd54 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -2650,6 +2650,17 @@ class Rectangle { flattenArrays([[[10], 123], [8, [10]], "hello"]); // => [[10, 123], [8, 10], "hello"] }; +() => { + const incCount = R.ifElse( + R.has('count'), + R.over(R.lensProp('count'), R.inc), + R.assoc('count', 1) + ); + incCount({}); // => { count: 1 } + incCount({ count: 1 }); // => { count: 2 } + R.ifElse(R.identical, R.add as (a: number, b: number) => number, R.always(""))(2, 2); // https://goo.gl/CVUSs9 +}; + () => { R.isEmpty([1, 2, 3]); // => false R.isEmpty([]); // => true From b1c147e5e0e19ffb61b9b0fb0c67ac553c350b83 Mon Sep 17 00:00:00 2001 From: perry Date: Thu, 13 Dec 2018 12:29:19 -0800 Subject: [PATCH 19/20] Add missing option: env --- types/dd-trace/dd-trace-tests.ts | 4 ++-- types/dd-trace/index.d.ts | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/types/dd-trace/dd-trace-tests.ts b/types/dd-trace/dd-trace-tests.ts index f98a0853cf..cee1b6e3ee 100644 --- a/types/dd-trace/dd-trace-tests.ts +++ b/types/dd-trace/dd-trace-tests.ts @@ -6,11 +6,11 @@ tracer.init({ service: "MyLovelyService", hostname: "localhost", port: 8126, + env: "dev", logger: { debug: msg => {}, error: err => {}, - }, - tags: { tracerEnv: 'dev'} + } }); function useWebFrameworkPlugin(plugin: "express" | "hapi" | "koa" | "restify") { diff --git a/types/dd-trace/index.d.ts b/types/dd-trace/index.d.ts index 43bfd7183f..a55b7f8de7 100644 --- a/types/dd-trace/index.d.ts +++ b/types/dd-trace/index.d.ts @@ -83,6 +83,11 @@ interface TracerOptions { */ port?: number | string; + /** + * Set an application’s environment e.g. prod, pre-prod, stage. + */ + env?: string; + /** * Percentage of spans to sample as a float between 0 and 1. * @default 1 From 7b41345f82a42a1cf234c4a7bd3c69949be327f9 Mon Sep 17 00:00:00 2001 From: BuffayBu Date: Fri, 14 Dec 2018 18:08:19 +0800 Subject: [PATCH 20/20] fix typo --- types/http-proxy-middleware/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/http-proxy-middleware/index.d.ts b/types/http-proxy-middleware/index.d.ts index b48214b8f6..09b80e21c4 100644 --- a/types/http-proxy-middleware/index.d.ts +++ b/types/http-proxy-middleware/index.d.ts @@ -18,7 +18,7 @@ declare function proxy(config: proxy.Config): proxy.Proxy; declare function proxy(contextOrUri: string | string[] | proxy.Filter, config: proxy.Config): proxy.Proxy; declare namespace proxy { - type Filter = (pathanme: string, req: http.IncomingMessage) => boolean; + type Filter = (pathname: string, req: http.IncomingMessage) => boolean; type Logger = (...args: any[]) => void; interface LogProvider { log: Logger;