mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-06 06:19:58 +08:00
Add typings for react-twitter-auth
This commit is contained in:
25
types/react-twitter-auth/index.d.ts
vendored
Normal file
25
types/react-twitter-auth/index.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// Type definitions for react-twitter-auth 0.10
|
||||
// Project: https://github.com/GenFirst/react-twitter-auth
|
||||
// Definitions by: Paul Fasola <https://github.com/paulfasola>
|
||||
// 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<TwitterLoginProp>;
|
||||
|
||||
export default TwitterLogin;
|
||||
23
types/react-twitter-auth/react-twitter-auth-tests.tsx
Normal file
23
types/react-twitter-auth/react-twitter-auth-tests.tsx
Normal file
@@ -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 (
|
||||
<TwitterLogin loginUrl="http://server.url/api/v1/auth/twitter"
|
||||
onSuccess={ handleSucess }
|
||||
onFailure={ handleFailure }
|
||||
requestTokenUrl="http://server.url/api/v1/auth/twitter/reverse"
|
||||
dialogWidth={ 1200 }
|
||||
dialogHeight={ 800 }
|
||||
style={ "font-size: 14px;" }
|
||||
disabled={ false }
|
||||
text={ "test" }
|
||||
tag={ "test" }
|
||||
className={ "test" }
|
||||
credentials={ "same-origin" }
|
||||
showIcon={true}/>
|
||||
);
|
||||
};
|
||||
25
types/react-twitter-auth/tsconfig.json
Normal file
25
types/react-twitter-auth/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
1
types/react-twitter-auth/tslint.json
Normal file
1
types/react-twitter-auth/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user