Files
mattermost-mobile/types/global/markdown.ts
Elias Nahum 0c0f92a237 [Gekidou] Markdown SVG & image size support (#6032)
* Support Markdown svg and custom size inline images

* remove commonmark patches

* move getMarkdownImageSize to @utils/markdown

* Fix worklet not present while running unit tests that use calculateDimensions

* Set max size for SVG

* Set svg dimensions based on calculated size

* feedback review
2022-03-10 09:03:09 -03:00

49 lines
991 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {TextStyle, ViewStyle} from 'react-native';
export type UserMentionKey= {
key: string;
caseSensitive?: boolean;
};
export type MarkdownBlockStyles = {
adjacentParagraph: ViewStyle;
horizontalRule: ViewStyle;
quoteBlockIcon: TextStyle;
};
export type MarkdownTextStyles = {
[key: string]: TextStyle;
};
export type MarkdownAtMentionRenderer = {
context: string[];
mentionName: string;
}
export type MarkdownBaseRenderer = {
context: string[];
literal: string;
}
export type MarkdownChannelMentionRenderer = {
context: string[];
channelName: string;
}
export type MarkdownEmojiRenderer = MarkdownBaseRenderer & {
emojiName: string;
}
export type MarkdownImageRenderer = {
linkDestination?: string;
context: string[];
src: string;
size?: {
width?: number;
height?: number;
};
}