mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-21 13:27:15 +08:00
Updated Table type to support generics
This commit is contained in:
16
types/massive/index.d.ts
vendored
16
types/massive/index.d.ts
vendored
@@ -44,16 +44,16 @@ declare namespace massive {
|
||||
term: string;
|
||||
}
|
||||
|
||||
interface Table {
|
||||
find(criteria: object | {}, queryOptions?: QueryOptions): Promise<object[]>;
|
||||
findOne(criteria: number | object, queryOptions?: QueryOptions): Promise<object>;
|
||||
interface Table<T> {
|
||||
find(criteria: object | {}, queryOptions?: QueryOptions): Promise<T[]>;
|
||||
findOne(criteria: number | object, queryOptions?: QueryOptions): Promise<T>;
|
||||
count(criteria: object): Promise<string>;
|
||||
where(query: string, params: any[] | object): Promise<object[]>;
|
||||
where(query: string, params: any[] | object): Promise<T[]>;
|
||||
search(criteria: SearchCriteria, queryOptions?: QueryOptions): Promise<any>;
|
||||
save(data: object): Promise<object[]>;
|
||||
insert(data: object): Promise<object[]>;
|
||||
update(dataOrCriteria: object, changesMap?: object): Promise<object[]>;
|
||||
destroy(criteria: object): Promise<object[]>;
|
||||
save(data: object): Promise<T[]>;
|
||||
insert(data: object): Promise<T[]>;
|
||||
update(dataOrCriteria: object, changesMap?: object): Promise<T[]>;
|
||||
destroy(criteria: object): Promise<T[]>;
|
||||
}
|
||||
|
||||
interface Document {
|
||||
|
||||
Reference in New Issue
Block a user