blecsd 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -2
- package/README.md +167 -65
- package/dist/3d/index.d.ts +2 -2
- package/dist/3d/index.js +1 -1
- package/dist/audio/index.d.ts +2 -2
- package/dist/{border-D_Jb4ZJV.d.ts → border-DGNDfT6T.d.ts} +20 -10
- package/dist/chunk-25OEBENM.js +3 -0
- package/dist/chunk-26STV7ZS.js +1 -0
- package/dist/chunk-2NMGUEFC.js +4 -0
- package/dist/{chunk-LYSK5S63.js → chunk-4PRDJTCM.js} +1 -1
- package/dist/chunk-5N3O25O7.js +1 -0
- package/dist/chunk-5VEKHA3B.js +5 -0
- package/dist/chunk-6KEM3OS2.js +11 -0
- package/dist/chunk-6PX5R326.js +1 -0
- package/dist/chunk-6XWY6GB7.js +1 -0
- package/dist/chunk-735KKTP3.js +1 -0
- package/dist/chunk-7SWJNDOL.js +26 -0
- package/dist/chunk-APKUNIMB.js +1 -0
- package/dist/{chunk-FGHEFXLK.js → chunk-CJCSZRV6.js} +1 -1
- package/dist/chunk-DMBMCCLN.js +1 -0
- package/dist/chunk-DQTVJITR.js +1 -0
- package/dist/chunk-DSKQ5J4R.js +1 -0
- package/dist/chunk-E4CJRSND.js +1 -0
- package/dist/{chunk-OB66FB4F.js → chunk-EF4DC6IN.js} +1 -1
- package/dist/chunk-EJAKECSN.js +1 -0
- package/dist/chunk-FNQRUMFD.js +1 -0
- package/dist/chunk-GJ3RS2VG.js +1 -0
- package/dist/{chunk-TYMY2TBR.js → chunk-JHCKPCUH.js} +3 -3
- package/dist/{chunk-2UBBZFE4.js → chunk-KTVEMB2I.js} +1 -1
- package/dist/chunk-KYAPE44E.js +8 -0
- package/dist/chunk-LI4Y7TBZ.js +1 -0
- package/dist/chunk-NHOL4BN6.js +1 -0
- package/dist/chunk-NPDPBAW6.js +4 -0
- package/dist/chunk-NPNUUSIB.js +1 -0
- package/dist/chunk-OFRWGW2G.js +1 -0
- package/dist/chunk-OMU5BSAS.js +2 -0
- package/dist/chunk-P3ZLIQJP.js +1 -0
- package/dist/chunk-PWI36BQJ.js +1 -0
- package/dist/{chunk-VNZ6CWJA.js → chunk-QQMUDJ32.js} +2 -2
- package/dist/chunk-R3ICZOE4.js +1 -0
- package/dist/chunk-RJULLVTH.js +1 -0
- package/dist/{chunk-3B7MIVW6.js → chunk-RZ7FGVI6.js} +1 -1
- package/dist/chunk-S6WS46FE.js +1 -0
- package/dist/{chunk-TWSWTBYL.js → chunk-TSARUU56.js} +1 -1
- package/dist/chunk-WJRVUAZR.js +33 -0
- package/dist/{chunk-JKVHO4LH.js → chunk-WY5EZOOL.js} +1 -1
- package/dist/chunk-YY6RZCZH.js +4 -0
- package/dist/chunk-ZPGJCHXH.js +1 -0
- package/dist/chunk-ZPL2J25N.js +1 -0
- package/dist/cli/init.d.ts +1 -1
- package/dist/{componentStorage-DTkj1Qyj.d.ts → componentStorage-CJTh-TPO.d.ts} +1 -1
- package/dist/components/index.d.ts +7137 -5587
- package/dist/components/index.js +1 -1
- package/dist/core/index.d.ts +4138 -3169
- package/dist/core/index.js +1 -1
- package/dist/debug/index.d.ts +491 -98
- package/dist/debug/index.js +1 -1
- package/dist/dirtyTracking-C4v8MmM9.d.ts +235 -0
- package/dist/errors/index.d.ts +12 -12
- package/dist/errors/index.js +1 -1
- package/dist/{events-BbbxkgvX.d.ts → events-9ForpTfM.d.ts} +75 -2
- package/dist/game/index.d.ts +8 -8
- package/dist/game/index.js +1 -1
- package/dist/{gameLoop-BIPW7-OY.d.ts → gameLoop-CSTb7e0L.d.ts} +2 -2
- package/dist/{index-zSGJ2eUk.d.ts → index-DBS5Uefn.d.ts} +2 -2
- package/dist/index.d.ts +1005 -26
- package/dist/index.js +3 -1
- package/dist/input/index.d.ts +1 -1
- package/dist/input/index.js +1 -1
- package/dist/{inputActions-CefRUBuT.d.ts → inputActions-Fyw14_Gm.d.ts} +11 -722
- package/dist/{keyParser-Bwm8-l7v.d.ts → keyParser-m7fWto6g.d.ts} +18 -18
- package/dist/{mouseParser-Cfrbn3AX.d.ts → mouseParser-B7p5ow7K.d.ts} +1 -1
- package/dist/{packedStore-480t2X74.d.ts → packedStore-BgvnEdE7.d.ts} +1 -1
- package/dist/{renderable-jTMOA-GK.d.ts → renderable-CwqGwrEV.d.ts} +9 -9
- package/dist/scheduler-DeeZleia.d.ts +150 -0
- package/dist/systems/index.d.ts +473 -37
- package/dist/systems/index.js +1 -1
- package/dist/terminal/index.d.ts +2481 -2225
- package/dist/terminal/index.js +1 -1
- package/dist/{tilemap-j0twN9-y.d.ts → tilemap-BirMJdbu.d.ts} +2 -2
- package/dist/{types-BcsvoKzf.d.ts → types-CPB4CpbH.d.ts} +2 -2
- package/dist/utils/index.d.ts +28 -27
- package/dist/utils/index.js +1 -1
- package/dist/{virtualScrollback-DvZTRU8a.d.ts → virtualScrollback-D9uLFe8l.d.ts} +4 -4
- package/dist/{virtualViewport-Dx2iJliO.d.ts → virtualViewport-DTSN6jFk.d.ts} +370 -848
- package/dist/widgets/bigText.d.ts +1 -1
- package/dist/widgets/bigText.js +1 -1
- package/dist/widgets/index.d.ts +12079 -5902
- package/dist/widgets/index.js +1 -1
- package/package.json +102 -6
- package/dist/chunk-35I22JJO.js +0 -1
- package/dist/chunk-3APDF6RW.js +0 -1
- package/dist/chunk-3EGGGI5J.js +0 -3
- package/dist/chunk-4GISPPOH.js +0 -33
- package/dist/chunk-4X4N4HNQ.js +0 -2
- package/dist/chunk-6N6BRCEM.js +0 -4
- package/dist/chunk-AXZQAH4X.js +0 -1
- package/dist/chunk-BCADUCOZ.js +0 -1
- package/dist/chunk-CIK4AMUA.js +0 -1
- package/dist/chunk-EAY7B5GL.js +0 -1
- package/dist/chunk-EJ5WVDDZ.js +0 -6
- package/dist/chunk-FMFEOAML.js +0 -1
- package/dist/chunk-FYEBZAWN.js +0 -1
- package/dist/chunk-G7GIWWLE.js +0 -1
- package/dist/chunk-GYHI26UE.js +0 -1
- package/dist/chunk-H2YAOJDW.js +0 -1
- package/dist/chunk-JUWDTH25.js +0 -1
- package/dist/chunk-K2B2OXQ5.js +0 -5
- package/dist/chunk-K3SX2LY5.js +0 -1
- package/dist/chunk-KD55INV7.js +0 -1
- package/dist/chunk-KFAK4A3G.js +0 -1
- package/dist/chunk-LB3JA744.js +0 -19
- package/dist/chunk-LCN2ZITE.js +0 -1
- package/dist/chunk-P6CJO3BC.js +0 -1
- package/dist/chunk-PSXXMBVJ.js +0 -1
- package/dist/chunk-PXXGH3BV.js +0 -1
- package/dist/chunk-SHUC6JWA.js +0 -1
- package/dist/chunk-VCW7EOZ4.js +0 -12
- package/dist/chunk-W5OU7Z6J.js +0 -1
- package/dist/chunk-WHF27JF3.js +0 -4
- package/dist/chunk-WNG4A3K7.js +0 -4
- package/dist/chunk-WY3KY2TR.js +0 -1
- package/dist/chunk-XZA63ZPO.js +0 -1
- package/dist/scheduler-DcfoFuum.d.ts +0 -86
package/dist/core/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{gd as BUILTIN_PHASE_NAMES,B as Clipping,Xc as DEFAULT_NAV_BINDINGS,Wc as DEFAULT_TEXT_BINDINGS,bc as DEFAULT_Z_INDEX,Pd as INHERITING_PROPERTIES,Yc as InitPriority,i as JUNCTION_ASCII,h as JUNCTION_BOLD,g as JUNCTION_DOUBLE,f as JUNCTION_SINGLE,Hc as KeyBindingSchema,Ic as KeyBindingsArraySchema,cc as MAX_Z_INDEX,dc as MIN_Z_INDEX,Qd as NON_INHERITING_PROPERTIES,A as Overflow,Ab as PositionCache,kd as PositionValueSchema,Jd as SERIALIZATION_VERSION,ec as ZOrder,fb as applyCustomEffect,pb as applyDisabledEffect,$a as applyFocusEffect,cb as applyHoverEffect,u as applyJunctions,nb as applyPressEffect,Nd as applyShrink,yb as bubbleEvent,Od as calculateShrinkSize,qd as centerPosition,nd as clampPosition,M as clampToClipRect,wb as clearAllEffectConfigs,Gb as clearAllPositionCaches,_a as clearAllStoredStyles,fd as clearCapabilityCache,Na as clearCleanupCallbacks,Ua as clearDestroyQueue,sa as clearDirtyTracking,k as clearDockingContext,vb as clearEffectState,mb as clearEffects,za as clearLifecycleEventBuses,Dd as clearSerializableRegistry,Za as clearStoredStyle,Ud as clearStyleCache,Id as cloneSnapshot,_d as computeInheritedStyle,j as createBorderDockingContext,xb as createBubbleableEvent,sc as createClickableCache,G as createClipRect,S as createClipStack,ea as createDirtyTracker,zb as createEntityEventBusStore,wd as createFadeTransition,H as createInfiniteClipRect,Kc as createKeyBindingRegistry,id as createPhaseManager,vd as createSceneManager,yd as createSceneSystem,xd as createSlideTransition,jd as defaultPhaseManager,Gd as deserializeWorld,Hd as deserializeWorldFromJSON,Pa as destroyAllChildren,Oa as destroyEntity,Sa as destroyWorld,t as detectAllJunctions,m as detectBorderStyle,ed as detectCapabilities,s as detectJunctions,ae as doesPropertyInherit,Ba as emitAdopt,Ca as emitAttach,Fa as emitDestroy,Da as emitDetach,Ea as emitRemove,Aa as emitReparent,Rc as evaluateCondition,_b as filterClickable,Ub as filterDirty,Zb as filterFocusable,Tb as filterVisible,Vb as filterVisibleDirty,ce as findPropertySource,Ra as flushDestroyQueue,ta as forceFullRedrawFlag,Tc as formatKey,Uc as formatKeyEvent,cd as formatStartupReport,W as getAbsolutePosition,Fc as getAllClickablesAt,Gc as getAllHoverablesAt,b as getAutoPadding,Oc as getBindingForAction,Pc as getBindingsForKey,Rd as getCacheGeneration,Ib as getCachedInnerHeight,Hb as getCachedInnerWidth,Wb as getChildEntities,pc as getChildrenByZIndex,Dc as getClickableAt,xc as getClickableCount,wc as getClickableEntities,P as getClipRect,O as getClipRectHeight,Q as getClipRectToAncestor,N as getClipRectWidth,F as getClipping,ib as getComputedEffectStyle,ba as getComputedPosition,ee as getComputedStyles,q as getConnectionFlags,V as getCurrentClip,Xd as getDefaultStyle,Xb as getDescendantEntities,Ta as getDestroyQueueSize,qa as getDirtyEntities,na as getDirtyRegions,wa as getDirtyRegionsInViewport,ra as getDirtyStats,y as getEdgeCount,z as getEdgesAt,ub as getEffectState,c as getEffectivePadding,lb as getEffects,Ec as getHoverableAt,be as getInheritedProperty,Z as getInnerDimensions,Y as getInnerPosition,r as getJunctionChar,n as getJunctionCharset,v as getJunctionRenderData,xa as getLifecycleEventBus,Wd as getLocalStyle,gc as getLocalZ,jb as getOriginalStyle,E as getOverflow,Cb as getPositionCache,Cd as getRegisteredComponents,X as getRelativePosition,Yb as getRootEntities,Bd as getSerializable,Md as getShrinkBox,Ld as getShrinkHeight,Kd as getShrinkWidth,bd as getStartupReport,Xa as getStoredStyle,d as getTotalEffectivePadding,_ as getTotalPadding,fc as getZIndex,tb as hasAnyEffectApplied,a as hasAutoPadding,Bc as hasClickableAt,C as hasClipping,oa as hasDirtyEntities,sb as hasDisabledEffectApplied,e as hasEntityAutoPadding,bb as hasFocusEffectApplied,eb as hasHoverEffectApplied,Cc as hasHoverableAt,rb as hasPressEffectApplied,Ya as hasStoredStyle,Db as hasValidPositionCache,Vd as hasValidStyleCache,hc as hasZOrder,yc as hitTest,zc as hitTestAll,Ac as hitTestDetailed,$c as initSubsystem,ad as initSubsystemsUpTo,L as intersectClipRects,Td as invalidateAllStyleCaches,tc as invalidateClickableCache,Eb as invalidatePositionCache,Fb as invalidatePositionCacheTree,Sd as invalidateStyleCache,w as isBorderChar,hd as isBuiltinPhase,uc as isCacheDirty,ha as isCellDirty,I as isClipRectEmpty,Zd as isDefaultColor,ma as isEntityDirty,x as isJunctionChar,pd as isKeywordPosition,Qa as isMarkedForDestruction,od as isPercentagePosition,Kb as isPointInCachedBounds,ca as isPointInEntity,da as isPointInInnerBounds,J as isPointVisible,K as isRectVisible,Zc as lazy,Vc as listBindings,ua as markAllEntitiesDirty,ga as markCellDirty,ja as markEntityDirty,ia as markRegionDirty,Sc as matchEvent,Qc as matchesKey,Yd as mergeStyles,nc as moveDown,mc as moveUp,pa as needsFullRedraw,qc as normalizeZIndices,Ha as onAdopt,Ia as onAttach,La as onDestroy,Ja as onDetach,Ka as onRemove,Ga as onReparent,Jc as parseKeyString,ld as parsePosition,md as parsePositionWithNegative,sd as percentOffsetPosition,rd as percentPosition,U as popClipRect,de as precomputeStyles,T as pushClipRect,Qb as queryBorder,Pb as queryContent,Mb as queryFocusable,Sb as queryHierarchy,Nb as queryInteractive,Rb as queryPadding,Lb as queryRenderable,Ob as queryScrollable,va as regionIntersectsDirty,Lc as registerBinding,Mc as registerBindings,Ma as registerCleanupCallback,o as registerEdge,p as registerRectBorder,zd as registerSerializable,_c as registerSubsystem,gb as removeAllEffects,qb as removeDisabledEffect,la as removeEntityFromTracking,ab as removeFocusEffect,db as removeHoverEffect,ya as removeLifecycleEventBus,ob as removePressEffect,Va as resetDisposalState,dd as resetSubsystems,rc as resetZOrder,fa as resizeDirtyTracker,l as resizeDockingContext,Wa as resolveEffectConfig,td as resolvePosition,ud as resolvePositionClamped,$d as resolveStyle,Ed as serializeWorld,Fd as serializeWorldToJSON,$ as setAbsolutePosition,lc as setBack,kb as setEffects,kc as setFront,jc as setLocalZ,D as setOverflow,Bb as setPositionCache,aa as setRelativePosition,ic as setZIndex,R as shouldClipContent,ac as sortByDepth,$b as sortByTabIndex,oc as sortByZIndex,hb as syncEffects,Nc as unregisterBinding,Ad as unregisterSerializable,Jb as updateCachedScrollBase,vc as updateClickableCache,ka as updateEntityBounds}from'../chunk-WHF27JF3.js';export{I as ActionBindingSchema,L as ActionPresets,a as BoxConfigSchema,c as ButtonConfigSchema,g as CheckboxConfigSchema,l as FormConfigSchema,e as InputConfigSchema,f as ListConfigSchema,E as LoopState,m as ProgressBarConfigSchema,o as RadioButtonConfigSchema,n as RadioSetConfigSchema,d as ScreenConfigSchema,j as SelectConfigSchema,J as SerializedBindingsSchema,k as SliderConfigSchema,b as TextConfigSchema,i as TextareaConfigSchema,h as TextboxConfigSchema,aa as beginFrame,V as clearBuffer,p as createBoxEntity,r as createButtonEntity,v as createCheckboxEntity,A as createFormEntity,F as createGameLoop,K as createInputActionManager,t as createInputEntity,M as createInputEventBuffer,ja as createInputState,u as createListEntity,B as createProgressBarEntity,D as createRadioButtonEntity,C as createRadioSetEntity,s as createScreenEntity,y as createSelectEntity,z as createSliderEntity,q as createTextEntity,x as createTextareaEntity,w as createTextboxEntity,R as drainAllEvents,P as drainKeys,Q as drainMouse,ba as endFrame,ea as getLatencyStats,na as getMovementDirection,Y as getPendingCount,W as getPendingKeyCount,X as getPendingMouseCount,_ as getStats,ia as globalInputBuffer,Z as hasPendingEvents,la as isAllKeysDown,ka as isAnyKeyDown,ma as isAnyKeyPressed,ga as isLatencyAcceptable,H as isLoopPaused,G as isLoopRunning,ha as isProcessingTimeAcceptable,S as peekEvents,T as peekKeys,U as peekMouse,N as pushKeyEvent,O as pushMouseEvent,ca as recordLatency,da as recordLatencyBatch,fa as resetLatencyStats,$ as resetStats}from'../chunk-4X4N4HNQ.js';export{k as acquireEntity,b as allocateEntity,h as assertEntityAlive,q as clearAllArchetypePools,o as clearArchetypePool,a as createEntityPool,d as deallocateEntity,m as getArchetypePoolStats,f as getEntityCount,g as getEntityPoolCapacity,n as getRecyclingStats,c as isEntityAlive,j as preallocateEntities,i as registerArchetype,l as releaseEntity,e as resetEntityPool,p as unregisterArchetype}from'../chunk-OB66FB4F.js';export{m as addIgnoredKeys,v as applyKeyLockOptions,k as areAllKeysLocked,o as clearIgnoredKeys,w as createKeyLockScope,a as createKeyLockState,h as getGrabbedKeys,p as getIgnoredKeys,s as getKeyLockFilter,b as getKeyLockState,d as grabKeys,g as isKeyGrabbed,q as isKeyIgnored,u as isKeyLocked,i as lockAllKeys,f as releaseAllGrabbedKeys,e as releaseKeys,n as removeIgnoredKeys,c as resetKeyLockState,l as setIgnoredKeys,r as setKeyLockFilter,t as shouldBlockKeyEvent,j as unlockAllKeys}from'../chunk-XQIGERNI.js';export{d as DEFAULT_WORLD_ADAPTER,c as PackedQueryAdapterConfigSchema,b as PackedQueryRegistrationSchema,h as clearWorldAdapter,a as createEventBus,i as createPackedQueryAdapter,e as createWorldAdapter,g as getWorldAdapter,j as isPackedQueryAdapter,f as setWorldAdapter}from'../chunk-WY3KY2TR.js';import'../chunk-XZA63ZPO.js';export{a as LoopPhase,c as createScheduler,b as getDeltaTime}from'../chunk-H2YAOJDW.js';import'../chunk-P6CJO3BC.js';import'../chunk-KFAK4A3G.js';import'../chunk-BCADUCOZ.js';import'../chunk-EAY7B5GL.js';export{b as addToStore,g as clearStore,a as createPackedStore,h as forEachInStore,d as getFromStore,l as getStoreCapacity,j as getStoreData,k as getStoreSize,c as isValidHandle,i as mapStore,f as removeFromStore,e as setInStore}from'../chunk-K3SX2LY5.js';export{i as clearAllEntityData,h as clearEntityData,d as deleteEntityData,f as getAllEntityData,a as getEntityData,j as getEntityDataCount,e as getEntityDataKeys,k as hasAnyEntityData,c as hasEntityData,b as setEntityData,g as setEntityDataBulk,l as updateEntityData}from'../chunk-OMMJ7B5P.js';import'../chunk-KD55INV7.js';import'../chunk-PSXXMBVJ.js';import'../chunk-LCN2ZITE.js';import'../chunk-FYEBZAWN.js';import'../chunk-W5OU7Z6J.js';import'../chunk-Z4EZERNE.js';import'../chunk-WNG4A3K7.js';import'../chunk-SHUC6JWA.js';import'../chunk-G7GIWWLE.js';export{h as addComponent,d as addEntity,a as createWorld,f as entityExists,g as getAllEntities,i as hasComponent,k as query,l as registerComponent,j as removeComponent,e as removeEntity,b as resetWorld,m as withStore}from'../chunk-PXXGH3BV.js';import'../chunk-5PELJRUQ.js';
|
|
1
|
+
export{od as BUILTIN_PHASE_NAMES,H as Clipping,dd as DEFAULT_NAV_BINDINGS,cd as DEFAULT_TEXT_BINDINGS,jc as DEFAULT_Z_INDEX,Ae as DeprecatedAPIMetadataSchema,Gb as EmitDescendantsOptionsSchema,Fb as EmitDescendantsResultSchema,fe as INHERITING_PROPERTIES,ed as InitPriority,o as JUNCTION_ASCII,n as JUNCTION_BOLD,m as JUNCTION_DOUBLE,l as JUNCTION_SINGLE,Pc as KeyBindingSchema,Qc as KeyBindingsArraySchema,kc as MAX_Z_INDEX,lc as MIN_Z_INDEX,ge as NON_INHERITING_PROPERTIES,G as Overflow,Be as PerformanceIssueMetadataSchema,sd as PluginComponentSchema,ud as PluginSchema,td as PluginSystemSchema,Ib as PositionCache,Cd as PositionValueSchema,$d as SERIALIZATION_VERSION,ye as TerminalTooSmallMetadataSchema,ze as UnsupportedCapabilityMetadataSchema,Ce as WarningEventSchema,xe as WarningType,mc as ZOrder,lb as applyCustomEffect,vb as applyDisabledEffect,fb as applyFocusEffect,ib as applyHoverEffect,A as applyJunctions,tb as applyPressEffect,de as applyShrink,Eb as bubbleEvent,ee as calculateShrinkSize,Id as centerPosition,Fd as clampPosition,S as clampToClipRect,Cb as clearAllEffectConfigs,Ob as clearAllPositionCaches,eb as clearAllStoredStyles,nd as clearCapabilityCache,Ta as clearCleanupCallbacks,_a as clearDestroyQueue,q as clearDockingContext,Bb as clearEffectState,sb as clearEffects,Fa as clearLifecycleEventBuses,Bd as clearPlugins,Vd as clearSerializableRegistry,db as clearStoredStyle,ke as clearStyleCache,_d as cloneSnapshot,qe as computeInheritedStyle,p as createBorderDockingContext,Db as createBubbleableEvent,Ac as createClickableCache,M as createClipRect,Y as createClipStack,Od as createFadeTransition,N as createInfiniteClipRect,Sc as createKeyBindingRegistry,qd as createPhaseManager,vd as createPluginRegistry,Nd as createSceneManager,Qd as createSceneSystem,Pd as createSlideTransition,De as createWarningEmitter,rd as defaultPhaseManager,Yd as deserializeWorld,Zd as deserializeWorldFromJSON,Va as destroyAllChildren,Ua as destroyEntity,Ya as destroyWorld,z as detectAllJunctions,s as detectBorderStyle,md as detectCapabilities,y as detectJunctions,se as doesPropertyInherit,Ha as emitAdopt,Ia as emitAttach,Ge as emitDeprecatedAPIWarning,Hb as emitDescendants,La as emitDestroy,Ja as emitDetach,He as emitPerformanceWarning,Ka as emitRemove,Ga as emitReparent,Ee as emitTerminalTooSmallWarning,Fe as emitUnsupportedCapabilityWarning,Zc as evaluateCondition,gc as filterClickable,ac as filterDirty,fc as filterFocusable,$b as filterVisible,bc as filterVisibleDirty,ue as findPropertySource,Xa as flushDestroyQueue,za as forceFullRedrawFlag,$c as formatKey,ad as formatKeyEvent,kd as formatStartupReport,f as getAbsoluteEdges,aa as getAbsolutePosition,Nc as getAllClickablesAt,Oc as getAllHoverablesAt,h as getAutoPadding,Wc as getBindingForAction,Xc as getBindingsForKey,he as getCacheGeneration,Qb as getCachedInnerHeight,Pb as getCachedInnerWidth,cc as getChildEntities,xc as getChildrenByZIndex,Lc as getClickableAt,Fc as getClickableCount,Ec as getClickableEntities,V as getClipRect,U as getClipRectHeight,W as getClipRectToAncestor,T as getClipRectWidth,L as getClipping,ob as getComputedEffectStyle,ha as getComputedPosition,we as getComputedStyles,w as getConnectionFlags,$ as getCurrentClip,ne as getDefaultStyle,dc as getDescendantEntities,Za as getDestroyQueueSize,wa as getDirtyEntities,Ca as getDirtyRegionsInViewport,xa as getDirtyStats,E as getEdgeCount,F as getEdgesAt,Ab as getEffectState,i as getEffectivePadding,rb as getEffects,Mc as getHoverableAt,te as getInheritedProperty,da as getInnerDimensions,ca as getInnerPosition,x as getJunctionChar,t as getJunctionCharset,B as getJunctionRenderData,Da as getLifecycleEventBus,me as getLocalStyle,oc as getLocalZ,pb as getOriginalStyle,K as getOverflow,Ad as getPluginCount,yd as getPlugins,Kb as getPositionCache,Ud as getRegisteredComponents,ba as getRelativePosition,ec as getRootEntities,Td as getSerializable,ce as getShrinkBox,be as getShrinkHeight,ae as getShrinkWidth,jd as getStartupReport,bb as getStoredStyle,j as getTotalEffectivePadding,ea as getTotalPadding,nc as getZIndex,zb as hasAnyEffectApplied,g as hasAutoPadding,Jc as hasClickableAt,I as hasClipping,ua as hasDirtyEntities,yb as hasDisabledEffectApplied,k as hasEntityAutoPadding,hb as hasFocusEffectApplied,kb as hasHoverEffectApplied,Kc as hasHoverableAt,zd as hasPlugin,xb as hasPressEffectApplied,cb as hasStoredStyle,Lb as hasValidPositionCache,le as hasValidStyleCache,pc as hasZOrder,Gc as hitTest,Hc as hitTestAll,Ic as hitTestDetailed,hd as initSubsystem,id as initSubsystemsUpTo,R as intersectClipRects,je as invalidateAllStyleCaches,Bc as invalidateClickableCache,Mb as invalidatePositionCache,Nb as invalidatePositionCacheTree,ie as invalidateStyleCache,C as isBorderChar,pd as isBuiltinPhase,Cc as isCacheDirty,O as isClipRectEmpty,pe as isDefaultColor,sa as isEntityDirty,D as isJunctionChar,Hd as isKeywordPosition,Wa as isMarkedForDestruction,Gd as isPercentagePosition,Sb as isPointInCachedBounds,ia as isPointInEntity,ja as isPointInInnerBounds,P as isPointVisible,Q as isRectVisible,fd as lazy,ya as legacyClearDirtyTracking,ka as legacyCreateDirtyTracker,ta as legacyGetDirtyRegions,na as legacyIsCellDirty,ma as legacyMarkCellDirty,pa as legacyMarkEntityDirty,oa as legacyMarkRegionDirty,ra as legacyRemoveEntityFromTracking,bd as listBindings,Aa as markAllEntitiesDirty,_c as matchEvent,Yc as matchesKey,oe as mergeStyles,vc as moveDown,uc as moveUp,va as needsFullRedraw,yc as normalizeZIndices,Na as onAdopt,Oa as onAttach,Ra as onDestroy,Pa as onDetach,Qa as onRemove,Ma as onReparent,Rc as parseKeyString,Dd as parsePosition,Ed as parsePositionWithNegative,Kd as percentOffsetPosition,Jd as percentPosition,_ as popClipRect,ve as precomputeStyles,Z as pushClipRect,Yb as queryBorder,Xb as queryContent,Ub as queryFocusable,_b as queryHierarchy,Vb as queryInteractive,Zb as queryPadding,Tb as queryRenderable,Wb as queryScrollable,Ba as regionIntersectsDirty,Tc as registerBinding,Uc as registerBindings,Sa as registerCleanupCallback,u as registerEdge,wd as registerPlugin,v as registerRectBorder,Rd as registerSerializable,gd as registerSubsystem,mb as removeAllEffects,wb as removeDisabledEffect,gb as removeFocusEffect,jb as removeHoverEffect,Ea as removeLifecycleEventBus,ub as removePressEffect,$a as resetDisposalState,ld as resetSubsystems,zc as resetZOrder,la as resizeDirtyTracker,r as resizeDockingContext,ab as resolveEffectConfig,Ld as resolvePosition,Md as resolvePositionClamped,re as resolveStyle,Wd as serializeWorld,Xd as serializeWorldToJSON,d as setAbsoluteBottom,e as setAbsoluteEdges,a as setAbsoluteLeft,fa as setAbsolutePosition,b as setAbsoluteRight,c as setAbsoluteTop,tc as setBack,qb as setEffects,sc as setFront,rc as setLocalZ,J as setOverflow,Jb as setPositionCache,ga as setRelativePosition,qc as setZIndex,X as shouldClipContent,ic as sortByDepth,hc as sortByTabIndex,wc as sortByZIndex,nb as syncEffects,Vc as unregisterBinding,xd as unregisterPlugin,Sd as unregisterSerializable,Rb as updateCachedScrollBase,Dc as updateClickableCache,qa as updateEntityBounds}from'../chunk-YY6RZCZH.js';export{k as acquireEntity,b as allocateEntity,h as assertEntityAlive,q as clearAllArchetypePools,o as clearArchetypePool,a as createEntityPool,d as deallocateEntity,m as getArchetypePoolStats,f as getEntityCount,g as getEntityPoolCapacity,n as getRecyclingStats,c as isEntityAlive,j as preallocateEntities,i as registerArchetype,l as releaseEntity,e as resetEntityPool,p as unregisterArchetype}from'../chunk-EF4DC6IN.js';export{m as addIgnoredKeys,v as applyKeyLockOptions,k as areAllKeysLocked,o as clearIgnoredKeys,w as createKeyLockScope,a as createKeyLockState,h as getGrabbedKeys,p as getIgnoredKeys,s as getKeyLockFilter,b as getKeyLockState,d as grabKeys,g as isKeyGrabbed,q as isKeyIgnored,u as isKeyLocked,i as lockAllKeys,f as releaseAllGrabbedKeys,e as releaseKeys,n as removeIgnoredKeys,c as resetKeyLockState,l as setIgnoredKeys,r as setKeyLockFilter,t as shouldBlockKeyEvent,j as unlockAllKeys}from'../chunk-XQIGERNI.js';export{i as clearDirtyTracking,a as createDirtyTracker,m as createEntityEventBusStore,l as createEventBus,j as forceFullRedraw,g as getDirtyRegions,k as getDirtyTrackingStats,h as hasDirtyRegions,e as isCellDirty,d as markCellDirty,b as markEntityDirty,f as markRegionDirty,c as removeEntityFromTracking}from'../chunk-OFRWGW2G.js';import'../chunk-FNQRUMFD.js';export{i as clearAllEntityData,h as clearEntityData,d as deleteEntityData,f as getAllEntityData,a as getEntityData,j as getEntityDataCount,e as getEntityDataKeys,k as hasAnyEntityData,c as hasEntityData,b as setEntityData,g as setEntityDataBulk,l as updateEntityData}from'../chunk-OMMJ7B5P.js';export{a as createEntityValidationError,e as isEntityValid,b as isEntityValidationError,c as registerComponentName,d as validateEntity}from'../chunk-S6WS46FE.js';export{b as addToStore,g as clearStore,a as createPackedStore,h as forEachInStore,d as getFromStore,l as getStoreCapacity,j as getStoreData,k as getStoreSize,c as isValidHandle,i as mapStore,f as removeFromStore,e as setInStore}from'../chunk-RJULLVTH.js';export{I as ActionBindingSchema,L as ActionPresets,a as BoxConfigSchema,c as ButtonConfigSchema,g as CheckboxConfigSchema,l as FormConfigSchema,e as InputConfigSchema,f as ListConfigSchema,E as LoopState,m as ProgressBarConfigSchema,o as RadioButtonConfigSchema,n as RadioSetConfigSchema,d as ScreenConfigSchema,j as SelectConfigSchema,J as SerializedBindingsSchema,k as SliderConfigSchema,b as TextConfigSchema,i as TextareaConfigSchema,h as TextboxConfigSchema,aa as beginFrame,V as clearBuffer,p as createBoxEntity,r as createButtonEntity,v as createCheckboxEntity,A as createFormEntity,F as createGameLoop,K as createInputActionManager,t as createInputEntity,M as createInputEventBuffer,ja as createInputState,u as createListEntity,B as createProgressBarEntity,D as createRadioButtonEntity,C as createRadioSetEntity,s as createScreenEntity,y as createSelectEntity,z as createSliderEntity,q as createTextEntity,x as createTextareaEntity,w as createTextboxEntity,R as drainAllEvents,P as drainKeys,Q as drainMouse,ba as endFrame,ea as getLatencyStats,na as getMovementDirection,Y as getPendingCount,W as getPendingKeyCount,X as getPendingMouseCount,_ as getStats,ia as globalInputBuffer,Z as hasPendingEvents,la as isAllKeysDown,ka as isAnyKeyDown,ma as isAnyKeyPressed,ga as isLatencyAcceptable,H as isLoopPaused,G as isLoopRunning,ha as isProcessingTimeAcceptable,S as peekEvents,T as peekKeys,U as peekMouse,N as pushKeyEvent,O as pushMouseEvent,ca as recordLatency,da as recordLatencyBatch,fa as resetLatencyStats,$ as resetStats}from'../chunk-OMU5BSAS.js';export{b as createScheduler,a as getDeltaTime}from'../chunk-NPNUUSIB.js';export{c as DEFAULT_WORLD_ADAPTER,b as PackedQueryAdapterConfigSchema,a as PackedQueryRegistrationSchema,h as clearWorldAdapter,j as createDefaultPackedQueryAdapter,i as createPackedQueryAdapter,d as createWorldAdapter,f as getWorldAdapter,k as isPackedQueryAdapter,e as setWorldAdapter,g as syncWorldAdapter}from'../chunk-DMBMCCLN.js';export{a as LoopPhase}from'../chunk-5N3O25O7.js';import'../chunk-R3ICZOE4.js';import'../chunk-DSKQ5J4R.js';import'../chunk-LI4Y7TBZ.js';import'../chunk-6XWY6GB7.js';import'../chunk-DQTVJITR.js';import'../chunk-ZPGJCHXH.js';import'../chunk-735KKTP3.js';import'../chunk-APKUNIMB.js';import'../chunk-NPDPBAW6.js';import'../chunk-GJ3RS2VG.js';import'../chunk-Z4EZERNE.js';export{h as addComponent,d as addEntity,a as createWorld,f as entityExists,g as getAllEntities,i as hasComponent,k as query,l as registerComponent,j as removeComponent,e as removeEntity,b as resetWorld,m as withStore}from'../chunk-P3ZLIQJP.js';import'../chunk-5PELJRUQ.js';
|
package/dist/debug/index.d.ts
CHANGED
|
@@ -1,7 +1,489 @@
|
|
|
1
|
-
import { W as World, E as Entity } from '../types-
|
|
2
|
-
import {
|
|
3
|
-
import '
|
|
4
|
-
import '
|
|
1
|
+
import { W as World, E as Entity } from '../types-CPB4CpbH.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { G as GameLoop } from '../gameLoop-CSTb7e0L.js';
|
|
4
|
+
import { ComponentRef } from 'bitecs';
|
|
5
|
+
import '../scheduler-DeeZleia.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* System timing and performance tracking utilities.
|
|
9
|
+
*
|
|
10
|
+
* @module debug/systemTiming
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Performance statistics.
|
|
15
|
+
*/
|
|
16
|
+
interface PerformanceStats {
|
|
17
|
+
/** Current frames per second */
|
|
18
|
+
readonly fps: number;
|
|
19
|
+
/** Current frame time in milliseconds */
|
|
20
|
+
readonly frameTime: number;
|
|
21
|
+
/** Total frames rendered */
|
|
22
|
+
readonly frameCount: number;
|
|
23
|
+
/** Total running time in seconds */
|
|
24
|
+
readonly runningTime: number;
|
|
25
|
+
/** Entity count */
|
|
26
|
+
readonly entityCount: number;
|
|
27
|
+
/** Memory usage in MB (if available) */
|
|
28
|
+
readonly memoryUsageMB: number | null;
|
|
29
|
+
/** System timing in milliseconds per system */
|
|
30
|
+
readonly systemTimings: Record<string, number>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Enables or disables system timing tracking.
|
|
34
|
+
*
|
|
35
|
+
* When enabled, system execution times are tracked and can be retrieved
|
|
36
|
+
* via getPerformanceStats().
|
|
37
|
+
*
|
|
38
|
+
* @param enabled - Whether to enable timing
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* import { enableSystemTiming, getPerformanceStats } from 'blecsd/debug';
|
|
43
|
+
*
|
|
44
|
+
* // Enable timing
|
|
45
|
+
* enableSystemTiming(true);
|
|
46
|
+
*
|
|
47
|
+
* // Run game loop...
|
|
48
|
+
*
|
|
49
|
+
* // Get stats
|
|
50
|
+
* const stats = getPerformanceStats(world, loop);
|
|
51
|
+
* console.log(stats.systemTimings);
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
declare function enableSystemTiming(enabled: boolean): void;
|
|
55
|
+
/**
|
|
56
|
+
* Checks if system timing is enabled.
|
|
57
|
+
*/
|
|
58
|
+
declare function isSystemTimingEnabled(): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Records system execution time.
|
|
61
|
+
* Called internally by timed system wrappers.
|
|
62
|
+
*
|
|
63
|
+
* @param systemName - Name of the system
|
|
64
|
+
* @param timeMs - Execution time in milliseconds
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
declare function recordSystemTime(systemName: string, timeMs: number): void;
|
|
68
|
+
/**
|
|
69
|
+
* Wraps a system function with timing instrumentation.
|
|
70
|
+
*
|
|
71
|
+
* @param name - Name for the system (used in timing reports)
|
|
72
|
+
* @param system - The system function to wrap
|
|
73
|
+
* @returns Wrapped system that records execution time
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* import { timedSystem } from 'blecsd/debug';
|
|
78
|
+
*
|
|
79
|
+
* const movementSystem = timedSystem('movement', (world) => {
|
|
80
|
+
* // movement logic
|
|
81
|
+
* return world;
|
|
82
|
+
* });
|
|
83
|
+
*
|
|
84
|
+
* // Register the timed system
|
|
85
|
+
* loop.registerSystem(LoopPhase.UPDATE, movementSystem);
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
declare function timedSystem<T extends (world: World) => World>(name: string, system: T): T;
|
|
89
|
+
/**
|
|
90
|
+
* Gets the current system timing data.
|
|
91
|
+
* Returns average time per call for each system.
|
|
92
|
+
*
|
|
93
|
+
* @returns Map of system name to average time in milliseconds
|
|
94
|
+
*/
|
|
95
|
+
declare function getSystemTimings(): Record<string, number>;
|
|
96
|
+
/**
|
|
97
|
+
* Resets all system timing data.
|
|
98
|
+
*/
|
|
99
|
+
declare function resetSystemTimings(): void;
|
|
100
|
+
/**
|
|
101
|
+
* Resets the performance stats cache.
|
|
102
|
+
* Useful for testing.
|
|
103
|
+
* @internal
|
|
104
|
+
*/
|
|
105
|
+
declare function resetPerformanceStatsCache(): void;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Debug console with F12 toggle and logging capabilities.
|
|
109
|
+
*
|
|
110
|
+
* Provides a unified interface for debug mode with:
|
|
111
|
+
* - F12 key toggle for debug overlay
|
|
112
|
+
* - Log messages with levels (info, warn, error, debug)
|
|
113
|
+
* - Entity inspection
|
|
114
|
+
* - Performance monitoring
|
|
115
|
+
*
|
|
116
|
+
* @module debug/console
|
|
117
|
+
*/
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Log level for debug messages.
|
|
121
|
+
*/
|
|
122
|
+
type ConsoleLogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
123
|
+
/**
|
|
124
|
+
* Debug console configuration.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```typescript
|
|
128
|
+
* const console = createDebugConsole(world, {
|
|
129
|
+
* enabled: true,
|
|
130
|
+
* toggleKey: 'F12',
|
|
131
|
+
* showOverlay: true,
|
|
132
|
+
* maxLogEntries: 100,
|
|
133
|
+
* });
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
interface DebugConsoleConfig {
|
|
137
|
+
/**
|
|
138
|
+
* Enable debug mode
|
|
139
|
+
* @default false
|
|
140
|
+
*/
|
|
141
|
+
readonly enabled?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Key to toggle debug console
|
|
144
|
+
* @default 'F12'
|
|
145
|
+
*/
|
|
146
|
+
readonly toggleKey?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Show performance overlay
|
|
149
|
+
* @default true
|
|
150
|
+
*/
|
|
151
|
+
readonly showOverlay?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Show log panel
|
|
154
|
+
* @default true
|
|
155
|
+
*/
|
|
156
|
+
readonly showLogs?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Maximum number of log entries to keep
|
|
159
|
+
* @default 100
|
|
160
|
+
*/
|
|
161
|
+
readonly maxLogEntries?: number;
|
|
162
|
+
/**
|
|
163
|
+
* Position for debug console
|
|
164
|
+
* @default { x: 0, y: 0 }
|
|
165
|
+
*/
|
|
166
|
+
readonly position?: {
|
|
167
|
+
x: number;
|
|
168
|
+
y: number;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Dimensions for debug console
|
|
172
|
+
* @default { width: 80, height: 20 }
|
|
173
|
+
*/
|
|
174
|
+
readonly dimensions?: {
|
|
175
|
+
width: number;
|
|
176
|
+
height: number;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Theme colors
|
|
180
|
+
*/
|
|
181
|
+
readonly theme?: {
|
|
182
|
+
readonly bg?: string | number;
|
|
183
|
+
readonly fg?: string | number;
|
|
184
|
+
readonly infoBg?: string | number;
|
|
185
|
+
readonly warnBg?: string | number;
|
|
186
|
+
readonly errorBg?: string | number;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Log entry in the debug console.
|
|
191
|
+
*/
|
|
192
|
+
interface LogEntry {
|
|
193
|
+
readonly timestamp: number;
|
|
194
|
+
readonly level: ConsoleLogLevel;
|
|
195
|
+
readonly message: string;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Resolved debug console configuration with all required fields.
|
|
199
|
+
* @internal
|
|
200
|
+
*/
|
|
201
|
+
interface ResolvedDebugConsoleConfig {
|
|
202
|
+
readonly enabled: boolean;
|
|
203
|
+
readonly toggleKey: string;
|
|
204
|
+
readonly showOverlay: boolean;
|
|
205
|
+
readonly showLogs: boolean;
|
|
206
|
+
readonly maxLogEntries: number;
|
|
207
|
+
readonly position: {
|
|
208
|
+
x: number;
|
|
209
|
+
y: number;
|
|
210
|
+
};
|
|
211
|
+
readonly dimensions: {
|
|
212
|
+
width: number;
|
|
213
|
+
height: number;
|
|
214
|
+
};
|
|
215
|
+
readonly theme: {
|
|
216
|
+
readonly bg: string | number;
|
|
217
|
+
readonly fg: string | number;
|
|
218
|
+
readonly infoBg: string | number;
|
|
219
|
+
readonly warnBg: string | number;
|
|
220
|
+
readonly errorBg: string | number;
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Debug console instance.
|
|
225
|
+
*/
|
|
226
|
+
interface DebugConsole {
|
|
227
|
+
/** Whether console is enabled */
|
|
228
|
+
readonly enabled: boolean;
|
|
229
|
+
/** Whether console is visible */
|
|
230
|
+
readonly visible: boolean;
|
|
231
|
+
/** Log entries */
|
|
232
|
+
readonly logs: readonly LogEntry[];
|
|
233
|
+
/** Configuration */
|
|
234
|
+
readonly config: ResolvedDebugConsoleConfig;
|
|
235
|
+
/** Show the console */
|
|
236
|
+
show(): void;
|
|
237
|
+
/** Hide the console */
|
|
238
|
+
hide(): void;
|
|
239
|
+
/** Toggle visibility */
|
|
240
|
+
toggle(): void;
|
|
241
|
+
/** Log a message */
|
|
242
|
+
log(message: string, level?: ConsoleLogLevel): void;
|
|
243
|
+
/** Update console display */
|
|
244
|
+
update(world: World, loop?: GameLoop): void;
|
|
245
|
+
/** Clear all logs */
|
|
246
|
+
clearLogs(): void;
|
|
247
|
+
/** Destroy the console */
|
|
248
|
+
destroy(): void;
|
|
249
|
+
}
|
|
250
|
+
declare const DebugConsoleConfigSchema: z.ZodObject<{
|
|
251
|
+
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
252
|
+
toggleKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
253
|
+
showOverlay: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
254
|
+
showLogs: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
255
|
+
maxLogEntries: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
256
|
+
position: z.ZodOptional<z.ZodObject<{
|
|
257
|
+
x: z.ZodNumber;
|
|
258
|
+
y: z.ZodNumber;
|
|
259
|
+
}, z.core.$strip>>;
|
|
260
|
+
dimensions: z.ZodOptional<z.ZodObject<{
|
|
261
|
+
width: z.ZodNumber;
|
|
262
|
+
height: z.ZodNumber;
|
|
263
|
+
}, z.core.$strip>>;
|
|
264
|
+
theme: z.ZodOptional<z.ZodObject<{
|
|
265
|
+
bg: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
266
|
+
fg: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
267
|
+
infoBg: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
268
|
+
warnBg: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
269
|
+
errorBg: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
270
|
+
}, z.core.$strip>>;
|
|
271
|
+
}, z.core.$strip>;
|
|
272
|
+
/**
|
|
273
|
+
* Creates a debug console with F12 toggle and logging capabilities.
|
|
274
|
+
*
|
|
275
|
+
* @param world - The ECS world
|
|
276
|
+
* @param config - Console configuration
|
|
277
|
+
* @returns Debug console instance
|
|
278
|
+
*
|
|
279
|
+
* @example
|
|
280
|
+
* ```typescript
|
|
281
|
+
* import { createDebugConsole } from 'blecsd/debug';
|
|
282
|
+
*
|
|
283
|
+
* const debugConsole = createDebugConsole(world, {
|
|
284
|
+
* enabled: true,
|
|
285
|
+
* toggleKey: 'F12',
|
|
286
|
+
* });
|
|
287
|
+
*
|
|
288
|
+
* // Log messages
|
|
289
|
+
* debugConsole.log('Hello from debug!', 'info');
|
|
290
|
+
* debugConsole.log('Warning message', 'warn');
|
|
291
|
+
* debugConsole.log('Error occurred', 'error');
|
|
292
|
+
*
|
|
293
|
+
* // In game loop
|
|
294
|
+
* game.onUpdate(() => {
|
|
295
|
+
* debugConsole.update(world, loop);
|
|
296
|
+
* });
|
|
297
|
+
*
|
|
298
|
+
* // Wire up F12 key
|
|
299
|
+
* game.onKey('F12', () => debugConsole.toggle());
|
|
300
|
+
* ```
|
|
301
|
+
*/
|
|
302
|
+
declare function createDebugConsole(world: World, config?: DebugConsoleConfig): DebugConsole;
|
|
303
|
+
/**
|
|
304
|
+
* Logs a debug message to the debug console.
|
|
305
|
+
*
|
|
306
|
+
* @param world - The ECS world
|
|
307
|
+
* @param message - Message to log
|
|
308
|
+
* @param level - Log level
|
|
309
|
+
*
|
|
310
|
+
* @example
|
|
311
|
+
* ```typescript
|
|
312
|
+
* import { debugLog } from 'blecsd/debug';
|
|
313
|
+
*
|
|
314
|
+
* debugLog(world, 'System initialized', 'info');
|
|
315
|
+
* debugLog(world, 'Performance warning', 'warn');
|
|
316
|
+
* debugLog(world, 'Critical error', 'error');
|
|
317
|
+
* ```
|
|
318
|
+
*/
|
|
319
|
+
declare function debugLog(_world: World, message: string, level?: ConsoleLogLevel): void;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* ECS state inspection utilities for debugging.
|
|
323
|
+
*
|
|
324
|
+
* @module debug/ecsInspector
|
|
325
|
+
*/
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Returns a formatted string representation of an entity for console logging.
|
|
329
|
+
*
|
|
330
|
+
* Formats entity data with component values in a tree structure for easy reading.
|
|
331
|
+
*
|
|
332
|
+
* @param world - The ECS world
|
|
333
|
+
* @param eid - The entity to dump
|
|
334
|
+
* @returns Formatted string suitable for console.log
|
|
335
|
+
*
|
|
336
|
+
* @example
|
|
337
|
+
* ```typescript
|
|
338
|
+
* import { dumpEntity } from 'blecsd';
|
|
339
|
+
*
|
|
340
|
+
* const entity = addEntity(world);
|
|
341
|
+
* setPosition(world, entity, 10, 20);
|
|
342
|
+
* setDimensions(world, entity, 40, 10);
|
|
343
|
+
*
|
|
344
|
+
* console.log(dumpEntity(world, entity));
|
|
345
|
+
* // Entity 1
|
|
346
|
+
* // ├─ Position: x=10, y=20, z=0, absolute=0
|
|
347
|
+
* // └─ Dimensions: width=40, height=10, minWidth=0, minHeight=0
|
|
348
|
+
* ```
|
|
349
|
+
*/
|
|
350
|
+
declare function dumpEntity(world: World, eid: Entity): string;
|
|
351
|
+
/**
|
|
352
|
+
* Returns a formatted string representation of world statistics.
|
|
353
|
+
*
|
|
354
|
+
* @param world - The ECS world
|
|
355
|
+
* @returns Formatted string suitable for console.log
|
|
356
|
+
*
|
|
357
|
+
* @example
|
|
358
|
+
* ```typescript
|
|
359
|
+
* import { dumpWorld } from 'blecsd';
|
|
360
|
+
*
|
|
361
|
+
* console.log(dumpWorld(world));
|
|
362
|
+
* // World Statistics
|
|
363
|
+
* // ────────────────
|
|
364
|
+
* // Entities: 42
|
|
365
|
+
* // ComponentRefs:
|
|
366
|
+
* // Position: 38 (90%)
|
|
367
|
+
* // Dimensions: 35 (83%)
|
|
368
|
+
* ```
|
|
369
|
+
*/
|
|
370
|
+
declare function dumpWorld(world: World): string;
|
|
371
|
+
/**
|
|
372
|
+
* Returns an array of all active entity IDs in the world.
|
|
373
|
+
*
|
|
374
|
+
* @param world - The ECS world
|
|
375
|
+
* @returns Array of entity IDs
|
|
376
|
+
*
|
|
377
|
+
* @example
|
|
378
|
+
* ```typescript
|
|
379
|
+
* import { listEntities } from 'blecsd';
|
|
380
|
+
*
|
|
381
|
+
* const entities = listEntities(world);
|
|
382
|
+
* console.log(`Total entities: ${entities.length}`);
|
|
383
|
+
* for (const eid of entities) {
|
|
384
|
+
* console.log(`Entity ${eid}`);
|
|
385
|
+
* }
|
|
386
|
+
* ```
|
|
387
|
+
*/
|
|
388
|
+
declare function listEntities(world: World): readonly Entity[];
|
|
389
|
+
/**
|
|
390
|
+
* Finds all entities that have a specific component attached.
|
|
391
|
+
*
|
|
392
|
+
* @param world - The ECS world
|
|
393
|
+
* @param component - The component to search for
|
|
394
|
+
* @returns Array of entity IDs that have the component
|
|
395
|
+
*
|
|
396
|
+
* @example
|
|
397
|
+
* ```typescript
|
|
398
|
+
* import { findEntitiesWithComponent, Position } from 'blecsd';
|
|
399
|
+
*
|
|
400
|
+
* const positioned = findEntitiesWithComponent(world, Position);
|
|
401
|
+
* console.log(`Found ${positioned.length} entities with Position`);
|
|
402
|
+
* for (const eid of positioned) {
|
|
403
|
+
* console.log(`Entity ${eid} at (${Position.x[eid]}, ${Position.y[eid]})`);
|
|
404
|
+
* }
|
|
405
|
+
* ```
|
|
406
|
+
*/
|
|
407
|
+
declare function findEntitiesWithComponent(world: World, component: ComponentRef): readonly Entity[];
|
|
408
|
+
/**
|
|
409
|
+
* Finds all entities that have all of the specified components attached.
|
|
410
|
+
*
|
|
411
|
+
* @param world - The ECS world
|
|
412
|
+
* @param components - Array of components to search for
|
|
413
|
+
* @returns Array of entity IDs that have all components
|
|
414
|
+
*
|
|
415
|
+
* @example
|
|
416
|
+
* ```typescript
|
|
417
|
+
* import { findEntitiesWithComponents, Position, Dimensions } from 'blecsd';
|
|
418
|
+
*
|
|
419
|
+
* const boxes = findEntitiesWithComponents(world, [Position, Dimensions]);
|
|
420
|
+
* console.log(`Found ${boxes.length} boxes`);
|
|
421
|
+
* ```
|
|
422
|
+
*/
|
|
423
|
+
declare function findEntitiesWithComponents(world: World, components: readonly ComponentRef[]): readonly Entity[];
|
|
424
|
+
/**
|
|
425
|
+
* Checks if an entity is in the active entities list.
|
|
426
|
+
*
|
|
427
|
+
* Note: This uses `getAllEntities` which may be slower than `entityExists` from core/ecs.
|
|
428
|
+
* Use this when you specifically need to verify the entity is in the active list.
|
|
429
|
+
*
|
|
430
|
+
* @param world - The ECS world
|
|
431
|
+
* @param eid - The entity to check
|
|
432
|
+
* @returns True if the entity is in the active entities list
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
* ```typescript
|
|
436
|
+
* import { isEntityActive, addEntity, removeEntity } from 'blecsd';
|
|
437
|
+
*
|
|
438
|
+
* const entity = addEntity(world);
|
|
439
|
+
* console.log(isEntityActive(world, entity)); // true
|
|
440
|
+
*
|
|
441
|
+
* removeEntity(world, entity);
|
|
442
|
+
* console.log(isEntityActive(world, entity)); // false
|
|
443
|
+
* ```
|
|
444
|
+
*/
|
|
445
|
+
declare function isEntityActive(world: World, eid: Entity): boolean;
|
|
446
|
+
/**
|
|
447
|
+
* Lists all components attached to an entity by name.
|
|
448
|
+
*
|
|
449
|
+
* @param world - The ECS world
|
|
450
|
+
* @param eid - The entity to inspect
|
|
451
|
+
* @returns Array of component names
|
|
452
|
+
*
|
|
453
|
+
* @example
|
|
454
|
+
* ```typescript
|
|
455
|
+
* import { listEntityComponents } from 'blecsd';
|
|
456
|
+
*
|
|
457
|
+
* const entity = addEntity(world);
|
|
458
|
+
* setPosition(world, entity, 10, 20);
|
|
459
|
+
* setDimensions(world, entity, 40, 10);
|
|
460
|
+
*
|
|
461
|
+
* const components = listEntityComponents(world, entity);
|
|
462
|
+
* console.log(components); // ['Position', 'Dimensions']
|
|
463
|
+
* ```
|
|
464
|
+
*/
|
|
465
|
+
declare function listEntityComponents(world: World, eid: Entity): readonly string[];
|
|
466
|
+
/**
|
|
467
|
+
* Gets the value of a specific component field for an entity.
|
|
468
|
+
*
|
|
469
|
+
* @param world - The ECS world
|
|
470
|
+
* @param eid - The entity
|
|
471
|
+
* @param component - The component
|
|
472
|
+
* @param field - The field name
|
|
473
|
+
* @returns The field value, or undefined if not found
|
|
474
|
+
*
|
|
475
|
+
* @example
|
|
476
|
+
* ```typescript
|
|
477
|
+
* import { getComponentField, Position } from 'blecsd';
|
|
478
|
+
*
|
|
479
|
+
* const entity = addEntity(world);
|
|
480
|
+
* setPosition(world, entity, 10, 20);
|
|
481
|
+
*
|
|
482
|
+
* const x = getComponentField(world, entity, Position, 'x');
|
|
483
|
+
* console.log(`X position: ${x}`); // X position: 10
|
|
484
|
+
* ```
|
|
485
|
+
*/
|
|
486
|
+
declare function getComponentField(world: World, eid: Entity, component: ComponentRef, field: string): unknown;
|
|
5
487
|
|
|
6
488
|
/**
|
|
7
489
|
* Memory Profiling and Leak Detection
|
|
@@ -403,25 +885,6 @@ interface WorldInspection {
|
|
|
403
885
|
readonly componentCounts: Record<string, number>;
|
|
404
886
|
readonly hierarchyRoots: readonly Entity[];
|
|
405
887
|
}
|
|
406
|
-
/**
|
|
407
|
-
* Performance statistics.
|
|
408
|
-
*/
|
|
409
|
-
interface PerformanceStats {
|
|
410
|
-
/** Current frames per second */
|
|
411
|
-
readonly fps: number;
|
|
412
|
-
/** Current frame time in milliseconds */
|
|
413
|
-
readonly frameTime: number;
|
|
414
|
-
/** Total frames rendered */
|
|
415
|
-
readonly frameCount: number;
|
|
416
|
-
/** Total running time in seconds */
|
|
417
|
-
readonly runningTime: number;
|
|
418
|
-
/** Entity count */
|
|
419
|
-
readonly entityCount: number;
|
|
420
|
-
/** Memory usage in MB (if available) */
|
|
421
|
-
readonly memoryUsageMB: number | null;
|
|
422
|
-
/** System timing in milliseconds per system */
|
|
423
|
-
readonly systemTimings: Record<string, number>;
|
|
424
|
-
}
|
|
425
888
|
/**
|
|
426
889
|
* Known components for inspection.
|
|
427
890
|
*/
|
|
@@ -506,83 +969,13 @@ declare function inspectWorld(world: World): WorldInspection;
|
|
|
506
969
|
* ```
|
|
507
970
|
*/
|
|
508
971
|
declare function formatWorldInspection(inspection: WorldInspection): string;
|
|
509
|
-
|
|
510
|
-
* Enables or disables system timing tracking.
|
|
511
|
-
*
|
|
512
|
-
* When enabled, system execution times are tracked and can be retrieved
|
|
513
|
-
* via getPerformanceStats().
|
|
514
|
-
*
|
|
515
|
-
* @param enabled - Whether to enable timing
|
|
516
|
-
*
|
|
517
|
-
* @example
|
|
518
|
-
* ```typescript
|
|
519
|
-
* import { enableSystemTiming, getPerformanceStats } from 'blecsd/debug';
|
|
520
|
-
*
|
|
521
|
-
* // Enable timing
|
|
522
|
-
* enableSystemTiming(true);
|
|
523
|
-
*
|
|
524
|
-
* // Run game loop...
|
|
525
|
-
*
|
|
526
|
-
* // Get stats
|
|
527
|
-
* const stats = getPerformanceStats(world, loop);
|
|
528
|
-
* console.log(stats.systemTimings);
|
|
529
|
-
* ```
|
|
530
|
-
*/
|
|
531
|
-
declare function enableSystemTiming(enabled: boolean): void;
|
|
532
|
-
/**
|
|
533
|
-
* Checks if system timing is enabled.
|
|
534
|
-
*/
|
|
535
|
-
declare function isSystemTimingEnabled(): boolean;
|
|
536
|
-
/**
|
|
537
|
-
* Records system execution time.
|
|
538
|
-
* Called internally by timed system wrappers.
|
|
539
|
-
*
|
|
540
|
-
* @param systemName - Name of the system
|
|
541
|
-
* @param timeMs - Execution time in milliseconds
|
|
542
|
-
* @internal
|
|
543
|
-
*/
|
|
544
|
-
declare function recordSystemTime(systemName: string, timeMs: number): void;
|
|
545
|
-
/**
|
|
546
|
-
* Wraps a system function with timing instrumentation.
|
|
547
|
-
*
|
|
548
|
-
* @param name - Name for the system (used in timing reports)
|
|
549
|
-
* @param system - The system function to wrap
|
|
550
|
-
* @returns Wrapped system that records execution time
|
|
551
|
-
*
|
|
552
|
-
* @example
|
|
553
|
-
* ```typescript
|
|
554
|
-
* import { timedSystem } from 'blecsd/debug';
|
|
555
|
-
*
|
|
556
|
-
* const movementSystem = timedSystem('movement', (world) => {
|
|
557
|
-
* // movement logic
|
|
558
|
-
* return world;
|
|
559
|
-
* });
|
|
560
|
-
*
|
|
561
|
-
* // Register the timed system
|
|
562
|
-
* loop.registerSystem(LoopPhase.UPDATE, movementSystem);
|
|
563
|
-
* ```
|
|
564
|
-
*/
|
|
565
|
-
declare function timedSystem<T extends (world: World) => World>(name: string, system: T): T;
|
|
566
|
-
/**
|
|
567
|
-
* Gets the current system timing data.
|
|
568
|
-
* Returns average time per call for each system.
|
|
569
|
-
*
|
|
570
|
-
* @returns Map of system name to average time in milliseconds
|
|
571
|
-
*/
|
|
572
|
-
declare function getSystemTimings(): Record<string, number>;
|
|
573
|
-
/**
|
|
574
|
-
* Resets all system timing data.
|
|
575
|
-
*/
|
|
576
|
-
declare function resetSystemTimings(): void;
|
|
577
|
-
/**
|
|
578
|
-
* Resets the performance stats cache.
|
|
579
|
-
* Useful for testing.
|
|
580
|
-
* @internal
|
|
581
|
-
*/
|
|
582
|
-
declare function resetPerformanceStatsCache(): void;
|
|
972
|
+
|
|
583
973
|
/**
|
|
584
974
|
* Gets current performance statistics.
|
|
585
975
|
*
|
|
976
|
+
* Wrapper around systemTiming.getPerformanceStats that automatically
|
|
977
|
+
* gets the entity count from the world.
|
|
978
|
+
*
|
|
586
979
|
* @param world - The ECS world
|
|
587
980
|
* @param loop - Optional game loop for frame stats
|
|
588
981
|
* @returns Performance statistics
|
|
@@ -708,4 +1101,4 @@ declare function logEntity(world: World, eid: Entity): void;
|
|
|
708
1101
|
*/
|
|
709
1102
|
declare function logWorld(world: World): void;
|
|
710
1103
|
|
|
711
|
-
export { type AllocationTracker, type ComponentInfo, type DebugOverlay, type DebugOverlayConfig, type EntityInspection, type FrameRateGraph, KNOWN_COMPONENTS, type LeakWarning, type MemoryDiff, type MemoryProfiler, type MemoryProfilerConfig, type MemorySnapshot, type MiniProfiler, type PerformanceStats, type WorldInspection, createDebugOverlay, createFrameRateGraph, createInputLogger, createMemoryProfiler, createMiniProfiler, enableDebugBounds, enableSystemTiming, formatEntityInspection, formatWorldInspection, getDebugBoundsConfig, getDebugBoundsEntities, getEntitySummary, getPerformanceStats, getSystemTimings, inspectEntity, inspectWorld, isDebugBoundsEnabled, isSystemTimingEnabled, logEntity, logWorld, recordSystemTime, resetPerformanceStatsCache, resetSystemTimings, timedSystem };
|
|
1104
|
+
export { type AllocationTracker, type ComponentInfo, type ConsoleLogLevel, type DebugConsole, type DebugConsoleConfig, DebugConsoleConfigSchema, type DebugOverlay, type DebugOverlayConfig, type EntityInspection, type FrameRateGraph, KNOWN_COMPONENTS, type LeakWarning, type LogEntry, type MemoryDiff, type MemoryProfiler, type MemoryProfilerConfig, type MemorySnapshot, type MiniProfiler, type PerformanceStats, type WorldInspection, createDebugConsole, createDebugOverlay, createFrameRateGraph, createInputLogger, createMemoryProfiler, createMiniProfiler, debugLog, dumpEntity, dumpWorld, enableDebugBounds, enableSystemTiming, findEntitiesWithComponent, findEntitiesWithComponents, formatEntityInspection, formatWorldInspection, getComponentField, getDebugBoundsConfig, getDebugBoundsEntities, getEntitySummary, getPerformanceStats, getSystemTimings, inspectEntity, inspectWorld, isDebugBoundsEnabled, isEntityActive, isSystemTimingEnabled, listEntities, listEntityComponents, logEntity, logWorld, recordSystemTime, resetPerformanceStatsCache, resetSystemTimings, timedSystem };
|
package/dist/debug/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{l as DebugConsoleConfigSchema,x as KNOWN_COMPONENTS,m as createDebugConsole,h as createDebugOverlay,k as createFrameRateGraph,i as createInputLogger,w as createMemoryProfiler,j as createMiniProfiler,n as debugLog,o as dumpEntity,p as dumpWorld,D as enableDebugBounds,a as enableSystemTiming,r as findEntitiesWithComponent,s as findEntitiesWithComponents,z as formatEntityInspection,B as formatWorldInspection,v as getComponentField,F as getDebugBoundsConfig,G as getDebugBoundsEntities,H as getEntitySummary,C as getPerformanceStats,e as getSystemTimings,y as inspectEntity,A as inspectWorld,E as isDebugBoundsEnabled,t as isEntityActive,b as isSystemTimingEnabled,q as listEntities,u as listEntityComponents,I as logEntity,J as logWorld,c as recordSystemTime,g as resetPerformanceStatsCache,f as resetSystemTimings,d as timedSystem}from'../chunk-KYAPE44E.js';import'../chunk-OMMJ7B5P.js';import'../chunk-ZPL2J25N.js';import'../chunk-WY5EZOOL.js';import'../chunk-6XWY6GB7.js';import'../chunk-DQTVJITR.js';import'../chunk-ZPGJCHXH.js';import'../chunk-735KKTP3.js';import'../chunk-APKUNIMB.js';import'../chunk-NPDPBAW6.js';import'../chunk-GJ3RS2VG.js';import'../chunk-Z4EZERNE.js';import'../chunk-P3ZLIQJP.js';import'../chunk-5PELJRUQ.js';
|