mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
feat: new react-github-button types (#34847)
This commit is contained in:
committed by
Armando Aguirre
parent
8ad81d7563
commit
84196b4d06
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
// Type definitions for react-github-button 0.1
|
||||
// Project: https://github.com/benjycui/react-github-button#readme
|
||||
// Definitions by: Ifiok Jr. <https://github.com/ifiokjr>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { Component } from 'react';
|
||||
|
||||
export interface ReactGitHubButtonProps {
|
||||
/**
|
||||
* The type of information to display
|
||||
*/
|
||||
type: 'stargazers' | 'watchers' | 'forks';
|
||||
/**
|
||||
* The size of the button. Leave undefined for default.
|
||||
*/
|
||||
size?: 'large';
|
||||
/**
|
||||
* Your GitHub id or organization name.
|
||||
*/
|
||||
namespace: string;
|
||||
/**
|
||||
* The name of your repository.
|
||||
*/
|
||||
repo: string;
|
||||
}
|
||||
|
||||
export default class GitHubButton extends Component<ReactGitHubButtonProps> {}
|
||||
@@ -0,0 +1,10 @@
|
||||
import GitHubButton from 'react-github-button';
|
||||
|
||||
const MyComponent = () => (
|
||||
<GitHubButton
|
||||
type="stargazers"
|
||||
size="large"
|
||||
namespace="benjycui"
|
||||
repo="react-github-button"
|
||||
/>
|
||||
);
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"jsx": "preserve",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "react-github-button-tests.tsx"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user