@types/easy-rbac
TypeScript icon, indicating that this package has built-in type declarations

3.1.5 • Public • Published

Installation

npm install --save @types/easy-rbac

Summary

This package contains type definitions for easy-rbac (https://github.com/DeadAlready/easy-rbac).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/easy-rbac.

index.d.ts

interface RoleObject {
    name: string;
    when: (params: object) => Promise<boolean>;
}

interface Roles {
    [key: string]: {
        can: Array<string | RoleObject>;
        inherits?: string[] | undefined;
    };
}

type Options = Roles | (() => Promise<Roles>) | Promise<Roles>;

declare class RBAC {
    constructor(opts: Options);
    can(role: string | string[] | Roles[], operation: string, params?: object): Promise<boolean>;
    static create(opts: Options): RBAC;
}

export = RBAC;

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: none

Credits

These definitions were written by .

Readme

Keywords

none

Package Sidebar

Install

npm i @types/easy-rbac

Weekly Downloads

1,178

Version

3.1.5

License

MIT

Unpacked Size

3.33 kB

Total Files

5

Last publish

Collaborators

  • types