mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
Vendored
+1
-1
@@ -1223,7 +1223,7 @@ declare namespace AceAjax {
|
||||
/**
|
||||
* Returns `true` if the current `textInput` is in focus.
|
||||
**/
|
||||
isFocused(): void;
|
||||
isFocused(): boolean;
|
||||
|
||||
/**
|
||||
* Blurs the current `textInput`.
|
||||
|
||||
Vendored
+1
-1
@@ -54,7 +54,7 @@ declare namespace AltJS {
|
||||
export type Source = {[name:string]: () => SourceModel<any>};
|
||||
|
||||
export interface SourceModel<S> {
|
||||
local(state:any, ...args: any[]):any;
|
||||
local?(state:any, ...args: any[]):any;
|
||||
remote(state:any, ...args: any[]):Promise<S>;
|
||||
shouldFetch?(fetchFn:(...args:Array<any>) => boolean):void;
|
||||
loading?:(args:any) => void;
|
||||
|
||||
@@ -1,15 +1,76 @@
|
||||
import { Configuration } from 'webpack';
|
||||
import CompressionPlugin = require('compression-webpack-plugin');
|
||||
|
||||
const c: Configuration = {
|
||||
new CompressionPlugin();
|
||||
|
||||
new CompressionPlugin({
|
||||
include: ["a"] as ReadonlyArray<string>,
|
||||
exclude: [/a/g] as ReadonlyArray<RegExp>,
|
||||
test: "a",
|
||||
});
|
||||
|
||||
const config: Configuration = {
|
||||
plugins: [
|
||||
new CompressionPlugin({
|
||||
asset: "[path].gz[query]",
|
||||
algorithm: "gzip",
|
||||
cache: true,
|
||||
filename: "[path].gz[query]",
|
||||
minRatio: 0.8,
|
||||
test: /\.js$|\.html$/,
|
||||
threshold: 10240,
|
||||
minRatio: 0.8
|
||||
deleteOriginalAssets: true
|
||||
})
|
||||
]
|
||||
};
|
||||
|
||||
const configDefaultAlgo = new CompressionPlugin({
|
||||
compressionOptions: { level: 7 }
|
||||
});
|
||||
|
||||
// $ExpectError
|
||||
new CompressionPlugin({ asset: "[path].gz[query]" });
|
||||
|
||||
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 }
|
||||
})
|
||||
]
|
||||
};
|
||||
|
||||
+32
-27
@@ -1,42 +1,47 @@
|
||||
// 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 <https://github.com/dublicator>
|
||||
// Rhys van der Waerden <https://github.com/rhys-vdw>
|
||||
// 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<O = any> extends Plugin {
|
||||
constructor(options?: CompressionPlugin.Options<O>);
|
||||
}
|
||||
|
||||
declare namespace CompressionPlugin {
|
||||
interface Options {
|
||||
asset?: string;
|
||||
algorithm?: string;
|
||||
type AlgorithmCallback = (error: Error | null, result: Buffer) => void;
|
||||
type Algorithm<O> = (source: string, options: O, callback: AlgorithmCallback) => void;
|
||||
|
||||
// NOTE: These are the async compression algorithms on the zlib object.
|
||||
type ZlibAlgorithm = 'deflate' | 'deflateRaw' | 'gzip';
|
||||
type Pattern = string | RegExp | ReadonlyArray<RegExp> | ReadonlyArray<string>;
|
||||
|
||||
interface BaseOptions {
|
||||
cache?: boolean | string;
|
||||
test?: RegExp | RegExp[];
|
||||
regExp?: RegExp | RegExp[];
|
||||
threshold?: number;
|
||||
deleteOriginalAssets?: boolean;
|
||||
exclude?: Pattern;
|
||||
filename?: string;
|
||||
include?: Pattern;
|
||||
minRatio?: number;
|
||||
|
||||
// zopfli options
|
||||
verbose?: boolean;
|
||||
verbose_more?: boolean;
|
||||
numiterations?: number;
|
||||
blocksplitting?: boolean;
|
||||
blocksplittinglast?: boolean;
|
||||
blocksplittingmax?: number;
|
||||
|
||||
// zlib options
|
||||
level?: number;
|
||||
flush?: number;
|
||||
chunkSize?: number;
|
||||
windowBits?: number;
|
||||
memLevel?: number;
|
||||
strategy?: number;
|
||||
dictionary?: any;
|
||||
test?: Pattern;
|
||||
threshold?: number;
|
||||
}
|
||||
|
||||
interface ZlibOptions extends BaseOptions {
|
||||
algorithm?: ZlibAlgorithm;
|
||||
compressionOptions?: ZlibCompressionOptions;
|
||||
}
|
||||
|
||||
interface CustomOptions<O> extends BaseOptions {
|
||||
algorithm: Algorithm<O>;
|
||||
compressionOptions?: O;
|
||||
}
|
||||
|
||||
type Options<O> = ZlibOptions | CustomOptions<O>;
|
||||
}
|
||||
|
||||
@@ -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") {
|
||||
|
||||
Vendored
+5
@@ -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
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
Vendored
+18
-18
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1477,13 +1477,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;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+3
-3
@@ -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 {
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
Vendored
+11
-5
@@ -1,7 +1,8 @@
|
||||
// Type definitions for prompts 1.1
|
||||
// Type definitions for prompts 1.2
|
||||
// Project: https://github.com/terkelg/prompts
|
||||
// Definitions by: Berkay GURSOY <https://github.com/Berkays>
|
||||
// Daniel Perez Alvarez <https://github.com/danielpa9708>
|
||||
// Kamontat Chantrachirathumrong <https://github.com/kamontat>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -47,18 +48,19 @@ declare namespace prompts {
|
||||
interface Choice {
|
||||
title: string;
|
||||
value: string;
|
||||
disable?: boolean;
|
||||
}
|
||||
|
||||
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<T extends string = string> {
|
||||
type: ValueOrFunc<string>;
|
||||
type: ValueOrFunc<PromptType> | Falsy;
|
||||
name: ValueOrFunc<T>;
|
||||
message?: ValueOrFunc<string>;
|
||||
initial?: string;
|
||||
initial?: string | number | boolean;
|
||||
style?: string;
|
||||
format?: PrevCaller<T, void>;
|
||||
validate?: PrevCaller<T, void>;
|
||||
@@ -85,5 +87,9 @@ declare namespace prompts {
|
||||
prompt: PromptObject
|
||||
) => R;
|
||||
|
||||
type Falsy = false | null | undefined;
|
||||
|
||||
type PromptType = "text" | "password" | "invisible" | "number" | "confirm" | "list" | "toggle" | "select" | "multiselect" | "autocomplete";
|
||||
|
||||
type ValueOrFunc<T extends string> = T | PrevCaller<T>;
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -1123,6 +1123,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.
|
||||
|
||||
@@ -2657,6 +2657,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
|
||||
|
||||
Reference in New Issue
Block a user