-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the fabric-only CSS aliases experimental (#37338)
Summary: Pull Request resolved: #37338 Changelog: [General] [Changed] - Change the way types for New Architecture/experimental APIs are exposed. Reviewed By: NickGerleman Differential Revision: D45699522 fbshipit-source-id: 9265ce0c0964bf2e967624cb4d81c2c8a58cfbe7
- Loading branch information
1 parent
2668f50
commit f9bf14d
Showing
2 changed files
with
137 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
|
||
/** | ||
* These are types for things that are present for New Architecture enabled apps | ||
* which is currently considered experimental. | ||
* | ||
* To load the types declared here in an actual project, there are three ways. | ||
* | ||
* 1. If your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section, | ||
* is to add `"react-native/types/experimental"` to the `"types"` array. | ||
* | ||
* 2. Alternatively, a specific import syntax can to be used from a typescript file. | ||
* This module does not exist in reality, which is why the {} is important: | ||
* | ||
* ```ts | ||
* import {} from 'react-native/types/experimental' | ||
* ``` | ||
* | ||
* 3. It is also possible to include it through a triple-slash reference: | ||
* | ||
* ```ts | ||
* /// <reference types="react-native/types/experimental" /> | ||
* ``` | ||
* | ||
* Either the import or the reference only needs to appear once, anywhere in the project. | ||
*/ | ||
|
||
import {DimensionValue} from 'react-native/Libraries/StyleSheet/StyleSheetTypes'; | ||
|
||
export {}; | ||
|
||
declare module '.' { | ||
export interface FlexStyle { | ||
/** | ||
* Equivalent to `top`, `bottom`, `right` and `left` | ||
*/ | ||
inset?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `top`, `bottom` | ||
*/ | ||
insetBlock?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `bottom` | ||
*/ | ||
insetBlockEnd?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `top` | ||
*/ | ||
insetBlockStart?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `right` and `left` | ||
*/ | ||
insetInline?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `right` or `left` | ||
*/ | ||
insetInlineEnd?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `right` or `left` | ||
*/ | ||
insetInlineStart?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `marginVertical` | ||
*/ | ||
marginBlock?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `marginBottom` | ||
*/ | ||
marginBlockEnd?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `marginTop` | ||
*/ | ||
marginBlockStart?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `marginHorizontal` | ||
*/ | ||
marginInline?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `marginEnd` | ||
*/ | ||
marginInlineEnd?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `marginStart` | ||
*/ | ||
marginInlineStart?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `paddingVertical` | ||
*/ | ||
paddingBlock?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `paddingBottom` | ||
*/ | ||
paddingBlockEnd?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `paddingTop` | ||
*/ | ||
paddingBlockStart?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `paddingHorizontal` | ||
*/ | ||
paddingInline?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `paddingEnd` | ||
*/ | ||
paddingInlineEnd?: DimensionValue | undefined; | ||
|
||
/** | ||
* Equivalent to `paddingStart` | ||
*/ | ||
paddingInlineStart?: DimensionValue | undefined; | ||
} | ||
} |