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:
Max Boguslavsky 2019-10-02 23:36:30 +03:00 committed by Ryan Cavanaugh
parent d2a59b239b
commit c9e2ebd317
4 changed files with 64 additions and 0 deletions

34
types/oauth2-implicit/index.d.ts vendored Normal file
View 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;
}

View 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: '' });

View 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"
]
}

View File

@ -0,0 +1 @@
{"extends": "dtslint/dt.json"}