File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-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' > > {
6+ renderText ?: ( matchingString : string ) => string ;
7+ onPress ?: ( text : string , index : number ) => void ;
8+ }
9+
10+ interface DefaultParseShape extends BaseParseShape {
11+ type : 'url' | 'phone' | 'email' ;
12+ }
13+
14+ interface CustomParseShape extends BaseParseShape {
15+ pattern : string | RegExp ;
16+ }
17+
18+ type ParseShape = DefaultParseShape | CustomParseShape ;
19+
20+ export interface ParsedTextProps extends TextProps {
21+ parse ?: ParseShape [ ] ;
22+ childrenProps ?: TextProps ;
23+ }
24+
25+ export default class ParsedText extends Component < ParsedTextProps > { }
26+ }
You can’t perform that action at this time.
0 commit comments