diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..d0d32ba --- /dev/null +++ b/index.d.ts @@ -0,0 +1,59 @@ +// Type definitions for react-native-simple-markdown 1.1.0 +// Project: https://github.com/CharlesMangwa/react-native-simple-markdown +// Definitions by: Mohamed Shaban + +import { Component, ReactNode } from 'react'; +import { ViewStyle, TextStyle, ImageStyle, StyleProp } from 'react-native'; +import styles from './styles'; + +export interface ReactNativeSimpleMarkdown { } +export type ValidRules = + | 'autolink' + | 'blockQuote' + | 'br' + | 'codeBlock' + | 'del' + | 'em' + | 'heading' + | 'hr' + | 'image' + | 'inlineCode' + | 'link' + | 'list' + | 'newline' + | 'paragraph' + | 'strong' + | 'table' + | 'url'; + +interface State { + key: string; + withinText: boolean; +} + +export interface Node { + content: any; + target: string; + level: number; + items: any[]; + ordered: boolean; +} + +type Output = (content: any, state: State) => string; + +export interface Rule { + match?: any; + react?: (node: Node, output: Output, state: State) => ReactNode; +} + +export type Rules = Partial<{ [key in ValidRules]: Rule }>; + +export interface Props { + styles: { [key in keyof typeof styles]: StyleProp | StyleProp | StyleProp }; + children?: string | string[]; + rules?: Rules; + whitelist?: string[]; + blacklist?: string[]; +} + +export default class RNSMDComponent extends Component {} \ No newline at end of file