Merge pull request #32171 from jczyzewski/react-dotdotdot-typings

[react-dotdotdot] Add types
This commit is contained in:
Daniel Rosenwasser
2019-01-22 13:22:04 -08:00
committed by GitHub
4 changed files with 68 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
// Type definitions for react-dotdotdot 1.2
// Project: https://github.com/CezaryDanielNowak/React-dotdotdot
// Definitions by: Jakub Czyżewski <https://github.com/jczyzewski>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import { ComponentType } from 'react';
interface DotDotDotProps {
clamp: number | string | boolean;
useNativeClamp?: boolean;
splitOnChars?: string[];
animate?: boolean;
truncationChar?: string;
truncationHTML?: string;
tagName?: string;
}
declare const Dotdotdot: ComponentType<DotDotDotProps>;
export = Dotdotdot;
@@ -0,0 +1,20 @@
import * as React from 'react';
import Dotdotdot from 'react-dotdotdot';
import * as ReactDOM from "react-dom";
ReactDOM.render(
<Dotdotdot
clamp={3}
useNativeClamp={false}
splitOnChars={[',']}
animate={false}
truncationChar={"…"}
tagName={"div"}
>
<p>
Long, long <br />
content,<br />
3 lines <br />
will be shown.
</p>
</Dotdotdot>, document.body);
+26
View File
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"esModuleInterop": true
},
"files": [
"index.d.ts",
"react-dotdotdot-tests.tsx"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }