WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
This repository was archived by the owner on Jun 24, 2021. It is now read-only.

Commit ae72d70

Browse files
authored
Merge pull request #60 from andreialecu/ts-types
add typescript types
2 parents afe8390 + 058b2e5 commit ae72d70

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

index.d.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React, { ReactNode } from "react";
2+
import { StyleProp, TextStyle, TextProps } from "react-native";
3+
4+
export interface SelectableTextProps {
5+
value?: string;
6+
onSelection?: (args: {
7+
eventType: string;
8+
content: string;
9+
selectionStart: number;
10+
selectionEnd: number;
11+
}) => void;
12+
13+
menuItems?: string[];
14+
highlights?: Array<{ id: string; start: number; end: number }>;
15+
highlightColor?: string;
16+
style?: StyleProp<TextStyle>;
17+
onHighlightPress?: (id: string) => void;
18+
appendToChildren?: ReactNode;
19+
TextComponent?: ReactNode;
20+
textValueProp?: string;
21+
textComponentProps?: TextProps;
22+
}
23+
24+
export class SelectableText extends React.Component<SelectableTextProps> {}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.5.0",
44
"description": "React Native component used to provide the features of pass different context menu items and events",
55
"main": "index.js",
6+
"types": "index.d.ts",
67
"homepage": "https://github.com/Astrocoders/react-native-selectable-text",
78
"scripts": {
89
"test": "echo \"Error: no test specified\" && exit 1"

0 commit comments

Comments
 (0)