bard-legends-framework 1.3.1 → 1.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/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as actions_lib from 'actions-lib';
2
2
  import { IDAttachable, Attachable, SingleEvent, Sequence, SingleNotifier, Notifier, Reducer, Variable, Action } from 'actions-lib';
3
- import { Vector, Radian, Rectangle, Vec2, RGBColor, TypeValuePair, Grid, GridNeighborType, Line } from 'helpers-lib';
3
+ import { Vector, Radian, Rectangle, Vec2, RGBColor, Grid, GridNeighborType, Line } from 'helpers-lib';
4
4
  import * as Pixi from 'pixi.js';
5
5
 
6
6
  declare class ControllerLink {
@@ -26,9 +26,17 @@ declare abstract class Entity extends IDAttachable {
26
26
  attachToRoot(): this;
27
27
  }
28
28
 
29
+ type SingletonEntityClassType<T extends SingletonEntity = SingletonEntity> = (new (...args: any[]) => T) & {
30
+ id: number;
31
+ };
29
32
  declare abstract class SingletonEntity extends Entity {
30
- static getInstance<T extends SingletonEntity>(this: EntityClassType<T>): T | undefined;
31
- static getInstanceOrFail<T extends SingletonEntity>(this: EntityClassType<T>): T;
33
+ static getInstanceAsync<T extends SingletonEntity>(this: SingletonEntityClassType<T>): SingleEvent<T>;
34
+ static continuesSubscription<T extends SingletonEntity>(this: SingletonEntityClassType<T>): Sequence<{
35
+ type: 'open' | 'close';
36
+ value: T;
37
+ }>;
38
+ static getInstance<T extends SingletonEntity>(this: SingletonEntityClassType<T>): T | undefined;
39
+ static getInstanceOrFail<T extends SingletonEntity>(this: SingletonEntityClassType<T>): T;
32
40
  constructor();
33
41
  }
34
42
 
@@ -41,6 +49,8 @@ type SceneClassType = new (...services: unknown[]) => Scene<unknown, unknown>;
41
49
  type SceneInput<T> = T extends Scene<infer I, any> ? I : never;
42
50
  declare function SceneDecorator(): (SceneClass: SceneClassType) => any;
43
51
  declare abstract class Scene<InputType, OutputType> extends IDAttachable {
52
+ static readonly isTransitioning: actions_lib.Notifier<boolean>;
53
+ static getIsTransitioning(this: typeof Scene): boolean;
44
54
  static readonly activeScene: actions_lib.Notifier<Scene<unknown, unknown> | undefined>;
45
55
  static getActiveScene(this: typeof Scene): Scene<unknown, unknown> | undefined;
46
56
  static getActiveSceneOrFail(this: typeof Scene): Scene<unknown, unknown>;
@@ -418,48 +428,42 @@ declare class DisplayObjectArray<T> extends Container {
418
428
  set(items: readonly T[]): void;
419
429
  }
420
430
 
421
- type MenuUINewMenuOpenBehavior = 'close' | 'temporarilyDisappear' | 'stayInBackground';
422
- type MenuCloseReason<OutputType = undefined> = TypeValuePair<{
423
- backgroundClick: undefined;
424
- newMenuOpened: undefined;
425
- withValue: OutputType;
426
- }>;
427
431
  interface MenuOptions {
428
- readonly onNewMenuOpen: MenuUINewMenuOpenBehavior;
429
432
  readonly closeOnBackgroundClick: boolean;
430
433
  readonly appearAnimationDuration: number;
431
434
  readonly backgroundDarkeningRatio: number;
432
435
  }
433
- declare class MenuUI<OutputType = undefined> extends Container {
436
+ declare class MenuUI extends Container {
437
+ static isAnyMenuTransitioning: actions_lib.Notifier<boolean>;
438
+ static getIsAnyMenuTransitioning(this: typeof MenuUI): boolean;
434
439
  readonly onCreate: actions_lib.SingleNotifier<void>;
435
440
  readonly onOpen: actions_lib.SingleNotifier<void>;
436
- readonly onClose: actions_lib.SingleNotifier<MenuCloseReason<OutputType>>;
441
+ readonly onClose: actions_lib.SingleNotifier<void>;
437
442
  constructor(windowSprite: string, partialOptions: Partial<MenuOptions>);
438
443
  getBoundingMask(): Sprite;
439
- close(output: MenuCloseReason<OutputType>): SingleEvent<MenuCloseReason<OutputType>>;
444
+ close(): SingleEvent;
440
445
  }
441
446
 
442
447
  interface MenuEntityOptions {
443
- readonly onNewMenuOpen: MenuUINewMenuOpenBehavior;
444
448
  readonly closeOnBackgroundClick: boolean;
445
449
  }
446
- declare class MenuEntity<OutputType = undefined> extends SingletonEntity {
450
+ declare class MenuEntity extends SingletonEntity {
447
451
  constructor(partialOptions: Partial<MenuEntityOptions>);
448
452
  onCreate(): SingleEvent;
449
453
  onOpen(): SingleEvent;
450
- onClose(): SingleEvent<MenuCloseReason<OutputType>>;
451
- close(...args: undefined extends OutputType ? (OutputType extends undefined ? [] : [OutputType]) : [OutputType]): SingleEvent<MenuCloseReason<OutputType>>;
454
+ onClose(): SingleEvent;
455
+ close(): SingleEvent;
452
456
  }
453
457
 
454
458
  interface MenuViewOptions {
455
459
  readonly appearAnimationDuration: number;
456
460
  readonly backgroundDarkeningRatio: number;
457
461
  }
458
- declare class MenuView<OutputType = void> extends View {
462
+ declare class MenuView extends View {
459
463
  readonly onCreate: SingleNotifier<Container>;
460
464
  readonly onOpen: SingleNotifier;
461
- readonly onClose: SingleNotifier<MenuCloseReason<OutputType>>;
462
- constructor(entity: MenuEntity<OutputType>, windowSprite: string, partialOptions: Partial<MenuViewOptions>);
465
+ readonly onClose: SingleNotifier;
466
+ constructor(entity: MenuEntity, windowSprite: string, partialOptions: Partial<MenuViewOptions>);
463
467
  }
464
468
 
465
469
  interface ScrollAreaUIOptions {
@@ -989,4 +993,4 @@ declare class PhysicsGateway {
989
993
  printPathfindingTestGrid(physicsWorldID: number, testLayerID: number, target: Vector | number, physicsBodyGroup: PhysicsBodyGroup, area: Rectangle, gridCellSize?: number): void;
990
994
  }
991
995
 
992
- export { AnimationFlicker, AnimationInterpolationFunctions, type AnimationOptions, Animations, AnimationsCompletionHandlingType, Animator, type AnimatorAnimation, type AssetDefinition, BORDER_MATERIAL_NAME, BardLegendsHardReset, BlendMode, type BorderProperties, Camera, CameraGateway, type CircleShapeData, ClosestAvailableSpaceHelper, type CollisionDetails, type CollisionReport, Container, ContainerEventType, ControllerDecorator, type ControllerDecoratorMeta, ControllerLink, type CreateDashedLineOptions, type CreatePhysicsWorldRequestDTO, Cursor, DEFAULT_SHADER_RESOLUTION, DeltaTime, DisplayObjectArray, type DisplayObjectArrayOptions, type DropShadowOptions, Entity, EntityDecorator, type ExplosionHit, FadeInContent, type FadeInContentOptions, FadeInStateAnimation, FocusingAnimation, Game, type GlowEffectOptions, type GlowOptions, type GlowingShapeDefinition, Graphics, type HitTestOptions, ImmovablePhysicsEntity, type InteractingBodyGroups, KeyboardService, type MapSizeDTO, type MaterialContactDefinition, type MaterialDefinition, type MenuCloseReason, MenuEntity, type MenuOptions, MenuUI, type MenuUINewMenuOpenBehavior, MenuView, MouseService, MouseTargetFocusService, MovableEntity, MovablePhysicsEntity, type PartialTextOptions, PathFinder, type PathFinderResult, type PhysicsBodyDTO, PhysicsEntity, type PhysicsEntityDefinition, type PhysicsExplosionOptions, PhysicsGateway, PhysicsShapeType, Placeholder, type PolygonDefinition, type PolygonShapeData, PositionConversionHelper, ROTATIONAL_SPEED_LIMIT, type RayCast, type RayCastHit, ReAnimateHandlingType, type RectangleShapeData, RichText, type RichTextOptions, type RichTextRectangleCut, type RichTextStyles, SPEED_LIMIT, Scene, SceneDecorator, ScrollAreaUI, ScrollDirection, type ScrollInContentOptions, ScrollMaskUI, Service, ServiceDecorator, type SetParentOptions, type ShapeDefinition, SingletonEntity, SlideInContent, SlideInContentByIndex, SlideStateAnimation, SlideStateAnimationState, Sprite, type SpriteDefinition, StateAnimation, type StateAnimationOptions, Text, type TextAlignment, type TextOptions, UpdatableContainer, UpdateCycle, VectorFieldPathFinder, VectorSet, View, ViewDecorator, type ViewDecoratorMeta };
996
+ export { AnimationFlicker, AnimationInterpolationFunctions, type AnimationOptions, Animations, AnimationsCompletionHandlingType, Animator, type AnimatorAnimation, type AssetDefinition, BORDER_MATERIAL_NAME, BardLegendsHardReset, BlendMode, type BorderProperties, Camera, CameraGateway, type CircleShapeData, ClosestAvailableSpaceHelper, type CollisionDetails, type CollisionReport, Container, ContainerEventType, ControllerDecorator, type ControllerDecoratorMeta, ControllerLink, type CreateDashedLineOptions, type CreatePhysicsWorldRequestDTO, Cursor, DEFAULT_SHADER_RESOLUTION, DeltaTime, DisplayObjectArray, type DisplayObjectArrayOptions, type DropShadowOptions, Entity, EntityDecorator, type ExplosionHit, FadeInContent, type FadeInContentOptions, FadeInStateAnimation, FocusingAnimation, Game, type GlowEffectOptions, type GlowOptions, type GlowingShapeDefinition, Graphics, type HitTestOptions, ImmovablePhysicsEntity, type InteractingBodyGroups, KeyboardService, type MapSizeDTO, type MaterialContactDefinition, type MaterialDefinition, MenuEntity, type MenuOptions, MenuUI, MenuView, MouseService, MouseTargetFocusService, MovableEntity, MovablePhysicsEntity, type PartialTextOptions, PathFinder, type PathFinderResult, type PhysicsBodyDTO, PhysicsEntity, type PhysicsEntityDefinition, type PhysicsExplosionOptions, PhysicsGateway, PhysicsShapeType, Placeholder, type PolygonDefinition, type PolygonShapeData, PositionConversionHelper, ROTATIONAL_SPEED_LIMIT, type RayCast, type RayCastHit, ReAnimateHandlingType, type RectangleShapeData, RichText, type RichTextOptions, type RichTextRectangleCut, type RichTextStyles, SPEED_LIMIT, Scene, SceneDecorator, ScrollAreaUI, ScrollDirection, type ScrollInContentOptions, ScrollMaskUI, Service, ServiceDecorator, type SetParentOptions, type ShapeDefinition, SingletonEntity, SlideInContent, SlideInContentByIndex, SlideStateAnimation, SlideStateAnimationState, Sprite, type SpriteDefinition, StateAnimation, type StateAnimationOptions, Text, type TextAlignment, type TextOptions, UpdatableContainer, UpdateCycle, VectorFieldPathFinder, VectorSet, View, ViewDecorator, type ViewDecoratorMeta };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as actions_lib from 'actions-lib';
2
2
  import { IDAttachable, Attachable, SingleEvent, Sequence, SingleNotifier, Notifier, Reducer, Variable, Action } from 'actions-lib';
3
- import { Vector, Radian, Rectangle, Vec2, RGBColor, TypeValuePair, Grid, GridNeighborType, Line } from 'helpers-lib';
3
+ import { Vector, Radian, Rectangle, Vec2, RGBColor, Grid, GridNeighborType, Line } from 'helpers-lib';
4
4
  import * as Pixi from 'pixi.js';
5
5
 
6
6
  declare class ControllerLink {
@@ -26,9 +26,17 @@ declare abstract class Entity extends IDAttachable {
26
26
  attachToRoot(): this;
27
27
  }
28
28
 
29
+ type SingletonEntityClassType<T extends SingletonEntity = SingletonEntity> = (new (...args: any[]) => T) & {
30
+ id: number;
31
+ };
29
32
  declare abstract class SingletonEntity extends Entity {
30
- static getInstance<T extends SingletonEntity>(this: EntityClassType<T>): T | undefined;
31
- static getInstanceOrFail<T extends SingletonEntity>(this: EntityClassType<T>): T;
33
+ static getInstanceAsync<T extends SingletonEntity>(this: SingletonEntityClassType<T>): SingleEvent<T>;
34
+ static continuesSubscription<T extends SingletonEntity>(this: SingletonEntityClassType<T>): Sequence<{
35
+ type: 'open' | 'close';
36
+ value: T;
37
+ }>;
38
+ static getInstance<T extends SingletonEntity>(this: SingletonEntityClassType<T>): T | undefined;
39
+ static getInstanceOrFail<T extends SingletonEntity>(this: SingletonEntityClassType<T>): T;
32
40
  constructor();
33
41
  }
34
42
 
@@ -41,6 +49,8 @@ type SceneClassType = new (...services: unknown[]) => Scene<unknown, unknown>;
41
49
  type SceneInput<T> = T extends Scene<infer I, any> ? I : never;
42
50
  declare function SceneDecorator(): (SceneClass: SceneClassType) => any;
43
51
  declare abstract class Scene<InputType, OutputType> extends IDAttachable {
52
+ static readonly isTransitioning: actions_lib.Notifier<boolean>;
53
+ static getIsTransitioning(this: typeof Scene): boolean;
44
54
  static readonly activeScene: actions_lib.Notifier<Scene<unknown, unknown> | undefined>;
45
55
  static getActiveScene(this: typeof Scene): Scene<unknown, unknown> | undefined;
46
56
  static getActiveSceneOrFail(this: typeof Scene): Scene<unknown, unknown>;
@@ -418,48 +428,42 @@ declare class DisplayObjectArray<T> extends Container {
418
428
  set(items: readonly T[]): void;
419
429
  }
420
430
 
421
- type MenuUINewMenuOpenBehavior = 'close' | 'temporarilyDisappear' | 'stayInBackground';
422
- type MenuCloseReason<OutputType = undefined> = TypeValuePair<{
423
- backgroundClick: undefined;
424
- newMenuOpened: undefined;
425
- withValue: OutputType;
426
- }>;
427
431
  interface MenuOptions {
428
- readonly onNewMenuOpen: MenuUINewMenuOpenBehavior;
429
432
  readonly closeOnBackgroundClick: boolean;
430
433
  readonly appearAnimationDuration: number;
431
434
  readonly backgroundDarkeningRatio: number;
432
435
  }
433
- declare class MenuUI<OutputType = undefined> extends Container {
436
+ declare class MenuUI extends Container {
437
+ static isAnyMenuTransitioning: actions_lib.Notifier<boolean>;
438
+ static getIsAnyMenuTransitioning(this: typeof MenuUI): boolean;
434
439
  readonly onCreate: actions_lib.SingleNotifier<void>;
435
440
  readonly onOpen: actions_lib.SingleNotifier<void>;
436
- readonly onClose: actions_lib.SingleNotifier<MenuCloseReason<OutputType>>;
441
+ readonly onClose: actions_lib.SingleNotifier<void>;
437
442
  constructor(windowSprite: string, partialOptions: Partial<MenuOptions>);
438
443
  getBoundingMask(): Sprite;
439
- close(output: MenuCloseReason<OutputType>): SingleEvent<MenuCloseReason<OutputType>>;
444
+ close(): SingleEvent;
440
445
  }
441
446
 
442
447
  interface MenuEntityOptions {
443
- readonly onNewMenuOpen: MenuUINewMenuOpenBehavior;
444
448
  readonly closeOnBackgroundClick: boolean;
445
449
  }
446
- declare class MenuEntity<OutputType = undefined> extends SingletonEntity {
450
+ declare class MenuEntity extends SingletonEntity {
447
451
  constructor(partialOptions: Partial<MenuEntityOptions>);
448
452
  onCreate(): SingleEvent;
449
453
  onOpen(): SingleEvent;
450
- onClose(): SingleEvent<MenuCloseReason<OutputType>>;
451
- close(...args: undefined extends OutputType ? (OutputType extends undefined ? [] : [OutputType]) : [OutputType]): SingleEvent<MenuCloseReason<OutputType>>;
454
+ onClose(): SingleEvent;
455
+ close(): SingleEvent;
452
456
  }
453
457
 
454
458
  interface MenuViewOptions {
455
459
  readonly appearAnimationDuration: number;
456
460
  readonly backgroundDarkeningRatio: number;
457
461
  }
458
- declare class MenuView<OutputType = void> extends View {
462
+ declare class MenuView extends View {
459
463
  readonly onCreate: SingleNotifier<Container>;
460
464
  readonly onOpen: SingleNotifier;
461
- readonly onClose: SingleNotifier<MenuCloseReason<OutputType>>;
462
- constructor(entity: MenuEntity<OutputType>, windowSprite: string, partialOptions: Partial<MenuViewOptions>);
465
+ readonly onClose: SingleNotifier;
466
+ constructor(entity: MenuEntity, windowSprite: string, partialOptions: Partial<MenuViewOptions>);
463
467
  }
464
468
 
465
469
  interface ScrollAreaUIOptions {
@@ -989,4 +993,4 @@ declare class PhysicsGateway {
989
993
  printPathfindingTestGrid(physicsWorldID: number, testLayerID: number, target: Vector | number, physicsBodyGroup: PhysicsBodyGroup, area: Rectangle, gridCellSize?: number): void;
990
994
  }
991
995
 
992
- export { AnimationFlicker, AnimationInterpolationFunctions, type AnimationOptions, Animations, AnimationsCompletionHandlingType, Animator, type AnimatorAnimation, type AssetDefinition, BORDER_MATERIAL_NAME, BardLegendsHardReset, BlendMode, type BorderProperties, Camera, CameraGateway, type CircleShapeData, ClosestAvailableSpaceHelper, type CollisionDetails, type CollisionReport, Container, ContainerEventType, ControllerDecorator, type ControllerDecoratorMeta, ControllerLink, type CreateDashedLineOptions, type CreatePhysicsWorldRequestDTO, Cursor, DEFAULT_SHADER_RESOLUTION, DeltaTime, DisplayObjectArray, type DisplayObjectArrayOptions, type DropShadowOptions, Entity, EntityDecorator, type ExplosionHit, FadeInContent, type FadeInContentOptions, FadeInStateAnimation, FocusingAnimation, Game, type GlowEffectOptions, type GlowOptions, type GlowingShapeDefinition, Graphics, type HitTestOptions, ImmovablePhysicsEntity, type InteractingBodyGroups, KeyboardService, type MapSizeDTO, type MaterialContactDefinition, type MaterialDefinition, type MenuCloseReason, MenuEntity, type MenuOptions, MenuUI, type MenuUINewMenuOpenBehavior, MenuView, MouseService, MouseTargetFocusService, MovableEntity, MovablePhysicsEntity, type PartialTextOptions, PathFinder, type PathFinderResult, type PhysicsBodyDTO, PhysicsEntity, type PhysicsEntityDefinition, type PhysicsExplosionOptions, PhysicsGateway, PhysicsShapeType, Placeholder, type PolygonDefinition, type PolygonShapeData, PositionConversionHelper, ROTATIONAL_SPEED_LIMIT, type RayCast, type RayCastHit, ReAnimateHandlingType, type RectangleShapeData, RichText, type RichTextOptions, type RichTextRectangleCut, type RichTextStyles, SPEED_LIMIT, Scene, SceneDecorator, ScrollAreaUI, ScrollDirection, type ScrollInContentOptions, ScrollMaskUI, Service, ServiceDecorator, type SetParentOptions, type ShapeDefinition, SingletonEntity, SlideInContent, SlideInContentByIndex, SlideStateAnimation, SlideStateAnimationState, Sprite, type SpriteDefinition, StateAnimation, type StateAnimationOptions, Text, type TextAlignment, type TextOptions, UpdatableContainer, UpdateCycle, VectorFieldPathFinder, VectorSet, View, ViewDecorator, type ViewDecoratorMeta };
996
+ export { AnimationFlicker, AnimationInterpolationFunctions, type AnimationOptions, Animations, AnimationsCompletionHandlingType, Animator, type AnimatorAnimation, type AssetDefinition, BORDER_MATERIAL_NAME, BardLegendsHardReset, BlendMode, type BorderProperties, Camera, CameraGateway, type CircleShapeData, ClosestAvailableSpaceHelper, type CollisionDetails, type CollisionReport, Container, ContainerEventType, ControllerDecorator, type ControllerDecoratorMeta, ControllerLink, type CreateDashedLineOptions, type CreatePhysicsWorldRequestDTO, Cursor, DEFAULT_SHADER_RESOLUTION, DeltaTime, DisplayObjectArray, type DisplayObjectArrayOptions, type DropShadowOptions, Entity, EntityDecorator, type ExplosionHit, FadeInContent, type FadeInContentOptions, FadeInStateAnimation, FocusingAnimation, Game, type GlowEffectOptions, type GlowOptions, type GlowingShapeDefinition, Graphics, type HitTestOptions, ImmovablePhysicsEntity, type InteractingBodyGroups, KeyboardService, type MapSizeDTO, type MaterialContactDefinition, type MaterialDefinition, MenuEntity, type MenuOptions, MenuUI, MenuView, MouseService, MouseTargetFocusService, MovableEntity, MovablePhysicsEntity, type PartialTextOptions, PathFinder, type PathFinderResult, type PhysicsBodyDTO, PhysicsEntity, type PhysicsEntityDefinition, type PhysicsExplosionOptions, PhysicsGateway, PhysicsShapeType, Placeholder, type PolygonDefinition, type PolygonShapeData, PositionConversionHelper, ROTATIONAL_SPEED_LIMIT, type RayCast, type RayCastHit, ReAnimateHandlingType, type RectangleShapeData, RichText, type RichTextOptions, type RichTextRectangleCut, type RichTextStyles, SPEED_LIMIT, Scene, SceneDecorator, ScrollAreaUI, ScrollDirection, type ScrollInContentOptions, ScrollMaskUI, Service, ServiceDecorator, type SetParentOptions, type ShapeDefinition, SingletonEntity, SlideInContent, SlideInContentByIndex, SlideStateAnimation, SlideStateAnimationState, Sprite, type SpriteDefinition, StateAnimation, type StateAnimationOptions, Text, type TextAlignment, type TextOptions, UpdatableContainer, UpdateCycle, VectorFieldPathFinder, VectorSet, View, ViewDecorator, type ViewDecoratorMeta };