Skip to content

Commit 5f110c4

Browse files
coadofacebook-github-bot
authored andcommitted
Add Settings path to build-types script and align Flow with TS types (#49175)
Summary: Pull Request resolved: #49175 Changelog: [Internal] Reviewed By: huntie Differential Revision: D69121991 fbshipit-source-id: 022d56e823aae884ce10fd24cc9701b02db19e9f
1 parent 091f8cf commit 5f110c4

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

packages/react-native/Libraries/Settings/Settings.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
'use strict';
1212

1313
const Settings = {
14-
get(key: string): mixed {
14+
get(key: string): any {
1515
console.warn('Settings is not yet supported on this platform.');
1616
return null;
1717
},
@@ -20,7 +20,7 @@ const Settings = {
2020
console.warn('Settings is not yet supported on this platform.');
2121
},
2222

23-
watchKeys(keys: string | Array<string>, callback: Function): number {
23+
watchKeys(keys: string | Array<string>, callback: () => void): number {
2424
console.warn('Settings is not yet supported on this platform.');
2525
return -1;
2626
},

packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -6975,9 +6975,9 @@ declare export default typeof NativeSettingsManager;
69756975

69766976
exports[`public API should not change unintentionally Libraries/Settings/Settings.js 1`] = `
69776977
"declare const Settings: {
6978-
get(key: string): mixed,
6978+
get(key: string): any,
69796979
set(settings: Object): void,
6980-
watchKeys(keys: string | Array<string>, callback: Function): number,
6980+
watchKeys(keys: string | Array<string>, callback: () => void): number,
69816981
clearWatch(watchId: number): void,
69826982
};
69836983
declare export default typeof Settings;

scripts/build/build-types.js

+2
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ const SOURCE_PATTERNS = [
3131
'react-native/Libraries/Types/RootTagTypes.js',
3232
'react-native/Libraries/ReactNative/RootTag.js',
3333
'react-native/Libraries/Utilities/Platform.js',
34+
'react-native/Libraries/Settings/**/*.js',
3435
'react-native/src/private/specs_DEPRECATED/modules/NativeAlertManager.js',
3536
'react-native/src/private/specs_DEPRECATED/modules/NativeActionSheetManager.js',
3637
'react-native/src/private/specs/modules/NativeToastAndroid.js',
38+
'react-native/src/private/specs_DEPRECATED/modules/NativeSettingsManager.js',
3739
// TODO(T210505412): Include input packages, e.g. virtualized-lists
3840
];
3941

0 commit comments

Comments
 (0)