mirror of
https://github.com/Ukendio/jecs.git
synced 2026-02-04 15:15:21 +00:00
update types
This commit is contained in:
parent
b5bd5a9a02
commit
6475471a9d
1 changed files with 3 additions and 3 deletions
6
src/jecs.d.ts
vendored
6
src/jecs.d.ts
vendored
|
|
@ -173,7 +173,7 @@ export class World {
|
||||||
* @param value The hook callback.
|
* @param value The hook callback.
|
||||||
*/
|
*/
|
||||||
set<T>(component: Entity<T>, hook: StatefulHook, value: (e: Entity, id: Id<T>, data: T) => void): void;
|
set<T>(component: Entity<T>, hook: StatefulHook, value: (e: Entity, id: Id<T>, data: T) => void): void;
|
||||||
set<T>(component: Entity<T>, hook: StatelessHook, value: (e: Entity, id: Id<T>) => void): void;
|
set<T>(component: Entity<T>, hook: StatelessHook, value: (e: Entity, id: Id<T>, deleted?: boolean) => void): void;
|
||||||
/**
|
/**
|
||||||
* Assigns a value to a component on the given entity.
|
* Assigns a value to a component on the given entity.
|
||||||
* @param entity The target entity.
|
* @param entity The target entity.
|
||||||
|
|
@ -277,7 +277,7 @@ export class World {
|
||||||
|
|
||||||
added<T>(component: Entity<T>, listener: (e: Entity, id: Id<T>, value: T) => void): () => void;
|
added<T>(component: Entity<T>, listener: (e: Entity, id: Id<T>, value: T) => void): () => void;
|
||||||
changed<T>(component: Entity<T>, listener: (e: Entity, id: Id<T>, value: T) => void): () => void;
|
changed<T>(component: Entity<T>, listener: (e: Entity, id: Id<T>, value: T) => void): () => void;
|
||||||
removed<T>(component: Entity<T>, listener: (e: Entity, id: Id<T>) => void): () => void;
|
removed<T>(component: Entity<T>, listener: (e: Entity, id: Id<T>, deleted?: boolean) => void): () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function world(): World;
|
export function world(): World;
|
||||||
|
|
@ -326,7 +326,7 @@ export function ECS_PAIR_SECOND(pair: Pair): number;
|
||||||
type StatefulHook = Entity<<T>(e: Entity<T>, id: Id<T>, data: T) => void> & {
|
type StatefulHook = Entity<<T>(e: Entity<T>, id: Id<T>, data: T) => void> & {
|
||||||
readonly __nominal_StatefulHook: unique symbol;
|
readonly __nominal_StatefulHook: unique symbol;
|
||||||
};
|
};
|
||||||
type StatelessHook = Entity<<T>(e: Entity<T>, id: Id<T>) => void> & {
|
type StatelessHook = Entity<<T>(e: Entity<T>, id: Id<T>, deleted?: boolean) => void> & {
|
||||||
readonly __nominal_StatelessHook: unique symbol;
|
readonly __nominal_StatelessHook: unique symbol;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue