diff --git a/jecs.d.ts b/jecs.d.ts index 179a4b0..6b18f36 100644 --- a/jecs.d.ts +++ b/jecs.d.ts @@ -150,6 +150,14 @@ export class World { * @param component The component (or tag) to add. */ add(entity: Entity, component: undefined extends InferComponent ? C : Id): 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(entity: Entity, component: Id, value: T): void; /** * Installs a hook on the given component. @@ -158,15 +166,13 @@ export class World { * @param value The hook callback. */ set(component: Entity, hook: StatefulHook, value: (e: Entity, id: Id, data: T) => void): void; - set(component: Entity, hook: StatelessHook, value: (e: Entity, id: Id) => 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. + * Installs a hook on the given component. + * @param component The target component. + * @param hook The hook to install. + * @param value The hook callback. */ - set>(entity: Entity, component: E, value: InferComponent): void; + set(component: Entity, hook: StatelessHook, value: (e: Entity, id: Id) => void): void; /** * Cleans up the world by removing empty archetypes and rebuilding the archetype collections.