import { CSSProperties } from 'react'; import { StyleSheet, TextStyle } from 'react-native'; import normalizeStylesheet from './normalizeStylesheet'; type HljsStylsheet = Record; export type HighlighterStylesheets = ReturnType; export default function createStylesheets(hljsStylesheet: HljsStylsheet) { const normalizedStyles = normalizeStylesheet(hljsStylesheet); const { backgroundColor, color } = normalizedStyles.hljs; const containerStylesheet = StyleSheet.create({ container: { backgroundColor: backgroundColor as string }, text: { color } }); const contentStylesheet = StyleSheet.create( normalizedStyles as Record ); return { containerStylesheet, contentStylesheet }; }