mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
Add package [passport-kakao & passport-naver] (#22798)
* Add package [passport-kakao & passport-naver] * Fixed types/tsconfig.json [passport-kakao & passport-naver]
This commit is contained in:
committed by
Ryan Cavanaugh
parent
5be99ed666
commit
c76270a2d2
35
types/passport-kakao/index.d.ts
vendored
Normal file
35
types/passport-kakao/index.d.ts
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
// Type definitions for passport-kakao 0.1
|
||||
// Project: https://github.com/rotoshine/passport-kakao
|
||||
// Definitions by: Park9eon <https://github.com/Park9eon>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import passport = require("passport");
|
||||
import express = require("express");
|
||||
|
||||
export interface Profile extends passport.Profile {
|
||||
id: string;
|
||||
provider: string;
|
||||
|
||||
_raw: string;
|
||||
_json: any;
|
||||
}
|
||||
|
||||
export interface StrategyOption {
|
||||
clientID: string;
|
||||
clientSecret: string;
|
||||
callbackURL: string;
|
||||
|
||||
scopeSeparator?: string;
|
||||
customHeaders?: string;
|
||||
}
|
||||
|
||||
export type VerifyFunction =
|
||||
(accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void;
|
||||
|
||||
export class Strategy implements passport.Strategy {
|
||||
constructor(options: StrategyOption, verify: VerifyFunction);
|
||||
|
||||
authenticate: (req: express.Request, options?: any) => void;
|
||||
userProfile: (accessToken: string, done: (error: any, user?: any) => void) => void;
|
||||
}
|
||||
10
types/passport-kakao/passport-kakao-tests.ts
Normal file
10
types/passport-kakao/passport-kakao-tests.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import {Strategy as KakaoStrategy } from 'passport-kakao';
|
||||
|
||||
new KakaoStrategy({
|
||||
clientID: 'client',
|
||||
clientSecret: 'clientSecret',
|
||||
callbackURL: 'callbackUrl'
|
||||
},
|
||||
(accessToken: string, refreshToken: string, profile: any, done: any) => {
|
||||
// signUp or signIn
|
||||
});
|
||||
23
types/passport-kakao/tsconfig.json
Normal file
23
types/passport-kakao/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"passport-kakao-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/passport-kakao/tslint.json
Normal file
3
types/passport-kakao/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
46
types/passport-naver/index.d.ts
vendored
Normal file
46
types/passport-naver/index.d.ts
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
// Type definitions for passport-naver 0.1
|
||||
// Project: https://github.com/naver/passport-naver
|
||||
// Definitions by: Park9eon <https://github.com/Park9eon>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import passport = require("passport");
|
||||
import express = require("express");
|
||||
|
||||
export interface Profile extends passport.Profile {
|
||||
id: string;
|
||||
provider: string;
|
||||
|
||||
_json: {
|
||||
email: string,
|
||||
nickname: string,
|
||||
profile_image: string,
|
||||
age: number,
|
||||
birthday: any
|
||||
id: string
|
||||
};
|
||||
}
|
||||
|
||||
export interface StrategyOption {
|
||||
clientID: string;
|
||||
clientSecret: string;
|
||||
callbackURL: string;
|
||||
|
||||
svcType?: number;
|
||||
authType?: string;
|
||||
|
||||
authorizationURL?: string;
|
||||
tokenURL?: string;
|
||||
profileURL?: string;
|
||||
}
|
||||
|
||||
export type VerifyFunction =
|
||||
(accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void;
|
||||
|
||||
export class Strategy implements passport.Strategy {
|
||||
constructor(options: StrategyOption, verify: VerifyFunction);
|
||||
|
||||
authenticate: (req: express.Request, options?: any) => void;
|
||||
authorizationParams: (options: any) => any;
|
||||
userProfile: (accessToken: string, done: (error: any, user?: any) => void) => void;
|
||||
}
|
||||
10
types/passport-naver/passport-naver-tests.ts
Normal file
10
types/passport-naver/passport-naver-tests.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import {Strategy as NaverStrategy } from 'passport-naver';
|
||||
|
||||
new NaverStrategy({
|
||||
clientID: 'client',
|
||||
clientSecret: 'clientSecret',
|
||||
callbackURL: 'callbackUrl'
|
||||
},
|
||||
(accessToken: string, refreshToken: string, profile: any, done: any) => {
|
||||
// signUp or signIn
|
||||
});
|
||||
23
types/passport-naver/tsconfig.json
Normal file
23
types/passport-naver/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"passport-naver-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/passport-naver/tslint.json
Normal file
3
types/passport-naver/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user