Clean up based on tsc errors, and add dependencies for auth0-js.

This commit is contained in:
Saqib Rokadia
2017-02-10 13:08:45 -08:00
parent 4916c5a23d
commit df42ce87e9
13 changed files with 33 additions and 25 deletions

View File

@@ -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
View File

@@ -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;
}

View File

@@ -20,4 +20,4 @@
"index.d.ts",
"auth0-js-tests.ts"
]
}
}

View File

@@ -1,4 +1,5 @@
/// <reference types="auth0-js/v7" />
import 'auth0-js';
var auth0 = new Auth0({
domain: 'mine.auth0.com',
clientID: 'dsa7d77dsa7d7',

View File

@@ -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;
}

View File

@@ -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
},

View File

@@ -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
View File

@@ -0,0 +1,5 @@
{
"dependencies": {
"@types/auth0-js": "latest"
}
}

View File

@@ -20,4 +20,4 @@
"index.d.ts",
"auth0-lock-tests.ts"
]
}
}

View File

@@ -1,5 +1,4 @@
/// <reference types="auth0-js/v7" />
import 'auth0-js/v7';
var widget: Auth0WidgetStatic = new Auth0Widget({
domain: 'mine.auth0.com',

View File

@@ -5,7 +5,6 @@
/// <reference types="auth0-js/v7" />
interface Auth0WidgetStatic {
new(params: Auth0Constructor): Auth0WidgetStatic;

View File

@@ -0,0 +1,5 @@
{
"dependencies": {
"@types/auth0-js": "latest"
}
}

View File

@@ -19,4 +19,4 @@
"index.d.ts",
"auth0.widget-tests.ts"
]
}
}