@ayanaware/bento
Version:
Modular runtime framework designed to solve complex tasks
54 lines (53 loc) • 2.35 kB
TypeScript
import type { Bento } from './Bento';
import type { Application } from './application/Application';
import { EntityManager } from './entities/EntityManager';
import { Component } from './entities/interfaces/Component';
import { Entity } from './entities/interfaces/Entity';
import { Plugin } from './entities/interfaces/Plugin';
import { ComponentReference } from './entities/types/ComponentReference';
import { EntityReference } from './entities/types/EntityReference';
import { PluginReference } from './entities/types/PluginReference';
import { PropertyManager } from './properties/PropertyManager';
import { VariableManager } from './variables/VariableManager';
/**
* Define Application instance `getApplication()` returns
* @param applicaton Application instance
* @param force Force override. Only use if you know what you're doing.
*/
export declare function useApplication(instance: Application, force?: boolean): void;
export declare function getApplication(): Application;
/**
* Define Bento instance `getBento()` returns
*
* This function will mostly be called internally by Bento in it's constructor
*
* @param bento Bento instance
* @param force Force override. Only use if you know what you're doing.
*/
export declare function useBento(instance: Bento, force?: boolean): void;
/**
* Bento Instance
* @returns Bento
*/
export declare function getBento(): Bento;
/**
* Bento PropertyManager Instance
*/
export declare function getPropertyManager(): PropertyManager;
export declare function hasProperty(name: string): boolean;
export declare function getProperty<T>(name: string): T;
export declare function setProperty<T>(name: string, value: T): T;
/**
* Bento VariableManager Instance
*/
export declare function getVariableManager(): VariableManager;
export declare function hasVariable(name: string): boolean;
export declare function getVariable<T>(name: string, def?: T): T;
export declare function setVariable<T>(name: string, value: T): T;
/**
* Bento EntityManager Instance
*/
export declare function getEntityManager(): EntityManager;
export declare function getEntity<T extends Entity>(reference: EntityReference<T>): T;
export declare function getPlugin<T extends Plugin>(reference: PluginReference<T>): T;
export declare function getComponent<T extends Component>(reference: ComponentReference<T>): T;