forked from nyambati/express-acl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
37 lines (35 loc) · 798 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { Response, Request, NextFunction } from "express";
interface configOptions {
baseUrl: string;
filename?: string;
path?: string;
rules?: Array<any>;
defaultRole?: string;
decodedObjectName?: string;
roleSearchPath?: string;
denyCallback?: (res?: Response) => {};
}
interface responseObj {
status: string;
message: string;
}
interface unlessOption {
path: Array<any>;
}
declare namespace expressacl {
export function config(
options: configOptions,
responseObj?: responseObj
): null;
namespace authorize {
export function unless(
config: unlessOption
): (req: Request, res: Response, next: NextFunction) => null;
}
export function authorize(
req: Request,
res: Response,
next: NextFunction
): null;
}
export = expressacl;