mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 20:02:05 +08:00
imperium: Fix typescript errors
This commit is contained in:
14
types/imperium/index.d.ts
vendored
14
types/imperium/index.d.ts
vendored
@@ -8,11 +8,11 @@
|
||||
|
||||
import express = require('express');
|
||||
|
||||
type GetAcl = (req: express.Request) => Promise<boolean> | Promise<object>;
|
||||
type Actions = string[] | string;
|
||||
type Context = Array<'params' | 'query' | 'headers' | 'body'>;
|
||||
export type GetAcl = (req: express.Request) => Promise<boolean> | Promise<object>;
|
||||
export type Actions = string[] | string;
|
||||
export type Context = Array<'params' | 'query' | 'headers' | 'body'>;
|
||||
// Can contain when key that is evaluated during route action
|
||||
interface RoleParams {
|
||||
export interface RoleParams {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
@@ -62,16 +62,16 @@ export class Imperium {
|
||||
evaluateUserAction(action: RoleParams, context: { [key: string]: string[] }): { [key: string]: string[] };
|
||||
}
|
||||
|
||||
interface Roles {
|
||||
export interface Roles {
|
||||
[key: string]: RoleActions;
|
||||
}
|
||||
|
||||
interface RoleActions {
|
||||
export interface RoleActions {
|
||||
actions: Action[];
|
||||
getAcl?: GetAcl;
|
||||
}
|
||||
|
||||
interface Action {
|
||||
export interface Action {
|
||||
action: string;
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user