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 
8 #pragma once
9 
10 #include <folly/dynamic.h>
11 #include <memory>
12 #include <string>
13 
14 namespace ABI49_0_0facebook {
15 namespace ABI49_0_0React {
16 
17 /*
18  * `Tag` and `InstanceHandle` are used to address ABI49_0_0React Native components.
19  */
20 using Tag = int32_t;
21 using InstanceHandle = struct InstanceHandleDummyStruct {
22 } *;
23 
24 /*
25  * An id of a running Surface instance that is used to refer to the instance.
26  */
27 using SurfaceId = int32_t;
28 
29 /*
30  * Universal component handle which allows to refer to `ComponentDescriptor`s
31  * in maps efficiently.
32  * Practically, it's something that concrete ShadowNode and concrete
33  * ComponentDescriptor have in common.
34  */
35 using ComponentHandle = int64_t;
36 
37 /*
38  * String identifier for components used for addressing them from
39  * JavaScript side.
40  */
41 using ComponentName = char const *;
42 
43 /*
44  * Defines how visual side effects (views, images, text, and so on) are
45  * mounted (on not) on the screen.
46  */
47 enum class DisplayMode {
48   /*
49    * The surface is running normally. All visual side-effects will be rendered
50    * on the screen.
51    */
52   Visible = 0,
53 
54   /*
55    * The surface is `Suspended`. All new (committed after switching to the
56    * mode) visual side-effects will *not* be mounted on the screen (the screen
57    * will stop updating).
58    *
59    * The mode can be used for preparing a surface for possible future use.
60    * The surface will be prepared without spending computing resources
61    * on mounting, and then can be instantly mounted if needed.
62    */
63   Suspended = 1,
64 
65   /*
66    * The surface is `Hidden`. All previously mounted visual side-effects
67    * will be unmounted, and all new (committed after switching to the mode)
68    * visual side-effects will *not* be mounted on the screen until the mode is
69    * switched back to `normal`.
70    *
71    * The mode can be used for temporarily freeing computing resources of
72    * off-the-screen surfaces.
73    */
74   Hidden = 2,
75 };
76 
77 } // namespace ABI49_0_0React
78 } // namespace ABI49_0_0facebook
79