diff --git a/types/persisted-model.d.ts b/types/persisted-model.d.ts index ed0461722..a5e1b5cb1 100644 --- a/types/persisted-model.d.ts +++ b/types/persisted-model.d.ts @@ -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'; /** @@ -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>): 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>): 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;