diff --git a/types/react-facebook-login-component/index.d.ts b/types/react-facebook-login-component/index.d.ts new file mode 100644 index 0000000000..6de3d2e0eb --- /dev/null +++ b/types/react-facebook-login-component/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for react-facebook-login-component 4.1 +// Project: https://github.com/kennetpostigo/react-facebook-login-component +// Definitions by: Konstantin Lebedev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from "react"; + +export interface FacebookLoginInfo { + id: string; + accessToken: string; + name?: string; + email?: string; +} + +export interface FacebookLoginProps extends React.ButtonHTMLAttributes { + socialId: string; + xfbml?: boolean; + version?: string; + fields?: string; + buttonText?: string; + responseHandler: (response: FacebookLoginInfo) => void; +} + +export class FacebookLogin extends React.Component {} diff --git a/types/react-facebook-login-component/react-facebook-login-component-tests.tsx b/types/react-facebook-login-component/react-facebook-login-component-tests.tsx new file mode 100644 index 0000000000..ee9730d6c4 --- /dev/null +++ b/types/react-facebook-login-component/react-facebook-login-component-tests.tsx @@ -0,0 +1,24 @@ +import { FacebookLogin, FacebookLoginInfo } from "react-facebook-login-component"; +import * as React from "react"; + +const handler = (response: FacebookLoginInfo) => { + console.log(response.accessToken); +}; + +const ReactFacebookLoginComponent: JSX.Element = ( + +); + +const ReactFacebookLoginComponentAllOptions: JSX.Element = ( + +); diff --git a/types/react-facebook-login-component/tsconfig.json b/types/react-facebook-login-component/tsconfig.json new file mode 100644 index 0000000000..f5c4eb981d --- /dev/null +++ b/types/react-facebook-login-component/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "target": "es6", + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-facebook-login-component-tests.tsx" + ] +} diff --git a/types/react-facebook-login-component/tslint.json b/types/react-facebook-login-component/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-facebook-login-component/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }