@types/memjs
Advanced tools
Comparing version 1.2.0 to 1.2.1
// Type definitions for memjs 1.2 | ||
// Project: http://github.com/memcachier/memjs | ||
// Definitions by: Zongmin Lei <https://github.com/leizongmin> | ||
// BendingBender <https://github.com/BendingBender> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -11,23 +12,25 @@ // TypeScript Version: 2.1 | ||
/** | ||
* `failoverTime` - how much to wait until retring a failed server. Default | ||
* is 60 seconds. | ||
* How many seconds to wait until retrying a failed server. | ||
* @default 60 | ||
*/ | ||
failoverTime?: number; | ||
/** | ||
* `retries` - the number of times to retry an operation in lieu of failures | ||
* (default 2) | ||
* The number of times to retry an operation in lieu of failures. | ||
* @default 2 | ||
*/ | ||
retries?: number; | ||
/** | ||
* `retry_delay` - default is 0.2 | ||
* @default 0.2 | ||
*/ | ||
retry_delay?: number; | ||
/** | ||
* `expires` - the default expiration in seconds to use (default 0 - never | ||
* expire). If `expires` is greater than 30 days (60 x 60 x 24 x 30), it is | ||
* The default expiration in seconds to use. A `0` means never expire, | ||
* if it is greater than 30 days (60 x 60 x 24 x 30), it is | ||
* treated as a UNIX time (number of seconds since January 1, 1970). | ||
* @default 0 | ||
*/ | ||
expires?: number; | ||
/** | ||
* `logger` - a logger object that responds to `log(string)` method calls. | ||
* A logger object that responds to `log(string)` method calls. | ||
* @default console | ||
*/ | ||
@@ -107,5 +110,6 @@ logger?: { | ||
*/ | ||
get(key: string): Promise<{ value: Buffer; flags: Buffer }>; | ||
get( | ||
key: string, | ||
callback: (err?: Error | null, value?: Buffer, flags?: Buffer) => void | ||
callback: (err: Error | null, value: Buffer | null, flags: Buffer | null) => void | ||
): void; | ||
@@ -130,2 +134,3 @@ | ||
*/ | ||
set(key: string, value: string | Buffer, options: { expires?: number }): Promise<boolean>; | ||
set( | ||
@@ -135,3 +140,3 @@ key: string, | ||
options: { expires?: number }, | ||
callback: (err?: Error | null, success?: boolean) => void | ||
callback: (err: Error | null, success: boolean | null) => void | ||
): void; | ||
@@ -157,2 +162,3 @@ | ||
*/ | ||
add(key: string, value: string | Buffer, options: { expires?: number }): Promise<boolean>; | ||
add( | ||
@@ -162,3 +168,3 @@ key: string, | ||
options: { expires?: number }, | ||
callback: (err?: Error | null, success?: boolean) => void | ||
callback: (err: Error | null, success: boolean | null) => void | ||
): void; | ||
@@ -184,2 +190,3 @@ | ||
*/ | ||
replace(key: string, value: string | Buffer, options: { expires?: number }): Promise<boolean>; | ||
replace( | ||
@@ -189,3 +196,3 @@ key: string, | ||
options: { expires?: number }, | ||
callback: (err?: Error | null, success?: boolean) => void | ||
callback: (err: Error | null, success: boolean | null) => void | ||
): void; | ||
@@ -205,6 +212,4 @@ | ||
*/ | ||
delete( | ||
key: string, | ||
callback: (err?: Error | null, success?: boolean) => void | ||
): void; | ||
delete(key: string): Promise<boolean>; | ||
delete(key: string, callback: (err: Error | null, success: boolean | null) => void): void; | ||
@@ -232,8 +237,9 @@ /** | ||
amount: number, | ||
options: { initial?: number; expires?: number } | ||
): Promise<{ success: boolean; value?: number | null }>; | ||
increment( | ||
key: string, | ||
amount: number, | ||
options: { initial?: number; expires?: number }, | ||
callback: ( | ||
err?: Error | null, | ||
success?: boolean, | ||
value?: number | ||
) => void | ||
callback: (err: Error | null, success: boolean | null, value?: number | null) => void | ||
): void; | ||
@@ -262,8 +268,9 @@ | ||
amount: number, | ||
options: { initial?: number; expires?: number } | ||
): Promise<{ success: boolean; value?: number | null }>; | ||
decrement( | ||
key: string, | ||
amount: number, | ||
options: { initial?: number; expires?: number }, | ||
callback: ( | ||
err?: Error | null, | ||
success?: boolean, | ||
value?: number | ||
) => void | ||
callback: (err: Error | null, success: boolean | null, value?: number | null) => void | ||
): void; | ||
@@ -283,6 +290,7 @@ | ||
*/ | ||
append(key: string, value: string | Buffer): Promise<boolean>; | ||
append( | ||
key: string, | ||
value: string | Buffer, | ||
callback: (err?: Error | null, success?: boolean) => void | ||
callback: (err: Error | null, success: boolean | null) => void | ||
): void; | ||
@@ -302,6 +310,7 @@ | ||
*/ | ||
prepend(key: string, value: string | Buffer): Promise<boolean>; | ||
prepend( | ||
key: string, | ||
value: string | Buffer, | ||
callback: (err?: Error | null, success?: boolean) => void | ||
callback: (err: Error | null, success: boolean | null) => void | ||
): void; | ||
@@ -321,6 +330,7 @@ | ||
*/ | ||
touch(key: string, expires: number): Promise<boolean>; | ||
touch( | ||
key: string, | ||
expires: number, | ||
callback: (err?: Error | null, success?: boolean) => void | ||
callback: (err: Error | null, success: boolean | null) => void | ||
): void; | ||
@@ -340,8 +350,4 @@ | ||
*/ | ||
flush( | ||
callback: ( | ||
err?: Error | null, | ||
results?: Record<string, boolean> | ||
) => void | ||
): void; | ||
flush(): Promise<Record<string, boolean>>; | ||
flush(callback: (err: Error | null, results: Record<string, boolean>) => void): void; | ||
@@ -363,10 +369,22 @@ /** | ||
key: string, | ||
callback: ( | ||
err?: Error | null, | ||
server?: string, | ||
stats?: Record<string, string> | ||
) => void | ||
callback?: (err: Error | null, server: string, stats: Record<string, string> | null) => void | ||
): void; | ||
/** | ||
* STATS | ||
* | ||
* Fetches memcache stats from each connected server. The callback is invoked | ||
* **ONCE PER SERVER** and has the signature: | ||
* | ||
* callback(err, server, stats) | ||
* | ||
* _server_ is the `"hostname:port"` of the server, and _stats_ is a | ||
* dictionary mapping the stat name to the value of the statistic as a string. | ||
* @param callback | ||
*/ | ||
stats( | ||
callback?: (err: Error | null, server: string, stats: Record<string, string> | null) => void | ||
): void; | ||
/** | ||
* RESET_STATS | ||
@@ -385,3 +403,5 @@ * | ||
*/ | ||
resetStats(callback: (err?: Error | null, server?: string) => void): void; | ||
resetStats( | ||
callback?: (err: Error | null, server: string, stats: Record<string, string> | null) => void | ||
): void; | ||
@@ -424,5 +444,5 @@ /** | ||
seq: number, | ||
callback: () => void, | ||
retries: number | ||
callback?: (err: Error | null, ...args: any[]) => void, | ||
retries?: number | ||
): void; | ||
} |
{ | ||
"name": "@types/memjs", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "TypeScript definitions for memjs", | ||
@@ -11,5 +11,11 @@ "license": "MIT", | ||
"githubUsername": "leizongmin" | ||
}, | ||
{ | ||
"name": "BendingBender", | ||
"url": "https://github.com/BendingBender", | ||
"githubUsername": "BendingBender" | ||
} | ||
], | ||
"main": "", | ||
"types": "index", | ||
"repository": { | ||
@@ -23,4 +29,4 @@ "type": "git", | ||
}, | ||
"typesPublisherContentHash": "48e0a3e50730792446ddc592100a0239d3b2bcf993ed8c068d60ccae89f23fe9", | ||
"typesPublisherContentHash": "aeb8151d47549f90dc0888b094dead94a8c07c398594c47e8b32e17d84125553", | ||
"typeScriptVersion": "2.1" | ||
} |
@@ -5,3 +5,3 @@ # Installation | ||
# Summary | ||
This package contains type definitions for memjs (http://github.com/memcachier/memjs). | ||
This package contains type definitions for memjs ( http://github.com/memcachier/memjs ). | ||
@@ -12,7 +12,7 @@ # Details | ||
Additional Details | ||
* Last updated: Fri, 03 Aug 2018 01:26:21 GMT | ||
* Dependencies: node | ||
* Last updated: Tue, 05 Feb 2019 01:15:44 GMT | ||
* Dependencies: @types/node | ||
* Global values: none | ||
# Credits | ||
These definitions were written by Zongmin Lei <https://github.com/leizongmin>. | ||
These definitions were written by Zongmin Lei <https://github.com/leizongmin>, BendingBender <https://github.com/BendingBender>. |
Sorry, the diff of this file is not supported yet
16213
408