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