Add world.clear to types (#68)

* Sync typescript types to 0.2.2

* semicolon

* Add world.clear to the types

* Add luau type for clear
This commit is contained in:
EncodedVenom 2024-07-08 10:04:28 -04:00 committed by GitHub
parent 6b8dde8fd3
commit 7d2cd6219b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

6
src/index.d.ts vendored
View file

@ -55,6 +55,12 @@ export class World {
*/
target(id: Entity, relation: Entity): Entity | undefined;
/**
* Clears an entity from the world.
* @praram id Entity to be cleared
*/
clear(id: Entity): void;
/**
* Deletes an entity and all its related components and relationships.
* @param id Entity to be destroyed

View file

@ -942,6 +942,9 @@ export type WorldShim = typeof(setmetatable(
add: <T>(WorldShim, id: Entity, component: Entity<T>) -> (),
--- Assigns a value to a component on the given entity
set: <T>(WorldShim, id: Entity, component: Entity<T>, data: T) -> (),
-- Clears an entity from the world
clear: (WorldShim, id: Entity) -> (),
--- Removes a component from the given entity
remove: (WorldShim, id: Entity, component: Entity) -> (),
--- Retrieves the value of up to 4 components. These values may be nil.