Fixed passport-beam from comments

This commit is contained in:
AtlasDev
2016-10-04 21:08:04 +02:00
parent d5cd803691
commit dccbbbeb9b
4 changed files with 52 additions and 38 deletions
+32
View File
@@ -0,0 +1,32 @@
// Type definitions for passport-beam 1.0.4
// Project: https://github.com/alfw/passport-beam
// Definitions by: AtlasDev <https://github.com/AtlasDev>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../passport/passport.d.ts"/>
import * as passport from 'passport';
declare class Strategy<T> implements passport.Strategy {
constructor(options: Strategy.IStrategyOption, verify: (accessToken: string, refreshToken: string, profile: Strategy.Profile, done: (error: any, user?: any) => void) => void);
}
declare namespace Strategy {
interface IStrategyOption {
clientID: string;
clientSecret: string;
callbackURL: string;
}
interface Profile extends passport.Profile {
profileUrl: string;
id: number
username: string;
provider: string;
email: string;
_raw: string;
_json: any;
}
}
export Strategy;
+1 -1
View File
@@ -1,4 +1,4 @@
/// <reference path="./passport-beam.d.ts" />
/// <reference path="./index.d.ts" />
/**
* Created by AtlasDev on 4/10/2016.
-37
View File
@@ -1,37 +0,0 @@
// Type definitions for passport-beam 1.0.4
// Project: https://github.com/alfw/passport-beam
// Definitions by: AtlasDev <https://github.com/AtlasDev>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../passport/passport.d.ts"/>
declare module "passport-beam" {
import * as passport from 'passport';
import * as express from 'express';
interface Profile extends passport.Profile {
gender: string;
profileUrl: string;
id: number
username: string;
provider: string;
email: string;
_raw: string;
_json: any;
}
interface IStrategyOption {
clientID: string;
clientSecret: string;
callbackURL: string;
}
class Strategy implements passport.Strategy {
constructor(options: IStrategyOption, verify: (accessToken: string, refreshToken: string, profile: any, done: (error: any, user?: any) => void) => void);
name: string;
authenticate: (req: express.Request, options?: Object) => void;
}
}
+19
View File
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"passport-beam-tests.ts"
]
}