mirror of
https://github.com/Ukendio/jecs.git
synced 2025-08-04 19:29:18 +00:00
Compare commits
No commits in common. "28ef8d72346159b702d4463f86406e4ea496b1e9" and "dab260f733c40552d9d221a7836e673f1e06f81d" have entirely different histories.
28ef8d7234
...
dab260f733
1 changed files with 8 additions and 17 deletions
25
jecs.d.ts
vendored
25
jecs.d.ts
vendored
|
@ -151,14 +151,6 @@ export class World {
|
|||
*/
|
||||
add<C>(entity: Entity, component: undefined extends InferComponent<C> ? C : Id<undefined>): void;
|
||||
|
||||
/**
|
||||
* Assigns a value to a component on the given entity.
|
||||
* @param entity The target entity.
|
||||
* @param component The component definition (could be a Pair or Entity).
|
||||
* @param value The value to store with that component.
|
||||
*/
|
||||
set<T>(entity: Entity, component: Id<T>, value: T): void;
|
||||
|
||||
/**
|
||||
* Installs a hook on the given component.
|
||||
* @param component The target component.
|
||||
|
@ -166,14 +158,16 @@ export class World {
|
|||
* @param value The hook callback.
|
||||
*/
|
||||
set<T>(component: Entity<T>, hook: StatefulHook, value: (e: Entity<T>, id: Id<T>, data: T) => void): void;
|
||||
/**
|
||||
* Installs a hook on the given component.
|
||||
* @param component The target component.
|
||||
* @param hook The hook to install.
|
||||
* @param value The hook callback.
|
||||
*/
|
||||
set<T>(component: Entity<T>, hook: StatelessHook, value: (e: Entity<T>, id: Id<T>) => void): void;
|
||||
|
||||
/**
|
||||
* Assigns a value to a component on the given entity.
|
||||
* @param entity The target entity.
|
||||
* @param component The component definition (could be a Pair or Entity).
|
||||
* @param value The value to store with that component.
|
||||
*/
|
||||
set<E extends Id<unknown>>(entity: Entity, component: E, value: InferComponent<E>): void;
|
||||
|
||||
/**
|
||||
* Cleans up the world by removing empty archetypes and rebuilding the archetype collections.
|
||||
* This helps maintain memory efficiency by removing unused archetype definitions.
|
||||
|
@ -295,9 +289,6 @@ export function pair_first<P, O>(world: World, p: Pair<P, O>): Entity<P>;
|
|||
*/
|
||||
export function pair_second<P, O>(world: World, p: Pair<P, O>): Entity<O>;
|
||||
|
||||
export function ECS_PAIR_FIRST(pair: Pair): number;
|
||||
export function ECS_PAIR_SECOND(pair: Pair): number;
|
||||
|
||||
type StatefulHook = Entity<<T>(e: Entity<T>, id: Id<T>, data: T) => void> & {
|
||||
readonly __nominal_StatefulHook: unique symbol,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue