blecsd 0.3.0 → 0.6.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/README.md +146 -147
- package/dist/{border-Jb7TrMob.d.ts → border-Br-Jc027.d.ts} +2 -2
- package/dist/{cell-DwIu2ryP.d.ts → cell-5Ty_3yMs.d.ts} +1 -1
- package/dist/cellRenderer-D0-DJXWl.d.ts +374 -0
- package/dist/chunk-4N7IFBRQ.js +4 -0
- package/dist/{chunk-DNRXW56C.js → chunk-4XCFTNGN.js} +1 -1
- package/dist/chunk-5YWRP2KG.js +3 -0
- package/dist/chunk-6PX5R326.js +1 -0
- package/dist/chunk-73Y45MLV.js +12 -0
- package/dist/chunk-7ZFQO3OQ.js +1 -0
- package/dist/chunk-A3GSH6MV.js +1 -0
- package/dist/chunk-A5B2BGUM.js +1 -0
- package/dist/chunk-AM6IDSXI.js +1 -0
- package/dist/chunk-EHYOVHRL.js +2 -0
- package/dist/chunk-EMZA6G2M.js +4 -0
- package/dist/chunk-EOFT3PNU.js +1 -0
- package/dist/chunk-ETFDYZVJ.js +1 -0
- package/dist/chunk-FUW7OD3H.js +1 -0
- package/dist/chunk-GRMSEMU7.js +1 -0
- package/dist/chunk-I7AUKTXE.js +1 -0
- package/dist/chunk-IANAVH2A.js +1 -0
- package/dist/chunk-JN2OGNK3.js +1 -0
- package/dist/chunk-JVMNMAHX.js +1 -0
- package/dist/chunk-K2QWNDXV.js +1 -0
- package/dist/chunk-KYNS3GBJ.js +2 -0
- package/dist/chunk-LI3ZYXUT.js +1 -0
- package/dist/chunk-LNEISTXM.js +1 -0
- package/dist/chunk-QABNK7IA.js +1 -0
- package/dist/chunk-QS5QXZNJ.js +1 -0
- package/dist/chunk-QTDRFJG2.js +1 -0
- package/dist/chunk-RJULLVTH.js +1 -0
- package/dist/chunk-SVHITP3F.js +2 -0
- package/dist/chunk-UKVY43V3.js +1 -0
- package/dist/chunk-VIT4KE6Q.js +1 -0
- package/dist/chunk-XG5PVDOP.js +1 -0
- package/dist/chunk-XH5GTWCV.js +1 -0
- package/dist/chunk-XYMPBCYW.js +1 -0
- package/dist/chunk-YRSSCEAS.js +1 -0
- package/dist/chunk-ZL46COQF.js +1 -0
- package/dist/cli/init.js +1 -1
- package/dist/{componentStorage-CJTh-TPO.d.ts → componentStorage-CXJvx4Lt.d.ts} +2 -2
- package/dist/components/index.d.ts +7209 -6691
- package/dist/components/index.js +5 -1
- package/dist/core/index.d.ts +2501 -1262
- package/dist/core/index.js +1 -1
- package/dist/debug/index.d.ts +310 -84
- package/dist/debug/index.js +8 -1
- package/dist/{dirtyTracking-C4v8MmM9.d.ts → dirtyTracking-kCS9-NVF.d.ts} +2 -2
- package/dist/{doubleBuffer-CKQFmlPN.d.ts → doubleBuffer-CWASihKh.d.ts} +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/{inputActions-CRsUtTHM.d.ts → factories-vW7bn_He.d.ts} +21 -786
- package/dist/{gameLoop-C-Ez_i54.d.ts → gameLoop-C1AyRWyP.d.ts} +3 -3
- package/dist/index.d.ts +25 -500
- package/dist/index.js +1 -3
- package/dist/input/index.d.ts +1 -1
- package/dist/input/index.js +1 -1
- package/dist/inputStream-COARA4CP.d.ts +1182 -0
- package/dist/interactiveSystem-h92W9W4n.d.ts +1977 -0
- package/dist/{keyParser-BnHbg2iD.d.ts → keyParser-DReXe2j-.d.ts} +41 -41
- package/dist/{events-9ForpTfM.d.ts → mouseParser-CCqSEUVN.d.ts} +177 -2
- package/dist/{packedStore-BgvnEdE7.d.ts → packedStore-480t2X74.d.ts} +1 -1
- package/dist/panelMovement-DGzIQ8Ll.d.ts +1908 -0
- package/dist/{parser-iMHmQuUh.d.ts → parser-Q1YLXYpF.d.ts} +1 -1
- package/dist/positioning-DiUivJXa.d.ts +917 -0
- package/dist/{renderable-CwqGwrEV.d.ts → renderable-IbSJao5y.d.ts} +2 -2
- package/dist/{scheduler-CMcYew9Z.d.ts → scheduler-NbHT3-D2.d.ts} +3 -1
- package/dist/schemas/index.d.ts +6 -6
- package/dist/schemas/index.js +1 -1
- package/dist/systems/index.d.ts +1057 -1807
- package/dist/systems/index.js +1 -1
- package/dist/terminal/index.d.ts +7207 -2709
- package/dist/terminal/index.js +1 -1
- package/dist/terminalBuffer-BbUz27qM.d.ts +691 -0
- package/dist/{terminus-14-bold-HWSPRLJD.js → terminus-14-bold-ZS4IH465.js} +1 -1
- package/dist/{terminus-14-normal-T3SWMH4D.js → terminus-14-normal-HD5N7F5W.js} +1 -1
- package/dist/text/index.d.ts +263 -0
- package/dist/text/index.js +3 -0
- package/dist/textWrap-Ct2J8gO6.d.ts +761 -0
- package/dist/{tilemap-BirMJdbu.d.ts → tilemap-ByvTsepD.d.ts} +5 -5
- package/dist/{types-CPB4CpbH.d.ts → types-B8LmNkzG.d.ts} +1 -1
- package/dist/utils/index.d.ts +827 -780
- package/dist/utils/index.js +32 -1
- package/dist/{virtualScrollback-D9uLFe8l.d.ts → virtualScrollback-CiooIebp.d.ts} +4 -4
- package/dist/virtualViewport-fIlbIGPt.d.ts +657 -0
- package/dist/{virtualizedLineStore-DwPEvPkk.d.ts → virtualizedLineStore-DfyhojPZ.d.ts} +1 -1
- package/dist/widgets/bigText.d.ts +13 -13
- package/dist/widgets/bigText.js +1 -1
- package/dist/widgets/fonts/index.d.ts +1 -1
- package/dist/widgets/fonts/index.js +1 -1
- package/dist/widgets/index.d.ts +2933 -1102
- package/dist/widgets/index.js +24 -1
- package/package.json +9 -22
- package/dist/3d/index.d.ts +0 -5
- package/dist/3d/index.js +0 -1
- package/dist/audio/index.d.ts +0 -177
- package/dist/audio/index.js +0 -1
- package/dist/chunk-2IEMMRUO.js +0 -1
- package/dist/chunk-35LCBY6P.js +0 -1
- package/dist/chunk-3AV52GY5.js +0 -1
- package/dist/chunk-3LHLSY3Y.js +0 -1
- package/dist/chunk-3O4TQHGK.js +0 -4
- package/dist/chunk-3UJWZ5ZN.js +0 -1
- package/dist/chunk-5PELJRUQ.js +0 -1
- package/dist/chunk-6M2J5QUA.js +0 -1
- package/dist/chunk-7IQEUVGF.js +0 -1
- package/dist/chunk-A6M6TFBL.js +0 -1
- package/dist/chunk-CIK4AMUA.js +0 -1
- package/dist/chunk-CUEUJAHK.js +0 -3
- package/dist/chunk-D42Q2KKR.js +0 -1
- package/dist/chunk-DYEXOFUU.js +0 -2
- package/dist/chunk-DYU72XLL.js +0 -1
- package/dist/chunk-E4CJRSND.js +0 -1
- package/dist/chunk-EAY7B5GL.js +0 -1
- package/dist/chunk-FCMTWFSE.js +0 -1
- package/dist/chunk-FGHEFXLK.js +0 -1
- package/dist/chunk-FL56THSI.js +0 -25
- package/dist/chunk-G437VE43.js +0 -1
- package/dist/chunk-G7GIWWLE.js +0 -1
- package/dist/chunk-GGXNWT36.js +0 -8
- package/dist/chunk-HLFORKXS.js +0 -1
- package/dist/chunk-J7MBKEBY.js +0 -1
- package/dist/chunk-K3SX2LY5.js +0 -1
- package/dist/chunk-LDAFEXN5.js +0 -1
- package/dist/chunk-LYSK5S63.js +0 -1
- package/dist/chunk-MKMFUXLB.js +0 -33
- package/dist/chunk-MQWPHPUM.js +0 -1
- package/dist/chunk-MTI376CU.js +0 -5
- package/dist/chunk-MTV2RJZD.js +0 -1
- package/dist/chunk-NZ55KBM6.js +0 -1
- package/dist/chunk-OB66FB4F.js +0 -1
- package/dist/chunk-OMMJ7B5P.js +0 -1
- package/dist/chunk-OR3BZY7C.js +0 -1
- package/dist/chunk-PXXGH3BV.js +0 -1
- package/dist/chunk-R7AICVRN.js +0 -2
- package/dist/chunk-RZ7FGVI6.js +0 -1
- package/dist/chunk-SHUC6JWA.js +0 -1
- package/dist/chunk-TWSWTBYL.js +0 -1
- package/dist/chunk-UMGTXSQB.js +0 -11
- package/dist/chunk-X3Q3T2SS.js +0 -4
- package/dist/chunk-XZJRWFOS.js +0 -1
- package/dist/chunk-ZAHG7Y3X.js +0 -1
- package/dist/game/index.d.ts +0 -486
- package/dist/game/index.js +0 -1
- package/dist/index-DBS5Uefn.d.ts +0 -3156
- package/dist/mouseParser-Cfrbn3AX.d.ts +0 -177
- package/dist/viewport3d-xI33-_wq.d.ts +0 -182
- package/dist/virtualViewport-Bpv6jlKt.d.ts +0 -1856
package/dist/core/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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,qe as DeprecatedAPIMetadataSchema,Gb as EmitDescendantsOptionsSchema,Fb as EmitDescendantsResultSchema,Xd 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,Yd as NON_INHERITING_PROPERTIES,G as Overflow,re as PerformanceIssueMetadataSchema,Ib as PositionCache,sd as PositionValueSchema,Rd as SERIALIZATION_VERSION,oe as TerminalTooSmallMetadataSchema,pe as UnsupportedCapabilityMetadataSchema,se as WarningEventSchema,ne as WarningType,mc as ZOrder,lb as applyCustomEffect,vb as applyDisabledEffect,fb as applyFocusEffect,ib as applyHoverEffect,A as applyJunctions,tb as applyPressEffect,Vd as applyShrink,Eb as bubbleEvent,Wd as calculateShrinkSize,yd as centerPosition,vd 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,Ld as clearSerializableRegistry,db as clearStoredStyle,ae as clearStyleCache,Qd as cloneSnapshot,ge as computeInheritedStyle,p as createBorderDockingContext,Db as createBubbleableEvent,Ac as createClickableCache,M as createClipRect,Y as createClipStack,Ed as createFadeTransition,N as createInfiniteClipRect,Sc as createKeyBindingRegistry,qd as createPhaseManager,Dd as createSceneManager,Gd as createSceneSystem,Fd as createSlideTransition,te as createWarningEmitter,rd as defaultPhaseManager,Od as deserializeWorld,Pd as deserializeWorldFromJSON,Va as destroyAllChildren,Ua as destroyEntity,Ya as destroyWorld,z as detectAllJunctions,s as detectBorderStyle,md as detectCapabilities,y as detectJunctions,ie as doesPropertyInherit,Ha as emitAdopt,Ia as emitAttach,we as emitDeprecatedAPIWarning,Hb as emitDescendants,La as emitDestroy,Ja as emitDetach,xe as emitPerformanceWarning,Ka as emitRemove,Ga as emitReparent,ue as emitTerminalTooSmallWarning,ve as emitUnsupportedCapabilityWarning,Zc as evaluateCondition,gc as filterClickable,ac as filterDirty,fc as filterFocusable,$b as filterVisible,bc as filterVisibleDirty,ke 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,Zd 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,me as getComputedStyles,w as getConnectionFlags,$ as getCurrentClip,de 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,je as getInheritedProperty,da as getInnerDimensions,ca as getInnerPosition,x as getJunctionChar,t as getJunctionCharset,B as getJunctionRenderData,Da as getLifecycleEventBus,ce as getLocalStyle,oc as getLocalZ,pb as getOriginalStyle,K as getOverflow,Kb as getPositionCache,Kd as getRegisteredComponents,ba as getRelativePosition,ec as getRootEntities,Jd as getSerializable,Ud as getShrinkBox,Td as getShrinkHeight,Sd 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,xb as hasPressEffectApplied,cb as hasStoredStyle,Lb as hasValidPositionCache,be as hasValidStyleCache,pc as hasZOrder,Gc as hitTest,Hc as hitTestAll,Ic as hitTestDetailed,hd as initSubsystem,id as initSubsystemsUpTo,R as intersectClipRects,$d as invalidateAllStyleCaches,Bc as invalidateClickableCache,Mb as invalidatePositionCache,Nb as invalidatePositionCacheTree,_d as invalidateStyleCache,C as isBorderChar,pd as isBuiltinPhase,Cc as isCacheDirty,O as isClipRectEmpty,fe as isDefaultColor,sa as isEntityDirty,D as isJunctionChar,xd as isKeywordPosition,Wa as isMarkedForDestruction,wd 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,ee 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,td as parsePosition,ud as parsePositionWithNegative,Ad as percentOffsetPosition,zd as percentPosition,_ as popClipRect,le 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,v as registerRectBorder,Hd 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,Bd as resolvePosition,Cd as resolvePositionClamped,he as resolveStyle,Md as serializeWorld,Nd 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,Id as unregisterSerializable,Rb as updateCachedScrollBase,Dc as updateClickableCache,qa as updateEntityBounds}from'../chunk-X3Q3T2SS.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-DYEXOFUU.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{p as DEFAULT_WORLD_ADAPTER,o as PackedQueryAdapterConfigSchema,n as PackedQueryRegistrationSchema,i as clearDirtyTracking,t as clearWorldAdapter,a as createDirtyTracker,m as createEntityEventBusStore,l as createEventBus,u as createPackedQueryAdapter,q as createWorldAdapter,j as forceFullRedraw,g as getDirtyRegions,k as getDirtyTrackingStats,s as getWorldAdapter,h as hasDirtyRegions,e as isCellDirty,v as isPackedQueryAdapter,d as markCellDirty,b as markEntityDirty,f as markRegionDirty,c as removeEntityFromTracking,r as setWorldAdapter}from'../chunk-MTV2RJZD.js';import'../chunk-3AV52GY5.js';export{b as createScheduler,a as getDeltaTime}from'../chunk-D42Q2KKR.js';export{a as LoopPhase}from'../chunk-5N3O25O7.js';export{a as EntityValidationError,d as isEntityValid,b as registerComponentName,c as validateEntity}from'../chunk-7IQEUVGF.js';import'../chunk-LDAFEXN5.js';import'../chunk-A6M6TFBL.js';import'../chunk-6M2J5QUA.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-3LHLSY3Y.js';import'../chunk-OR3BZY7C.js';import'../chunk-DYU72XLL.js';import'../chunk-FCMTWFSE.js';import'../chunk-ZAHG7Y3X.js';import'../chunk-Z4EZERNE.js';import'../chunk-NPDPBAW6.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{cd as ActionBindingSchema,fd as ActionPresets,je as BUILTIN_PHASE_NAMES,vb as Clipping,_d as DEFAULT_NAV_BINDINGS,Zd as DEFAULT_TEXT_BINDINGS,ka as DEFAULT_Z_INDEX,Ff as DeprecatedAPIMetadataSchema,Yc as EmitDescendantsOptionsSchema,Xc as EmitDescendantsResultSchema,kf as INHERITING_PROPERTIES,$d as InitPriority,cb as JUNCTION_ASCII,bb as JUNCTION_BOLD,ab as JUNCTION_DOUBLE,$a as JUNCTION_SINGLE,Kd as KeyBindingSchema,Ld as KeyBindingsArraySchema,_c as LoopState,la as MAX_Z_INDEX,ma as MIN_Z_INDEX,lf as NON_INHERITING_PROPERTIES,ub as Overflow,Gf as PerformanceIssueMetadataSchema,ne as PluginComponentSchema,re as PluginSchema,oe as PluginSystemSchema,qe as PluginThemeDeclarationSchema,pe as PluginWidgetDeclarationSchema,J as PositionCache,Ee as PositionValueSchema,dd as SerializedBindingsSchema,Df as TerminalTooSmallMetadataSchema,Ef as UnsupportedCapabilityMetadataSchema,Hf as WarningEventSchema,Cf as WarningType,na as ZOrder,Ae as activatePlugin,Dc as applyCustomEffect,Nc as applyDisabledEffect,xc as applyFocusEffect,Ac as applyHoverEffect,ob as applyJunctions,Lc as applyPressEffect,if as applyShrink,ef as applyWorldDelta,wd as beginFrame,Yb as bind,Wc as bubbleEvent,jf as calculateShrinkSize,Ke as centerPosition,He as clampPosition,Gb as clampToClipRect,Uc as clearAllEffectConfigs,P as clearAllPositionCaches,wc as clearAllStoredStyles,pd as clearBuffer,ie as clearCapabilityCache,q as clearCleanupCallbacks,x as clearDestroyQueue,eb as clearDockingContext,Tc as clearEffectState,Kc as clearEffects,c as clearLifecycleEventBuses,ye as clearPlugins,vc as clearStoredStyle,pf as clearStyleCache,vf as computeInheritedStyle,db as createBorderDockingContext,Vc as createBubbleableEvent,Ue as createCallbackSignal,Ba as createClickableCache,Ab as createClipRect,Mb as createClipStack,Se as createDerivedSignal,We as createEventSignal,Ye as createFadeTransition,$c as createGameLoop,Bb as createInfiniteClipRect,ed as createInputActionManager,gd as createInputEventBuffer,Fd as createInputState,Pe as createIntervalSignal,Nd as createKeyBindingRegistry,le as createPhaseManager,se as createPluginRegistry,Ve as createPollingSignal,Re as createReducerSignal,Xe as createSceneManager,_e as createSceneSystem,Ze as createSlideTransition,Te as createStreamSignal,Qe as createTimerSignal,If as createWarningEmitter,df as createWorldDelta,Be as deactivatePlugin,me as defaultPhaseManager,ze as definePlugin,cf as deserializeWorld,s as destroyAllChildren,r as destroyEntity,v as destroyWorld,nb as detectAllJunctions,gb as detectBorderStyle,he as detectCapabilities,mb as detectJunctions,xf as doesPropertyInherit,ld as drainAllEvents,jd as drainKeys,kd as drainMouse,Sb as el,Tb as elRef,e as emitAdopt,f as emitAttach,Lf as emitDeprecatedAPIWarning,Zc as emitDescendants,i as emitDestroy,g as emitDetach,Mf as emitPerformanceWarning,h as emitRemove,d as emitReparent,Jf as emitTerminalTooSmallWarning,Kf as emitUnsupportedCapabilityWarning,xd as endFrame,Ud as evaluateCondition,ha as filterClickable,ba as filterDirty,ga as filterFocusable,aa as filterVisible,ca as filterVisibleDirty,zf as findPropertySource,u as flushDestroyQueue,oc as forceFullRedrawFlag,Wd as formatKey,Xd as formatKeyEvent,fe as formatStartupReport,Va as getAbsoluteEdges,z as getAbsolutePosition,Oa as getAllClickablesAt,Pa as getAllHoverablesAt,Xa as getAutoPadding,Rd as getBindingForAction,Sd as getBindingsForKey,mf as getCacheGeneration,R as getCachedInnerHeight,Q as getCachedInnerWidth,da as getChildEntities,ya as getChildrenByZIndex,Ma as getClickableAt,Ga as getClickableCount,Fa as getClickableEntities,Jb as getClipRect,Ib as getClipRectHeight,Kb as getClipRectToAncestor,Hb as getClipRectWidth,zb as getClipping,Gc as getComputedEffectStyle,G as getComputedPosition,Bf as getComputedStyles,kb as getConnectionFlags,Pb as getCurrentClip,sf as getDefaultStyle,ea as getDescendantEntities,w as getDestroyQueueSize,lc as getDirtyEntities,rc as getDirtyRegionsInViewport,mc as getDirtyStats,sb as getEdgeCount,tb as getEdgesAt,Sc as getEffectState,Ya as getEffectivePadding,Jc as getEffects,Na as getHoverableAt,yf as getInheritedProperty,C as getInnerDimensions,B as getInnerPosition,lb as getJunctionChar,hb as getJunctionCharset,pb as getJunctionRenderData,Ad as getLatencyStats,a as getLifecycleEventBus,rf as getLocalStyle,pa as getLocalZ,Jd as getMovementDirection,Hc as getOriginalStyle,yb as getOverflow,sd as getPendingCount,qd as getPendingKeyCount,rd as getPendingMouseCount,xe as getPluginCount,ve as getPlugins,L as getPositionCache,af as getRegisteredComponents,A as getRelativePosition,fa as getRootEntities,hf as getShrinkBox,gf as getShrinkHeight,ff as getShrinkWidth,ee as getStartupReport,ud as getStats,tc as getStoredStyle,Za as getTotalEffectivePadding,D as getTotalPadding,oa as getZIndex,Ed as globalInputBuffer,Rc as hasAnyEffectApplied,Wa as hasAutoPadding,Ka as hasClickableAt,wb as hasClipping,jc as hasDirtyEntities,Qc as hasDisabledEffectApplied,_a as hasEntityAutoPadding,zc as hasFocusEffectApplied,Cc as hasHoverEffectApplied,La as hasHoverableAt,td as hasPendingEvents,we as hasPlugin,Pc as hasPressEffectApplied,uc as hasStoredStyle,M as hasValidPositionCache,qf as hasValidStyleCache,qa as hasZOrder,Vb as hbox,Ha as hitTest,Ia as hitTestAll,Ja as hitTestDetailed,ce as initSubsystem,de as initSubsystemsUpTo,Fb as intersectClipRects,of as invalidateAllStyleCaches,Ca as invalidateClickableCache,N as invalidatePositionCache,O as invalidatePositionCacheTree,nf as invalidateStyleCache,Hd as isAllKeysDown,Gd as isAnyKeyDown,Id as isAnyKeyPressed,qb as isBorderChar,ke as isBuiltinPhase,Da as isCacheDirty,Cb as isClipRectEmpty,uf as isDefaultColor,hc as isEntityDirty,rb as isJunctionChar,Je as isKeywordPosition,Cd as isLatencyAcceptable,bd as isLoopPaused,ad as isLoopRunning,t as isMarkedForDestruction,Ie as isPercentagePosition,Ce as isPluginActive,T as isPointInCachedBounds,H as isPointInEntity,I as isPointInInnerBounds,Db as isPointVisible,Dd as isProcessingTimeAcceptable,Eb as isRectVisible,ae as lazy,nc as legacyClearDirtyTracking,$b as legacyCreateDirtyTracker,ic as legacyGetDirtyRegions,cc as legacyIsCellDirty,bc as legacyMarkCellDirty,ec as legacyMarkEntityDirty,dc as legacyMarkRegionDirty,gc as legacyRemoveEntityFromTracking,Yd as listBindings,pc as markAllEntitiesDirty,Vd as matchEvent,Td as matchesKey,tf as mergeStyles,Wb as mount,wa as moveDown,va as moveUp,kc as needsFullRedraw,za as normalizeZIndices,k as onAdopt,l as onAttach,o as onDestroy,m as onDetach,n as onRemove,j as onReparent,Md as parseKeyString,Fe as parsePosition,Ge as parsePositionWithNegative,md as peekEvents,nd as peekKeys,od as peekMouse,Me as percentOffsetPosition,Le as percentPosition,Ob as popClipRect,Af as precomputeStyles,Nb as pushClipRect,hd as pushKeyEvent,id as pushMouseEvent,Z as queryBorder,Y as queryContent,V as queryFocusable,$ as queryHierarchy,W as queryInteractive,_ as queryPadding,U as queryRenderable,X as queryScrollable,yd as recordLatency,zd as recordLatencyBatch,qc as regionIntersectsDirty,Od as registerBinding,Pd as registerBindings,p as registerCleanupCallback,$e as registerComponents,Zb as registerDefaultPropSetters,ib as registerEdge,te as registerPlugin,Rb as registerPropSetter,jb as registerRectBorder,be as registerSubsystem,Qb as registerWidgetFactory,Ec as removeAllEffects,Oc as removeDisabledEffect,yc as removeFocusEffect,Bc as removeHoverEffect,b as removeLifecycleEventBus,Mc as removePressEffect,_b as resetDeclarativeRegistrations,y as resetDisposalState,Bd as resetLatencyStats,vd as resetStats,ge as resetSubsystems,Aa as resetZOrder,ac as resizeDirtyTracker,fb as resizeDockingContext,sc as resolveEffectConfig,Ne as resolvePosition,Oe as resolvePositionClamped,wf as resolveStyle,bf as serializeWorld,Ta as setAbsoluteBottom,Ua as setAbsoluteEdges,Qa as setAbsoluteLeft,E as setAbsolutePosition,Ra as setAbsoluteRight,Sa as setAbsoluteTop,ua as setBack,Ic as setEffects,ta as setFront,sa as setLocalZ,xb as setOverflow,K as setPositionCache,F as setRelativePosition,ra as setZIndex,Lb as shouldClipContent,ja as sortByDepth,ia as sortByTabIndex,xa as sortByZIndex,Fc as syncEffects,Xb as unmount,Qd as unregisterBinding,ue as unregisterPlugin,S as updateCachedScrollBase,Ea as updateClickableCache,fc as updateEntityBounds,De as validatePluginConfig,Ub as vbox}from'../chunk-EMZA6G2M.js';export{y as acquireEntity,p as allocateEntity,v as assertEntityAlive,E as clearAllArchetypePools,C as clearArchetypePool,e as createBatch,d as createComputed,i as createEffect,o as createEntityPool,f as createEntitySignal,j as createScheduledEffect,b as createScheduler,c as createSignal,r as deallocateEntity,k as disposeEffect,g as disposeSignal,l as flushScheduledEffects,A as getArchetypePoolStats,a as getDeltaTime,t as getEntityCount,u as getEntityPoolCapacity,B as getRecyclingStats,m as getScheduledEffectCount,n as getTotalScheduledEffectCount,q as isEntityAlive,x as preallocateEntities,w as registerArchetype,z as releaseEntity,s as resetEntityPool,h as trackDependencies,D as unregisterArchetype}from'../chunk-XH5GTWCV.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{e as DEFAULT_WORLD_ADAPTER,d as PackedQueryAdapterConfigSchema,c as PackedQueryRegistrationSchema,v as clearDirtyTracking,j as clearWorldAdapter,l as createDefaultPackedQueryAdapter,n as createDirtyTracker,b as createEntityEventBusStore,a as createEventBus,k as createPackedQueryAdapter,f as createWorldAdapter,w as forceFullRedraw,t as getDirtyRegions,x as getDirtyTrackingStats,h as getWorldAdapter,u as hasDirtyRegions,r as isCellDirty,m as isPackedQueryAdapter,q as markCellDirty,o as markEntityDirty,s as markRegionDirty,p as removeEntityFromTracking,g as setWorldAdapter,i as syncWorldAdapter}from'../chunk-VIT4KE6Q.js';export{a as BoxConfigSchema,c as ButtonConfigSchema,g as CheckboxConfigSchema,l as FormConfigSchema,e as InputConfigSchema,f as ListConfigSchema,m as ProgressBarConfigSchema,o as RadioButtonConfigSchema,n as RadioSetConfigSchema,d as ScreenConfigSchema,j as SelectConfigSchema,k as SliderConfigSchema,b as TextConfigSchema,i as TextareaConfigSchema,h as TextboxConfigSchema,p as createBoxEntity,r as createButtonEntity,v as createCheckboxEntity,A as createFormEntity,t as createInputEntity,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}from'../chunk-SVHITP3F.js';export{a as LoopPhase}from'../chunk-5N3O25O7.js';import'../chunk-ZL46COQF.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-QS5QXZNJ.js';export{a as createEntityValidationError,e as isEntityValid,b as isEntityValidationError,c as registerComponentName,d as validateEntity}from'../chunk-XYMPBCYW.js';import'../chunk-XG5PVDOP.js';import'../chunk-LI3ZYXUT.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';import'../chunk-UKVY43V3.js';import'../chunk-K2QWNDXV.js';import'../chunk-EOFT3PNU.js';import'../chunk-JN2OGNK3.js';import'../chunk-ETFDYZVJ.js';import'../chunk-NPDPBAW6.js';export{l as addComponent,h as addEntity,c as cleanupEntityStores,d as clearWorldStores,f as createWorld,j as entityExists,k as getAllEntities,e as getStoreKeys,b as getWorldSet,a as getWorldStore,m as hasComponent,o as query,p as registerComponent,n as removeComponent,i as removeEntity,g as resetWorld,q as withStore}from'../chunk-7ZFQO3OQ.js';import'../chunk-Z4EZERNE.js';import'../chunk-I7AUKTXE.js';
|
package/dist/debug/index.d.ts
CHANGED
|
@@ -1,8 +1,128 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as Entity, W as World } from '../types-B8LmNkzG.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { G as GameLoop } from '../gameLoop-
|
|
3
|
+
import { G as GameLoop } from '../gameLoop-C1AyRWyP.js';
|
|
4
4
|
import { ComponentRef } from 'bitecs';
|
|
5
|
-
import '../scheduler-
|
|
5
|
+
import '../scheduler-NbHT3-D2.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Core entity and world inspection functions (internal).
|
|
9
|
+
*
|
|
10
|
+
* These functions are used by both index.ts and ecsInspector.ts
|
|
11
|
+
* to avoid circular dependencies.
|
|
12
|
+
*
|
|
13
|
+
* @module debug/inspect
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Component information for inspection.
|
|
19
|
+
*/
|
|
20
|
+
interface ComponentInfo {
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly data: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Entity inspection result.
|
|
26
|
+
*/
|
|
27
|
+
interface EntityInspection {
|
|
28
|
+
readonly entity: Entity;
|
|
29
|
+
readonly name: string | null;
|
|
30
|
+
readonly components: readonly ComponentInfo[];
|
|
31
|
+
readonly parent: Entity | null;
|
|
32
|
+
readonly children: readonly Entity[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* World inspection result.
|
|
36
|
+
*/
|
|
37
|
+
interface WorldInspection {
|
|
38
|
+
readonly entityCount: number;
|
|
39
|
+
readonly componentCounts: Record<string, number>;
|
|
40
|
+
readonly hierarchyRoots: readonly Entity[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Known components for inspection.
|
|
44
|
+
*/
|
|
45
|
+
declare const KNOWN_COMPONENTS: readonly {
|
|
46
|
+
component: unknown;
|
|
47
|
+
name: string;
|
|
48
|
+
}[];
|
|
49
|
+
/**
|
|
50
|
+
* Inspects an entity and returns detailed information about its components.
|
|
51
|
+
*
|
|
52
|
+
* @param world - The ECS world
|
|
53
|
+
* @param eid - The entity to inspect
|
|
54
|
+
* @returns Entity inspection data
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* import { inspectEntity } from 'blecsd/debug';
|
|
59
|
+
*
|
|
60
|
+
* const entity = addEntity(world);
|
|
61
|
+
* setPosition(world, entity, 10, 20);
|
|
62
|
+
*
|
|
63
|
+
* const info = inspectEntity(world, entity);
|
|
64
|
+
* console.log(info.components);
|
|
65
|
+
* // [{ name: 'Position', data: { x: 10, y: 20, z: 0, absolute: 0 } }]
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
declare function inspectEntity(world: World, eid: Entity): EntityInspection;
|
|
69
|
+
/**
|
|
70
|
+
* Formats an entity inspection as a human-readable string.
|
|
71
|
+
*
|
|
72
|
+
* @param inspection - The entity inspection data
|
|
73
|
+
* @returns Formatted string
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* import { inspectEntity, formatEntityInspection } from 'blecsd/debug';
|
|
78
|
+
*
|
|
79
|
+
* const info = inspectEntity(world, entity);
|
|
80
|
+
* console.log(formatEntityInspection(info));
|
|
81
|
+
* // Entity 1 (MyBox)
|
|
82
|
+
* // ├─ Position: x=10, y=20, z=0
|
|
83
|
+
* // ├─ Dimensions: width=40, height=10
|
|
84
|
+
* // └─ Renderable: visible=1
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
declare function formatEntityInspection(inspection: EntityInspection): string;
|
|
88
|
+
/**
|
|
89
|
+
* Inspects the world and returns statistics about entities and components.
|
|
90
|
+
*
|
|
91
|
+
* @param world - The ECS world to inspect
|
|
92
|
+
* @returns World inspection data
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* import { inspectWorld } from 'blecsd/debug';
|
|
97
|
+
*
|
|
98
|
+
* const info = inspectWorld(world);
|
|
99
|
+
* console.log(`Entities: ${info.entityCount}`);
|
|
100
|
+
* console.log(`Position components: ${info.componentCounts['Position']}`);
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
declare function inspectWorld(world: World): WorldInspection;
|
|
104
|
+
/**
|
|
105
|
+
* Formats a world inspection as a human-readable string.
|
|
106
|
+
*
|
|
107
|
+
* @param inspection - The world inspection data
|
|
108
|
+
* @returns Formatted string
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* import { inspectWorld, formatWorldInspection } from 'blecsd/debug';
|
|
113
|
+
*
|
|
114
|
+
* const info = inspectWorld(world);
|
|
115
|
+
* console.log(formatWorldInspection(info));
|
|
116
|
+
* // World Statistics
|
|
117
|
+
* // ────────────────
|
|
118
|
+
* // Entities: 42
|
|
119
|
+
* // Components:
|
|
120
|
+
* // Position: 38
|
|
121
|
+
* // Dimensions: 35
|
|
122
|
+
* // ...
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
declare function formatWorldInspection(inspection: WorldInspection): string;
|
|
6
126
|
|
|
7
127
|
/**
|
|
8
128
|
* System timing and performance tracking utilities.
|
|
@@ -318,6 +438,98 @@ declare function createDebugConsole(world: World, config?: DebugConsoleConfig):
|
|
|
318
438
|
*/
|
|
319
439
|
declare function debugLog(_world: World, message: string, level?: ConsoleLogLevel): void;
|
|
320
440
|
|
|
441
|
+
/**
|
|
442
|
+
* Debug overlay toggle state management.
|
|
443
|
+
*
|
|
444
|
+
* Provides key-based toggle functionality for debug overlays and tools.
|
|
445
|
+
* Pure state machine - no terminal I/O or event listeners.
|
|
446
|
+
*
|
|
447
|
+
* @module debug/debugToggle
|
|
448
|
+
*/
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Configuration for debug toggle behavior.
|
|
452
|
+
*/
|
|
453
|
+
interface DebugToggleConfig {
|
|
454
|
+
/** Key name to toggle (default: 'f12') */
|
|
455
|
+
readonly toggleKey: string;
|
|
456
|
+
/** Initial visibility state (default: false) */
|
|
457
|
+
readonly initialVisible: boolean;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Current state of the debug toggle.
|
|
461
|
+
*/
|
|
462
|
+
interface DebugToggleState {
|
|
463
|
+
/** Whether the overlay is currently visible */
|
|
464
|
+
readonly visible: boolean;
|
|
465
|
+
/** Number of times toggle has been activated */
|
|
466
|
+
readonly toggleCount: number;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Debug toggle instance.
|
|
470
|
+
*/
|
|
471
|
+
interface DebugToggle {
|
|
472
|
+
/** Process a key press. Returns true if the key was consumed (matched toggle key). */
|
|
473
|
+
readonly processKey: (keyName: string) => boolean;
|
|
474
|
+
/** Check if currently visible */
|
|
475
|
+
readonly isVisible: () => boolean;
|
|
476
|
+
/** Get current state */
|
|
477
|
+
readonly getState: () => DebugToggleState;
|
|
478
|
+
/** Toggle visibility */
|
|
479
|
+
readonly toggle: () => void;
|
|
480
|
+
/** Set visibility explicitly */
|
|
481
|
+
readonly setVisible: (visible: boolean) => void;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Zod schema for DebugToggleConfig validation.
|
|
485
|
+
*
|
|
486
|
+
* @example
|
|
487
|
+
* ```typescript
|
|
488
|
+
* import { DebugToggleConfigSchema } from 'blecsd/debug';
|
|
489
|
+
*
|
|
490
|
+
* const config = DebugToggleConfigSchema.parse({
|
|
491
|
+
* toggleKey: 'f12',
|
|
492
|
+
* initialVisible: false,
|
|
493
|
+
* });
|
|
494
|
+
* ```
|
|
495
|
+
*/
|
|
496
|
+
declare const DebugToggleConfigSchema: z.ZodObject<{
|
|
497
|
+
toggleKey: z.ZodString;
|
|
498
|
+
initialVisible: z.ZodBoolean;
|
|
499
|
+
}, z.core.$strip>;
|
|
500
|
+
/**
|
|
501
|
+
* Creates a debug toggle for managing overlay visibility.
|
|
502
|
+
*
|
|
503
|
+
* This is a pure state machine that processes key input and manages
|
|
504
|
+
* toggle state. It does not interact with the terminal or DOM.
|
|
505
|
+
*
|
|
506
|
+
* @param config - Optional configuration
|
|
507
|
+
* @returns Debug toggle instance
|
|
508
|
+
*
|
|
509
|
+
* @example
|
|
510
|
+
* ```typescript
|
|
511
|
+
* import { createDebugToggle } from 'blecsd/debug';
|
|
512
|
+
*
|
|
513
|
+
* const toggle = createDebugToggle({
|
|
514
|
+
* toggleKey: 'f12',
|
|
515
|
+
* initialVisible: false,
|
|
516
|
+
* });
|
|
517
|
+
*
|
|
518
|
+
* // In input handler
|
|
519
|
+
* game.onKey((key) => {
|
|
520
|
+
* if (toggle.processKey(key.name.toLowerCase())) {
|
|
521
|
+
* // Key was consumed by toggle
|
|
522
|
+
* if (toggle.isVisible()) {
|
|
523
|
+
* overlay.show();
|
|
524
|
+
* } else {
|
|
525
|
+
* overlay.hide();
|
|
526
|
+
* }
|
|
527
|
+
* }
|
|
528
|
+
* });
|
|
529
|
+
* ```
|
|
530
|
+
*/
|
|
531
|
+
declare function createDebugToggle(config?: Partial<DebugToggleConfig>): DebugToggle;
|
|
532
|
+
|
|
321
533
|
/**
|
|
322
534
|
* ECS state inspection utilities for debugging.
|
|
323
535
|
*
|
|
@@ -849,126 +1061,140 @@ interface FrameRateGraph {
|
|
|
849
1061
|
declare function createFrameRateGraph(sampleCount?: number): FrameRateGraph;
|
|
850
1062
|
|
|
851
1063
|
/**
|
|
852
|
-
*
|
|
1064
|
+
* Slow frame detection and warning utilities.
|
|
853
1065
|
*
|
|
854
|
-
*
|
|
855
|
-
*
|
|
856
|
-
* - Viewing world statistics
|
|
857
|
-
* - Performance monitoring
|
|
858
|
-
* - Visual debugging
|
|
1066
|
+
* Tracks frame times and detects when frames exceed the target budget.
|
|
1067
|
+
* Useful for identifying performance issues and frame drops.
|
|
859
1068
|
*
|
|
860
|
-
* @module debug
|
|
1069
|
+
* @module debug/slowFrame
|
|
861
1070
|
*/
|
|
862
1071
|
|
|
863
1072
|
/**
|
|
864
|
-
*
|
|
1073
|
+
* Configuration for slow frame detection.
|
|
865
1074
|
*/
|
|
866
|
-
interface
|
|
867
|
-
|
|
868
|
-
readonly
|
|
1075
|
+
interface SlowFrameConfig {
|
|
1076
|
+
/** Frame budget in milliseconds (default: 16.67 for 60fps) */
|
|
1077
|
+
readonly budgetMs: number;
|
|
1078
|
+
/** Number of frames to track in history (default: 120) */
|
|
1079
|
+
readonly historySize: number;
|
|
1080
|
+
/** Multiplier above budget to trigger warning (default: 1.5) */
|
|
1081
|
+
readonly warningThreshold: number;
|
|
869
1082
|
}
|
|
870
1083
|
/**
|
|
871
|
-
*
|
|
1084
|
+
* Statistics about frame performance.
|
|
872
1085
|
*/
|
|
873
|
-
interface
|
|
874
|
-
|
|
875
|
-
readonly
|
|
876
|
-
|
|
877
|
-
readonly
|
|
878
|
-
|
|
1086
|
+
interface SlowFrameStats {
|
|
1087
|
+
/** Worst (slowest) frame time in milliseconds */
|
|
1088
|
+
readonly worstFrameMs: number;
|
|
1089
|
+
/** Average frame time in milliseconds */
|
|
1090
|
+
readonly averageFrameMs: number;
|
|
1091
|
+
/** Count of frames that exceeded the warning threshold */
|
|
1092
|
+
readonly slowFrameCount: number;
|
|
1093
|
+
/** Total frames tracked */
|
|
1094
|
+
readonly totalFrames: number;
|
|
1095
|
+
/** Whether the most recent frame was slow */
|
|
1096
|
+
readonly isCurrentlySlow: boolean;
|
|
1097
|
+
/** Frame time history (last N frames) */
|
|
1098
|
+
readonly histogram: readonly number[];
|
|
879
1099
|
}
|
|
880
1100
|
/**
|
|
881
|
-
*
|
|
1101
|
+
* Slow frame detector instance.
|
|
882
1102
|
*/
|
|
883
|
-
interface
|
|
884
|
-
|
|
885
|
-
readonly
|
|
886
|
-
|
|
1103
|
+
interface SlowFrameDetector {
|
|
1104
|
+
/** Check if a frame time exceeds the threshold. Returns true if frame was slow. */
|
|
1105
|
+
readonly check: (deltaMs: number) => boolean;
|
|
1106
|
+
/** Get current frame statistics */
|
|
1107
|
+
readonly getStats: () => SlowFrameStats;
|
|
1108
|
+
/** Reset all tracked data */
|
|
1109
|
+
readonly reset: () => void;
|
|
887
1110
|
}
|
|
888
1111
|
/**
|
|
889
|
-
*
|
|
890
|
-
*/
|
|
891
|
-
declare const KNOWN_COMPONENTS: readonly {
|
|
892
|
-
component: unknown;
|
|
893
|
-
name: string;
|
|
894
|
-
}[];
|
|
895
|
-
/**
|
|
896
|
-
* Inspects an entity and returns detailed information about its components.
|
|
897
|
-
*
|
|
898
|
-
* @param world - The ECS world
|
|
899
|
-
* @param eid - The entity to inspect
|
|
900
|
-
* @returns Entity inspection data
|
|
1112
|
+
* Zod schema for SlowFrameConfig validation.
|
|
901
1113
|
*
|
|
902
1114
|
* @example
|
|
903
1115
|
* ```typescript
|
|
904
|
-
* import {
|
|
1116
|
+
* import { SlowFrameConfigSchema } from 'blecsd/debug';
|
|
905
1117
|
*
|
|
906
|
-
* const
|
|
907
|
-
*
|
|
908
|
-
*
|
|
909
|
-
*
|
|
910
|
-
*
|
|
911
|
-
* // [{ name: 'Position', data: { x: 10, y: 20, z: 0, absolute: 0 } }]
|
|
1118
|
+
* const config = SlowFrameConfigSchema.parse({
|
|
1119
|
+
* budgetMs: 16.67,
|
|
1120
|
+
* historySize: 120,
|
|
1121
|
+
* warningThreshold: 1.5,
|
|
1122
|
+
* });
|
|
912
1123
|
* ```
|
|
913
1124
|
*/
|
|
914
|
-
declare
|
|
1125
|
+
declare const SlowFrameConfigSchema: z.ZodObject<{
|
|
1126
|
+
budgetMs: z.ZodNumber;
|
|
1127
|
+
historySize: z.ZodNumber;
|
|
1128
|
+
warningThreshold: z.ZodNumber;
|
|
1129
|
+
}, z.core.$strip>;
|
|
915
1130
|
/**
|
|
916
|
-
*
|
|
1131
|
+
* Creates a slow frame detector.
|
|
917
1132
|
*
|
|
918
|
-
*
|
|
919
|
-
*
|
|
1133
|
+
* Tracks frame times and detects when frames exceed the target budget.
|
|
1134
|
+
* Maintains a rolling history of frame times for analysis.
|
|
1135
|
+
*
|
|
1136
|
+
* @param config - Optional configuration
|
|
1137
|
+
* @returns Slow frame detector instance
|
|
920
1138
|
*
|
|
921
1139
|
* @example
|
|
922
1140
|
* ```typescript
|
|
923
|
-
* import {
|
|
1141
|
+
* import { createSlowFrameDetector } from 'blecsd/debug';
|
|
924
1142
|
*
|
|
925
|
-
* const
|
|
926
|
-
*
|
|
927
|
-
*
|
|
928
|
-
*
|
|
929
|
-
*
|
|
930
|
-
*
|
|
1143
|
+
* const detector = createSlowFrameDetector({
|
|
1144
|
+
* budgetMs: 16.67, // 60fps
|
|
1145
|
+
* historySize: 120,
|
|
1146
|
+
* warningThreshold: 1.5,
|
|
1147
|
+
* });
|
|
1148
|
+
*
|
|
1149
|
+
* // In game loop
|
|
1150
|
+
* game.onUpdate((deltaMs) => {
|
|
1151
|
+
* const isSlow = detector.check(deltaMs);
|
|
1152
|
+
* if (isSlow) {
|
|
1153
|
+
* const stats = detector.getStats();
|
|
1154
|
+
* console.warn(`Slow frame: ${deltaMs.toFixed(2)}ms`);
|
|
1155
|
+
* }
|
|
1156
|
+
* });
|
|
931
1157
|
* ```
|
|
932
1158
|
*/
|
|
933
|
-
declare function
|
|
1159
|
+
declare function createSlowFrameDetector(config?: Partial<SlowFrameConfig>): SlowFrameDetector;
|
|
934
1160
|
/**
|
|
935
|
-
*
|
|
1161
|
+
* Renders a slow frame warning message with ANSI formatting.
|
|
936
1162
|
*
|
|
937
|
-
*
|
|
938
|
-
*
|
|
1163
|
+
* Returns an empty string if the frame is not currently slow.
|
|
1164
|
+
* Returns a red "SLOW FRAME" warning with timing details if slow.
|
|
1165
|
+
*
|
|
1166
|
+
* @param stats - Frame statistics from detector
|
|
1167
|
+
* @returns ANSI-formatted warning string or empty string
|
|
939
1168
|
*
|
|
940
1169
|
* @example
|
|
941
1170
|
* ```typescript
|
|
942
|
-
* import {
|
|
1171
|
+
* import { createSlowFrameDetector, renderSlowFrameWarning } from 'blecsd/debug';
|
|
943
1172
|
*
|
|
944
|
-
* const
|
|
945
|
-
*
|
|
946
|
-
*
|
|
1173
|
+
* const detector = createSlowFrameDetector();
|
|
1174
|
+
*
|
|
1175
|
+
* // In game loop
|
|
1176
|
+
* game.onUpdate((deltaMs) => {
|
|
1177
|
+
* detector.check(deltaMs);
|
|
1178
|
+
* const warning = renderSlowFrameWarning(detector.getStats());
|
|
1179
|
+
* if (warning) {
|
|
1180
|
+
* console.log(warning);
|
|
1181
|
+
* }
|
|
1182
|
+
* });
|
|
947
1183
|
* ```
|
|
948
1184
|
*/
|
|
949
|
-
declare function
|
|
1185
|
+
declare function renderSlowFrameWarning(stats: SlowFrameStats): string;
|
|
1186
|
+
|
|
950
1187
|
/**
|
|
951
|
-
*
|
|
952
|
-
*
|
|
953
|
-
* @param inspection - The world inspection data
|
|
954
|
-
* @returns Formatted string
|
|
1188
|
+
* Debug utilities for development and debugging.
|
|
955
1189
|
*
|
|
956
|
-
*
|
|
957
|
-
*
|
|
958
|
-
*
|
|
1190
|
+
* These utilities help with:
|
|
1191
|
+
* - Inspecting entity state
|
|
1192
|
+
* - Viewing world statistics
|
|
1193
|
+
* - Performance monitoring
|
|
1194
|
+
* - Visual debugging
|
|
959
1195
|
*
|
|
960
|
-
*
|
|
961
|
-
* console.log(formatWorldInspection(info));
|
|
962
|
-
* // World Statistics
|
|
963
|
-
* // ────────────────
|
|
964
|
-
* // Entities: 42
|
|
965
|
-
* // Components:
|
|
966
|
-
* // Position: 38
|
|
967
|
-
* // Dimensions: 35
|
|
968
|
-
* // ...
|
|
969
|
-
* ```
|
|
1196
|
+
* @module debug
|
|
970
1197
|
*/
|
|
971
|
-
declare function formatWorldInspection(inspection: WorldInspection): string;
|
|
972
1198
|
|
|
973
1199
|
/**
|
|
974
1200
|
* Gets current performance statistics.
|
|
@@ -1101,4 +1327,4 @@ declare function logEntity(world: World, eid: Entity): void;
|
|
|
1101
1327
|
*/
|
|
1102
1328
|
declare function logWorld(world: World): void;
|
|
1103
1329
|
|
|
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 };
|
|
1330
|
+
export { type AllocationTracker, type ComponentInfo, type ConsoleLogLevel, type DebugConsole, type DebugConsoleConfig, DebugConsoleConfigSchema, type DebugOverlay, type DebugOverlayConfig, type DebugToggle, type DebugToggleConfig, DebugToggleConfigSchema, type DebugToggleState, type EntityInspection, type FrameRateGraph, KNOWN_COMPONENTS, type LeakWarning, type LogEntry, type MemoryDiff, type MemoryProfiler, type MemoryProfilerConfig, type MemorySnapshot, type MiniProfiler, type PerformanceStats, type SlowFrameConfig, SlowFrameConfigSchema, type SlowFrameDetector, type SlowFrameStats, type WorldInspection, createDebugConsole, createDebugOverlay, createDebugToggle, createFrameRateGraph, createInputLogger, createMemoryProfiler, createMiniProfiler, createSlowFrameDetector, 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, renderSlowFrameWarning, resetPerformanceStatsCache, resetSystemTimings, timedSystem };
|
package/dist/debug/index.js
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import {i}from'../chunk-AM6IDSXI.js';import {u,b as b$2}from'../chunk-IANAVH2A.js';import {A,I as I$1}from'../chunk-A3GSH6MV.js';import {c as c$2,a,b as b$3}from'../chunk-QS5QXZNJ.js';import {c,b as b$1}from'../chunk-UKVY43V3.js';import {c as c$1,i as i$3,j as j$2}from'../chunk-K2QWNDXV.js';import {k,o as o$1}from'../chunk-EOFT3PNU.js';import {d,e}from'../chunk-JN2OGNK3.js';import {Ba,$,I,b,ka,i as i$1,f,d as d$1,S,T,Ca,aa,J as J$1,na}from'../chunk-ETFDYZVJ.js';import'../chunk-NPDPBAW6.js';import {m,s,k as k$1,o,j as j$1,i as i$2,h,v as v$1}from'../chunk-7ZFQO3OQ.js';import'../chunk-Z4EZERNE.js';import'../chunk-I7AUKTXE.js';import {z}from'zod';var J=[{component:Ba,name:"Position"},{component:$,name:"Dimensions"},{component:I,name:"Renderable"},{component:d,name:"Content"},{component:k,name:"Border"},{component:c,name:"Padding"},{component:b,name:"Hierarchy"},{component:c$1,name:"Interactive"},{component:ka,name:"Focusable"},{component:b$1,name:"Scrollable"},{component:u,name:"Velocity"},{component:A,name:"Animation"},{component:b$2,name:"Collider"},{component:i,name:"Shadow"}];function Ie(e,n,t,o){if(!m(e,n,t))return null;let r={},s=t;for(let[g,c]of Object.entries(s))if(ArrayBuffer.isView(c)||Array.isArray(c)){let S=c;r[g]=S[n];}return {name:o,data:r}}function j(e,n){let t=[];for(let{component:g,name:c}of J){let S=Ie(e,n,g,c);S&&t.push(S);}let o=m(e,n,b)?i$1(e,n):null,r=m(e,n,b)?f(e,n):[],s=c$2(e,n,"name")?a(e,n,"name")??null:null;return {entity:n,name:s,components:t,parent:o===0?null:o,children:r}}function Q(e){let n=[],t=e.name?` (${e.name})`:"";n.push(`Entity ${e.entity}${t}`),e.parent!==null&&n.push(`\u251C\u2500 Parent: ${e.parent}`),e.children.length>0&&n.push(`\u251C\u2500 Children: [${e.children.join(", ")}]`);let o=e.components.length;return e.components.forEach((r,s$1)=>{let c=s$1===o-1?"\u2514\u2500":"\u251C\u2500",S=Object.entries(r.data).map(([y,a])=>{if(typeof a=="number"){if(y==="fg"||y==="bg"){let{r:d,g:w,b:T,a:i}=s(a>>>0),l=m=>m.toString(16).padStart(2,"0");return `${y}=#${l(d)}${l(w)}${l(T)}${l(Math.round(i*255))}`}if(!Number.isInteger(a))return `${y}=${a.toFixed(2)}`}return `${y}=${a}`}).join(", ");n.push(`${c} ${r.name}: ${S}`);}),n.join(`
|
|
2
|
+
`)}function Y(e){let n=k$1(e),t={},o=[];for(let{name:r}of J)t[r]=0;for(let r of n){for(let{component:s,name:g}of J)if(m(e,r,s)){let c=t[g]??0;t[g]=c+1;}m(e,r,b)&&i$1(e,r)===0&&o.push(r);}return {entityCount:n.length,componentCounts:t,hierarchyRoots:o}}function Z(e){let n=[];n.push("World Statistics"),n.push("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),n.push(`Entities: ${e.entityCount}`),n.push(""),n.push("Components:");let t=Object.entries(e.componentCounts).filter(([,o])=>o>0).sort(([,o],[,r])=>r-o);for(let[o,r]of t){let s=(r/e.entityCount*100).toFixed(0);n.push(` ${o}: ${r} (${s}%)`);}return e.hierarchyRoots.length>0&&(n.push(""),n.push(`Hierarchy Roots: [${e.hierarchyRoots.join(", ")}]`)),n.join(`
|
|
3
|
+
`)}function $e(e,n){let t=[];return m(e,n,ka)&&na(e,n)&&t.push("focused"),m(e,n,c$1)&&(i$3(e,n)&&t.push("hovered"),j$2(e,n)&&t.push("pressed")),I$1(e,n)&&t.push("animated"),o$1(e,n)&&t.push("bordered"),t}var ee=false,K=new Map,G=null,me=0,Oe=100;function ue(e){ee=e,e||K.clear();}function ge(){return ee}function Pe(e,n){if(!ee)return;let t=K.get(e);t?(t.totalTime+=n,t.callCount++):K.set(e,{name:e,totalTime:n,callCount:1});}function _e(e,n){return(o=>{if(!ee)return n(o);let r=performance.now(),s=n(o),g=performance.now()-r;return Pe(e,g),s})}function ne(){let e={};for(let[n,t]of K)e[n]=t.callCount>0?t.totalTime/t.callCount:0;return e}function Ae(){K.clear();}function Be(){G=null,me=0;}function te(e,n,t){let o=performance.now();if(G&&o-me<Oe)return G;let r=t?.getStats()??{fps:0,frameTime:0,frameCount:0,runningTime:0},s=null;typeof process<"u"&&process.memoryUsage&&(s=process.memoryUsage().heapUsed/(1024*1024));let g=ne();return G={fps:r.fps,frameTime:r.frameTime,frameCount:r.frameCount,runningTime:r.runningTime,entityCount:n,memoryUsageMB:s,systemTimings:g},me=o,G}z.object({x:z.number().finite().optional(),y:z.number().finite().optional(),width:z.number().positive().optional(),toggleKey:z.string().optional(),showFPS:z.boolean().optional(),showEntityCount:z.boolean().optional(),showMemory:z.boolean().optional(),showSystemTimings:z.boolean().optional(),maxSystemsShown:z.number().int().positive().optional(),bgColor:z.number().int().nonnegative().optional(),fgColor:z.number().int().nonnegative().optional(),visibleOnStart:z.boolean().optional()});var Ne={x:0,y:0,width:35,toggleKey:"F12",showFPS:true,showEntityCount:true,showMemory:true,showSystemTimings:true,maxSystemsShown:5,bgColor:33023,fgColor:4294967295,visibleOnStart:false};function pe(e$1,n={}){let t={...Ne,...n},o=t.visibleOnStart,r=null;t.showSystemTimings&&!ge()&&ue(true);function s(){let a=h(e$1);return Ca(e$1,a,t.x,t.y,9999),aa(e$1,a,t.width,10),J$1(e$1,a,{fg:t.fgColor,bg:t.bgColor}),S(e$1,a),e(e$1,a,"Loading..."),b$3(e$1,a,"name","__debug_overlay__"),a}function g(a,d){return `\u2502 FPS: \x1B[${a>=55?"32":a>=30?"33":"31"}m${a.toString().padStart(3)}\x1B[0m (${d.toFixed(1)}ms)`}function c(a){let d=ne(),w=Object.entries(d).filter(([,i])=>i>0).sort(([,i],[,l])=>l-i).slice(0,a);if(w.length===0)return [];let T=["\u251C\u2500 Systems \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"];for(let[i,l]of w){let m=l.toFixed(2).padStart(6),p=i.length>20?`${i.slice(0,17)}...`:i;T.push(`\u2502 ${p.padEnd(20)} ${m}ms`);}return T}function S$1(a){let d=["\u250C\u2500 Debug \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"];return t.showFPS&&d.push(g(a.fps,a.frameTime)),t.showEntityCount&&d.push(`\u2502 Entities: ${a.entityCount}`),t.showMemory&&a.memoryUsageMB!==null&&d.push(`\u2502 Memory: ${a.memoryUsageMB.toFixed(1)}MB`),t.showSystemTimings&&d.push(...c(t.maxSystemsShown)),d.push(`\u2502 Frame: ${a.frameCount}`),d.push(`\u2502 Time: ${a.runningTime.toFixed(1)}s`),d.push("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),d.join(`
|
|
4
|
+
`)}let y={get visible(){return o},get entity(){return r},get config(){return t},show(){o=true,r||(r=s()),S(e$1,r);},hide(){o=false,r&&T(e$1,r);},toggle(){o?y.hide():y.show();},update(a,d){if(!o||!r)return;let T=k$1(a).length,i=te(a,T,d),l=S$1(i);e(a,r,l);let m=l.split(`
|
|
5
|
+
`).length;aa(a,r,t.width,m);},destroy(){r&&(i$2(e$1,r),r=null),o=false;}};return o&&(r=s()),y}function Ue(e=20){let n=[];return {get entries(){return n},get maxEntries(){return e},log(t,o){for(n.push({type:t,detail:o,timestamp:Date.now()});n.length>e;)n.shift();},clear(){n.length=0;},getRecentEntries(t=5){return n.slice(-t)}}}function je(){let e=new Map,n=new Map;return {start(t){e.set(t,performance.now());},end(t){let o=e.get(t);if(o===void 0)return 0;let r=performance.now()-o;e.delete(t);let s=n.get(t);return s?(s.total+=r,s.min=Math.min(s.min,r),s.max=Math.max(s.max,r),s.count++):n.set(t,{total:r,min:r,max:r,count:1}),r},getAverage(t){let o=n.get(t);return !o||o.count===0?0:o.total/o.count},getAll(){let t={};for(let[o,r]of n)t[o]={avg:r.count>0?r.total/r.count:0,min:r.min,max:r.max,count:r.count};return t},reset(){e.clear(),n.clear();}}}function Ge(e=60){let n=[],t=0;return {addSample(o){for(n.push(o),t+=o;n.length>e;){let r=n.shift();r!==void 0&&(t-=r);}},getSamples(){return n},getCurrentFPS(){if(n.length===0)return 0;let o=n[n.length-1]??0;return o>0?1e3/o:0},getAverageFPS(){if(n.length===0)return 0;let o=t/n.length;return o>0?1e3/o:0},getMinMaxFPS(){if(n.length===0)return {min:0,max:0};let o=Number.MAX_VALUE,r=0;for(let s of n)o=Math.min(o,s),r=Math.max(r,s);return {min:r>0?1e3/r:0,max:o>0?1e3/o:0}},reset(){n.length=0,t=0;}}}var Re=z.object({enabled:z.boolean().optional().default(false),toggleKey:z.string().optional().default("F12"),showOverlay:z.boolean().optional().default(true),showLogs:z.boolean().optional().default(true),maxLogEntries:z.number().int().positive().optional().default(100),position:z.object({x:z.number(),y:z.number()}).optional(),dimensions:z.object({width:z.number().positive(),height:z.number().positive()}).optional(),theme:z.object({bg:z.union([z.string(),z.number()]).optional(),fg:z.union([z.string(),z.number()]).optional(),infoBg:z.union([z.string(),z.number()]).optional(),warnBg:z.union([z.string(),z.number()]).optional(),errorBg:z.union([z.string(),z.number()]).optional()}).optional()}),oe={enabled:false,toggleKey:"F12",showOverlay:true,showLogs:true,maxLogEntries:100,position:{x:0,y:0},dimensions:{width:80,height:20},theme:{bg:221,fg:4294967295,infoBg:65535,warnBg:4294902015,errorBg:4278190335}};function Ke(e$1,n={}){let t={...oe,...n,position:n.position??oe.position,dimensions:n.dimensions??oe.dimensions,theme:{...oe.theme,...n.theme??{}}};if(Re.parse(n),!t.enabled)return He(t);let o=[],r=false,s=null,g=null,c=null;t.showOverlay&&(c=pe(e$1,{x:t.position.x,y:t.position.y,width:Math.floor(t.dimensions.width/2),toggleKey:t.toggleKey,visibleOnStart:false}));function S$1(){let u=h(e$1),x=t.showOverlay?t.position.x+Math.floor(t.dimensions.width/2)+1:t.position.x;return Ca(e$1,u,x,t.position.y,9999),aa(e$1,u,Math.floor(t.dimensions.width/2),t.dimensions.height),J$1(e$1,u,{fg:v$1(t.theme.fg),bg:v$1(t.theme.bg)}),T(e$1,u),b$3(e$1,u,"name","__debug_console__"),u}function y(){let u=h(e$1);return Ca(e$1,u,0,0,0),aa(e$1,u,Math.floor(t.dimensions.width/2),t.dimensions.height),J$1(e$1,u,{fg:v$1(t.theme.fg),bg:0}),e(e$1,u,`Debug Console
|
|
6
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`),b$3(e$1,u,"name","__debug_log_panel__"),u}function a(){if(!g||!j$1(e$1,g))return;let u=t.dimensions.height-2,x=o.slice(-u),D=["Debug Console","\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"];for(let L of x){let H=new Date(L.timestamp).toLocaleTimeString(),V=d(L.level);D.push(`${H} ${V} ${L.message}`);}e(e$1,g,D.join(`
|
|
7
|
+
`));}function d(u){switch(u){case "debug":return "[D]";case "info":return "[I]";case "warn":return "[W]";case "error":return "[E]"}}function w(){r||(r=true,c&&c.show(),t.showLogs&&((!s||!j$1(e$1,s))&&(s=S$1(),g=y(),d$1(e$1,s,g)),s&&j$1(e$1,s)&&S(e$1,s),a()));}function T$1(){r&&(r=false,c&&c.hide(),s&&j$1(e$1,s)&&T(e$1,s));}function i(){r?T$1():w();}function l(u,x="info"){let D={timestamp:Date.now(),level:x,message:u};for(o.push(D);o.length>t.maxLogEntries;)o.shift();switch(x){case "debug":console.debug(`[DEBUG] ${u}`);break;case "info":console.info(`[INFO] ${u}`);break;case "warn":console.warn(`[WARN] ${u}`);break;case "error":console.error(`[ERROR] ${u}`);break}r&&t.showLogs&&a();}function m(u,x){r&&(c&&c.update(u,x),t.showLogs&&g&&j$1(u,g)&&a());}function p(){o.length=0,r&&t.showLogs&&a();}function h$1(){c&&c.destroy(),g&&j$1(e$1,g)&&i$2(e$1,g),s&&j$1(e$1,s)&&i$2(e$1,s),o.length=0;}return {get enabled(){return t.enabled},get visible(){return r},get logs(){return o},get config(){return t},show:w,hide:T$1,toggle:i,log:l,update:m,clearLogs:p,destroy:h$1}}function He(e){return {enabled:false,visible:false,logs:[],config:e,show:()=>{},hide:()=>{},toggle:()=>{},log:()=>{},update:()=>{},clearLogs:()=>{},destroy:()=>{}}}function Ve(e,n,t="info"){switch(t){case "debug":console.debug(`[DEBUG] ${n}`);break;case "info":console.info(`[INFO] ${n}`);break;case "warn":console.warn(`[WARN] ${n}`);break;case "error":console.error(`[ERROR] ${n}`);break}}var ze=z.object({toggleKey:z.string().min(1),initialVisible:z.boolean()}),qe={toggleKey:"f12",initialVisible:false};function Xe(e){let n={...qe,...e},t=n.initialVisible,o=0;return {processKey(r){return r.toLowerCase()===n.toggleKey.toLowerCase()?(t=!t,o++,true):false},isVisible(){return t},getState(){return {visible:t,toggleCount:o}},toggle(){t=!t,o++;},setVisible(r){t!==r&&(t=r,o++);}}}function Je(e,n){let t=j(e,n);return Q(t)}function Qe(e){let n=Y(e);return Z(n)}function Ye(e){return k$1(e)}function Ze(e,n){return o(e,[n])}function en(e,n){return n.length===0?[]:o(e,n)}function nn(e,n){return k$1(e).includes(n)}function tn(e,n){return j(e,n).components.map(o=>o.name)}function on(e,n,t,o){if(!m(e,n,t))return;let s=t[o];if(ArrayBuffer.isView(s)||Array.isArray(s))return s[n]}z.object({snapshotInterval:z.number().nonnegative(),maxSnapshots:z.number().int().positive(),entityLeakThreshold:z.number().nonnegative(),heapLeakThreshold:z.number().nonnegative(),trackedComponents:z.array(z.object({component:z.unknown(),name:z.string()})).readonly()});var rn={snapshotInterval:5e3,maxSnapshots:100,entityLeakThreshold:10,heapLeakThreshold:1024*1024,trackedComponents:[]};function sn(e){let n={...rn,...e},t=[],o=null;function r(i){let l=k$1(i),m$1={};for(let{component:u,name:x}of n.trackedComponents){let D=0;for(let L of l)m(i,L,u)&&D++;m$1[x]=D;}let p=process.memoryUsage(),h={timestamp:Date.now(),entityCount:l.length,componentCounts:m$1,heapUsed:p.heapUsed,heapTotal:p.heapTotal,rss:p.rss,external:p.external};for(t.push(h);t.length>n.maxSnapshots;)t.shift();return h}function s(i,l){let m={},p=new Set([...Object.keys(i.componentCounts),...Object.keys(l.componentCounts)]);for(let h of p)m[h]=(l.componentCounts[h]??0)-(i.componentCounts[h]??0);return m}function g(i,l,m,p){let h=i/l;return h<=n.entityLeakThreshold?null:{type:"entity",message:`Entity count growing at ${h.toFixed(1)}/sec (${m.entityCount} -> ${p.entityCount})`,growthRate:h}}function c(i,l){let m=i/l;return m<=n.heapLeakThreshold?null:{type:"heap",message:`Heap growing at ${(m/1024).toFixed(1)}KB/sec`,growthRate:m}}function S(i,l){let m=[];for(let[p,h]of Object.entries(i)){let u=h/l;u>n.entityLeakThreshold&&m.push({type:"component",message:`${p} component growing at ${u.toFixed(1)}/sec`,growthRate:u});}return m}function y(i,l){let m=l.timestamp-i.timestamp,p=m/1e3,h=l.entityCount-i.entityCount,u=l.heapUsed-i.heapUsed,x=l.rss-i.rss,D=s(i,l),L=[];if(p>0){let H=g(h,p,i,l);H&&L.push(H);let V=c(u,p);V&&L.push(V);let ke=S(D,p);L.push(...ke);}return {elapsed:m,entityCountDelta:h,componentDeltas:D,heapUsedDelta:u,rssDelta:x,possibleLeaks:L}}function a(i){return Math.abs(i)<1024?`${i}B`:Math.abs(i)<1024*1024?`${(i/1024).toFixed(1)}KB`:`${(i/(1024*1024)).toFixed(1)}MB`}function d(i,l){i.push("Memory Profile Report"),i.push("\u2550".repeat(40)),i.push(`Entities: ${l.entityCount}`),i.push(`Heap Used: ${a(l.heapUsed)}`),i.push(`Heap Total: ${a(l.heapTotal)}`),i.push(`RSS: ${a(l.rss)}`),i.push(`External: ${a(l.external)}`);}function w(i,l){if(Object.keys(l.componentCounts).length!==0){i.push(""),i.push("Component Counts:");for(let[m,p]of Object.entries(l.componentCounts))i.push(` ${m}: ${p}`);}}function T(i,l){if(t.length<2)return;let m=t[0];if(!m)return;let p=y(m,l);if(i.push(""),i.push(`Trends (over ${(p.elapsed/1e3).toFixed(0)}s):`),i.push(` Entity delta: ${p.entityCountDelta>0?"+":""}${p.entityCountDelta}`),i.push(` Heap delta: ${p.heapUsedDelta>0?"+":""}${a(p.heapUsedDelta)}`),p.possibleLeaks.length>0){i.push(""),i.push("WARNINGS:");for(let h of p.possibleLeaks)i.push(` [${h.type}] ${h.message}`);}}return {snapshot(i){return r(i)},diff(i,l){return y(i,l)},getSnapshots(){return t},getLatestSnapshot(){return t.length>0?t[t.length-1]??null:null},getReport(i){let l=r(i),m=[];return d(m,l),w(m,l),T(m,l),m.join(`
|
|
8
|
+
`)},startAutoSnapshot(i){o===null&&(n.snapshotInterval<=0||(r(i),o=setInterval(()=>{r(i);},n.snapshotInterval)));},stopAutoSnapshot(){o!==null&&(clearInterval(o),o=null);},reset(){t.length=0,o!==null&&(clearInterval(o),o=null);}}}var an=z.object({budgetMs:z.number().positive().finite(),historySize:z.number().int().positive(),warningThreshold:z.number().positive().finite()}),ln={budgetMs:16.67,historySize:120,warningThreshold:1.5};function mn(e){let n={...ln,...e},t=n.budgetMs*n.warningThreshold,o=[],r=0,s=0,g=0,c=0,S=false;return {check(y){for(o.push(y),r+=y,c++,y>s&&(s=y);o.length>n.historySize;){let d=o.shift();d!==void 0&&(r-=d);}let a=y>t;return a&&g++,S=a,a},getStats(){let y=o.length,a=y>0?r/y:0;return {worstFrameMs:s,averageFrameMs:a,slowFrameCount:g,totalFrames:c,isCurrentlySlow:S,histogram:[...o]}},reset(){o.length=0,r=0,s=0,g=0,c=0,S=false;}}}function un(e){return e.isCurrentlySlow?`\x1B[1m\x1B[31m\u26A0 SLOW FRAME\x1B[0m ${(e.histogram[e.histogram.length-1]??0).toFixed(2)}ms (avg: ${e.averageFrameMs.toFixed(2)}ms, worst: ${e.worstFrameMs.toFixed(2)}ms)`:""}function ft(e,n){let o=k$1(e).length;return te(e,o,n)}var v={enabled:false,showHitboxes:true,showPadding:false,showMargins:false,color:4278255360};function yt(e,n){v.enabled=e,n&&(v.showHitboxes=n.showHitboxes??v.showHitboxes,v.showPadding=n.showPadding??v.showPadding,v.showMargins=n.showMargins??v.showMargins,v.color=n.color??v.color);}function dt(){return v.enabled}function ht(){return {...v}}function bt(e){return v.enabled?k$1(e).filter(t=>m(e,t,Ba)&&m(e,t,$)):[]}function St(e,n){let t=[],o=c$2(e,n,"name")?a(e,n,"name"):null;if(t.push(`Entity ${n}${o?` (${o})`:""}`),m(e,n,Ba)){let s=Math.round(Ba.x[n]??0),g=Math.round(Ba.y[n]??0);t.push(`@ ${s},${g}`);}m(e,n,$)&&t.push(`[${$.width[n]}x${$.height[n]}]`);let r=$e(e,n);return r.length>0&&t.push(r.join(" ")),t.join(" ")}function Ct(e,n){let t=j(e,n),o=Q(t);console.log(`[DEBUG] ${o}`);}function xt(e){let n=Y(e),t=Z(n);console.log(`[DEBUG] ${t}`);}export{Re as DebugConsoleConfigSchema,ze as DebugToggleConfigSchema,J as KNOWN_COMPONENTS,an as SlowFrameConfigSchema,Ke as createDebugConsole,pe as createDebugOverlay,Xe as createDebugToggle,Ge as createFrameRateGraph,Ue as createInputLogger,sn as createMemoryProfiler,je as createMiniProfiler,mn as createSlowFrameDetector,Ve as debugLog,Je as dumpEntity,Qe as dumpWorld,yt as enableDebugBounds,ue as enableSystemTiming,Ze as findEntitiesWithComponent,en as findEntitiesWithComponents,Q as formatEntityInspection,Z as formatWorldInspection,on as getComponentField,ht as getDebugBoundsConfig,bt as getDebugBoundsEntities,St as getEntitySummary,ft as getPerformanceStats,ne as getSystemTimings,j as inspectEntity,Y as inspectWorld,dt as isDebugBoundsEnabled,nn as isEntityActive,ge as isSystemTimingEnabled,Ye as listEntities,tn as listEntityComponents,Ct as logEntity,xt as logWorld,Pe as recordSystemTime,un as renderSlowFrameWarning,Be as resetPerformanceStatsCache,Ae as resetSystemTimings,_e as timedSystem};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Entity, W as World } from './types-
|
|
1
|
+
import { E as Entity, W as World } from './types-B8LmNkzG.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Unified dirty tracking system for efficient rendering.
|
|
@@ -232,4 +232,4 @@ declare function getDirtyTrackingStats(tracker: DirtyTracker): {
|
|
|
232
232
|
readonly frameCount: number;
|
|
233
233
|
};
|
|
234
234
|
|
|
235
|
-
export { type
|
|
235
|
+
export { type DirtyRect as D, type DirtyTracker as a, createDirtyTracker as b, clearDirtyTracking as c, getDirtyTrackingStats as d, markEntityDirty as e, forceFullRedraw as f, getDirtyRegions as g, hasDirtyRegions as h, isCellDirty as i, markRegionDirty as j, markCellDirty as m, removeEntityFromTracking as r };
|
package/dist/errors/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import'../chunk-I7AUKTXE.js';var E=Symbol.for("blecsd.error");var t={INVALID_INPUT:"VALIDATION_INVALID_INPUT",INVALID_HEX_COLOR:"VALIDATION_INVALID_HEX_COLOR",INVALID_HEX_LENGTH:"VALIDATION_INVALID_HEX_LENGTH",INVALID_COLOR_OBJECT:"VALIDATION_INVALID_COLOR_OBJECT",INVALID_COLOR_VALUE:"VALIDATION_INVALID_COLOR_VALUE",INVALID_PALETTE_INDEX:"VALIDATION_INVALID_PALETTE_INDEX",INVALID_CUBE_INDEX:"VALIDATION_INVALID_CUBE_INDEX",INVALID_GRAYSCALE_INDEX:"VALIDATION_INVALID_GRAYSCALE_INDEX",INVALID_DIMENSION:"VALIDATION_INVALID_DIMENSION",INVALID_BUFFER_DIMENSIONS:"VALIDATION_INVALID_BUFFER_DIMENSIONS",INVALID_SURROGATE_PAIR:"VALIDATION_INVALID_SURROGATE_PAIR",SCHEMA_VALIDATION_FAILED:"VALIDATION_SCHEMA_FAILED",REQUIRED_FIELD_MISSING:"VALIDATION_REQUIRED_FIELD_MISSING",VALUE_OUT_OF_RANGE:"VALIDATION_VALUE_OUT_OF_RANGE"},i={TERMINAL_ERROR:"TERMINAL_ERROR",NOT_INITIALIZED:"TERMINAL_NOT_INITIALIZED",ALREADY_INITIALIZED:"TERMINAL_ALREADY_INITIALIZED",TERMINFO_NOT_FOUND:"TERMINAL_TERMINFO_NOT_FOUND",NEGOTIATION_NOT_STARTED:"TERMINAL_NEGOTIATION_NOT_STARTED",NEGOTIATION_ALREADY_STARTED:"TERMINAL_NEGOTIATION_ALREADY_STARTED",CAPABILITY_NOT_SUPPORTED:"TERMINAL_CAPABILITY_NOT_SUPPORTED",WRITE_FAILED:"TERMINAL_WRITE_FAILED",READ_FAILED:"TERMINAL_READ_FAILED",CLEANUP_FAILED:"TERMINAL_CLEANUP_FAILED"},d={SYSTEM_ERROR:"SYSTEM_ERROR",LOOP_ALREADY_RUNNING:"SYSTEM_LOOP_ALREADY_RUNNING",LOOP_NOT_RUNNING:"SYSTEM_LOOP_NOT_RUNNING",CANNOT_CHANGE_WORLD:"SYSTEM_CANNOT_CHANGE_WORLD",SYSTEM_EXECUTION_FAILED:"SYSTEM_EXECUTION_FAILED",PHASE_NOT_FOUND:"SYSTEM_PHASE_NOT_FOUND",PHASE_ALREADY_EXISTS:"SYSTEM_PHASE_ALREADY_EXISTS",INVALID_PHASE_ORDER:"SYSTEM_INVALID_PHASE_ORDER",SCHEDULER_NOT_INITIALIZED:"SYSTEM_SCHEDULER_NOT_INITIALIZED"},I={ENTITY_ERROR:"ENTITY_ERROR",NOT_FOUND:"ENTITY_NOT_FOUND",ALREADY_EXISTS:"ENTITY_ALREADY_EXISTS",SCREEN_ALREADY_EXISTS:"ENTITY_SCREEN_ALREADY_EXISTS",INVALID_ID:"ENTITY_INVALID_ID",MISSING_COMPONENT:"ENTITY_MISSING_COMPONENT",HIERARCHY_ERROR:"ENTITY_HIERARCHY_ERROR"},a={COMPONENT_ERROR:"COMPONENT_ERROR",NOT_FOUND:"COMPONENT_NOT_FOUND",ALREADY_EXISTS:"COMPONENT_ALREADY_EXISTS",INVALID_DATA:"COMPONENT_INVALID_DATA",STORE_NOT_INITIALIZED:"COMPONENT_STORE_NOT_INITIALIZED"},T={INPUT_ERROR:"INPUT_ERROR",INVALID_KEY_SEQUENCE:"INPUT_INVALID_KEY_SEQUENCE",INVALID_MOUSE_EVENT:"INPUT_INVALID_MOUSE_EVENT",HANDLER_NOT_REGISTERED:"INPUT_HANDLER_NOT_REGISTERED",BUFFER_OVERFLOW:"INPUT_BUFFER_OVERFLOW"},p={RENDER_ERROR:"RENDER_ERROR",BUFFER_NOT_INITIALIZED:"RENDER_BUFFER_NOT_INITIALIZED",INVALID_COORDINATES:"RENDER_INVALID_COORDINATES",BUFFER_OVERFLOW:"RENDER_BUFFER_OVERFLOW",CYCLE_TIMEOUT:"RENDER_CYCLE_TIMEOUT"},s={CONFIG_ERROR:"CONFIG_ERROR",INVALID_GAME_CONFIG:"CONFIG_INVALID_GAME_CONFIG",INVALID_SCREEN_CONFIG:"CONFIG_INVALID_SCREEN_CONFIG",INVALID_WIDGET_CONFIG:"CONFIG_INVALID_WIDGET_CONFIG",MISSING_REQUIRED:"CONFIG_MISSING_REQUIRED"},C={INTERNAL_ERROR:"INTERNAL_ERROR",UNEXPECTED_STATE:"INTERNAL_UNEXPECTED_STATE",ASSERTION_FAILED:"INTERNAL_ASSERTION_FAILED",NOT_IMPLEMENTED:"INTERNAL_NOT_IMPLEMENTED",UNREACHABLE:"INTERNAL_UNREACHABLE"},O={...t,...i,...d,...I,...a,...T,...p,...s,...C};function S(r,e,o){return {kind:"validation",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.zodIssues?{...o.context,zodIssues:o.zodIssues}:o?.context}}function A(r,e,o){return {kind:"terminal",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.context}}function c(r,e,o){return {kind:"system",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.context}}function f(r,e,o){return {kind:"entity",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.context}}function D(r,e,o){return {kind:"component",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.context}}function L(r,e,o){return {kind:"input",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.context}}function m(r,e,o){return {kind:"render",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.context}}function x(r,e,o){return {kind:"config",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.context}}function N(r,e,o){return {kind:"internal",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.context}}function B(r){let e=new Error(r.message);return e.name=`BlECSd${k(r.kind)}Error`,e[E]=r,r.cause&&(e.cause=r.cause),e}function _(r){return r==null||typeof r!="object"?null:E in r?r[E]:null}function V(r,e,o){let n=_(r);if(n)return n;let y=r instanceof Error?r:void 0,u=r instanceof Error?`${o}: ${r.message}`:`${o}: ${String(r)}`;return N(e,u,{cause:y})}function k(r){return r.charAt(0).toUpperCase()+r.slice(1)}function U(r){return r.kind==="validation"}function g(r){return r.kind==="terminal"}function M(r){return r.kind==="system"}function F(r){return r.kind==="entity"}function Y(r){return r.kind==="component"}function P(r){return r.kind==="input"}function G(r){return r.kind==="render"}function w(r){return r.kind==="config"}function H(r){return r.kind==="internal"}function v(r,e){return r.kind===e}function X(r,e){return r.code===e}function h(r){return r!=null&&typeof r=="object"&&E in r}function K(r){if(r==null||typeof r!="object")return false;let e=r;return typeof e.kind=="string"&&typeof e.code=="string"&&typeof e.message=="string"&&typeof e.timestamp=="number"}function Z(r){return r.context!=null}function b(r){return r.cause!=null}function z(r){return r.context!=null&&r.context.zodIssues!=null&&r.context.zodIssues.length>0}function R(r){return {ok:true,value:r}}function l(r){return {ok:false,error:r}}function W(r){return r.ok===true}function $(r){return r.ok===false}function Q(r){if(r.ok)return r.value;let e=r.error instanceof Error?r.error.message:typeof r.error=="object"&&r.error!==null&&"message"in r.error?String(r.error.message):String(r.error);throw new Error(`Called unwrap on Err: ${e}`)}function j(r,e){return r.ok?r.value:e}function J(r,e){return r.ok?r.value:e(r.error)}function q(r,e){return r.ok?R(e(r.value)):r}function rr(r,e){return r.ok?r:l(e(r.error))}function er(r,e){return r.ok?e(r.value):r}export{E as BLECSD_ERROR_SYMBOL,O as BlECSdErrorCode,a as ComponentErrorCode,s as ConfigErrorCode,I as EntityErrorCode,T as InputErrorCode,C as InternalErrorCode,p as RenderErrorCode,d as SystemErrorCode,i as TerminalErrorCode,t as ValidationErrorCode,D as createComponentError,x as createConfigError,f as createEntityError,L as createInputError,N as createInternalError,m as createRenderError,c as createSystemError,A as createTerminalError,S as createValidationError,l as err,er as flatMap,_ as fromNativeError,K as hasBlECSdErrorShape,b as hasCause,Z as hasContext,X as hasErrorCode,z as hasZodIssues,h as isBlECSdError,Y as isComponentError,w as isConfigError,F as isEntityError,$ as isErr,v as isErrorKind,P as isInputError,H as isInternalError,W as isOk,G as isRenderError,M as isSystemError,g as isTerminalError,U as isValidationError,q as map,rr as mapError,R as ok,B as toNativeError,Q as unwrap,j as unwrapOr,J as unwrapOrElse,V as wrapError};
|