3.1.5 • Published 6 months ago

@types/cancan v3.1.5

Weekly downloads
272
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for cancan 3.1
// Project: https://github.com/vadimdemedes/cancan
// Definitions by: Vincent Pang <https://github.com/Vincent-Pang>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4

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 | ReadonlyArray<string>,
             targets: T | ReadonlyArray<T> | string | ReadonlyArray<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: Thu, 08 Jul 2021 00:35:50 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Vincent Pang.

3.1.3

7 months ago

3.1.2

9 months ago

3.1.5

6 months ago

3.1.4

7 months ago

3.1.1

3 years ago

3.1.0

6 years ago