Add record types (#271)
Some checks are pending
analysis / Run Luau Analyze (push) Waiting to run
deploy-docs / build (push) Waiting to run
deploy-docs / Deploy (push) Blocked by required conditions
publish-npm / publish (push) Waiting to run
unit-testing / Run Luau Tests (push) Waiting to run

* Add record typings

* Correct
This commit is contained in:
dai 2025-08-20 22:37:32 +02:00 committed by GitHub
parent a6c2d7152e
commit 51b09549db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

8
jecs.d.ts vendored
View file

@ -347,3 +347,11 @@ export function bulk_insert<const C extends Id[]>(
values: { [K in keyof C]: TagToUndefined<InferComponent<C[K]>> }, values: { [K in keyof C]: TagToUndefined<InferComponent<C[K]>> },
): void; ): void;
export function bulk_remove(world: World, entity: Entity, ids: Id[]): void; export function bulk_remove(world: World, entity: Entity, ids: Id[]): void;
export type EntityRecord<T extends Id[]> = {
archetype: Archetype<T>,
row: number,
dense: number,
};
export function record<T extends Id[] = []>(world: World, entity: Entity): EntityRecord<T>;