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

This commit is contained in:
Shamsuddin Dzhamalov
2021-03-30 23:28:23 +03:00
committed by GitHub
parent 17c85107ba
commit e9e4934faf
2 changed files with 5 additions and 5 deletions

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[];
}
/**

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;