add loopback Remote hooks definitely types

This commit is contained in:
richardgong1987
2017-04-24 09:28:52 +08:00
parent 0691dc0101
commit 6292510edd
2 changed files with 21 additions and 0 deletions
+1
View File
@@ -41,3 +41,4 @@ node_modules
.vs
.vscode
yarn.lock
.idea
+20
View File
@@ -11,6 +11,7 @@
************************************************/
import * as core from "express-serve-static-core";
import {NextFunction} from "../express-serve-static-core/index";
declare function l(): l.LoopBackApplication;
declare namespace l {
@@ -886,8 +887,27 @@ declare namespace l {
* See [Setting up a custom model](docs.strongloop.com/display/LB/Extending+built-in+models#Extendingbuilt-inmodels-Settingupacustommodel)
*/
static setup(): void;
static setup(): void;
/**
* loopback 3.x Remote hooks
* http://loopback.io/doc/en/lb3/Remote-hooks.html
* @param method
* @param fn
*/
beforeRemote(method: string, backback: (ctx: Context, modelInstanceOrNext: Model
| NextFunction, next?: NextFunction)=>void): void;
afterRemote(method: string, backback: (ctx: Context, modelInstanceOrNext: Model
| NextFunction, next?: NextFunction) => void): void;
afterRemoteError(method: string, next: NextFunction): void;
}
/**
* SharedClass
* Create a new SharedClass with the given options.