Compare commits

...

2 commits

Author SHA1 Message Date
dai
bd00edc8c0
Separate Iter from IterFn (#267)
Some checks failed
analysis / Run Luau Analyze (push) Has been cancelled
deploy-docs / build (push) Has been cancelled
publish-npm / publish (push) Has been cancelled
unit-testing / Run Luau Tests (push) Has been cancelled
deploy-docs / Deploy (push) Has been cancelled
* Separate Iter from IterFn

* Clean up
2025-08-17 21:59:06 +02:00
dai
0bc1848554
Correct Archetype field types (#268) 2025-08-17 21:58:41 +02:00

18
jecs.d.ts vendored
View file

@ -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.