@awesome-ecs/abstract
Version:
A comprehensive Entity-Component-System (ECS) Architecture implementation. Abstract components.
57 lines (56 loc) • 2.86 kB
TypeScript
import { IEntity } from "../identity-component-CR1ULadR.js";
import "../types-yh4pOGEm.js";
import "../index-C3UGZqUG.js";
import { IPipeline, IPipelineContext } from "../index-Cm-YSPhK.js";
import "../index-oenqxDCa.js";
import { ISystemContext, ISystemsRuntimeContext } from "../index-CH8ucsKZ.js";
//#region src/factories/context-factory.d.ts
/**
* The IContextFactory interface is used to create abstraction layers for quickly creating Pipeline Contexts.
* It helps to avoid manually resolving all dependencies when creating these contexts.
*/
interface IContextFactory {
/**
* Creates a new instance of ISystemsRuntimeContext.
*
* @template TEntity - The type of entity to be used in the runtime context. It must extend IEntity.
* @returns A new instance of ISystemsRuntimeContext with the specified entity type.
*/
createRuntimeContext<TEntity extends IEntity>(): ISystemsRuntimeContext<TEntity>;
}
//#endregion
//#region src/factories/pipeline-factory.d.ts
/**
* The PipelineFactory interface provides methods to create different types of pipelines.
* It helps to quickly create IPipeline objects without manually resolving their dependencies.
*/
interface IPipelineFactory {
/**
* Creates a new pipeline with the specified context and result type.
*
* @template TContext - The type of the pipeline context. It must extend IPipelineContext.
* @param name - Optional name for the pipeline. If not provided, a default name will be assigned.
* @returns A new instance of IPipeline with the specified context and result type.
*/
createPipeline<TContext extends IPipelineContext>(name?: string): IPipeline<TContext>;
/**
* Creates a new pipeline specifically for systems with the specified entity type and result type.
*
* @template TEntity - The type of the entity. It must extend IEntity.
* @param name - Optional name for the pipeline. If not provided, a default name will be assigned.
* @returns A new instance of IPipeline with the specified system context and result type.
*/
createSystemsPipeline<TEntity extends IEntity>(name?: string): IPipeline<ISystemContext<TEntity>>;
/**
* Creates a new pipeline specifically for systems runtime with the specified entity type and result type.
*
* @template TEntity - The type of the entity. It must extend IEntity.
* @template TResult - The type of the result returned by the pipeline. Default is MiddlewareResult.
* @param name - Optional name for the pipeline. If not provided, a default name will be assigned.
* @returns A new instance of IPipeline with the specified systems runtime context and result type.
*/
createRuntimePipeline<TEntity extends IEntity>(name?: string): IPipeline<ISystemsRuntimeContext<TEntity>>;
}
//#endregion
export { IContextFactory, IPipelineFactory };
//# sourceMappingURL=index.d.ts.map