diff --git a/.gitignore b/.gitignore index 5b79863e52..bf7fc48845 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ node_modules .vs .vscode yarn.lock +.idea diff --git a/types/loopback/index.d.ts b/types/loopback/index.d.ts index adb14ae209..e4c31c7f8d 100644 --- a/types/loopback/index.d.ts +++ b/types/loopback/index.d.ts @@ -11,6 +11,7 @@ ************************************************/ import * as core from "express-serve-static-core"; +import { NextFunction } from "express"; declare function l(): l.LoopBackApplication; declare namespace l { @@ -886,6 +887,18 @@ declare namespace l { * See [Setting up a custom model](docs.strongloop.com/display/LB/Extending+built-in+models#Extendingbuilt-inmodels-Settingupacustommodel) */ static setup(): void; + + /** + * loopback 3.x Remote hooks + * http://loopback.io/doc/en/lb3/Remote-hooks.html + * @param method + * @param backback + */ + beforeRemote(method: string, callback: (ctx: Context, modelInstanceOrNext: Model | NextFunction, next?: NextFunction) => void): void; + + afterRemote(method: string, callback: (ctx: Context, modelInstanceOrNext: Model | NextFunction, next?: NextFunction) => void): void; + + afterRemoteError(method: string, callback: NextFunction): void; } /**