mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[react-twitter-auth] update types (#27680)
* Add missing props * Add more tests * Update types version * Fix specified type version for package * Fix specified version
This commit is contained in:
parent
953faadd23
commit
686d449242
4
types/react-twitter-auth/index.d.ts
vendored
4
types/react-twitter-auth/index.d.ts
vendored
@ -1,6 +1,7 @@
|
||||
// Type definitions for react-twitter-auth 0.0
|
||||
// Project: https://github.com/GenFirst/react-twitter-auth
|
||||
// Definitions by: Paul Fasola <https://github.com/paulfasola>
|
||||
// Dmytro Savchenko <https://github.com/loginwashere>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@ -17,6 +18,9 @@ interface TwitterLoginProps {
|
||||
dialogHeight?: number;
|
||||
showIcon?: boolean;
|
||||
credentials?: "omit" | "same-origin" | "include";
|
||||
customHeaders?: HeadersInit;
|
||||
children?: React.ReactNode;
|
||||
forceLogin?: boolean;
|
||||
}
|
||||
|
||||
declare var TwitterLogin: React.StatelessComponent<TwitterLoginProps>;
|
||||
|
||||
@ -6,17 +6,47 @@ const ReactTwitterAuth: React.StatelessComponent = () => {
|
||||
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={{display: "initial"}}
|
||||
disabled={ false }
|
||||
text={ "test" }
|
||||
tag="button"
|
||||
credentials="same-origin"
|
||||
showIcon={true}/>
|
||||
<div>
|
||||
<TwitterLogin
|
||||
loginUrl="http://server.url/api/v1/auth/twitter"
|
||||
onSuccess={ handleSucess }
|
||||
onFailure={ handleFailure }
|
||||
requestTokenUrl="http://server.url/api/v1/auth/twitter/reverse"
|
||||
/>
|
||||
<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={{display: "initial"}}
|
||||
disabled={ false }
|
||||
text={ "test" }
|
||||
tag="button"
|
||||
credentials="same-origin"
|
||||
showIcon={true}
|
||||
/>
|
||||
<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={{display: "initial"}}
|
||||
disabled={ false }
|
||||
text={ "test" }
|
||||
tag="button"
|
||||
credentials="same-origin"
|
||||
showIcon={true}
|
||||
customHeaders={{
|
||||
authorization: 'Bearer sometoken',
|
||||
}}
|
||||
forceLogin={true}
|
||||
>
|
||||
Login with twitter
|
||||
</TwitterLogin>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user