Add react-tether definition (#14913)

This commit is contained in:
Ryan Price
2017-03-10 02:00:40 -05:00
committed by Mohamed Hegazy
parent 279736f8b2
commit 951a105ad7
4 changed files with 68 additions and 0 deletions

25
react-tether/index.d.ts vendored Normal file
View File

@@ -0,0 +1,25 @@
// Type definitions for react-tether 0.5
// Project: https://github.com/souporserious/react-tether
// Definitions by: Ryan Price <https://github.com/ryprice>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
export default TetherComponent;
export as namespace ReactTether;
import * as React from 'react';
import * as Tether from 'tether';
declare class TetherComponent extends React.Component<ReactTether.TetherComponentProps, null> { }
declare namespace ReactTether {
export interface TetherComponentProps extends React.Props<TetherComponent>, Tether.ITetherOptions {
renderElementTag?: string;
renderElementTo?: string | {appendChild: (element: HTMLElement) => void};
id?: string;
className?: string;
style?: React.CSSProperties;
onUpdate?: () => void;
onRepositioned?: () => void;
}
}

View File

@@ -0,0 +1,16 @@
import TetherComponent from "react-tether";
import * as React from "react";
const ReactTetherAllOptions: JSX.Element =
<TetherComponent
attachment="bottom middle"
id="id123"
className="react-tether"
onUpdate={() => {}}
onRepositioned={() => {}}
renderElementTag="div"
renderElementTo=".container"
/>;
const ReactTetherRequiredOptions: JSX.Element =
<TetherComponent attachment="bottom middle" />;

View File

@@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"jsx": "react",
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"react-tether-tests.tsx"
]
}

2
react-tether/tslint.json Normal file
View File

@@ -0,0 +1,2 @@
{ "extends": "../tslint.json" }