diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/SurfaceDelegateFactory.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/SurfaceDelegateFactory.java deleted file mode 100644 index 76a5edf6305..00000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/SurfaceDelegateFactory.java +++ /dev/null @@ -1,29 +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.common; - -import androidx.annotation.Nullable; -import com.facebook.infer.annotation.Nullsafe; - -/** - * Factory to create a {@link SurfaceDelegate}. The moduleName is needed to help the factory decide - * which surface to return {@link SurfaceDelegate} that the given module should use to interact - * with. - */ -@Nullsafe(Nullsafe.Mode.LOCAL) -public interface SurfaceDelegateFactory { - /** - * Create a {@link SurfaceDelegate} instance which is used to interact with a surface of platform - * the app is running in. - * - * @param moduleName the module name that will be using the surface - * @return {@link SurfaceDelegate} instance - */ - @Nullable - SurfaceDelegate createSurfaceDelegate(String moduleName); -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/SurfaceDelegateFactory.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/SurfaceDelegateFactory.kt new file mode 100644 index 00000000000..d1675bc7dc3 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/SurfaceDelegateFactory.kt @@ -0,0 +1,22 @@ +/* + * 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.common + +/** + * Factory to create a [SurfaceDelegate]. The moduleName is needed to help the factory decide which + * surface to return [SurfaceDelegate] that the given module should use to interact with. + */ +public fun interface SurfaceDelegateFactory { + /** + * Create a [SurfaceDelegate] instance which is used to interact with a surface of platform the + * app is running in. + * + * @param moduleName the module name that will be using the surface + * @return [SurfaceDelegate] instance + */ + public fun createSurfaceDelegate(moduleName: String): SurfaceDelegate? +}