|
| 1 | +/** |
| 2 | + * These are types for things that are present for New Architecture enabled apps |
| 3 | + * which is currently considered experimental. |
| 4 | + * |
| 5 | + * To load the types declared here in an actual project, there are three ways. |
| 6 | + * |
| 7 | + * 1. If your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section, |
| 8 | + * is to add `"react-native/types/experimental"` to the `"types"` array. |
| 9 | + * |
| 10 | + * 2. Alternatively, a specific import syntax can to be used from a typescript file. |
| 11 | + * This module does not exist in reality, which is why the {} is important: |
| 12 | + * |
| 13 | + * ```ts |
| 14 | + * import {} from 'react-native/types/experimental' |
| 15 | + * ``` |
| 16 | + * |
| 17 | + * 3. It is also possible to include it through a triple-slash reference: |
| 18 | + * |
| 19 | + * ```ts |
| 20 | + * /// <reference types="react-native/types/experimental" /> |
| 21 | + * ``` |
| 22 | + * |
| 23 | + * Either the import or the reference only needs to appear once, anywhere in the project. |
| 24 | + */ |
| 25 | + |
| 26 | +import {DimensionValue} from '../Libraries/StyleSheet/StyleSheetTypes'; |
| 27 | + |
| 28 | +export {}; |
| 29 | + |
| 30 | +declare module '.' { |
| 31 | + export interface FlexStyle { |
| 32 | + /** |
| 33 | + * Equivalent to `marginVertical` |
| 34 | + */ |
| 35 | + marginBlock?: DimensionValue | undefined; |
| 36 | + |
| 37 | + /** |
| 38 | + * Equivalent to `marginBottom` |
| 39 | + */ |
| 40 | + marginBlockEnd?: DimensionValue | undefined; |
| 41 | + |
| 42 | + /** |
| 43 | + * Equivalent to `marginTop` |
| 44 | + */ |
| 45 | + marginBlockStart?: DimensionValue | undefined; |
| 46 | + |
| 47 | + /** |
| 48 | + * Equivalent to `marginHorizontal` |
| 49 | + */ |
| 50 | + marginInline?: DimensionValue | undefined; |
| 51 | + |
| 52 | + /** |
| 53 | + * Equivalent to `marginEnd` |
| 54 | + */ |
| 55 | + marginInlineEnd?: DimensionValue | undefined; |
| 56 | + |
| 57 | + /** |
| 58 | + * Equivalent to `marginStart` |
| 59 | + */ |
| 60 | + marginInlineStart?: DimensionValue | undefined; |
| 61 | + |
| 62 | + /** |
| 63 | + * Equivalent to `paddingVertical` |
| 64 | + */ |
| 65 | + paddingBlock?: DimensionValue | undefined; |
| 66 | + |
| 67 | + /** |
| 68 | + * Equivalent to `paddingBottom` |
| 69 | + */ |
| 70 | + paddingBlockEnd?: DimensionValue | undefined; |
| 71 | + |
| 72 | + /** |
| 73 | + * Equivalent to `paddingTop` |
| 74 | + */ |
| 75 | + paddingBlockStart?: DimensionValue | undefined; |
| 76 | + |
| 77 | + /** |
| 78 | + * Equivalent to `paddingHorizontal` |
| 79 | + */ |
| 80 | + paddingInline?: DimensionValue | undefined; |
| 81 | + |
| 82 | + /** |
| 83 | + * Equivalent to `paddingEnd` |
| 84 | + */ |
| 85 | + paddingInlineEnd?: DimensionValue | undefined; |
| 86 | + |
| 87 | + /** |
| 88 | + * Equivalent to `paddingStart` |
| 89 | + */ |
| 90 | + paddingInlineStart?: DimensionValue | undefined; |
| 91 | + } |
| 92 | +} |
0 commit comments