mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Add react-tether definition (#14913)
This commit is contained in:
committed by
Mohamed Hegazy
parent
279736f8b2
commit
951a105ad7
25
react-tether/index.d.ts
vendored
Normal file
25
react-tether/index.d.ts
vendored
Normal 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;
|
||||
}
|
||||
}
|
||||
16
react-tether/react-tether-tests.tsx
Normal file
16
react-tether/react-tether-tests.tsx
Normal 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" />;
|
||||
25
react-tether/tsconfig.json
Normal file
25
react-tether/tsconfig.json
Normal 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
2
react-tether/tslint.json
Normal file
@@ -0,0 +1,2 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
|
||||
Reference in New Issue
Block a user