comments for world:targets (#312)
Some checks are pending
analysis / Run Luau Analyze (push) Waiting to run
build-studio-docs / Build Studio Docs (push) Waiting to run
unit-testing / Run Luau Tests (push) Waiting to run

* docs for world:targets

* Update src/jecs.d.ts

Co-authored-by: dai <contact@daimond113.com>

* remove world:targets() mention in 042_target.luau

* ensure doc comments are same across files

---------

Co-authored-by: dai <contact@daimond113.com>
This commit is contained in:
kuro 2026-04-29 10:23:40 -04:00 committed by GitHub
parent e2c56f5420
commit bfc3eb9980
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

8
src/jecs.d.ts vendored
View file

@ -155,6 +155,14 @@ export class World {
*/ */
target(entity: Entity, relation: Entity, index?: number): Entity | undefined; target(entity: Entity, relation: Entity, index?: number): Entity | undefined;
/**
* Gets an iterator for all targets of a relationship.
* Returns an empty iterator if no matches are found.
* @param entity The entity using a relationship pair.
* @param relation The "relationship" component/tag
*/
targets(entity: Entity, relation: Entity): IterFn<[]>
/** /**
* Deletes an entity (and its components/relationships) from the world entirely. * Deletes an entity (and its components/relationships) from the world entirely.
* @param entity The entity to delete. * @param entity The entity to delete.

View file

@ -254,7 +254,8 @@ export type World = {
index: number? index: number?
) -> Entity<unknown>?, ) -> Entity<unknown>?,
-- Gets an iterator for all viable targets of a relationship -- Gets an iterator for all targets of a relationship.
-- Returns an empty iterator if no matches are found.
targets: <T>( targets: <T>(
self: World, self: World,
id: Entity<T> | number, id: Entity<T> | number,