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.
|
||||
*/
|
||||
private constructor();
|
||||
private constructor(DEBUG?: boolean);
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
type TagToUndefined<T> = T extends TagDiscriminator ? undefined : T
|
||||
type TrimOptional<T extends unknown[]> = T extends [...infer L, infer R]
|
||||
? unknown extends R
|
||||
? L | T | TrimOptional<L>
|
||||
type TrimOptional<T extends unknown[]> = T extends [...infer L, infer R]
|
||||
? unknown extends R
|
||||
? L | T | TrimOptional<L>
|
||||
: R extends undefined
|
||||
? L | T | TrimOptional<L>
|
||||
: T
|
||||
|
|
|
|||
|
|
@ -2667,9 +2667,6 @@ local function ecs_bulk_remove(world: world, entity: i53, ids: { i53 })
|
|||
end
|
||||
end
|
||||
|
||||
type Context = {
|
||||
debug: boolean?
|
||||
}
|
||||
local function world_new(DEBUG: boolean?)
|
||||
local eindex_dense_array = {} :: { i53 }
|
||||
local eindex_sparse_array = {} :: { record }
|
||||
|
|
@ -3844,7 +3841,7 @@ local function ecs_entity_record(world: world, entity: i53)
|
|||
end
|
||||
|
||||
return {
|
||||
world = world_new :: () -> World,
|
||||
world = world_new :: (boolean?) -> World,
|
||||
World = {
|
||||
new = world_new
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue