mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
BCL: added console, added references, added libjs.d.ts based on MS lib.d.ts without DOM
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import app_common_module = require("Application/application_common");
|
||||
import console_module = require("Console/console_common");
|
||||
|
||||
var currentApp = app_common_module.tk.ui.Application.current;
|
||||
declare var exports;
|
||||
exports.tk = app_common_module.tk;
|
||||
|
||||
export module tk {
|
||||
// TODO: This is tricky, we have a module named android down in the hierarchy and we need to declare it here
|
||||
@@ -96,6 +100,7 @@ export module tk {
|
||||
currentApp.os = app_common_module.tk.TargetOS.Android;
|
||||
currentApp.android = app;
|
||||
app.init();
|
||||
console = new console_module.tk.TKConsole();
|
||||
}
|
||||
|
||||
class Application {
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
import app_common_module = require("Application/application_common");
|
||||
|
||||
/*
|
||||
Current launch sequence for iOS looks like:
|
||||
|
||||
var app = require("Application/application");
|
||||
|
||||
app.tk.ui.Application.current.onLaunch = function() {
|
||||
log("tk.ui.Application.current.onLaunch");
|
||||
var myViewController = new MyViewController();
|
||||
var navController = new UIKit.UINavigationController(myViewController);
|
||||
|
||||
return navController;
|
||||
}
|
||||
|
||||
log("JavaScript loading started.");
|
||||
app.tk.ui.ios.initApp(null);
|
||||
log("JavaScript loading ended.");
|
||||
|
||||
log("JavaScript loading ended.");
|
||||
|
||||
*/
|
||||
|
||||
import app_common_module = require("Application/application_common");
|
||||
import console_module = require("Console/console_common");
|
||||
|
||||
var currentApp = app_common_module.tk.ui.Application.current;
|
||||
declare var exports;
|
||||
exports.tk = app_common_module.tk;
|
||||
|
||||
export module tk {
|
||||
export module ui {
|
||||
@@ -10,6 +36,7 @@ export module tk {
|
||||
currentApp.os = app_common_module.tk.TargetOS.iOS;
|
||||
currentApp.ios = app;
|
||||
app.init();
|
||||
console = new console_module.tk.TKConsole();
|
||||
}
|
||||
|
||||
class Application {
|
||||
@@ -23,7 +50,7 @@ export module tk {
|
||||
public init() {
|
||||
UIKit.UIResponder.extends({/*TODO: Empty parameter here, needs API improvement*/}, {
|
||||
name: "KimeraAppDelegate",
|
||||
}).extends({
|
||||
}).implements({
|
||||
protocol: "UIApplicationDelegate",
|
||||
implementation: {
|
||||
applicationDidFinishLaunchingWithOptions: function () {
|
||||
@@ -33,10 +60,10 @@ export module tk {
|
||||
this.window.setBackgroundColor(UIKit.UIColor.whiteColor());
|
||||
|
||||
var iosApp = <Application>currentApp.ios;
|
||||
this.window.setRootViewController(iosApp.rootController);
|
||||
//this.window.setRootViewController(iosApp.rootController);
|
||||
|
||||
if (currentApp.onLaunch) {
|
||||
currentApp.onLaunch();
|
||||
this.window.setRootViewController(currentApp.onLaunch());
|
||||
} else {
|
||||
log("Missing TK.UI.Application.current.onLaunch");
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export module tk {
|
||||
|
||||
export module tk {
|
||||
export enum TargetOS {
|
||||
iOS,
|
||||
Android,
|
||||
|
||||
Reference in New Issue
Block a user