mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 11:02:11 +08:00
merge acl-mongodbBackend.d.ts and acl-redisBackend.d.ts into acl.d.ts
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/// <reference path='acl-mongodbBackend.d.ts'/>
|
||||
/// <reference path='acl.d.ts'/>
|
||||
|
||||
// https://github.com/OptimalBits/node_acl/blob/master/Readme.md
|
||||
import Acl = require('acl');
|
||||
@@ -14,4 +14,3 @@ acl.allow('guest', 'blogs', 'view');
|
||||
|
||||
// allow function accepts arrays as any parameter
|
||||
acl.allow('member', 'blogs', ['edit','view', 'delete']);
|
||||
|
||||
|
||||
22
acl/acl-mongodbBackend.d.ts
vendored
22
acl/acl-mongodbBackend.d.ts
vendored
@@ -1,22 +0,0 @@
|
||||
// Type definitions for node_acl 0.4.7
|
||||
// Project: https://github.com/optimalbits/node_acl
|
||||
// Definitions by: Qubo <https://github.com/tkQubo>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="acl.d.ts" />
|
||||
/// <reference path="../mongodb/mongodb.d.ts" />
|
||||
|
||||
declare module "acl" {
|
||||
import mongo = require('mongodb');
|
||||
|
||||
interface AclStatic {
|
||||
mongodbBackend: MongodbBackendStatic;
|
||||
}
|
||||
|
||||
interface MongodbBackend extends Backend<Callback> { }
|
||||
interface MongodbBackendStatic {
|
||||
new(db: mongo.Db, prefix: string, useSingle: boolean): MongodbBackend;
|
||||
new(db: mongo.Db, prefix: string): MongodbBackend;
|
||||
new(db: mongo.Db): MongodbBackend;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
/// <reference path='acl-redisBackend.d.ts'/>
|
||||
/// <reference path='acl.d.ts'/>
|
||||
|
||||
// https://github.com/OptimalBits/node_acl/blob/master/Readme.md
|
||||
import Acl = require('acl');
|
||||
|
||||
21
acl/acl-redisBackend.d.ts
vendored
21
acl/acl-redisBackend.d.ts
vendored
@@ -1,21 +0,0 @@
|
||||
// Type definitions for node_acl 0.4.7
|
||||
// Project: https://github.com/optimalbits/node_acl
|
||||
// Definitions by: Qubo <https://github.com/tkQubo>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="acl.d.ts" />
|
||||
/// <reference path='../redis/redis.d.ts'/>
|
||||
|
||||
declare module "acl" {
|
||||
import redis = require('redis');
|
||||
|
||||
interface AclStatic {
|
||||
redisBackend: RedisBackendStatic;
|
||||
}
|
||||
|
||||
interface RedisBackend extends Backend<redis.RedisClient> { }
|
||||
interface RedisBackendStatic {
|
||||
new(redis: redis.RedisClient, prefix: string): RedisBackend;
|
||||
new(redis: redis.RedisClient): RedisBackend;
|
||||
}
|
||||
}
|
||||
30
acl/acl.d.ts
vendored
30
acl/acl.d.ts
vendored
@@ -6,6 +6,9 @@
|
||||
/// <reference path="../bluebird/bluebird.d.ts" />
|
||||
/// <reference path='../node/node.d.ts'/>
|
||||
|
||||
/// <reference path='../redis/redis.d.ts'/>
|
||||
/// <reference path="../mongodb/mongodb.d.ts" />
|
||||
|
||||
declare module "acl" {
|
||||
import http = require('http');
|
||||
import Promise = require("bluebird");
|
||||
@@ -115,6 +118,33 @@ declare module "acl" {
|
||||
end: () => void;
|
||||
}
|
||||
|
||||
// for redis backend
|
||||
import redis = require('redis');
|
||||
|
||||
interface AclStatic {
|
||||
redisBackend: RedisBackendStatic;
|
||||
}
|
||||
|
||||
interface RedisBackend extends Backend<redis.RedisClient> { }
|
||||
interface RedisBackendStatic {
|
||||
new(redis: redis.RedisClient, prefix: string): RedisBackend;
|
||||
new(redis: redis.RedisClient): RedisBackend;
|
||||
}
|
||||
|
||||
// for mongodb backend
|
||||
import mongo = require('mongodb');
|
||||
|
||||
interface AclStatic {
|
||||
mongodbBackend: MongodbBackendStatic;
|
||||
}
|
||||
|
||||
interface MongodbBackend extends Backend<Callback> { }
|
||||
interface MongodbBackendStatic {
|
||||
new(db: mongo.Db, prefix: string, useSingle: boolean): MongodbBackend;
|
||||
new(db: mongo.Db, prefix: string): MongodbBackend;
|
||||
new(db: mongo.Db): MongodbBackend;
|
||||
}
|
||||
|
||||
var _: AclStatic;
|
||||
export = _;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user