mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Added types for oauth2-implicit package (#38725)
* added rollup-plugin-peer-deps-external * fixed error * added oauth2-implicit * corrected formatting * removed unused files * corrected version
This commit is contained in:
parent
d2a59b239b
commit
c9e2ebd317
34
types/oauth2-implicit/index.d.ts
vendored
Normal file
34
types/oauth2-implicit/index.d.ts
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
// Type definitions for oauth2-implicit 0.7
|
||||
// Project: https://github.com/jasonkuhrt/oauth2-implicit
|
||||
// Definitions by: Vladimir Grenaderov <https://github.com/VladimirGrenaderov>,
|
||||
// Max Boguslavskiy <https://github.com/maxbogus>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface AuthState {
|
||||
[key: string]: any;
|
||||
originalUrl: string;
|
||||
}
|
||||
|
||||
export interface AuthParams {
|
||||
auth_uri: string;
|
||||
client_id: string;
|
||||
state: AuthState;
|
||||
redirect_uri: string;
|
||||
scope?: string[];
|
||||
}
|
||||
|
||||
export interface AuthResult {
|
||||
accessToken: string;
|
||||
state: AuthState;
|
||||
}
|
||||
|
||||
export function finish(): AuthResult | undefined | null;
|
||||
export function parseCredentials(hashString: string): AuthParams;
|
||||
export function run(options: any): any;
|
||||
export function start(options: AuthParams): void;
|
||||
|
||||
export namespace run {
|
||||
function finish(): AuthResult | undefined | null;
|
||||
function parseCredentials(hashString: string): AuthParams;
|
||||
function start(options: AuthParams): void;
|
||||
}
|
||||
6
types/oauth2-implicit/oauth2-implicit-tests.ts
Normal file
6
types/oauth2-implicit/oauth2-implicit-tests.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { finish, parseCredentials, start, AuthState } from 'oauth2-implicit';
|
||||
|
||||
parseCredentials('hello');
|
||||
finish();
|
||||
const params: AuthState = { originalUrl: '' };
|
||||
start({ auth_uri: '', client_id: '', state: params, redirect_uri: '' });
|
||||
23
types/oauth2-implicit/tsconfig.json
Normal file
23
types/oauth2-implicit/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",
|
||||
"oauth2-implicit-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/oauth2-implicit/tslint.json
Normal file
1
types/oauth2-implicit/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{"extends": "dtslint/dt.json"}
|
||||
Loading…
Reference in New Issue
Block a user