react-native-windows 0.71.0 → 0.71.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Directory.Build.props +1 -1
- package/Libraries/Components/Flyout/FlyoutProps.d.ts +2 -2
- package/Libraries/Components/Keyboard/KeyboardExtProps.d.ts +1 -1
- package/Libraries/Components/View/ViewWindows.d.ts +2 -2
- package/Libraries/Components/View/ViewWindowsProps.d.ts +2 -2
- package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +9 -0
- package/Microsoft.ReactNative/Views/ControlViewManager.cpp +8 -24
- package/Microsoft.ReactNative/Views/ControlViewManager.h +0 -9
- package/Microsoft.ReactNative/Views/ShadowNodeBase.cpp +13 -0
- package/Microsoft.ReactNative/Views/ShadowNodeBase.h +7 -0
- package/Microsoft.ReactNative/Views/ViewViewManager.cpp +2 -17
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/PropertySheets/NuGet.Cpp.props +2 -2
- package/package.json +5 -4
- package/types/index.d.ts +216 -0
- package/types/modules/BatchedBridge.d.ts +32 -0
- package/types/modules/Codegen.d.ts +74 -0
- package/types/modules/Devtools.d.ts +31 -0
- package/types/modules/LaunchScreen.d.ts +18 -0
- package/types/modules/globals.d.ts +577 -0
- package/types/private/TimerMixin.d.ts +19 -0
- package/types/private/Utilities.d.ts +10 -0
- package/types/public/DeprecatedPropertiesAlias.d.ts +205 -0
- package/types/public/Insets.d.ts +15 -0
- package/types/public/ReactNativeRenderer.d.ts +149 -0
- package/types/public/ReactNativeTypes.d.ts +143 -0
package/Directory.Build.props
CHANGED
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
|
|
68
68
|
<PropertyGroup Label="NuGet" Condition="'$(MSBuildProjectExtension)' == '.vcxproj'">
|
|
69
69
|
<!--See https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets#restore-target-->
|
|
70
|
-
<RestoreUseStaticGraphEvaluation Condition="'$(BuildingInsideVisualStudio)' == 'true'">true</RestoreUseStaticGraphEvaluation>
|
|
70
|
+
<RestoreUseStaticGraphEvaluation Condition="'$(BuildingInsideVisualStudio)' == 'true' AND '$(DisableRestoreUseStaticGraphEvaluation)' != 'true'">true</RestoreUseStaticGraphEvaluation>
|
|
71
71
|
</PropertyGroup>
|
|
72
72
|
|
|
73
73
|
</Project>
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { ViewProps } from 'react-native';
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export type Placement = 'top' | 'bottom' | 'left' | 'right' | 'full' | 'top-edge-aligned-left' | 'top-edge-aligned-right' | 'bottom-edge-aligned-left' | 'bottom-edge-aligned-right' | 'left-edge-aligned-top' | 'right-edge-aligned-top' | 'left-edge-aligned-bottom' | 'right-edge-aligned-bottom';
|
|
9
|
+
export type ShowMode = 'auto' | 'standard' | 'transient' | 'transient-with-dismiss-on-pointer-move-away';
|
|
10
10
|
export interface IFlyoutProps extends ViewProps {
|
|
11
11
|
horizontalOffset?: number;
|
|
12
12
|
isLightDismissEnabled?: boolean;
|
|
@@ -31,7 +31,7 @@ export interface IHandledKeyboardEvent {
|
|
|
31
31
|
code: string;
|
|
32
32
|
handledEventPhase?: HandledEventPhase;
|
|
33
33
|
}
|
|
34
|
-
export
|
|
34
|
+
export type IKeyboardEvent = RN.NativeSyntheticEvent<INativeKeyboardEvent>;
|
|
35
35
|
export interface IKeyboardProps {
|
|
36
36
|
onKeyDown?: (args: IKeyboardEvent) => void;
|
|
37
37
|
onKeyDownCapture?: (args: IKeyboardEvent) => void;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { IViewWindowsProps } from './ViewWindowsProps';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { View } from 'react-native';
|
|
9
|
-
|
|
9
|
+
type ViewWindowsType = React.ForwardRefExoticComponent<IViewWindowsProps & React.RefAttributes<View>> & View;
|
|
10
10
|
/**
|
|
11
11
|
* Same as {@link https://facebook.github.io/react-native/docs/view | react-native's View}, but with extra Windows specific functionality
|
|
12
12
|
*
|
|
@@ -15,5 +15,5 @@ declare type ViewWindowsType = React.ForwardRefExoticComponent<IViewWindowsProps
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
export declare const ViewWindows: ViewWindowsType;
|
|
18
|
-
export
|
|
18
|
+
export type ViewWindows = ViewWindowsType;
|
|
19
19
|
export {};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { IKeyboardProps } from '../Keyboard/KeyboardExtProps';
|
|
7
7
|
import { NativeSyntheticEvent, ViewProps } from 'react-native';
|
|
8
|
-
export
|
|
8
|
+
export type INativeMouseEvent = {
|
|
9
9
|
target: number;
|
|
10
10
|
identifier: number;
|
|
11
11
|
pageX: number;
|
|
@@ -25,7 +25,7 @@ export declare type INativeMouseEvent = {
|
|
|
25
25
|
ctrlKey: boolean;
|
|
26
26
|
altKey: boolean;
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type IMouseEvent = NativeSyntheticEvent<INativeMouseEvent>;
|
|
29
29
|
/**
|
|
30
30
|
* @remarks
|
|
31
31
|
* Props type for ViewWindows component
|
|
@@ -626,6 +626,15 @@ static void StyleYogaNode(
|
|
|
626
626
|
YGValue result = YGValueOrDefault(value, YGValue{YGUndefined, YGUnitPoint} /*default*/, shadowNode, key);
|
|
627
627
|
|
|
628
628
|
SetYogaUnitValueHelper(yogaNode, result, YGNodeStyleSetMaxHeight, YGNodeStyleSetMaxHeightPercent);
|
|
629
|
+
} else if (key == "rowGap") {
|
|
630
|
+
float result = NumberOrDefault(value, 0.0f /*default*/);
|
|
631
|
+
YGNodeStyleSetGap(yogaNode, YGGutterRow, result);
|
|
632
|
+
} else if (key == "columnGap") {
|
|
633
|
+
float result = NumberOrDefault(value, 0.0f /*default*/);
|
|
634
|
+
YGNodeStyleSetGap(yogaNode, YGGutterColumn, result);
|
|
635
|
+
} else if (key == "gap") {
|
|
636
|
+
float result = NumberOrDefault(value, 0.0f /*default*/);
|
|
637
|
+
YGNodeStyleSetGap(yogaNode, YGGutterAll, result);
|
|
629
638
|
} else if (key == "margin") {
|
|
630
639
|
YGValue result = YGValueOrDefault(value, YGValue{YGUndefined, YGUnitPoint} /*default*/, shadowNode, key);
|
|
631
640
|
|
|
@@ -82,16 +82,14 @@ bool ControlViewManager::UpdateProperty(
|
|
|
82
82
|
}
|
|
83
83
|
} else if (propertyName == "focusable") {
|
|
84
84
|
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Boolean) {
|
|
85
|
-
IsFocusable(propertyValue.AsBoolean());
|
|
86
|
-
control.IsTabStop(propertyValue.AsBoolean());
|
|
85
|
+
nodeToUpdate->IsFocusable(propertyValue.AsBoolean());
|
|
87
86
|
} else if (propertyValue.IsNull()) {
|
|
88
|
-
|
|
89
|
-
IsFocusable(false);
|
|
87
|
+
nodeToUpdate->IsFocusable(false);
|
|
90
88
|
}
|
|
91
89
|
} else {
|
|
92
90
|
if (propertyName == "accessible") {
|
|
93
91
|
if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Boolean) {
|
|
94
|
-
IsAccessible(propertyValue.AsBoolean());
|
|
92
|
+
nodeToUpdate->IsAccessible(propertyValue.AsBoolean());
|
|
95
93
|
}
|
|
96
94
|
}
|
|
97
95
|
ret = Super::UpdateProperty(nodeToUpdate, propertyName, propertyValue);
|
|
@@ -126,12 +124,11 @@ void ControlViewManager::OnPropertiesUpdated(ShadowNodeBase *node) {
|
|
|
126
124
|
|
|
127
125
|
// If developer specifies either the accessible and focusable prop to be false
|
|
128
126
|
// remove accessibility and keyboard focus for component.
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
127
|
+
const auto isTabStop = (node->IsAccessible() && node->IsFocusable());
|
|
128
|
+
const auto accessibilityView =
|
|
129
|
+
isTabStop ? xaml::Automation::Peers::AccessibilityView::Content : xaml::Automation::Peers::AccessibilityView::Raw;
|
|
130
|
+
control.IsTabStop(isTabStop);
|
|
131
|
+
xaml::Automation::AutomationProperties::SetAccessibilityView(control, accessibilityView);
|
|
135
132
|
}
|
|
136
133
|
|
|
137
134
|
void ControlViewManager::OnViewCreated(XamlView view) {
|
|
@@ -142,17 +139,4 @@ void ControlViewManager::OnViewCreated(XamlView view) {
|
|
|
142
139
|
}
|
|
143
140
|
}
|
|
144
141
|
|
|
145
|
-
void ControlViewManager::IsAccessible(bool accessible) {
|
|
146
|
-
m_isAccessible = accessible;
|
|
147
|
-
}
|
|
148
|
-
bool ControlViewManager::IsAccessible() {
|
|
149
|
-
return m_isAccessible;
|
|
150
|
-
}
|
|
151
|
-
void ControlViewManager::IsFocusable(bool focusable) {
|
|
152
|
-
m_isFocusable = focusable;
|
|
153
|
-
}
|
|
154
|
-
bool ControlViewManager::IsFocusable() {
|
|
155
|
-
return m_isFocusable;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
142
|
} // namespace Microsoft::ReactNative
|
|
@@ -33,15 +33,6 @@ class REACTWINDOWS_EXPORT ControlViewManager : public FrameworkElementViewManage
|
|
|
33
33
|
void OnViewCreated(XamlView view) override;
|
|
34
34
|
|
|
35
35
|
void OnPropertiesUpdated(ShadowNodeBase *node) override;
|
|
36
|
-
|
|
37
|
-
private:
|
|
38
|
-
void IsAccessible(bool accessible);
|
|
39
|
-
bool IsAccessible();
|
|
40
|
-
void IsFocusable(bool focusable);
|
|
41
|
-
bool IsFocusable();
|
|
42
|
-
|
|
43
|
-
bool m_isAccessible = true;
|
|
44
|
-
bool m_isFocusable = true;
|
|
45
36
|
};
|
|
46
37
|
|
|
47
38
|
} // namespace Microsoft::ReactNative
|
|
@@ -166,4 +166,17 @@ void ShadowNodeBase::RedBox(const std::string &message) const noexcept {
|
|
|
166
166
|
GetViewManager()->GetReactContext().CallJSFunction("RCTLog", "logToConsole", folly::dynamic::array("error", message));
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
+
void ShadowNodeBase::IsAccessible(bool accessible) {
|
|
170
|
+
m_isAccessible = accessible;
|
|
171
|
+
}
|
|
172
|
+
bool ShadowNodeBase::IsAccessible() {
|
|
173
|
+
return m_isAccessible;
|
|
174
|
+
}
|
|
175
|
+
void ShadowNodeBase::IsFocusable(bool focusable) {
|
|
176
|
+
m_isFocusable = focusable;
|
|
177
|
+
}
|
|
178
|
+
bool ShadowNodeBase::IsFocusable() {
|
|
179
|
+
return m_isFocusable;
|
|
180
|
+
}
|
|
181
|
+
|
|
169
182
|
} // namespace Microsoft::ReactNative
|
|
@@ -121,9 +121,16 @@ struct REACTWINDOWS_EXPORT ShadowNodeBase : public ShadowNode {
|
|
|
121
121
|
return m_onMouseEnterRegistered || m_onMouseLeaveRegistered;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
void IsAccessible(bool accessible);
|
|
125
|
+
bool IsAccessible();
|
|
126
|
+
void IsFocusable(bool focusable);
|
|
127
|
+
bool IsFocusable();
|
|
128
|
+
|
|
124
129
|
protected:
|
|
125
130
|
XamlView m_view;
|
|
126
131
|
bool m_updating = false;
|
|
132
|
+
bool m_isFocusable = true;
|
|
133
|
+
bool m_isAccessible = true;
|
|
127
134
|
comp::CompositionPropertySet m_transformPS{nullptr};
|
|
128
135
|
|
|
129
136
|
public:
|
|
@@ -47,6 +47,8 @@ class ViewShadowNode : public ShadowNodeBase {
|
|
|
47
47
|
Super::createView(props);
|
|
48
48
|
|
|
49
49
|
auto panel = GetPanel();
|
|
50
|
+
IsAccessible(false);
|
|
51
|
+
IsFocusable(false);
|
|
50
52
|
|
|
51
53
|
DynamicAutomationProperties::SetAccessibilityInvokeEventHandler(panel, [=]() {
|
|
52
54
|
if (OnClick())
|
|
@@ -121,21 +123,6 @@ class ViewShadowNode : public ShadowNodeBase {
|
|
|
121
123
|
m_onClick = isSet;
|
|
122
124
|
}
|
|
123
125
|
|
|
124
|
-
bool IsFocusable() const {
|
|
125
|
-
return m_isFocusable;
|
|
126
|
-
}
|
|
127
|
-
void IsFocusable(bool isFocusable) {
|
|
128
|
-
m_isFocusable = isFocusable;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
bool IsAccessible() const {
|
|
132
|
-
return m_isAccessible;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
void IsAccessible(bool isAccessible) {
|
|
136
|
-
m_isAccessible = isAccessible;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
126
|
bool IsHitTestBrushRequired() const {
|
|
140
127
|
return IsRegisteredForMouseEvents();
|
|
141
128
|
}
|
|
@@ -259,8 +246,6 @@ class ViewShadowNode : public ShadowNodeBase {
|
|
|
259
246
|
|
|
260
247
|
bool m_enableFocusRing = true;
|
|
261
248
|
bool m_onClick = false;
|
|
262
|
-
bool m_isFocusable = false;
|
|
263
|
-
bool m_isAccessible = false;
|
|
264
249
|
int32_t m_tabIndex = std::numeric_limits<std::int32_t>::max();
|
|
265
250
|
|
|
266
251
|
xaml::Controls::ContentControl::GotFocus_revoker m_contentControlGotFocusRevoker{};
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.71.
|
|
13
|
+
<ReactNativeWindowsVersion>0.71.1</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>71</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>1</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
18
|
</PropertyGroup>
|
|
19
19
|
</Project>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<!--
|
|
2
|
+
<!--
|
|
3
3
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
Licensed under the MIT License.
|
|
5
5
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<PropertyGroup Label="NuGet">
|
|
11
11
|
<!-- Should match entry in $(ReactNativeWindowsDir)vnext\Directory.Build.props -->
|
|
12
12
|
<!--See https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets#restore-target-->
|
|
13
|
-
<RestoreUseStaticGraphEvaluation Condition="'$(BuildingInsideVisualStudio)' == 'true'">true</RestoreUseStaticGraphEvaluation>
|
|
13
|
+
<RestoreUseStaticGraphEvaluation Condition="'$(BuildingInsideVisualStudio)' == 'true' AND '$(DisableRestoreUseStaticGraphEvaluation)' != 'true'">true</RestoreUseStaticGraphEvaluation>
|
|
14
14
|
|
|
15
15
|
<!-- Ensure PackageReference compatibility for any consuming projects/apps -->
|
|
16
16
|
<ResolveNuGetPackages>false</ResolveNuGetPackages>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@react-native-community/cli": "10.0.0",
|
|
27
27
|
"@react-native-community/cli-platform-android": "10.0.0",
|
|
28
28
|
"@react-native-community/cli-platform-ios": "10.0.0",
|
|
29
|
-
"@react-native-windows/cli": "0.71.
|
|
29
|
+
"@react-native-windows/cli": "0.71.1",
|
|
30
30
|
"@react-native/assets": "1.0.0",
|
|
31
31
|
"@react-native/normalize-color": "2.1.0",
|
|
32
32
|
"@react-native/polyfills": "2.0.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"ws": "^6.2.2"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@react-native-windows/codegen": "0.71.
|
|
63
|
+
"@react-native-windows/codegen": "0.71.1",
|
|
64
64
|
"@rnw-scripts/babel-react-native-config": "0.0.0",
|
|
65
65
|
"@rnw-scripts/eslint-config": "1.1.14",
|
|
66
66
|
"@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"react-native": "0.71.0",
|
|
81
81
|
"react-native-platform-override": "^1.8.3",
|
|
82
82
|
"react-refresh": "^0.4.0",
|
|
83
|
-
"typescript": "^4.
|
|
83
|
+
"typescript": "^4.9.5"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"react": "18.2.0",
|
|
@@ -119,6 +119,7 @@
|
|
|
119
119
|
"/Shared",
|
|
120
120
|
"/stubs",
|
|
121
121
|
"/template",
|
|
122
|
+
"types",
|
|
122
123
|
"/rntypes",
|
|
123
124
|
"/.flowconfig",
|
|
124
125
|
"/Directory.Build.props",
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
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
|
+
// Definitions by: Eloy Durán <https://github.com/alloy>
|
|
11
|
+
// HuHuanming <https://github.com/huhuanming>
|
|
12
|
+
// Kyle Roach <https://github.com/iRoachie>
|
|
13
|
+
// Tim Wang <https://github.com/timwangdev>
|
|
14
|
+
// Kamal Mahyuddin <https://github.com/kamal>
|
|
15
|
+
// Alex Dunne <https://github.com/alexdunne>
|
|
16
|
+
// Manuel Alabor <https://github.com/swissmanu>
|
|
17
|
+
// Michele Bombardi <https://github.com/bm-software>
|
|
18
|
+
// Martin van Dam <https://github.com/mvdam>
|
|
19
|
+
// Kacper Wiszczuk <https://github.com/esemesek>
|
|
20
|
+
// Ryan Nickel <https://github.com/mrnickel>
|
|
21
|
+
// Souvik Ghosh <https://github.com/souvik-ghosh>
|
|
22
|
+
// Cheng Gibson <https://github.com/nossbigg>
|
|
23
|
+
// Saransh Kataria <https://github.com/saranshkataria>
|
|
24
|
+
// Wojciech Tyczynski <https://github.com/tykus160>
|
|
25
|
+
// Jake Bloom <https://github.com/jakebloom>
|
|
26
|
+
// Ceyhun Ozugur <https://github.com/ceyhun>
|
|
27
|
+
// Mike Martin <https://github.com/mcmar>
|
|
28
|
+
// Theo Henry de Villeneuve <https://github.com/theohdv>
|
|
29
|
+
// Romain Faust <https://github.com/romain-faust>
|
|
30
|
+
// Be Birchall <https://github.com/bebebebebe>
|
|
31
|
+
// Jesse Katsumata <https://github.com/Naturalclar>
|
|
32
|
+
// Xianming Zhong <https://github.com/chinesedfan>
|
|
33
|
+
// Valentyn Tolochko <https://github.com/vtolochk>
|
|
34
|
+
// Sergey Sychev <https://github.com/SychevSP>
|
|
35
|
+
// Kelvin Chu <https://github.com/RageBill>
|
|
36
|
+
// Daiki Ihara <https://github.com/sasurau4>
|
|
37
|
+
// Abe Dolinger <https://github.com/256hz>
|
|
38
|
+
// Dominique Richard <https://github.com/doumart>
|
|
39
|
+
// Mohamed Shaban <https://github.com/drmas>
|
|
40
|
+
// Jérémy Barbet <https://github.com/jeremybarbet>
|
|
41
|
+
// David Sheldrick <https://github.com/ds300>
|
|
42
|
+
// Natsathorn Yuthakovit <https://github.com/natsathorn>
|
|
43
|
+
// ConnectDotz <https://github.com/connectdotz>
|
|
44
|
+
// Alexey Molchan <https://github.com/alexeymolchan>
|
|
45
|
+
// Alex Brazier <https://github.com/alexbrazier>
|
|
46
|
+
// Arafat Zahan <https://github.com/kuasha420>
|
|
47
|
+
// Pedro Hernández <https://github.com/phvillegas>
|
|
48
|
+
// Sebastian Silbermann <https://github.com/eps1lon>
|
|
49
|
+
// Zihan Chen <https://github.com/ZihanChen-MSFT>
|
|
50
|
+
// Lorenzo Sciandra <https://github.com/kelset>
|
|
51
|
+
// Mateusz Wit <https://github.com/MateWW>
|
|
52
|
+
// Saad Najmi <https://github.com/saadnajmi>
|
|
53
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
54
|
+
// TypeScript Version: 3.0
|
|
55
|
+
|
|
56
|
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
57
|
+
//
|
|
58
|
+
// USING: these definitions are meant to be used with the TSC compiler target set to at least ES2015.
|
|
59
|
+
//
|
|
60
|
+
// USAGE EXAMPLES: check the RNTSExplorer project at https://github.com/bgrieder/RNTSExplorer
|
|
61
|
+
//
|
|
62
|
+
// CONTRIBUTING: please open pull requests
|
|
63
|
+
//
|
|
64
|
+
// CREDITS: This work is based on an original work made by Bernd Paradies: https://github.com/bparadie
|
|
65
|
+
//
|
|
66
|
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
67
|
+
|
|
68
|
+
/// <reference path="modules/BatchedBridge.d.ts" />
|
|
69
|
+
/// <reference path="modules/Codegen.d.ts" />
|
|
70
|
+
/// <reference path="modules/Devtools.d.ts" />
|
|
71
|
+
/// <reference path="modules/globals.d.ts" />
|
|
72
|
+
/// <reference path="modules/LaunchScreen.d.ts" />
|
|
73
|
+
|
|
74
|
+
export * from '../Libraries/ActionSheetIOS/ActionSheetIOS';
|
|
75
|
+
export * from '../Libraries/Alert/Alert';
|
|
76
|
+
export * from '../Libraries/Animated/Animated';
|
|
77
|
+
export * from '../Libraries/Animated/Easing';
|
|
78
|
+
export * from '../Libraries/Animated/useAnimatedValue';
|
|
79
|
+
export * from '../Libraries/AppState/AppState';
|
|
80
|
+
export * from '../Libraries/BatchedBridge/NativeModules';
|
|
81
|
+
export * from '../Libraries/Components/AccessibilityInfo/AccessibilityInfo';
|
|
82
|
+
export * from '../Libraries/Components/ActivityIndicator/ActivityIndicator';
|
|
83
|
+
export * from '../Libraries/Components/Clipboard/Clipboard';
|
|
84
|
+
export * from '../Libraries/Components/DatePicker/DatePickerIOS';
|
|
85
|
+
export * from '../Libraries/Components/DrawerAndroid/DrawerLayoutAndroid';
|
|
86
|
+
export * from '../Libraries/Components/Keyboard/Keyboard';
|
|
87
|
+
export * from '../Libraries/Components/Keyboard/KeyboardAvoidingView';
|
|
88
|
+
export * from '../Libraries/Components/Pressable/Pressable';
|
|
89
|
+
export * from '../Libraries/Components/ProgressBarAndroid/ProgressBarAndroid';
|
|
90
|
+
export * from '../Libraries/Components/ProgressViewIOS/ProgressViewIOS';
|
|
91
|
+
export * from '../Libraries/Components/RefreshControl/RefreshControl';
|
|
92
|
+
export * from '../Libraries/Components/SafeAreaView/SafeAreaView';
|
|
93
|
+
export * from '../Libraries/Components/ScrollView/ScrollView';
|
|
94
|
+
export * from '../Libraries/Components/Slider/Slider';
|
|
95
|
+
export * from '../Libraries/Components/StatusBar/StatusBar';
|
|
96
|
+
export * from '../Libraries/Components/Switch/Switch';
|
|
97
|
+
export * from '../Libraries/Components/TextInput/InputAccessoryView';
|
|
98
|
+
export * from '../Libraries/Components/TextInput/TextInput';
|
|
99
|
+
export * from '../Libraries/Components/ToastAndroid/ToastAndroid';
|
|
100
|
+
export * from '../Libraries/Components/Touchable/Touchable';
|
|
101
|
+
export * from '../Libraries/Components/Touchable/TouchableHighlight';
|
|
102
|
+
export * from '../Libraries/Components/Touchable/TouchableNativeFeedback';
|
|
103
|
+
export * from '../Libraries/Components/Touchable/TouchableOpacity';
|
|
104
|
+
export * from '../Libraries/Components/Touchable/TouchableWithoutFeedback';
|
|
105
|
+
export * from '../Libraries/Components/View/View';
|
|
106
|
+
export * from '../Libraries/Components/View/ViewAccessibility';
|
|
107
|
+
export * from '../Libraries/Components/View/ViewPropTypes';
|
|
108
|
+
export * from '../Libraries/Components/Button';
|
|
109
|
+
export * from '../Libraries/EventEmitter/NativeEventEmitter';
|
|
110
|
+
export * from '../Libraries/EventEmitter/RCTDeviceEventEmitter';
|
|
111
|
+
export * from '../Libraries/EventEmitter/RCTNativeAppEventEmitter';
|
|
112
|
+
export * from '../Libraries/Image/Image';
|
|
113
|
+
export * from '../Libraries/Image/ImageResizeMode';
|
|
114
|
+
export * from '../Libraries/Image/ImageSource';
|
|
115
|
+
export * from '../Libraries/Interaction/InteractionManager';
|
|
116
|
+
export * from '../Libraries/Interaction/PanResponder';
|
|
117
|
+
export * from '../Libraries/LayoutAnimation/LayoutAnimation';
|
|
118
|
+
export * from '../Libraries/Linking/Linking';
|
|
119
|
+
export * from '../Libraries/Lists/FlatList';
|
|
120
|
+
export * from '../Libraries/Lists/SectionList';
|
|
121
|
+
export * from '../Libraries/Lists/VirtualizedList';
|
|
122
|
+
export * from '../Libraries/LogBox/LogBox';
|
|
123
|
+
export * from '../Libraries/Modal/Modal';
|
|
124
|
+
export * as Systrace from '../Libraries/Performance/Systrace';
|
|
125
|
+
export * from '../Libraries/PermissionsAndroid/PermissionsAndroid';
|
|
126
|
+
export * from '../Libraries/PushNotificationIOS/PushNotificationIOS';
|
|
127
|
+
export * from '../Libraries/ReactNative/AppRegistry';
|
|
128
|
+
export * from '../Libraries/ReactNative/I18nManager';
|
|
129
|
+
export * from '../Libraries/ReactNative/RendererProxy';
|
|
130
|
+
export * from '../Libraries/ReactNative/RootTag';
|
|
131
|
+
export * from '../Libraries/ReactNative/UIManager';
|
|
132
|
+
export * from '../Libraries/ReactNative/requireNativeComponent';
|
|
133
|
+
export * from '../Libraries/Settings/Settings';
|
|
134
|
+
export * from '../Libraries/Share/Share';
|
|
135
|
+
export * from '../Libraries/StyleSheet/PlatformColorValueTypesIOS';
|
|
136
|
+
export * from '../Libraries/StyleSheet/PlatformColorValueTypes';
|
|
137
|
+
export * from '../Libraries/StyleSheet/StyleSheet';
|
|
138
|
+
export * from '../Libraries/StyleSheet/StyleSheetTypes';
|
|
139
|
+
export * from '../Libraries/StyleSheet/processColor';
|
|
140
|
+
export * from '../Libraries/Text/Text';
|
|
141
|
+
export * from '../Libraries/TurboModule/RCTExport';
|
|
142
|
+
export * from '../Libraries/TurboModule/TurboModuleRegistry';
|
|
143
|
+
export * from '../Libraries/Types/CoreEventTypes';
|
|
144
|
+
export * from '../Libraries/Utilities/Appearance';
|
|
145
|
+
export * from '../Libraries/Utilities/BackHandler';
|
|
146
|
+
export * from '../Libraries/Utilities/DevSettings';
|
|
147
|
+
export * from '../Libraries/Utilities/Dimensions';
|
|
148
|
+
export * from '../Libraries/Utilities/PixelRatio';
|
|
149
|
+
export * from '../Libraries/Utilities/Platform';
|
|
150
|
+
export * from '../Libraries/Vibration/Vibration';
|
|
151
|
+
export * from '../Libraries/YellowBox/YellowBoxDeprecated';
|
|
152
|
+
export * from '../Libraries/vendor/core/ErrorUtils';
|
|
153
|
+
export * from '../Libraries/vendor/emitter/EventEmitter';
|
|
154
|
+
|
|
155
|
+
export * from './public/DeprecatedPropertiesAlias';
|
|
156
|
+
export * from './public/Insets';
|
|
157
|
+
export * from './public/ReactNativeRenderer';
|
|
158
|
+
export * from './public/ReactNativeTypes';
|
|
159
|
+
|
|
160
|
+
import type {ErrorUtils} from '../Libraries/vendor/core/ErrorUtils';
|
|
161
|
+
|
|
162
|
+
declare global {
|
|
163
|
+
interface NodeRequire {
|
|
164
|
+
(id: string): any;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
var require: NodeRequire;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Console polyfill
|
|
171
|
+
* @see https://reactnative.dev/docs/javascript-environment#polyfills
|
|
172
|
+
*/
|
|
173
|
+
interface Console {
|
|
174
|
+
error(message?: any, ...optionalParams: any[]): void;
|
|
175
|
+
info(message?: any, ...optionalParams: any[]): void;
|
|
176
|
+
log(message?: any, ...optionalParams: any[]): void;
|
|
177
|
+
warn(message?: any, ...optionalParams: any[]): void;
|
|
178
|
+
trace(message?: any, ...optionalParams: any[]): void;
|
|
179
|
+
debug(message?: any, ...optionalParams: any[]): void;
|
|
180
|
+
table(...data: any[]): void;
|
|
181
|
+
groupCollapsed(label?: string): void;
|
|
182
|
+
groupEnd(): void;
|
|
183
|
+
group(label?: string): void;
|
|
184
|
+
/**
|
|
185
|
+
* @deprecated Use LogBox.ignoreLogs(patterns) instead
|
|
186
|
+
*/
|
|
187
|
+
ignoredYellowBox: string[];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
var console: Console;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* This contains the non-native `XMLHttpRequest` object, which you can use if you want to route network requests
|
|
194
|
+
* through DevTools (to trace them):
|
|
195
|
+
*
|
|
196
|
+
* global.XMLHttpRequest = global.originalXMLHttpRequest;
|
|
197
|
+
*
|
|
198
|
+
* @see https://github.com/facebook/react-native/issues/934
|
|
199
|
+
*/
|
|
200
|
+
const originalXMLHttpRequest: any;
|
|
201
|
+
|
|
202
|
+
const __BUNDLE_START_TIME__: number;
|
|
203
|
+
const ErrorUtils: ErrorUtils;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* This variable is set to true when react-native is running in Dev mode
|
|
207
|
+
* @example
|
|
208
|
+
* if (__DEV__) console.log('Running in dev mode')
|
|
209
|
+
*/
|
|
210
|
+
const __DEV__: boolean;
|
|
211
|
+
|
|
212
|
+
const HermesInternal: null | {};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Export platform specific types
|
|
216
|
+
export * from '../Libraries/platform-types';
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
interface SpyData {
|
|
11
|
+
type: number;
|
|
12
|
+
module?: string | undefined;
|
|
13
|
+
method: string | number;
|
|
14
|
+
args: any[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare class MessageQueue {
|
|
18
|
+
static spy(spyOrToggle: boolean | ((data: SpyData) => void)): void;
|
|
19
|
+
|
|
20
|
+
getCallableModule(name: string): Object;
|
|
21
|
+
registerCallableModule(name: string, module: Object): void;
|
|
22
|
+
registerLazyCallableModule(name: string, factory: () => Object): void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare module 'react-native/Libraries/BatchedBridge/BatchedBridge' {
|
|
26
|
+
const BatchedBridge: MessageQueue;
|
|
27
|
+
export default BatchedBridge;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare module 'react-native/Libraries/BatchedBridge/MessageQueue' {
|
|
31
|
+
export default MessageQueue;
|
|
32
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
declare module 'react-native/Libraries/Utilities/codegenNativeCommands' {
|
|
11
|
+
export interface Options<T extends string> {
|
|
12
|
+
readonly supportedCommands: ReadonlyArray<T>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function codegenNativeCommands<T extends object>(
|
|
16
|
+
options: Options<keyof T extends string ? keyof T : never>,
|
|
17
|
+
): T;
|
|
18
|
+
|
|
19
|
+
export default codegenNativeCommands;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare module 'react-native/Libraries/Utilities/codegenNativeComponent' {
|
|
23
|
+
import type {HostComponent} from 'react-native';
|
|
24
|
+
|
|
25
|
+
export interface Options {
|
|
26
|
+
readonly interfaceOnly?: boolean;
|
|
27
|
+
readonly paperComponentName?: string;
|
|
28
|
+
readonly paperComponentNameDeprecated?: string;
|
|
29
|
+
readonly excludedPlatforms?: ReadonlyArray<'iOS' | 'android'>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type NativeComponentType<T> = HostComponent<T>;
|
|
33
|
+
|
|
34
|
+
function codegenNativeComponent<Props extends object>(
|
|
35
|
+
componentName: string,
|
|
36
|
+
options?: Options,
|
|
37
|
+
): NativeComponentType<Props>;
|
|
38
|
+
|
|
39
|
+
export default codegenNativeComponent;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare module 'react-native/Libraries/Types/CodegenTypes' {
|
|
43
|
+
import type {NativeSyntheticEvent} from 'react-native';
|
|
44
|
+
|
|
45
|
+
// Event types
|
|
46
|
+
// We're not using the PaperName, it is only used to codegen view config settings
|
|
47
|
+
|
|
48
|
+
export type BubblingEventHandler<
|
|
49
|
+
T,
|
|
50
|
+
PaperName extends string | never = never,
|
|
51
|
+
> = (event: NativeSyntheticEvent<T>) => void | Promise<void>;
|
|
52
|
+
export type DirectEventHandler<
|
|
53
|
+
T,
|
|
54
|
+
PaperName extends string | never = never,
|
|
55
|
+
> = (event: NativeSyntheticEvent<T>) => void | Promise<void>;
|
|
56
|
+
|
|
57
|
+
// Prop types
|
|
58
|
+
export type Double = number;
|
|
59
|
+
export type Float = number;
|
|
60
|
+
export type Int32 = number;
|
|
61
|
+
export type UnsafeObject = object;
|
|
62
|
+
|
|
63
|
+
type DefaultTypes = number | boolean | string | ReadonlyArray<string>;
|
|
64
|
+
// Default handling, ignore the unused value
|
|
65
|
+
// we're only using it for type checking
|
|
66
|
+
//
|
|
67
|
+
// TODO: (rickhanlonii) T44881457 If a default is provided, it should always be optional
|
|
68
|
+
// but that is currently not supported in the codegen since we require a default
|
|
69
|
+
|
|
70
|
+
export type WithDefault<
|
|
71
|
+
Type extends DefaultTypes,
|
|
72
|
+
Value extends Type | string | undefined | null,
|
|
73
|
+
> = Type | undefined | null;
|
|
74
|
+
}
|