From 84196b4d06928dae32583758a304ebfa1f57eeb7 Mon Sep 17 00:00:00 2001 From: Ifiok Jr Date: Sat, 20 Apr 2019 00:37:56 +0100 Subject: [PATCH] feat: new react-github-button types (#34847) --- types/react-github-button/index.d.ts | 28 +++++++++++++++++++ .../react-github-button-tests.tsx | 10 +++++++ types/react-github-button/tsconfig.json | 17 +++++++++++ types/react-github-button/tslint.json | 1 + 4 files changed, 56 insertions(+) create mode 100644 types/react-github-button/index.d.ts create mode 100644 types/react-github-button/react-github-button-tests.tsx create mode 100644 types/react-github-button/tsconfig.json create mode 100644 types/react-github-button/tslint.json diff --git a/types/react-github-button/index.d.ts b/types/react-github-button/index.d.ts new file mode 100644 index 0000000000..87548f2d03 --- /dev/null +++ b/types/react-github-button/index.d.ts @@ -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. +// 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 {} diff --git a/types/react-github-button/react-github-button-tests.tsx b/types/react-github-button/react-github-button-tests.tsx new file mode 100644 index 0000000000..39b3d4464f --- /dev/null +++ b/types/react-github-button/react-github-button-tests.tsx @@ -0,0 +1,10 @@ +import GitHubButton from 'react-github-button'; + +const MyComponent = () => ( + +); diff --git a/types/react-github-button/tsconfig.json b/types/react-github-button/tsconfig.json new file mode 100644 index 0000000000..031f784407 --- /dev/null +++ b/types/react-github-button/tsconfig.json @@ -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"] +} diff --git a/types/react-github-button/tslint.json b/types/react-github-button/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-github-button/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }