@vert/core
Version:
Library to build OOP applications which are based on Vue.
68 lines (67 loc) • 1.61 kB
TypeScript
import Vue from 'vue';
import { TConstructor, THookFunction, TRootComponent } from '../types';
/**
* Constructor param of AppPage.
*
* @interface IAppPage
*/
export interface IAppOption {
element?: string | HTMLElement;
name?: string;
RootComponent: TRootComponent;
router?: any;
store?: any;
created?: THookFunction;
mounted?: THookFunction;
beforeDestroy?: THookFunction;
}
/**
* App is the basic unit for a project.
*
* @description
* Page is the root member for an app. Create an instance to initialize your app.
*
* @class App
*/
export declare class App {
/**
* Register target as a singleton provider in global.
*
* @static
* @template T
* @param {TConstructor[]} Providers
*/
static addSingleton(...Providers: TConstructor[]): typeof App;
/**
* Register target as a transient provider in global.
*
* @static
* @template T
* @param {TConstructor[]} Providers
*/
static addTransient(...Providers: TConstructor[]): typeof App;
private _element?;
private _name;
private _store?;
private _router?;
private _viewModel;
private _rootComponent;
get name(): string;
get store(): any;
get viewModel(): Vue;
get RootComponent(): TRootComponent;
private initViewModel;
/**
* Start up this app.
*
* @memberof App
*/
start(): void;
/**
* Destroy app.
*
* @memberof App
*/
destroy(): void;
constructor(option: IAppOption);
}