Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #60 from andreialecu/ts-types
Browse files Browse the repository at this point in the history
add typescript types
  • Loading branch information
georgelima authored Aug 3, 2020
2 parents afe8390 + 058b2e5 commit ae72d70
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React, { ReactNode } from "react";
import { StyleProp, TextStyle, TextProps } from "react-native";

export interface SelectableTextProps {
value?: string;
onSelection?: (args: {
eventType: string;
content: string;
selectionStart: number;
selectionEnd: number;
}) => void;

menuItems?: string[];
highlights?: Array<{ id: string; start: number; end: number }>;
highlightColor?: string;
style?: StyleProp<TextStyle>;
onHighlightPress?: (id: string) => void;
appendToChildren?: ReactNode;
TextComponent?: ReactNode;
textValueProp?: string;
textComponentProps?: TextProps;
}

export class SelectableText extends React.Component<SelectableTextProps> {}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.5.0",
"description": "React Native component used to provide the features of pass different context menu items and events",
"main": "index.js",
"types": "index.d.ts",
"homepage": "https://github.com/Astrocoders/react-native-selectable-text",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down

0 comments on commit ae72d70

Please sign in to comment.