Skip to content
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
15 changes: 8 additions & 7 deletions packages/react-native/ReactNativeApi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<2199d280ef42e2a63ec4d6c405af893a>>
* @generated SignedSource<<650ec5a18cd69ff8783eaeaf894868fb>>
*
* This file was generated by scripts/js-api/build-types/index.js.
*/
Expand Down Expand Up @@ -76,7 +76,7 @@ declare const $$index: {
get VirtualizedListContextResetter(): VirtualizedListContextResetterT
get VirtualizedSectionList(): AnyVirtualizedSectionList
}
declare const $$NativeDeviceInfo: typeof NativeDeviceInfo_default
declare const $$NativeDeviceInfo: typeof NativeModule_default
declare const $$ReactFabric: typeof ReactFabric_default
declare const $$ScrollViewContext: typeof ScrollViewContext_default
declare const absoluteFill: AbsoluteFillStyle
Expand Down Expand Up @@ -288,9 +288,7 @@ declare const multiplyImpl: (
b: AnimatedNode_default | number,
) => AnimatedMultiplication_default
declare const NativeAppEventEmitter: typeof RCTNativeAppEventEmitter_default
declare const NativeDeviceInfo_default: {
getConstants(): DeviceInfoConstants
}
declare const NativeModule_default: Spec
declare const NativeModules: typeof NativeModules_default
declare let NativeModules_default: {
[moduleName: string]: any
Expand Down Expand Up @@ -4549,6 +4547,9 @@ declare type ShareOptions = {
tintColor?: ColorValue
}
declare interface Spec extends TurboModule {
readonly getConstants: () => DeviceInfoConstants
}
declare interface Spec_2 extends TurboModule {
readonly blur?: (reactTag: number) => void
readonly focus?: (reactTag: number) => void
readonly getConstantsForViewManager?: (
Expand Down Expand Up @@ -5396,7 +5397,7 @@ declare type TVViewPropsIOS = {
readonly tvParallaxTiltAngle?: number
}
declare type UIManager = typeof UIManager
declare interface UIManagerJSInterface extends Spec {
declare interface UIManagerJSInterface extends Spec_2 {
readonly getViewManagerConfig: (viewManagerName: string) => Object
readonly hasViewManagerConfig: (viewManagerName: string) => boolean
}
Expand Down Expand Up @@ -5788,7 +5789,7 @@ export {
DevMenu, // 21b8b7a9
DevSettings, // e55b91dc
DeviceEventEmitter, // bdbdd014
DeviceInfo, // 521bfb71
DeviceInfo, // 0f5a517b
DeviceInfoConstants, // 279e7858
DimensionValue, // b163a381
Dimensions, // 980ef68c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,5 @@ export interface Spec extends TurboModule {
}

const NativeModule: Spec = TurboModuleRegistry.getEnforcing<Spec>('DeviceInfo');
let constants: ?DeviceInfoConstants = null;

const NativeDeviceInfo = {
getConstants(): DeviceInfoConstants {
if (constants == null) {
constants = NativeModule.getConstants();
}
return constants;
},
};

export default NativeDeviceInfo;
export default NativeModule;
Loading