import type {
    TouchableOpacityProps,
    ImageProps,
    StyleProp,
    TextProps,
    TextStyle,
    ViewProps,
    ViewStyle
} from "react-native";
import type ITextProps from "../text/type";

export type MarkdownDynamicStyles = {
    radiuses: NCoreUIKit.ActivePalette["radiuses"];
    colors: NCoreUIKit.ActivePalette["colors"];
    spaces: NCoreUIKit.ActivePalette["spaces"];
};

export type MarkdownObject = {
    type?: "text" | "list" | "image" | "space" | "code" | "blockquote" | "center" | "right" | "left" | "link";
    resizeMode?: "cover" | "contain" | "center" | "none" | "repeat" | "stretch";
    nativeType: MarkdownKeys | "image" | "center" | "right" | "left" | "link";
    variant?: keyof NCoreUIKit.Typography;
    size?: Array<number | string>;
    content: string;
    url?: string;
    key: number;
};

export type TextMarkdownTypes = "# " |
    "## " |
    "### " |
    "#### " |
    "##### " |
    "###### " |
    "<p>";

export type EnterMarkdownTypes = "<br/>" | "";

export type CodeMarkdownTypes = "```";

export type BlockquoteTypes = "<<";

export type ListTypes = "* " | "- ";

export type MarkdownKeys = TextMarkdownTypes | EnterMarkdownTypes | CodeMarkdownTypes | BlockquoteTypes | ListTypes;

interface IMarkdownViewerProps extends ViewProps {
    blockquoteIconStyle?: StyleProp<ViewStyle>[] | StyleProp<ViewStyle>;
    blockquoteTextColor?: keyof NCoreUIKit.TextContentColors;
    blockquoteIconColor?: keyof NCoreUIKit.IconContentColors;
    style?: StyleProp<ViewStyle>[] | StyleProp<ViewStyle>;
    codeTextColor?: keyof NCoreUIKit.TextContentColors;
    blockquoteIconSize?: keyof NCoreUIKit.Typography;
    linkContainerProps?: TouchableOpacityProps;
    centerMarkdownProps?: IMarkdownViewerProps;
    blockquoteTextStyle?: ITextProps["style"];
    rightMarkdownProps?: IMarkdownViewerProps;
    leftMarkdownProps?: IMarkdownViewerProps;
    linkMarkdownProps?: IMarkdownViewerProps;
    blockquoteContainerProps?: ViewProps;
    centerContainerProps?: ViewProps;
    rightContainerProps?: ViewProps;
    leftContainerProps?: ViewProps;
    codeContainerProps?: ViewProps;
    listContainerProps?: ViewProps;
    italicTextProps?: TextProps;
    enterTextProps?: ITextProps;
    codeTextProps?: ITextProps;
    listTextProps?: ITextProps;
    listIconProps?: ITextProps;
    boldTextProps?: TextProps;
    imageProps?: ImageProps;
    customTextProps?: Record<
        TextMarkdownTypes,
        ITextProps
    >;
    customTextStyles?: Record<
        TextMarkdownTypes,
        ITextProps["style"]
    >;
    italicStyle?: TextStyle;
    boldStyle?: TextStyle;
    content: string;
};
export type {
    IMarkdownViewerProps as default
};
