File tree Expand file tree Collapse file tree 3 files changed +10
-14
lines changed
Expand file tree Collapse file tree 3 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ function sortRanges(ranges: MarkdownRange[]) {
2222}
2323
2424function groupRanges ( ranges : MarkdownRange [ ] ) {
25- const lastVisibleRangeIndex : { [ key in MarkdownType ] ?: number } = { } ;
25+ const lastVisibleRangeIndex : Partial < Record < MarkdownType , number > > = { } ;
2626
2727 return ranges . reduce ( ( acc , range ) => {
2828 const start = range . start ;
Original file line number Diff line number Diff line change @@ -4,17 +4,13 @@ const ANIMATED_ELEMENT_TYPES = ['spinner'] as const;
44
55type AnimatedElementType = ( typeof ANIMATED_ELEMENT_TYPES ) [ number ] ;
66
7- type AnimationTimes = {
8- [ key in AnimatedElementType ] ?: CSSNumberish [ ] ;
9- } ;
7+ type AnimationTimes = Partial < Record < AnimatedElementType , CSSNumberish [ ] > > ;
108
11- const KEYFRAMES : {
12- [ key in AnimatedElementType ] ?: Keyframe [ ] ;
13- } = {
9+ const KEYFRAMES : Partial < Record < AnimatedElementType , Keyframe [ ] > > = {
1410 spinner : [ { transform : 'rotate(0deg)' } , { transform : 'rotate(360deg)' } ] ,
1511} ;
1612
17- const OPTIONS : { [ key in AnimatedElementType ] ?: KeyframeAnimationOptions } = {
13+ const OPTIONS : Partial < Record < AnimatedElementType , KeyframeAnimationOptions > > = {
1814 spinner : {
1915 duration : 1000 ,
2016 iterations : Infinity ,
Original file line number Diff line number Diff line change @@ -6,27 +6,27 @@ import {mergeMarkdownStyleWithDefault} from '../../styleUtils';
66let createReactDOMStyle : ( style : any ) => any ;
77try {
88 createReactDOMStyle =
9- // eslint-disable-next-line @typescript-eslint/no-var-requires
9+ // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports
1010 require ( 'react-native-web/dist/exports/StyleSheet/compiler/createReactDOMStyle' ) . default ;
11- } catch ( e ) {
11+ } catch {
1212 throw new Error ( '[react-native-live-markdown] Function `createReactDOMStyle` from react-native-web not found. Please make sure that you are using React Native Web 0.18 or newer.' ) ;
1313}
1414
1515let preprocessStyle : ( style : any ) => any ;
1616try {
1717 preprocessStyle =
18- // eslint-disable-next-line @typescript-eslint/no-var-requires
18+ // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports
1919 require ( 'react-native-web/dist/exports/StyleSheet/preprocess' ) . default ;
20- } catch ( e ) {
20+ } catch {
2121 throw new Error ( '[react-native-live-markdown] Function `preprocessStyle` from react-native-web not found.' ) ;
2222}
2323
2424let dangerousStyleValue : ( name : string , value : any , isCustomProperty : boolean ) => any ;
2525try {
2626 dangerousStyleValue =
27- // eslint-disable-next-line @typescript-eslint/no-var-requires
27+ // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports
2828 require ( 'react-native-web/dist/modules/setValueForStyles/dangerousStyleValue' ) . default ;
29- } catch ( e ) {
29+ } catch {
3030 throw new Error ( '[react-native-live-markdown] Function `dangerousStyleValue` from react-native-web not found.' ) ;
3131}
3232
You can’t perform that action at this time.
0 commit comments