devzonetech / react-show-more-text

Convenience wrapper around react-truncate

Home Page:https://github.com/One-com/react-truncate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

missing typings

FDiskas opened this issue · comments

Thanks for this module.
I would like to have typings for this included directly in module

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);
    }
}

@FDiskas Thank you for your suggestion!
But the component is written in JS code not in typescript.

React also written in javascript :) but it has typings

npm install -ED @types/react-show-more-text