Sync to upstream Jecs 0.6.0-rc.1-nightly.20250509T001119Z

This commit is contained in:
forgejo-actions 2025-05-09 00:11:37 +00:00 committed by github-actions[bot]
parent bb51a51eea
commit 238f2eadc5
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)