From 4ec7a6b59bf208fa631398ef5f7cb9924a3740e4 Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Sun, 2 Dec 2018 13:04:25 -0800 Subject: [PATCH] re-emable most dts-lint errors --- types/cassanknex/index.d.ts | 176 +++++++++++++++++------------------ types/cassanknex/tslint.json | 15 +-- 2 files changed, 92 insertions(+), 99 deletions(-) diff --git a/types/cassanknex/index.d.ts b/types/cassanknex/index.d.ts index b9b75e92e6..fd7f9c53f4 100644 --- a/types/cassanknex/index.d.ts +++ b/types/cassanknex/index.d.ts @@ -11,7 +11,7 @@ import { Client, ClientOptions, types, ResultCallback } from "cassandra-driver"; import * as Long from "long"; import { Readable } from "stream"; -declare function CassanKnex (options?: CassanKnex.DriverOptions): CassanKnex.CassanKnex; +declare function CassanKnex(options?: CassanKnex.DriverOptions): CassanKnex.CassanKnex; export = CassanKnex; @@ -49,134 +49,134 @@ declare namespace CassanKnex { } interface QueryBuilderRoot { - insert (values: Partial | T): InsertQueryBuilder; - select (...columns: Array): SelectQueryBuilder; - select (values: SelectAsClause): SelectQueryBuilder; - update (table: string): UpdateQueryBuilder; - delete (): DeleteQueryBuilder; - alterColumnFamily (columnFamily: string): AlterColumnFamilyQueryBuilder; - createColumnFamily (columnFamily: string): CreateColumnFamilyQueryBuilder; - createColumnFamilyIfNotExists (columnFamily: string): CreateColumnFamilyQueryBuilder; - createIndex (columnFamily: string, indexName: string, column: keyof T): QueryBuilder; - createIndexCustom (columnFamily: string, indexName: string, column: keyof T): QueryBuilder & CreateableIndexBuilder; - createType (typeName: string): CreateTypeQueryBuilder; - createTypeIfNotExists (typeName: string): CreateTypeQueryBuilder; - dropColumnFamily (columnFamily: string): QueryBuilder; - dropColumnFamilyIfExists (columnFamily: string): QueryBuilder; - dropType (): QueryBuilder; - dropTypeIfExists (): QueryBuilder; - truncate (columnFamily: string): QueryBuilder; - alterKeyspace (keyspace: string): KeyspaceQueryBuilder; - createKeyspace (keyspace: string): KeyspaceQueryBuilder; - createKeyspaceIfNotExists (keyspace: string): KeyspaceQueryBuilder; - dropKeyspace (): QueryBuilder; - dropKeyspaceIfExists (): QueryBuilder; + insert (values: Partial | T): InsertQueryBuilder; + select (...columns: Array): SelectQueryBuilder; + select (values: SelectAsClause): SelectQueryBuilder; + update (table: string): UpdateQueryBuilder; + delete (): DeleteQueryBuilder; + alterColumnFamily (columnFamily: string): AlterColumnFamilyQueryBuilder; + createColumnFamily (columnFamily: string): CreateColumnFamilyQueryBuilder; + createColumnFamilyIfNotExists (columnFamily: string): CreateColumnFamilyQueryBuilder; + createIndex (columnFamily: string, indexName: string, column: keyof T): QueryBuilder; + createIndexCustom (columnFamily: string, indexName: string, column: keyof T): QueryBuilder & CreateableIndexBuilder; + createType (typeName: string): CreateTypeQueryBuilder; + createTypeIfNotExists (typeName: string): CreateTypeQueryBuilder; + dropColumnFamily(columnFamily: string): QueryBuilder; + dropColumnFamilyIfExists(columnFamily: string): QueryBuilder; + dropType(): QueryBuilder; + dropTypeIfExists(): QueryBuilder; + truncate(columnFamily: string): QueryBuilder; + alterKeyspace(keyspace: string): KeyspaceQueryBuilder; + createKeyspace(keyspace: string): KeyspaceQueryBuilder; + createKeyspaceIfNotExists(keyspace: string): KeyspaceQueryBuilder; + dropKeyspace(): QueryBuilder; + dropKeyspaceIfExists(): QueryBuilder; } interface QueryBuilder { - cql (): string; - bindings (): any[]; - exec (cb: ResultCallback): undefined; - eachRow (onEachRow: (n: number, row: types.Row) => any, onError: (err: Error) => any): undefined; - stream (params: StreamParams): undefined; + cql(): string; + bindings(): any[]; + exec(cb: ResultCallback): undefined; + eachRow(onEachRow: (n: number, row: types.Row) => any, onError: (err: Error) => any): undefined; + stream(params: StreamParams): undefined; } interface FieldValueQueryBuilder { - decimal (columnName: K): TypeMatchedValue; - boolean (columnName: K): TypeMatchedValue; - blob (columnName: K): TypeMatchedValue; - timestamp (columnName: K): TypeMatchedValue; - date (columnName: K): TypeMatchedValue; - inet (columnName: K): TypeMatchedValue; - bigint (columnName: K): TypeMatchedValue; - counter (columnName: K): TypeMatchedValue; - double (columnName: K): TypeMatchedValue; - int (columnName: K): TypeMatchedValue; - float (columnName: K): TypeMatchedValue; - map (columnName: K, a: A, b: B): TypeMatchedValue, this>; - ascii (columnName: K): TypeMatchedValue; - text (columnName: K): TypeMatchedValue; - timeuuid (columnName: K): TypeMatchedValue; - uuid (columnName: K): TypeMatchedValue; - varchar (columnName: K): TypeMatchedValue; - list (columnName: K, typeName: string): TypeMatchedValue; - primary (primaryKey: string): this; - set (columnName: K, a: A): TypeMatchedValue, this>; + decimal (columnName: K): TypeMatchedValue; + boolean (columnName: K): TypeMatchedValue; + blob (columnName: K): TypeMatchedValue; + timestamp (columnName: K): TypeMatchedValue; + date (columnName: K): TypeMatchedValue; + inet (columnName: K): TypeMatchedValue; + bigint (columnName: K): TypeMatchedValue; + counter (columnName: K): TypeMatchedValue; + double (columnName: K): TypeMatchedValue; + int (columnName: K): TypeMatchedValue; + float (columnName: K): TypeMatchedValue; + map (columnName: K, a: A, b: B): TypeMatchedValue, this>; + ascii (columnName: K): TypeMatchedValue; + text (columnName: K): TypeMatchedValue; + timeuuid (columnName: K): TypeMatchedValue; + uuid (columnName: K): TypeMatchedValue; + varchar (columnName: K): TypeMatchedValue; + list (columnName: K, typeName: string): TypeMatchedValue; + primary(primaryKey: string): this; + set (columnName: K, a: A): TypeMatchedValue, this>; } interface CreateableColumnFamilyBuilder { - withCaching (): this; - withCompression (): this; - withCompaction (): this; - withClusteringOrderBy (value: K, direction: 'desc' | 'asc'): this; + withCaching(): this; + withCompression(): this; + withCompaction(): this; + withClusteringOrderBy (value: K, direction: 'desc' | 'asc'): this; } interface CreateableIndexBuilder { - withOptions (opts: MappedDict): this; + withOptions(opts: MappedDict): this; } interface KeyspaceableQueryBuilder { - withNetworkTopologyStrategy (strategy: MappedDict): this; - withSimpleStrategy (replicas: number): this; - withDurableWrites (durableWrites: boolean): this; + withNetworkTopologyStrategy(strategy: MappedDict): this; + withSimpleStrategy(replicas: number): this; + withDurableWrites(durableWrites: boolean): this; } interface InsertableQueryBuilder { - into (table: string): this; - ifNotExists (): this; + into(table: string): this; + ifNotExists(): this; } interface TtlableQueryBuilder { - usingTimestamp (timestamp: number): this; - usingTTL (ttl: number): this; + usingTimestamp(timestamp: number): this; + usingTTL(ttl: number): this; } interface WhereableQueryBuilder { - where (lhs: K, comparison: InRestriction, rhs: Array): this; - where (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; - orWhere (lhs: K, comparison: InRestriction, rhs: Array): this; - orWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; - andWhere (lhs: K, comparison: InRestriction, rhs: Array): this; - andWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; - tokenWhere (lhs: K, comparison: InRestriction, rhs: Array): this; - tokenWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; - ttl (columnName: K): this; + where (lhs: K, comparison: InRestriction, rhs: Array): this; + where (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + orWhere (lhs: K, comparison: InRestriction, rhs: Array): this; + orWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + andWhere (lhs: K, comparison: InRestriction, rhs: Array): this; + andWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + tokenWhere (lhs: K, comparison: InRestriction, rhs: Array): this; + tokenWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + ttl (columnName: K): this; } interface IfableQueryBuilder { - if (lhs: K, comparison: ComparisonRestriction, rhs: T[K] | null): this; + if (lhs: K, comparison: ComparisonRestriction, rhs: T[K] | null): this; } interface LimitableQueryBuilder { - limit (limit: number): this; - limitPerPartition (limit: number): this; + limit(limit: number): this; + limitPerPartition(limit: number): this; } interface FromableQueryBuilder { - from (table: string): this; + from(table: string): this; } interface UpdateableQueryBuilder { - set (key: K, value: T[K]): this; - set (object: Partial): this; - add (key: K, value: { [str: string]: T[K] }): TypeMatchedValue, this>; - add (key: K, value: Array): TypeMatchedValue, this>; - add (object: Partial): this; - remove (key: K, value: Array): this; - remove (object: Partial): this; - increment (column: keyof T, amount: number): this; - increment (object: Partial): this; - decrement (column: keyof T, amount: number): this; - decrement (object: Partial): this; + set (key: K, value: T[K]): this; + set(object: Partial): this; + add (key: K, value: { [str: string]: T[K] }): TypeMatchedValue, this>; + add (key: K, value: Array): TypeMatchedValue, this>; + add(object: Partial): this; + remove (key: K, value: Array): this; + remove(object: Partial): this; + increment(column: keyof T, amount: number): this; + increment(object: Partial): this; + decrement(column: keyof T, amount: number): this; + decrement(object: Partial): this; } interface AlterableQueryBuilder { - drop (...columns: K[]): this; - rename (column: K, newColumn: K): this; - alter (column: K, newType: string): this; + drop (...columns: K[]): this; + rename (column: K, newColumn: K): this; + alter (column: K, newType: string): this; } - type InsertQueryBuilder = QueryBuilder + type InsertQueryBuilder = QueryBuilder & InsertableQueryBuilder & TtlableQueryBuilder; type SelectQueryBuilder = QueryBuilder diff --git a/types/cassanknex/tslint.json b/types/cassanknex/tslint.json index 978a6cf2fc..4074d3cece 100644 --- a/types/cassanknex/tslint.json +++ b/types/cassanknex/tslint.json @@ -1,14 +1,7 @@ { "extends": "dtslint/dt.json", - "rules": { - "space-before-function-paren": [true, "always"], - "no-unnecessary-generics": false, - "strict-export-declare-modifiers": false, - "prefer-readonly": false, - "await-promise": false, - "no-for-in-array": false, - "no-void-expression": false, - "expect": true, - "no-declare-current-package": false - } + "rules": { + "no-unnecessary-generics": false, + "strict-export-declare-modifiers": false + } } \ No newline at end of file