diff --git a/jecs.d.ts b/jecs.d.ts index 4ffb93b..8d2e03e 100644 --- a/jecs.d.ts +++ b/jecs.d.ts @@ -150,15 +150,6 @@ export class World { * @param component The component (or tag) to add. */ add(entity: Entity, component: undefined extends InferComponent ? C : Id): 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(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. @@ -168,6 +159,21 @@ export class World { */ set>(entity: Entity, component: E, value: InferComponent): 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(component: Entity, hook: StatefulHook, value: (e: Entity, id: Id, 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(component: Entity, hook: StatelessHook, value: (e: Entity, id: Id) => void): void; + /** * Cleans up the world by removing empty archetypes and rebuilding the archetype collections. * This helps maintain memory efficiency by removing unused archetype definitions.