reactant
Version:
A framework for building React web applications
55 lines • 1.31 kB
TypeScript
import { Context } from 'react';
import { Container } from 'reactant-module';
import { Config, App, Renderer } from './interfaces';
export declare const ContainerContext: Context<Container | null>;
/**
* ## Description
*
* You can create an app with `createApp()` passing app configuration,
* which will return an object including `instance`, `store`,
* and `bootstrap()` method(You can run `bootstrap` to start the app inject into the browser or mobile).
*
* ## Example
*
* ```typescript
* import { createApp, injectable } from 'reactant';
*
* @injectable()
* class Foo {}
*
* const app = createApp({
* modules: [],
* main: Foo,
* render: () => {},
* });
*
* expect(app.instance instanceof Foo).toBeTruthy();
* ```
*/
declare function createApp<T, S extends any[], R extends Renderer<S>>({
/**
* As the main start-up module.
*/
main,
/**
* As a rendering function for any React renderer.
*/
render,
/**
* Importing the injected dependency modules.
*/
modules: _modules,
/**
* Dependent injection container options.
*/
containerOptions,
/**
* Preloaded state of shared state for Redux.
*/
preloadedState,
/**
* Reactant's development setting options.
*/
devOptions, }: Config<T, S, R>): App<T, S, R>;
export { createApp };
//# sourceMappingURL=createApp.d.ts.map