Skip to content

Commit

Permalink
docs(EventsChannel): additional code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrowhurstram committed Nov 27, 2016
1 parent 4e10719 commit 8f2870a
Showing 1 changed file with 40 additions and 37 deletions.
77 changes: 40 additions & 37 deletions src/core/public-interfaces.ts
Expand Up @@ -572,6 +572,10 @@ export interface IUnregistrationFunc {
* Supported events:
*
* * afterCreated - raised when a new instance of {@link INgTableParams} has finished being constructed
* * afterDataFiltered - raised when `ngTableDefaultGetData` instance filters data
* note: this event will not be raised when filtering is performed on server
* * afterDataSorted - raised when `ngTableDefaultGetData` instance orders data
* note: this event will not be raised when ordering is performed on server
* * afterReloadData - raised when the {@link INgTableParams} `reload` method has finished loading new data
* * datasetChanged - raised when {@link ISettings} `dataset` receives a new data array
* * pagesChanged - raised when a new pages array has been generated
Expand All @@ -598,49 +602,45 @@ export interface IEventsChannel {
*/
onAfterCreated(listener: IAfterCreatedListener, eventFilter?: IEventSelectorFunc): IUnregistrationFunc;
/**
* Subscribe to receive notification whenever the `reload` method of an `NgTableParams` instance has successfully executed
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a
* `scope` to have angular automatically unregister the listener when the `scope` is destroyed.
* Subscribe to receive notification whenever a `ngTableDefaultGetData` instance filters data
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called.
*
* @param listener the function that will be called when the event fires
* @param scope the angular `$scope` that will limit the lifetime of the event subscription
* @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event
* @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event
* @return a unregistration function that when called will unregister the `listener`
*/
onAfterReloadData<T>(listener: IAfterReloadDataListener<T>, scope: IScope, eventFilter?: EventSelector<T>): IUnregistrationFunc;
onAfterDataFiltered<T>(listener: IAfterDataFilteredListener<T>, scope: IScope, eventFilter?: EventSelector<T> ): IUnregistrationFunc;
/**
* Subscribe to receive notification whenever the `reload` method of an `NgTableParams` instance has successfully executed
* Subscribe to receive notification whenever a `ngTableDefaultGetData` instance filters data
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called.
*
* @param listener the function that will be called when the event fires
* @param eventFilter a predicate function that should return true to receive the event
* @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event
* @return a unregistration function that when called will unregister the `listener`
*/
onAfterReloadData<T>(listener: IAfterReloadDataListener<T>, eventFilter?: EventSelector<T>): IUnregistrationFunc;

onAfterDataFiltered<T>(listener: IAfterDataFilteredListener<T>, eventFilter?: EventSelector<T> ): IUnregistrationFunc;
/**
* Subscribe to receive notification whenever a new data rows *array* is supplied as a `settings` value to a `NgTableParams` instance.
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a
* `scope` to have angular automatically unregister the listener when the `scope` is destroyed.
* Subscribe to receive notification whenever a `ngTableDefaultGetData` instance orders data
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called.
*
* @param listener the function that will be called when the event fires
* @param scope the angular `$scope` that will limit the lifetime of the event subscription
* @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event
* @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event
* @return a unregistration function that when called will unregister the `listener`
*/
onDatasetChanged<T>(listener: IDatasetChangedListener<T>, scope: IScope, eventFilter?: EventSelector<T>): IUnregistrationFunc;
onAfterDataSorted<T>(listener: IAfterDataSortedListener<T>, scope: IScope, eventFilter?: EventSelector<T> ): IUnregistrationFunc;
/**
* Subscribe to receive notification whenever a new data rows *array* is supplied as a `settings` value to a `NgTableParams` instance.
* Subscribe to receive notification whenever a `ngTableDefaultGetData` instance orders data
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called.
*
* @param listener the function that will be called when the event fires
* @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event
* @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event
* @return a unregistration function that when called will unregister the `listener`
*/
onDatasetChanged<T>(listener: IDatasetChangedListener<T>, eventFilter?: EventSelector<T>): IUnregistrationFunc;

onAfterDataSorted<T>(listener: IAfterDataSortedListener<T>, eventFilter?: EventSelector<T> ): IUnregistrationFunc;
/**
* Subscribe to receive notification whenever the paging buttons for an `NgTableParams` instance change
* Subscribe to receive notification whenever the `reload` method of an `NgTableParams` instance has successfully executed
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a
* `scope` to have angular automatically unregister the listener when the `scope` is destroyed.
*
Expand All @@ -649,54 +649,57 @@ export interface IEventsChannel {
* @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event
* @return a unregistration function that when called will unregister the `listener`
*/
onPagesChanged<T>(listener: IPagesChangedListener, scope: IScope, eventFilter?: EventSelector<T>): IUnregistrationFunc;
onAfterReloadData<T>(listener: IAfterReloadDataListener<T>, scope: IScope, eventFilter?: EventSelector<T>): IUnregistrationFunc;
/**
* Subscribe to receive notification whenever the paging buttons for an `NgTableParams` instance change
* Subscribe to receive notification whenever the `reload` method of an `NgTableParams` instance has successfully executed
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called.
*
* @param listener the function that will be called when the event fires
* @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event
* @param eventFilter a predicate function that should return true to receive the event
* @return a unregistration function that when called will unregister the `listener`
*/
onPagesChanged<T>(listener: IPagesChangedListener, eventFilter?: EventSelector<T>): IUnregistrationFunc;
onAfterReloadData<T>(listener: IAfterReloadDataListener<T>, eventFilter?: EventSelector<T>): IUnregistrationFunc;
/**
* Subscribe to receive notification whenever a `ngTableDefaultGetData` instance filters data
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called.
* Subscribe to receive notification whenever a new data rows *array* is supplied as a `settings` value to a `NgTableParams` instance.
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a
* `scope` to have angular automatically unregister the listener when the `scope` is destroyed.
*
* @param listener the function that will be called when the event fires
* @param scope the angular `$scope` that will limit the lifetime of the event subscription
* @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event
* @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event
* @return a unregistration function that when called will unregister the `listener`
*/
onAfterDataFiltered<T>(listener: IAfterDataFilteredListener<T>, scope: IScope, eventFilter?: EventSelector<T> ): IUnregistrationFunc;
onDatasetChanged<T>(listener: IDatasetChangedListener<T>, scope: IScope, eventFilter?: EventSelector<T>): IUnregistrationFunc;
/**
* Subscribe to receive notification whenever a `ngTableDefaultGetData` instance filters data
* Subscribe to receive notification whenever a new data rows *array* is supplied as a `settings` value to a `NgTableParams` instance.
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called.
*
* @param listener the function that will be called when the event fires
* @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event
* @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event
* @return a unregistration function that when called will unregister the `listener`
*/
onAfterDataFiltered<T>(listener: IAfterDataFilteredListener<T>, eventFilter?: EventSelector<T> ): IUnregistrationFunc;
onDatasetChanged<T>(listener: IDatasetChangedListener<T>, eventFilter?: EventSelector<T>): IUnregistrationFunc;

/**
* Subscribe to receive notification whenever a `ngTableDefaultGetData` instance orders data
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called.
* Subscribe to receive notification whenever the paging buttons for an `NgTableParams` instance change
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a
* `scope` to have angular automatically unregister the listener when the `scope` is destroyed.
*
* @param listener the function that will be called when the event fires
* @param scope the angular `$scope` that will limit the lifetime of the event subscription
* @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event
* @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event
* @return a unregistration function that when called will unregister the `listener`
*/
onAfterDataSorted<T>(listener: IAfterDataSortedListener<T>, scope: IScope, eventFilter?: EventSelector<T> ): IUnregistrationFunc;
onPagesChanged<T>(listener: IPagesChangedListener, scope: IScope, eventFilter?: EventSelector<T>): IUnregistrationFunc;
/**
* Subscribe to receive notification whenever a `ngTableDefaultGetData` instance orders data
* Subscribe to receive notification whenever the paging buttons for an `NgTableParams` instance change
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called.
*
* @param listener the function that will be called when the event fires
* @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event
* @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event
* @return a unregistration function that when called will unregister the `listener`
*/
onAfterDataSorted<T>(listener: IAfterDataSortedListener<T>, eventFilter?: EventSelector<T> ): IUnregistrationFunc;
onPagesChanged<T>(listener: IPagesChangedListener, eventFilter?: EventSelector<T>): IUnregistrationFunc;

publishAfterCreated<T>(publisher: INgTableParams<T>): void;
publishAfterReloadData<T>(publisher: INgTableParams<T>, newData: T[], oldData: T[]): void;
Expand Down

0 comments on commit 8f2870a

Please sign in to comment.