Skip to content

Commit cd0cb47

Browse files
coadofacebook-github-bot
authored andcommitted
Add Settings path to build-types script and align Flow with TS types
Summary: Changelog: [Internal] Differential Revision: D69121991
1 parent 9350d6f commit cd0cb47

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

Diff for: 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
},

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

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

69526952
exports[`public API should not change unintentionally Libraries/Settings/Settings.js 1`] = `
69536953
"declare const Settings: {
6954-
get(key: string): mixed,
6954+
get(key: string): any,
69556955
set(settings: Object): void,
6956-
watchKeys(keys: string | Array<string>, callback: Function): number,
6956+
watchKeys(keys: string | Array<string>, callback: () => void): number,
69576957
clearWatch(watchId: number): void,
69586958
};
69596959
declare export default typeof Settings;

Diff for: scripts/build/build-types.js

+2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ 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',
37+
'react-native/src/private/specs_DEPRECATED/modules/NativeSettingsManager.js',
3638
// TODO(T210505412): Include input packages, e.g. virtualized-lists
3739
];
3840

0 commit comments

Comments
 (0)