import 'normalize.css';
import './util.css';
import utils from 'somes';
import { Router, history } from './router';
import Page, { DataPage } from './page';
import * as ReactDom from 'react-dom';
import * as React from 'react';
import { Component } from 'react';
import { Link } from 'react-router-dom';
import { ViewController } from './ctr';
var current = null;
export class Root extends ViewController {
    constructor() {
        super(...arguments);
        this.loadingText = 'Loading..';
    }
    async triggerLoad() {
        current = this;
    }
    get history() {
        return history;
    }
    render() {
        return (this.isLoaded ?
            React.createElement(Router, { ref: "router", notFound: this.props.notFound, routes: this.props.routes }) :
            React.createElement("div", { className: "init-loading" }, this.loadingText));
    }
    static get current() {
        utils.assert(current);
        return current;
    }
}
export { React, ReactDom, Component, Router, Page, DataPage, Link, ViewController, };
