Skip to content

Commit

Permalink
feat(typescript): add ICollectionObserverSplice definition
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathaneckman authored and jdanyow committed Jan 9, 2018
1 parent e487cae commit 4e1244e
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/aurelia-binding.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,28 @@ export declare interface CollectionObserver {
/**
* Subscribe to collection mutation events.
*/
subscribe(callback: (changeRecords: any) => void): Disposable;
subscribe(callback: (changeRecords: Array<ICollectionObserverSplice<any>>) => void): Disposable;
}

/**
* The change record of a collection mutation.
*/
export declare interface ICollectionObserverSplice<T = any> {

/**
* Number of items added to the collection.
*/
addedCount: number;

/**
* The position at which the items were added.
*/
index: number;

/**
* A collection of items that were removed from the collection.
*/
removed: Array<T>;
}

/**
Expand Down Expand Up @@ -732,4 +753,4 @@ export declare function connectBindingToSignal(binding: Binding, name: string):
* Signals all bindings that are associated with the specified signal name.
* @param name The signal associated with the binding(s) to refresh.
*/
export declare function signalBindings(name: string): void;
export declare function signalBindings(name: string): void;

0 comments on commit 4e1244e

Please sign in to comment.