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

3.1.5 • Public • Published

Installation

npm install --save @types/cancan

Summary

This package contains type definitions for cancan (https://github.com/vadimdemedes/cancan).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cancan.

index.d.ts

declare namespace CanCan {
    interface Option {
        instanceOf?: ((instance: any, model: any) => boolean) | undefined;
        createError?: (() => any) | undefined;
    }
}

declare class CanCan {
    constructor(options?: CanCan.Option);

    allow<T>(
        model: any,
        actions: string | readonly string[],
        targets: T | readonly T[] | string | readonly string[],
        condition?: object | ((performer: any, target: any, options?: any) => boolean),
    ): void;

    can(performer: any, action: string, target: any, options?: any): boolean;

    cannot(performer: any, action: string, target: any, options?: any): boolean;

    authorize(performer: any, action: string, target: any, options?: any): void;
}

export = CanCan;

Additional Details

  • Last updated: Mon, 20 Nov 2023 23:36:23 GMT
  • Dependencies: none

Credits

These definitions were written by Vincent Pang.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/cancan

Weekly Downloads

76

Version

3.1.5

License

MIT

Unpacked Size

4.03 kB

Total Files

5

Last publish

Collaborators

  • types