import { App, Debugger, Plugin } from './index'; import { BlueRainAPI, JsonComponentSchema } from './apis'; import { ConfigType } from './config'; import { ComponentRegistry as IComponentRegistry } from './typings/registries/ComponentRegistry'; import AppRegistry from './registries/AppRegistry'; import ConfigRegistry from './registries/ConfigRegistry'; import DebuggerRegistry from './registries/DebuggerRegistry'; import EventRegistry from './registries/EventRegistry'; import FilterRegistry from './registries/FilterRegistry'; import HooksRegistry from './registries/HooksRegistry'; import PluginRegistry from './registries/PluginRegistry'; import React from 'react'; /** * Functions */ export declare type setMainViewFunction = (App: React.ComponentType) => void; export interface BlueRainType { Apps: AppRegistry; Components: IComponentRegistry; Configs: ConfigRegistry; Events: EventRegistry; Filters: FilterRegistry; Plugins: PluginRegistry; Hooks: HooksRegistry; Debug: DebuggerRegistry; Platform: PluginRegistry; API: BlueRainAPI; [key: string]: any; Utils: { parseJsonSchema: (schema: JsonComponentSchema) => React.ReactElement | null; setMainView: setMainViewFunction; createStyleSheet: any; }; refs?: { [id: string]: any; }; boot: (options?: BootOptions) => React.ComponentType; reboot: (options?: BootOptions) => React.ComponentType; reset: (hard?: boolean) => void; booted: boolean; bootOptions?: BootOptions; } /** * Options object that `boot` and `bootOnServer` methods expect. * * @property {Array} apps An array of apps to load * @property {ConfigType} config Configuration object * @property {boolean} renderApp If set to false, BlueRain will not render the main app, * instead it is up to the developer to render it. The App is returned from the boot function. * @property {Array} plugins An array of plugins to load */ export declare type BootOptions = { apps?: App[]; config?: ConfigType; renderApp?: boolean; plugins?: Plugin[]; platform?: Plugin[]; debuggers?: Debugger[]; }; /** * This is the main BlueRain context. Works as a backbone of whole system. * * @namespace * @prop {AppRegistry} Apps Instance object of AppRegistry. * @prop {ComponentRegistry} Components Instance object of ComponentRegistry. * @prop {ConfigRegistry} Configs Instance object of ConfigRegistry. * @prop {EventRegistry} Events Instance object of EventRegistry. * @prop {FilterRegistry} Filters Instance object of FilterRegistry. * @prop {PluginRegistry} Plugins Instance object of PluginRegistry. * @prop {Object} Utils Contains utility methods. * @prop {Function} Utils.setMainView Set BlueRain component as the main view of the app * @prop {Object} refs Contains references of objects created by different apps and plugins * @prop {boolean} booted true if the OS has already booted * @prop {Object} booleanOptions Cache of initial boot options provided at boot time * @prop {boolean} _isSsrMode Flag to identify if the system is currently running during Server Side Rendering */ export declare class BlueRain implements BlueRainType { Apps: AppRegistry; Components: IComponentRegistry; Configs: ConfigRegistry; Events: EventRegistry; Filters: FilterRegistry; Hooks: HooksRegistry; Debug: DebuggerRegistry; Plugins: PluginRegistry; Platform: PluginRegistry; API: BlueRainAPI; Utils: { parseJsonSchema: (schema: JsonComponentSchema) => React.ReactElement | null; createStyleSheet: (styles: object) => object; setMainView: (MainView: React.ComponentType) => void; }; refs: {}; booted: boolean; bootOptions: BootOptions; private _isSsrMode; boot(options?: BootOptions): React.ComponentType; /** * Reset (clear) BlueRain registries * @param {boolean} hard Flag to do a hard reset. This will erase initial boot options as well. */ reset(hard?: boolean): void; /** * Performs a reset and boot. */ reboot(options?: BootOptions): React.ComponentType; /** * Enables server side rendering mode */ enableSsrMode(): void; /** * Disables server side rendering mode */ disableSsrMode(): void; /** * Checks if SSR mode is enabled. */ isSsrMode(): boolean; }