BCL: added console, added references, added libjs.d.ts based on MS lib.d.ts without DOM

This commit is contained in:
Stanimir Karoserov
2014-03-18 12:42:36 +02:00
parent 9e39a150b0
commit 3f290abdf7
16 changed files with 2333 additions and 19 deletions

View File

@@ -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 {

View File

@@ -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");
}

View File

@@ -1,4 +1,5 @@
export module tk {

export module tk {
export enum TargetOS {
iOS,
Android,