Skip to content

Add Settings path to build-types script and align Flow with TS types #49175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/react-native/Libraries/Settings/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'use strict';

const Settings = {
get(key: string): mixed {
get(key: string): any {
console.warn('Settings is not yet supported on this platform.');
return null;
},
Expand All @@ -20,7 +20,7 @@ const Settings = {
console.warn('Settings is not yet supported on this platform.');
},

watchKeys(keys: string | Array<string>, callback: Function): number {
watchKeys(keys: string | Array<string>, callback: () => void): number {
console.warn('Settings is not yet supported on this platform.');
return -1;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6975,9 +6975,9 @@ declare export default typeof NativeSettingsManager;

exports[`public API should not change unintentionally Libraries/Settings/Settings.js 1`] = `
"declare const Settings: {
get(key: string): mixed,
get(key: string): any,
set(settings: Object): void,
watchKeys(keys: string | Array<string>, callback: Function): number,
watchKeys(keys: string | Array<string>, callback: () => void): number,
clearWatch(watchId: number): void,
};
declare export default typeof Settings;
Expand Down
2 changes: 2 additions & 0 deletions scripts/build/build-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ const SOURCE_PATTERNS = [
'react-native/Libraries/Types/RootTagTypes.js',
'react-native/Libraries/ReactNative/RootTag.js',
'react-native/Libraries/Utilities/Platform.js',
'react-native/Libraries/Settings/**/*.js',
'react-native/src/private/specs_DEPRECATED/modules/NativeAlertManager.js',
'react-native/src/private/specs_DEPRECATED/modules/NativeActionSheetManager.js',
'react-native/src/private/specs/modules/NativeToastAndroid.js',
'react-native/src/private/specs_DEPRECATED/modules/NativeSettingsManager.js',
// TODO(T210505412): Include input packages, e.g. virtualized-lists
];

Expand Down
Loading