fix(ios): incorrect declaration of 'jsArrayToNSArray' and 'nsArrayToJSArray' (#9277)

This commit is contained in:
Shamsuddin Dzhamalov
2021-03-30 13:28:23 -07:00
committed by GitHub
parent 17c85107ba
commit e9e4934faf
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -112,13 +112,13 @@ export namespace iOSNativeHelper {
* Converts JavaScript array to [NSArray](https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/).
* @param str - JavaScript string array to convert.
*/
export function jsArrayToNSArray(str: string[]): any;
export function jsArrayToNSArray<T>(str: T[]): NSArray<T>;
/**
* Converts NSArray to JavaScript array.
* @param a - NSArray to convert.
*/
export function nsArrayToJSArray(a: any): string[];
export function nsArrayToJSArray<T>(a: NSArray<T>): T[];
}
/**
+3 -3
View File
@@ -36,11 +36,11 @@ export namespace iOSNativeHelper {
}
export namespace collections {
export function jsArrayToNSArray(str: string[]): NSArray<any> {
return NSArray.arrayWithArray(<any>str);
export function jsArrayToNSArray<T>(str: T[]): NSArray<T> {
return NSArray.arrayWithArray(str);
}
export function nsArrayToJSArray(a: NSArray<any>): Array<Object> {
export function nsArrayToJSArray<T>(a: NSArray<T>): Array<T> {
const arr = [];
if (a !== undefined) {
const count = a.count;