diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..c934993 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,27 @@ +import React from 'react'; +import { StyleProp, TextStyle, ViewStyle, LayoutChangeEvent, NativeSyntheticEvent, TextLayoutEventData } from 'react-native'; + +export interface ReadMoreProps { + style?: StyleProp; + seeMoreStyle?: StyleProp; + seeLessStyle?: StyleProp; + wrapperStyle?: StyleProp; + children?: React.ReactNode; + numberOfLines?: number; + seeMoreText?: string; + seeLessText?: string; + animate?: boolean; + customTextComponent?: React.ReactNode; + ellipsis?: string; + allowFontScaling?: boolean; + onExpand?: () => void; + onCollapse?: () => void; + expandOnly?: boolean; + seeMoreOverlapCount?: number; + debounceSeeMoreCalc?: number; + onLayout?: (event: LayoutChangeEvent) => void; + onTextLayout?: (event: NativeSyntheticEvent) => void; + onReady?: () => void; +} +declare const ReadMore: React.FC; +export default ReadMore; \ No newline at end of file diff --git a/package.json b/package.json index 63d2e4d..70d96d7 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "name": "@fawazahmed/react-native-read-more", - "version": "2.2.2", + "version": "2.3.0", "description": "A simple react native library to show large blocks of text in a condensed manner with the ability to collapse and expand.", "main": "index.js", + "types": "index.d.ts", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" },