Migrate ViewManagerResolver & UIManagerModuleListener to Kotlin (#49501)

Summary:
Migrate two more `com.facebook.react.uimanager` interfaces to Kotlin

## Changelog:

[INTERNAL] - Migrate ViewManagerResolver & UIManagerModuleListener to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/49501

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D69836273

Pulled By: cortinico

fbshipit-source-id: cbdddc1ecf432127426fc07a9df6ed824db63e73
This commit is contained in:
Mateo Guzmán
2025-02-19 07:30:31 -08:00
committed by Facebook GitHub Bot
parent 236db59a26
commit 4bafd4734e
3 changed files with 24 additions and 33 deletions
@@ -5,17 +5,14 @@
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.uimanager;
package com.facebook.react.uimanager
/**
* Listener used to hook into the UIManager update process. Deprecated: use UIManagerListener
* instead. This will be deleted in some future release.
*/
@Deprecated
/** Listener used to hook into the UIManager update process. */
@Deprecated("Use UIManagerListener instead. This will be deleted in some future release.")
public interface UIManagerModuleListener {
/**
* Called right before view updates are dispatched at the end of a batch. This is useful if a
* module needs to add UIBlocks to the queue before it is flushed.
*/
void willDispatchViewUpdates(UIManagerModule uiManager);
public fun willDispatchViewUpdates(uiManager: UIManagerModule)
}
@@ -1,26 +0,0 @@
/*
* 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.
*/
package com.facebook.react.uimanager;
import java.util.Collection;
import javax.annotation.Nullable;
/** Enables lazy discovery of a specific {@link ViewManager} by its name. */
public interface ViewManagerResolver {
/**
* {@class UIManagerModule} class uses this method to get a ViewManager by its name. This is the
* same name that comes from JS by {@code UIManager.ViewManagerName} call.
*/
@Nullable
ViewManager getViewManager(String viewManagerName);
/**
* Provides a list of view manager names to register in JS as {@code UIManager.ViewManagerName}
*/
Collection<String> getViewManagerNames();
}
@@ -0,0 +1,20 @@
/*
* 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.
*/
package com.facebook.react.uimanager
/** Enables lazy discovery of a specific [ViewManager] by its name. */
public interface ViewManagerResolver {
/**
* [UIManagerModule] class uses this method to get a [ViewManager] by its name. This is the same
* name that comes from JS by `UIManager.ViewManagerName` call.
*/
public fun getViewManager(viewManagerName: String): ViewManager<*, *>?
/** Provides a list of view manager names to register in JS as `UIManager.ViewManagerName` */
public fun getViewManagerNames(): Collection<String>
}