Skip to content

Commit

Permalink
Add registerCallableModule types (#43366)
Browse files Browse the repository at this point in the history
Summary:
`registerCallableModule()` was added from 7f549ec but no typescript types there. this pr tries to add the corresponding types.

## Changelog:

[GENERAL] [FIXED] - Add missing `registerCallableModule` TypeScript definitions

Pull Request resolved: #43366

Test Plan: patch locally and try to `import { registerCallableModule } from 'react-native';` in a 0.74.0-rc.2 project

Reviewed By: fabriziocucci

Differential Revision: D54676151

Pulled By: cortinico

fbshipit-source-id: cd01f2ebe2d2516b458fae5b2e83cba3d3794455
  • Loading branch information
Kudo authored and facebook-github-bot committed Mar 8, 2024
1 parent 5126bac commit 6bc95b2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/react-native/Libraries/Core/registerCallableModule.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/

type Module = Object;
type RegisterCallableModule = (
name: string,
moduleOrFactory: Module | (() => Module),
) => void;

export const registerCallableModule: RegisterCallableModule;
1 change: 1 addition & 0 deletions packages/react-native/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export * from '../Libraries/Components/View/View';
export * from '../Libraries/Components/View/ViewAccessibility';
export * from '../Libraries/Components/View/ViewPropTypes';
export * from '../Libraries/Components/Button';
export * from '../Libraries/Core/registerCallableModule';
export * from '../Libraries/DevToolsSettings/DevToolsSettingsManager';
export * from '../Libraries/EventEmitter/NativeEventEmitter';
export * from '../Libraries/EventEmitter/RCTDeviceEventEmitter';
Expand Down

0 comments on commit 6bc95b2

Please sign in to comment.