mirror of
https://github.com/Ukendio/jecs.git
synced 2025-09-23 08:39:16 +00:00
Compare commits
No commits in common. "bd00edc8c092a971684dbd5426329d09ad61c9c6" and "65a27a798af20c2f54a966fadbd5f1e4c335d20a" have entirely different histories.
bd00edc8c0
...
65a27a798a
1 changed files with 5 additions and 13 deletions
18
jecs.d.ts
vendored
18
jecs.d.ts
vendored
|
@ -49,28 +49,20 @@ export type Column<T> = T[];
|
|||
|
||||
export type Archetype<T extends Id[]> = {
|
||||
id: number;
|
||||
types: Entity[];
|
||||
types: number[];
|
||||
type: string;
|
||||
entities: Entity[];
|
||||
entities: number[];
|
||||
columns: Column<unknown>[];
|
||||
columns_map: { [K in T[number]]: Column<InferComponent<K>> };
|
||||
};
|
||||
|
||||
type IterFn<T extends Id[]> = IterableFunction<LuaTuple<[Entity, ...InferComponents<T>]>>;
|
||||
type Iter<T extends Id[]> = IterFn<T> & {
|
||||
/**
|
||||
* This isn't callable
|
||||
* @hidden
|
||||
* @deprecated
|
||||
*/
|
||||
(): never
|
||||
};
|
||||
type Iter<T extends Id[]> = IterableFunction<LuaTuple<[Entity, ...InferComponents<T>]>>;
|
||||
|
||||
export type CachedQuery<T extends Id[]> = {
|
||||
/**
|
||||
* Returns an iterator that produces a tuple of [Entity, ...queriedComponents].
|
||||
*/
|
||||
iter(): IterFn<T>;
|
||||
iter(): Iter<T>;
|
||||
|
||||
/**
|
||||
* Returns the matched archetypes of the query
|
||||
|
@ -83,7 +75,7 @@ export type Query<T extends Id[]> = {
|
|||
/**
|
||||
* Returns an iterator that produces a tuple of [Entity, ...queriedComponents].
|
||||
*/
|
||||
iter(): IterFn<T>;
|
||||
iter(): Iter<T>;
|
||||
|
||||
/**
|
||||
* Creates and returns a cached version of this query for efficient reuse.
|
||||
|
|
Loading…
Reference in a new issue