Compare commits

..

3 commits

Author SHA1 Message Date
PepeElToro41
4bd2e47eca
Merge f912866fcb into bd00edc8c0 2025-08-17 15:37:28 -07:00
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[]> = { export type Archetype<T extends Id[]> = {
id: number; id: number;
types: number[]; types: Entity[];
type: string; type: string;
entities: number[]; entities: Entity[];
columns: Column<unknown>[]; columns: Column<unknown>[];
columns_map: { [K in T[number]]: Column<InferComponent<K>> }; 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[]> = { export type CachedQuery<T extends Id[]> = {
/** /**
* Returns an iterator that produces a tuple of [Entity, ...queriedComponents]. * Returns an iterator that produces a tuple of [Entity, ...queriedComponents].
*/ */
iter(): Iter<T>; iter(): IterFn<T>;
/** /**
* Returns the matched archetypes of the query * 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]. * 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. * Creates and returns a cached version of this query for efficient reuse.