diff --git a/types/cassandra-store/index.d.ts b/types/cassandra-store/index.d.ts new file mode 100644 index 0000000000..a329af6cfc --- /dev/null +++ b/types/cassandra-store/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for cassandra-store 5.0 +// Project: https://github.com/webcc/cassandra-store +// Definitions by: Ngo Quang Duong +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.7 + +/// + +import { Store } from 'express-session'; +import { ClientOptions, Client, EmptyCallback } from 'cassandra-driver'; + +interface CassandraStoreOptions { + table: string; + clientOptions: ClientOptions; + client?: Client | null; +} + +export = CassandraStore; + +declare class CassandraStore extends Store { + private _client: Client; + private _clientOptions: ClientOptions; + + constructor(opts: CassandraStoreOptions, callback?: EmptyCallback); + + get client(): Client; + + set client(value: Client); + + get clientOptions(): ClientOptions; + + set clientOptions(value: ClientOptions); + + get table(): string; + + set table(value: string); +} diff --git a/types/cassandra-store/package.json b/types/cassandra-store/package.json new file mode 100644 index 0000000000..faf8cad917 --- /dev/null +++ b/types/cassandra-store/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "cassandra-driver": "^4.3.0" + } +} diff --git a/types/cassandra-store/tsconfig.json b/types/cassandra-store/tsconfig.json new file mode 100644 index 0000000000..5d2a7f2f43 --- /dev/null +++ b/types/cassandra-store/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} \ No newline at end of file diff --git a/types/cassandra-store/tslint.json b/types/cassandra-store/tslint.json new file mode 100644 index 0000000000..b4b47a0378 --- /dev/null +++ b/types/cassandra-store/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}