mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
module merge util module naming changed to use "-"
This commit is contained in:
@ -135,7 +135,7 @@
|
||||
<TypeScriptCompile Include="text\text.ios.ts">
|
||||
<DependentUpon>text.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="utils\module_merge.ts" />
|
||||
<TypeScriptCompile Include="utils\module-merge.ts" />
|
||||
<TypeScriptCompile Include="utils\utils_android.ts" />
|
||||
<TypeScriptCompile Include="utils\utils_ios.ts" />
|
||||
<TypeScriptCompile Include="http\http-request.d.ts" />
|
||||
|
@ -1,7 +1,7 @@
|
||||
import types = require("location/location-types");
|
||||
import appModule = require("application/application");
|
||||
import common = require("location/location-common");
|
||||
import merger = require("utils/module_merge");
|
||||
import merger = require("utils/module-merge");
|
||||
|
||||
// merge the exports of the types module with the exports of this file
|
||||
declare var exports;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import types = require("location/location-types");
|
||||
import common = require("location/location-common");
|
||||
import merger = require("utils/module_merge");
|
||||
import merger = require("utils/module-merge");
|
||||
|
||||
// merge the exports of the types module with the exports of this file
|
||||
declare var exports;
|
||||
|
24
utils/utils.android.ts
Normal file
24
utils/utils.android.ts
Normal file
@ -0,0 +1,24 @@
|
||||
export class Collections {
|
||||
public static stringArrayToStringSet(str: string[]): any {
|
||||
var hashSet = new java.util.HashSet();
|
||||
if ("undefined" != typeof str) {
|
||||
for (var element in str) {
|
||||
hashSet.add('' + str[element]);
|
||||
}
|
||||
}
|
||||
return hashSet;
|
||||
}
|
||||
|
||||
public static stringSetToStringArray(stringSet: any): string[] {
|
||||
var arr = [];
|
||||
if ("undefined" != typeof stringSet) {
|
||||
var it = stringSet.iterator();
|
||||
while (it.hasNext()) {
|
||||
var element = '' + it.next();
|
||||
arr.push(element);
|
||||
}
|
||||
}
|
||||
|
||||
return arr;
|
||||
}
|
||||
}
|
7
utils/utils.d.ts
vendored
Normal file
7
utils/utils.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Timer functions.
|
||||
*/
|
||||
export declare function setTimeout(callback: Function, milliseconds?: number): number;
|
||||
export declare function clearTimeout(id: number): void;
|
||||
export declare function setInterval(callback: Function, milliseconds?: number): number;
|
||||
export declare function clearInterval(id: number): void;
|
22
utils/utils.ios.ts
Normal file
22
utils/utils.ios.ts
Normal file
@ -0,0 +1,22 @@
|
||||
export class Collections {
|
||||
public static jsArrayToNSArray(str: string[]): any {
|
||||
var arr = new Foundation.NSMutableArray();
|
||||
if ("undefined" != typeof str) {
|
||||
for (var element in str) {
|
||||
arr.addObject(str[element]);
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public static nsArrayToJSArray(a: any): string[] {
|
||||
var arr = [];
|
||||
if ("undefined" != typeof a) {
|
||||
for (var i = 0; i < a.count(); i++) {
|
||||
arr.push(a.objectAtIndex(i));
|
||||
}
|
||||
}
|
||||
|
||||
return arr;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user