feat: new react-github-button types (#34847)

This commit is contained in:
Ifiok Jr
2019-04-19 16:37:56 -07:00
committed by Armando Aguirre
parent 8ad81d7563
commit 84196b4d06
4 changed files with 56 additions and 0 deletions
+28
View File
@@ -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"
/>
);
+17
View File
@@ -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"]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }