Sync to released Jecs 0.6.0-rc.1-nightly.20250509T001119Z (#58)

Reviewed-on: #58
This commit is contained in:
marked 2025-05-09 02:11:39 +02:00
parent bb51a51eea
commit 8ff7640686
8 changed files with 23 additions and 19 deletions

View file

@ -1,16 +1,16 @@
local jecs = require("@jecs")
type Observer<T...> = {
type Observer = {
callback: (jecs.Entity) -> (),
query: jecs.Query<T...>,
query: jecs.Query<...jecs.Id>,
}
export type PatchedWorld = jecs.World & {
added: <T>(PatchedWorld, jecs.Id<T>, (e: jecs.Entity, id: jecs.Id, value: T) -> ()) -> () -> (),
removed: <T>(PatchedWorld, jecs.Id<T>, (e: jecs.Entity, id: jecs.Id) -> ()) -> () -> (),
changed: <T>(PatchedWorld, jecs.Id<T>, (e: jecs.Entity, id: jecs.Id, value: T) -> ()) -> () -> (),
observer: (PatchedWorld, Observer<any>) -> (),
monitor: (PatchedWorld, Observer<any>) -> (),
added: <T>(PatchedWorld, jecs.Id<T>, (jecs.Entity, jecs.Id, T) -> ()) -> () -> (),
removed: <T>(PatchedWorld, jecs.Id<T>, (jecs.Entity, jecs.Id) -> ()) -> () -> (),
changed: <T>(PatchedWorld, jecs.Id<T>, (jecs.Entity, jecs.Id, T) -> ()) -> () -> (),
observer: (PatchedWorld, Observer) -> (),
monitor: (PatchedWorld, Observer) -> (),
}
local function observers_new(world, description)