diff --git a/types/react-dotdotdot/index.d.ts b/types/react-dotdotdot/index.d.ts new file mode 100644 index 0000000000..0522d11590 --- /dev/null +++ b/types/react-dotdotdot/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for react-dotdotdot 1.2 +// Project: https://github.com/CezaryDanielNowak/React-dotdotdot +// Definitions by: Jakub Czyżewski +// 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; + +export = Dotdotdot; diff --git a/types/react-dotdotdot/react-dotdotdot-tests.tsx b/types/react-dotdotdot/react-dotdotdot-tests.tsx new file mode 100644 index 0000000000..9168c30dba --- /dev/null +++ b/types/react-dotdotdot/react-dotdotdot-tests.tsx @@ -0,0 +1,20 @@ +import * as React from 'react'; +import Dotdotdot from 'react-dotdotdot'; +import * as ReactDOM from "react-dom"; + +ReactDOM.render( + +

+ Long, long
+ content,
+ 3 lines
+ will be shown. +

+
, document.body); diff --git a/types/react-dotdotdot/tsconfig.json b/types/react-dotdotdot/tsconfig.json new file mode 100644 index 0000000000..e2267fd6bb --- /dev/null +++ b/types/react-dotdotdot/tsconfig.json @@ -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" + ] +} \ No newline at end of file diff --git a/types/react-dotdotdot/tslint.json b/types/react-dotdotdot/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-dotdotdot/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }