File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ declare module 'react-native-parsed-text' {
2+ import { Component } from 'react' ;
3+ import { TextProps } from 'react-native' ;
4+
5+ interface BaseParseShape extends Pick < TextProps , Exclude < keyof TextProps , 'onPress' | 'onLongPress' > > {
6+ renderText ?: ( matchingString : string ) => string ;
7+ onPress ?: ( text : string , index : number ) => void ;
8+ onLongPress ?: ( text : string , index : number ) => void ;
9+ }
10+
11+ interface DefaultParseShape extends BaseParseShape {
12+ type : 'url' | 'phone' | 'email' ;
13+ }
14+
15+ interface CustomParseShape extends BaseParseShape {
16+ pattern : string | RegExp ;
17+ }
18+
19+ type ParseShape = DefaultParseShape | CustomParseShape ;
20+
21+ export interface ParsedTextProps extends TextProps {
22+ parse ?: ParseShape [ ] ;
23+ childrenProps ?: TextProps ;
24+ }
25+
26+ export default class ParsedText extends Component < ParsedTextProps > { }
27+ }
You can’t perform that action at this time.
0 commit comments