diff --git a/types/react-native-auth0/index.d.ts b/types/react-native-auth0/index.d.ts index e738cf69b3..62a6a94d9d 100644 --- a/types/react-native-auth0/index.d.ts +++ b/types/react-native-auth0/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for react-native-auth0 1.3 +// Type definitions for react-native-auth0 2.0 // Project: https://github.com/auth0/react-native-auth0 // Definitions by: Andrea Ascari // Mark Nelissen +// Leo Farias // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -9,7 +10,7 @@ * Auth */ -export interface AuthorizationUrlParams { +export interface AuthorizeUrlParams { responseType: string; redirectUri: string; state: string; @@ -87,7 +88,7 @@ export type UserInfo = { } & CustomClaims; export class Auth { - authorizationUrl(params: AuthorizationUrlParams): string; + authorizeUrl(params: AuthorizeUrlParams): string; /* tslint:disable-next-line no-unnecessary-generics */ createUser(user: CreateUserParams): Promise; exchange(params: ExchangeParams): Promise; diff --git a/types/react-native-auth0/react-native-auth0-tests.ts b/types/react-native-auth0/react-native-auth0-tests.ts index 8a10d5d2b6..dae0a05c4b 100644 --- a/types/react-native-auth0/react-native-auth0-tests.ts +++ b/types/react-native-auth0/react-native-auth0-tests.ts @@ -1,41 +1,41 @@ -import Auth0, { UserInfo } from "react-native-auth0"; +import Auth0, { UserInfo } from 'react-native-auth0'; const auth0 = new Auth0({ - domain: "definitely-typed", - clientId: "definitely-typed" + domain: 'definitely-typed', + clientId: 'definitely-typed', }); auth0.auth.createUser({ - email: "me@example.com", - username: "johndoe", - password: "password", - connection: "db-connection" + email: 'me@example.com', + username: 'johndoe', + password: 'password', + connection: 'db-connection', }); -auth0.auth.authorizationUrl({ - responseType: "json", - redirectUri: "http://localhost:3000", - state: "my-state" +auth0.auth.authorizeUrl({ + responseType: 'json', + redirectUri: 'http://localhost:3000', + state: 'my-state', }); auth0.auth.exchange({ - code: "my-code", - redirectUri: "http://localhost:3000", - verifier: "verifier" + code: 'my-code', + redirectUri: 'http://localhost:3000', + verifier: 'verifier', }); auth0.auth.logoutUrl({ federated: true, - clientId: "client-id", - returnTo: "http://localhost:3000" + clientId: 'client-id', + returnTo: 'http://localhost:3000', }); auth0.auth .passwordRealm({ - username: "me@example.com", - password: "password", - realm: "realm", - audience: "user-info" + username: 'me@example.com', + password: 'password', + realm: 'realm', + audience: 'user-info', }) .then(res => { if (res.refreshToken) { @@ -45,37 +45,37 @@ auth0.auth }); auth0.auth.refreshToken({ - refreshToken: "refresh-token", - scope: "openid" + refreshToken: 'refresh-token', + scope: 'openid', }); auth0.auth.resetPassword({ - email: "me@example.com", - connection: "db-connection" + email: 'me@example.com', + connection: 'db-connection', }); auth0.auth.revoke({ - refreshToken: "refresh-token" + refreshToken: 'refresh-token', }); auth0.auth.userInfo({ - token: "token" + token: 'token', }); auth0.webAuth.authorize({ - state: "state", - nonce: "nonce", - scope: "openid", - language: "en", - prompt: 'login' + state: 'state', + nonce: 'nonce', + scope: 'openid', + language: 'en', + prompt: 'login', }); auth0.webAuth.clearSession({ federated: false }); auth0.webAuth.clearSession(); -auth0.users("token").getUser({ id: "userId" }); +auth0.users('token').getUser({ id: 'userId' }); -auth0.users("token").patchUser<{ firstName: string; lastName: string }>({ - id: "userId", - metadata: { firstName: "John", lastName: "Dow" } +auth0.users('token').patchUser<{ firstName: string; lastName: string }>({ + id: 'userId', + metadata: { firstName: 'John', lastName: 'Dow' }, });