# typed-ecstasy

# Table of contents

# Classes

# Interfaces

# Type aliases

# Functions

# Type aliases

# ComponentConfig

Ƭ ComponentConfig: Record<string, unknown>

# Defined in

src/factory/ComponentFactory.ts:4 (opens new window)


# ComponentFactory

Ƭ ComponentFactory<T, TContext>: (obtain: ObtainComponent, blueprint: ComponentBlueprint<T>, context: TContext) => Component | null

# Type parameters

Name Type Description
T extends ComponentConfig The component config.
TContext TContext The context type.

# Type declaration

▸ (obtain, blueprint, context): Component | null

A component factory creates a Component based on the blueprint.

# Parameters
Name Type Description
obtain ObtainComponent A function to obtain a new or reused component instance.
blueprint ComponentBlueprint<T> The blueprint.
context TContext The context to use.
# Returns

Component | null

The component to add or null if it should not be added.

# Defined in

src/factory/ComponentFactory.ts:25 (opens new window)


# ComponentFactoryRegistry

Ƭ ComponentFactoryRegistry<TEntityConfig, TContext>: Object

A component factory registry.

# Type parameters

Name Type Description
TEntityConfig extends EntityConfig The entity config to use.
TContext TContext The context to be passed to component factories.

# Type declaration

Name Type
add <TName>(name: TName, factory: ComponentFactory<Exclude<TEntityConfig[TName], undefined>, TContext>) => void
get (name: string) => ComponentFactory<any, TContext>

# Defined in

src/factory/ComponentFactory.ts:37 (opens new window)


# DelayedOperations

Ƭ DelayedOperations<T>: T & { shouldDelay: boolean ; processDelayedOperations: () => void }

Represents the managing class to delay operations.

# Type parameters

Name Type Description
T extends Record<string, (...args: any[]) => void> The type of the object containing methods to be delayed.

# Defined in

src/utils/DelayedOperations.ts:63 (opens new window)


# EntityComparator

Ƭ EntityComparator: (a: Entity, b: Entity) => number

# Type declaration

▸ (a, b): number

A comparator for entities.

see Array.sort()

# Parameters
Name Type
a Entity
b Entity
# Returns

number

# Defined in

src/systems/SortedIteratingSystem.ts:12 (opens new window)


# EntityConfig

Ƭ EntityConfig: Record<string, ComponentConfig>

# Defined in

src/factory/ComponentFactory.ts:5 (opens new window)


# EntityConfigOverrides

Ƭ EntityConfigOverrides<T>: { [P in keyof T]?: Partial<T[P]> }

An object with overrides for each component.

# Type parameters

Name Description
T The EntityConfig to override.

# Defined in

src/factory/EntityFactory.ts:11 (opens new window)


# ObtainComponent

Ƭ ObtainComponent: <T>(clazz: NoArgsComponentConstructor<T>) => T

# Type declaration

▸ <T>(clazz): T

A function, which creates a component.

# Type parameters
Name Type Description
T extends Component The component class to be created.
# Parameters
Name Type Description
clazz NoArgsComponentConstructor<T> The constructor of the component.
# Returns

T

# Defined in

src/factory/ComponentFactory.ts:13 (opens new window)

# Functions

# createComponentFactoryRegistry

createComponentFactoryRegistry<T, TContext>(): ComponentFactoryRegistry<T, TContext>

Create a registry for component factories.

# Type parameters

Name Type Description
T extends EntityConfig The entity config to use.
TContext TContext -

# Returns

ComponentFactoryRegistry<T, TContext>

A new registry.

# Defined in

src/factory/ComponentFactory.ts:58 (opens new window)


# createDelayedOperations

createDelayedOperations<T>(operations): DelayedOperations<T>

A helper for delaying operations during engine updates.

# Type parameters

Name Type
T extends Record<string, (...args: any[]) => void>

# Parameters

Name Type Description
operations T An object containing methods to be delayed.

# Returns

DelayedOperations<T>

A new DelayedOperations instance.

# Defined in

src/utils/DelayedOperations.ts:78 (opens new window)