@types/passport
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -7,99 +7,98 @@ // Type definitions for Passport 0.4 | ||
declare namespace Express { | ||
export interface Request { | ||
authInfo?: any; | ||
user?: any; | ||
declare global { | ||
namespace Express { | ||
interface Request { | ||
authInfo?: any; | ||
user?: any; | ||
// These declarations are merged into express's Request type | ||
login(user: any, done: (err: any) => void): void; | ||
login(user: any, options: any, done: (err: any) => void): void; | ||
logIn(user: any, done: (err: any) => void): void; | ||
logIn(user: any, options: any, done: (err: any) => void): void; | ||
// These declarations are merged into express's Request type | ||
login(user: any, done: (err: any) => void): void; | ||
login(user: any, options: any, done: (err: any) => void): void; | ||
logIn(user: any, done: (err: any) => void): void; | ||
logIn(user: any, options: any, done: (err: any) => void): void; | ||
logout(): void; | ||
logOut(): void; | ||
logout(): void; | ||
logOut(): void; | ||
isAuthenticated(): boolean; | ||
isUnauthenticated(): boolean; | ||
isAuthenticated(): boolean; | ||
isUnauthenticated(): boolean; | ||
} | ||
} | ||
} | ||
declare module 'passport' { | ||
import express = require('express'); | ||
import express = require('express'); | ||
namespace passport { | ||
interface AuthenticateOptions { | ||
authInfo?: boolean; | ||
assignProperty?: string; | ||
failureFlash?: string|boolean|any; | ||
failureMessage?: boolean|string; | ||
failureRedirect?: string; | ||
failWithError?: boolean; | ||
session?: boolean; | ||
scope?: string|string[]; | ||
successFlash?: string|boolean|any; | ||
successMessage?: boolean|string; | ||
successRedirect?: string; | ||
successReturnToOrRedirect?: string; | ||
pauseStream?: boolean; | ||
userProperty?: string; | ||
passReqToCallback?: boolean; | ||
} | ||
declare namespace passport { | ||
interface AuthenticateOptions { | ||
authInfo?: boolean; | ||
assignProperty?: string; | ||
failureFlash?: string|boolean; | ||
failureMessage?: boolean|string; | ||
failureRedirect?: string; | ||
failWithError?: boolean; | ||
session?: boolean; | ||
scope?: string|string[]; | ||
successFlash?: string|boolean; | ||
successMessage?: boolean|string; | ||
successRedirect?: string; | ||
successReturnToOrRedirect?: string; | ||
pauseStream?: boolean; | ||
userProperty?: string; | ||
passReqToCallback?: boolean; | ||
} | ||
interface Passport { | ||
use(strategy: passport.Strategy): this; | ||
use(name: string, strategy: passport.Strategy): this; | ||
unuse(name: string): this; | ||
framework(fw: passport.Framework): this; | ||
initialize(options?: { userProperty: string; }): express.Handler; | ||
session(options?: { pauseStream: boolean; }): express.Handler; | ||
interface Passport { | ||
use(strategy: Strategy): this; | ||
use(name: string, strategy: Strategy): this; | ||
unuse(name: string): this; | ||
framework(fw: Framework): this; | ||
initialize(options?: { userProperty: string; }): express.Handler; | ||
session(options?: { pauseStream: boolean; }): express.Handler; | ||
authenticate(strategy: string|string[], callback?: Function): express.Handler; | ||
authenticate(strategy: string|string[], options: AuthenticateOptions, callback?: Function): express.Handler; | ||
authorize(strategy: string|string[], callback?: Function): express.Handler; | ||
authorize(strategy: string|string[], options: any, callback?: Function): express.Handler; | ||
serializeUser<TUser, TID>(fn: (user: TUser, done: (err: any, id?: TID) => void) => void): void; | ||
deserializeUser<TUser, TID>(fn: (id: TID, done: (err: any, user?: TUser) => void) => void): void; | ||
transformAuthInfo(fn: (info: any, done: (err: any, info: any) => void) => void): void; | ||
} | ||
authenticate(strategy: string|string[], callback?: (...args: any[]) => any): express.Handler; | ||
authenticate(strategy: string|string[], options: AuthenticateOptions, callback?: (...args: any[]) => any): express.Handler; | ||
authorize(strategy: string|string[], callback?: (...args: any[]) => any): express.Handler; | ||
authorize(strategy: string|string[], options: any, callback?: (...args: any[]) => any): express.Handler; | ||
serializeUser<TUser, TID>(fn: (user: TUser, done: (err: any, id?: TID) => void) => void): void; | ||
deserializeUser<TUser, TID>(fn: (id: TID, done: (err: any, user?: TUser) => void) => void): void; | ||
transformAuthInfo(fn: (info: any, done: (err: any, info: any) => void) => void): void; | ||
} | ||
interface PassportStatic extends Passport { | ||
Passport: {new(): Passport}; | ||
Authenticator: {new(): Passport}; | ||
} | ||
interface PassportStatic extends Passport { | ||
Passport: {new(): Passport}; | ||
Authenticator: {new(): Passport}; | ||
} | ||
interface Strategy { | ||
name?: string; | ||
authenticate(req: express.Request, options?: any): void; | ||
} | ||
interface Strategy { | ||
name?: string; | ||
authenticate(req: express.Request, options?: any): void; | ||
} | ||
interface Profile { | ||
provider: string; | ||
id: string; | ||
displayName: string; | ||
username?: string; | ||
name?: { | ||
familyName: string; | ||
givenName: string; | ||
middleName?: string; | ||
}; | ||
emails?: Array<{ | ||
value: string; | ||
type?: string; | ||
}>; | ||
photos?: Array<{ | ||
value: string; | ||
}>; | ||
} | ||
interface Profile { | ||
provider: string; | ||
id: string; | ||
displayName: string; | ||
username?: string; | ||
name?: { | ||
familyName: string; | ||
givenName: string; | ||
middleName?: string; | ||
}; | ||
emails?: Array<{ | ||
value: string; | ||
type?: string; | ||
}>; | ||
photos?: Array<{ | ||
value: string; | ||
}>; | ||
} | ||
interface Framework { | ||
initialize(passport: Passport, options?: any): Function; | ||
authenticate(passport: Passport, name: string, options?: any, callback?: Function): Function; | ||
authorize?(passport: Passport, name: string, options?: any, callback?: Function): Function; | ||
} | ||
interface Framework { | ||
initialize(passport: Passport, options?: any): (...args: any[]) => any; | ||
authenticate(passport: Passport, name: string, options?: any, callback?: (...args: any[]) => any): (...args: any[]) => any; | ||
authorize?(passport: Passport, name: string, options?: any, callback?: (...args: any[]) => any): (...args: any[]) => any; | ||
} | ||
const passport: passport.PassportStatic; | ||
export = passport; | ||
} | ||
declare const passport: passport.PassportStatic; | ||
export = passport; |
{ | ||
"name": "@types/passport", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "TypeScript definitions for Passport", | ||
@@ -32,4 +32,4 @@ "license": "MIT", | ||
}, | ||
"typesPublisherContentHash": "4bfdd8d0c19d80a3e14e82591f5da0c3ad68a31740b37ed94e181fb8a4139815", | ||
"typesPublisherContentHash": "f31cad980213e28363246861a62317718eba22a1e783655b0d8b98fcc00a459f", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Thu, 09 Nov 2017 09:57:14 GMT | ||
* Last updated: Thu, 09 Nov 2017 22:14:16 GMT | ||
* Dependencies: express | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6609