Merge remote-tracking branch 'source/master' into fix/mongoose-validators

This commit is contained in:
Marko Schilde
2018-08-24 14:44:42 +02:00
67 changed files with 3550 additions and 2584 deletions
+2 -2
View File
@@ -3576,8 +3576,8 @@
/types/react-native-vector-icons/ @iRoachie @timwangdev
/types/react-native-version-number/ @VincentLanglet
/types/react-native-video/ @huhuanming
/types/react-navigation/v1/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi
/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi @magrinj @TizioFittizio @stigi
/types/react-navigation/v1/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi
/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi @magrinj @TizioFittizio @stigi
/types/react-notification-system/ @GiedriusGrabauskas @DeividasBakanas @LKay @sztobar
/types/react-notification-system-redux/ @LKay
/types/react-notify-toast/ @klaascuvelier
+8
View File
@@ -1776,6 +1776,14 @@ declare namespace algoliasearch {
facets?: {
[facetName: string]: { [facetValue: string]: number };
};
facets_stats?: {
[facetName: string]: {
avg: number,
max: number,
min: number,
sum: number,
};
};
}
interface MultiResponse {
+9
View File
@@ -4,6 +4,7 @@
// Haroen Viaene <https://github.com/haroenv>
// Aurélien Hervé <https://github.com/aherve>
// Samuel Vaillant <https://github.com/samouss>
// Claas Brüggemann <https://github.com/ClaasBrueggemann>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@@ -570,6 +571,14 @@ declare namespace algoliasearch {
facets?: {
[facetName: string]: { [facetValue: string]: number };
};
facets_stats?: {
[facetName: string]: {
avg: number,
max: number,
min: number,
sum: number,
};
};
}
interface MultiResponse {
@@ -17,17 +17,24 @@ const config: Microsoft.ApplicationInsights.IConfig = {
autoTrackPageVisitTime: true,
disableExceptionTracking: false,
disableAjaxTracking: false,
disableFetchTracking: true,
overridePageViewDuration: false,
maxAjaxCallsPerView: -1,
disableDataLossAnalysis: true,
disableCorrelationHeaders: true,
correlationHeaderExcludedDomains: [],
disableFlushOnBeforeUnload: false,
enableSessionStorageBuffer: false,
cookieDomain: "",
isCookieUseDisabled: true,
isRetryDisabled: true,
isPerfAnalyzerEnabled: true,
isStorageUseDisabled: true
url: "url",
isStorageUseDisabled: true,
isBeaconApiDisabled: false,
sdkExtension: "sdkExtension",
isBrowserLinkTrackingEnabled: false,
appId: "appId",
enableCorsCorrelation: false
};
appInsights = {
@@ -175,3 +182,8 @@ const traceObj = new Microsoft.ApplicationInsights.Telemetry.Trace("message", nu
const traceData = new Microsoft.ApplicationInsights.Telemetry.Common.Data<Microsoft.ApplicationInsights.Telemetry.Trace>(Microsoft.ApplicationInsights.Telemetry.Trace.dataType, traceObj);
const traceEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(traceData, Microsoft.ApplicationInsights.Telemetry.Trace.envelopeType);
context.track(traceEnvelope);
// UtilHelpers
let Util: typeof Microsoft.ApplicationInsights.UtilHelpers;
Util.newId();
+15 -1
View File
@@ -1,6 +1,7 @@
// Type definitions for ApplicationInsights-JS 1.0
// Project: https://github.com/Microsoft/ApplicationInsights-JS
// Definitions by: Kamil Szostak <https://github.com/kamilszostak>
// Mark Wolff <https://github.com/markwolff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module AI {
@@ -560,19 +561,24 @@ declare module Microsoft.ApplicationInsights {
samplingPercentage?: number;
autoTrackPageVisitTime?: boolean;
disableAjaxTracking?: boolean;
disableFetchTracking?: boolean;
overridePageViewDuration?: boolean;
maxAjaxCallsPerView?: number;
disableDataLossAnalysis?: boolean;
disableCorrelationHeaders?: boolean;
correlationHeaderExcludedDomains?: string[];
disableFlushOnBeforeUnload?: boolean;
enableSessionStorageBuffer?: boolean;
isCookieUseDisabled?: boolean;
cookieDomain?: string;
isRetryDisabled?: boolean;
isPerfAnalyzerEnabled?: boolean;
url?: string;
isStorageUseDisabled?: boolean;
isBeaconApiDisabled?: boolean;
sdkExtension?: string;
isBrowserLinkTrackingEnabled?: boolean;
appId?: string;
enableCorsCorrelation?: boolean;
}
/**
@@ -793,10 +799,18 @@ declare module Microsoft.ApplicationInsights {
*/
_onerror(message: string, url: string, lineNumber: number, columnNumber: number, error: Error): any;
}
class UtilHelpers {
/**
* Generate a random ID string
*/
static newId(): string;
}
}
declare module 'applicationinsights-js' {
const AppInsights: Microsoft.ApplicationInsights.IAppInsights;
const Util: typeof Microsoft.ApplicationInsights.UtilHelpers;
}
declare var appInsights: Microsoft.ApplicationInsights.IAppInsights;
+1
View File
@@ -214,6 +214,7 @@ interface CheerioOptionsInterface {
recognizeCDATA?: boolean;
recognizeSelfClosing?: boolean;
normalizeWhitespace?: boolean;
ignoreWhitespace?: boolean;
}
interface CheerioSelector {
+1 -1
View File
@@ -500,7 +500,7 @@ declare namespace echarts {
/**
* Chart height.
*/
heiight?: number | string,
height?: number | string,
/**
* Specify whether or not to prevent triggering events.
+1 -1
View File
@@ -52,7 +52,7 @@ declare namespace Evaporate {
customAuthMethod?: null | ((
signParams: string,
signHeaders: string,
stringToSign: () => string | undefined,
stringToSign: string,
signatureDateTime: string,
canonicalRequest: string
) => Promise<string>);
+94
View File
@@ -0,0 +1,94 @@
// Type definitions for intl-relativeformat 2.1
// Project: https://github.com/yahoo/intl-relativeformat
// Definitions by: Mohsen Azimi <https://github.com/mohsen1>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
/**
* This package aims to provide a way to format different variations of relative time.
* You can use this package in the browser and on the server via Node.js.
*
* This implementation is very similar to moment.js, in concept, although it provides
* only formatting features based on the Unicode CLDR locale data, an industry
* standard that supports more than 200 languages.
*
* @see https://github.com/yahoo/intl-relativeformat
*/
export default class IntlRelativeFormat {
/**
* To format a date to relative time, use the IntlRelativeFormat constructor.
* The constructor takes two parameters:
*
* @param locales A string with a BCP 47 language tag, or an array of
* such strings. If you do not provide a locale, the default locale will be used.
* When an array of locales is provided, each item and its ancestor locales are checked
* and the first one with registered locale data is returned. See: Locale Resolution
* for more details.
* @see https://github.com/yahoo/intl-relativeformat#locale-resolution
*
* @param optionas object with user defined options for format styles.
* See: Custom Options for more details.
* @see https://github.com/yahoo/intl-relativeformat#custom-options
* Note: The rf instance should be enough for your entire application,
* unless you want to use custom options.
*/
constructor(
locales: string | string[],
options?: Intl.DateTimeFormatOptions & {
/**
* By default, the relative time is computed to the best fit unit,
* but you can explicitly call it to force units to be displayed in
* "second", "second-short", "minute", "minute-short", "hour",
* "hour-short", "day", "day-short", "month", "month-short",
* "year" or "year-short":
*/
units?:
| "second"
| "second-short"
| "minute"
| "minute-short"
| "hour"
| "hour-short"
| "day"
| "day-short"
| "month"
| "month-short"
| "year"
| "year-short";
/**
* By default, the relative time is computed as "best fit",
* which means that instead of "1 day ago", it will display "yesterday",
* or "in 1 year" will be "next year", etc. But you can force to always
* use the "numeric" alternative:
*/
style?: "best fit" | "numeric";
}
);
/**
* This method returns an object with the options values that were resolved
* during instance creation. It currently only contains a locale property
*
* var rf = new IntlRelativeFormat('en-us');
* console.log(rf.resolvedOptions().locale); // => "en-US"
*
* Notice how the specified locale was the all lower-case value: "en-us",
* but it was resolved and normalized to: "en-US".
*/
resolvedOptions(): { locale: string };
/**
* The format method (which takes a JavaScript date or timestamp) and optional
* options arguments will compare the date with "now" (or options.now),
* and returns the formatted string; e.g., "3 hours ago" in the corresponding
* locale passed into the constructor.
*
* var output = rf.format(new Date());
* console.log(output); // => "now"
*
* If you wish to specify a "now" value, it can be provided via options.now and
* will be used instead of querying Date.now() to get the current "now" value.
*/
format(date: Date, options?: { now?: Date }): string;
}
@@ -0,0 +1,16 @@
import IntlRelativeFormat from "intl-relativeformat";
let dateFormatter = new IntlRelativeFormat("en-US");
dateFormatter = new IntlRelativeFormat("en-US", {
units: "day"
});
dateFormatter = new IntlRelativeFormat("en-US", {
units: "day",
style: "numeric"
});
console.log(dateFormatter.resolvedOptions().locale);
dateFormatter.format(new Date());
dateFormatter.format(new Date(), { now: new Date() });
+16
View File
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6", "dom"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"strictFunctionTypes": true
},
"files": ["index.d.ts", "intl-relativeformat-tests.ts"]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+309 -307
View File
@@ -45,6 +45,8 @@ declare class Commander {
}
declare namespace IORedis {
type KeyType = string | Buffer;
interface Command {
setArgumentTransformer(name: string, fn: (args: any[]) => any[]): void;
setReplyTransformer(name: string, fn: (result: any) => any): void;
@@ -59,257 +61,257 @@ declare namespace IORedis {
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>;
bitcount(key: KeyType, callback: (err: Error, res: number) => void): void;
bitcount(key: KeyType, start: number, end: number, callback: (err: Error, res: number) => void): void;
bitcount(key: KeyType): Promise<number>;
bitcount(key: KeyType, start: number, end: number): Promise<number>;
get(key: string, callback: (err: Error, res: string) => void): void;
get(key: string): Promise<string>;
get(key: KeyType, callback: (err: Error, res: string) => void): void;
get(key: KeyType): Promise<string>;
getBuffer(key: string, callback: (err: Error, res: Buffer) => void): void;
getBuffer(key: string): Promise<Buffer>;
getBuffer(key: KeyType, callback: (err: Error, res: Buffer) => void): void;
getBuffer(key: KeyType): Promise<Buffer>;
set(key: string, value: any, expiryMode?: string | any[], time?: number | string, setMode?: number | string): Promise<string>;
set(key: KeyType, 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;
set(key: KeyType, value: any, callback: (err: Error, res: string) => void): void;
set(key: KeyType, value: any, setMode: string | any[], callback: (err: Error, res: string) => void): void;
set(key: KeyType, value: any, expiryMode: string, time: number | string, callback: (err: Error, res: string) => void): void;
set(key: KeyType, 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: KeyType, 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;
setBuffer(key: KeyType, value: any, callback: (err: Error, res: Buffer) => void): void;
setBuffer(key: KeyType, value: any, setMode: string, callback: (err: Error, res: Buffer) => void): void;
setBuffer(key: KeyType, value: any, expiryMode: string, time: number, callback: (err: Error, res: Buffer) => void): void;
setBuffer(key: KeyType, 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>;
setnx(key: KeyType, value: any, callback: (err: Error, res: any) => void): void;
setnx(key: KeyType, 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>;
setex(key: KeyType, seconds: number, value: any, callback: (err: Error, res: any) => void): void;
setex(key: KeyType, 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>;
psetex(key: KeyType, milliseconds: number, value: any, callback: (err: Error, res: any) => void): void;
psetex(key: KeyType, 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>;
append(key: KeyType, value: any, callback: (err: Error, res: number) => void): void;
append(key: KeyType, value: any): Promise<number>;
strlen(key: string, callback: (err: Error, res: number) => void): void;
strlen(key: string): Promise<number>;
strlen(key: KeyType, callback: (err: Error, res: number) => void): void;
strlen(key: KeyType): Promise<number>;
del(...keys: string[]): any;
del(...keys: KeyType[]): any;
exists(...keys: string[]): any;
exists(...keys: KeyType[]): any;
setbit(key: string, offset: number, value: any, callback: (err: Error, res: number) => void): void;
setbit(key: string, offset: number, value: any): Promise<number>;
setbit(key: KeyType, offset: number, value: any, callback: (err: Error, res: number) => void): void;
setbit(key: KeyType, 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>;
getbit(key: KeyType, offset: number, callback: (err: Error, res: number) => void): void;
getbit(key: KeyType, 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>;
setrange(key: KeyType, offset: number, value: any, callback: (err: Error, res: number) => void): void;
setrange(key: KeyType, 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>;
getrange(key: KeyType, start: number, end: number, callback: (err: Error, res: string) => void): void;
getrange(key: KeyType, 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>;
substr(key: KeyType, start: number, end: number, callback: (err: Error, res: string) => void): void;
substr(key: KeyType, start: number, end: number): Promise<string>;
incr(key: string, callback: (err: Error, res: number) => void): void;
incr(key: string): Promise<number>;
incr(key: KeyType, callback: (err: Error, res: number) => void): void;
incr(key: KeyType): Promise<number>;
decr(key: string, callback: (err: Error, res: number) => void): void;
decr(key: string): Promise<number>;
decr(key: KeyType, callback: (err: Error, res: number) => void): void;
decr(key: KeyType): Promise<number>;
mget(...keys: string[]): any;
mget(...keys: KeyType[]): any;
rpush(key: string, ...values: any[]): any;
rpush(key: KeyType, ...values: any[]): any;
lpush(key: string, ...values: any[]): any;
lpush(key: KeyType, ...values: any[]): any;
rpushx(key: string, value: any, callback: (err: Error, res: number) => void): void;
rpushx(key: string, value: any): Promise<number>;
rpushx(key: KeyType, value: any, callback: (err: Error, res: number) => void): void;
rpushx(key: KeyType, value: any): Promise<number>;
lpushx(key: string, value: any, callback: (err: Error, res: number) => void): void;
lpushx(key: string, value: any): Promise<number>;
lpushx(key: KeyType, value: any, callback: (err: Error, res: number) => void): void;
lpushx(key: KeyType, 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>;
linsert(key: KeyType, direction: "BEFORE" | "AFTER", pivot: string, value: any, callback: (err: Error, res: number) => void): void;
linsert(key: KeyType, direction: "BEFORE" | "AFTER", pivot: string, value: any): Promise<number>;
rpop(key: string, callback: (err: Error, res: string) => void): void;
rpop(key: string): Promise<string>;
rpop(key: KeyType, callback: (err: Error, res: string) => void): void;
rpop(key: KeyType): Promise<string>;
lpop(key: string, callback: (err: Error, res: string) => void): void;
lpop(key: string): Promise<string>;
lpop(key: KeyType, callback: (err: Error, res: string) => void): void;
lpop(key: KeyType): Promise<string>;
brpop(...keys: string[]): any;
brpop(...keys: KeyType[]): any;
blpop(...keys: string[]): any;
blpop(...keys: KeyType[]): 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>;
llen(key: KeyType, callback: (err: Error, res: number) => void): void;
llen(key: KeyType): Promise<number>;
lindex(key: string, index: number, callback: (err: Error, res: string) => void): void;
lindex(key: string, index: number): Promise<string>;
lindex(key: KeyType, index: number, callback: (err: Error, res: string) => void): void;
lindex(key: KeyType, 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>;
lset(key: KeyType, index: number, value: any, callback: (err: Error, res: any) => void): void;
lset(key: KeyType, 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>;
lrange(key: KeyType, start: number, stop: number, callback: (err: Error, res: any) => void): void;
lrange(key: KeyType, 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>;
ltrim(key: KeyType, start: number, stop: number, callback: (err: Error, res: any) => void): void;
ltrim(key: KeyType, 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>;
lrem(key: KeyType, count: number, value: any, callback: (err: Error, res: number) => void): void;
lrem(key: KeyType, 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;
sadd(key: KeyType, ...members: any[]): any;
srem(key: string, ...members: any[]): any;
srem(key: KeyType, ...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>;
sismember(key: KeyType, member: string, callback: (err: Error, res: 1 | 0) => void): void;
sismember(key: KeyType, member: string): Promise<1 | 0>;
scard(key: string, callback: (err: Error, res: number) => void): void;
scard(key: string): Promise<number>;
scard(key: KeyType, callback: (err: Error, res: number) => void): void;
scard(key: KeyType): 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>;
spop(key: KeyType, callback: (err: Error, res: any) => void): void;
spop(key: KeyType, count: number, callback: (err: Error, res: any) => void): void;
spop(key: KeyType, 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>;
srandmember(key: KeyType, callback: (err: Error, res: any) => void): void;
srandmember(key: KeyType, count: number, callback: (err: Error, res: any) => void): void;
srandmember(key: KeyType, count?: number): Promise<any>;
sinter(...keys: string[]): any;
sinter(...keys: KeyType[]): any;
sinterstore(destination: string, ...keys: string[]): any;
sinterstore(destination: string, ...keys: KeyType[]): any;
sunion(...keys: string[]): any;
sunion(...keys: KeyType[]): any;
sunionstore(destination: string, ...keys: string[]): any;
sunionstore(destination: string, ...keys: KeyType[]): any;
sdiff(...keys: string[]): any;
sdiff(...keys: KeyType[]): any;
sdiffstore(destination: string, ...keys: string[]): any;
sdiffstore(destination: string, ...keys: KeyType[]): any;
smembers(key: string, callback: (err: Error, res: any) => void): void;
smembers(key: string): Promise<any>;
smembers(key: KeyType, callback: (err: Error, res: any) => void): void;
smembers(key: KeyType): Promise<any>;
zadd(key: string, ...args: string[]): any;
zadd(key: KeyType, ...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>;
zincrby(key: KeyType, increment: number, member: string, callback: (err: Error, res: any) => void): void;
zincrby(key: KeyType, increment: number, member: string): Promise<any>;
zrem(key: string, ...members: any[]): any;
zrem(key: KeyType, ...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>;
zremrangebyscore(key: KeyType, min: number | string, max: number | string, callback: (err: Error, res: any) => void): void;
zremrangebyscore(key: KeyType, 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>;
zremrangebyrank(key: KeyType, start: number, stop: number, callback: (err: Error, res: any) => void): void;
zremrangebyrank(key: KeyType, start: number, stop: number): Promise<any>;
zunionstore(destination: string, numkeys: number, key: string, ...args: string[]): any;
zunionstore(destination: string, numkeys: number, key: KeyType, ...args: string[]): any;
zinterstore(destination: string, numkeys: number, key: string, ...args: string[]): any;
zinterstore(destination: string, numkeys: number, key: KeyType, ...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>;
zrange(key: KeyType, start: number, stop: number, callback: (err: Error, res: any) => void): void;
zrange(key: KeyType, start: number, stop: number, withScores: "WITHSCORES", callback: (err: Error, res: any) => void): void;
zrange(key: KeyType, 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>;
zrevrange(key: KeyType, start: number, stop: number, callback: (err: Error, res: any) => void): void;
zrevrange(key: KeyType, start: number, stop: number, withScores: "WITHSCORES", callback: (err: Error, res: any) => void): void;
zrevrange(key: KeyType, start: number, stop: number, withScores?: "WITHSCORES"): Promise<any>;
zrangebyscore(key: string, min: number | string, max: number | string, ...args: string[]): any;
zrangebyscore(key: KeyType, min: number | string, max: number | string, ...args: string[]): any;
zrevrangebyscore(key: string, max: number | string, min: number | string, ...args: string[]): any;
zrevrangebyscore(key: KeyType, 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>;
zcount(key: KeyType, min: number | string, max: number | string, callback: (err: Error, res: number) => void): void;
zcount(key: KeyType, min: number | string, max: number | string): Promise<number>;
zcard(key: string, callback: (err: Error, res: number) => void): void;
zcard(key: string): Promise<number>;
zcard(key: KeyType, callback: (err: Error, res: number) => void): void;
zcard(key: KeyType): Promise<number>;
zscore(key: string, member: string, callback: (err: Error, res: string) => void): void;
zscore(key: string, member: string): Promise<string>;
zscore(key: KeyType, member: string, callback: (err: Error, res: string) => void): void;
zscore(key: KeyType, member: string): Promise<string>;
zrank(key: string, member: string, callback: (err: Error, res: number) => void): void;
zrank(key: string, member: string): Promise<number>;
zrank(key: KeyType, member: string, callback: (err: Error, res: number) => void): void;
zrank(key: KeyType, member: string): Promise<number>;
zrevrank(key: string, member: string, callback: (err: Error, res: number) => void): void;
zrevrank(key: string, member: string): Promise<number>;
zrevrank(key: KeyType, member: string, callback: (err: Error, res: number) => void): void;
zrevrank(key: KeyType, 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>;
hset(key: KeyType, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void;
hset(key: KeyType, field: string, value: any): Promise<0 | 1>;
hsetBuffer(key: KeyType, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void;
hsetBuffer(key: KeyType, 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>;
hsetnx(key: KeyType, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void;
hsetnx(key: KeyType, 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>;
hget(key: KeyType, field: string, callback: (err: Error, res: string) => void): void;
hget(key: KeyType, field: string): Promise<string>;
hgetBuffer(key: KeyType, field: string, callback: (err: Error, res: Buffer) => void): void;
hgetBuffer(key: KeyType, 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>;
hmset(key: KeyType, field: string, value: any, ...args: string[]): Promise<0 | 1>;
hmset(key: KeyType, data: any, callback: (err: Error, res: 0 | 1) => void): void;
hmset(key: KeyType, data: any): Promise<0 | 1>;
hmget(key: string, ...fields: string[]): any;
hmget(key: KeyType, ...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>;
hincrby(key: KeyType, field: string, increment: number, callback: (err: Error, res: number) => void): void;
hincrby(key: KeyType, 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>;
hincrbyfloat(key: KeyType, field: string, increment: number, callback: (err: Error, res: number) => void): void;
hincrbyfloat(key: KeyType, field: string, increment: number): Promise<number>;
hdel(key: string, ...fields: string[]): any;
hdel(key: KeyType, ...fields: string[]): any;
hlen(key: string, callback: (err: Error, res: number) => void): void;
hlen(key: string): Promise<number>;
hlen(key: KeyType, callback: (err: Error, res: number) => void): void;
hlen(key: KeyType): Promise<number>;
hkeys(key: string, callback: (err: Error, res: any) => void): void;
hkeys(key: string): Promise<any>;
hkeys(key: KeyType, callback: (err: Error, res: any) => void): void;
hkeys(key: KeyType): Promise<any>;
hvals(key: string, callback: (err: Error, res: any) => void): void;
hvals(key: string): Promise<any>;
hvals(key: KeyType, callback: (err: Error, res: any) => void): void;
hvals(key: KeyType): Promise<any>;
hgetall(key: string, callback: (err: Error, res: any) => void): void;
hgetall(key: string): Promise<any>;
hgetall(key: KeyType, callback: (err: Error, res: any) => void): void;
hgetall(key: KeyType): Promise<any>;
hexists(key: string, field: string, callback: (err: Error, res: 0 | 1) => void): void;
hexists(key: string, field: string): Promise<0 | 1>;
hexists(key: KeyType, field: string, callback: (err: Error, res: 0 | 1) => void): void;
hexists(key: KeyType, field: string): Promise<0 | 1>;
incrby(key: string, increment: number, callback: (err: Error, res: number) => void): void;
incrby(key: string, increment: number): Promise<number>;
incrby(key: KeyType, increment: number, callback: (err: Error, res: number) => void): void;
incrby(key: KeyType, increment: number): Promise<number>;
incrbyfloat(key: string, increment: number, callback: (err: Error, res: number) => void): void;
incrbyfloat(key: string, increment: number): Promise<number>;
incrbyfloat(key: KeyType, increment: number, callback: (err: Error, res: number) => void): void;
incrbyfloat(key: KeyType, increment: number): Promise<number>;
decrby(key: string, decrement: number, callback: (err: Error, res: number) => void): void;
decrby(key: string, decrement: number): Promise<number>;
decrby(key: KeyType, decrement: number, callback: (err: Error, res: number) => void): void;
decrby(key: KeyType, decrement: number): Promise<number>;
getset(key: string, value: any, callback: (err: Error, res: string) => void): void;
getset(key: string, value: any): Promise<string>;
getset(key: KeyType, value: any, callback: (err: Error, res: string) => void): void;
getset(key: KeyType, value: any): Promise<string>;
mset(key: string, value: any, ...args: string[]): any;
mset(key: KeyType, value: any, ...args: string[]): any;
msetnx(key: string, value: any, ...args: string[]): any;
msetnx(key: KeyType, value: any, ...args: string[]): any;
randomkey(callback: (err: Error, res: string) => void): void;
randomkey(): Promise<string>;
@@ -317,26 +319,26 @@ declare namespace IORedis {
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>;
move(key: KeyType, db: string, callback: (err: Error, res: 0 | 1) => void): void;
move(key: KeyType, db: string): Promise<0 | 1>;
rename(key: string, newkey: string, callback: (err: Error, res: string) => void): void;
rename(key: string, newkey: string): Promise<string>;
rename(key: KeyType, newkey: KeyType, callback: (err: Error, res: string) => void): void;
rename(key: KeyType, newkey: KeyType): Promise<string>;
renamenx(key: string, newkey: string, callback: (err: Error, res: 0 | 1) => void): void;
renamenx(key: string, newkey: string): Promise<0 | 1>;
renamenx(key: KeyType, newkey: KeyType, callback: (err: Error, res: 0 | 1) => void): void;
renamenx(key: KeyType, newkey: KeyType): Promise<0 | 1>;
expire(key: string, seconds: number, callback: (err: Error, res: 0 | 1) => void): void;
expire(key: string, seconds: number): Promise<0 | 1>;
expire(key: KeyType, seconds: number, callback: (err: Error, res: 0 | 1) => void): void;
expire(key: KeyType, 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>;
pexpire(key: KeyType, milliseconds: number, callback: (err: Error, res: 0 | 1) => void): void;
pexpire(key: KeyType, 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>;
expireat(key: KeyType, timestamp: number, callback: (err: Error, res: 0 | 1) => void): void;
expireat(key: KeyType, 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>;
pexpireat(key: KeyType, millisecondsTimestamp: number, callback: (err: Error, res: 0 | 1) => void): void;
pexpireat(key: KeyType, millisecondsTimestamp: number): Promise<0 | 1>;
keys(pattern: string, callback: (err: Error, res: string[]) => void): void;
keys(pattern: string): Promise<string[]>;
@@ -369,8 +371,8 @@ declare namespace IORedis {
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>;
type(key: KeyType, callback: (err: Error, res: string) => void): void;
type(key: KeyType): Promise<string>;
multi(commands?: string[][], options?: MultiOptions): Pipeline;
multi(options: { pipeline: false }): Promise<string>;
@@ -390,7 +392,7 @@ declare namespace IORedis {
flushall(callback: (err: Error, res: string) => void): void;
flushall(): Promise<string>;
sort(key: string, ...args: string[]): any;
sort(key: KeyType, ...args: string[]): any;
info(callback: (err: Error, res: any) => void): void;
info(section: string, callback: (err: Error, res: any) => void): void;
@@ -402,11 +404,11 @@ declare namespace IORedis {
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>;
ttl(key: KeyType, callback: (err: Error, res: number) => void): void;
ttl(key: KeyType): Promise<number>;
persist(key: string, callback: (err: Error, res: 0 | 1) => void): void;
persist(key: string): Promise<0 | 1>;
persist(key: KeyType, callback: (err: Error, res: 0 | 1) => void): void;
persist(key: KeyType): Promise<0 | 1>;
slaveof(host: string, port: number, callback: (err: Error, res: string) => void): void;
slaveof(host: string, port: number): Promise<string>;
@@ -426,7 +428,7 @@ declare namespace IORedis {
publish(channel: string, message: string, callback: (err: Error, res: number) => void): void;
publish(channel: string, message: string): Promise<number>;
watch(...keys: string[]): any;
watch(...keys: KeyType[]): any;
unwatch(callback: (err: Error, res: string) => void): void;
unwatch(): Promise<string>;
@@ -437,8 +439,8 @@ declare namespace IORedis {
migrate(...args: any[]): any;
dump(key: string, callback: (err: Error, res: string) => void): void;
dump(key: string): Promise<string>;
dump(key: KeyType, callback: (err: Error, res: string) => void): void;
dump(key: KeyType): Promise<string>;
object(subcommand: string, ...args: any[]): any;
@@ -455,24 +457,24 @@ declare namespace IORedis {
scan(cursor: number, ...args: any[]): any;
sscan(key: string, cursor: number, ...args: any[]): any;
sscan(key: KeyType, cursor: number, ...args: any[]): any;
hscan(key: string, cursor: number, ...args: any[]): any;
hscan(key: KeyType, cursor: number, ...args: any[]): any;
zscan(key: string, cursor: number, ...args: any[]): any;
zscan(key: KeyType, cursor: number, ...args: any[]): any;
pfmerge(destkey: string, ...sourcekeys: string[]): any;
pfmerge(destkey: KeyType, ...sourcekeys: KeyType[]): any;
pfadd(key: string, ...elements: string[]): any;
pfadd(key: KeyType, ...elements: string[]): any;
pfcount(...keys: string[]): any;
pfcount(...keys: KeyType[]): 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;
sscanStream(key: KeyType, options?: ScanStreamOption): NodeJS.EventEmitter;
hscanStream(key: KeyType, options?: ScanStreamOption): NodeJS.EventEmitter;
zscanStream(key: KeyType, options?: ScanStreamOption): NodeJS.EventEmitter;
}
interface Pipeline {
@@ -483,208 +485,208 @@ declare namespace IORedis {
_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;
bitcount(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline;
bitcount(key: KeyType, 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;
get(key: KeyType, callback?: (err: Error, res: string) => void): Pipeline;
getBuffer(key: KeyType, 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;
set(key: KeyType, value: any, callback?: (err: Error, res: string) => void): Pipeline;
set(key: KeyType, value: any, setMode: string, callback?: (err: Error, res: string) => void): Pipeline;
set(key: KeyType, value: any, expiryMode: string, time: number, callback?: (err: Error, res: string) => void): Pipeline;
set(key: KeyType, 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;
setBuffer(key: KeyType, value: any, callback?: (err: Error, res: Buffer) => void): Pipeline;
setBuffer(key: KeyType, value: any, setMode: string, callback?: (err: Error, res: Buffer) => void): Pipeline;
setBuffer(key: KeyType, value: any, expiryMode: string, time: number, callback?: (err: Error, res: Buffer) => void): Pipeline;
setBuffer(key: KeyType, 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;
setnx(key: KeyType, value: any, callback?: (err: Error, res: any) => void): Pipeline;
setex(key: string, seconds: number, value: any, callback?: (err: Error, res: any) => void): Pipeline;
setex(key: KeyType, 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;
psetex(key: KeyType, milliseconds: number, value: any, callback?: (err: Error, res: any) => void): Pipeline;
append(key: string, value: any, callback?: (err: Error, res: number) => void): Pipeline;
append(key: KeyType, value: any, callback?: (err: Error, res: number) => void): Pipeline;
strlen(key: string, callback?: (err: Error, res: number) => void): Pipeline;
strlen(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline;
del(...keys: string[]): Pipeline;
del(...keys: KeyType[]): Pipeline;
exists(...keys: string[]): Pipeline;
exists(...keys: KeyType[]): Pipeline;
setbit(key: string, offset: number, value: any, callback?: (err: Error, res: number) => void): Pipeline;
setbit(key: KeyType, offset: number, value: any, callback?: (err: Error, res: number) => void): Pipeline;
getbit(key: string, offset: number, callback?: (err: Error, res: number) => void): Pipeline;
getbit(key: KeyType, offset: number, callback?: (err: Error, res: number) => void): Pipeline;
setrange(key: string, offset: number, value: any, callback?: (err: Error, res: number) => void): Pipeline;
setrange(key: KeyType, 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;
getrange(key: KeyType, 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;
substr(key: KeyType, start: number, end: number, callback?: (err: Error, res: string) => void): Pipeline;
incr(key: string, callback?: (err: Error, res: number) => void): Pipeline;
incr(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline;
decr(key: string, callback?: (err: Error, res: number) => void): Pipeline;
decr(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline;
mget(...keys: string[]): Pipeline;
mget(...keys: KeyType[]): Pipeline;
rpush(key: string, ...values: any[]): Pipeline;
rpush(key: KeyType, ...values: any[]): Pipeline;
lpush(key: string, ...values: any[]): Pipeline;
lpush(key: KeyType, ...values: any[]): Pipeline;
rpushx(key: string, value: any, callback?: (err: Error, res: number) => void): Pipeline;
rpushx(key: KeyType, value: any, callback?: (err: Error, res: number) => void): Pipeline;
lpushx(key: string, value: any, callback?: (err: Error, res: number) => void): Pipeline;
lpushx(key: KeyType, 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;
linsert(key: KeyType, direction: "BEFORE" | "AFTER", pivot: string, value: any, callback?: (err: Error, res: number) => void): Pipeline;
rpop(key: string, callback?: (err: Error, res: string) => void): Pipeline;
rpop(key: KeyType, callback?: (err: Error, res: string) => void): Pipeline;
lpop(key: string, callback?: (err: Error, res: string) => void): Pipeline;
lpop(key: KeyType, callback?: (err: Error, res: string) => void): Pipeline;
brpop(...keys: string[]): Pipeline;
brpop(...keys: KeyType[]): Pipeline;
blpop(...keys: string[]): Pipeline;
blpop(...keys: KeyType[]): 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;
llen(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline;
lindex(key: string, index: number, callback?: (err: Error, res: string) => void): Pipeline;
lindex(key: KeyType, index: number, callback?: (err: Error, res: string) => void): Pipeline;
lset(key: string, index: number, value: any, callback?: (err: Error, res: any) => void): Pipeline;
lset(key: KeyType, 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;
lrange(key: KeyType, 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;
ltrim(key: KeyType, 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;
lrem(key: KeyType, 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;
sadd(key: KeyType, ...members: any[]): Pipeline;
srem(key: string, ...members: any[]): Pipeline;
srem(key: KeyType, ...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;
sismember(key: KeyType, member: string, callback?: (err: Error, res: 1 | 0) => void): Pipeline;
scard(key: string, callback?: (err: Error, res: number) => void): Pipeline;
scard(key: KeyType, 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;
spop(key: KeyType, callback?: (err: Error, res: any) => void): Pipeline;
spop(key: KeyType, 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;
srandmember(key: KeyType, callback?: (err: Error, res: any) => void): Pipeline;
srandmember(key: KeyType, count: number, callback?: (err: Error, res: any) => void): Pipeline;
sinter(...keys: string[]): Pipeline;
sinter(...keys: KeyType[]): Pipeline;
sinterstore(destination: string, ...keys: string[]): Pipeline;
sinterstore(destination: string, ...keys: KeyType[]): Pipeline;
sunion(...keys: string[]): Pipeline;
sunion(...keys: KeyType[]): Pipeline;
sunionstore(destination: string, ...keys: string[]): Pipeline;
sunionstore(destination: string, ...keys: KeyType[]): Pipeline;
sdiff(...keys: string[]): Pipeline;
sdiff(...keys: KeyType[]): Pipeline;
sdiffstore(destination: string, ...keys: string[]): Pipeline;
sdiffstore(destination: string, ...keys: KeyType[]): Pipeline;
smembers(key: string, callback?: (err: Error, res: any) => void): Pipeline;
smembers(key: KeyType, callback?: (err: Error, res: any) => void): Pipeline;
zadd(key: string, ...args: string[]): Pipeline;
zadd(key: KeyType, ...args: string[]): Pipeline;
zincrby(key: string, increment: number, member: string, callback?: (err: Error, res: any) => void): Pipeline;
zincrby(key: KeyType, increment: number, member: string, callback?: (err: Error, res: any) => void): Pipeline;
zrem(key: string, ...members: any[]): Pipeline;
zrem(key: KeyType, ...members: any[]): Pipeline;
zremrangebyscore(key: string, min: number | string, max: number | string, callback?: (err: Error, res: any) => void): Pipeline;
zremrangebyscore(key: KeyType, 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;
zremrangebyrank(key: KeyType, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline;
zunionstore(destination: string, numkeys: number, key: string, ...args: string[]): Pipeline;
zunionstore(destination: string, numkeys: number, key: KeyType, ...args: string[]): Pipeline;
zinterstore(destination: string, numkeys: number, key: string, ...args: string[]): Pipeline;
zinterstore(destination: string, numkeys: number, key: KeyType, ...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;
zrange(key: KeyType, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline;
zrange(key: KeyType, 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;
zrevrange(key: KeyType, start: number, stop: number, callback?: (err: Error, res: any) => void): Pipeline;
zrevrange(key: KeyType, 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;
zrangebyscore(key: KeyType, min: number | string, max: number | string, ...args: string[]): Pipeline;
zrevrangebyscore(key: string, max: number | string, min: number | string, ...args: string[]): Pipeline;
zrevrangebyscore(key: KeyType, 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;
zcount(key: KeyType, min: number | string, max: number | string, callback?: (err: Error, res: number) => void): Pipeline;
zcard(key: string, callback?: (err: Error, res: number) => void): Pipeline;
zcard(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline;
zscore(key: string, member: string, callback?: (err: Error, res: number) => void): Pipeline;
zscore(key: KeyType, member: string, callback?: (err: Error, res: number) => void): Pipeline;
zrank(key: string, member: string, callback?: (err: Error, res: number) => void): Pipeline;
zrank(key: KeyType, member: string, callback?: (err: Error, res: number) => void): Pipeline;
zrevrank(key: string, member: string, callback?: (err: Error, res: number) => void): Pipeline;
zrevrank(key: KeyType, 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;
hset(key: KeyType, field: string, value: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
hsetBuffer(key: KeyType, 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;
hsetnx(key: KeyType, 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;
hget(key: KeyType, field: string, callback?: (err: Error, res: string) => void): Pipeline;
hgetBuffer(key: KeyType, 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;
hmset(key: KeyType, field: string, value: any, ...args: string[]): Pipeline;
hmset(key: KeyType, data: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
hmget(key: string, ...fields: string[]): Pipeline;
hmget(key: KeyType, ...fields: string[]): Pipeline;
hincrby(key: string, field: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline;
hincrby(key: KeyType, 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;
hincrbyfloat(key: KeyType, field: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline;
hdel(key: string, ...fields: string[]): Pipeline;
hdel(key: KeyType, ...fields: string[]): Pipeline;
hlen(key: string, callback?: (err: Error, res: number) => void): Pipeline;
hlen(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline;
hkeys(key: string, callback?: (err: Error, res: any) => void): Pipeline;
hkeys(key: KeyType, callback?: (err: Error, res: any) => void): Pipeline;
hvals(key: string, callback?: (err: Error, res: any) => void): Pipeline;
hvals(key: KeyType, callback?: (err: Error, res: any) => void): Pipeline;
hgetall(key: string, callback?: (err: Error, res: any) => void): Pipeline;
hgetall(key: KeyType, callback?: (err: Error, res: any) => void): Pipeline;
hexists(key: string, field: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
hexists(key: KeyType, field: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
incrby(key: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline;
incrby(key: KeyType, increment: number, callback?: (err: Error, res: number) => void): Pipeline;
incrbyfloat(key: string, increment: number, callback?: (err: Error, res: number) => void): Pipeline;
incrbyfloat(key: KeyType, increment: number, callback?: (err: Error, res: number) => void): Pipeline;
decrby(key: string, decrement: number, callback?: (err: Error, res: number) => void): Pipeline;
decrby(key: KeyType, decrement: number, callback?: (err: Error, res: number) => void): Pipeline;
getset(key: string, value: any, callback?: (err: Error, res: string) => void): Pipeline;
getset(key: KeyType, value: any, callback?: (err: Error, res: string) => void): Pipeline;
mset(key: string, value: any, ...args: string[]): Pipeline;
mset(key: KeyType, value: any, ...args: string[]): Pipeline;
msetnx(key: string, value: any, ...args: string[]): Pipeline;
msetnx(key: KeyType, 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;
move(key: KeyType, db: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
rename(key: string, newkey: string, callback?: (err: Error, res: string) => void): Pipeline;
rename(key: KeyType, newkey: KeyType, callback?: (err: Error, res: string) => void): Pipeline;
renamenx(key: string, newkey: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
renamenx(key: KeyType, newkey: KeyType, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
expire(key: string, seconds: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
expire(key: KeyType, seconds: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
pexpire(key: string, milliseconds: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
pexpire(key: KeyType, milliseconds: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
expireat(key: string, timestamp: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
expireat(key: KeyType, timestamp: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
pexpireat(key: string, millisecondsTimestamp: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
pexpireat(key: KeyType, millisecondsTimestamp: number, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
keys(pattern: string, callback?: (err: Error, res: string[]) => void): Pipeline;
@@ -707,7 +709,7 @@ declare namespace IORedis {
lastsave(callback?: (err: Error, res: number) => void): Pipeline;
type(key: string, callback?: (err: Error, res: string) => void): Pipeline;
type(key: KeyType, callback?: (err: Error, res: string) => void): Pipeline;
multi(callback?: (err: Error, res: string) => void): Pipeline;
@@ -721,7 +723,7 @@ declare namespace IORedis {
flushall(callback?: (err: Error, res: string) => void): Pipeline;
sort(key: string, ...args: string[]): Pipeline;
sort(key: KeyType, ...args: string[]): Pipeline;
info(callback?: (err: Error, res: any) => void): Pipeline;
info(section: string, callback?: (err: Error, res: any) => void): Pipeline;
@@ -730,9 +732,9 @@ declare namespace IORedis {
monitor(callback?: (err: Error, res: NodeJS.EventEmitter) => void): Pipeline;
ttl(key: string, callback?: (err: Error, res: number) => void): Pipeline;
ttl(key: KeyType, callback?: (err: Error, res: number) => void): Pipeline;
persist(key: string, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
persist(key: KeyType, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
slaveof(host: string, port: number, callback?: (err: Error, res: string) => void): Pipeline;
@@ -750,7 +752,7 @@ declare namespace IORedis {
publish(channel: string, message: string, callback?: (err: Error, res: number) => void): Pipeline;
watch(...keys: string[]): Pipeline;
watch(...keys: KeyType[]): Pipeline;
unwatch(callback?: (err: Error, res: string) => void): Pipeline;
@@ -760,7 +762,7 @@ declare namespace IORedis {
migrate(...args: any[]): Pipeline;
dump(key: string, callback?: (err: Error, res: string) => void): Pipeline;
dump(key: KeyType, callback?: (err: Error, res: string) => void): Pipeline;
object(subcommand: string, ...args: any[]): Pipeline;
@@ -776,17 +778,17 @@ declare namespace IORedis {
scan(cursor: number, ...args: any[]): Pipeline;
sscan(key: string, cursor: number, ...args: any[]): Pipeline;
sscan(key: KeyType, cursor: number, ...args: any[]): Pipeline;
hscan(key: string, cursor: number, ...args: any[]): Pipeline;
hscan(key: KeyType, cursor: number, ...args: any[]): Pipeline;
zscan(key: string, cursor: number, ...args: any[]): Pipeline;
zscan(key: KeyType, cursor: number, ...args: any[]): Pipeline;
pfmerge(destkey: string, ...sourcekeys: string[]): Pipeline;
pfmerge(destkey: KeyType, ...sourcekeys: KeyType[]): Pipeline;
pfadd(key: string, ...elements: string[]): Pipeline;
pfadd(key: KeyType, ...elements: string[]): Pipeline;
pfcount(...keys: string[]): Pipeline;
pfcount(...keys: KeyType[]): Pipeline;
}
interface NodeConfiguration {
+4
View File
@@ -31,6 +31,10 @@ 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) => {});
// Should support usage of Buffer
redis.set(Buffer.from('key'), '100');
redis.setBuffer(Buffer.from('key'), '100', 'NX', 'EX', 10);
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
+1 -1
View File
@@ -70,7 +70,7 @@ export interface Field {
caseSensitive: boolean;
compoundFieldName?: maybe<string>;
controllerName?: maybe<string>;
creatable: boolean;
createable: boolean;
custom: boolean;
defaultValue?: maybe<string | boolean>;
defaultValueFormula?: maybe<string>;
+1 -2
View File
@@ -1,2 +1 @@
export class SalesforceId extends String {
}
export type SalesforceId = string
+1 -3
View File
@@ -53,7 +53,7 @@ export interface UtilBase {
/**
* use QuickSort
*/
sort(array: any[]): UtilQuickSort;
sort(array: any[]): (array: number[], isClone: boolean) => this;
/**
* caculate callback runtime
@@ -577,5 +577,3 @@ export interface UtilScaleOrdinal extends Function {
rangeBands(interval: number, padding?: number, outerPadding?: number): () => void;
invert(x: number): number;
}
export type UtilQuickSort = (array: number[], isClone: boolean) => this;
+1 -1
View File
@@ -1,5 +1,5 @@
// Type definitions for Marked 0.4
// Project: https://github.com/chjj/marked
// Project: https://github.com/markedjs/marked
// Definitions by: William Orr <https://github.com/worr>
// BendingBender <https://github.com/BendingBender>
// CrossR <https://github.com/CrossR>
+17 -13
View File
@@ -1,4 +1,4 @@
// Type definitions for Node.js 10.7.x
// Type definitions for Node.js 10.9.x
// Project: http://nodejs.org/
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>
// DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>
@@ -186,11 +186,11 @@ interface String {
trimRight(): string;
}
/************************************************
* *
* GLOBAL *
* *
************************************************/
/*-----------------------------------------------*
* *
* GLOBAL *
* *
------------------------------------------------*/
declare var process: NodeJS.Process;
declare var global: NodeJS.Global;
declare var console: Console;
@@ -1289,7 +1289,9 @@ declare module "http" {
// create interface RequestOptions would make the naming more clear to developers
export interface RequestOptions extends ClientRequestArgs { }
export function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
export function request(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
export function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
export function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
export var globalAgent: Agent;
}
@@ -1891,7 +1893,9 @@ declare module "https" {
export function createServer(options: ServerOptions, requestListener?: (req: http.IncomingMessage, res: http.ServerResponse) => void): Server;
export function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
export function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
export function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
export function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
export var globalAgent: Agent;
}
@@ -2198,7 +2202,7 @@ declare module "child_process" {
keepOpen?: boolean;
}
export type StdioOptions = "pipe" | "ignore" | "inherit" | Array<("pipe" | "ipc" | "ignore" | stream.Stream | number | null | undefined)>;
export type StdioOptions = "pipe" | "ignore" | "inherit" | Array<("pipe" | "ipc" | "ignore" | "inherit" | stream.Stream | number | null | undefined)>;
export interface SpawnOptions {
cwd?: string;
@@ -6405,17 +6409,17 @@ declare module "util" {
export function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
export function promisify<TResult>(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise<TResult>;
export function promisify(fn: (callback: (err: Error | null) => void) => void): () => Promise<void>;
export function promisify(fn: (callback: (err?: Error | null) => void) => void): () => Promise<void>;
export function promisify<T1, TResult>(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise<TResult>;
export function promisify<T1>(fn: (arg1: T1, callback: (err: Error | null) => void) => void): (arg1: T1) => Promise<void>;
export function promisify<T1>(fn: (arg1: T1, callback: (err?: Error | null) => void) => void): (arg1: T1) => Promise<void>;
export function promisify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise<TResult>;
export function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
export function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
export function promisify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
export function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
export function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
export function promisify<T1, T2, T3, T4, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>;
export function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
export function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
export function promisify<T1, T2, T3, T4, T5, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>;
export function promisify<T1, T2, T3, T4, T5>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
export function promisify<T1, T2, T3, T4, T5>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
export function promisify(fn: Function): Function;
export namespace promisify {
const custom: symbol;
+1974 -1630
View File
File diff suppressed because it is too large Load Diff
+38 -1
View File
@@ -862,6 +862,7 @@ namespace util_tests {
var arg0NoResult: () => Promise<any> = util.promisify((cb: (err: Error) => void): void => { });
var arg1: (arg: string) => Promise<number> = util.promisify((arg: string, cb: (err: Error, result: number) => void): void => { });
var arg1NoResult: (arg: string) => Promise<any> = util.promisify((arg: string, cb: (err: Error) => void): void => { });
var cbOptionalError: () => Promise<void> = util.promisify((cb: (err?: Error | null) => void): void => { cb(); });
assert(typeof util.promisify.custom === 'symbol');
// util.deprecate
const foo = () => {};
@@ -1708,7 +1709,25 @@ namespace http_tests {
}
{
http.get('http://www.example.com/xyz');
http.request('http://www.example.com/xyz');
http.get('http://www.example.com/xyz', (res: http.IncomingMessage): void => {});
http.request('http://www.example.com/xyz', (res: http.IncomingMessage): void => {});
http.get(new url.URL('http://www.example.com/xyz'));
http.request(new url.URL('http://www.example.com/xyz'));
http.get(new url.URL('http://www.example.com/xyz'), (res: http.IncomingMessage): void => {});
http.request(new url.URL('http://www.example.com/xyz'), (res: http.IncomingMessage): void => {});
const opts: http.RequestOptions = {
path: '"/some/path'
};
http.get(new url.URL('http://www.example.com'), opts);
http.request(new url.URL('http://www.example.com'), opts);
http.get(new url.URL('http://www.example.com/xyz'), opts, (res: http.IncomingMessage): void => {});
http.request(new url.URL('http://www.example.com/xyz'), opts, (res: http.IncomingMessage): void => {});
}
{
@@ -1770,8 +1789,26 @@ namespace https_tests {
agent: undefined
});
https.get('http://www.example.com/xyz');
https.request('http://www.example.com/xyz');
https.get('http://www.example.com/xyz', (res: http.IncomingMessage): void => {});
https.request('http://www.example.com/xyz', (res: http.IncomingMessage): void => {});
https.get(new url.URL('http://www.example.com/xyz'));
https.request(new url.URL('http://www.example.com/xyz'));
https.get(new url.URL('http://www.example.com/xyz'), (res: http.IncomingMessage): void => {});
https.request(new url.URL('http://www.example.com/xyz'), (res: http.IncomingMessage): void => {});
const opts: https.RequestOptions = {
path: '/some/path'
};
https.get(new url.URL('http://www.example.com'), opts);
https.request(new url.URL('http://www.example.com'), opts);
https.get(new url.URL('http://www.example.com/xyz'), opts, (res: http.IncomingMessage): void => {});
https.request(new url.URL('http://www.example.com/xyz'), opts, (res: http.IncomingMessage): void => {});
https.globalAgent.options.ca = [];
{
@@ -2329,7 +2366,7 @@ namespace child_process_tests {
childProcess.exec("echo test", { windowsHide: true });
childProcess.spawn("echo", ["test"], { windowsHide: true });
childProcess.spawn("echo", ["test"], { windowsHide: true, argv0: "echo-test" });
childProcess.spawn("echo", ["test"], { stdio: [0xdeadbeef, undefined, "pipe"] });
childProcess.spawn("echo", ["test"], { stdio: [0xdeadbeef, "inherit", undefined, "pipe"] });
childProcess.spawnSync("echo test");
childProcess.spawnSync("echo test", {windowsVerbatimArguments: false});
childProcess.spawnSync("echo test", {windowsVerbatimArguments: false, argv0: "echo-test"});
+6 -6
View File
@@ -5688,17 +5688,17 @@ declare module "util" {
export function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
export function promisify<TResult>(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise<TResult>;
export function promisify(fn: (callback: (err: Error | null) => void) => void): () => Promise<void>;
export function promisify(fn: (callback: (err?: Error | null) => void) => void): () => Promise<void>;
export function promisify<T1, TResult>(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise<TResult>;
export function promisify<T1>(fn: (arg1: T1, callback: (err: Error | null) => void) => void): (arg1: T1) => Promise<void>;
export function promisify<T1>(fn: (arg1: T1, callback: (err?: Error | null) => void) => void): (arg1: T1) => Promise<void>;
export function promisify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise<TResult>;
export function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
export function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
export function promisify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
export function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
export function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
export function promisify<T1, T2, T3, T4, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>;
export function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
export function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
export function promisify<T1, T2, T3, T4, T5, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>;
export function promisify<T1, T2, T3, T4, T5>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
export function promisify<T1, T2, T3, T4, T5>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
export function promisify(fn: Function): Function;
export namespace promisify {
const custom: symbol;
+28 -4
View File
@@ -244,7 +244,7 @@ declare module "inspector" {
*/
export interface CallArgument {
/**
* Primitive value.
* Primitive value or serializable javascript object.
*/
value?: any;
/**
@@ -416,7 +416,7 @@ declare module "inspector" {
*/
userGesture?: boolean;
/**
* Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error.
* Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
*/
awaitPromise?: boolean;
}
@@ -468,7 +468,7 @@ declare module "inspector" {
*/
userGesture?: boolean;
/**
* Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error.
* Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
*/
awaitPromise?: boolean;
}
@@ -561,11 +561,18 @@ declare module "inspector" {
*/
generatePreview?: boolean;
/**
* Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error.
* Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
*/
awaitPromise?: boolean;
}
export interface QueryObjectsParameterType {
/**
* Identifier of the prototype to return objects for.
*/
prototypeObjectId: Runtime.RemoteObjectId;
}
export interface EvaluateReturnType {
/**
* Evaluation result.
@@ -636,6 +643,13 @@ declare module "inspector" {
exceptionDetails?: Runtime.ExceptionDetails;
}
export interface QueryObjectsReturnType {
/**
* Array with objects.
*/
objects: Runtime.RemoteObject;
}
export interface ExecutionContextCreatedEventDataType {
/**
* A newly created execution context.
@@ -1476,6 +1490,10 @@ declare module "inspector" {
* Collect accurate call counts beyond simple 'covered' or 'not covered'.
*/
callCount?: boolean;
/**
* Collect block-based coverage.
*/
detailed?: boolean;
}
export interface StopReturnType {
@@ -1749,6 +1767,12 @@ declare module "inspector" {
*/
post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void;
post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void;
/**
* @experimental
*/
post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void;
post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void;
/**
* Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.
*/
+2
View File
@@ -819,6 +819,8 @@ namespace util_tests {
var arg0NoResult: () => Promise<any> = util.promisify((cb: (err: Error) => void): void => { });
var arg1: (arg: string) => Promise<number> = util.promisify((arg: string, cb: (err: Error, result: number) => void): void => { });
var arg1NoResult: (arg: string) => Promise<any> = util.promisify((arg: string, cb: (err: Error) => void): void => { });
// The following test requires typescript >= 2.4, but definitions currently tested with typescript@2.1
// var cbOptionalError: () => Promise<void> = util.promisify((cb: (err?: Error | null) => void): void => { cb(); });
assert(typeof util.promisify.custom === 'symbol');
// util.deprecate
const foo = () => {};
+6 -6
View File
@@ -5772,17 +5772,17 @@ declare module "util" {
export function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
export function promisify<TResult>(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise<TResult>;
export function promisify(fn: (callback: (err: Error | null) => void) => void): () => Promise<void>;
export function promisify(fn: (callback: (err?: Error | null) => void) => void): () => Promise<void>;
export function promisify<T1, TResult>(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise<TResult>;
export function promisify<T1>(fn: (arg1: T1, callback: (err: Error | null) => void) => void): (arg1: T1) => Promise<void>;
export function promisify<T1>(fn: (arg1: T1, callback: (err?: Error | null) => void) => void): (arg1: T1) => Promise<void>;
export function promisify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise<TResult>;
export function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
export function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
export function promisify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
export function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
export function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
export function promisify<T1, T2, T3, T4, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>;
export function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
export function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
export function promisify<T1, T2, T3, T4, T5, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>;
export function promisify<T1, T2, T3, T4, T5>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
export function promisify<T1, T2, T3, T4, T5>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
export function promisify(fn: Function): Function;
export namespace promisify {
const custom: symbol;
+46 -4
View File
@@ -244,7 +244,7 @@ declare module "inspector" {
*/
export interface CallArgument {
/**
* Primitive value.
* Primitive value or serializable javascript object.
*/
value?: any;
/**
@@ -416,7 +416,7 @@ declare module "inspector" {
*/
userGesture?: boolean;
/**
* Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error.
* Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
*/
awaitPromise?: boolean;
}
@@ -468,7 +468,7 @@ declare module "inspector" {
*/
userGesture?: boolean;
/**
* Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error.
* Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
*/
awaitPromise?: boolean;
}
@@ -561,11 +561,25 @@ declare module "inspector" {
*/
generatePreview?: boolean;
/**
* Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error.
* Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
*/
awaitPromise?: boolean;
}
export interface QueryObjectsParameterType {
/**
* Identifier of the prototype to return objects for.
*/
prototypeObjectId: Runtime.RemoteObjectId;
}
export interface GlobalLexicalScopeNamesParameterType {
/**
* Specifies in which execution context to lookup global scope variables.
*/
executionContextId?: Runtime.ExecutionContextId;
}
export interface EvaluateReturnType {
/**
* Evaluation result.
@@ -636,6 +650,17 @@ declare module "inspector" {
exceptionDetails?: Runtime.ExceptionDetails;
}
export interface QueryObjectsReturnType {
/**
* Array with objects.
*/
objects: Runtime.RemoteObject;
}
export interface GlobalLexicalScopeNamesReturnType {
names: string[];
}
export interface ExecutionContextCreatedEventDataType {
/**
* A newly created execution context.
@@ -1476,6 +1501,10 @@ declare module "inspector" {
* Collect accurate call counts beyond simple 'covered' or 'not covered'.
*/
callCount?: boolean;
/**
* Collect block-based coverage.
*/
detailed?: boolean;
}
export interface StopReturnType {
@@ -1749,6 +1778,19 @@ declare module "inspector" {
*/
post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void;
post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void;
/**
* @experimental
*/
post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void;
post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void;
/**
* Returns all let, const and class variables from global scope.
* @experimental
*/
post(method: "Runtime.globalLexicalScopeNames", params?: Runtime.GlobalLexicalScopeNamesParameterType, callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void;
post(method: "Runtime.globalLexicalScopeNames", callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void;
/**
* Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.
*/
+1
View File
@@ -845,6 +845,7 @@ namespace util_tests {
var arg0NoResult: () => Promise<any> = util.promisify((cb: (err: Error) => void): void => { });
var arg1: (arg: string) => Promise<number> = util.promisify((arg: string, cb: (err: Error, result: number) => void): void => { });
var arg1NoResult: (arg: string) => Promise<any> = util.promisify((arg: string, cb: (err: Error) => void): void => { });
var cbOptionalError: () => Promise<void> = util.promisify((cb: (err?: Error | null) => void): void => { cb(); });
assert(typeof util.promisify.custom === 'symbol');
// util.deprecate
const foo = () => {};
+458 -339
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -53,6 +53,7 @@ interface IOAuth2StrategyOption {
callbackURL: string;
authorizationURL?: string;
tokenURL?: string;
userProfileURL?: string;
accessType?: string;
approval_prompt?: string;
prompt?: string;
+10 -1
View File
@@ -1,8 +1,9 @@
// Type definitions for pino 4.16
// Type definitions for pino 5.20
// Project: https://github.com/pinojs/pino.git
// Definitions by: Peter Snider <https://github.com/psnider>
// BendingBender <https://github.com/BendingBender>
// Christian Rackerseder <https://github.com/screendriver>
// GP <https://github.com/paambaati>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -145,6 +146,10 @@ declare namespace P {
* requires supplying a level value via `levelVal`. Default: 'info'.
*/
level?: LevelWithSilent | string;
/**
* Outputs the level as a string instead of integer. Default: `false`.
*/
useLevelLabels?: boolean;
/**
* When defining a custom log level via level, set to an integer value to define the new level. Default: `undefined`.
*/
@@ -268,6 +273,10 @@ declare namespace P {
* You can pass `'silent'` to disable logging.
*/
level: LevelWithSilent | string;
/**
* Outputs the level as a string instead of integer.
*/
useLevelLabels: boolean;
/**
* Returns the integer value for the logger instance's logging level.
*/
+4
View File
@@ -96,3 +96,7 @@ pino.levels.labels[50] === 'error';
const logstderr: pino.Logger = pino(process.stderr);
logstderr.error('on stderr instead of stdout');
log.useLevelLabels = true;
log.info('lol');
log.level === 'info';
+58
View File
@@ -0,0 +1,58 @@
// Type definitions for png.js 0.2
// Project: https://github.com/arian/pngjs
// Definitions by: Florian Keller <https://github.com/ffflorian>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
type BitDepth = 2 | 4 | 8 | 16;
type ColorType = 0 | 2 | 3 | 4 | 6;
type ParseCallback = (err: Error | undefined, png: PNG) => void;
interface ParseOptions {
data?: boolean;
}
declare class PNGReader {
bytes: Uint8Array | number[] | Buffer;
dataChunks: number[][];
i: number;
png: PNG;
constructor(bytes: Uint8Array | string | Buffer | ArrayBuffer);
parse(callback: ParseCallback): void;
parse(options: ParseOptions, callback: ParseCallback): void;
}
declare class PNG {
alpha: boolean;
bitDepth: BitDepth;
colors: number;
colorType: ColorType;
compressionMethod: 0;
filterMethod: 0;
height: number;
interlaceMethod: 0 | 1;
palette: number[] | null;
pixelBits: number;
pixels: Buffer | null;
width: number;
getBitDepth(): BitDepth;
getColorType(): ColorType;
getCompressionMethod(): 0;
getFilterMethod(): 0;
getHeight(): number;
getInterlaceMethod(): 0 | 1;
getPalette(): number[];
getPixel(x: number, y: number): [number, number, number, number];
getWidth(): number;
setBitDepth(bitDepth: BitDepth): void;
setColorType(colorType: ColorType): void;
setCompressionMethod(compressionMethod: 0): void;
setFilterMethod(filterMethod: 0): void;
setHeight(height: number): void;
setInterlaceMethod(interlaceMethod: 0 | 1): void;
setPalette(palette: number[]): void;
setWidth(width: number): void;
}
export = PNGReader;
+37
View File
@@ -0,0 +1,37 @@
/// <reference types="node" />
import PNGReader = require('png.js');
const buffer = new Buffer([]);
const reader1 = new PNGReader(buffer);
reader1.parse((err, png) => {
if (err) throw err;
png.getWidth();
png.getHeight();
png.getPixel(1, 0)[0];
png.getBitDepth();
png.getColorType();
png.getCompressionMethod();
png.getFilterMethod();
png.getInterlaceMethod();
png.getPalette();
});
const bytes = new Uint8Array(0);
const reader2 = new PNGReader(bytes);
reader2.parse({data: false}, (err, png) => {
if (err) throw err;
png.getWidth();
png.getHeight();
png.getPixel(1, 0)[2];
png.getBitDepth();
png.getColorType();
png.getCompressionMethod();
png.getFilterMethod();
png.getInterlaceMethod();
png.getPalette();
});
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"png.js-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+6 -2
View File
@@ -1,6 +1,9 @@
// Type definitions for pouchdb-upsert 2.2
// Project: https://github.com/pouchdb/upsert
// Definitions by: Keith D. Moore <https://github.com/keithdmoore>, Andrew Mitchell <https://github.com/hotforfeature>, Eddie Hsu <https://github.com/apolkingg8>
// Definitions by: Keith D. Moore <https://github.com/keithdmoore>
// Andrew Mitchell <https://github.com/hotforfeature>
// Eddie Hsu <https://github.com/apolkingg8>
// John McLaughlin <https://github.com/zamb3zi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
@@ -55,7 +58,8 @@ declare namespace PouchDB {
callback: Core.Callback<UpsertResponse>): void;
}
type UpsertDiffCallback<Content extends {}> = (doc: Core.Document<Content> | {}) => Core.Document<Content> | boolean;
type CancelUpsert = '' | 0 | false | null | undefined; // falsey values
type UpsertDiffCallback<Content extends {}> = (doc: Core.Document<Content> | {}) => Content & Partial<Core.IdMeta> | CancelUpsert;
interface UpsertResponse {
id: Core.DocumentId;
+26 -6
View File
@@ -2,9 +2,10 @@ import * as pouchdbUpsert from 'pouchdb-upsert';
PouchDB.plugin(pouchdbUpsert);
interface UpsertDocModel {
_id: 'test-doc1';
name: 'test';
name: string;
readonly?: boolean;
}
declare const docToUpsert: PouchDB.Core.Document<UpsertDocModel>;
const db = new PouchDB<UpsertDocModel>();
@@ -16,10 +17,20 @@ function testUpsert_WithPromise_AndReturnDoc() {
});
}
function testUpsert_WithPromise_AndReturnBoolean() {
function testUpsert_WithPromise_AndReturnFalsey() {
db.upsert<UpsertDocModel>(docToUpsert._id, (doc: PouchDB.Core.Document<UpsertDocModel>) => {
if (doc.readonly)
return false;
// Make some updates....
return false;
return doc;
}).then((res: PouchDB.UpsertResponse) => {
});
}
function testUpsert_WithPromise_AndReturnNewObject() {
// callback return boolean
db.upsert<UpsertDocModel>(docToUpsert._id, (doc: PouchDB.Core.Document<UpsertDocModel>) => {
return {name: 'test', readonly: true};
}).then((res: PouchDB.UpsertResponse) => {
});
}
@@ -31,11 +42,20 @@ function testUpsert_WithCallback_AndReturnDoc() {
}, (res: PouchDB.UpsertResponse) => {});
}
function testUpsert_WithCallback_AndReturnBoolean() {
function testUpsert_WithCallback_AndReturnFalsey() {
// callback return boolean
db.upsert<UpsertDocModel>(docToUpsert._id, (doc: PouchDB.Core.Document<UpsertDocModel>) => {
if (doc.readonly)
return false;
// Make some updates....
return false;
return doc;
}, (res: PouchDB.UpsertResponse) => {});
}
function testUpsert_WithCallback_AndReturnNewObject() {
// callback return boolean
db.upsert<UpsertDocModel>(docToUpsert._id, (doc: PouchDB.Core.Document<UpsertDocModel>) => {
return {name: 'test', readonly: true};
}, (res: PouchDB.UpsertResponse) => {});
}
+36 -22
View File
@@ -20,41 +20,55 @@ export {
declare namespace RcSelect {
interface SelectProps {
className?: string;
prefixCls?: string;
animation?: string;
transitionName?: string;
choiceTransitionName?: string;
dropdownMatchSelectWidth?: boolean;
dropdownClassName?: string;
dropdownStyle?: { [key: string]: string };
dropdownMenuStyle?: { [key: string]: string };
notFoundContent?: string;
showSearch?: boolean;
allowClear?: boolean;
tags?: boolean;
maxTagTextLength?: number;
animation?: string;
choiceTransitionName?: string;
className?: string;
combobox?: boolean;
multiple?: boolean;
defaultActiveFirstOption?: boolean;
defaultLabel?: string | Array<string>;
defaultValue?: string | Array<string>;
disabled?: boolean;
dropdownClassName?: string;
dropdownMatchSelectWidth?: boolean;
dropdownMenuStyle?: { [key: string]: string };
dropdownStyle?: { [key: string]: string };
filterOption?: boolean;
getPopupContainer?: (trigger: Node) => Node;
getInputElement?: () => Node;
id?: string;
labelInValue?: boolean;
maxTagCount?: number;
maxTagPlaceholder?: React.ReactNode | Function;
maxTagTextLength?: number;
multiple?: boolean;
notFoundContent?: string;
onBlur?: () => void;
onChange?: (value: string, label: string) => void;
onDeselect?: (value: string, option: Option) => void;
onFocus?: () => void;
onInputKeyDown?: (e: Event) => void;
onPopupScroll?: () => void;
onSearch?: () => void;
onSelect?: (value: string, ontion: Option) => void;
optionFilterProp?: string;
optionLabelProp?: string;
defaultValue?: string | Array<string>;
placeholder?: React.ReactNode;
prefixCls?: string;
showAction?: string[];
showArrow?: boolean;
showSearch?: boolean;
tags?: boolean;
tokenSeparators?: string[];
transitionName?: string;
value?: string | Array<string>;
onChange?: (value: string, label: string) => void;
onSearch?: Function;
onSelect?: (value: string, ontion: Option) => void;
onDeselect?: Function;
defaultLabel?: string | Array<string>;
defaultActiveFirstOption?: boolean;
getPopupContainer?: (trigger: Node) => Node;
}
export class Select extends React.Component<SelectProps> { }
interface OptionProps {
className?: string;
disabled?: boolean;
key?: string;
title?: string;
value?: string;
}
export class Option extends React.Component<OptionProps> { }
+1 -1
View File
@@ -5,7 +5,7 @@
This package contains type definitions for rc-slider (https://github.com/react-component/slider).
Additional Details
* Last updated: Fri, 15 Dec 2017
* Last updated: Sun, 04 Aug 2018
* Dependencies: react
* Global values: none
+29 -13
View File
@@ -1,9 +1,10 @@
// Type definitions for rc-slider 8.2
// Type definitions for rc-slider 8.6
// Project: https://github.com/react-component/slider
// Definitions by: Marcinkus Mantas <https://github.com/mantasmarcinkus>
// Alexander Mattoni <https://github.com/mattoni>
// Austin Turner <https://github.com/paustint>
// Jacob Froman <https://github.com/j-fro>
// Deanna Veale <https://github.com/Deanna2>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -68,18 +69,6 @@ export interface CommonApiProps {
* @default false
*/
dots?: boolean;
/**
* onBeforeChange will be triggered when ontouchstart or onmousedown is triggered.
*/
onBeforeChange?(value: any): any | undefined;
/**
* onChange will be triggered while the value of Slider changing.
*/
onChange?(value: any): any | undefined;
/**
* onAfterChange will be triggered when ontouchend or onmouseup is triggered.
*/
onAfterChange?(value: any): any | undefined;
/**
* @deprecated in version ^6.0.0. Use rc-tooltip
@@ -125,6 +114,18 @@ export interface CommonApiProps {
}
export interface SliderProps extends CommonApiProps {
/**
* onBeforeChange will be triggered when ontouchstart or onmousedown is triggered.
*/
onBeforeChange?(value: number): void;
/**
* onChange will be triggered while the value of Slider changing.
*/
onChange?(value: number): void;
/**
* onAfterChange will be triggered when ontouchend or onmouseup is triggered.
*/
onAfterChange?(value: number): void;
/**
* Set initial value of slider.
* @default 0
@@ -137,6 +138,21 @@ export interface SliderProps extends CommonApiProps {
}
export interface RangeProps extends CommonApiProps {
/**
* onBeforeChange will be triggered when ontouchstart or onmousedown is triggered.
* For prop (count = -1) type returned is [number, undefined]. Bug raised in rc-slider https://github.com/react-component/slider/issues/457
*/
onBeforeChange?(value: number[]): void;
/**
* onChange will be triggered while the value of Slider changing.
* For prop (count = -1) type returned is [number, undefined]. Bug raised in rc-slider https://github.com/react-component/slider/issues/457
*/
onChange?(value: number[]): void;
/**
* onAfterChange will be triggered when ontouchend or onmouseup is triggered.
* For prop (count = -1) type returned is [number, undefined]. Bug raised in rc-slider https://github.com/react-component/slider/issues/457
*/
onAfterChange?(value: number[]): void;
/**
* Set initial positions of handles.
* @default [0,0]
+11 -3
View File
@@ -18,6 +18,11 @@ ReactDOM.render(
/>,
document.querySelector('.another-app')
);
const onChangeFunc1 = (string: number) => {};
const onChangeFunc2 = (string: number[]) => {};
ReactDOM.render(
<Slider
className="bottomRight"
@@ -30,9 +35,9 @@ ReactDOM.render(
included={true}
disabled={false}
dots={true}
onBeforeChange={() => { }}
onChange={() => { }}
onAfterChange={() => { }}
onBeforeChange={onChangeFunc1}
onChange={onChangeFunc1}
onAfterChange={onChangeFunc1}
defaultValue={0.1}
value={0.1}
style={{backgroundColor: 'plum'}}
@@ -49,6 +54,9 @@ ReactDOM.render(
count={3}
allowCross={false}
pushable={true}
onChange={onChangeFunc2}
onAfterChange={onChangeFunc2}
onBeforeChange={onChangeFunc2}
/>,
document.querySelector('.app')
);
+11
View File
@@ -11,6 +11,7 @@
// Michele Bombardi <https://github.com/bm-software>
// Tanguy Krotoff <https://github.com/tkrotoff>
// Alexander T. <https://github.com/a-tarasyuk>
// Martin van Dam <https://github.com/mvdam>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -6210,6 +6211,11 @@ export interface ScrollViewPropsAndroid {
* - 'never' - Never allow a user to over-scroll this view.
*/
overScrollMode?: "auto" | "always" | "never";
/**
* Enables nested scrolling for Android API level 21+. Nested scrolling is supported by default on iOS.
*/
nestedScrollEnabled?: boolean;
}
export interface ScrollViewProps
@@ -7859,6 +7865,7 @@ type TimePickerAndroidOpenOptions = {
hour?: number;
minute?: number;
is24Hour?: boolean;
mode?: 'clock' | 'spinner' | 'default';
};
/**
@@ -7891,6 +7898,10 @@ export interface TimePickerAndroidStatic {
* * `is24Hour` (boolean) - If `true`, the picker uses the 24-hour format. If `false`,
* the picker shows an AM/PM chooser. If undefined, the default for the current locale
* is used.
* * `mode` (enum('clock', 'spinner', 'default')) - set the time picker mode
* * 'clock': Show a time picker in clock mode.
* * 'spinner': Show a time picker in spinner mode.
* * 'default': Show a default time picker based on Android versions.
*
* Returns a Promise which will be invoked an object containing `action`, `hour` (0-23),
* `minute` (0-59) if the user picked a time. If the user dismissed the dialog, the Promise will
+11 -1
View File
@@ -72,6 +72,7 @@ import {
WebView,
KeyboardAvoidingView,
Modal,
TimePickerAndroid,
} from "react-native";
declare module "react-native" {
@@ -390,7 +391,7 @@ class ScrollerListComponentTest extends React.Component<{}, { dataSource: ListVi
throw new Error("Expected scroll to be enabled.");
}
return <ScrollView horizontal={true} contentOffset={{x: 0, y: 0}} {...props} style={[scrollViewStyle1.scrollView, scrollViewStyle2]} />;
return <ScrollView horizontal={true} nestedScrollEnabled={true} contentOffset={{x: 0, y: 0}} {...props} style={[scrollViewStyle1.scrollView, scrollViewStyle2]} />;
}}
renderRow={({ type, data }, _, row) => {
return <Text>Filler</Text>;
@@ -734,3 +735,12 @@ const AlertIOSTest = () => {
const ModalTest = () => (
<Modal hardwareAccelerated />
)
const TimePickerAndroidTest = () => (
TimePickerAndroid.open({
hour: 8,
minute: 15,
is24Hour: true,
mode: 'spinner'
})
)
+11 -9
View File
@@ -21,6 +21,7 @@
// Linus Unnebäck <https://github.com/LinusU>
// Yosuke Seki <https://github.com/jshosomichi>
// Jake <https://github.com/jakebooyah>
// Gustavo Brunoro <https://github.com/brunoro>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -565,6 +566,16 @@ export interface NavigationEventSubscription {
remove: () => void;
}
export interface NavigationEventsProps extends ViewProps {
navigation?: NavigationNavigator;
onWillFocus?: NavigationEventCallback;
onDidFocus?: NavigationEventCallback;
onWillBlur?: NavigationEventCallback;
onDidBlur?: NavigationEventCallback;
}
export const NavigationEvents: React.ComponentType<NavigationEventsProps>;
export interface NavigationScreenProp<S, P = NavigationParams> {
state: S;
dispatch: NavigationDispatch;
@@ -996,25 +1007,16 @@ export namespace NavigationActions {
const BACK: 'Navigation/BACK';
const INIT: 'Navigation/INIT';
const NAVIGATE: 'Navigation/NAVIGATE';
const RESET: 'Navigation/RESET';
const SET_PARAMS: 'Navigation/SET_PARAMS';
const URI: 'Navigation/URI';
const POP: 'Navigation/POP';
const POP_TO_TOP: 'Navigation/POP_TO_TOP';
function init(options?: NavigationInitActionPayload): NavigationInitAction;
function navigate(
options: NavigationNavigateActionPayload
): NavigationNavigateAction;
function reset(options: NavigationResetActionPayload): NavigationResetAction;
function back(options?: NavigationBackActionPayload): NavigationBackAction;
function setParams(
options: NavigationSetParamsActionPayload
): NavigationSetParamsAction;
function pop(options: NavigationPopActionPayload): NavigationPopAction;
function popToTop(
options: NavigationPopToTopActionPayload
): NavigationPopToTopAction;
}
/**
@@ -11,6 +11,7 @@ import {
DrawerNavigatorConfig,
NavigationAction,
NavigationActions,
NavigationEvents,
NavigationBackAction,
NavigationInitAction,
NavigationNavigateAction,
@@ -410,14 +411,6 @@ const navigateAction: NavigationNavigateAction = NavigationActions.navigate({
action: NavigationActions.navigate({ routeName: "BarScreen" })
});
const resetAction: NavigationResetAction = NavigationActions.reset({
index: 0,
key: "foo",
actions: [
NavigationActions.navigate({ routeName: "FooScreen" })
]
});
const backAction: NavigationBackAction = NavigationActions.back({
key: "foo"
});
@@ -429,16 +422,6 @@ const setParamsAction: NavigationSetParamsAction = NavigationActions.setParams({
}
});
const popAction: NavigationPopAction = NavigationActions.pop({
n: 1,
immediate: true
});
const popToTopAction: NavigationPopToTopAction = NavigationActions.popToTop({
key: "foo",
immediate: true
});
class Page1 extends React.Component { }
const RootNavigator: NavigationContainer = createSwitchNavigator({
@@ -589,3 +572,14 @@ createStackNavigator(
routeConfigMap,
{transitionConfig: () => ({screenInterpolator: StackViewTransitionConfigs.SlideFromRightIOS.screenInterpolator})}
);
// Test NavigationEvents component
const ViewWithNavigationEvents = (
<NavigationEvents
onWillFocus={console.log}
onDidFocus={console.log}
onWillBlur={console.log}
onDidBlur={console.log}
/>
);
-1
View File
@@ -11,7 +11,6 @@
// Qibang Sun <https://github.com/bang88>
// Sergei Butko: <https://github.com/svbutko>
// Veit Lehmann: <https://github.com/levito>
// Roberto Huertas: <https://github.com/robertohuertasm>
// Steven Miller <https://github.com/YourGamesBeOver>
// Armando Assuncao <https://github.com/ArmandoAssuncao>
// Ciaran Liedeman <https://github.com/cliedeman>
+5 -4
View File
@@ -7,6 +7,7 @@
// Alex Young <https://github.com/alsiola>
// Anton Novik <https://github.com/tehbi4>
// Huw Martin <https://github.com/huwmartin>
// Ethan Resnick <https://github.com/ethanresnick>
// Tim de Koning <https://github.com/reggino>
// Maddi Joyce <https://github.com/maddijoyce>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -19,13 +20,13 @@ import {
export type FieldType = "Field" | "FieldArray";
export interface ErrorOther<T = void> {
export interface ErrorOther<T = string> {
_error?: T;
}
export type FormErrors<FormData = {}, T = void> = {
[P in keyof FormData]?: ReactElement<any> | string | ErrorOther<T>;
};
export type FormErrors<FormData = {}, T = string> = {
[P in keyof FormData]?: ReactElement<any> | T;
} & ErrorOther<T>;
export interface WarningOther<T = void> {
_warning?: T;
+5 -5
View File
@@ -1,12 +1,12 @@
import { Component, FormHTMLAttributes, FormEvent, FormEventHandler } from "react";
import { FormProps, FormErrors, FormSubmitHandler, Omit } from "../index";
interface FormSubmitProp<FormData = {}, P = {}> {
onSubmit?: FormSubmitHandler<FormData, P>;
interface FormSubmitProp<FormData = {}, P = {}, ErrorType = string> {
onSubmit?: FormSubmitHandler<FormData, P, ErrorType>;
}
export type FormProps<FormData, P> = Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"> & FormSubmitProp<FormData, P>;
export type FormProps<FormData, P, ErrorType = string> = Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"> & FormSubmitProp<FormData, P, ErrorType>;
export class GenericForm<FormData, P> extends Component<FormProps<FormData, P>> {}
export class GenericForm<FormData, P, ErrorType> extends Component<FormProps<FormData, P, ErrorType>> {}
export class Form<FormData = {}, P = {}> extends Component<FormProps<FormData, P>> implements GenericForm<FormData, P> {}
export class Form<FormData = {}, P = {}, ErrorType = string> extends Component<FormProps<FormData, P, ErrorType>> implements GenericForm<FormData, P, ErrorType> {}
+2 -4
View File
@@ -1,9 +1,7 @@
import { FormErrors } from "../index";
export interface SubmissionErrorConstructor<T> {
new (errors?: FormErrors<T>): Error;
export declare class SubmissionError<FormData = {}, ErrorType = string> extends Error {
constructor(errors?: FormErrors<FormData, ErrorType>);
}
export const SubmissionError: SubmissionErrorConstructor<any>;
export default SubmissionError;
+4 -4
View File
@@ -36,11 +36,11 @@ export declare function registerField(form: string, name: string, type: FieldTyp
export declare function reset(form: string): FormAction;
export declare function resetSection(form: string, ...sections: string[]): FormAction;
export declare function startAsyncValidation(form: string): FormAction;
export declare function stopAsyncValidation(form: string, errors?: any): FormAction;
export declare function stopAsyncValidation(form: string, errors?: FormErrors<FormData, any>): FormAction;
export declare function setSubmitFailed(form: string, ...fields: string[]): FormAction;
export declare function setSubmitSucceeded(form: string, ...fields: string[]): FormAction;
export declare function startSubmit(form: string): FormAction;
export declare function stopSubmit(form: string, errors?: any): FormAction;
export declare function stopSubmit(form: string, errors?: FormErrors<FormData, any>): FormAction;
export declare function submit(form: string): FormAction;
export declare function clearSubmit(form: string): FormAction;
export declare function clearSubmitErrors(form: string): FormAction;
@@ -49,8 +49,8 @@ export declare function clearFields(form: string, keepTouched: boolean, persiste
export declare function touch(form: string, ...fields: string[]): FormAction;
export declare function unregisterField(form: string, name: string): FormAction;
export declare function untouch(form: string, ...fields: string[]): FormAction;
export declare function updateSyncErrors(from: string, syncErrors: FormErrors<FormData>, error: any): FormAction;
export declare function updateSyncWarnings(form: string, syncWarnings: FormWarnings<FormData>, warning: any): FormAction;
export declare function updateSyncErrors<T = any>(from: string, syncErrors: FormErrors<FormData, T>, error: T): FormAction;
export declare function updateSyncWarnings<T = any>(form: string, syncWarnings: FormWarnings<FormData, T>, warning: T): FormAction;
declare const actions: {
arrayInsert: typeof arrayInsert,
+42 -37
View File
@@ -17,14 +17,14 @@ import {
FormStateMap
} from "../index";
export type FormSubmitHandler<FormData = {}, P = {}> =
(values: FormData, dispatch: Dispatch<any>, props: P) => void | FormErrors<FormData> | Promise<any>;
export type FormSubmitHandler<FormData = {}, P = {}, ErrorType = string> =
(values: FormData, dispatch: Dispatch<any>, props: P) => void | FormErrors<FormData, ErrorType> | Promise<any>;
export type GetFormState = (state: any) => FormStateMap;
export interface SubmitHandler<FormData = {}, P = {}> {
export interface SubmitHandler<FormData = {}, P = {}, ErrorType = string> {
(
submit: FormSubmitHandler<FormData, P>,
props?: InjectedFormProps<FormData, P>,
submit: FormSubmitHandler<FormData, P, ErrorType>,
props?: InjectedFormProps<FormData, P, ErrorType>,
valid?: boolean,
asyncValidate?: any,
fields?: string[]
@@ -32,16 +32,16 @@ export interface SubmitHandler<FormData = {}, P = {}> {
(event: SyntheticEvent<any>): void;
}
export interface ValidateCallback<FormData, P> {
export interface ValidateCallback<FormData, P, ErrorType> {
values: FormData;
nextProps: P & InjectedFormProps<FormData, P>;
props: P & InjectedFormProps<FormData, P>;
nextProps: P & InjectedFormProps<FormData, P, ErrorType>;
props: P & InjectedFormProps<FormData, P, ErrorType>;
initialRender: boolean;
structure: any;
}
export interface AsyncValidateCallback<FormData> {
asyncErrors?: FormErrors<FormData>;
export interface AsyncValidateCallback<FormData, ErrorType> {
asyncErrors?: FormErrors<FormData, ErrorType>;
initialized: boolean;
trigger: "blur" | "submit";
blurredField?: string;
@@ -68,7 +68,7 @@ export interface RegisteredField {
type: "Field" | "FieldArray";
}
export interface InjectedFormProps<FormData = {}, P = {}> {
export interface InjectedFormProps<FormData = {}, P = {}, ErrorType = string> {
anyTouched: boolean;
array: InjectedArrayProps;
asyncValidate(): void;
@@ -79,9 +79,9 @@ export interface InjectedFormProps<FormData = {}, P = {}> {
clearAsyncError(field: string): void;
destroy(): void;
dirty: boolean;
error: string;
error: ErrorType;
form: string;
handleSubmit: SubmitHandler<FormData, P>;
handleSubmit: SubmitHandler<FormData, P, ErrorType>;
initialize(data: Partial<FormData>): void;
initialized: boolean;
initialValues: Partial<FormData>;
@@ -98,11 +98,11 @@ export interface InjectedFormProps<FormData = {}, P = {}> {
registeredFields: { [name: string]: RegisteredField };
}
export interface ConfigProps<FormData = {}, P = {}> {
export interface ConfigProps<FormData = {}, P = {}, ErrorType = string> {
form: string;
asyncBlurFields?: string[];
asyncChangeFields?: string[];
asyncValidate?(values: FormData, dispatch: Dispatch<any>, props: P & InjectedFormProps<FormData, P>, blurredField: string): Promise<any>;
asyncValidate?(values: FormData, dispatch: Dispatch<any>, props: P & InjectedFormProps<FormData, P, ErrorType>, blurredField: string): Promise<any>;
destroyOnUnmount?: boolean;
enableReinitialize?: boolean;
forceUnregisterOnUnmount?: boolean;
@@ -111,24 +111,29 @@ export interface ConfigProps<FormData = {}, P = {}> {
initialValues?: Partial<FormData>;
keepDirtyOnReinitialize?: boolean;
updateUnregisteredFields?: boolean;
onChange?(values: Partial<FormData>, dispatch: Dispatch<any>, props: P & InjectedFormProps<FormData, P>): void;
onSubmit?: FormSubmitHandler<FormData, P & InjectedFormProps<FormData, P>> | SubmitHandler<FormData, P & InjectedFormProps<FormData, P>>;
onSubmitFail?(errors: FormErrors<FormData>, dispatch: Dispatch<any>, submitError: any, props: P & InjectedFormProps<FormData, P>): void;
onSubmitSuccess?(result: any, dispatch: Dispatch<any>, props: P & InjectedFormProps<FormData, P>): void;
onChange?(values: Partial<FormData>, dispatch: Dispatch<any>, props: P & InjectedFormProps<FormData, P, ErrorType>): void;
onSubmit?: FormSubmitHandler<FormData, P & InjectedFormProps<FormData, P, ErrorType>, ErrorType> | SubmitHandler<FormData, P & InjectedFormProps<FormData, P, ErrorType>, ErrorType>;
onSubmitFail?(
errors: FormErrors<FormData, ErrorType> | undefined,
dispatch: Dispatch<any>,
submitError: any,
props: P & InjectedFormProps<FormData, P, ErrorType>
): void;
onSubmitSuccess?(result: any, dispatch: Dispatch<any>, props: P & InjectedFormProps<FormData, P, ErrorType>): void;
propNamespace?: string;
pure?: boolean;
shouldValidate?(params: ValidateCallback<FormData, P>): boolean;
shouldError?(params: ValidateCallback<FormData, P>): boolean;
shouldWarn?(params: ValidateCallback<FormData, P>): boolean;
shouldAsyncValidate?(params: AsyncValidateCallback<FormData>): boolean;
shouldValidate?(params: ValidateCallback<FormData, P, ErrorType>): boolean;
shouldError?(params: ValidateCallback<FormData, P, ErrorType>): boolean;
shouldWarn?(params: ValidateCallback<FormData, P, ErrorType>): boolean;
shouldAsyncValidate?(params: AsyncValidateCallback<FormData, ErrorType>): boolean;
touchOnBlur?: boolean;
touchOnChange?: boolean;
persistentSubmitErrors?: boolean;
validate?(values: FormData, props: P & InjectedFormProps<FormData, P>): FormErrors<FormData>;
warn?(values: FormData, props: P & InjectedFormProps<FormData, P>): FormWarnings<FormData>;
validate?(values: FormData, props: P & InjectedFormProps<FormData, P, ErrorType>): FormErrors<FormData, ErrorType>;
warn?(values: FormData, props: P & InjectedFormProps<FormData, P, ErrorType>): FormWarnings<FormData>;
}
export interface FormInstance<FormData, P> extends Component<P> {
export interface FormInstance<FormData, P, ErrorType> extends Component<P> {
dirty: boolean;
invalid: boolean;
pristine: boolean;
@@ -138,22 +143,22 @@ export interface FormInstance<FormData, P> extends Component<P> {
submit(): Promise<any>;
valid: boolean;
values: Partial<FormData>;
wrappedInstance: ReactElement<P & InjectedFormProps<FormData, P>>;
wrappedInstance: ReactElement<P & InjectedFormProps<FormData, P, ErrorType>>;
}
export interface DecoratedComponentClass<FormData, P> {
new(props?: P, context?: any): FormInstance<FormData, P>;
export interface DecoratedComponentClass<FormData, P, ErrorType> {
new(props?: P, context?: any): FormInstance<FormData, P, ErrorType>;
}
export type FormDecorator<FormData, P, Config> =
(component: ComponentType<P & InjectedFormProps<FormData, P>>) => DecoratedComponentClass<FormData, P & Config>;
export type FormDecorator<FormData, P, Config, ErrorType = string> =
(component: ComponentType<P & InjectedFormProps<FormData, P, ErrorType>>) => DecoratedComponentClass<FormData, P & Config, ErrorType>;
export declare function reduxForm<FormData = {}, P = {}>(
config: ConfigProps<FormData, P>
): FormDecorator<FormData, P, Partial<ConfigProps<FormData, P>>>;
export declare function reduxForm<FormData = {}, P = {}, ErrorType = string>(
config: ConfigProps<FormData, P, ErrorType>
): FormDecorator<FormData, P, Partial<ConfigProps<FormData, P, ErrorType>>, ErrorType>;
export declare function reduxForm<FormData = {}, P = {}>(
config: Partial<ConfigProps<FormData, P>>
): FormDecorator<FormData, P, ConfigProps<FormData, P>>;
export declare function reduxForm<FormData = {}, P = {}, ErrorType = string>(
config: Partial<ConfigProps<FormData, P, ErrorType>>
): FormDecorator<FormData, P, ConfigProps<FormData, P, ErrorType>, ErrorType>;
export default reduxForm;
+1 -1
View File
@@ -1,7 +1,7 @@
import { FormErrors, GetFormState } from "../index";
export type DataSelector<FormData = {}, State = {}> = (formName: string, getFormState?: GetFormState) => (state: State) => FormData;
export type ErrorSelector<FormData = {}, State = {}> = (formName: string, getFormState?: GetFormState) => (state: State) => FormErrors<FormData>;
export type ErrorSelector<FormData = {}, State = {}, ErrorType = string> = (formName: string, getFormState?: GetFormState) => (state: State) => FormErrors<FormData, ErrorType>;
export type BooleanSelector<State = {}> = (formName: string, getFormState?: GetFormState) => (state: State) => boolean;
export type NamesSelector<State = {}> = (getFormState?: GetFormState) => (state: State) => string[];
export type FormOrFieldsBooleanSelector<State = {}> = (formName: string, getFormState?: GetFormState) => (state: State, ...fields: string[]) => boolean;
+38 -2
View File
@@ -61,8 +61,9 @@ type InjectedProps = InjectedFormProps<TestFormData, TestFormComponentProps>;
class TestFormComponent extends React.Component<TestFormComponentProps & InjectedProps> {
render() {
const { form, initialValues } = this.props;
const { form, initialValues, error } = this.props;
const foo = initialValues.foo;
const errorIsString = error + 'test';
return null;
}
}
@@ -238,7 +239,7 @@ const Test = reduxForm<TestFormData>({
render() {
const { handleSubmit } = this.props;
const FormCustom = Form as new () => GenericForm<TestFormData, {}>;
const FormCustom = Form as new () => GenericForm<TestFormData, {}, string>;
return (
<div>
@@ -409,3 +410,38 @@ class FormNameTest extends React.Component {
);
}
}
// Test SubmissionError with custom error format
// See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/26494
// Note: explicit parameters not needed in TS 2.7
new LibSubmissionError<{ myField: any }, string[]>({
_error: ["First form-level error", "Second form-level error"],
myField: ["Field-level error"]
});
new SubmissionError({
_error: ["First form-level error", "Second form-level error"]
});
// Test forms with custom error format.
const HandleSubmitTestForm2 = reduxForm<TestFormData, {}, string[]>({ form : "test" })(
(props: InjectedFormProps<TestFormData, {}, string[]>) => <form onSubmit={ props.handleSubmit } />
);
class HandleSubmitTest2 extends React.Component {
handleSubmit = (values: Partial<TestFormData>, dispatch: Dispatch<any>, props: {}) => {};
render() {
return <HandleSubmitTestForm2 onSubmit={this.handleSubmit} />;
}
}
type InjectedProps2 = InjectedFormProps<TestFormData, TestFormComponentProps, string[]>;
class TestFormComponent2 extends React.Component<TestFormComponentProps & InjectedProps2> {
render() {
const { error, initialValues, handleSubmit } = this.props;
error.concat(['error is a string array']);
handleSubmit((values) => ({ foo: ['string'], _error: [] }));
return null;
}
}
+1 -1
View File
@@ -851,7 +851,7 @@ export interface RedirectOptions {
/**
* redirect location's query string parameters
*/
query?: string;
query?: string|object;
/**
* if true, `options.query`
+1 -1
View File
@@ -5,7 +5,7 @@
declare const ScrollReveal: scrollReveal.ScrollRevealObject;
declare module 'ScrollReveal' {
declare module 'scrollreveal' {
export = ScrollReveal;
}
+15 -1
View File
@@ -4672,6 +4672,20 @@ declare namespace sequelize {
}
/**
* Interface for Attributes provided for a column
*
* @see Sequelize.define
*/
type DefineModelAttributes<T> = {
/**
* The description of a database column for model
*/
[P in keyof T]: string | DataTypeAbstract | DefineAttributeColumnOptions;
}
/**
* Interface for query options
*
@@ -5976,7 +5990,7 @@ declare namespace sequelize {
* @param options These options are merged with the default define options provided to the Sequelize
* constructor
*/
define<TInstance, TAttributes>(modelName: string, attributes: DefineAttributes,
define<TInstance, TAttributes>(modelName: string, attributes: DefineModelAttributes<TAttributes>,
options?: DefineOptions<TInstance>): Model<TInstance, TAttributes>;
/**
+14 -5
View File
@@ -34,11 +34,16 @@ s.transaction().then( ( a ) => t = a );
interface GUserAttributes {
id? : number;
username? : string;
email: string;
}
interface GUserInstance extends Sequelize.Instance<GUserAttributes> {}
var GUser = s.define<GUserInstance, GUserAttributes>( 'user', { id: Sequelize.INTEGER, username : Sequelize.STRING });
GUser.create({ id : 1, username : 'one' }).then( ( guser ) => guser.save() );
const GUser = s.define<GUserInstance, GUserAttributes>('user', {
id: Sequelize.INTEGER,
username: Sequelize.STRING,
email: Sequelize.STRING
});
GUser.create({ id : 1, username : 'one', email: 'one@lol.com' }).then((guser) => guser.save());
var schema : Sequelize.DefineAttributes = {
key : { type : Sequelize.STRING, primaryKey : true },
@@ -1294,7 +1299,7 @@ var testModel = s.define( 'User', {
theDate : Sequelize.DATE,
aBool : Sequelize.BOOLEAN
} );
var testModel = s.define( 'FrozenUser', {}, { freezeTableName : true } );
const testFrozenModel = s.define( 'FrozenUser', {}, { freezeTableName : true } );
s.define( 'UserWithClassAndInstanceMethods', {}, {
classMethods : { doSmth : function() { return 1; } },
instanceMethods : { makeItSo : function() { return 2; } }
@@ -1539,7 +1544,11 @@ interface ChairAttributes {
}
interface ChairInstance extends Sequelize.Instance<ChairAttributes> {}
const Chair = s.define<ChairInstance, ChairAttributes>('chair', {});
const Chair = s.define<ChairInstance, ChairAttributes>('chair', {
id: Sequelize.NUMBER,
color: Sequelize.STRING,
legs: Sequelize.NUMBER
});
Chair.findAll({
where: {
@@ -1728,7 +1737,7 @@ s.define('DefineOptionsIndexesTest', {
email: {
allowNull: false,
type: Sequelize.STRING(255),
set: function (val) {
set: function (val: any) {
if (typeof val === "string") {
val = val.toLowerCase();
} else {
+20 -24
View File
@@ -1,32 +1,28 @@
// Type definitions for shapefile 0.5.6
// Type definitions for shapefile 0.6
// Project: https://github.com/mbostock/shapefile
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>
// James Bromwell <https://github.com/Thw0rted>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="geojson"/>
/// <reference types="node" />
declare const shapefile: shapefile.ShapefileStatic;
import { Feature, FeatureCollection, GeometryObject, GeoJsonProperties } from "geojson";
import { Readable } from "stream";
declare namespace shapefile {
interface Options {
encoding: string
highWaterMark: number
}
interface Feature {
done: boolean
value: GeoJSON.Feature<any>
}
interface Shapefile {
bbox: Array<number>
read(): Promise<Feature>;
}
interface ShapefileStatic {
open(shp: any, dbf?: any, options?: Options): Promise<Shapefile>;
read(shp: any, dbf?: any, options?: Options): Promise<GeoJSON.FeatureCollection<any>>;
}
export interface Options {
encoding?: string;
highWaterMark?: number;
}
export interface Source<RecordType> {
bbox: number[];
read(): Promise<{done: boolean, value: RecordType}>;
cancel(): Promise<void>;
}
declare module "shapefile" {
export = shapefile
}
export type Openable = string | ArrayBuffer | Uint8Array | Readable | ReadableStream;
export function open(shp: Openable, dbf?: Openable, options?: Options): Promise<Source<Feature>>;
export function openShp(source: Openable, options?: Options): Promise<Source<GeometryObject>>;
export function openDbf(source: Openable, options?: Options): Promise<Source<GeoJsonProperties>>;
export function read(shp: Openable, dbf?: Openable, options?: Options): Promise<FeatureCollection>;
+32 -12
View File
@@ -1,18 +1,38 @@
import * as shapefile from 'shapefile'
import { open, openDbf, openShp, read } from 'shapefile';
shapefile.open('./example.shp')
open('./example.shp', new ArrayBuffer(123))
.then(source => {
source.bbox
source.bbox;
source.read()
.then(result => {
result.value
result.done
})
})
result.value.geometry;
result.done;
});
});
shapefile.read("example.shp")
openDbf('./example.dbf', {encoding: "utf8"})
.then(source => {
source.bbox;
source.read()
.then(result => {
result.value;
result.done;
});
});
openShp('./example.shp', {highWaterMark: 0xabad1dea})
.then(source => {
source.bbox;
source.read()
.then(result => {
result.value;
result.done;
});
});
read("example.shp")
.then(result => {
result.bbox
result.features
result.type
})
result.bbox;
result.features;
result.type;
});
+3 -2
View File
@@ -2,7 +2,8 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
@@ -20,4 +21,4 @@
"index.d.ts",
"shapefile-tests.ts"
]
}
}
+1 -77
View File
@@ -1,79 +1,3 @@
{
"extends": "dtslint/dt.json",
"rules": {
"adjacent-overload-signatures": false,
"array-type": false,
"arrow-return-shorthand": false,
"ban-types": false,
"callable-types": false,
"comment-format": false,
"dt-header": false,
"eofline": false,
"export-just-namespace": false,
"import-spacing": false,
"interface-name": false,
"interface-over-type-literal": false,
"jsdoc-format": false,
"max-line-length": false,
"member-access": false,
"new-parens": false,
"no-any-union": false,
"no-boolean-literal-compare": false,
"no-conditional-assignment": false,
"no-consecutive-blank-lines": false,
"no-construct": false,
"no-declare-current-package": false,
"no-duplicate-imports": false,
"no-duplicate-variable": false,
"no-empty-interface": false,
"no-for-in-array": false,
"no-inferrable-types": false,
"no-internal-module": false,
"no-irregular-whitespace": false,
"no-mergeable-namespace": false,
"no-misused-new": false,
"no-namespace": false,
"no-object-literal-type-assertion": false,
"no-padding": false,
"no-redundant-jsdoc": false,
"no-redundant-jsdoc-2": false,
"no-redundant-undefined": false,
"no-reference-import": false,
"no-relative-import-in-test": false,
"no-self-import": false,
"no-single-declare-module": false,
"no-string-throw": false,
"no-unnecessary-callback-wrapper": false,
"no-unnecessary-class": false,
"no-unnecessary-generics": false,
"no-unnecessary-qualifier": false,
"no-unnecessary-type-assertion": false,
"no-useless-files": false,
"no-var-keyword": false,
"no-var-requires": false,
"no-void-expression": false,
"no-trailing-whitespace": false,
"object-literal-key-quotes": false,
"object-literal-shorthand": false,
"one-line": false,
"one-variable-per-declaration": false,
"only-arrow-functions": false,
"prefer-conditional-expression": false,
"prefer-const": false,
"prefer-declare-function": false,
"prefer-for-of": false,
"prefer-method-signature": false,
"prefer-template": false,
"radix": false,
"semicolon": false,
"space-before-function-paren": false,
"space-within-parens": false,
"strict-export-declare-modifiers": false,
"trim-file": false,
"triple-equals": false,
"typedef-whitespace": false,
"unified-signatures": false,
"void-return": false,
"whitespace": false
}
"extends": "dtslint/dt.json"
}
+1 -1
View File
@@ -616,7 +616,7 @@ declare namespace SocketIO {
* take an optional parameter, err, of a possible error
* @return This Socket
*/
join( name: string, fn?: ( err?: any ) => void ): Socket;
join( name: string|string[], fn?: ( err?: any ) => void ): Socket;
/**
* Leaves a room
+1 -1
View File
@@ -1322,7 +1322,7 @@ declare namespace Stripe {
/**
* ID of the default source attached to this customer. [Expandable]
*/
default_source: string | cards.ICard | bitcoinReceivers.IBitcoinReceiver;
default_source: string | cards.ICard | bitcoinReceivers.IBitcoinReceiver | null;
/**
* Whether or not the latest charge for the customer's latest invoice has failed
+1
View File
@@ -110,6 +110,7 @@ export function letterSpacing(...args: any[]): any;
*/
export type DisplayValue =
| "none"
| "inline"
| "block"
| "contents"
+1
View File
@@ -101,6 +101,7 @@ declare namespace request {
get(header: string): string;
header: any;
info: boolean;
links: object;
noContent: boolean;
notAcceptable: boolean;
notFound: boolean;
+2 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for unzipper 0.8
// Type definitions for unzipper 0.9
// Project: https://github.com/ZJONSSON/node-unzipper#readme
// Definitions by: s73obrien <https://github.com/s73obrien>
// Nate <https://github.com/natemara>
@@ -57,6 +57,7 @@ export function unzip(
): Entry;
export namespace Open {
function buffer(data: Buffer): Promise<CentralDirectory>;
function file(filename: string): Promise<CentralDirectory>;
function url(
request: ClientRequest,
+1
View File
@@ -41,3 +41,4 @@ createReadStream("http://example.org/path/to/archive.zip")
const dir1: Promise<CentralDirectory> = Open.file("Z:\\path\\to\\archive.zip");
const dir2: Promise<CentralDirectory> = Open.url(get("url/to/archive.zip"), {});
const dir3: Promise<CentralDirectory> = Open.s3("any", "any");
const dir4: Promise<CentralDirectory> = Open.buffer(Buffer.from('ZIPDATA'));