diff --git a/package-lock.json b/package-lock.json index e5064a5ddc9..75e2df14d2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,6 +44,7 @@ "eslint-plugin-vue": "^9.5.1", "esm": "^3.2.25", "flow-remove-types": "^1.2.3", + "fs-extra": "^11.1.1", "got": "^12.1.0", "husky": "^7.0.4", "is-ci": "^2.0.0", @@ -62,6 +63,7 @@ "rimraf": "^2.6.3", "rollup": "^2.79.1", "rollup-plugin-api-extractor": "^0.2.5", + "rollup-plugin-copy": "^3.4.0", "rollup-plugin-dts": "^4.2.3", "rollup-plugin-flow-no-whitespace": "^1.0.0", "rollup-plugin-typescript2": "^0.34.0", @@ -2122,6 +2124,20 @@ "node": ">=v12" } }, + "node_modules/@commitlint/read/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://mirrors.tencent.com/npm/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@commitlint/resolve-extends": { "version": "16.2.1", "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-16.2.1.tgz", @@ -6017,6 +6033,15 @@ "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "dev": true }, + "node_modules/@types/fs-extra": { + "version": "8.1.2", + "resolved": "https://mirrors.tencent.com/npm/@types/fs-extra/-/fs-extra-8.1.2.tgz", + "integrity": "sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", @@ -12505,9 +12530,9 @@ "dev": true }, "node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "version": "11.1.1", + "resolved": "https://mirrors.tencent.com/npm/fs-extra/-/fs-extra-11.1.1.tgz", + "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", "dev": true, "dependencies": { "graceful-fs": "^4.2.0", @@ -12515,7 +12540,7 @@ "universalify": "^2.0.0" }, "engines": { - "node": ">=12" + "node": ">=14.14" } }, "node_modules/fs-minipass": { @@ -18381,6 +18406,20 @@ "node": ">=8" } }, + "node_modules/nx/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://mirrors.tencent.com/npm/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/nx/node_modules/glob": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", @@ -21153,6 +21192,79 @@ "tslib": "*" } }, + "node_modules/rollup-plugin-copy": { + "version": "3.4.0", + "resolved": "https://mirrors.tencent.com/npm/rollup-plugin-copy/-/rollup-plugin-copy-3.4.0.tgz", + "integrity": "sha512-rGUmYYsYsceRJRqLVlE9FivJMxJ7X6jDlP79fmFkL8sJs7VVMSVyA2yfyL+PGyO/vJs4A87hwhgVfz61njI+uQ==", + "dev": true, + "dependencies": { + "@types/fs-extra": "^8.0.1", + "colorette": "^1.1.0", + "fs-extra": "^8.1.0", + "globby": "10.0.1", + "is-plain-object": "^3.0.0" + }, + "engines": { + "node": ">=8.3" + } + }, + "node_modules/rollup-plugin-copy/node_modules/colorette": { + "version": "1.4.0", + "resolved": "https://mirrors.tencent.com/npm/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", + "dev": true + }, + "node_modules/rollup-plugin-copy/node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://mirrors.tencent.com/npm/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/rollup-plugin-copy/node_modules/globby": { + "version": "10.0.1", + "resolved": "https://mirrors.tencent.com/npm/globby/-/globby-10.0.1.tgz", + "integrity": "sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==", + "dev": true, + "dependencies": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/rollup-plugin-copy/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://mirrors.tencent.com/npm/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/rollup-plugin-copy/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://mirrors.tencent.com/npm/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/rollup-plugin-dts": { "version": "4.2.3", "resolved": "https://mirrors.tencent.com/npm/rollup-plugin-dts/-/rollup-plugin-dts-4.2.3.tgz", @@ -21228,6 +21340,20 @@ "node": ">= 8.0.0" } }, + "node_modules/rollup-plugin-typescript2/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://mirrors.tencent.com/npm/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/rollup-pluginutils": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz", @@ -25679,6 +25805,19 @@ "@commitlint/types": "^16.2.1", "fs-extra": "^10.0.0", "git-raw-commits": "^2.0.0" + }, + "dependencies": { + "fs-extra": { + "version": "10.1.0", + "resolved": "https://mirrors.tencent.com/npm/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + } } }, "@commitlint/resolve-extends": { @@ -28788,6 +28927,15 @@ "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "dev": true }, + "@types/fs-extra": { + "version": "8.1.2", + "resolved": "https://mirrors.tencent.com/npm/@types/fs-extra/-/fs-extra-8.1.2.tgz", + "integrity": "sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", @@ -33779,9 +33927,9 @@ "dev": true }, "fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "version": "11.1.1", + "resolved": "https://mirrors.tencent.com/npm/fs-extra/-/fs-extra-11.1.1.tgz", + "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", "dev": true, "requires": { "graceful-fs": "^4.2.0", @@ -38290,6 +38438,17 @@ "micromatch": "^4.0.4" } }, + "fs-extra": { + "version": "10.1.0", + "resolved": "https://mirrors.tencent.com/npm/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, "glob": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", @@ -40392,6 +40551,69 @@ "@microsoft/api-extractor": "^7.19.0" } }, + "rollup-plugin-copy": { + "version": "3.4.0", + "resolved": "https://mirrors.tencent.com/npm/rollup-plugin-copy/-/rollup-plugin-copy-3.4.0.tgz", + "integrity": "sha512-rGUmYYsYsceRJRqLVlE9FivJMxJ7X6jDlP79fmFkL8sJs7VVMSVyA2yfyL+PGyO/vJs4A87hwhgVfz61njI+uQ==", + "dev": true, + "requires": { + "@types/fs-extra": "^8.0.1", + "colorette": "^1.1.0", + "fs-extra": "^8.1.0", + "globby": "10.0.1", + "is-plain-object": "^3.0.0" + }, + "dependencies": { + "colorette": { + "version": "1.4.0", + "resolved": "https://mirrors.tencent.com/npm/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", + "dev": true + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://mirrors.tencent.com/npm/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "globby": { + "version": "10.0.1", + "resolved": "https://mirrors.tencent.com/npm/globby/-/globby-10.0.1.tgz", + "integrity": "sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://mirrors.tencent.com/npm/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://mirrors.tencent.com/npm/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, "rollup-plugin-dts": { "version": "4.2.3", "resolved": "https://mirrors.tencent.com/npm/rollup-plugin-dts/-/rollup-plugin-dts-4.2.3.tgz", @@ -40444,6 +40666,17 @@ "estree-walker": "^2.0.1", "picomatch": "^2.2.2" } + }, + "fs-extra": { + "version": "10.1.0", + "resolved": "https://mirrors.tencent.com/npm/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } } } }, diff --git a/package.json b/package.json index 16d1d1150d0..2978cafc44b 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "eslint-plugin-vue": "^9.5.1", "esm": "^3.2.25", "flow-remove-types": "^1.2.3", + "fs-extra": "^11.1.1", "got": "^12.1.0", "husky": "^7.0.4", "is-ci": "^2.0.0", @@ -81,6 +82,7 @@ "rimraf": "^2.6.3", "rollup": "^2.79.1", "rollup-plugin-api-extractor": "^0.2.5", + "rollup-plugin-copy": "^3.4.0", "rollup-plugin-dts": "^4.2.3", "rollup-plugin-flow-no-whitespace": "^1.0.0", "rollup-plugin-typescript2": "^0.34.0", diff --git a/packages/global.d.ts b/packages/global.d.ts index d8d01bef1ca..bdb6a106c75 100644 --- a/packages/global.d.ts +++ b/packages/global.d.ts @@ -73,129 +73,233 @@ declare namespace HippyTypes { height: number | undefined; } - export interface Transform { - perspective?: number; - rotate?: string; - rotateX?: string; - rotateY?: string; - rotateZ?: string; - scale?: number; - scaleX?: number; - scaleY?: number; - translateX?: number; - translateY?: number; - skewX?: string; - skewY?: string; - } - - export type color = string | number; - export type colors = string[] | number[]; - export type backgroundColor = string | number; - export type tintColor = string | number; - export type tintColors = string[] | number[] | null; - export type position = - | 'relative' - | 'absolute'; - export type flexDirection = - | 'row' - | 'column' - | 'row-reverse'; - export type flexWrap = - | 'nowrap' - | 'wrap' - | 'wrap-reverse'; - export type justifyContent = - | 'start' - | 'center' - | 'end' + export type Color = string | number; + export type Colors = Color[]; + export type tintColor = Color; + export type tintColors = Colors; + + export type FlexAlignType = | 'flex-start' | 'flex-end' - | 'left' - | 'right' - | 'normal' - | 'space-between' - | 'space-around' - | 'space-evenly' - | 'stretch'; - export type alignItems = - | 'stretch' | 'center' + | 'stretch' + | 'baseline'; + + export type DimensionValue = + | number + | 'auto' + | Animation + | AnimationSet; + + export interface FlexStyle { + alignContent?: | 'flex-start' | 'flex-end' - | 'baseline'; - export type alignSelf = - | 'stretch' | 'center' + | 'stretch' + | 'space-between' + | 'space-around'; + alignItems?: FlexAlignType; + alignSelf?: 'auto' | FlexAlignType; + aspectRatio?: number | string; + bottom?: DimensionValue; + collapse?: boolean; + collapsable?: boolean; + display?: 'none' | 'flex'; + flex?: number; + flexBasis?: DimensionValue; + flexDirection?: + | 'row' + | 'column' + | 'row-reverse' + | 'column-reverse' + ; + rowGap?: number; + gap?: number; + columnGap?: number; + flexGrow?: number; + flexShrink?: number; + flexWrap?: 'wrap' | 'nowrap' | 'wrap-reverse'; + height?: DimensionValue; + justifyContent?: | 'flex-start' | 'flex-end' - | 'baseline'; - export type overflow = - | 'hidden' - | 'scroll'; - export interface BaseStyle { - color?: color; - colors?: colors; - collapsable?: false; - backgroundColor?: backgroundColor; - backgroundImage?: string; - backgroundSize?: string; - backgroundPosition?: string; - width?: number; - height?: number; - top?: number; - left?: number; - right?: number; - bottom?: number; - minWidth?: number; - maxWidth?: number; - minHeight?: number; - maxHeight?: number; - margin?: number; - marginVertical?: number; - marginHorizontal?: number; - marginTop?: number; - marginBottom?: number; - marginLeft?: number; - marginRight?: number; - padding?: number; - paddingVertical?: number; - paddingHorizontal?: number; - paddingTop?: number; - paddingBottom?: number; - paddingLeft?: number; - paddingRight?: number; + | 'center' + | 'space-between' + | 'space-around' + | 'space-evenly' + ; + left?: DimensionValue; + margin?: DimensionValue; + marginBottom?: DimensionValue; + marginHorizontal?: DimensionValue; + marginLeft?: DimensionValue; + marginRight?: DimensionValue; + marginTop?: DimensionValue; + marginVertical?: DimensionValue; + maxHeight?: DimensionValue; + maxWidth?: DimensionValue; + minHeight?: DimensionValue; + minWidth?: DimensionValue; + overflow?: 'visible' | 'hidden' | 'scroll'; + padding?: DimensionValue; + paddingBottom?: DimensionValue; + paddingHorizontal?: DimensionValue; + paddingLeft?: DimensionValue; + paddingRight?: DimensionValue; + paddingTop?: DimensionValue; + paddingVertical?: DimensionValue; + position?: 'absolute' | 'relative'; + right?: DimensionValue; + start?: DimensionValue; + top?: DimensionValue; + width?: DimensionValue; + zIndex?: number; + } + + export interface BoxShadowStyle { + boxShadowOpacity?: number; + boxShadowRadius?: number; + boxShadowColor?: Color; + boxShadowOffsetX?: number; + boxShadowOffsetY?: number; + /** iOS only */ + boxShadowSpread?: number; + shadowColor?: string; + shadowOffset?: + | string + | { + width?: number; + height?: number; + }; + shadowOpacity?: number; + shadowRadius?: string | number; + } + + export interface Transform { + perspective?: number | Animation; + rotate?: string | Animation; + rotateX?: string | Animation; + rotateY?: string | Animation; + rotateZ?: string | Animation; + scale?: number | Animation; + scaleX?: number | Animation; + scaleY?: number | Animation; + translateX?: number | Animation; + translateY?: number | Animation; + skewX?: string | Animation; + skewY?: string | Animation; + } + + export interface TransformsStyle { + transform?: Transform[]; + } + + export type BorderStyle = 'solid' | 'dotted' | 'dashed'; + export interface BorderBoxStyle { + borderStyle?: BorderStyle; + borderTopStyle?: BorderStyle; + borderRightStyle?: BorderStyle; + borderLeftStyle?: BorderStyle; + borderBottomStyle?: BorderStyle; borderWidth?: number; borderTopWidth?: number; borderRightWidth?: number; borderBottomWidth?: number; borderLeftWidth?: number; - position?: position; - flexDirection?: flexDirection; - flexWrap?: flexWrap; - justifyContent?: justifyContent; - alignItems?: alignItems; - alignSelf?: alignSelf; - overflow?: overflow; - flex?: any; - flexGrow?: number; - flexShrink?: number; - flexBasis?: true; - zIndex?: number; - shadowColor?: string; - shadowOffset?: string; - shadowOpacity?: number; - shadowRadius?: string; + borderRadius?: number; + borderTopLeftRadius?: number; + borderTopRightRadius?: number; + borderBottomLeftRadius?: number; + borderBottomRightRadius?: number; + borderColor?: Color; + borderTopColor?: Color; + borderLeftColor?: Color; + borderBottomColor?: Color; + borderRightColor?: Color; + } + + export interface BackgroundStyle { + backgroundColor?: Color; + backgroundColors?: Colors; + backgroundImage?: string; + backgroundSize?: string; + backgroundPosition?: string; + } + + export interface ViewStyle extends FlexStyle, BoxShadowStyle, BorderBoxStyle, TransformsStyle, BackgroundStyle { + opacity?: DimensionValue; + pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto'; + } + + export type TextStyleIOS = ViewStyle; + + export interface TextStyleAndroid extends ViewStyle { + underlineColorAndroid?: string; + } + + export interface TextStyle extends TextStyleIOS, TextStyleAndroid, ViewStyle { + color?: Color; + colors?: Colors; + ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip'; + fontFamily?: string; + fontSize?: number; + fontStyle?: 'normal' | 'italic'; + /** + * Specifies font weight. The values 'normal' and 'bold' are supported + * for most fonts. Not all fonts have a variant for each of the numeric + * values, in that case the closest one is chosen. + */ + fontWeight?: + | 'normal' + | 'bold' + | '100' + | '200' + | '300' + | '400' + | '500' + | '600' + | '700' + | '800' + | '900' + ; + letterSpacing?: number; + lineHeight?: number; + textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify'; + textDecorationLine?: + | 'none' + | 'underline' + | 'line-through' + | 'underline line-through' + ; + textDecorationStyle?: 'solid' | 'double' | 'dotted' | 'dashed'; + textDecorationColor?: Color; + textShadowColor?: Color; + textShadowOffset?: {width: number; height: number}; + textShadowRadius?: number; + textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase'; + placeholderTextColor?: Color; + placeholderTextColors?: Colors; + caretColor?: Color; + } + + export interface ImageStyle extends FlexStyle, BoxShadowStyle, BorderBoxStyle, TransformsStyle, BackgroundStyle { + resizeMode?: 'cover' | 'contain' | 'stretch' | 'repeat' | 'center'; tintColor?: tintColor; tintColors?: tintColors; - underlineColorAndroid?: string; - transform?: Transform[]; - collapse?: boolean, + opacity?: DimensionValue; } - export interface Style extends BaseStyle { + export interface Style extends ViewStyle, TextStyle, ImageStyle { [props: string]: any } + type GenericStyleProp = T | T[]; + export type StyleProp = GenericStyleProp