mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
add types for @hapi/catbox-memcached (#42728)
This commit is contained in:
parent
ec7cccef2d
commit
fde43b408a
21
types/hapi__catbox-memcached/hapi__catbox-memcached-tests.ts
Normal file
21
types/hapi__catbox-memcached/hapi__catbox-memcached-tests.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import CatboxMemcached = require('@hapi/catbox-memcached');
|
||||
import { Server } from '@hapi/hapi';
|
||||
|
||||
new CatboxMemcached<string>();
|
||||
|
||||
const options: CatboxMemcached.Options = {
|
||||
host: 'test',
|
||||
port: 0,
|
||||
timeout: 0,
|
||||
idle: 0,
|
||||
partition: 'test',
|
||||
};
|
||||
|
||||
new Server({
|
||||
cache: {
|
||||
provider: {
|
||||
constructor: CatboxMemcached,
|
||||
options,
|
||||
},
|
||||
},
|
||||
});
|
||||
25
types/hapi__catbox-memcached/index.d.ts
vendored
Normal file
25
types/hapi__catbox-memcached/index.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// Type definitions for @hapi/catbox-memcached 3.0
|
||||
// Project: https://github.com/hapijs/catbox-memcached#readme
|
||||
// Definitions by: Avery Fay <https://github.com/btmorex>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { CacheKey, ClientApi, ClientOptions } from '@hapi/catbox';
|
||||
|
||||
declare namespace CatboxMemcached {
|
||||
interface Options extends ClientOptions {
|
||||
host?: string;
|
||||
port?: number;
|
||||
location?: string;
|
||||
timeout?: number;
|
||||
idle?: number;
|
||||
}
|
||||
}
|
||||
|
||||
interface CatboxMemcached<T> extends ClientApi<T> {}
|
||||
|
||||
declare class CatboxMemcached<T> implements ClientApi<T> {
|
||||
constructor(options?: CatboxMemcached.Options);
|
||||
generateKey(key: CacheKey): string;
|
||||
}
|
||||
|
||||
export = CatboxMemcached;
|
||||
25
types/hapi__catbox-memcached/tsconfig.json
Normal file
25
types/hapi__catbox-memcached/tsconfig.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"paths": {
|
||||
"@hapi/catbox": ["hapi__catbox"],
|
||||
"@hapi/catbox-memcached": ["hapi__catbox-memcached"],
|
||||
"@hapi/hapi": ["hapi__hapi"],
|
||||
"@hapi/joi": ["hapi__joi"],
|
||||
"@hapi/mimos": ["hapi__mimos"],
|
||||
"@hapi/podium": ["hapi__podium"],
|
||||
"@hapi/shot": ["hapi__shot"]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "hapi__catbox-memcached-tests.ts"]
|
||||
}
|
||||
1
types/hapi__catbox-memcached/tslint.json
Normal file
1
types/hapi__catbox-memcached/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user