mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
Clean up based on tsc errors, and add dependencies for auth0-js.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/// <reference types="auth0-js" />
|
||||
import 'auth0-js';
|
||||
|
||||
let webAuth = new auth0.WebAuth({
|
||||
domain: 'mine.auth0.com',
|
||||
|
||||
6
auth0-js/index.d.ts
vendored
6
auth0-js/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Auth0.js v8.1.3
|
||||
// Type definitions for Auth0.js 8.1
|
||||
// Project: https://github.com/auth0/auth0.js
|
||||
// Definitions by: Adrian Chia <https://github.com/adrianchia>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -409,7 +409,7 @@ declare namespace auth0 {
|
||||
|
||||
interface Auth0Error {
|
||||
error: any;
|
||||
errorDescription: string
|
||||
errorDescription: string;
|
||||
}
|
||||
|
||||
interface Auth0DecodedHash {
|
||||
@@ -442,7 +442,7 @@ declare namespace auth0 {
|
||||
connection: string;
|
||||
send: string;
|
||||
phoneNumber?: string;
|
||||
email?: string,
|
||||
email?: string;
|
||||
authParams?: any;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,4 +20,4 @@
|
||||
"index.d.ts",
|
||||
"auth0-js-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/// <reference types="auth0-js/v7" />
|
||||
import 'auth0-js';
|
||||
|
||||
var auth0 = new Auth0({
|
||||
domain: 'mine.auth0.com',
|
||||
clientID: 'dsa7d77dsa7d7',
|
||||
|
||||
14
auth0-js/v7/index.d.ts
vendored
14
auth0-js/v7/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Auth0.js v7.x
|
||||
// Type definitions for Auth0.js 7.0
|
||||
// Project: https://github.com/auth0/auth0.js
|
||||
// Definitions by: Robert McLaws <https://github.com/advancedrei>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -13,20 +13,20 @@ interface Window {
|
||||
interface Auth0Static {
|
||||
|
||||
new(options: Auth0ClientOptions): Auth0Static;
|
||||
changePassword(options: any, callback?: Function): void;
|
||||
changePassword(options: any, callback?: (error?: Auth0Error, valid?: any) => void): void;
|
||||
decodeJwt(jwt: string): any;
|
||||
login(options: any, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void;
|
||||
loginWithPopup(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void;
|
||||
loginWithResourceOwner(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: any) => any): void;
|
||||
loginWithUsernamePassword(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void;
|
||||
logout(query: string): void;
|
||||
getConnections(callback?: Function): void;
|
||||
getConnections(callback?: (error?: Auth0Error, valid?: any) => void): void;
|
||||
refreshToken(refreshToken: string, callback: (error?: Auth0Error, delegationResult?: Auth0DelegationToken) => any): void;
|
||||
getDelegationToken(options: any, callback: (error?: Auth0Error, delegationResult?: Auth0DelegationToken) => any): void;
|
||||
getProfile(id_token: string, callback?: Function): Auth0UserProfile;
|
||||
getSSOData(withActiveDirectories: any, callback?: Function): void;
|
||||
getProfile(id_token: string, callback?: (error?: Auth0Error, valid?: any) => void): Auth0UserProfile;
|
||||
getSSOData(withActiveDirectories: any, callback?: (error?: Auth0Error, valid?: any) => void): void;
|
||||
parseHash(hash: string): Auth0DecodedHash;
|
||||
signup(options: Auth0SignupOptions, callback: Function): void;
|
||||
signup(options: Auth0SignupOptions, callback: (error?: Auth0Error, valid?: any) => void): void;
|
||||
validateUser(options: any, callback: (error?: Auth0Error, valid?: any) => any): void;
|
||||
}
|
||||
|
||||
@@ -132,5 +132,5 @@ interface Auth0DelegationToken {
|
||||
declare const Auth0: Auth0Static;
|
||||
|
||||
declare module "auth0-js" {
|
||||
export = Auth0
|
||||
export = Auth0;
|
||||
}
|
||||
|
||||
@@ -12,12 +12,11 @@
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"paths": {
|
||||
"auth0-js": [
|
||||
"auth0-js/v7"
|
||||
]
|
||||
},
|
||||
"types": [],
|
||||
"paths": {
|
||||
"auth0-js": ["auth0-js/v7"],
|
||||
"auth0-js/*": ["auth0-js/v7/*"]
|
||||
},
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/// <reference types="auth0-js/v7" />
|
||||
/// <reference path="index.d.ts" />
|
||||
import 'auth0-js/v7';
|
||||
import Auth0Lock from 'auth0-lock';
|
||||
|
||||
const CLIENT_ID = "YOUR_AUTH0_APP_CLIENTID";
|
||||
const DOMAIN = "YOUR_DOMAIN_AT.auth0.com";
|
||||
|
||||
5
auth0-lock/package.json
Normal file
5
auth0-lock/package.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/auth0-js": "latest"
|
||||
}
|
||||
}
|
||||
@@ -20,4 +20,4 @@
|
||||
"index.d.ts",
|
||||
"auth0-lock-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/// <reference types="auth0-js/v7" />
|
||||
|
||||
import 'auth0-js/v7';
|
||||
|
||||
var widget: Auth0WidgetStatic = new Auth0Widget({
|
||||
domain: 'mine.auth0.com',
|
||||
|
||||
1
auth0.widget/index.d.ts
vendored
1
auth0.widget/index.d.ts
vendored
@@ -5,7 +5,6 @@
|
||||
|
||||
/// <reference types="auth0-js/v7" />
|
||||
|
||||
|
||||
interface Auth0WidgetStatic {
|
||||
new(params: Auth0Constructor): Auth0WidgetStatic;
|
||||
|
||||
|
||||
5
auth0.widget/package.json
Normal file
5
auth0.widget/package.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/auth0-js": "latest"
|
||||
}
|
||||
}
|
||||
@@ -19,4 +19,4 @@
|
||||
"index.d.ts",
|
||||
"auth0.widget-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user