diff --git a/types/react-twitter-auth/index.d.ts b/types/react-twitter-auth/index.d.ts new file mode 100644 index 0000000000..7348b10a21 --- /dev/null +++ b/types/react-twitter-auth/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for react-twitter-auth 0.10 +// Project: https://github.com/GenFirst/react-twitter-auth +// Definitions by: Paul Fasola +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +interface TwitterLoginProp { + tag?: string; + text?: string; + loginUrl: string; + requestTokenUrl: string; + onFailure: (msg: string) => void; + onSuccess: (response: string) => void; + disabled?: boolean; + style?: string; + className?: string; + dialogWidth?: number; + dialogHeight?: number; + showIcon?: boolean; + credentials?: string; +} + +declare var TwitterLogin: React.StatelessComponent; + +export default TwitterLogin; diff --git a/types/react-twitter-auth/react-twitter-auth-tests.tsx b/types/react-twitter-auth/react-twitter-auth-tests.tsx new file mode 100644 index 0000000000..a1d212a726 --- /dev/null +++ b/types/react-twitter-auth/react-twitter-auth-tests.tsx @@ -0,0 +1,23 @@ +import * as React from 'react'; +import TwitterLogin from 'react-twitter-auth'; + +const ReactTwitterAuth: React.StatelessComponent = () => { + function handleSucess(response: string) {} + function handleFailure(msg: string) {} + + return ( + + ); +}; diff --git a/types/react-twitter-auth/tsconfig.json b/types/react-twitter-auth/tsconfig.json new file mode 100644 index 0000000000..1c73a25222 --- /dev/null +++ b/types/react-twitter-auth/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "jsx": "react", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-twitter-auth-tests.tsx" + ] +} diff --git a/types/react-twitter-auth/tslint.json b/types/react-twitter-auth/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-twitter-auth/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }