missing typings
FDiskas opened this issue · comments
Vytenis commented
Thanks for this module.
I would like to have typings for this included directly in module
Vytenis commented
something like
declare module 'react-show-more-text' {
interface ComponentProps {
lines: number;
more: string;
less: string;
anchorClass: string;
onClick: any;
expanded: boolean;
width: number;
keepNewLines: boolean;
className: string;
}
export default ShowMoreText;
declare class ShowMoreText extends React.Component<ComponentProps, any, any> {
static defaultProps: {
lines: number;
more: string;
less: string;
anchorClass: string;
onClick: any;
expanded: boolean;
width: number;
keepNewLines: boolean;
};
_isMounted: boolean;
handleTruncate: (truncated: any) => void;
toggleLines: (event: any) => void;
truncateRef: any;
constructor(props: any);
}
}
antares-code commented
@FDiskas Thank you for your suggestion!
But the component is written in JS code not in typescript.
Vytenis commented
React also written in javascript :) but it has typings
Constantin Predescu commented
npm install -ED @types/react-show-more-text