mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Fix ReadableArray annotations, because these methods throw ArrayIndexOutOfBoundsException instead of null if index is not found. ## Changelog [Android] [Changed] - fix ReadableArray null annotations. Possibly breaking change for Kotlin apps. Pull Request resolved: https://github.com/facebook/react-native/pull/30122 Test Plan: RNTester app builds and runs as expected, and show correct type in when used with Kotlin code. Reviewed By: JoshuaGross Differential Revision: D24164326 Pulled By: fkgozali fbshipit-source-id: 0c3f8fa9accbd32cc71c50befe9330e5201643f6
47 lines
857 B
Java
47 lines
857 B
Java
/*
|
|
* Copyright (c) Facebook, Inc. and its 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.bridge;
|
|
|
|
import androidx.annotation.NonNull;
|
|
import java.util.ArrayList;
|
|
|
|
/**
|
|
* Interface for an array that allows typed access to its members. Used to pass parameters from JS
|
|
* to Java.
|
|
*/
|
|
public interface ReadableArray {
|
|
|
|
int size();
|
|
|
|
boolean isNull(int index);
|
|
|
|
boolean getBoolean(int index);
|
|
|
|
double getDouble(int index);
|
|
|
|
int getInt(int index);
|
|
|
|
@NonNull
|
|
String getString(int index);
|
|
|
|
@NonNull
|
|
ReadableArray getArray(int index);
|
|
|
|
@NonNull
|
|
ReadableMap getMap(int index);
|
|
|
|
@NonNull
|
|
Dynamic getDynamic(int index);
|
|
|
|
@NonNull
|
|
ReadableType getType(int index);
|
|
|
|
@NonNull
|
|
ArrayList<Object> toArrayList();
|
|
}
|