UNPKG

1.77 kBTypeScriptView Raw
1/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @format
8 */
9
10/**
11 * These are types for things that are present for New Architecture enabled apps
12 * which is currently considered experimental.
13 *
14 * To load the types declared here in an actual project, there are three ways.
15 *
16 * 1. If your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
17 * is to add `"react-native/types/experimental"` to the `"types"` array.
18 *
19 * 2. Alternatively, a specific import syntax can to be used from a typescript file.
20 * This module does not exist in reality, which is why the {} is important:
21 *
22 * ```ts
23 * import {} from 'react-native/types/experimental'
24 * ```
25 *
26 * 3. It is also possible to include it through a triple-slash reference:
27 *
28 * ```ts
29 * /// <reference types="react-native/types/experimental" />
30 * ```
31 *
32 * Either the import or the reference only needs to appear once, anywhere in the project.
33 */
34
35import {
36 GradientValue,
37 BlendMode,
38} from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
39
40export {};
41
42declare module '.' {
43 export interface ViewProps {
44 /**
45 * Contols whether this view, and its transitive children, are laid in a way
46 * consistent with web browsers ('strict'), or consistent with existing
47 * React Native code which may rely on incorrect behavior ('classic').
48 */
49 experimental_layoutConformance?: 'strict' | 'classic' | undefined;
50 }
51
52 export interface ViewStyle {
53 experimental_mixBlendMode?: BlendMode | undefined;
54 experimental_backgroundImage?:
55 | ReadonlyArray<GradientValue>
56 | string
57 | undefined;
58 }
59}