CezaryDanielNowak / React-dotdotdot

Multiline text ellipsis for react. Demo:
https://nowak.click/react-dotdotdot/
MIT License
401 stars 54 forks source link

Typescript integration #40

Closed hubertguillemain closed 5 years ago

hubertguillemain commented 6 years ago

Would the maintainer(s) of thid repo be open to creating and maintaining the type definitions for seamless integration in typescript?

CezaryDanielNowak commented 6 years ago

Feel free to fork and create TS interface for this

JoshuaKGoldberg commented 6 years ago

FWIW, I've found it not to be worth the effort to keep a repo's typings updated - putting them on DefinitelyTyped tends to be more seamless.

feimosi commented 6 years ago

If anyone needs, here are the typings for v1.2.3

declare module 'react-dotdotdot' {
  import * as React from 'react';

  export interface DotdotdotProps {
    children?: React.ReactNode,
    clamp: string | number | boolean,
    truncationChar?: string,
    useNativeClamp?: boolean,
    className?: string,
    tagName?: string,
  }

  export default class Dotdotdot extends React.Component<DotdotdotProps> { }
}
CezaryDanielNowak commented 5 years ago

It's a part of 1.2.4