mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Fixed bugs in angular-permission 2.3.6 type defintions.
This commit is contained in:
Vendored
+30
-15
@@ -30,8 +30,8 @@ declare module 'angular' {
|
||||
* @param validationFunction {Function} Function used to validate if permission is valid
|
||||
*/
|
||||
definePermission(
|
||||
name: string,
|
||||
validationFunction: (permission?: string, transitionProperties?: TransitionProperties) => boolean | angular.IPromise<any>
|
||||
permissionName: string,
|
||||
validationFunction: PermissionValidationFunction
|
||||
): void;
|
||||
|
||||
/**
|
||||
@@ -43,10 +43,14 @@ declare module 'angular' {
|
||||
* @param validationFunction {Function} Function used to validate if permission is valid
|
||||
*/
|
||||
defineManyPermissions(
|
||||
permissions: string[],
|
||||
validationFunction: (permission?: string, transitionProperties?: TransitionProperties) => boolean | angular.IPromise<any>
|
||||
permissionNames: string[],
|
||||
validationFunction: PermissionValidationFunction
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Removes all permissions
|
||||
* @method
|
||||
*/
|
||||
clearStore(): void;
|
||||
|
||||
/**
|
||||
@@ -55,7 +59,7 @@ declare module 'angular' {
|
||||
*
|
||||
* @param permissionName {String} Name of defined permission
|
||||
*/
|
||||
removePermissionDefinition(permission: string): void;
|
||||
removePermissionDefinition(permissionName: string): void;
|
||||
|
||||
/**
|
||||
* Checks if permission exists
|
||||
@@ -66,13 +70,21 @@ declare module 'angular' {
|
||||
*/
|
||||
hasPermissionDefinition(permissionName: string): boolean;
|
||||
|
||||
/**
|
||||
* Returns permission by it's name
|
||||
* @method
|
||||
*
|
||||
* @returns {permission.Permission} Permissions definition object
|
||||
*/
|
||||
getPermissionDefinition(permissionName: string): Permission;
|
||||
|
||||
/**
|
||||
* Returns all permissions
|
||||
* @method
|
||||
*
|
||||
* @returns {Object} Permissions collection
|
||||
*/
|
||||
getStore(): Permission[];
|
||||
getStore(): {[permissionName: string]: Permission};
|
||||
}
|
||||
|
||||
export interface RoleStore {
|
||||
@@ -85,8 +97,8 @@ declare module 'angular' {
|
||||
* @param [validationFunction] {Function} Function used to validate if permissions in role are valid
|
||||
*/
|
||||
defineRole(
|
||||
role: string,
|
||||
permissions: Array<string>,
|
||||
roleName: string,
|
||||
permissions: string[],
|
||||
validationFunction: RoleValidationFunction
|
||||
): void;
|
||||
|
||||
@@ -97,7 +109,10 @@ declare module 'angular' {
|
||||
* @param roleName {String} Name of defined role
|
||||
* @param permissions {Array} Set of permission names
|
||||
*/
|
||||
defineRole(role: string, permissions: Array<string>): void;
|
||||
defineRole(
|
||||
roleName: string,
|
||||
permissions: string[]
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Checks if role is defined in store
|
||||
@@ -106,7 +121,7 @@ declare module 'angular' {
|
||||
* @param roleName {String} Name of role
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
hasRoleDefinition(role: string): boolean;
|
||||
hasRoleDefinition(roleName: string): boolean;
|
||||
|
||||
/**
|
||||
* Returns role definition object by it's name
|
||||
@@ -136,7 +151,7 @@ declare module 'angular' {
|
||||
*
|
||||
* @returns {Object} Defined roles collection
|
||||
*/
|
||||
getStore(): Role[];
|
||||
getStore(): {[roleName: string]: Role};
|
||||
}
|
||||
|
||||
export interface Role {
|
||||
@@ -150,12 +165,12 @@ declare module 'angular' {
|
||||
validationFunction?: PermissionValidationFunction;
|
||||
}
|
||||
|
||||
interface RoleValidationFunction {
|
||||
(permission?: string, transitionProperties?: TransitionProperties): boolean | angular.IPromise<any>;
|
||||
export interface RoleValidationFunction {
|
||||
(roleName?: string, transitionProperties?: TransitionProperties): boolean | angular.IPromise<any>;
|
||||
}
|
||||
|
||||
interface PermissionValidationFunction {
|
||||
(permission?: string, transitionProperties?: TransitionProperties): boolean | angular.IPromise<any>;
|
||||
export interface PermissionValidationFunction {
|
||||
(permissionName?: string, transitionProperties?: TransitionProperties): boolean | angular.IPromise<any>;
|
||||
}
|
||||
|
||||
export interface IPermissionState extends angular.ui.IState {
|
||||
|
||||
Reference in New Issue
Block a user