From 322728342726dd171e02d5d2ef0d9c47a96eea65 Mon Sep 17 00:00:00 2001 From: kingdaro Date: Fri, 30 Nov 2018 00:18:46 -0600 Subject: [PATCH 1/7] [react-facebook-login]: export props --- types/react-facebook-login/index.d.ts | 2 +- .../react-facebook-login/react-facebook-login-tests.tsx | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/types/react-facebook-login/index.d.ts b/types/react-facebook-login/index.d.ts index 82672660a8..3ef679141e 100644 --- a/types/react-facebook-login/index.d.ts +++ b/types/react-facebook-login/index.d.ts @@ -6,7 +6,7 @@ import * as React from "react"; -interface ReactFacebookLoginProps { +export interface ReactFacebookLoginProps { appId: string; callback(userInfo: ReactFacebookLoginInfo): void; onFailure?(response: ReactFacebookFailureResponse): void; diff --git a/types/react-facebook-login/react-facebook-login-tests.tsx b/types/react-facebook-login/react-facebook-login-tests.tsx index d7b2ebcde8..2a1fede6dd 100644 --- a/types/react-facebook-login/react-facebook-login-tests.tsx +++ b/types/react-facebook-login/react-facebook-login-tests.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; - -import FacebookLogin, { ReactFacebookLoginInfo, ReactFacebookFailureResponse } from 'react-facebook-login'; +import FacebookLogin, { ReactFacebookFailureResponse, ReactFacebookLoginInfo, ReactFacebookLoginProps } from 'react-facebook-login'; const responseFacebook = (response: ReactFacebookLoginInfo) => { console.log(response); @@ -106,3 +105,9 @@ class MyComponent2 extends React.Component { ); } } + +type FacebookLoginWrapperProps = ReactFacebookLoginProps & { className?: string } + +export const FacebookLoginWrapper = ({ className, ...props}: FacebookLoginWrapperProps) => ( + +) From 9a86c019d97a9846393b34e8e3a1d21f141aca31 Mon Sep 17 00:00:00 2001 From: kingdaro Date: Fri, 30 Nov 2018 00:25:08 -0600 Subject: [PATCH 2/7] missing semicolons --- types/react-facebook-login/react-facebook-login-tests.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-facebook-login/react-facebook-login-tests.tsx b/types/react-facebook-login/react-facebook-login-tests.tsx index 2a1fede6dd..ed11a5f4ac 100644 --- a/types/react-facebook-login/react-facebook-login-tests.tsx +++ b/types/react-facebook-login/react-facebook-login-tests.tsx @@ -106,8 +106,8 @@ class MyComponent2 extends React.Component { } } -type FacebookLoginWrapperProps = ReactFacebookLoginProps & { className?: string } +type FacebookLoginWrapperProps = ReactFacebookLoginProps & { className?: string }; export const FacebookLoginWrapper = ({ className, ...props}: FacebookLoginWrapperProps) => ( -) +); From cc1e2c1ac382d742e3ac9a7877236f3ab449a9dd Mon Sep 17 00:00:00 2001 From: kingdaro Date: Fri, 30 Nov 2018 00:35:05 -0600 Subject: [PATCH 3/7] react-facebook-login: remove redundant `string |` --- types/react-facebook-login/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-facebook-login/index.d.ts b/types/react-facebook-login/index.d.ts index 3ef679141e..24df31b5ad 100644 --- a/types/react-facebook-login/index.d.ts +++ b/types/react-facebook-login/index.d.ts @@ -18,7 +18,7 @@ export interface ReactFacebookLoginProps { cssClass?: string; disableMobileRedirect?: boolean; fields?: string; - icon?: string | React.ReactNode; + icon?: React.ReactNode; isDisabled?: boolean; language?: string; onClick?(event: React.MouseEvent): void; From 1626bd3d82d37b2e37a34bd132c4109234c78cbd Mon Sep 17 00:00:00 2001 From: kingdaro Date: Fri, 30 Nov 2018 00:35:26 -0600 Subject: [PATCH 4/7] react-facebook-login: add additional missnig props --- types/react-facebook-login/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/react-facebook-login/index.d.ts b/types/react-facebook-login/index.d.ts index 24df31b5ad..c8be6e47f0 100644 --- a/types/react-facebook-login/index.d.ts +++ b/types/react-facebook-login/index.d.ts @@ -32,6 +32,10 @@ export interface ReactFacebookLoginProps { xfbml?: boolean; isMobile?: boolean; tag?: Node | React.Component; + returnScopes?: boolean; + state?: string; + authType?: string; + responseType?: string; } export interface ReactFacebookFailureResponse { From 04fb2654db72e7979e44b81ce44386244c6e1859 Mon Sep 17 00:00:00 2001 From: kingdaro Date: Fri, 30 Nov 2018 00:35:52 -0600 Subject: [PATCH 5/7] react-facebook-login: simplify exports --- types/react-facebook-login/index.d.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/types/react-facebook-login/index.d.ts b/types/react-facebook-login/index.d.ts index c8be6e47f0..b56b484476 100644 --- a/types/react-facebook-login/index.d.ts +++ b/types/react-facebook-login/index.d.ts @@ -49,14 +49,12 @@ export interface ReactFacebookLoginInfo { email?: string; } -interface ReactFacebookLoginState { +export interface ReactFacebookLoginState { isSdkLoaded?: boolean; isProcessing?: boolean; } -declare class ReactFacebookLogin extends React.Component< +export default class ReactFacebookLogin extends React.Component< ReactFacebookLoginProps, ReactFacebookLoginState > {} - -export default ReactFacebookLogin; From 7fe4b2a91493a6b1fdbe861029ad7347572c806a Mon Sep 17 00:00:00 2001 From: kingdaro Date: Fri, 30 Nov 2018 00:36:27 -0600 Subject: [PATCH 6/7] add missing space --- types/react-facebook-login/react-facebook-login-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-facebook-login/react-facebook-login-tests.tsx b/types/react-facebook-login/react-facebook-login-tests.tsx index ed11a5f4ac..a52c955596 100644 --- a/types/react-facebook-login/react-facebook-login-tests.tsx +++ b/types/react-facebook-login/react-facebook-login-tests.tsx @@ -108,6 +108,6 @@ class MyComponent2 extends React.Component { type FacebookLoginWrapperProps = ReactFacebookLoginProps & { className?: string }; -export const FacebookLoginWrapper = ({ className, ...props}: FacebookLoginWrapperProps) => ( +export const FacebookLoginWrapper = ({ className, ...props }: FacebookLoginWrapperProps) => ( ); From 544bbdef11e4a15ad8dddae8305fc6f6b5b783a8 Mon Sep 17 00:00:00 2001 From: kingdaro Date: Fri, 30 Nov 2018 00:38:50 -0600 Subject: [PATCH 7/7] bump version --- types/react-facebook-login/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-facebook-login/index.d.ts b/types/react-facebook-login/index.d.ts index b56b484476..419761974e 100644 --- a/types/react-facebook-login/index.d.ts +++ b/types/react-facebook-login/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-facebook-login 3.6 +// Type definitions for react-facebook-login 4.1 // Project: https://github.com/keppelen/react-facebook-login // Definitions by: Alexandre Paré , Jan Karres // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped