mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Merge branch 'master' into mongoose
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { AbstractLevelDOWN } from 'abstract-leveldown';
|
||||
|
||||
const test = (levelDown: AbstractLevelDOWN<any, string>) => {
|
||||
levelDown.put("key", "value", (err?) => { });
|
||||
levelDown.put(1, "value", { something: true }, (err?) => { });
|
||||
|
||||
levelDown.get("key", (err?) => { });
|
||||
levelDown.get(1, { something: true }, (err?) => { });
|
||||
};
|
||||
// $ExpectType void
|
||||
test(new AbstractLevelDOWN('here'));
|
||||
// $ExpectType void
|
||||
test(AbstractLevelDOWN('there'));
|
||||
Vendored
+103
@@ -0,0 +1,103 @@
|
||||
// Type definitions for abstract-leveldown 5.0
|
||||
// Project: https://github.com/Level/abstract-leveldown
|
||||
// Definitions by: Meirion Hughes <https://github.com/MeirionHughes>
|
||||
// Daniel Byrne <https://github.com/danwbyrne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface AbstractOptions {
|
||||
readonly [k: string]: any;
|
||||
}
|
||||
|
||||
export type ErrorCallback = (err: Error | undefined) => void;
|
||||
export type ErrorValueCallback<V> = (err: Error | undefined, value: V) => void;
|
||||
export type ErrorKeyValueCallback<K, V> = (err: Error | undefined, key: K, value: V) => void;
|
||||
|
||||
export interface AbstractOpenOptions extends AbstractOptions {
|
||||
createIfMissing?: boolean;
|
||||
errorIfExists?: boolean;
|
||||
}
|
||||
|
||||
export interface AbstractGetOptions extends AbstractOptions {
|
||||
asBuffer?: boolean;
|
||||
}
|
||||
|
||||
export interface AbstractLevelDOWN<K, V> extends AbstractOptions {
|
||||
open(cb: ErrorCallback): void;
|
||||
open(options: AbstractOpenOptions, cb: ErrorCallback): void;
|
||||
|
||||
close(cb: ErrorCallback): void;
|
||||
|
||||
get(key: K, cb: ErrorValueCallback<V>): void;
|
||||
get(key: K, options: AbstractGetOptions, cb: ErrorValueCallback<V>): void;
|
||||
|
||||
put(key: K, value: V, cb: ErrorCallback): void;
|
||||
put(key: K, value: V, options: AbstractOptions, cb: ErrorCallback): void;
|
||||
|
||||
del(key: K, cb: ErrorCallback): void;
|
||||
del(key: K, options: AbstractOptions, cb: ErrorCallback): void;
|
||||
|
||||
batch(): AbstractChainedBatch<K, V>;
|
||||
batch(array: ReadonlyArray<AbstractBatch<K, V>>, cb: ErrorCallback): AbstractChainedBatch<K, V>;
|
||||
batch(array: ReadonlyArray<AbstractBatch<K, V>>, options: AbstractOptions, cb: ErrorCallback): AbstractChainedBatch<K, V>;
|
||||
|
||||
iterator(options?: AbstractIteratorOptions<K>): AbstractIterator<K, V>;
|
||||
}
|
||||
|
||||
export interface AbstractLevelDOWNConstructor {
|
||||
new (location: string): AbstractLevelDOWN<any, any>;
|
||||
(location: string): AbstractLevelDOWN<any, any>;
|
||||
}
|
||||
|
||||
export interface AbstractIteratorOptions<K> extends AbstractOptions {
|
||||
gt?: K;
|
||||
gte?: K;
|
||||
lt?: K;
|
||||
lte?: K;
|
||||
reverse?: boolean;
|
||||
limit?: number;
|
||||
keys?: boolean;
|
||||
values?: boolean;
|
||||
keyAsBuffer?: boolean;
|
||||
valueAsBuffer?: boolean;
|
||||
}
|
||||
|
||||
export type AbstractBatch<K, V> = PutBatch<K, V> | DelBatch<K, V>;
|
||||
|
||||
export interface PutBatch<K, V> {
|
||||
readonly type: 'put';
|
||||
readonly key: K;
|
||||
readonly value: V;
|
||||
}
|
||||
|
||||
export interface DelBatch<K, V> {
|
||||
readonly type: 'del';
|
||||
readonly key: K;
|
||||
}
|
||||
|
||||
export interface AbstractChainedBatch<K, V> extends AbstractChainedBatchConstructor, AbstractOptions {
|
||||
put: (key: K, value: V) => this;
|
||||
del: (key: K) => this;
|
||||
clear: () => this;
|
||||
write(cb: ErrorCallback): any;
|
||||
write(options: any, cb: ErrorCallback): any;
|
||||
}
|
||||
|
||||
export interface AbstractChainedBatchConstructor {
|
||||
new(db: any): AbstractChainedBatch<any, any>;
|
||||
(db: any): AbstractChainedBatch<any, any>;
|
||||
}
|
||||
|
||||
export interface AbstractIterator<K, V> extends AbstractChainedBatchConstructor {
|
||||
db: AbstractLevelDOWN<K, V>;
|
||||
next(cb: ErrorKeyValueCallback<K, V>): this;
|
||||
end(cb: ErrorCallback): void;
|
||||
}
|
||||
|
||||
export interface AbstractIteratorConstructor {
|
||||
new(db: any): AbstractIterator<any, any>;
|
||||
(db: any): AbstractIterator<any, any>;
|
||||
}
|
||||
|
||||
export const AbstractLevelDOWN: AbstractLevelDOWNConstructor;
|
||||
export const AbstractIterator: AbstractIteratorConstructor;
|
||||
export const AbstractChainedBatch: AbstractChainedBatchConstructor;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"abstract-leveldown-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
@@ -1,10 +1,14 @@
|
||||
import Agenda = require("agenda");
|
||||
import { Db, Server } from "mongodb";
|
||||
import { Db, Server, MongoClient } from "mongodb";
|
||||
|
||||
var mongoConnectionString = "mongodb://127.0.0.1/agenda";
|
||||
|
||||
(async () => {
|
||||
var agenda = new Agenda({ db: { address: mongoConnectionString } });
|
||||
var agenda = new Agenda({
|
||||
mongo: (await MongoClient.connect(mongoConnectionString)).db(),
|
||||
db: { collection: 'agenda-jobs' },
|
||||
});
|
||||
|
||||
agenda.define<{ foo: Error }>('delete old users', (job, done) => {
|
||||
done(job.attrs.data.foo)
|
||||
|
||||
Vendored
+5
-12
@@ -203,17 +203,7 @@ declare namespace Agenda {
|
||||
/**
|
||||
* Specifies that Agenda should be initialized using and existing MongoDB connection.
|
||||
*/
|
||||
mongo?: {
|
||||
/**
|
||||
* The MongoDB database connection to use.
|
||||
*/
|
||||
db: Db;
|
||||
|
||||
/**
|
||||
* The name of the collection to use.
|
||||
*/
|
||||
collection?: string;
|
||||
}
|
||||
mongo?: Db;
|
||||
|
||||
/**
|
||||
* Specifies that Agenda should connect to MongoDB.
|
||||
@@ -221,8 +211,10 @@ declare namespace Agenda {
|
||||
db?: {
|
||||
/**
|
||||
* The connection URL.
|
||||
* Required when using `db` option to connect.
|
||||
* Not required when an existing connection is passed as `mongo` property.
|
||||
*/
|
||||
address: string;
|
||||
address?: string;
|
||||
|
||||
/**
|
||||
* The name of the collection to use.
|
||||
@@ -231,6 +223,7 @@ declare namespace Agenda {
|
||||
|
||||
/**
|
||||
* Connection options to pass to MongoDB.
|
||||
* Not required when an existing connection is passed as `mongo` property.
|
||||
*/
|
||||
options?: any;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
import * as ansi from 'ansi-escape-sequences';
|
||||
|
||||
// $ExpectType string
|
||||
ansi.style.red;
|
||||
// $ExpectError
|
||||
ansi.style.invalidStyle;
|
||||
|
||||
// $ExpectType string
|
||||
ansi.styles('green');
|
||||
// $ExpectType string
|
||||
ansi.styles(['green', 'underline']);
|
||||
// $ExpectError
|
||||
ansi.styles('invalidStyle');
|
||||
// $ExpectError
|
||||
ansi.styles(['invalidStyle']);
|
||||
|
||||
// $ExpectType string
|
||||
ansi.format('what?', 'green');
|
||||
// $ExpectType string
|
||||
ansi.format('what?', ['green', 'bold']);
|
||||
// $ExpectType string
|
||||
ansi.format('[green bold]{what?}');
|
||||
// $ExpectError
|
||||
ansi.styles('what?', 'invalidStyle');
|
||||
// $ExpectError
|
||||
ansi.styles('what?', ['invalidStyle']);
|
||||
|
||||
// $ExpectType string
|
||||
ansi.cursor.up();
|
||||
// $ExpectType string
|
||||
ansi.cursor.up(1);
|
||||
|
||||
// $ExpectType string
|
||||
ansi.cursor.hide;
|
||||
// $ExpectType string
|
||||
ansi.cursor.show;
|
||||
|
||||
// $ExpectType string
|
||||
ansi.erase.display();
|
||||
// $ExpectType string
|
||||
ansi.erase.display(3);
|
||||
// $ExpectError
|
||||
ansi.erase.display(4);
|
||||
|
||||
// $ExpectType string
|
||||
ansi.erase.inLine();
|
||||
// $ExpectType string
|
||||
ansi.erase.inLine(2);
|
||||
// $ExpectError
|
||||
ansi.erase.inLine(3);
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
// Type definitions for ansi-escape-sequences 4.0
|
||||
// Project: https://github.com/75lb/ansi-escape-sequences#readme
|
||||
// Definitions by: Alexander Marks <https://github.com/aomarks>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
export type Style = 'reset'|'bold'|'italic'|'underline'|'fontDefault'|'font2'|
|
||||
'font3'|'font4'|'font5'|'font6'|'imageNegative'|'imagePositive'|'black'|
|
||||
'red'|'green'|'yellow'|'blue'|'magenta'|'cyan'|'white'|'grey'|'gray'|
|
||||
'bg-black'|'bg-red'|'bg-green'|'bg-yellow'|'bg-blue'|'bg-magenta'|'bg-cyan'|
|
||||
'bg-white'|'bg-grey'|'bg-gray';
|
||||
|
||||
/**
|
||||
* Various formatting styles (aka Select Graphic Rendition codes).
|
||||
*
|
||||
* @example
|
||||
* console.log(ansi.style.red + 'this is red' + ansi.style.reset)
|
||||
*/
|
||||
export const style: {[K in Style]: string};
|
||||
|
||||
/**
|
||||
* Returns an ansi sequence setting one or more effects.
|
||||
*
|
||||
* @param styles a style, or list or styles
|
||||
*
|
||||
* @example
|
||||
* > ansi.styles('green')
|
||||
* '\u001b[32m'
|
||||
*
|
||||
* > ansi.styles([ 'green', 'underline' ])
|
||||
* '\u001b[32;4m'
|
||||
*/
|
||||
export function styles(styles: Style|ReadonlyArray<Style>): string;
|
||||
|
||||
/**
|
||||
* A convenience function, applying the provided styles to the input string and
|
||||
* then resetting.
|
||||
*
|
||||
* Inline styling can be applied using the syntax `[style-list]{text to
|
||||
* format}`, where `style-list` is a space-separated list of styles from {@link
|
||||
* module:ansi-escape-sequences.style ansi.style}. For example `[bold white
|
||||
* bg-red]{bold white text on a red background}`.
|
||||
*
|
||||
* @param str the string to format
|
||||
* @param styles a style or list of styles to add to the input string
|
||||
*
|
||||
* @example
|
||||
* > ansi.format('what?', 'green')
|
||||
* '\u001b[32mwhat?\u001b[0m'
|
||||
*
|
||||
* > ansi.format('what?', ['green', 'bold'])
|
||||
* '\u001b[32;1mwhat?\u001b[0m'
|
||||
*
|
||||
* > ansi.format('[green bold]{what?}')
|
||||
* '\u001b[32;1mwhat?\u001b[0m'
|
||||
*/
|
||||
export function format(
|
||||
str: string, styles?: Style|ReadonlyArray<Style>): string;
|
||||
|
||||
/**
|
||||
* cursor-related sequences
|
||||
*/
|
||||
export namespace cursor {
|
||||
/**
|
||||
* Moves the cursor `lines` cells up. If the cursor is already at the edge
|
||||
* of the screen, this has no effect.
|
||||
* @param lines default=1
|
||||
*/
|
||||
function up(lines?: number): string;
|
||||
|
||||
/**
|
||||
* Moves the cursor `lines` cells down. If the cursor is already at the edge
|
||||
* of the screen, this has no effect.
|
||||
* @param lines default=1
|
||||
*/
|
||||
function down(lines?: number): string;
|
||||
|
||||
/**
|
||||
* Moves the cursor `lines` cells forward. If the cursor is already at the
|
||||
* edge of the screen, this has no effect.
|
||||
* @param lines default=1
|
||||
*/
|
||||
function forward(lines?: number): string;
|
||||
|
||||
/**
|
||||
* Moves the cursor `lines` cells back. If the cursor is already at the edge
|
||||
* of the screen, this has no effect.
|
||||
* @param lines default=1
|
||||
*/
|
||||
function back(lines?: number): string;
|
||||
|
||||
/**
|
||||
* Moves cursor to beginning of the line n lines down.
|
||||
* @param lines default=1
|
||||
*/
|
||||
function nextLine(lines?: number): string;
|
||||
|
||||
/**
|
||||
* Moves cursor to beginning of the line n lines up.
|
||||
* @param lines default=1
|
||||
*/
|
||||
function previousLine(lines?: number): string;
|
||||
|
||||
/**
|
||||
* Moves the cursor to column n.
|
||||
* @param n column number
|
||||
*/
|
||||
function horizontalAbsolute(n: number): string;
|
||||
|
||||
/**
|
||||
* Moves the cursor to row n, column m. The values are 1-based, and default
|
||||
* to 1 (top left corner) if omitted.
|
||||
*
|
||||
* @param n row number, default=1
|
||||
* @param m column number, default=1
|
||||
*/
|
||||
function position(n?: number, m?: number): string;
|
||||
|
||||
/**
|
||||
* Hides the cursor
|
||||
*/
|
||||
const hide: string;
|
||||
|
||||
/**
|
||||
* Shows the cursor
|
||||
*/
|
||||
const show: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* erase sequences
|
||||
*/
|
||||
export namespace erase {
|
||||
/**
|
||||
* Clears part of the screen. If n is 0 (or missing), clear from cursor to
|
||||
* end of screen. If n is 1, clear from cursor to beginning of the screen.
|
||||
* If n is 2, clear entire screen. If n is 3, clear entire screen and delete
|
||||
* all lines saved in the scrollback buffer (some terminals only).
|
||||
*/
|
||||
function display(n?: 0|1|2|3): string;
|
||||
|
||||
/**
|
||||
* Erases part of the line. If n is zero (or missing), clear from cursor to
|
||||
* the end of the line. If n is one, clear from cursor to beginning of the
|
||||
* line. If n is two, clear entire line. Cursor position does not change.
|
||||
*/
|
||||
function inLine(n?: 0|1|2): string;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ansi-escape-sequences-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+3
-2
@@ -14,12 +14,13 @@ type FontFamily =
|
||||
|
||||
type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;
|
||||
|
||||
type CSSProperties = Omit<BaseCSSProperties, 'fontFamily'> & {
|
||||
type CSSProperties = Omit<BaseCSSProperties, 'fontFamily' | 'transition' | 'animationName' > & {
|
||||
fontFamily?: FontFamily | FontFamily[];
|
||||
animationName?: string | OpenCSSProperties | OpenCSSProperties[];
|
||||
};
|
||||
|
||||
// For pseudo selectors and media queries
|
||||
interface OpenCSSProperties extends CSSProperties {
|
||||
interface OpenCSSProperties extends CSSProperties {
|
||||
[k: string]: CSSProperties[keyof CSSProperties] | CSSProperties;
|
||||
}
|
||||
|
||||
|
||||
@@ -99,10 +99,9 @@ console.log(
|
||||
|
||||
const view = db._view("yolo")!;
|
||||
view.properties({
|
||||
locale: "C",
|
||||
commit: {
|
||||
consolidate: {
|
||||
bytes: { segmentThreshold: 20 }
|
||||
}
|
||||
consolidationIntervalMsec: 123,
|
||||
consolidationPolicy: {
|
||||
type: "bytes",
|
||||
segmentThreshold: 234
|
||||
}
|
||||
});
|
||||
|
||||
Vendored
+18
-26
@@ -848,10 +848,11 @@ declare namespace ArangoDB {
|
||||
): ArangoSearchViewProperties;
|
||||
}
|
||||
|
||||
interface ArangoSearchViewConsolidate {
|
||||
threshold: number;
|
||||
segmentThreshold: number;
|
||||
}
|
||||
type ArangoSearchViewConsolidationType =
|
||||
| "bytes"
|
||||
| "bytes_accum"
|
||||
| "count"
|
||||
| "fill";
|
||||
|
||||
interface ArangoSearchViewCollectionLink {
|
||||
analyzers?: string[];
|
||||
@@ -865,35 +866,26 @@ declare namespace ArangoDB {
|
||||
id: string;
|
||||
name: string;
|
||||
type: "arangosearch";
|
||||
commit: {
|
||||
cleanupIntervalStep: number;
|
||||
commitIntervalMsec: number;
|
||||
consolidate: {
|
||||
bytes?: ArangoSearchViewConsolidate;
|
||||
bytes_accum?: ArangoSearchViewConsolidate;
|
||||
count?: ArangoSearchViewConsolidate;
|
||||
fill?: ArangoSearchViewConsolidate;
|
||||
};
|
||||
|
||||
cleanupIntervalStep: number;
|
||||
consolidationIntervalMsec: number;
|
||||
consolidationPolicy: {
|
||||
type: ArangoSearchViewConsolidationType;
|
||||
segmentThreshold: number;
|
||||
threshold: number;
|
||||
};
|
||||
locale: string;
|
||||
links: {
|
||||
[key: string]: ArangoSearchViewCollectionLink | undefined;
|
||||
};
|
||||
}
|
||||
|
||||
interface ArangoSearchViewPropertiesOptions {
|
||||
locale?: string;
|
||||
commit?: {
|
||||
consolidate?:
|
||||
| "none"
|
||||
| {
|
||||
count?: Partial<ArangoSearchViewConsolidate>;
|
||||
bytes?: Partial<ArangoSearchViewConsolidate>;
|
||||
bytes_accum?: Partial<ArangoSearchViewConsolidate>;
|
||||
fill?: Partial<ArangoSearchViewConsolidate>;
|
||||
};
|
||||
commitIntervalMsec?: number;
|
||||
cleanupIntervalStep?: number;
|
||||
cleanupIntervalStep?: number;
|
||||
consolidationIntervalMsec?: number;
|
||||
consolidationPolicy?: {
|
||||
type?: ArangoSearchViewConsolidationType;
|
||||
segmentThreshold?: number;
|
||||
threshold?: number;
|
||||
};
|
||||
links?: {
|
||||
[key: string]: ArangoSearchViewCollectionLink | undefined;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import bloem = require('bloem');
|
||||
|
||||
const base = new bloem.Bloem(1, 2, Buffer.from('1', 'hex'));
|
||||
const safe = new bloem.SafeBloem(1, 2, Buffer.from('2', 'hex'));
|
||||
const scaling = new bloem.ScalingBloem(1,
|
||||
{ratio: 1, initial_capacity: 2, scaling: 3}
|
||||
);
|
||||
|
||||
// options are optional
|
||||
const scaling2 = new bloem.ScalingBloem(1);
|
||||
|
||||
// $ExpectType number
|
||||
bloem.calculateSize(1, 2);
|
||||
// $ExpectType number
|
||||
bloem.calculateSlices(1, 2);
|
||||
Vendored
+37
@@ -0,0 +1,37 @@
|
||||
// Type definitions for bloem 0.2
|
||||
// Project: https://github.com/wiedi/node-bloem
|
||||
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types= "node" />
|
||||
|
||||
export function calculateSize(capacity: number, error_rate: number): number;
|
||||
export function calculateSlices(size: number, capacity: number): number;
|
||||
|
||||
export class Bloem {
|
||||
constructor(size: number, slices: number, buffer: Buffer);
|
||||
|
||||
has(key: Buffer): boolean;
|
||||
add(key: Buffer): void;
|
||||
}
|
||||
|
||||
export class SafeBloem {
|
||||
constructor(capacity: number, error_rate: number, buffer: Buffer);
|
||||
|
||||
has(key: Buffer): boolean;
|
||||
add(key: Buffer): boolean;
|
||||
}
|
||||
|
||||
export class ScalingBloem {
|
||||
constructor(
|
||||
error_rate: number,
|
||||
options?: {
|
||||
ratio?: number;
|
||||
initial_capacity?: number;
|
||||
scaling?: number;
|
||||
}
|
||||
);
|
||||
|
||||
has(key: Buffer): boolean;
|
||||
add(key: Buffer): void;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"bloem-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
@@ -44,3 +44,11 @@ function testPromiseRejection() {
|
||||
function testGithubTicket28081Regression() {
|
||||
Promise.resolve([3]).map((n: number) => true);
|
||||
}
|
||||
|
||||
import Bluebird = require("bluebird");
|
||||
|
||||
function testTheWalkaroundForCastingGlobalPromiseToBluebirdPromise() {
|
||||
const bluebirdString: Bluebird<string> = Bluebird.resolve(
|
||||
new Promise<string>(() => 'Lorem ipsum')
|
||||
);
|
||||
}
|
||||
|
||||
Vendored
+56
-19
@@ -10,6 +10,25 @@
|
||||
* If you want to leverage the fact, that bluebird polyfills the global Promise in the browser, then
|
||||
* you need to tell TypeScript about this. The following declaration file does exactly that.
|
||||
*
|
||||
* 1.1. Why you might not want to use `bluebird-global` instead of `bluebird`.
|
||||
*
|
||||
* Because of how these typings tell TypeScript about bluebird's Promise methods, it is not
|
||||
* possible to cast global Promises to Bluebird promises in your code. In other words, you won't
|
||||
* be able to do the following (even though it's possible at the runtime):
|
||||
*
|
||||
* let bluebirdPromise: Bluebird<string> = new Promise<string>(() => { return 'Lorem ipsum'; });
|
||||
*
|
||||
* If you need to, you can walk-around this by constructing a new Bluebird promise over an instance
|
||||
* of the global Promise, like so:
|
||||
*
|
||||
* let bluebirdPromise: Bluebird<string> = Bluebird.resolve(
|
||||
* new Promise<string>(() => { return 'Lorem ipsum'; })
|
||||
* );
|
||||
*
|
||||
* So the bottom line is: if you use these typings, then be mindful when you try to mix the global
|
||||
* Promises with the Bluebird promises. You can avoid this problem by just settling on using either
|
||||
* of them and not both of them at the same time.
|
||||
*
|
||||
* 2. How to use it?
|
||||
*
|
||||
* It should just work, but there are a couple of points to be wary about:
|
||||
@@ -60,6 +79,17 @@
|
||||
* d. target es6, latest "es20xx", e.g. "es2017"
|
||||
*/
|
||||
|
||||
/*
|
||||
* @todo When dropping TS 2.x support, uncomment the following triple-slash directives and
|
||||
* remove the copy&paste from this file (marked with #std-lib-copy&paste-to-remove)
|
||||
*
|
||||
* TS 2.x support should be dropped once bluebird's typings stop compiling on 2.x (i.e.
|
||||
* once bluebird's typings stop supporting TS 2.x)
|
||||
*/
|
||||
/* /// <reference lib="es5" /> */
|
||||
/* /// <reference lib="es2015.promise" /> */
|
||||
/* /// <reference lib="es2018.promise" /> */
|
||||
|
||||
import Bluebird = require("bluebird");
|
||||
|
||||
declare global {
|
||||
@@ -73,7 +103,7 @@ declare global {
|
||||
bind: Bluebird<T>["bind"];
|
||||
call: Bluebird<T>["call"];
|
||||
cancel: Bluebird<T>["cancel"];
|
||||
// catch: Bluebird<T>["catch"];
|
||||
// catch: Bluebird<T>["catch"]; // Provided by lib.es5.d.ts
|
||||
caught: Bluebird<T>["caught"];
|
||||
delay: Bluebird<T>["delay"];
|
||||
disposer: Bluebird<T>["disposer"];
|
||||
@@ -81,7 +111,7 @@ declare global {
|
||||
each: Bluebird<T>["each"];
|
||||
error: Bluebird<T>["error"];
|
||||
filter: Bluebird<T>["filter"];
|
||||
// finally: Bluebird<T>["finally"];
|
||||
// finally: Bluebird<T>["finally"]; // Provided by lib.es2018.promise.d.ts
|
||||
get: Bluebird<T>["get"];
|
||||
isCancelled: Bluebird<T>["isCancelled"];
|
||||
isFulfilled: Bluebird<T>["isFulfilled"];
|
||||
@@ -103,7 +133,7 @@ declare global {
|
||||
suppressUnhandledRejections: Bluebird<T>["suppressUnhandledRejections"];
|
||||
tap: Bluebird<T>["tap"];
|
||||
tapCatch: Bluebird<T>["tapCatch"];
|
||||
// then: Bluebird<T>["then"];
|
||||
// then: Bluebird<T>["then"]; // Provided by lib.es5.d.ts
|
||||
thenReturn: Bluebird<T>["thenReturn"];
|
||||
thenThrow: Bluebird<T>["thenThrow"];
|
||||
catchReturn: Bluebird<T>["catchReturn"];
|
||||
@@ -115,19 +145,18 @@ declare global {
|
||||
value: Bluebird<T>["value"];
|
||||
|
||||
/*
|
||||
* Copy&paste ::then and ::catch from lib.es2015.promise.d.ts, because Bluebird's typings are not
|
||||
* Copy&paste ::then and ::catch from lib.es5.promise.d.ts, because Bluebird's typings are not
|
||||
* in line with the standard lib.
|
||||
*
|
||||
* This is only needed for es5 target, which doesn't include the lib.es2015.promise.d.ts typings.
|
||||
* #std-lib-copy&paste-to-remove
|
||||
*
|
||||
* @todo Make Bluebird's typings be in line with the standard lib.
|
||||
* @todo See the comment near the top of the file about code marked with #std-lib-copy&paste-to-remove
|
||||
*/
|
||||
then(onfulfilled?: ((value: T) => T | PromiseLike<T>) | undefined | null, onrejected?: ((reason: any) => T | PromiseLike<T>) | undefined | null): Promise<T>;
|
||||
then<TResult>(onfulfilled: ((value: T) => T | PromiseLike<T>) | undefined | null, onrejected: (reason: any) => TResult | PromiseLike<TResult>): Promise<T | TResult>;
|
||||
then<TResult>(onfulfilled: (value: T) => TResult | PromiseLike<TResult>, onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<TResult>;
|
||||
then<TResult1, TResult2>(onfulfilled: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>;
|
||||
catch(onrejected?: ((reason: any) => T | PromiseLike<T>) | undefined | null): Promise<T>;
|
||||
catch<TResult>(onrejected: (reason: any) => TResult | PromiseLike<TResult>): Promise<T | TResult>;
|
||||
then<TResult1 = T, TResult2 = never>(
|
||||
onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null,
|
||||
onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null
|
||||
): Promise<TResult1 | TResult2>;
|
||||
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
|
||||
|
||||
/*
|
||||
* TypeScript disallows adding overrides via `catch: typeof Bluebird.prototype.catch`. Copy&paste them then.
|
||||
@@ -142,7 +171,11 @@ declare global {
|
||||
catch<U>(predicate: Object, onReject: (error: any) => U | PromiseLike<U>): Bluebird<U | T>;
|
||||
|
||||
/*
|
||||
* See comments above `then` for the reason why this is needed. Taken from esnext.promise.d.ts.
|
||||
* See comments above `then` for the reason why this is needed. Taken from es2018.promise.d.ts.
|
||||
*
|
||||
* #std-lib-copy&paste-to-remove
|
||||
*
|
||||
* @todo See the comment near the top of the file about code marked with #std-lib-copy&paste-to-remove
|
||||
*/
|
||||
finally(onfinally?: (() => void) | undefined | null): Promise<T>;
|
||||
}
|
||||
@@ -153,7 +186,7 @@ declare global {
|
||||
interface PromiseConstructor {
|
||||
new <T>(callback: (resolve: (thenableOrResult?: T | PromiseLike<T>) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void): Promise<T>;
|
||||
|
||||
// all: typeof Bluebird.all;
|
||||
// all: typeof Bluebird.all; // Provided by lib.es2015.d.ts
|
||||
any: typeof Bluebird.any;
|
||||
attempt: typeof Bluebird.attempt;
|
||||
bind: typeof Bluebird.bind;
|
||||
@@ -176,10 +209,10 @@ declare global {
|
||||
promisify: typeof Bluebird.promisify;
|
||||
promisifyAll: typeof Bluebird.promisifyAll;
|
||||
props: typeof Bluebird.props;
|
||||
// race: typeof Bluebird.race;
|
||||
// race: typeof Bluebird.race; // Provided by lib.es2015.d.ts
|
||||
reduce: typeof Bluebird.reduce;
|
||||
// reject: typeof Bluebird.reject;
|
||||
// resolve: typeof Bluebird.resolve;
|
||||
// reject: typeof Bluebird.reject; // Provided by lib.es2015.d.ts
|
||||
// resolve: typeof Bluebird.resolve; // Provided by lib.es2015.d.ts
|
||||
some: typeof Bluebird.some;
|
||||
try: typeof Bluebird.try;
|
||||
using: typeof Bluebird.using;
|
||||
@@ -187,9 +220,9 @@ declare global {
|
||||
/*
|
||||
* Copy&paste from lib.es2015.promise.d.ts, because Bluebird's typings are not in line with the standard lib.
|
||||
*
|
||||
* This is only needed for es5 target, which doesn't include the lib.es2015.promise.d.ts typings.
|
||||
* #std-lib-copy&paste-to-remove
|
||||
*
|
||||
* @todo Make Bluebird's typings be in line with the standard lib.
|
||||
* @todo See the comment near the top of the file about code marked with #std-lib-copy&paste-to-remove
|
||||
*/
|
||||
all<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>, T9 | PromiseLike<T9>, T10 | PromiseLike<T10>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>;
|
||||
all<T1, T2, T3, T4, T5, T6, T7, T8, T9>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>, T9 | PromiseLike<T9>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;
|
||||
@@ -219,6 +252,10 @@ declare global {
|
||||
|
||||
/*
|
||||
* Declare the `Promise` variable. This is needed for es5 only and is a no-op for all other targets.
|
||||
*
|
||||
* #std-lib-copy&paste-to-remove
|
||||
*
|
||||
* @todo See the comment near the top of the file about code marked with #std-lib-copy&paste-to-remove
|
||||
*/
|
||||
var Promise: PromiseConstructor;
|
||||
}
|
||||
|
||||
Vendored
+1
-2
@@ -70,8 +70,7 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
|
||||
*
|
||||
* Alias `.caught();` for compatibility with earlier ECMAScript version.
|
||||
*/
|
||||
catch(onReject: (error: any) => Resolvable<R>): Bluebird<R>;
|
||||
catch<U>(onReject: ((error: any) => Resolvable<U>) | undefined | null): Bluebird<U | R>;
|
||||
catch<U = R>(onReject: ((error: any) => Resolvable<U>) | undefined | null): Bluebird<U | R>;
|
||||
|
||||
/**
|
||||
* This extends `.catch` to work more like catch-clauses in languages like Java or C#.
|
||||
|
||||
@@ -334,6 +334,7 @@ function zoom_examples() {
|
||||
data: {},
|
||||
zoom: {
|
||||
enabled: false,
|
||||
type: 'scroll',
|
||||
rescale: true,
|
||||
extent: [1, 100], // enable more zooming
|
||||
onzoom: (domain) => { /* code */ },
|
||||
|
||||
Vendored
+4
@@ -806,6 +806,10 @@ export interface ZoomOptions {
|
||||
* Enable zooming.
|
||||
*/
|
||||
enabled?: boolean;
|
||||
/**
|
||||
* Set interaction type for zooming
|
||||
*/
|
||||
type?: 'scroll' | 'drag';
|
||||
/**
|
||||
* Enable to rescale after zooming. If true set, y domain will be updated according to the zoomed region.
|
||||
*/
|
||||
|
||||
Vendored
+6471
-2633
File diff suppressed because it is too large
Load Diff
+1841
-375
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es2017",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
@@ -13,6 +9,10 @@
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"lib": [
|
||||
"es2017",
|
||||
"dom"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import cliTruncate = require('cli-truncate');
|
||||
|
||||
// Truncate at different positions
|
||||
// $ExpectType string
|
||||
cliTruncate('unicorn', 4); // default position: 'end'
|
||||
|
||||
// $ExpectType string
|
||||
cliTruncate('unicorn', 4, {position: 'start'});
|
||||
|
||||
// $ExpectType string
|
||||
cliTruncate('unicorn', 4, {position: 'middle'});
|
||||
|
||||
// Truncate Unicode surrogate pairs
|
||||
// $ExpectType string
|
||||
cliTruncate('uni\uD83C\uDE00corn', 5);
|
||||
|
||||
// Truncate full-width characters
|
||||
// $ExpectType string
|
||||
cliTruncate('안녕하세요', 3);
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// Type definitions for cli-truncate 1.1
|
||||
// Project: https://github.com/sindresorhus/cli-truncate
|
||||
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = cliTruncate;
|
||||
|
||||
declare function cliTruncate(
|
||||
input: string,
|
||||
columns: number,
|
||||
options?: {position?: 'start' | 'middle' | 'end'},
|
||||
): string;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"cli-truncate-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Vendored
+26
-5
@@ -17,9 +17,17 @@ declare namespace CodeMirror {
|
||||
export var Pos: CodeMirror.PositionConstructor;
|
||||
export var Pass: {toString(): "CodeMirror.PASS"};
|
||||
|
||||
/** Find the column position at a given string index using a given tabsize. */
|
||||
function countColumn(line: string, index: number | null, tabSize: number): number;
|
||||
function fromTextArea(host: HTMLTextAreaElement, options?: EditorConfiguration): CodeMirror.EditorFromTextArea;
|
||||
|
||||
/** Compare two positions, return 0 if they are the same, a negative number when a is less, and a positive number otherwise. */
|
||||
function cmpPos(a: Position, b: Position): number;
|
||||
|
||||
/** Utility function that computes an end position from a change (an object with from, to, and text properties, as passed to various event handlers).
|
||||
The returned position will be the end of the changed range, after the change is applied. */
|
||||
function changeEnd(change: EditorChange): Position;
|
||||
|
||||
/** It contains a string that indicates the version of the library. This is a triple of integers "major.minor.patch",
|
||||
where patch is zero for releases, and something else (usually one) for dev snapshots. */
|
||||
var version: string;
|
||||
@@ -51,6 +59,14 @@ declare namespace CodeMirror {
|
||||
CodeMirror.registerHelper("hint", "foo", myFoo), the value CodeMirror.hint.foo will point to myFoo. */
|
||||
function registerHelper(namespace: string, name: string, helper: any): void;
|
||||
|
||||
/** Given a state object, returns a {state, mode} object with the inner mode and its state for the current position. */
|
||||
function innerMode(mode: Mode<any>, state: any): { state: any, mode: Mode<any> };
|
||||
|
||||
/** Sometimes, it is useful to add or override mode object properties from external code.
|
||||
The CodeMirror.extendMode function can be used to add properties to mode objects produced for a specific mode.
|
||||
Its first argument is the name of the mode, its second an object that specifies the properties that should be added.
|
||||
This is mostly useful to add utilities that can later be looked up through getMode. */
|
||||
function extendMode(name: string, properties: Mode<any>): void;
|
||||
|
||||
function on(element: any, eventName: string, handler: Function): void;
|
||||
function off(element: any, eventName: string, handler: Function): void;
|
||||
@@ -324,6 +340,9 @@ declare namespace CodeMirror {
|
||||
you should probably follow up by calling this method to ensure CodeMirror is still looking as intended. */
|
||||
refresh(): void;
|
||||
|
||||
/** Gets the inner mode at a given position. This will return the same as getMode for simple modes, but will return an inner mode for nesting modes (such as htmlmixed). */
|
||||
getModeAt(pos: Position): any;
|
||||
|
||||
/** Retrieves information about the token the current mode found before the given position (a {line, ch} object). */
|
||||
getTokenAt(pos: CodeMirror.Position, precise?: boolean): Token;
|
||||
|
||||
@@ -555,8 +574,10 @@ declare namespace CodeMirror {
|
||||
/** Return true if any text is selected. */
|
||||
somethingSelected(): boolean;
|
||||
|
||||
/** Set the cursor position.You can either pass a single { line , ch } object , or the line and the character as two separate parameters. */
|
||||
setCursor(pos: CodeMirror.Position): void;
|
||||
/** Set the cursor position. You can either pass a single {line, ch} object, or the line and the character as two separate parameters.
|
||||
Will replace all selections with a single, empty selection at the given position.
|
||||
The supported options are the same as for setSelection */
|
||||
setCursor(pos: CodeMirror.Position | number, ch?: number, options?: { bias?: number, origin?: string, scroll?: boolean }): void;
|
||||
|
||||
/** Set a single selection range. anchor and head should be {line, ch} objects. head defaults to anchor when not given. */
|
||||
setSelection(anchor: CodeMirror.Position, head: CodeMirror.Position, options?: { bias?: number, origin?: string, scroll?: boolean }): void;
|
||||
@@ -709,9 +730,9 @@ declare namespace CodeMirror {
|
||||
/** Array of strings representing the text that replaced the changed range (split by line). */
|
||||
text: string[];
|
||||
/** Text that used to be between from and to, which is overwritten by this change. */
|
||||
removed: string[];
|
||||
removed?: string[];
|
||||
/** String representing the origin of the change event and wether it can be merged with history */
|
||||
origin: string;
|
||||
origin?: string;
|
||||
}
|
||||
|
||||
interface EditorChangeLinkedList extends CodeMirror.EditorChange {
|
||||
@@ -1083,7 +1104,7 @@ declare namespace CodeMirror {
|
||||
* This function should read one token from the stream it is given as an argument, optionally update its state,
|
||||
* and return a style string, or null for tokens that do not have to be styled. Multiple styles can be returned, separated by spaces.
|
||||
*/
|
||||
token(stream: StringStream, state: T): string | null;
|
||||
token?: (stream: StringStream, state: T) => string | null;
|
||||
|
||||
/**
|
||||
* A function that produces a state object to be used at the start of a document.
|
||||
|
||||
Vendored
+4
@@ -21,12 +21,16 @@ declare namespace CometD {
|
||||
}
|
||||
|
||||
interface CometD {
|
||||
|
||||
websocketEnabled?: boolean;
|
||||
|
||||
onListenerException: (exception: any, subscriptionHandle: any, isListener: boolean, message: string) => void;
|
||||
|
||||
init(options: CometD.ConfigurationOptions): void;
|
||||
|
||||
configure(config: CometD.ConfigurationOptions): void;
|
||||
|
||||
subscribe(channel: string, listener: (message: any) => void): void;
|
||||
|
||||
addListener(channel: string, listener: (message: any) => void): void;
|
||||
removeListener(listener: (message: any) => void): void;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
import * as crossfilter from 'crossfilter';
|
||||
|
||||
|
||||
interface Payment {
|
||||
|
||||
Vendored
-1
@@ -110,7 +110,6 @@ declare namespace CrossFilter {
|
||||
}
|
||||
}
|
||||
|
||||
declare var crossfilter: CrossFilter.CrossFilterStatic;
|
||||
declare module "crossfilter" {
|
||||
var crossfilter: CrossFilter.CrossFilterStatic;
|
||||
export = crossfilter;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as CrossFilter from 'crossfilter';
|
||||
import * as crossfilter from 'crossfilter';
|
||||
import * as d3 from "d3";
|
||||
import * as dc from "dc";
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -760,8 +760,8 @@ export enum MatchMode {
|
||||
}
|
||||
|
||||
export interface Credentials {
|
||||
client_email?: string;
|
||||
private_key?: string;
|
||||
client_email: string;
|
||||
private_key: string;
|
||||
}
|
||||
|
||||
export interface ClientOptions {
|
||||
|
||||
@@ -69,6 +69,10 @@ googletag.pubads().definePassback("/1234567/sports", [468, 60])
|
||||
.setTagForChildDirectedTreatment(1)
|
||||
.display();
|
||||
|
||||
googletag.pubads().definePassback('/1234567/sports', [468, 60])
|
||||
.setTagForUnderAgeOfConsent(1)
|
||||
.display();
|
||||
|
||||
googletag.pubads().definePassback("/1234567/sports", [468, 60]).
|
||||
setTargeting("color", "red").
|
||||
setTargeting("sport", ["rugby", "rowing"]).
|
||||
@@ -79,6 +83,13 @@ googletag.pubads().definePassback("/1234567/sports", [160, 600]).
|
||||
"interests": ["sports", "music", "movies"]}).
|
||||
display();
|
||||
|
||||
googletag.pubads().enableLazyLoad();
|
||||
googletag.pubads().enableLazyLoad({
|
||||
fetchMarginPercent: 500,
|
||||
renderMarginPercent: 200,
|
||||
mobileScaling: 2.0
|
||||
});
|
||||
|
||||
// The calls to construct an ad and display contents.
|
||||
slot1 = googletag.pubads().display("/1234567/sports", [728, 90], "div-1");
|
||||
slot2 = googletag.pubads().display("/1234567/news", [160, 600], "div-2");
|
||||
@@ -107,6 +118,13 @@ googletag.pubads().setTagForChildDirectedTreatment(1);
|
||||
// Clear child-directed setting and return to initial not-set value.
|
||||
googletag.pubads().clearTagForChildDirectedTreatment();
|
||||
|
||||
// Mark ad requests as coming from users under the age of consent.
|
||||
googletag.pubads().setTagForUnderAgeOfConsent(1);
|
||||
|
||||
// Clear the tag value that configures whether to mark ad requests as
|
||||
// coming from users under the age of consent.
|
||||
googletag.pubads().setTagForUnderAgeOfConsent();
|
||||
|
||||
googletag.pubads().setTargeting("interests", "sports");
|
||||
googletag.pubads().setTargeting("colors", "blue");
|
||||
googletag.pubads().setTargeting("fruits", "apple");
|
||||
|
||||
Vendored
+10
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Google Publisher Tag v199
|
||||
// Type definitions for Google Publisher Tag v238
|
||||
// Project: https://developers.google.com/doubleclick-gpt/reference
|
||||
// Definitions by: John Wright <https://github.com/johngeorgewright>
|
||||
// Steven Joyce <https://github.com/steven-joyce>
|
||||
@@ -40,6 +40,12 @@ declare namespace googletag {
|
||||
setContent(slot: Slot, content: String): void;
|
||||
}
|
||||
|
||||
export interface LazyLoadOptionsConfig {
|
||||
fetchMarginPercent?: number,
|
||||
renderMarginPercent?: number,
|
||||
mobileScaling?: number
|
||||
}
|
||||
|
||||
export interface ResponseInformation {
|
||||
advertiserId: string;
|
||||
campaignId: string;
|
||||
@@ -101,6 +107,7 @@ declare namespace googletag {
|
||||
setClickUrl(url: string): PassbackSlot;
|
||||
setForceSafeFrame(forceSafeFrame: boolean): PassbackSlot;
|
||||
setTagForChildDirectedTreatment(value: number): PassbackSlot;
|
||||
setTagForUnderAgeOfConsent(value: number): PassbackSlot;
|
||||
setTargeting(key: string, value: string | string[]): PassbackSlot;
|
||||
updateTargetingFromMap(map: Object): PassbackSlot;
|
||||
}
|
||||
@@ -116,6 +123,7 @@ declare namespace googletag {
|
||||
disableInitialLoad(): void;
|
||||
display(adUnitPath: string, size: GeneralSize, opt_div?: string | Element, opt_clickUrl?: string): Slot;
|
||||
enableAsyncRendering(): boolean;
|
||||
enableLazyLoad(opt_config?: LazyLoadOptionsConfig): void;
|
||||
enableSingleRequest(): boolean;
|
||||
enableSyncRendering(): boolean;
|
||||
enableVideoAds(): void;
|
||||
@@ -134,6 +142,7 @@ declare namespace googletag {
|
||||
setRequestNonPersonalizedAds(nonPersonalizedAds: 0 | 1): PubAdsService;
|
||||
setSafeFrameConfig(config: SafeFrameConfig): PubAdsService;
|
||||
setTagForChildDirectedTreatment(value: number): PubAdsService;
|
||||
setTagForUnderAgeOfConsent(opt_value?: number): PubAdsService;
|
||||
setTargeting(key: string, value: string | string[]): PubAdsService;
|
||||
setVideoContent(videoContentId: string, videoCmsId: string): void;
|
||||
updateCorrelator(): PubAdsService;
|
||||
|
||||
@@ -37,6 +37,21 @@ client.search({
|
||||
}, (error) => {
|
||||
});
|
||||
|
||||
client.search({
|
||||
body: {
|
||||
query: {
|
||||
match_all: {
|
||||
_name: 'test'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
).then((body) => {
|
||||
const hit = body.hits.hits[0];
|
||||
const names = hit && hit.matched_queries;
|
||||
}, (error) => {
|
||||
});
|
||||
|
||||
client.indices.delete({
|
||||
index: 'test_index',
|
||||
ignore: [404]
|
||||
|
||||
Vendored
+1
@@ -645,6 +645,7 @@ export interface SearchResponse<T> {
|
||||
fields?: any;
|
||||
highlight?: any;
|
||||
inner_hits?: any;
|
||||
matched_queries?: string[];
|
||||
sort?: string[];
|
||||
}>;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import elegantSpinner = require('elegant-spinner');
|
||||
|
||||
const frameFunction = elegantSpinner();
|
||||
|
||||
// $ExpectType string
|
||||
frameFunction();
|
||||
|
||||
const frames = elegantSpinner.frames;
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// Type definitions for elegant-spinner 1.0
|
||||
// Project: https://github.com/sindresorhus/elegant-spinner
|
||||
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = elegantSpinner;
|
||||
|
||||
declare function elegantSpinner(): () => string;
|
||||
|
||||
declare namespace elegantSpinner {
|
||||
const frames: ReadonlyArray<string>;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"elegant-spinner-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import envPaths = require('env-paths');
|
||||
|
||||
// $ExpectType Paths
|
||||
envPaths('./');
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// Type definitions for env-paths 1.0
|
||||
// Project: https://github.com/sindresorhus/env-paths
|
||||
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = envPaths;
|
||||
|
||||
declare function envPaths(name: string, opts?: { suffix: string; }): envPaths.Paths;
|
||||
|
||||
declare namespace envPaths {
|
||||
interface Paths {
|
||||
readonly data: string;
|
||||
readonly config: string;
|
||||
readonly cache: string;
|
||||
readonly log: string;
|
||||
readonly temp: string;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"env-paths-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
import ExpiredStorage = require('expired-storage');
|
||||
|
||||
const expiredStorage = new ExpiredStorage();
|
||||
|
||||
const mjkModel = {
|
||||
firstName: 'Maynard',
|
||||
middleName: 'James',
|
||||
familyName: 'Keenan',
|
||||
};
|
||||
|
||||
expiredStorage.clear();
|
||||
|
||||
expiredStorage.setItem('tool', '46&2', 10);
|
||||
|
||||
if (expiredStorage.getItem('tool') !== '46&2') {
|
||||
throw new Error('.setItem method is not working!');
|
||||
}
|
||||
|
||||
expiredStorage.setJson('mjk', mjkModel, 1);
|
||||
|
||||
const mjkTest = expiredStorage.getJson('mjk');
|
||||
|
||||
if (typeof mjkTest === 'undefined' || mjkTest.firstName !== mjkModel.firstName || mjkTest.middleName !== mjkModel.middleName || mjkTest.familyName !== mjkModel.familyName) {
|
||||
throw new Error('.setJson method is not working!');
|
||||
}
|
||||
|
||||
const keyCheck = expiredStorage.keys(true);
|
||||
|
||||
if (keyCheck && keyCheck.length === 2) {
|
||||
throw new Error('.keys method has failed.');
|
||||
}
|
||||
|
||||
expiredStorage.setItem('apc', 'brena', 2);
|
||||
|
||||
const goBackToSleep = expiredStorage.peek('apc');
|
||||
|
||||
if (!goBackToSleep.isExpired && goBackToSleep.value !== 'brena') {
|
||||
throw new Error('.peek -- we have expired early... or our value was incorrect...');
|
||||
}
|
||||
|
||||
do {
|
||||
// nothing here to see
|
||||
} while (!expiredStorage.isExpired('apc'));
|
||||
|
||||
const expiredKeys = expiredStorage.clearExpired();
|
||||
|
||||
if (expiredKeys.indexOf('apc') !== -1) {
|
||||
throw new Error('.clearExpired did not work..');
|
||||
}
|
||||
|
||||
if (expiredStorage.getItem('apc') !== null) {
|
||||
throw new Error('Expiration as a whole does not work.');
|
||||
}
|
||||
|
||||
expiredStorage.setItem('puscifer', 'the humbling river', 10000);
|
||||
|
||||
expiredStorage.updateExpiration('puscifer', 5000);
|
||||
|
||||
const checkKeyTime = expiredStorage.getTimeLeft('puscifer');
|
||||
|
||||
if (checkKeyTime && checkKeyTime >= 10000) {
|
||||
throw new Error('.updateExpiration method is broken -- or .getTimeLeft method is broken.');
|
||||
}
|
||||
|
||||
if (!expiredStorage.isExpired('mjk')) {
|
||||
throw new Error('.isExpired or Expiration as a whole is not working...');
|
||||
}
|
||||
|
||||
expiredStorage.clear();
|
||||
Vendored
+105
@@ -0,0 +1,105 @@
|
||||
// Type definitions for extended-storage 1.0
|
||||
// Project: https://github.com/RonenNess/ExpiredStorage/
|
||||
// Definitions by: Allen Gammel <https://github.com/intolerance>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
export = ExpiredStorage;
|
||||
|
||||
declare class ExpiredStorage {
|
||||
constructor(localStorage?: any);
|
||||
/**
|
||||
* Clear the entire storage and all keys in it.
|
||||
*/
|
||||
clear(): void;
|
||||
/**
|
||||
* Get a json serializable value. This basically calls JSON.parse on the returned value.
|
||||
* @param key Item key to get (string).
|
||||
* @return Stored value (JSON.parsed), or undefined if not set / expired.
|
||||
*/
|
||||
getJson(key: string): any;
|
||||
/**
|
||||
* Get item.
|
||||
* @param key: Item key to get (string).
|
||||
* @return: Stored value, or undefined if not set / expired.
|
||||
*/
|
||||
getItem(key: string): string | null;
|
||||
/**
|
||||
* Remove an item.
|
||||
* @param key Item key to remove (string).
|
||||
* @return Storage.removeItem() return code.
|
||||
*/
|
||||
removeItem(key: string): any;
|
||||
/**
|
||||
* Set a json serializable value. This basically calls JSON.stringify on 'val' before setting it.
|
||||
* @param key Item key to set (string).
|
||||
* @param value Value to store (object, will be JSON.stringified).
|
||||
* @param expiration Expiration time, in seconds. If not provided, will not set expiration time.
|
||||
* @param return Storage.setItem() return code.
|
||||
*/
|
||||
setJson(key: string, value: object, expirationTime?: number): any;
|
||||
/**
|
||||
* Set item.
|
||||
* @param key Item key to set (string).
|
||||
* @param value Value to store (string).
|
||||
* @param expiration Expiration time, in seconds. If not provided, will not set expiration time.
|
||||
* @return Storage.setItem() return code.
|
||||
*/
|
||||
setItem(key: string, value: string, expiration?: number): any;
|
||||
/**
|
||||
* Get all keys in storage, not including internal keys used to store expiration.
|
||||
* @param: includeExpired: if true, will also include expired keys.
|
||||
* @return: Array with keys.
|
||||
*/
|
||||
keys(includeExpired: boolean): string[] | null;
|
||||
/**
|
||||
* Get item time left to live.
|
||||
* @param key Item key to get (string).
|
||||
* @return Time left to expire (in seconds), or null if don't have expiration date.
|
||||
*/
|
||||
getTimeLeft(key: string): number | null;
|
||||
/**
|
||||
* Clear expired keys.
|
||||
* If you never call this function, expired keys will remain until you try to get them / reset a new value.
|
||||
*
|
||||
* @param return: List of removed keys due to expiration.
|
||||
*/
|
||||
clearExpired(): string[];
|
||||
/**
|
||||
* Return if an item is expired (don't remove it, even if expired).
|
||||
* @param key Item key to check (string).
|
||||
* @return True if expired, False otherwise.
|
||||
*/
|
||||
isExpired(key: string): boolean;
|
||||
/**
|
||||
* Get item + metadata such as time left and if expired.
|
||||
* Even if item expired, will not remove it.
|
||||
* @param key Item key to get (string).
|
||||
* @return PeekInterface with: {value, timeLeft, isExpired}
|
||||
*/
|
||||
peek(key: string): ExpiredStorage.PeekInterface;
|
||||
/**
|
||||
* Update expiration time for an item (note: doesn't validate that the item is set).
|
||||
* @param key: Item key to update expiration for (string).
|
||||
* @param expiration: New expiration time in seconds to set.
|
||||
* @return: Storage.setItem() return code for setting new expiration.
|
||||
*/
|
||||
updateExpiration(key: string, expiration: number): any;
|
||||
}
|
||||
|
||||
declare namespace ExpiredStorage {
|
||||
interface PeekInterface {
|
||||
/**
|
||||
* The value of a [key]
|
||||
*/
|
||||
value: string | null;
|
||||
/**
|
||||
* Time remaining until expiration
|
||||
*/
|
||||
timeLeft: number | null;
|
||||
/**
|
||||
* Has the [key] expired or not
|
||||
*/
|
||||
isExpired: boolean;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"expired-storage-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Vendored
+18
-2
@@ -1998,7 +1998,17 @@ interface IObjectOptions {
|
||||
*/
|
||||
scaleY?: number;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Object skew factor (horizontal)
|
||||
*/
|
||||
skewX?: number;
|
||||
|
||||
/**
|
||||
* Object skew factor (vertical)
|
||||
*/
|
||||
skewY?: number;
|
||||
|
||||
/**
|
||||
* When true, an object is rendered as flipped horizontally
|
||||
*/
|
||||
flipX?: boolean;
|
||||
@@ -2308,7 +2318,13 @@ export class Object {
|
||||
getScaleY(): number;
|
||||
setScaleY(value: number): Object;
|
||||
|
||||
setShadow(options: any): Object;
|
||||
getSkewX(): number;
|
||||
setSkewX(value: number): Object;
|
||||
|
||||
getSkewY(): number;
|
||||
setSkewY(value: number): Object;
|
||||
|
||||
setShadow(options: any): Object;
|
||||
getShadow(): Object;
|
||||
|
||||
stateProperties: any[];
|
||||
|
||||
@@ -872,7 +872,7 @@ laboris nisi ut aliquip ex ea commodo consequat.`;
|
||||
const activeObject = <fabric.Text> canvas.getActiveObject();
|
||||
if (activeObject && activeObject.type === 'text') {
|
||||
activeObject.textDecoration = (activeObject.textDecoration === 'underline' ? '' : 'underline');
|
||||
this.className = activeObject.textDecoration ? 'selected' : '';
|
||||
(this as HTMLElement).className = activeObject.textDecoration ? 'selected' : '';
|
||||
canvas.renderAll();
|
||||
}
|
||||
};
|
||||
@@ -885,7 +885,7 @@ laboris nisi ut aliquip ex ea commodo consequat.`;
|
||||
const activeObject = <fabric.Text> canvas.getActiveObject();
|
||||
if (activeObject && activeObject.type === 'text') {
|
||||
activeObject.textDecoration = (activeObject.textDecoration === 'line-through' ? '' : 'line-through');
|
||||
this.className = activeObject.textDecoration ? 'selected' : '';
|
||||
(this as HTMLElement).className = activeObject.textDecoration ? 'selected' : '';
|
||||
canvas.renderAll();
|
||||
}
|
||||
};
|
||||
@@ -898,7 +898,7 @@ laboris nisi ut aliquip ex ea commodo consequat.`;
|
||||
const activeObject = <fabric.Text> canvas.getActiveObject();
|
||||
if (activeObject && activeObject.type === 'text') {
|
||||
activeObject.textDecoration = (activeObject.textDecoration === 'overline' ? '' : 'overline');
|
||||
this.className = activeObject.textDecoration ? 'selected' : '';
|
||||
(this as HTMLElement).className = activeObject.textDecoration ? 'selected' : '';
|
||||
canvas.renderAll();
|
||||
}
|
||||
};
|
||||
@@ -911,7 +911,7 @@ laboris nisi ut aliquip ex ea commodo consequat.`;
|
||||
const activeObject = <fabric.Text> canvas.getActiveObject();
|
||||
if (activeObject && activeObject.type === 'text') {
|
||||
activeObject.fontWeight = (activeObject.fontWeight === 'bold' ? '' : 'bold');
|
||||
this.className = activeObject.fontWeight ? 'selected' : '';
|
||||
(this as HTMLElement).className = activeObject.fontWeight ? 'selected' : '';
|
||||
canvas.renderAll();
|
||||
}
|
||||
};
|
||||
@@ -924,7 +924,7 @@ laboris nisi ut aliquip ex ea commodo consequat.`;
|
||||
const activeObject = <fabric.Text> canvas.getActiveObject();
|
||||
if (activeObject && activeObject.type === 'text') {
|
||||
activeObject.fontStyle = (activeObject.fontStyle === 'italic' ? '' : 'italic');
|
||||
this.className = activeObject.fontStyle ? 'selected' : '';
|
||||
(this as HTMLElement).className = activeObject.fontStyle ? 'selected' : '';
|
||||
canvas.renderAll();
|
||||
}
|
||||
};
|
||||
@@ -937,7 +937,7 @@ laboris nisi ut aliquip ex ea commodo consequat.`;
|
||||
const activeObject = <fabric.Text> canvas.getActiveObject();
|
||||
if (activeObject && activeObject.type === 'text') {
|
||||
activeObject.shadow = !activeObject.shadow ? 'rgba(0,0,0,0.2) 2px 2px 10px' : '';
|
||||
this.className = activeObject.shadow ? 'selected' : '';
|
||||
(this as HTMLElement).className = activeObject.shadow ? 'selected' : '';
|
||||
canvas.renderAll();
|
||||
}
|
||||
};
|
||||
|
||||
Vendored
+95
-95
@@ -1,21 +1,21 @@
|
||||
// Type definitions for File System API
|
||||
// Project: http://www.w3.org/TR/file-system-api/
|
||||
// Definitions by: Kon <http://phyzkit.net/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// Definitions by: Kon <http://phyzkit.net/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="filewriter" />
|
||||
|
||||
interface LocalFileSystem {
|
||||
|
||||
|
||||
/**
|
||||
* Used for storage with no guarantee of persistence.
|
||||
*/
|
||||
TEMPORARY:number;
|
||||
TEMPORARY: number;
|
||||
|
||||
/**
|
||||
* Used for storage that should not be removed by the user agent without application or user permission.
|
||||
*/
|
||||
PERSISTENT:number;
|
||||
PERSISTENT: number;
|
||||
|
||||
/**
|
||||
* Requests a filesystem in which to store application data.
|
||||
@@ -24,50 +24,50 @@ interface LocalFileSystem {
|
||||
* @param successCallback The callback that is called when the user agent provides a filesystem.
|
||||
* @param errorCallback A callback that is called when errors happen, or when the request to obtain the filesystem is denied.
|
||||
*/
|
||||
requestFileSystem(type:number, size:number, successCallback:FileSystemCallback, errorCallback?:ErrorCallback):void;
|
||||
|
||||
requestFileSystem(type: number, size: number, successCallback: FileSystemCallback, errorCallback?: ErrorCallback): void;
|
||||
|
||||
/**
|
||||
* Allows the user to look up the Entry for a file or directory referred to by a local URL.
|
||||
* @param url A URL referring to a local file in a filesystem accessable via this API.
|
||||
* @param successCallback A callback that is called to report the Entry to which the supplied URL refers.
|
||||
* @param errorCallback A callback that is called when errors happen, or when the request to obtain the Entry is denied.
|
||||
*/
|
||||
resolveLocalFileSystemURL(url:string, successCallback:EntryCallback, errorCallback?:ErrorCallback):void;
|
||||
*/
|
||||
resolveLocalFileSystemURL(url: string, successCallback: EntryCallback, errorCallback?: ErrorCallback): void;
|
||||
|
||||
/**
|
||||
* see requestFileSystem.
|
||||
*/
|
||||
webkitRequestFileSystem(type:number, size:number, successCallback:FileSystemCallback, errorCallback?:ErrorCallback):void;
|
||||
webkitRequestFileSystem(type: number, size: number, successCallback: FileSystemCallback, errorCallback?: ErrorCallback): void;
|
||||
}
|
||||
|
||||
interface LocalFileSystemSync {
|
||||
/**
|
||||
* Used for storage with no guarantee of persistence.
|
||||
*/
|
||||
TEMPORARY:number;
|
||||
TEMPORARY: number;
|
||||
|
||||
/**
|
||||
* Used for storage that should not be removed by the user agent without application or user permission.
|
||||
*/
|
||||
PERSISTENT:number;
|
||||
PERSISTENT: number;
|
||||
|
||||
/**
|
||||
* Requests a filesystem in which to store application data.
|
||||
* @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT.
|
||||
* @param size This is an indicator of how much storage space, in bytes, the application expects to need.
|
||||
*/
|
||||
requestFileSystemSync(type:number, size:number):FileSystemSync;
|
||||
requestFileSystemSync(type: number, size: number): FileSystemSync;
|
||||
|
||||
/**
|
||||
* Allows the user to look up the Entry for a file or directory referred to by a local URL.
|
||||
* @param url A URL referring to a local file in a filesystem accessable via this API.
|
||||
*/
|
||||
resolveLocalFileSystemSyncURL(url:string):EntrySync;
|
||||
resolveLocalFileSystemSyncURL(url: string): EntrySync;
|
||||
|
||||
/**
|
||||
* see requestFileSystemSync
|
||||
*/
|
||||
webkitRequestFileSystemSync(type:number, size:number):FileSystemSync;
|
||||
webkitRequestFileSystemSync(type: number, size: number): FileSystemSync;
|
||||
}
|
||||
|
||||
interface Metadata {
|
||||
@@ -75,31 +75,31 @@ interface Metadata {
|
||||
* This is the time at which the file or directory was last modified.
|
||||
* @readonly
|
||||
*/
|
||||
modificationTime:Date;
|
||||
modificationTime: Date;
|
||||
|
||||
/**
|
||||
* The size of the file, in bytes. This must return 0 for directories.
|
||||
* @readonly
|
||||
*/
|
||||
size:number;
|
||||
size: number;
|
||||
}
|
||||
|
||||
interface Flags {
|
||||
/**
|
||||
* Used to indicate that the user wants to create a file or directory if it was not previously there.
|
||||
*/
|
||||
create?:boolean;
|
||||
create?: boolean;
|
||||
|
||||
/**
|
||||
* By itself, exclusive must have no effect. Used with create, it must cause getFile and getDirectory to fail if the target path already exists.
|
||||
*/
|
||||
exclusive?:boolean;
|
||||
exclusive?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* This interface represents a file system.
|
||||
*/
|
||||
interface FileSystem{
|
||||
interface FileSystem {
|
||||
/**
|
||||
* This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems.
|
||||
* @readonly
|
||||
@@ -118,38 +118,38 @@ interface Entry {
|
||||
/**
|
||||
* Entry is a file.
|
||||
*/
|
||||
isFile:boolean;
|
||||
isFile: boolean;
|
||||
|
||||
/**
|
||||
* Entry is a directory.
|
||||
*/
|
||||
isDirectory:boolean;
|
||||
isDirectory: boolean;
|
||||
|
||||
/**
|
||||
* Look up metadata about this entry.
|
||||
* @param successCallback A callback that is called with the time of the last modification.
|
||||
* @param errorCallback ErrorCallback A callback that is called when errors happen.
|
||||
*/
|
||||
getMetadata(successCallback:MetadataCallback, errorCallback?:ErrorCallback):void;
|
||||
|
||||
getMetadata(successCallback: MetadataCallback, errorCallback?: ErrorCallback): void;
|
||||
|
||||
/**
|
||||
* The name of the entry, excluding the path leading to it.
|
||||
*/
|
||||
name:string;
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* The full absolute path from the root to the entry.
|
||||
*/
|
||||
fullPath:string;
|
||||
fullPath: string;
|
||||
|
||||
/**
|
||||
* The file system on which the entry resides.
|
||||
*/
|
||||
filesystem:FileSystem;
|
||||
filesystem: FileSystem;
|
||||
|
||||
/**
|
||||
* Move an entry to a different location on the file system. It is an error to try to:
|
||||
*
|
||||
*
|
||||
* <ui>
|
||||
* <li>move a directory inside itself or to any child at any depth;</li>
|
||||
* <li>move an entry into its parent if a name different from its current one isn't provided;</li>
|
||||
@@ -161,12 +161,12 @@ interface Entry {
|
||||
* A move of a file on top of an existing file must attempt to delete and replace that file.
|
||||
* A move of a directory on top of an existing empty directory must attempt to delete and replace that directory.
|
||||
*/
|
||||
moveTo(parent:DirectoryEntry, newName?:string, successCallback?:EntryCallback, errorCallback?:ErrorCallback):void;
|
||||
|
||||
moveTo(parent: DirectoryEntry, newName?: string, successCallback?: EntryCallback, errorCallback?: ErrorCallback): void;
|
||||
|
||||
/**
|
||||
* Copy an entry to a different location on the file system. It is an error to try to:
|
||||
*
|
||||
* <ul>
|
||||
*
|
||||
* <ul>
|
||||
* <li> copy a directory inside itself or to any child at any depth;</li>
|
||||
* <li> copy an entry into its parent if a name different from its current one isn't provided;</li>
|
||||
* <li> copy a file to a path occupied by a directory;</li>
|
||||
@@ -178,26 +178,26 @@ interface Entry {
|
||||
*
|
||||
* Directory copies are always recursive--that is, they copy all contents of the directory.
|
||||
*/
|
||||
copyTo(parent:DirectoryEntry, newName?:string, successCallback?:EntryCallback, errorCallback?:ErrorCallback):void;
|
||||
|
||||
copyTo(parent: DirectoryEntry, newName?: string, successCallback?: EntryCallback, errorCallback?: ErrorCallback): void;
|
||||
|
||||
/**
|
||||
* Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists.
|
||||
*/
|
||||
toURL():string;
|
||||
toURL(): string;
|
||||
|
||||
/**
|
||||
* Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
|
||||
* @param successCallback A callback that is called on success.
|
||||
* @param errorCallback A callback that is called when errors happen.
|
||||
*/
|
||||
remove(successCallback:VoidCallback, errorCallback?:ErrorCallback):void;
|
||||
|
||||
remove(successCallback: VoidCallback, errorCallback?: ErrorCallback): void;
|
||||
|
||||
/**
|
||||
* Look up the parent DirectoryEntry containing this Entry. If this Entry is the root of its filesystem, its parent is itself.
|
||||
* @param successCallback A callback that is called to return the parent Entry.
|
||||
* @param errorCallback A callback that is called when errors happen.
|
||||
*/
|
||||
getParent(successCallback:DirectoryEntryCallback, errorCallback?:ErrorCallback):void;
|
||||
getParent(successCallback: DirectoryEntryCallback, errorCallback?: ErrorCallback): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -207,13 +207,13 @@ interface DirectoryEntry extends Entry {
|
||||
/**
|
||||
* Creates a new DirectoryReader to read Entries from this Directory.
|
||||
*/
|
||||
createReader():DirectoryReader;
|
||||
createReader(): DirectoryReader;
|
||||
|
||||
/**
|
||||
* Creates or looks up a file.
|
||||
* @param path Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.
|
||||
* @param options
|
||||
* <ul>
|
||||
* <ul>
|
||||
* <li>If create and exclusive are both true, and the path already exists, getFile must fail.</li>
|
||||
* <li>If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.</li>
|
||||
* <li>If create is not true and the path doesn't exist, getFile must fail.</li>
|
||||
@@ -223,12 +223,12 @@ interface DirectoryEntry extends Entry {
|
||||
* @param successCallback A callback that is called to return the File selected or created.
|
||||
* @param errorCallback A callback that is called when errors happen.
|
||||
*/
|
||||
getFile(path:string, options?:Flags, successCallback?:FileEntryCallback, errorCallback?:ErrorCallback):void;
|
||||
|
||||
getFile(path: string, options?: Flags, successCallback?: FileEntryCallback, errorCallback?: ErrorCallback): void;
|
||||
|
||||
/**
|
||||
* Creates or looks up a directory.
|
||||
* @param path Either an absolute path or a relative path from this DirectoryEntry to the directory to be looked up or created. It is an error to attempt to create a directory whose immediate parent does not yet exist.
|
||||
* @param options
|
||||
* @param options
|
||||
* <ul>
|
||||
* <li>If create and exclusive are both true and the path already exists, getDirectory must fail.</li>
|
||||
* <li>If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.</li>
|
||||
@@ -238,16 +238,16 @@ interface DirectoryEntry extends Entry {
|
||||
* </ul>
|
||||
* @param successCallback A callback that is called to return the DirectoryEntry selected or created.
|
||||
* @param errorCallback A callback that is called when errors happen.
|
||||
*
|
||||
*
|
||||
*/
|
||||
getDirectory(path:string, options?:Flags, successCallback?:DirectoryEntryCallback, errorCallback?:ErrorCallback):void;
|
||||
|
||||
getDirectory(path: string, options?: Flags, successCallback?: DirectoryEntryCallback, errorCallback?: ErrorCallback): void;
|
||||
|
||||
/**
|
||||
* Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem.
|
||||
* @param successCallback A callback that is called on success.
|
||||
* @param errorCallback A callback that is called when errors happen.
|
||||
*/
|
||||
removeRecursively(successCallback:VoidCallback, errorCallback?:ErrorCallback):void;
|
||||
removeRecursively(successCallback: VoidCallback, errorCallback?: ErrorCallback): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -265,7 +265,7 @@ interface DirectoryReader {
|
||||
* @param successCallback Called once per successful call to readEntries to deliver the next previously-unreported set of Entries in the associated Directory. If all Entries have already been returned from previous invocations of readEntries, successCallback must be called with a zero-length array as an argument.
|
||||
* @param errorCallback A callback indicating that there was an error reading from the Directory.
|
||||
*/
|
||||
readEntries(successCallback:EntriesCallback, errorCallback?:ErrorCallback):void;
|
||||
readEntries(successCallback: EntriesCallback, errorCallback?: ErrorCallback): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -277,14 +277,14 @@ interface FileEntry extends Entry {
|
||||
* @param successCallback A callback that is called with the new FileWriter.
|
||||
* @param errorCallback A callback that is called when errors happen.
|
||||
*/
|
||||
createWriter(successCallback:FileWriterCallback, errorCallback?:ErrorCallback):void;
|
||||
createWriter(successCallback: FileWriterCallback, errorCallback?: ErrorCallback): void;
|
||||
|
||||
/**
|
||||
* Returns a File that represents the current state of the file that this FileEntry represents.
|
||||
* @param successCallback A callback that is called with the File.
|
||||
* @param errorCallback A callback that is called when errors happen.
|
||||
*/
|
||||
file(successCallback:FileCallback, errorCallback?:ErrorCallback):void;
|
||||
file(successCallback: FileCallback, errorCallback?: ErrorCallback): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -294,7 +294,7 @@ interface FileSystemCallback {
|
||||
/**
|
||||
* @param filesystem The file systems to which the app is granted access.
|
||||
*/
|
||||
(filesystem:FileSystem):void;
|
||||
(filesystem: FileSystem): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -304,7 +304,7 @@ interface EntryCallback {
|
||||
/**
|
||||
* @param entry
|
||||
*/
|
||||
(entry:Entry):void;
|
||||
(entry: Entry): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -314,7 +314,7 @@ interface FileEntryCallback {
|
||||
/**
|
||||
* @param entry
|
||||
*/
|
||||
(entry:FileEntry):void;
|
||||
(entry: FileEntry): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -324,102 +324,102 @@ interface DirectoryEntryCallback {
|
||||
/**
|
||||
* @param entry
|
||||
*/
|
||||
(entry:DirectoryEntry):void;
|
||||
(entry: DirectoryEntry): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* When readEntries() succeeds, the following callback is made.
|
||||
*/
|
||||
interface EntriesCallback {
|
||||
(entries:Entry[]):void;
|
||||
(entries: Entry[]): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface is the callback used to look up file and directory metadata.
|
||||
*/
|
||||
interface MetadataCallback {
|
||||
(metadata:Metadata):void;
|
||||
(metadata: Metadata): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface is the callback used to create a FileWriter.
|
||||
*/
|
||||
*/
|
||||
interface FileWriterCallback {
|
||||
(fileWriter:FileWriter):void;
|
||||
(fileWriter: FileWriter): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface is the callback used to obtain a File.
|
||||
*/
|
||||
interface FileCallback {
|
||||
(file:File):void;
|
||||
(file: File): void;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* This interface is the generic callback used to indicate success of an asynchronous method.
|
||||
*/
|
||||
*/
|
||||
interface VoidCallback {
|
||||
():void;
|
||||
(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* When an error occurs, the following callback is made.
|
||||
*/
|
||||
interface ErrorCallback {
|
||||
(err:DOMError):void;
|
||||
(err: DOMError): void;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* This interface represents a file system.
|
||||
*/
|
||||
interface FileSystemSync {
|
||||
/**
|
||||
* This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems.
|
||||
*/
|
||||
name:string;
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* root The root directory of the file system.
|
||||
*/
|
||||
root:DirectoryEntrySync;
|
||||
root: DirectoryEntrySync;
|
||||
}
|
||||
|
||||
/**
|
||||
* An abstract interface representing entries in a file system, each of which may be a FileEntrySync or DirectoryEntrySync.
|
||||
*/
|
||||
interface EntrySync{
|
||||
interface EntrySync {
|
||||
/**
|
||||
* EntrySync is a file.
|
||||
* @readonly
|
||||
*/
|
||||
isFile:boolean;
|
||||
isFile: boolean;
|
||||
|
||||
/**
|
||||
* EntrySync is a directory.
|
||||
* @readonly
|
||||
*/
|
||||
isDirectory:boolean;
|
||||
isDirectory: boolean;
|
||||
|
||||
/**
|
||||
* Look up metadata about this entry.
|
||||
*/
|
||||
getMetadata():Metadata;
|
||||
|
||||
getMetadata(): Metadata;
|
||||
|
||||
/**
|
||||
* The name of the entry, excluding the path leading to it.
|
||||
*/
|
||||
name:string;
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* The full absolute path from the root to the entry.
|
||||
*/
|
||||
fullPath:string;
|
||||
fullPath: string;
|
||||
|
||||
/**
|
||||
* The file system on which the entry resides.
|
||||
*/
|
||||
filesystem:FileSystemSync;
|
||||
filesystem: FileSystemSync;
|
||||
|
||||
/**
|
||||
* Move an entry to a different location on the file system. It is an error to try to:
|
||||
@@ -429,12 +429,12 @@ interface EntrySync{
|
||||
* <li> move a file to a path occupied by a directory;</li>
|
||||
* <li> move a directory to a path occupied by a file;</li>
|
||||
* <li> move any element to a path occupied by a directory which is not empty.</li>
|
||||
* </ui>
|
||||
* </ui>
|
||||
* A move of a file on top of an existing file must attempt to delete and replace that file. A move of a directory on top of an existing empty directory must attempt to delete and replace that directory.
|
||||
* @param parent The directory to which to move the entry.
|
||||
* @param newName The new name of the entry. Defaults to the EntrySync's current name if unspecified.
|
||||
*/
|
||||
moveTo(parent:DirectoryEntrySync, newName?:string):EntrySync;
|
||||
moveTo(parent: DirectoryEntrySync, newName?: string): EntrySync;
|
||||
|
||||
/**
|
||||
* Copy an entry to a different location on the file system. It is an error to try to:
|
||||
@@ -444,27 +444,27 @@ interface EntrySync{
|
||||
* <li> copy a file to a path occupied by a directory;</li>
|
||||
* <li> copy a directory to a path occupied by a file;</li>
|
||||
* <li> copy any element to a path occupied by a directory which is not empty.</li>
|
||||
* </ui>
|
||||
* </ui>
|
||||
* A copy of a file on top of an existing file must attempt to delete and replace that file.
|
||||
* A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory.
|
||||
* Directory copies are always recursive--that is, they copy all contents of the directory.
|
||||
*/
|
||||
copyTo(parent:DirectoryEntrySync, newName?:string):EntrySync;
|
||||
copyTo(parent: DirectoryEntrySync, newName?: string): EntrySync;
|
||||
|
||||
/**
|
||||
* Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists.
|
||||
*/
|
||||
toURL():string;
|
||||
toURL(): string;
|
||||
|
||||
/**
|
||||
* Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
|
||||
*/
|
||||
remove ():void;
|
||||
remove(): void;
|
||||
|
||||
/**
|
||||
* Look up the parent DirectoryEntrySync containing this Entry. If this EntrySync is the root of its filesystem, its parent is itself.
|
||||
*/
|
||||
getParent():DirectoryEntrySync;
|
||||
getParent(): DirectoryEntrySync;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -474,12 +474,12 @@ interface DirectoryEntrySync extends EntrySync {
|
||||
/**
|
||||
* Creates a new DirectoryReaderSync to read EntrySyncs from this DirectorySync.
|
||||
*/
|
||||
createReader():DirectoryReaderSync;
|
||||
createReader(): DirectoryReaderSync;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Creates or looks up a directory.
|
||||
* @param path Either an absolute path or a relative path from this DirectoryEntrySync to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.
|
||||
* @param options
|
||||
* @param options
|
||||
* <ul>
|
||||
* <li> If create and exclusive are both true and the path already exists, getFile must fail.</li>
|
||||
* <li> If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.</li>
|
||||
@@ -488,12 +488,12 @@ interface DirectoryEntrySync extends EntrySync {
|
||||
* <li> Otherwise, if no other error occurs, getFile must return a FileEntrySync corresponding to path.</li>
|
||||
* </ul>
|
||||
*/
|
||||
getFile(path:string, options?:Flags):FileEntrySync;
|
||||
getFile(path: string, options?: Flags): FileEntrySync;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Creates or looks up a directory.
|
||||
* @param path Either an absolute path or a relative path from this DirectoryEntrySync to the directory to be looked up or created. It is an error to attempt to create a directory whose immediate parent does not yet exist.
|
||||
* @param options
|
||||
* @param options
|
||||
* <ul>
|
||||
* <li> If create and exclusive are both true and the path already exists, getDirectory must fail.</li>
|
||||
* <li> If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.</li>
|
||||
@@ -502,12 +502,12 @@ interface DirectoryEntrySync extends EntrySync {
|
||||
* <li> Otherwise, if no other error occurs, getDirectory must return a DirectoryEntrySync corresponding to path.</li>
|
||||
* </ul>
|
||||
*/
|
||||
getDirectory(path:string, options?:Flags):DirectoryEntrySync;
|
||||
getDirectory(path: string, options?: Flags): DirectoryEntrySync;
|
||||
|
||||
/**
|
||||
* Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem.
|
||||
*/
|
||||
removeRecursively():void;
|
||||
removeRecursively(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -523,7 +523,7 @@ interface DirectoryReaderSync {
|
||||
/**
|
||||
* Read the next block of entries from this directory.
|
||||
*/
|
||||
readEntries():EntrySync[];
|
||||
readEntries(): EntrySync[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -533,16 +533,16 @@ interface FileEntrySync extends EntrySync {
|
||||
/**
|
||||
* Creates a new FileWriterSync associated with the file that this FileEntrySync represents.
|
||||
*/
|
||||
createWriter():FileWriterSync;
|
||||
createWriter(): FileWriterSync;
|
||||
|
||||
/**
|
||||
* Returns a File that represents the current state of the file that this FileEntrySync represents.
|
||||
*/
|
||||
file():File;
|
||||
file(): File;
|
||||
}
|
||||
|
||||
interface Window extends LocalFileSystem, LocalFileSystemSync{
|
||||
interface Window extends LocalFileSystem, LocalFileSystemSync {
|
||||
}
|
||||
|
||||
interface WorkerGlobalScope extends LocalFileSystem, LocalFileSystemSync{
|
||||
interface WorkerGlobalScope extends LocalFileSystem, LocalFileSystemSync {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import Gamedig = require("gamedig");
|
||||
|
||||
Gamedig.query({
|
||||
type: "tf2",
|
||||
host: "127.0.0.1"
|
||||
}, (error, state) => {
|
||||
if (error) throw error();
|
||||
|
||||
const {
|
||||
name,
|
||||
map,
|
||||
password,
|
||||
maxplayers,
|
||||
players,
|
||||
bots,
|
||||
notes
|
||||
} = state;
|
||||
});
|
||||
Vendored
+285
@@ -0,0 +1,285 @@
|
||||
// Type definitions for Gamedig 1.0
|
||||
// Project: https://github.com/sonicsnes/node-gamedig
|
||||
// Definitions by: Ivan Sieder <https://github.com/ivansieder>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
export type Type =
|
||||
"7d2d"
|
||||
| "ageofchivalry"
|
||||
| "aoe2"
|
||||
| "alienarena"
|
||||
| "alienswarm"
|
||||
| "arkse"
|
||||
| "avp2"
|
||||
| "avp2010"
|
||||
| "americasarmy"
|
||||
| "americasarmy2"
|
||||
| "americasarmy3"
|
||||
| "americasarmypg"
|
||||
| "arma"
|
||||
| "arma2"
|
||||
| "arma3"
|
||||
| "armagetron"
|
||||
| "baldursgate"
|
||||
| "bat1944"
|
||||
| "bf1942"
|
||||
| "bfv"
|
||||
| "bf2"
|
||||
| "bf2142"
|
||||
| "bfbc2"
|
||||
| "bf3"
|
||||
| "bf4"
|
||||
| "bfh"
|
||||
| "breach"
|
||||
| "breed"
|
||||
| "brink"
|
||||
| "buildandshoot"
|
||||
| "cod"
|
||||
| "coduo"
|
||||
| "cod2"
|
||||
| "cod3"
|
||||
| "cod4"
|
||||
| "codwaw"
|
||||
| "codmw2"
|
||||
| "codmw3"
|
||||
| "callofjuarez"
|
||||
| "chaser"
|
||||
| "chrome"
|
||||
| "codenameeagle"
|
||||
| "commandos3"
|
||||
| "cacrenegade"
|
||||
| "conanexiles"
|
||||
| "contactjack"
|
||||
| "cs16"
|
||||
| "cscz"
|
||||
| "css"
|
||||
| "csgo"
|
||||
| "crossracing"
|
||||
| "crysis"
|
||||
| "crysiswars"
|
||||
| "crysis2"
|
||||
| "daikatana"
|
||||
| "dmomam"
|
||||
| "darkesthour"
|
||||
| "dayz"
|
||||
| "dayzmod"
|
||||
| "deadlydozenpt"
|
||||
| "dh2005"
|
||||
| "descent3"
|
||||
| "deusex"
|
||||
| "devastation"
|
||||
| "dinodday"
|
||||
| "dirttrackracing2"
|
||||
| "dnl"
|
||||
| "dod"
|
||||
| "dods"
|
||||
| "doi"
|
||||
| "doom3"
|
||||
| "dota2"
|
||||
| "drakan"
|
||||
| "etqw"
|
||||
| "fear"
|
||||
| "f12002"
|
||||
| "f1c9902"
|
||||
| "farcry"
|
||||
| "farcry2"
|
||||
| "fortressforever"
|
||||
| "flashpoint"
|
||||
| "ffow"
|
||||
| "fivem"
|
||||
| "garrysmod"
|
||||
| "graw"
|
||||
| "graw2"
|
||||
| "giantscitizenkabuto"
|
||||
| "globaloperations"
|
||||
| "geneshift"
|
||||
| "ges"
|
||||
| "gore"
|
||||
| "gunmanchronicles"
|
||||
| "hldm"
|
||||
| "hl2dm"
|
||||
| "halo"
|
||||
| "halo2"
|
||||
| "heretic2"
|
||||
| "hexen2"
|
||||
| "hidden"
|
||||
| "had2"
|
||||
| "homefront"
|
||||
| "homeworld2"
|
||||
| "hurtworld"
|
||||
| "igi2"
|
||||
| "il2"
|
||||
| "insurgency"
|
||||
| "ironstorm"
|
||||
| "jamesbondnightfire"
|
||||
| "jc2mp"
|
||||
| "killingfloor"
|
||||
| "killingfloor2"
|
||||
| "kingpin"
|
||||
| "kisspc"
|
||||
| "kspdmp"
|
||||
| "kzmod"
|
||||
| "left4dead"
|
||||
| "left4dead2"
|
||||
| "m2mp"
|
||||
| "medievalengineers"
|
||||
| "mohaa"
|
||||
| "mohpa"
|
||||
| "mohab"
|
||||
| "mohsh"
|
||||
| "mohbt"
|
||||
| "moh2010"
|
||||
| "mohwf"
|
||||
| "minecraft"
|
||||
| "minecraftpe"
|
||||
| "minecraftping"
|
||||
| "mnc"
|
||||
| "mtavc"
|
||||
| "mtasa"
|
||||
| "mumble"
|
||||
| "mumbleping"
|
||||
| "mutantfactions"
|
||||
| "nascarthunder2004"
|
||||
| "netpanzer"
|
||||
| "nmrih"
|
||||
| "ns"
|
||||
| "ns2"
|
||||
| "nfshp2"
|
||||
| "nab"
|
||||
| "nwn"
|
||||
| "nwn2"
|
||||
| "nexuiz"
|
||||
| "nitrofamily"
|
||||
| "nolf"
|
||||
| "nolf2"
|
||||
| "nucleardawn"
|
||||
| "openarena"
|
||||
| "openttd"
|
||||
| "operationflashpoint"
|
||||
| "painkiller"
|
||||
| "postal2"
|
||||
| "prey"
|
||||
| "primalcarnage"
|
||||
| "quake1"
|
||||
| "quake2"
|
||||
| "quake3"
|
||||
| "quake4"
|
||||
| "ragdollkungfu"
|
||||
| "r6"
|
||||
| "r6roguespear"
|
||||
| "r6ravenshield"
|
||||
| "rallisportchallenge"
|
||||
| "rallymasters"
|
||||
| "redorchestra"
|
||||
| "redorchestraost"
|
||||
| "redorchestra2"
|
||||
| "redline"
|
||||
| "rtcw"
|
||||
| "ricochet"
|
||||
| "riseofnations"
|
||||
| "rune"
|
||||
| "rust"
|
||||
| "samp"
|
||||
| "spaceengineers"
|
||||
| "ss"
|
||||
| "ss2"
|
||||
| "shatteredhorizon"
|
||||
| "ship"
|
||||
| "shogo"
|
||||
| "shootmania"
|
||||
| "sin"
|
||||
| "sinep"
|
||||
| "soldat"
|
||||
| "sof"
|
||||
| "sof2"
|
||||
| "stalker"
|
||||
| "stbc"
|
||||
| "stvef"
|
||||
| "stvef2"
|
||||
| "swbf"
|
||||
| "swbf2"
|
||||
| "swjk"
|
||||
| "swjk2"
|
||||
| "swrc"
|
||||
| "starbound"
|
||||
| "starmade"
|
||||
| "suicidesurvival"
|
||||
| "swat4"
|
||||
| "svencoop"
|
||||
| "synergy"
|
||||
| "tacticalops"
|
||||
| "teamfactor"
|
||||
| "tfc"
|
||||
| "tf2"
|
||||
| "teamspeak2"
|
||||
| "teamspeak3"
|
||||
| "terminus"
|
||||
| "terraria"
|
||||
| "thps3"
|
||||
| "thps4"
|
||||
| "thu2"
|
||||
| "towerunite"
|
||||
| "trackmania2"
|
||||
| "trackmaniaforever"
|
||||
| "tremulous"
|
||||
| "tribes1"
|
||||
| "tribesvengeance"
|
||||
| "tron20"
|
||||
| "turok2"
|
||||
| "universalcombat"
|
||||
| "unreal"
|
||||
| "unturned"
|
||||
| "ut"
|
||||
| "ut2003"
|
||||
| "ut2004"
|
||||
| "ut3"
|
||||
| "urbanterror"
|
||||
| "v8supercar"
|
||||
| "ventrilo"
|
||||
| "vietcong"
|
||||
| "vietcong2"
|
||||
| "warsow"
|
||||
| "wheeloftime"
|
||||
| "wolfenstein2009"
|
||||
| "wolfensteinet"
|
||||
| "xpandrally"
|
||||
| "zombiemaster"
|
||||
| "zps";
|
||||
|
||||
export interface Player {
|
||||
name?: string;
|
||||
ping?: number;
|
||||
score?: number;
|
||||
team?: string;
|
||||
address?: string;
|
||||
}
|
||||
|
||||
export interface QueryOptions {
|
||||
type: Type;
|
||||
host: string;
|
||||
port?: number;
|
||||
notes?: object;
|
||||
maxAttempts?: number;
|
||||
socketTimeout?: number;
|
||||
attemptTimeout?: number;
|
||||
}
|
||||
|
||||
export interface QueryResult {
|
||||
name: string;
|
||||
map: string;
|
||||
password: boolean;
|
||||
maxplayers: number;
|
||||
players: Player[];
|
||||
bots: Player[];
|
||||
notes: object;
|
||||
raw?: object;
|
||||
query?: object;
|
||||
}
|
||||
|
||||
export function query(
|
||||
options: QueryOptions,
|
||||
callback: (error: any, state: QueryResult) => void
|
||||
): void;
|
||||
|
||||
export function query(options: QueryOptions): Promise<QueryResult>;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gamedig-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
+2
@@ -104,10 +104,12 @@ declare namespace Storage {
|
||||
interface BucketQuery {
|
||||
autoPaginate?: boolean;
|
||||
delimiter?: string;
|
||||
directory?: string;
|
||||
prefix?: string;
|
||||
maxApiCalls?: number;
|
||||
maxResults?: number;
|
||||
pageToken?: string;
|
||||
userProject?: string;
|
||||
versions?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,33 @@
|
||||
import * as GulpImagemin from 'gulp-imagemin';
|
||||
import gulp = require('gulp');
|
||||
import gulpImagemin = require('gulp-imagemin');
|
||||
|
||||
GulpImagemin();
|
||||
const plugins = [
|
||||
gulpImagemin.gifsicle({ interlaced: true }),
|
||||
gulpImagemin.jpegtran({ progressive: true }),
|
||||
gulpImagemin.optipng({ optimizationLevel: 5 }),
|
||||
gulpImagemin.svgo({ floatPrecision: 2 })
|
||||
];
|
||||
|
||||
GulpImagemin([
|
||||
GulpImagemin.gifsicle({ interlaced: true }),
|
||||
GulpImagemin.jpegtran({ progressive: true }),
|
||||
GulpImagemin.optipng({ optimizationLevel: 5 }),
|
||||
GulpImagemin.svgo({
|
||||
plugins: [{ removeViewBox: true }, { cleanupIDs: false }]
|
||||
})
|
||||
]);
|
||||
gulp.task('build', () => {
|
||||
return gulp.src('*.{gif,jpg,png,svg}')
|
||||
.pipe(gulpImagemin())
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
|
||||
GulpImagemin({ verbose: true });
|
||||
gulp.task('build', () => {
|
||||
return gulp.src('*.{gif,jpg,png,svg}')
|
||||
.pipe(gulpImagemin(plugins))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
|
||||
GulpImagemin([
|
||||
GulpImagemin.svgo({
|
||||
plugins: [{ removeViewBox: true }]
|
||||
})
|
||||
], { verbose: true });
|
||||
gulp.task('build', () => {
|
||||
return gulp.src('*.{gif,jpg,png,svg}')
|
||||
.pipe(gulpImagemin({ verbose: true }))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
|
||||
gulp.task('build', () => {
|
||||
return gulp.src('*.{gif,jpg,png,svg}')
|
||||
.pipe(gulpImagemin(plugins, { verbose: true }))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
|
||||
Vendored
+13
-8
@@ -2,26 +2,31 @@
|
||||
// Project: https://github.com/sindresorhus/gulp-imagemin#readme
|
||||
// Definitions by: Romain Faust <https://github.com/romain-faust>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Plugin } from 'imagemin';
|
||||
import { Options as GifsicleOptions } from 'imagemin-gifsicle';
|
||||
import { Options as JpegtranOptions } from 'imagemin-jpegtran';
|
||||
import { Options as OptipngOptions } from 'imagemin-optipng';
|
||||
import { Options as SvgoOptions } from 'imagemin-svgo';
|
||||
import { Transform } from 'stream';
|
||||
|
||||
declare function imagemin(pluginsOrOptions?: imagemin.Plugin[] | imagemin.Options): Transform;
|
||||
declare function imagemin(plugins?: imagemin.Plugin[], options?: imagemin.Options): Transform;
|
||||
declare function imagemin(pluginsOrOptions?: ReadonlyArray<Plugin> | imagemin.Options): Transform;
|
||||
declare function imagemin(plugins?: ReadonlyArray<Plugin>, options?: imagemin.Options): Transform;
|
||||
|
||||
declare namespace imagemin {
|
||||
interface Options {
|
||||
verbose?: boolean;
|
||||
}
|
||||
|
||||
type Plugin = (input: any) => Promise<any>;
|
||||
type PluginFactory = (options?: any) => Plugin;
|
||||
type PluginFactory<T> = (options?: T) => Plugin;
|
||||
|
||||
const gifsicle: PluginFactory;
|
||||
const jpegtran: PluginFactory;
|
||||
const optipng: PluginFactory;
|
||||
const svgo: PluginFactory;
|
||||
const gifsicle: PluginFactory<GifsicleOptions>;
|
||||
const jpegtran: PluginFactory<JpegtranOptions>;
|
||||
const optipng: PluginFactory<OptipngOptions>;
|
||||
const svgo: PluginFactory<SvgoOptions>;
|
||||
}
|
||||
|
||||
export = imagemin;
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
import * as GulpJsonmin from 'gulp-jsonmin';
|
||||
import gulp = require('gulp');
|
||||
import gulpJsonmin = require('gulp-jsonmin');
|
||||
|
||||
GulpJsonmin();
|
||||
GulpJsonmin({});
|
||||
GulpJsonmin({ verbose: true });
|
||||
gulp.task('build', () => {
|
||||
return gulp.src('*.json')
|
||||
.pipe(gulpJsonmin())
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
|
||||
gulp.task('build', () => {
|
||||
return gulp.src('*.json')
|
||||
.pipe(gulpJsonmin({ verbose: true }))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
|
||||
Vendored
+3
-3
@@ -7,12 +7,12 @@
|
||||
|
||||
import { Transform } from 'stream';
|
||||
|
||||
declare function jsonmin(options?: jsonmin.Options): Transform;
|
||||
declare function gulpJsonmin(options?: gulpJsonmin.Options): Transform;
|
||||
|
||||
declare namespace jsonmin {
|
||||
declare namespace gulpJsonmin {
|
||||
interface Options {
|
||||
verbose?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export = jsonmin;
|
||||
export = gulpJsonmin;
|
||||
|
||||
Vendored
+1
-1
@@ -2904,7 +2904,7 @@ export interface ServerOptions {
|
||||
* Default value: none.
|
||||
* Used to create an HTTPS connection. The tls object is passed unchanged to the node HTTPS server as described in the node HTTPS documentation.
|
||||
*/
|
||||
tls?: boolean | https.RequestOptions;
|
||||
tls?: boolean | https.ServerOptions;
|
||||
|
||||
/**
|
||||
* Default value: constructed from runtime server information.
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import hat = require('hat');
|
||||
|
||||
const randomId = hat();
|
||||
|
||||
const rack = hat.rack();
|
||||
rack('car');
|
||||
const tractorId = rack('tractor');
|
||||
rack.get(tractorId);
|
||||
rack.set(randomId, 'bicycle');
|
||||
rack.hats;
|
||||
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
// Type definitions for hat 0.0
|
||||
// Project: https://github.com/substack/node-hat
|
||||
// Definitions by: Sasha Grin <https://github.com/tup1tsa>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface HatsList {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface Rack {
|
||||
bits: number;
|
||||
base: number;
|
||||
hats: HatsList;
|
||||
|
||||
(data: any): string;
|
||||
get(id: string): any;
|
||||
set(id: string, value: any): Rack;
|
||||
}
|
||||
|
||||
type CreateRack = (bits?: number, base?: number, expandBy?: number) => Rack;
|
||||
|
||||
interface Hat {
|
||||
(bits?: number, base?: number): string;
|
||||
rack: CreateRack;
|
||||
}
|
||||
|
||||
declare const hat: Hat;
|
||||
export = hat;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"hat-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -4,7 +4,29 @@ import * as hedron from 'hedron';
|
||||
<hedron.BreakpointProvider breakpoints={{ lg: 1, md: 2 }}>
|
||||
<hedron.Page debug fluid tagName="div" width="10px">
|
||||
<hedron.Row debug tagName="div">
|
||||
<hedron.Column debug divisions={3} fluid lg={3} smShift={2}>test</hedron.Column>
|
||||
<hedron.Column debug divisions={3} fluid lg={3} smShift={2}>
|
||||
test
|
||||
</hedron.Column>
|
||||
</hedron.Row>
|
||||
</hedron.Page>
|
||||
</hedron.BreakpointProvider>;
|
||||
|
||||
// withBreakpoints test
|
||||
interface Props {
|
||||
numeric: number;
|
||||
str: string;
|
||||
}
|
||||
|
||||
class ComponentWithBreakpoints extends React.Component<Props & hedron.BreakpointsProps> {
|
||||
render() {
|
||||
// `breakpoints` prop is accessible in component
|
||||
this.props.breakpoints;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
const WithBreakpoints = hedron.withBreakpoints(ComponentWithBreakpoints);
|
||||
|
||||
// breakpoints props is not needed
|
||||
<WithBreakpoints numeric={42} str='str' />;
|
||||
|
||||
Vendored
+10
-4
@@ -150,8 +150,14 @@ export interface HiddenProps {
|
||||
lg?: boolean;
|
||||
}
|
||||
|
||||
export interface BreakpointProviderProps {
|
||||
breakpoints: { sm?: number; md?: number; lg?: number };
|
||||
export interface Breakpoints {
|
||||
sm?: number;
|
||||
md?: number;
|
||||
lg?: number;
|
||||
}
|
||||
|
||||
export interface BreakpointsProps {
|
||||
breakpoints: Breakpoints;
|
||||
}
|
||||
|
||||
export class Column extends React.Component<ColumnProps & React.HTMLProps<HTMLElement>> {}
|
||||
@@ -159,8 +165,8 @@ export class Page extends React.Component<PageProps & React.HTMLProps<HTMLElemen
|
||||
export class Row extends React.Component<RowProps & React.HTMLProps<HTMLElement>> {}
|
||||
export class Hidden extends React.Component<HiddenProps & React.HTMLProps<HTMLElement>> {}
|
||||
export class BreakpointProvider extends React.Component<
|
||||
BreakpointProviderProps & React.HTMLProps<HTMLElement>
|
||||
BreakpointsProps & React.HTMLProps<HTMLElement>
|
||||
> {}
|
||||
export function withBreakpoints<T>(
|
||||
wrappedComponent: React.ComponentClass<T>
|
||||
wrappedComponent: React.ComponentClass<T & BreakpointsProps>
|
||||
): React.ComponentClass<T>;
|
||||
|
||||
@@ -58,6 +58,7 @@ function contentSecurityPolicyTest() {
|
||||
directives: {
|
||||
defaultSrc: ["'self'"]
|
||||
},
|
||||
loose: false,
|
||||
setAllHeaders: true
|
||||
}));
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -60,6 +60,7 @@ declare namespace helmet {
|
||||
disableAndroid?: boolean;
|
||||
browserSniff?: boolean;
|
||||
directives?: IHelmetContentSecurityPolicyDirectives;
|
||||
loose?: boolean;
|
||||
}
|
||||
|
||||
export interface IHelmetDnsPrefetchControlConfiguration {
|
||||
|
||||
Vendored
+14
-2
@@ -97,17 +97,29 @@ declare namespace i18next {
|
||||
interface ReactOptions {
|
||||
/**
|
||||
* set to true if you like to wait for loaded in every translated hoc
|
||||
* @default false
|
||||
*/
|
||||
wait?: boolean;
|
||||
/**
|
||||
* set it to fallback to let passed namespaces to translated hoc act as fallbacks
|
||||
* @default 'default'
|
||||
*/
|
||||
nsMode?: string;
|
||||
nsMode?: 'default' | 'fallback';
|
||||
/**
|
||||
* set it to the default parent element created by the Trans component.
|
||||
* @default div
|
||||
* @default 'div'
|
||||
*/
|
||||
defaultTransParent?: string;
|
||||
/**
|
||||
* set which events trigger a rerender, can be set to false or string of events
|
||||
* @default 'languageChanged loaded'
|
||||
*/
|
||||
bindI18n?: string | false;
|
||||
/**
|
||||
* set which events on store trigger a rerender, can be set to false or string of events
|
||||
* @default 'added removed'
|
||||
*/
|
||||
bindStore?: string | false;
|
||||
}
|
||||
|
||||
interface InitOptions {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import imagemin = require('imagemin');
|
||||
import imageminGifsicle = require('imagemin-gifsicle');
|
||||
|
||||
imagemin(['*.gif'], {
|
||||
plugins: [
|
||||
imageminGifsicle(),
|
||||
imageminGifsicle({ colors: 255 })
|
||||
]
|
||||
});
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// Type definitions for imagemin-gifsicle 5.2
|
||||
// Project: https://github.com/imagemin/imagemin-gifsicle#readme
|
||||
// Definitions by: Romain Faust <https://github.com/romain-faust>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Plugin } from 'imagemin';
|
||||
|
||||
declare function imageminGifsicle(options?: imageminGifsicle.Options): Plugin;
|
||||
|
||||
declare namespace imageminGifsicle {
|
||||
interface Options {
|
||||
colors?: number;
|
||||
interlaced?: boolean;
|
||||
optimizationLevel?: number;
|
||||
}
|
||||
}
|
||||
|
||||
export = imageminGifsicle;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"imagemin-gifsicle-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,9 @@
|
||||
import imagemin = require('imagemin');
|
||||
import imageminJpegtran = require('imagemin-jpegtran');
|
||||
|
||||
imagemin(['*.jpg'], {
|
||||
plugins: [
|
||||
imageminJpegtran(),
|
||||
imageminJpegtran({ progressive: true })
|
||||
]
|
||||
});
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for imagemin-jpegtran 5.0
|
||||
// Project: https://github.com/imagemin/imagemin-jpegtran#readme
|
||||
// Definitions by: Romain Faust <https://github.com/romain-faust>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Plugin } from 'imagemin';
|
||||
|
||||
declare function imageminJpegtran(options?: imageminJpegtran.Options): Plugin;
|
||||
|
||||
declare namespace imageminJpegtran {
|
||||
interface Options {
|
||||
arithmetic?: boolean;
|
||||
progressive?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export = imageminJpegtran;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"imagemin-jpegtran-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,9 @@
|
||||
import imagemin = require('imagemin');
|
||||
import imageminOptipng = require('imagemin-optipng');
|
||||
|
||||
imagemin(['*.png'], {
|
||||
plugins: [
|
||||
imageminOptipng(),
|
||||
imageminOptipng({ optimizationLevel: 2 })
|
||||
]
|
||||
});
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
// Type definitions for imagemin-optipng 5.2
|
||||
// Project: https://github.com/imagemin/imagemin-optipng#readme
|
||||
// Definitions by: Romain Faust <https://github.com/romain-faust>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Plugin } from 'imagemin';
|
||||
|
||||
declare function imageminOptipng(options?: imageminOptipng.Options): Plugin;
|
||||
|
||||
declare namespace imageminOptipng {
|
||||
interface Options {
|
||||
bitDepthReduction?: boolean;
|
||||
colorTypeReduction?: boolean;
|
||||
optimizationLevel?: number;
|
||||
paletteReduction?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export = imageminOptipng;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"imagemin-optipng-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,9 @@
|
||||
import imagemin = require('imagemin');
|
||||
import imageminSvgo = require('imagemin-svgo');
|
||||
|
||||
imagemin(['*.svg'], {
|
||||
plugins: [
|
||||
imageminSvgo(),
|
||||
imageminSvgo({ floatPrecision: 2 })
|
||||
]
|
||||
});
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
// Type definitions for imagemin-svgo 7.0
|
||||
// Project: https://github.com/imagemin/imagemin-svgo#readme
|
||||
// Definitions by: Romain Faust <https://github.com/romain-faust>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import { Plugin } from 'imagemin';
|
||||
import { Options as SvgoOptions } from 'svgo';
|
||||
|
||||
declare function imageminSvgo(options?: imageminSvgo.Options): Plugin;
|
||||
|
||||
declare namespace imageminSvgo {
|
||||
type Options = SvgoOptions;
|
||||
}
|
||||
|
||||
export = imageminSvgo;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"imagemin-svgo-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+13
-3
@@ -1,4 +1,4 @@
|
||||
// Type definitions for ioredis 3.2
|
||||
// Type definitions for ioredis 4.0
|
||||
// Project: https://github.com/luin/ioredis
|
||||
// Definitions by: York Yao <https://github.com/plantain-00>
|
||||
// Christopher Eck <https://github.com/chrisleck>
|
||||
@@ -12,12 +12,11 @@
|
||||
|
||||
/* =================== USAGE ===================
|
||||
import * as Redis from "ioredis";
|
||||
var redis = new Redis();
|
||||
const redis = new Redis();
|
||||
=============================================== */
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import Promise = require('bluebird');
|
||||
import tls = require('tls');
|
||||
|
||||
interface RedisStatic {
|
||||
@@ -842,6 +841,17 @@ declare namespace IORedis {
|
||||
* Fixed in: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/15858
|
||||
*/
|
||||
retryStrategy?(times: number): number | false;
|
||||
/**
|
||||
* By default, all pending commands will be flushed with an error every
|
||||
* 20 retry attempts. That makes sure commands won't wait forever when
|
||||
* the connection is down. You can change this behavior by setting
|
||||
* `maxRetriesPerRequest`.
|
||||
*
|
||||
* Set maxRetriesPerRequest to `null` to disable this behavior, and
|
||||
* every command will wait forever until the connection is alive again
|
||||
* (which is the default behavior before ioredis v4).
|
||||
*/
|
||||
maxRetriesPerRequest?: number | null;
|
||||
/**
|
||||
* 1/true means reconnect, 2 means reconnect and resend failed command. Returning false will ignore
|
||||
* the error and do nothing.
|
||||
|
||||
@@ -46,6 +46,7 @@ new Redis({
|
||||
password: 'auth',
|
||||
db: 0,
|
||||
retryStrategy() { return false; },
|
||||
maxRetriesPerRequest: 20,
|
||||
showFriendlyErrorStack: true,
|
||||
tls: {
|
||||
servername: 'tlsservername'
|
||||
@@ -129,9 +130,6 @@ redis.multi([
|
||||
// results = [[null, 'OK'], [null, 'bar']]
|
||||
});
|
||||
|
||||
redis.Promise.onPossiblyUnhandledRejection((error) => {
|
||||
});
|
||||
|
||||
const keys = ['foo', 'bar'];
|
||||
redis.mget(...keys);
|
||||
|
||||
|
||||
Vendored
+911
@@ -0,0 +1,911 @@
|
||||
// Type definitions for ioredis 3.2
|
||||
// Project: https://github.com/luin/ioredis
|
||||
// Definitions by: York Yao <https://github.com/plantain-00>
|
||||
// Christopher Eck <https://github.com/chrisleck>
|
||||
// Yoga Aliarham <https://github.com/aliarham11>
|
||||
// Ebrahim <https://github.com/br8h>
|
||||
// Shahar Mor <https://github.com/shaharmor>
|
||||
// Whemoon Jang <https://github.com/palindrom615>
|
||||
// Francis Gulotta <https://github.com/reconbot>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
/* =================== USAGE ===================
|
||||
import * as Redis from "ioredis";
|
||||
var redis = new Redis();
|
||||
=============================================== */
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import Promise = require('bluebird');
|
||||
import tls = require('tls');
|
||||
|
||||
interface RedisStatic {
|
||||
new(port?: number, host?: string, options?: IORedis.RedisOptions): IORedis.Redis;
|
||||
new(host?: string, options?: IORedis.RedisOptions): IORedis.Redis;
|
||||
new(options?: IORedis.RedisOptions): IORedis.Redis;
|
||||
(port?: number, host?: string, options?: IORedis.RedisOptions): IORedis.Redis;
|
||||
(host?: string, options?: IORedis.RedisOptions): IORedis.Redis;
|
||||
(options?: IORedis.RedisOptions): IORedis.Redis;
|
||||
Cluster: IORedis.Cluster;
|
||||
Command: IORedis.Command;
|
||||
}
|
||||
|
||||
declare var IORedis: RedisStatic;
|
||||
export = IORedis;
|
||||
|
||||
declare class Commander {
|
||||
getBuiltinCommands(): string[];
|
||||
createBuiltinCommand(commandName: string): {};
|
||||
defineCommand(name: string, definition: {
|
||||
numberOfKeys?: number;
|
||||
lua?: string;
|
||||
}): any;
|
||||
sendCommand(): void;
|
||||
}
|
||||
|
||||
declare namespace IORedis {
|
||||
interface Command {
|
||||
setArgumentTransformer(name: string, fn: (args: any[]) => any[]): void;
|
||||
setReplyTransformer(name: string, fn: (result: any) => any): void;
|
||||
}
|
||||
|
||||
interface Redis extends NodeJS.EventEmitter, Commander {
|
||||
Promise: typeof Promise;
|
||||
status: string;
|
||||
connect(callback?: () => void): Promise<any>;
|
||||
disconnect(): void;
|
||||
duplicate(): Redis;
|
||||
|
||||
send_command(command: string, ...args: any[]): any;
|
||||
|
||||
bitcount(key: string, callback: (err: Error, res: number) => void): void;
|
||||
bitcount(key: string, start: number, end: number, callback: (err: Error, res: number) => void): void;
|
||||
bitcount(key: string): Promise<number>;
|
||||
bitcount(key: string, start: number, end: number): Promise<number>;
|
||||
|
||||
get(key: string, callback: (err: Error, res: string) => void): void;
|
||||
get(key: string): Promise<string>;
|
||||
|
||||
getBuffer(key: string, callback: (err: Error, res: Buffer) => void): void;
|
||||
getBuffer(key: string): Promise<Buffer>;
|
||||
|
||||
set(key: string, value: any, expiryMode?: string | any[], time?: number | string, setMode?: number | string): Promise<string>;
|
||||
|
||||
set(key: string, value: any, callback: (err: Error, res: string) => void): void;
|
||||
set(key: string, value: any, setMode: string | any[], callback: (err: Error, res: string) => void): void;
|
||||
set(key: string, value: any, expiryMode: string, time: number | string, callback: (err: Error, res: string) => void): void;
|
||||
set(key: string, value: any, expiryMode: string, time: number | string, setMode: number | string, callback: (err: Error, res: string) => void): void;
|
||||
|
||||
setBuffer(key: string, value: any, expiryMode?: string | any[], time?: number | string, setMode?: number | string): Promise<Buffer>;
|
||||
|
||||
setBuffer(key: string, value: any, callback: (err: Error, res: Buffer) => void): void;
|
||||
setBuffer(key: string, value: any, setMode: string, callback: (err: Error, res: Buffer) => void): void;
|
||||
setBuffer(key: string, value: any, expiryMode: string, time: number, callback: (err: Error, res: Buffer) => void): void;
|
||||
setBuffer(key: string, value: any, expiryMode: string, time: number | string, setMode: number | string, callback: (err: Error, res: Buffer) => void): void;
|
||||
|
||||
setnx(key: string, value: any, callback: (err: Error, res: any) => void): void;
|
||||
setnx(key: string, value: any): Promise<any>;
|
||||
|
||||
setex(key: string, seconds: number, value: any, callback: (err: Error, res: any) => void): void;
|
||||
setex(key: string, seconds: number, value: any): Promise<any>;
|
||||
|
||||
psetex(key: string, milliseconds: number, value: any, callback: (err: Error, res: any) => void): void;
|
||||
psetex(key: string, milliseconds: number, value: any): Promise<any>;
|
||||
|
||||
append(key: string, value: any, callback: (err: Error, res: number) => void): void;
|
||||
append(key: string, value: any): Promise<number>;
|
||||
|
||||
strlen(key: string, callback: (err: Error, res: number) => void): void;
|
||||
strlen(key: string): Promise<number>;
|
||||
|
||||
del(...keys: string[]): any;
|
||||
|
||||
exists(...keys: string[]): any;
|
||||
|
||||
setbit(key: string, offset: number, value: any, callback: (err: Error, res: number) => void): void;
|
||||
setbit(key: string, offset: number, value: any): Promise<number>;
|
||||
|
||||
getbit(key: string, offset: number, callback: (err: Error, res: number) => void): void;
|
||||
getbit(key: string, offset: number): Promise<number>;
|
||||
|
||||
setrange(key: string, offset: number, value: any, callback: (err: Error, res: number) => void): void;
|
||||
setrange(key: string, offset: number, value: any): Promise<number>;
|
||||
|
||||
getrange(key: string, start: number, end: number, callback: (err: Error, res: string) => void): void;
|
||||
getrange(key: string, start: number, end: number): Promise<string>;
|
||||
|
||||
substr(key: string, start: number, end: number, callback: (err: Error, res: string) => void): void;
|
||||
substr(key: string, start: number, end: number): Promise<string>;
|
||||
|
||||
incr(key: string, callback: (err: Error, res: number) => void): void;
|
||||
incr(key: string): Promise<number>;
|
||||
|
||||
decr(key: string, callback: (err: Error, res: number) => void): void;
|
||||
decr(key: string): Promise<number>;
|
||||
|
||||
mget(...keys: string[]): any;
|
||||
|
||||
rpush(key: string, ...values: any[]): any;
|
||||
|
||||
lpush(key: string, ...values: any[]): any;
|
||||
|
||||
rpushx(key: string, value: any, callback: (err: Error, res: number) => void): void;
|
||||
rpushx(key: string, value: any): Promise<number>;
|
||||
|
||||
lpushx(key: string, value: any, callback: (err: Error, res: number) => void): void;
|
||||
lpushx(key: string, value: any): Promise<number>;
|
||||
|
||||
linsert(key: string, direction: "BEFORE" | "AFTER", pivot: string, value: any, callback: (err: Error, res: number) => void): void;
|
||||
linsert(key: string, direction: "BEFORE" | "AFTER", pivot: string, value: any): Promise<number>;
|
||||
|
||||
rpop(key: string, callback: (err: Error, res: string) => void): void;
|
||||
rpop(key: string): Promise<string>;
|
||||
|
||||
lpop(key: string, callback: (err: Error, res: string) => void): void;
|
||||
lpop(key: string): Promise<string>;
|
||||
|
||||
brpop(...keys: string[]): any;
|
||||
|
||||
blpop(...keys: string[]): any;
|
||||
|
||||
brpoplpush(source: string, destination: string, timeout: number, callback: (err: Error, res: any) => void): void;
|
||||
brpoplpush(source: string, destination: string, timeout: number): Promise<any>;
|
||||
|
||||
llen(key: string, callback: (err: Error, res: number) => void): void;
|
||||
llen(key: string): Promise<number>;
|
||||
|
||||
lindex(key: string, index: number, callback: (err: Error, res: string) => void): void;
|
||||
lindex(key: string, index: number): Promise<string>;
|
||||
|
||||
lset(key: string, index: number, value: any, callback: (err: Error, res: any) => void): void;
|
||||
lset(key: string, index: number, value: any): Promise<any>;
|
||||
|
||||
lrange(key: string, start: number, stop: number, callback: (err: Error, res: any) => void): void;
|
||||
lrange(key: string, start: number, stop: number): Promise<any>;
|
||||
|
||||
ltrim(key: string, start: number, stop: number, callback: (err: Error, res: any) => void): void;
|
||||
ltrim(key: string, start: number, stop: number): Promise<any>;
|
||||
|
||||
lrem(key: string, count: number, value: any, callback: (err: Error, res: number) => void): void;
|
||||
lrem(key: string, count: number, value: any): Promise<number>;
|
||||
|
||||
rpoplpush(source: string, destination: string, callback: (err: Error, res: string) => void): void;
|
||||
rpoplpush(source: string, destination: string): Promise<string>;
|
||||
|
||||
sadd(key: string, ...members: any[]): any;
|
||||
|
||||
srem(key: string, ...members: any[]): any;
|
||||
|
||||
smove(source: string, destination: string, member: string, callback: (err: Error, res: string) => void): void;
|
||||
smove(source: string, destination: string, member: string): Promise<string>;
|
||||
|
||||
sismember(key: string, member: string, callback: (err: Error, res: 1 | 0) => void): void;
|
||||
sismember(key: string, member: string): Promise<1 | 0>;
|
||||
|
||||
scard(key: string, callback: (err: Error, res: number) => void): void;
|
||||
scard(key: string): Promise<number>;
|
||||
|
||||
spop(key: string, callback: (err: Error, res: any) => void): void;
|
||||
spop(key: string, count: number, callback: (err: Error, res: any) => void): void;
|
||||
spop(key: string, count?: number): Promise<any>;
|
||||
|
||||
srandmember(key: string, callback: (err: Error, res: any) => void): void;
|
||||
srandmember(key: string, count: number, callback: (err: Error, res: any) => void): void;
|
||||
srandmember(key: string, count?: number): Promise<any>;
|
||||
|
||||
sinter(...keys: string[]): any;
|
||||
|
||||
sinterstore(destination: string, ...keys: string[]): any;
|
||||
|
||||
sunion(...keys: string[]): any;
|
||||
|
||||
sunionstore(destination: string, ...keys: string[]): any;
|
||||
|
||||
sdiff(...keys: string[]): any;
|
||||
|
||||
sdiffstore(destination: string, ...keys: string[]): any;
|
||||
|
||||
smembers(key: string, callback: (err: Error, res: any) => void): void;
|
||||
smembers(key: string): Promise<any>;
|
||||
|
||||
zadd(key: string, ...args: string[]): any;
|
||||
|
||||
zincrby(key: string, increment: number, member: string, callback: (err: Error, res: any) => void): void;
|
||||
zincrby(key: string, increment: number, member: string): Promise<any>;
|
||||
|
||||
zrem(key: string, ...members: any[]): any;
|
||||
|
||||
zremrangebyscore(key: string, min: number | string, max: number | string, callback: (err: Error, res: any) => void): void;
|
||||
zremrangebyscore(key: string, min: number | string, max: number | string): Promise<any>;
|
||||
|
||||
zremrangebyrank(key: string, start: number, stop: number, callback: (err: Error, res: any) => void): void;
|
||||
zremrangebyrank(key: string, start: number, stop: number): Promise<any>;
|
||||
|
||||
zunionstore(destination: string, numkeys: number, key: string, ...args: string[]): any;
|
||||
|
||||
zinterstore(destination: string, numkeys: number, key: string, ...args: string[]): any;
|
||||
|
||||
zrange(key: string, start: number, stop: number, callback: (err: Error, res: any) => void): void;
|
||||
zrange(key: string, start: number, stop: number, withScores: "WITHSCORES", callback: (err: Error, res: any) => void): void;
|
||||
zrange(key: string, start: number, stop: number, withScores?: "WITHSCORES"): Promise<any>;
|
||||
|
||||
zrevrange(key: string, start: number, stop: number, callback: (err: Error, res: any) => void): void;
|
||||
zrevrange(key: string, start: number, stop: number, withScores: "WITHSCORES", callback: (err: Error, res: any) => void): void;
|
||||
zrevrange(key: string, start: number, stop: number, withScores?: "WITHSCORES"): Promise<any>;
|
||||
|
||||
zrangebyscore(key: string, min: number | string, max: number | string, ...args: string[]): any;
|
||||
|
||||
zrevrangebyscore(key: string, max: number | string, min: number | string, ...args: string[]): any;
|
||||
|
||||
zcount(key: string, min: number | string, max: number | string, callback: (err: Error, res: number) => void): void;
|
||||
zcount(key: string, min: number | string, max: number | string): Promise<number>;
|
||||
|
||||
zcard(key: string, callback: (err: Error, res: number) => void): void;
|
||||
zcard(key: string): Promise<number>;
|
||||
|
||||
zscore(key: string, member: string, callback: (err: Error, res: string) => void): void;
|
||||
zscore(key: string, member: string): Promise<string>;
|
||||
|
||||
zrank(key: string, member: string, callback: (err: Error, res: number) => void): void;
|
||||
zrank(key: string, member: string): Promise<number>;
|
||||
|
||||
zrevrank(key: string, member: string, callback: (err: Error, res: number) => void): void;
|
||||
zrevrank(key: string, member: string): Promise<number>;
|
||||
|
||||
hset(key: string, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
hset(key: string, field: string, value: any): Promise<0 | 1>;
|
||||
hsetBuffer(key: string, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
hsetBuffer(key: string, field: string, value: any): Promise<Buffer>;
|
||||
|
||||
hsetnx(key: string, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
hsetnx(key: string, field: string, value: any): Promise<0 | 1>;
|
||||
|
||||
hget(key: string, field: string, callback: (err: Error, res: string) => void): void;
|
||||
hget(key: string, field: string): Promise<string>;
|
||||
hgetBuffer(key: string, field: string, callback: (err: Error, res: Buffer) => void): void;
|
||||
hgetBuffer(key: string, field: string): Promise<Buffer>;
|
||||
|
||||
hmset(key: string, field: string, value: any, ...args: string[]): Promise<0 | 1>;
|
||||
hmset(key: string, data: any, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
hmset(key: string, data: any): Promise<0 | 1>;
|
||||
|
||||
hmget(key: string, ...fields: string[]): any;
|
||||
|
||||
hincrby(key: string, field: string, increment: number, callback: (err: Error, res: number) => void): void;
|
||||
hincrby(key: string, field: string, increment: number): Promise<number>;
|
||||
|
||||
hincrbyfloat(key: string, field: string, increment: number, callback: (err: Error, res: number) => void): void;
|
||||
hincrbyfloat(key: string, field: string, increment: number): Promise<number>;
|
||||
|
||||
hdel(key: string, ...fields: string[]): any;
|
||||
|
||||
hlen(key: string, callback: (err: Error, res: number) => void): void;
|
||||
hlen(key: string): Promise<number>;
|
||||
|
||||
hkeys(key: string, callback: (err: Error, res: any) => void): void;
|
||||
hkeys(key: string): Promise<any>;
|
||||
|
||||
hvals(key: string, callback: (err: Error, res: any) => void): void;
|
||||
hvals(key: string): Promise<any>;
|
||||
|
||||
hgetall(key: string, callback: (err: Error, res: any) => void): void;
|
||||
hgetall(key: string): Promise<any>;
|
||||
|
||||
hexists(key: string, field: string, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
hexists(key: string, field: string): Promise<0 | 1>;
|
||||
|
||||
incrby(key: string, increment: number, callback: (err: Error, res: number) => void): void;
|
||||
incrby(key: string, increment: number): Promise<number>;
|
||||
|
||||
incrbyfloat(key: string, increment: number, callback: (err: Error, res: number) => void): void;
|
||||
incrbyfloat(key: string, increment: number): Promise<number>;
|
||||
|
||||
decrby(key: string, decrement: number, callback: (err: Error, res: number) => void): void;
|
||||
decrby(key: string, decrement: number): Promise<number>;
|
||||
|
||||
getset(key: string, value: any, callback: (err: Error, res: string) => void): void;
|
||||
getset(key: string, value: any): Promise<string>;
|
||||
|
||||
mset(key: string, value: any, ...args: string[]): any;
|
||||
|
||||
msetnx(key: string, value: any, ...args: string[]): any;
|
||||
|
||||
randomkey(callback: (err: Error, res: string) => void): void;
|
||||
randomkey(): Promise<string>;
|
||||
|
||||
select(index: number, callback: (err: Error, res: string) => void): void;
|
||||
select(index: number): Promise<string>;
|
||||
|
||||
move(key: string, db: string, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
move(key: string, db: string): Promise<0 | 1>;
|
||||
|
||||
rename(key: string, newkey: string, callback: (err: Error, res: string) => void): void;
|
||||
rename(key: string, newkey: string): Promise<string>;
|
||||
|
||||
renamenx(key: string, newkey: string, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
renamenx(key: string, newkey: string): Promise<0 | 1>;
|
||||
|
||||
expire(key: string, seconds: number, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
expire(key: string, seconds: number): Promise<0 | 1>;
|
||||
|
||||
pexpire(key: string, milliseconds: number, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
pexpire(key: string, milliseconds: number): Promise<0 | 1>;
|
||||
|
||||
expireat(key: string, timestamp: number, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
expireat(key: string, timestamp: number): Promise<0 | 1>;
|
||||
|
||||
pexpireat(key: string, millisecondsTimestamp: number, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
pexpireat(key: string, millisecondsTimestamp: number): Promise<0 | 1>;
|
||||
|
||||
keys(pattern: string, callback: (err: Error, res: string[]) => void): void;
|
||||
keys(pattern: string): Promise<string[]>;
|
||||
|
||||
dbsize(callback: (err: Error, res: number) => void): void;
|
||||
dbsize(): Promise<number>;
|
||||
|
||||
auth(password: string, callback: (err: Error, res: string) => void): void;
|
||||
auth(password: string): Promise<string>;
|
||||
|
||||
ping(callback: (err: Error, res: string) => void): void;
|
||||
ping(message: string, callback: (err: Error, res: string) => void): void;
|
||||
ping(message?: string): Promise<string>;
|
||||
|
||||
echo(message: string, callback: (err: Error, res: string) => void): void;
|
||||
echo(message: string): Promise<string>;
|
||||
|
||||
save(callback: (err: Error, res: string) => void): void;
|
||||
save(): Promise<string>;
|
||||
|
||||
bgsave(callback: (err: Error, res: string) => void): void;
|
||||
bgsave(): Promise<string>;
|
||||
|
||||
bgrewriteaof(callback: (err: Error, res: string) => void): void;
|
||||
bgrewriteaof(): Promise<string>;
|
||||
|
||||
shutdown(save: "SAVE" | "NOSAVE", callback: (err: Error, res: any) => void): void;
|
||||
shutdown(save: "SAVE" | "NOSAVE"): Promise<any>;
|
||||
|
||||
lastsave(callback: (err: Error, res: number) => void): void;
|
||||
lastsave(): Promise<number>;
|
||||
|
||||
type(key: string, callback: (err: Error, res: string) => void): void;
|
||||
type(key: string): Promise<string>;
|
||||
|
||||
multi(commands?: string[][], options?: MultiOptions): Pipeline;
|
||||
multi(options: { pipeline: false }): Promise<string>;
|
||||
|
||||
exec(callback: (err: Error, res: any) => void): void;
|
||||
exec(): Promise<any>;
|
||||
|
||||
discard(callback: (err: Error, res: any) => void): void;
|
||||
discard(): Promise<any>;
|
||||
|
||||
sync(callback: (err: Error, res: any) => void): void;
|
||||
sync(): Promise<any>;
|
||||
|
||||
flushdb(callback: (err: Error, res: string) => void): void;
|
||||
flushdb(): Promise<string>;
|
||||
|
||||
flushall(callback: (err: Error, res: string) => void): void;
|
||||
flushall(): Promise<string>;
|
||||
|
||||
sort(key: string, ...args: string[]): any;
|
||||
|
||||
info(callback: (err: Error, res: any) => void): void;
|
||||
info(section: string, callback: (err: Error, res: any) => void): void;
|
||||
info(section?: string): Promise<string>;
|
||||
|
||||
time(callback: (err: Error, res: any) => void): void;
|
||||
time(): Promise<any>;
|
||||
|
||||
monitor(callback: (err: Error, res: NodeJS.EventEmitter) => void): void;
|
||||
monitor(): Promise<NodeJS.EventEmitter>;
|
||||
|
||||
ttl(key: string, callback: (err: Error, res: number) => void): void;
|
||||
ttl(key: string): Promise<number>;
|
||||
|
||||
persist(key: string, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
persist(key: string): Promise<0 | 1>;
|
||||
|
||||
slaveof(host: string, port: number, callback: (err: Error, res: string) => void): void;
|
||||
slaveof(host: string, port: number): Promise<string>;
|
||||
|
||||
debug(...args: any[]): any;
|
||||
|
||||
config(...args: any[]): any;
|
||||
|
||||
subscribe(...channels: any[]): any;
|
||||
|
||||
unsubscribe(...channels: string[]): any;
|
||||
|
||||
psubscribe(...patterns: string[]): any;
|
||||
|
||||
punsubscribe(...patterns: string[]): any;
|
||||
|
||||
publish(channel: string, message: string, callback: (err: Error, res: number) => void): void;
|
||||
publish(channel: string, message: string): Promise<number>;
|
||||
|
||||
watch(...keys: string[]): any;
|
||||
|
||||
unwatch(callback: (err: Error, res: string) => void): void;
|
||||
unwatch(): Promise<string>;
|
||||
|
||||
cluster(...args: any[]): any;
|
||||
|
||||
restore(...args: any[]): any;
|
||||
|
||||
migrate(...args: any[]): any;
|
||||
|
||||
dump(key: string, callback: (err: Error, res: string) => void): void;
|
||||
dump(key: string): Promise<string>;
|
||||
|
||||
object(subcommand: string, ...args: any[]): any;
|
||||
|
||||
client(...args: any[]): any;
|
||||
|
||||
eval(...args: any[]): any;
|
||||
|
||||
evalsha(...args: any[]): any;
|
||||
|
||||
script(...args: any[]): any;
|
||||
|
||||
quit(callback: (err: Error, res: string) => void): void;
|
||||
quit(): Promise<string>;
|
||||
|
||||
scan(cursor: number, ...args: any[]): any;
|
||||
|
||||
sscan(key: string, cursor: number, ...args: any[]): any;
|
||||
|
||||
hscan(key: string, cursor: number, ...args: any[]): any;
|
||||
|
||||
zscan(key: string, cursor: number, ...args: any[]): any;
|
||||
|
||||
pfmerge(destkey: string, ...sourcekeys: string[]): any;
|
||||
|
||||
pfadd(key: string, ...elements: string[]): any;
|
||||
|
||||
pfcount(...keys: string[]): any;
|
||||
|
||||
pipeline(commands?: string[][]): Pipeline;
|
||||
|
||||
scanStream(options?: ScanStreamOption): NodeJS.EventEmitter;
|
||||
sscanStream(key: string, options?: ScanStreamOption): NodeJS.EventEmitter;
|
||||
hscanStream(key: string, options?: ScanStreamOption): NodeJS.EventEmitter;
|
||||
zscanStream(key: string, options?: ScanStreamOption): NodeJS.EventEmitter;
|
||||
}
|
||||
|
||||
interface Pipeline {
|
||||
redis: Redis;
|
||||
isCluster: boolean;
|
||||
options: RedisOptions;
|
||||
_queue: Command[];
|
||||
_result: any[];
|
||||
_transactions: number;
|
||||
_shaToScript: {};
|
||||
bitcount(key: string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
bitcount(key: string, start: number, end: number, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
get(key: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
getBuffer(key: string, callback?: (err: Error, res: Buffer) => void): Pipeline;
|
||||
|
||||
set(key: string, value: any, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
set(key: string, value: any, setMode: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
set(key: string, value: any, expiryMode: string, time: number, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
set(key: string, value: any, expiryMode: string, time: number, setMode: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
setBuffer(key: string, value: any, callback?: (err: Error, res: Buffer) => void): Pipeline;
|
||||
setBuffer(key: string, value: any, setMode: string, callback?: (err: Error, res: Buffer) => void): Pipeline;
|
||||
setBuffer(key: string, value: any, expiryMode: string, time: number, callback?: (err: Error, res: Buffer) => void): Pipeline;
|
||||
setBuffer(key: string, value: any, expiryMode: string, time: number, setMode: string, callback?: (err: Error, res: Buffer) => void): Pipeline;
|
||||
|
||||
setnx(key: string, value: any, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
setex(key: string, seconds: number, value: any, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
psetex(key: string, milliseconds: number, value: any, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
append(key: string, value: any, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
strlen(key: string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
del(...keys: string[]): Pipeline;
|
||||
|
||||
exists(...keys: string[]): Pipeline;
|
||||
|
||||
setbit(key: string, offset: number, value: any, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
getbit(key: string, offset: number, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
setrange(key: string, offset: number, value: any, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
getrange(key: string, start: number, end: number, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
substr(key: string, start: number, end: number, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
incr(key: string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
decr(key: string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
mget(...keys: string[]): Pipeline;
|
||||
|
||||
rpush(key: string, ...values: any[]): Pipeline;
|
||||
|
||||
lpush(key: string, ...values: any[]): Pipeline;
|
||||
|
||||
rpushx(key: string, value: any, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
lpushx(key: string, value: any, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
linsert(key: string, direction: "BEFORE" | "AFTER", pivot: string, value: any, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
rpop(key: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
lpop(key: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
brpop(...keys: string[]): Pipeline;
|
||||
|
||||
blpop(...keys: string[]): Pipeline;
|
||||
|
||||
brpoplpush(source: string, destination: string, timeout: number, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
llen(key: string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
lindex(key: string, index: number, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
lset(key: string, index: number, value: any, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
lrange(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
ltrim(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
lrem(key: string, count: number, value: any, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
rpoplpush(source: string, destination: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
sadd(key: string, ...members: any[]): Pipeline;
|
||||
|
||||
srem(key: string, ...members: any[]): Pipeline;
|
||||
|
||||
smove(source: string, destination: string, member: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
sismember(key: string, member: string, callback?: (err: Error, res: 1 | 0) => void): Pipeline;
|
||||
|
||||
scard(key: string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
spop(key: string, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
spop(key: string, count: number, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
srandmember(key: string, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
srandmember(key: string, count: number, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
sinter(...keys: string[]): Pipeline;
|
||||
|
||||
sinterstore(destination: string, ...keys: string[]): Pipeline;
|
||||
|
||||
sunion(...keys: string[]): Pipeline;
|
||||
|
||||
sunionstore(destination: string, ...keys: string[]): Pipeline;
|
||||
|
||||
sdiff(...keys: string[]): Pipeline;
|
||||
|
||||
sdiffstore(destination: string, ...keys: string[]): Pipeline;
|
||||
|
||||
smembers(key: string, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
zadd(key: string, ...args: string[]): Pipeline;
|
||||
|
||||
zincrby(key: string, increment: number, member: string, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
zrem(key: string, ...members: any[]): Pipeline;
|
||||
|
||||
zremrangebyscore(key: string, min: number | string, max: number | string, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
zremrangebyrank(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
zunionstore(destination: string, numkeys: number, key: string, ...args: string[]): Pipeline;
|
||||
|
||||
zinterstore(destination: string, numkeys: number, key: string, ...args: string[]): Pipeline;
|
||||
|
||||
zrange(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
zrange(key: string, start: number, stop: number, withScores: "WITHSCORES", callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
zrevrange(key: string, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
zrevrange(key: string, start: number, stop: number, withScores: "WITHSCORES", callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
zrangebyscore(key: string, min: number | string, max: number | string, ...args: string[]): Pipeline;
|
||||
|
||||
zrevrangebyscore(key: string, max: number | string, min: number | string, ...args: string[]): Pipeline;
|
||||
|
||||
zcount(key: string, min: number | string, max: number | string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
zcard(key: string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
zscore(key: string, member: string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
zrank(key: string, member: string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
zrevrank(key: string, member: string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
hset(key: string, field: string, value: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
|
||||
hsetBuffer(key: string, field: string, value: any, callback?: (err: Error, res: Buffer) => void): Pipeline;
|
||||
|
||||
hsetnx(key: string, field: string, value: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
|
||||
|
||||
hget(key: string, field: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
hgetBuffer(key: string, field: string, callback?: (err: Error, res: Buffer) => void): Pipeline;
|
||||
|
||||
hmset(key: string, field: string, value: any, ...args: string[]): Pipeline;
|
||||
hmset(key: string, data: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
|
||||
|
||||
hmget(key: string, ...fields: string[]): Pipeline;
|
||||
|
||||
hincrby(key: string, field: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
hincrbyfloat(key: string, field: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
hdel(key: string, ...fields: string[]): Pipeline;
|
||||
|
||||
hlen(key: string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
hkeys(key: string, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
hvals(key: string, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
hgetall(key: string, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
hexists(key: string, field: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
|
||||
|
||||
incrby(key: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
incrbyfloat(key: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
decrby(key: string, decrement: number, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
getset(key: string, value: any, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
mset(key: string, value: any, ...args: string[]): Pipeline;
|
||||
|
||||
msetnx(key: string, value: any, ...args: string[]): Pipeline;
|
||||
|
||||
randomkey(callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
select(index: number, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
move(key: string, db: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
|
||||
|
||||
rename(key: string, newkey: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
renamenx(key: string, newkey: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
|
||||
|
||||
expire(key: string, seconds: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
|
||||
|
||||
pexpire(key: string, milliseconds: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
|
||||
|
||||
expireat(key: string, timestamp: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
|
||||
|
||||
pexpireat(key: string, millisecondsTimestamp: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
|
||||
|
||||
keys(pattern: string, callback?: (err: Error, res: string[]) => void): Pipeline;
|
||||
|
||||
dbsize(callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
auth(password: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
ping(callback?: (err: Error, res: string) => void): Pipeline;
|
||||
ping(message: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
echo(message: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
save(callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
bgsave(callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
bgrewriteaof(callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
shutdown(save: "SAVE" | "NOSAVE", callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
lastsave(callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
type(key: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
multi(callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
exec(callback?: (err: Error, res: any) => void): Promise<any>;
|
||||
|
||||
discard(callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
sync(callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
flushdb(callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
flushall(callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
sort(key: string, ...args: string[]): Pipeline;
|
||||
|
||||
info(callback?: (err: Error, res: any) => void): Pipeline;
|
||||
info(section: string, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
time(callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
monitor(callback?: (err: Error, res: NodeJS.EventEmitter) => void): Pipeline;
|
||||
|
||||
ttl(key: string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
persist(key: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
|
||||
|
||||
slaveof(host: string, port: number, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
debug(...args: any[]): Pipeline;
|
||||
|
||||
config(...args: any[]): Pipeline;
|
||||
|
||||
subscribe(...channels: any[]): Pipeline;
|
||||
|
||||
unsubscribe(...channels: string[]): Pipeline;
|
||||
|
||||
psubscribe(...patterns: string[]): Pipeline;
|
||||
|
||||
punsubscribe(...patterns: string[]): Pipeline;
|
||||
|
||||
publish(channel: string, message: string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
watch(...keys: string[]): Pipeline;
|
||||
|
||||
unwatch(callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
cluster(...args: any[]): Pipeline;
|
||||
|
||||
restore(...args: any[]): Pipeline;
|
||||
|
||||
migrate(...args: any[]): Pipeline;
|
||||
|
||||
dump(key: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
object(subcommand: string, ...args: any[]): Pipeline;
|
||||
|
||||
client(...args: any[]): Pipeline;
|
||||
|
||||
eval(...args: any[]): Pipeline;
|
||||
|
||||
evalsha(...args: any[]): Pipeline;
|
||||
|
||||
script(...args: any[]): Pipeline;
|
||||
|
||||
quit(callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
scan(cursor: number, ...args: any[]): Pipeline;
|
||||
|
||||
sscan(key: string, cursor: number, ...args: any[]): Pipeline;
|
||||
|
||||
hscan(key: string, cursor: number, ...args: any[]): Pipeline;
|
||||
|
||||
zscan(key: string, cursor: number, ...args: any[]): Pipeline;
|
||||
|
||||
pfmerge(destkey: string, ...sourcekeys: string[]): Pipeline;
|
||||
|
||||
pfadd(key: string, ...elements: string[]): Pipeline;
|
||||
|
||||
pfcount(...keys: string[]): Pipeline;
|
||||
}
|
||||
|
||||
interface NodeConfiguration {
|
||||
host?: string;
|
||||
port?: number;
|
||||
}
|
||||
|
||||
type ClusterNode = string | number | NodeConfiguration;
|
||||
|
||||
interface Cluster extends NodeJS.EventEmitter, Commander {
|
||||
new(nodes: ClusterNode[], options?: ClusterOptions): Redis;
|
||||
connect(callback: () => void): Promise<any>;
|
||||
disconnect(): void;
|
||||
nodes(role: string): Redis[];
|
||||
}
|
||||
|
||||
interface RedisOptions {
|
||||
port?: number;
|
||||
host?: string;
|
||||
/**
|
||||
* 4 (IPv4) or 6 (IPv6), Defaults to 4.
|
||||
*/
|
||||
family?: number;
|
||||
/**
|
||||
* Local domain socket path. If set the port, host and family will be ignored.
|
||||
*/
|
||||
path?: string;
|
||||
/**
|
||||
* TCP KeepAlive on the socket with a X ms delay before start. Set to a non-number value to disable keepAlive.
|
||||
*/
|
||||
keepAlive?: number;
|
||||
connectionName?: string;
|
||||
/**
|
||||
* If set, client will send AUTH command with the value of this option when connected.
|
||||
*/
|
||||
password?: string;
|
||||
/**
|
||||
* Database index to use.
|
||||
*/
|
||||
db?: number;
|
||||
/**
|
||||
* When a connection is established to the Redis server, the server might still be loading
|
||||
* the database from disk. While loading, the server not respond to any commands.
|
||||
* To work around this, when this option is true, ioredis will check the status of the Redis server,
|
||||
* and when the Redis server is able to process commands, a ready event will be emitted.
|
||||
*/
|
||||
enableReadyCheck?: boolean;
|
||||
keyPrefix?: string;
|
||||
/**
|
||||
* When the return value isn't a number, ioredis will stop trying to reconnect.
|
||||
* Fixed in: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/15858
|
||||
*/
|
||||
retryStrategy?(times: number): number | false;
|
||||
/**
|
||||
* 1/true means reconnect, 2 means reconnect and resend failed command. Returning false will ignore
|
||||
* the error and do nothing.
|
||||
*/
|
||||
reconnectOnError?(error: Error): boolean | 1 | 2;
|
||||
/**
|
||||
* By default, if there is no active connection to the Redis server, commands are added to a queue
|
||||
* and are executed once the connection is "ready" (when enableReadyCheck is true, "ready" means
|
||||
* the Redis server has loaded the database from disk, otherwise means the connection to the Redis
|
||||
* server has been established). If this option is false, when execute the command when the connection
|
||||
* isn't ready, an error will be returned.
|
||||
*/
|
||||
enableOfflineQueue?: boolean;
|
||||
/**
|
||||
* The milliseconds before a timeout occurs during the initial connection to the Redis server.
|
||||
* default: 10000.
|
||||
*/
|
||||
connectTimeout?: number;
|
||||
/**
|
||||
* After reconnected, if the previous connection was in the subscriber mode, client will auto re-subscribe these channels.
|
||||
* default: true.
|
||||
*/
|
||||
autoResubscribe?: boolean;
|
||||
/**
|
||||
* If true, client will resend unfulfilled commands(e.g. block commands) in the previous connection when reconnected.
|
||||
* default: true.
|
||||
*/
|
||||
autoResendUnfulfilledCommands?: boolean;
|
||||
lazyConnect?: boolean;
|
||||
tls?: tls.ConnectionOptions;
|
||||
sentinels?: Array<{ host: string; port: number; }>;
|
||||
name?: string;
|
||||
/**
|
||||
* Enable READONLY mode for the connection. Only available for cluster mode.
|
||||
* default: false.
|
||||
*/
|
||||
readOnly?: boolean;
|
||||
/**
|
||||
* If you are using the hiredis parser, it's highly recommended to enable this option.
|
||||
* Create another instance with dropBufferSupport disabled for other commands that you want to return binary instead of string
|
||||
*/
|
||||
dropBufferSupport?: boolean;
|
||||
/**
|
||||
* Whether to show a friendly error stack. Will decrease the performance significantly.
|
||||
*/
|
||||
showFriendlyErrorStack?: boolean;
|
||||
}
|
||||
|
||||
interface ScanStreamOption {
|
||||
match?: string;
|
||||
count?: number;
|
||||
}
|
||||
|
||||
interface ClusterOptions {
|
||||
clusterRetryStrategy?(times: number): number;
|
||||
enableOfflineQueue?: boolean;
|
||||
enableReadyCheck?: boolean;
|
||||
scaleReads?: string;
|
||||
maxRedirections?: number;
|
||||
retryDelayOnFailover?: number;
|
||||
retryDelayOnClusterDown?: number;
|
||||
retryDelayOnTryAgain?: number;
|
||||
redisOptions?: RedisOptions;
|
||||
}
|
||||
|
||||
interface MultiOptions {
|
||||
pipeline: boolean;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
import Redis = require("ioredis");
|
||||
const redis = new Redis();
|
||||
|
||||
redis.set('foo', 'bar');
|
||||
redis.get('foo', (err, result) => {
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
// Or using a promise if the last argument isn't a function
|
||||
redis.get('foo').then((result: any) => {
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
// Arguments to commands are flattened, so the following are the same:
|
||||
redis.sadd('set', 1, 3, 5, 7);
|
||||
redis.sadd('set', [1, 3, 5, 7]);
|
||||
|
||||
// All arguments are passed directly to the redis server:
|
||||
redis.set('key', '100');
|
||||
redis.set('key', '100', 'XX');
|
||||
redis.set('key', '100', 'PX', 10);
|
||||
redis.set('key', '100', 'EX', 10, 'NX');
|
||||
redis.set('key', '100', 'NX', 'EX', 10);
|
||||
redis.set('key', '100', ['EX', 10, 'NX']);
|
||||
redis.setBuffer('key', '100', 'NX', 'EX', 10);
|
||||
|
||||
redis.set('key', '100', (err, data) => {});
|
||||
redis.set('key', '100', 'XX', (err, data) => {});
|
||||
redis.set('key', '100', 'PX', 10, (err, data) => {});
|
||||
redis.set('key', '100', 'EX', 10, 'NX', (err, data) => {});
|
||||
redis.set('key', '100', ['EX', 10, 'NX'], (err, data) => {});
|
||||
redis.setBuffer('key', '100', 'NX', 'EX', 10, (err, data) => {});
|
||||
|
||||
new Redis(); // Connect to 127.0.0.1:6379
|
||||
new Redis(6380); // 127.0.0.1:6380
|
||||
new Redis(6379, '192.168.1.1'); // 192.168.1.1:6379
|
||||
new Redis('/tmp/redis.sock');
|
||||
new Redis({
|
||||
port: 6379, // Redis port
|
||||
host: '127.0.0.1', // Redis host
|
||||
family: 4, // 4 (IPv4) or 6 (IPv6)
|
||||
password: 'auth',
|
||||
db: 0,
|
||||
retryStrategy() { return false; },
|
||||
showFriendlyErrorStack: true,
|
||||
tls: {
|
||||
servername: 'tlsservername'
|
||||
}
|
||||
});
|
||||
|
||||
const pub = new Redis();
|
||||
redis.subscribe('news', 'music', (err: any, count: any) => {
|
||||
// Now we are subscribed to both the 'news' and 'music' channels.
|
||||
// `count` represents the number of channels we are currently subscribed to.
|
||||
|
||||
pub.publish('news', 'Hello world!');
|
||||
pub.publish('music', 'Hello again!');
|
||||
});
|
||||
|
||||
redis.on('message', (channel: any, message: any) => {
|
||||
// Receive message Hello world! from channel news
|
||||
// Receive message Hello again! from channel music
|
||||
console.log('Receive message %s from channel %s', message, channel);
|
||||
});
|
||||
|
||||
// There's also an event called 'messageBuffer', which is the same as 'message' except
|
||||
// it returns buffers instead of strings.
|
||||
redis.on('messageBuffer', (channel: any, message: any) => {
|
||||
// Both `channel` and `message` are buffers.
|
||||
});
|
||||
|
||||
const pipeline = redis.pipeline();
|
||||
pipeline.set('foo', 'bar');
|
||||
pipeline.del('cc');
|
||||
pipeline.hset('hash', 'foo', 4);
|
||||
pipeline.hget('hash', 'foo');
|
||||
pipeline.hsetBuffer('hash', 'fooBuffer', 4);
|
||||
pipeline.hgetBuffer('hash', 'fooBuffer');
|
||||
pipeline.exec((err, results) => {
|
||||
// `err` is always null, and `results` is an array of responses
|
||||
// corresponding to the sequence of queued commands.
|
||||
// Each response follows the format `[err, result]`.
|
||||
});
|
||||
|
||||
// You can even chain the commands:
|
||||
redis.pipeline().set('foo', 'bar').del('cc').exec((err, results) => {
|
||||
});
|
||||
|
||||
// `exec` also returns a Promise:
|
||||
const promise = redis.pipeline().set('foo', 'bar').get('foo').exec();
|
||||
promise.then((result) => {
|
||||
// result === [[null, 'OK'], [null, 'bar']]
|
||||
});
|
||||
|
||||
redis.pipeline().set('foo', 'bar').get('foo', (err, result) => {
|
||||
// result === 'bar'
|
||||
}).exec((err, result) => {
|
||||
// result[1][1] === 'bar'
|
||||
});
|
||||
|
||||
redis.pipeline([
|
||||
['set', 'foo', 'bar'],
|
||||
['get', 'foo']
|
||||
]).exec(() => { /* ... */ });
|
||||
|
||||
Redis.Command.setArgumentTransformer('set', args => {
|
||||
return args;
|
||||
});
|
||||
|
||||
Redis.Command.setReplyTransformer('get', (result: any) => {
|
||||
return result;
|
||||
});
|
||||
|
||||
// multi
|
||||
redis.multi().set('foo', 'bar').set('foo', 'baz').get('foo', (err, result) => {
|
||||
// result === 'QUEUED'
|
||||
}).exec((err, results) => {
|
||||
// results = [[null, 'OK'], [null, 'OK'], [null, 'baz']]
|
||||
});
|
||||
|
||||
redis.multi([
|
||||
['set', 'foo', 'bar'],
|
||||
['get', 'foo']
|
||||
]).exec((err, results) => {
|
||||
// results = [[null, 'OK'], [null, 'bar']]
|
||||
});
|
||||
|
||||
redis.Promise.onPossiblyUnhandledRejection((error) => {
|
||||
});
|
||||
|
||||
const keys = ['foo', 'bar'];
|
||||
redis.mget(...keys);
|
||||
|
||||
new Redis.Cluster([
|
||||
'localhost'
|
||||
]);
|
||||
|
||||
new Redis.Cluster([
|
||||
6379
|
||||
]);
|
||||
|
||||
new Redis.Cluster([{
|
||||
host: 'localhost'
|
||||
}]);
|
||||
|
||||
new Redis.Cluster([{
|
||||
port: 6379
|
||||
}]);
|
||||
|
||||
new Redis.Cluster([{
|
||||
host: 'localhost',
|
||||
port: 6379
|
||||
}]);
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"paths": {
|
||||
"ioredis": [ "ioredis/v3" ]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ioredis-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+110
@@ -0,0 +1,110 @@
|
||||
// Type definitions for ip-address 5.8
|
||||
// Project: https://github.com/beaugunderson/ip-address
|
||||
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export as namespace ipAddress;
|
||||
|
||||
export interface v6Helpers {
|
||||
spanAllZeroes(s: string): string;
|
||||
spanAll(s: string, optionalOffset?: number): string;
|
||||
spanLeadingZeroes(address: string): string;
|
||||
simpleGroup(addressString: string, offset?: number): string;
|
||||
}
|
||||
|
||||
export interface TeredoObject {
|
||||
readonly prefix: string;
|
||||
readonly server4: string;
|
||||
readonly client4: string;
|
||||
readonly flags: string;
|
||||
readonly coneNat: any;
|
||||
readonly microsoft: {
|
||||
readonly reserved: any,
|
||||
readonly universalLocal: any,
|
||||
readonly groupIndividual: any,
|
||||
readonly nonce: any,
|
||||
};
|
||||
udpPort: string;
|
||||
}
|
||||
|
||||
export interface SixToFourResponse {
|
||||
readonly prefix: string;
|
||||
readonly gateway: string;
|
||||
}
|
||||
|
||||
export class Address4 {
|
||||
constructor(address: string);
|
||||
static fromHex(hex: string): Address4;
|
||||
static fromInteger(integer: number): Address4;
|
||||
static fromBigInteger(bigInteger: any): Address4;
|
||||
|
||||
valid: boolean;
|
||||
address: string;
|
||||
parsedAddress: string;
|
||||
groups: number;
|
||||
v4: boolean;
|
||||
subnet: string;
|
||||
subnetMask: number;
|
||||
|
||||
isValid(): boolean;
|
||||
correctForm(): string;
|
||||
isCorrect(): boolean;
|
||||
toHex(): string;
|
||||
toArray(): any;
|
||||
toGroup6(): string;
|
||||
bigInteger(): any;
|
||||
startAddress(): Address4;
|
||||
startAddressExclusive(): Address4;
|
||||
endAddress(): Address4;
|
||||
endAddressExclusive(): Address4;
|
||||
mask(optionalMask?: number): string;
|
||||
getBitsBase2(start: number, end: number): string;
|
||||
isInSubnet(): boolean;
|
||||
binaryZeroPad(): string;
|
||||
}
|
||||
|
||||
export class Address6 {
|
||||
constructor(address: string, optionalGroups?: number);
|
||||
static fromBigInteger(bigInteger: any): Address6;
|
||||
static fromURL(url: string): Address6;
|
||||
static fromAddress4(address4: string): Address6;
|
||||
static fromArpa(arpaFormAddress: string): Address6;
|
||||
static fromByteArray(bytes: any): Address6;
|
||||
static fromUnsignedByteArray(bytes: any): Address6;
|
||||
|
||||
valid: boolean;
|
||||
address: string;
|
||||
groups: number;
|
||||
v4: boolean;
|
||||
subnet: string;
|
||||
subnetMask: number;
|
||||
|
||||
microsoftTranscription(): string;
|
||||
mask(optionalMask?: number): string;
|
||||
possibleSubnets(optionalSubnetSize?: number): string;
|
||||
startAddress(): Address6;
|
||||
startAddressExclusive(): Address6;
|
||||
endAddress(): Address6;
|
||||
endAddressExclusive(): Address6;
|
||||
getScope(): string;
|
||||
getType(): string;
|
||||
getBits(start: number, end: number): any;
|
||||
getBitsBase2(start: number, end: number): string;
|
||||
getBitsBase16(start: number, end: number): string;
|
||||
getBitsPastSubnet(): string;
|
||||
reverseForm(options?: { omitSuffix: boolean }): string;
|
||||
correctForm(): string;
|
||||
binaryZeroPad(): string;
|
||||
canonicalForm(): string;
|
||||
decimal(): string;
|
||||
bigInteger(): any;
|
||||
to4(): string;
|
||||
to4in6(): string;
|
||||
inspectTeredo(): TeredoObject;
|
||||
inspect6to4(): SixToFourResponse;
|
||||
to6to4(): Address6;
|
||||
toByteArray(): any;
|
||||
toUnsignedByteArray(): any;
|
||||
}
|
||||
|
||||
export const v6: {helpers: v6Helpers};
|
||||
@@ -0,0 +1,121 @@
|
||||
import ipAddress = require('ip-address');
|
||||
|
||||
// Test Address4 Typings
|
||||
const address4 = new ipAddress.Address4('127.0.0.1');
|
||||
|
||||
const address4Valid = address4.valid;
|
||||
const address4String = address4.address;
|
||||
const address4Parsed = address4.parsedAddress;
|
||||
const address4Groups = address4.groups;
|
||||
const address4v4 = address4.v4;
|
||||
const address4Subnet = address4.subnet;
|
||||
const address4Mask = address4.subnetMask;
|
||||
|
||||
// $ExpectType Address4
|
||||
ipAddress.Address4.fromHex('127.0.0.1');
|
||||
// $ExpectType Address4
|
||||
ipAddress.Address4.fromInteger(127001);
|
||||
// $ExpectType Address4
|
||||
address4.startAddress();
|
||||
// $ExpectType Address4
|
||||
address4.startAddressExclusive();
|
||||
// $ExpectType Address4
|
||||
address4.endAddress();
|
||||
// $ExpectType Address4
|
||||
address4.endAddressExclusive();
|
||||
|
||||
// $ExpectType string
|
||||
address4.correctForm();
|
||||
// $ExpectType string
|
||||
address4.toHex();
|
||||
// $ExpectType string
|
||||
address4.toGroup6();
|
||||
// $ExpectType string
|
||||
address4.mask();
|
||||
// $ExpectType string
|
||||
address4.mask(0);
|
||||
// $ExpectType string
|
||||
address4.getBitsBase2(0, 1);
|
||||
// $ExpectType string
|
||||
address4.binaryZeroPad();
|
||||
|
||||
// $ExpectType boolean
|
||||
address4.isValid();
|
||||
// $ExpectType boolean
|
||||
address4.isCorrect();
|
||||
// $ExpectType boolean
|
||||
address4.isInSubnet();
|
||||
|
||||
// Test Address6 Typings
|
||||
const address6 = new ipAddress.Address6('127.0.0.1');
|
||||
|
||||
const address6Valid = address6.valid;
|
||||
const address6String = address6.address;
|
||||
const address6Groups = address6.groups;
|
||||
const address6v4 = address6.v4;
|
||||
const address6Subnet = address6.subnet;
|
||||
const address6Mask = address6.subnetMask;
|
||||
|
||||
// $ExpectType Address6
|
||||
address6.startAddress();
|
||||
// $ExpectType Address6
|
||||
address6.startAddressExclusive();
|
||||
// $ExpectType Address6
|
||||
address6.endAddress();
|
||||
// $ExpectType Address6
|
||||
address6.endAddressExclusive();
|
||||
// $ExpectType Address6
|
||||
address6.to6to4();
|
||||
|
||||
// $ExpectType string
|
||||
address6.microsoftTranscription();
|
||||
// $ExpectType string
|
||||
address6.mask();
|
||||
// $ExpectType string
|
||||
address6.mask(0);
|
||||
// $ExpectType string
|
||||
address6.possibleSubnets();
|
||||
// $ExpectType string
|
||||
address6.possibleSubnets(1);
|
||||
// $ExpectType string
|
||||
address6.getScope();
|
||||
// $ExpectType string
|
||||
address6.getType();
|
||||
// $ExpectType string
|
||||
address6.getBitsBase2(0, 1);
|
||||
// $ExpectType string
|
||||
address6.getBitsBase16(0, 1);
|
||||
// $ExpectType string
|
||||
address6.getBitsPastSubnet();
|
||||
// $ExpectType string
|
||||
address6.reverseForm();
|
||||
// $ExpectType string
|
||||
address6.correctForm();
|
||||
// $ExpectType string
|
||||
address6.binaryZeroPad();
|
||||
// $ExpectType string
|
||||
address6.canonicalForm();
|
||||
// $ExpectType string
|
||||
address6.decimal();
|
||||
// $ExpectType string
|
||||
address6.to4();
|
||||
// $ExpectType string
|
||||
address6.to4in6();
|
||||
|
||||
// $ExpectType TeredoObject
|
||||
address6.inspectTeredo();
|
||||
|
||||
// $ExpectType SixToFourResponse
|
||||
address6.inspect6to4();
|
||||
|
||||
// Test v6 Typings
|
||||
const v6 = ipAddress.v6;
|
||||
|
||||
// $ExpectType string
|
||||
v6.helpers.simpleGroup(address6.address);
|
||||
// $ExpectType string
|
||||
v6.helpers.spanAll(address6.address);
|
||||
// $ExpectType string
|
||||
v6.helpers.spanAllZeroes(address6.address);
|
||||
// $ExpectType string
|
||||
v6.helpers.spanLeadingZeroes(address6.address);
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ip-address-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// Type definitions for is-running 2.1
|
||||
// Project: https://github.com/nisaacson/is-running
|
||||
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function isRunning(pid: number): boolean;
|
||||
|
||||
export = isRunning;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user