mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Merge pull request #32171 from jczyzewski/react-dotdotdot-typings
[react-dotdotdot] Add types
This commit is contained in:
Vendored
+21
@@ -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);
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user