Compare commits

..

3 commits

Author SHA1 Message Date
PepeElToro41
5bf0d80ca4
Merge f912866fcb into 51b09549db 2025-08-20 17:36:24 -06:00
dai
51b09549db
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
2025-08-20 22:37:32 +02:00
dai
a6c2d7152e
Allow tags in bulk_insert (#269) 2025-08-20 22:30:43 +02:00

12
jecs.d.ts vendored
View file

@ -338,10 +338,20 @@ export type ComponentRecord = {
export function component_record(world: World, id: Id): ComponentRecord; export function component_record(world: World, id: Id): ComponentRecord;
type TagToUndefined<T> = T extends TagDiscriminator ? undefined : T
export function bulk_insert<const C extends Id[]>( export function bulk_insert<const C extends Id[]>(
world: World, world: World,
entity: Entity, entity: Entity,
ids: C, ids: C,
values: InferComponents<C>, 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>;