mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
🤖 Merge PR #45029 [@types/backbone] [backbone-1.4] Add iterator methods to Backbone.Collection by @jakubadamw
This commit is contained in:
parent
a9afdd9eb6
commit
b9418476d9
@ -287,6 +287,14 @@ function test_collection() {
|
||||
models = books.slice(1);
|
||||
models = books.slice(1, 3);
|
||||
|
||||
let it1: Iterator<Book>;
|
||||
it1 = books.values();
|
||||
it1 = books[Symbol.iterator]();
|
||||
let it2: Iterator<any>;
|
||||
it2 = books.keys();
|
||||
let it3: Iterator<[any, Book]>;
|
||||
it3 = books.entries();
|
||||
|
||||
// underscore methods
|
||||
bool = books.all((value: Book, index: number, list: Book[]) => true);
|
||||
bool = books.any((value: Book, index: number, list: Book[]) => true);
|
||||
|
||||
5
types/backbone/index.d.ts
vendored
5
types/backbone/index.d.ts
vendored
@ -376,6 +376,11 @@ declare namespace Backbone {
|
||||
findWhere(properties: any): TModel;
|
||||
modelId(attrs: any) : any
|
||||
|
||||
values(): Iterator<TModel>;
|
||||
keys(): Iterator<any>;
|
||||
entries(): Iterator<[any, TModel]>;
|
||||
[Symbol.iterator](): Iterator<TModel>;
|
||||
|
||||
private _prepareModel(attributes?: any, options?: any): any;
|
||||
private _removeReference(model: TModel): void;
|
||||
private _onModelEvent(event: string, model: TModel, collection: Collection<TModel>, options: any): void;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user