Skip to content

Commit

Permalink
chore: no changes required in persisted model
Browse files Browse the repository at this point in the history
No changes required in persisted model file.
Signed-off-by: Hage Yaapa <hage.yaapa@in.ibm.com>
  • Loading branch information
Hage Yaapa committed Feb 28, 2020
1 parent 273ce78 commit cca079f
Showing 1 changed file with 0 additions and 62 deletions.
62 changes: 0 additions & 62 deletions types/persisted-model.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import {Callback, Options, PromiseOrVoid} from './common';
import {ModelBase, ModelData} from './model';
import {Listener, OperationHookContext} from './observer-mixin';
import {Filter, Where} from './query';

/**
Expand Down Expand Up @@ -520,67 +519,6 @@ export declare class PersistedModel extends ModelBase {
* @returns {String} The `id` property name
*/
static getIdName(): string;

/**
* Register an asynchronous observer for the given operation (event).
*
* Example:
*
* Registers a `before save` observer for a given model.
*
* ```js
* MyModel.observe('before save', function filterProperties(ctx, next) {
if (ctx.options && ctx.options.skipPropertyFilter) return next();
if (ctx.instance) {
FILTERED_PROPERTIES.forEach(function(p) {
ctx.instance.unsetAttribute(p);
});
} else {
FILTERED_PROPERTIES.forEach(function(p) {
delete ctx.data[p];
});
}
next();
});
* ```
*
* @param {String} operation The operation name.
* @callback {function} listener The listener function. It will be invoked with
* `this` set to the model constructor, e.g. `User`.
*/
static observe(operation: string, handler: Listener<OperationHookContext<PersistedModelClass>>): void;

/**
* Unregister an asynchronous observer for the given operation (event).
*
* Example:
*
* ```js
* MyModel.removeObserver('before save', function removedObserver(ctx, next) {
// some logic user want to apply to the removed observer...
next();
});
* ```
*
* @param {String} operation The operation name.
* @callback {function} listener The listener function.
*/
static removeObserver(operation: string, handler: Listener<OperationHookContext<PersistedModelClass>>): void;

/**
* Unregister all asynchronous observers for the given operation (event).
*
* Example:
*
* Remove all observers connected to the `before save` operation.
*
* ```js
* MyModel.clearObservers('before save');
* ```
*
* @param {String} operation The operation name.
*/
static clearObservers(operation: string): void;
}

export type PersistedModelClass = typeof PersistedModel;

0 comments on commit cca079f

Please sign in to comment.