mirror of
https://github.com/Ukendio/jecs.git
synced 2026-02-04 15:15:21 +00:00
Add types for DEBUG parameter
This commit is contained in:
parent
d5c9abc57f
commit
74a97bc54e
2 changed files with 5 additions and 8 deletions
8
src/jecs.d.ts
vendored
8
src/jecs.d.ts
vendored
|
|
@ -121,7 +121,7 @@ export class World {
|
||||||
/**
|
/**
|
||||||
* Creates a new World.
|
* Creates a new World.
|
||||||
*/
|
*/
|
||||||
private constructor();
|
private constructor(DEBUG?: boolean);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enforces a check for entities to be created within a desired range.
|
* Enforces a check for entities to be created within a desired range.
|
||||||
|
|
@ -354,9 +354,9 @@ 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
|
type TagToUndefined<T> = T extends TagDiscriminator ? undefined : T
|
||||||
type TrimOptional<T extends unknown[]> = T extends [...infer L, infer R]
|
type TrimOptional<T extends unknown[]> = T extends [...infer L, infer R]
|
||||||
? unknown extends R
|
? unknown extends R
|
||||||
? L | T | TrimOptional<L>
|
? L | T | TrimOptional<L>
|
||||||
: R extends undefined
|
: R extends undefined
|
||||||
? L | T | TrimOptional<L>
|
? L | T | TrimOptional<L>
|
||||||
: T
|
: T
|
||||||
|
|
|
||||||
|
|
@ -2667,9 +2667,6 @@ local function ecs_bulk_remove(world: world, entity: i53, ids: { i53 })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
type Context = {
|
|
||||||
debug: boolean?
|
|
||||||
}
|
|
||||||
local function world_new(DEBUG: boolean?)
|
local function world_new(DEBUG: boolean?)
|
||||||
local eindex_dense_array = {} :: { i53 }
|
local eindex_dense_array = {} :: { i53 }
|
||||||
local eindex_sparse_array = {} :: { record }
|
local eindex_sparse_array = {} :: { record }
|
||||||
|
|
@ -3844,7 +3841,7 @@ local function ecs_entity_record(world: world, entity: i53)
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
world = world_new :: () -> World,
|
world = world_new :: (boolean?) -> World,
|
||||||
World = {
|
World = {
|
||||||
new = world_new
|
new = world_new
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue