mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
Add the missing Store instance to backbone-relational (#37926)
* Add tests for backbone-relational's exported Store instance * Add the missing store export to backbone-relational * Fix the typing of Store.unregister in backbone-relational * Disable use-default-type-parameter linter rule in backbone-relational The linter gives an unwarranted error: it complains that Model is the default type parameter of Collection on line 165, column 41 of the index.d.ts. While it is true that the default parameter is called Model, the type in question has been renamed to BModel in the current module. * Disable the linter rule in the correct way (see b1deb1c2)
This commit is contained in:
committed by
Andrew Casey
parent
e4a1a6437c
commit
e1498ebe71
@@ -109,4 +109,9 @@ alert('paul.livesIn=' + paul.get('livesIn'));
|
||||
var theirHouse = new House({ id: 'house-2' });
|
||||
paul.set({ 'livesIn': theirHouse });
|
||||
|
||||
alert('theirHouse.occupants=' + theirHouse.get('occupants').pluck('name'));
|
||||
alert('theirHouse.occupants=' + theirHouse.get('occupants').pluck('name'));
|
||||
|
||||
BackboneRel.store.removeModelScope(window);
|
||||
BackboneRel.store.addModelScope(window);
|
||||
BackboneRel.store.unregister(Person);
|
||||
BackboneRel.store.reset();
|
||||
|
||||
5
types/backbone-relational/index.d.ts
vendored
5
types/backbone-relational/index.d.ts
vendored
@@ -162,8 +162,11 @@ export class Store extends EventsMixin implements Events {
|
||||
|
||||
update(model:Model):void;
|
||||
|
||||
unregister(model:Model, collection:Collection<BModel>, options:any):void;
|
||||
// tslint:disable-next-line use-default-type-parameter
|
||||
unregister(type: Model | Collection<Model> | typeof Model): void;
|
||||
|
||||
reset():void;
|
||||
|
||||
}
|
||||
|
||||
export const store: Store;
|
||||
|
||||
Reference in New Issue
Block a user