mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(ios): incorrect declaration of 'jsArrayToNSArray' and 'nsArrayToJSArray' (#9277)
This commit is contained in:
committed by
GitHub
parent
17c85107ba
commit
e9e4934faf
4
packages/core/utils/native-helper.d.ts
vendored
4
packages/core/utils/native-helper.d.ts
vendored
@@ -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[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user