mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 20:21:46 +00:00
Added declarations for 'passport-discord'.
This commit is contained in:
Vendored
+75
@@ -0,0 +1,75 @@
|
||||
// Type definitions for passport-discord 0.1
|
||||
// Project: https://github.com/nicholastay/passport-discord#readme
|
||||
// Definitions by: My Self <https://github.com/me>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/** Declaration file generated by dts-gen */
|
||||
|
||||
export = passport_discord;
|
||||
|
||||
declare class passport_discord {
|
||||
constructor(options: any, verify: any);
|
||||
|
||||
authorizationParams(options: any): any;
|
||||
|
||||
checkScope(scope: any, accessToken: any, cb: any): any;
|
||||
|
||||
userProfile(accessToken: any, done: any): any;
|
||||
|
||||
static Strategy: any;
|
||||
|
||||
}
|
||||
|
||||
declare namespace passport_discord {
|
||||
namespace prototype {
|
||||
function authenticate(req: any, options: any): any;
|
||||
|
||||
function authorizationParams(options: any): any;
|
||||
|
||||
function checkScope(scope: any, accessToken: any, cb: any): any;
|
||||
|
||||
function parseErrorResponse(body: any, status: any): any;
|
||||
|
||||
function tokenParams(options: any): any;
|
||||
|
||||
function userProfile(accessToken: any, done: any): any;
|
||||
|
||||
namespace authenticate {
|
||||
const prototype: {
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace authorizationParams {
|
||||
const prototype: {
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace checkScope {
|
||||
const prototype: {
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace parseErrorResponse {
|
||||
const prototype: {
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace tokenParams {
|
||||
const prototype: {
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace userProfile {
|
||||
const prototype: {
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Created by kzaY on 07/09/2017.
|
||||
*/
|
||||
import passport = require('passport');
|
||||
import discord = require('passport-discord');
|
||||
|
||||
// just some test model
|
||||
let User = {
|
||||
findOrCreate(discordId: any, callback: (err: any, user: any) => void): void {
|
||||
callback(null, { username: 'james' });
|
||||
}
|
||||
};
|
||||
|
||||
passport.use(new discord.Strategy(
|
||||
{
|
||||
clientID: 'id',
|
||||
clientSecret: 'secret',
|
||||
callbackURL: 'callbackURL'
|
||||
},
|
||||
(accessToken: string, refreshToken: string, profile: any, cb: any) => {
|
||||
User.findOrCreate({ discordId: profile.id }, (err, user) => {
|
||||
return cb(err, user);
|
||||
});
|
||||
}
|
||||
));
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"passport-discord-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// This package uses the Function type, and it will take effort to fix.
|
||||
"ban-types": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user