diff --git a/auth0-lock/auth0-lock-tests.ts b/auth0-lock/auth0-lock-tests.ts index cd51950c6a..d0a9231a57 100644 --- a/auth0-lock/auth0-lock-tests.ts +++ b/auth0-lock/auth0-lock-tests.ts @@ -1,5 +1,5 @@ /// - +/// const CLIENT_ID = "YOUR_AUTH0_APP_CLIENTID"; const DOMAIN = "YOUR_DOMAIN_AT.auth0.com"; @@ -10,6 +10,30 @@ lock.show(); lock.hide(); lock.logout(() => {}); +// Show supports UI arguments + +var showOptions : Auth0LockShowOptions = { + allowedConnections: [ "twitter", "facebook" ], + autoclose: false, + autofocus: true, + closable: true, + container: "somediv", + flashMessage: { + type: "error", + text: "an error has occurred" + }, + language: "en", + popupOptions: { + width: 100, + height: 400, + left: 200, + top: 200 + }, + rememberLastLogin: false +}; + +lock.show(showOptions); + // The examples below are lifted from auth0-lock documentation on Github // "on" event-driven example diff --git a/auth0-lock/index.d.ts b/auth0-lock/index.d.ts index e2964d287c..4593b4e32a 100644 --- a/auth0-lock/index.d.ts +++ b/auth0-lock/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for auth0-lock v10.0.1 +// Type definitions for auth0-lock v10.9.1 // Project: http://auth0.com // Definitions by: Brian Caruso // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -103,13 +103,33 @@ interface Auth0LockConstructorOptions { usernameStyle?: string; } +interface Auth0LockFlashMessageOptions { + type: "success" | "error", + text: string; +} + +interface Auth0LockShowOptions { + allowedConnections?: string[]; + autoclose?: boolean; + autofocus?: boolean; + avatar?: Auth0LockAvatarOptions; + closable?: boolean; + container?: string; + flashMessage?: Auth0LockFlashMessageOptions; + language?: string; + languageDictionary?: any; + popupOptions?: Auth0LockPopupOptions; + rememberLastLogin?: boolean; +} + interface Auth0LockStatic { new (clientId: string, domain: string, options?: Auth0LockConstructorOptions): Auth0LockStatic; - getProfile(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void) : void; + // deprecated + getProfile(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void) : void; getUserInfo(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void) : void; - show(): void; + show(options?: Auth0LockShowOptions): void; hide(): void; logout(query: any): void;