Add basic Backbone type definitions
This commit is contained in:
parent
9d84b2f420
commit
e07458d886
2 changed files with 18 additions and 0 deletions
11
ts/types/backbone/Collection.ts
Normal file
11
ts/types/backbone/Collection.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @prettier
|
||||
*/
|
||||
import { Model } from './Model';
|
||||
|
||||
export interface Collection<T> {
|
||||
models: Array<Model<T>>;
|
||||
// tslint:disable-next-line no-misused-new
|
||||
new(): Collection<T>;
|
||||
fetch(options: object): JQuery.Deferred<any, any, any>;
|
||||
}
|
7
ts/types/backbone/Model.ts
Normal file
7
ts/types/backbone/Model.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* @prettier
|
||||
*/
|
||||
|
||||
export interface Model<T> {
|
||||
toJSON(): T;
|
||||
}
|
Loading…
Reference in a new issue