diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..e27f7bb --- /dev/null +++ b/index.d.ts @@ -0,0 +1,58 @@ +declare module 'react-native-easy-markdown' { + import React from 'react'; + import { StyleProp, TextStyle, ViewProps, ViewStyle } from 'react-native'; + + export enum TextType { + h1 = 'h1', + h2 = 'h2', + h3 = 'h3', + h4 = 'h4', + h5 = 'h5', + h6 = 'h6', + strong = 'strong', + del = 'del', + em = 'em', + u = 'u', + }; + + interface IProps { + debug?: boolean; + parseInline?: boolean; + useDefaultStyles?: boolean; + renderImage?: (src: string, alt: string, title: string, key: string) => React.ReactNode; + renderLink?: (href: string, title: string, children: React.ReactNode, key: string, extraThing: boolean) => React.ReactNode; + renderListBullet?: (ordered: boolean, index: number) => React.ReactNode; + renderLine?: (key: string) => React.ReactNode; + renderText?: (children: React.ReactNode, key: string, extras: { styles: StyleProp }, textType: TextType) => React.ReactNode; + renderBlockQuote?: (children: React.ReactNode, key: string) => React.ReactNode; + renderBlockText?: (children: React.ReactNode, key: string) => React.ReactNode; + renderBlock?: (children: React.ReactNode, key: string) => React.ReactNode; + markdownStyles?: { + block?: StyleProp; + blockQuote?: StyleProp; + del?: StyleProp; + em?: StyleProp; + h1?: StyleProp; + h2?: StyleProp; + h3?: StyleProp; + h4?: StyleProp; + h5?: StyleProp; + h6?: StyleProp; + hr?: StyleProp; + image?: StyleProp; + imageWrapper?: StyleProp; + link?: StyleProp; + linkWrapper?: StyleProp; + list?: StyleProp; + listItem?: StyleProp; + listItemBullet?: StyleProp; + listItemContent?: StyleProp; + listItemNumber?: StyleProp; + strong?: StyleProp; + text?: StyleProp; + u?: StyleProp; + }; + }; + + export default class Markdown extends React.Component {} +}