@sepveneto/dao 0.1.8 → 0.2.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/app/Application.d.ts +2 -2
- package/dist/assets/Assets.d.ts +4 -4
- package/dist/assets/loader/Loader.d.ts +2 -2
- package/dist/dao.cjs +1 -1
- package/dist/dao.cjs.map +1 -1
- package/dist/dao.js +1945 -1670
- package/dist/dao.js.map +1 -1
- package/dist/events/FederatedEvent.d.ts +2 -2
- package/dist/events/FederatedEventMap.d.ts +2 -2
- package/dist/main.d.ts +5 -5
- package/dist/maths/Bounds.d.ts +6 -3
- package/dist/maths/Matrix.d.ts +6 -10
- package/dist/maths/Point.d.ts +1 -1
- package/dist/maths/getLocalBounds.d.ts +4 -0
- package/dist/maths/index.d.ts +2 -2
- package/dist/maths/shapes/Polygon.d.ts +5 -2
- package/dist/maths/shapes/Rectangle.d.ts +3 -1
- package/dist/maths/utils.d.ts +17 -0
- package/dist/renderer/CanvasPool.d.ts +2 -2
- package/dist/renderer/RenderPipe.d.ts +6 -0
- package/dist/renderer/index.d.ts +15 -15
- package/dist/renderer/texture/RenderTexture.d.ts +1 -1
- package/dist/renderer/texture/Texture.d.ts +1 -1
- package/dist/renderer/texture/TextureSource.d.ts +4 -3
- package/dist/scene/ViewContainer.d.ts +3 -3
- package/dist/scene/batcher/Batcher.d.ts +1 -1
- package/dist/scene/batcher/BatcherPipe.d.ts +6 -6
- package/dist/scene/container/Container.d.ts +20 -20
- package/dist/scene/container/RenderGroup.d.ts +3 -3
- package/dist/scene/container/__tests__/DummyEffect.d.ts +1 -1
- package/dist/scene/container/__tests__/DummyView.d.ts +1 -1
- package/dist/scene/container/mixins/childrenHelperMixin.d.ts +1 -1
- package/dist/scene/container/mixins/effectMixin.d.ts +3 -3
- package/dist/scene/container/mixins/measureMixin.d.ts +1 -1
- package/dist/scene/graphics/Graphics.d.ts +7 -2
- package/dist/scene/graphics/GraphicsContext.d.ts +18 -32
- package/dist/scene/graphics/GraphicsPipe.d.ts +5 -3
- package/dist/scene/graphics/__tests__/Graphics.Bounds.test.d.ts +1 -0
- package/dist/scene/graphics/__tests__/Graphics.test.d.ts +1 -0
- package/dist/scene/graphics/__tests__/bounds.test.d.ts +1 -0
- package/dist/scene/graphics/path/GraphicsPath.d.ts +2 -2
- package/dist/scene/graphics/path/ShapePath.d.ts +5 -3
- package/dist/scene/graphics/utils/FillTypes.d.ts +28 -0
- package/dist/scene/graphics/utils/convertInputToStyle.d.ts +15 -0
- package/dist/scene/graphics/utils/getMaxMiterRatio.d.ts +11 -0
- package/dist/scene/index.d.ts +1 -1
- package/dist/scene/mask/StencilMask.d.ts +2 -2
- package/dist/scene/mask/StencilMaskPipe.d.ts +1 -1
- package/dist/scene/sprite/Sprite.d.ts +2 -2
- package/dist/scene/sprite/SpritePipe.d.ts +7 -2
- package/dist/scene/text/Text.d.ts +4 -4
- package/dist/scene/text/TextPipe.d.ts +5 -4
- package/dist/scene/text/TextStyle.d.ts +3 -3
- package/dist/scene/text/TextSystem.d.ts +1 -1
- package/dist/scene/text/utils.d.ts +18 -18
- package/dist/system/CanvasContextSystem.d.ts +1 -1
- package/dist/system/EventSystem.d.ts +10 -5
- package/dist/system/ExtractSystem.d.ts +2 -2
- package/dist/system/ViewSystem.d.ts +2 -2
- package/dist/ticker/Ticker.d.ts +243 -243
- package/dist/ticker/TickerListener.d.ts +5 -5
- package/dist/utils/color.d.ts +8 -0
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/pool/Pool.d.ts +17 -0
- package/dist/utils/pool/PoolGroup.d.ts +6 -0
- package/package.json +20 -26
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Bounds } from '../../../maths/Bounds';
|
|
2
2
|
import { ShapePath } from './ShapePath';
|
|
3
|
-
|
|
3
|
+
interface PathInstruction {
|
|
4
4
|
action: 'moveTo' | 'lineTo' | 'closePath' | 'bezierCurveTo' | 'rect';
|
|
5
5
|
data: any[];
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
7
|
export declare class GraphicsPath {
|
|
8
8
|
instructions: PathInstruction[];
|
|
9
9
|
private _dirty;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { GraphicsPath } from './GraphicsPath';
|
|
2
|
-
import { Bounds } from '../../../maths/Bounds';
|
|
3
2
|
import { Rectangle } from '../../../maths';
|
|
3
|
+
import { Bounds } from '../../../maths/Bounds';
|
|
4
4
|
export interface ShapePrimitive {
|
|
5
5
|
type: 'rectangle' | 'polygon';
|
|
6
|
-
|
|
6
|
+
contains: (x: number, y: number) => boolean;
|
|
7
|
+
strokeContains: (x: number, y: number, strokeWidth: number, alignment?: number) => boolean;
|
|
8
|
+
getBounds: (out?: Rectangle) => Rectangle;
|
|
7
9
|
}
|
|
8
10
|
export declare class ShapePath {
|
|
9
11
|
private _currentPoly;
|
|
@@ -20,7 +22,7 @@ export declare class ShapePath {
|
|
|
20
22
|
moveTo(x: number, y: number): this;
|
|
21
23
|
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number, smoothness?: number): this;
|
|
22
24
|
startPoly(x: number, y: number): this;
|
|
23
|
-
endPloy(closePath?: boolean):
|
|
25
|
+
endPloy(closePath?: boolean): this;
|
|
24
26
|
closePath(): this;
|
|
25
27
|
buildPath(): this;
|
|
26
28
|
get bounds(): Bounds;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
interface StrokeAttributes {
|
|
2
|
+
width?: number;
|
|
3
|
+
/**
|
|
4
|
+
* 1: inside
|
|
5
|
+
* 0.5: center
|
|
6
|
+
* 0: outside
|
|
7
|
+
*/
|
|
8
|
+
alignment?: number;
|
|
9
|
+
cap?: 'butt' | 'round' | 'square';
|
|
10
|
+
join?: 'round' | 'bevel' | 'miter';
|
|
11
|
+
miterLimit?: number;
|
|
12
|
+
pixelLine?: boolean;
|
|
13
|
+
alpha?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface FillStyle {
|
|
16
|
+
color?: string;
|
|
17
|
+
alpha?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface StrokeStyle extends FillStyle, StrokeAttributes {
|
|
20
|
+
}
|
|
21
|
+
export type ConvertedStrokeStyle = Required<StrokeAttributes & Omit<Required<FillStyle>, 'color'> & {
|
|
22
|
+
color: string;
|
|
23
|
+
}>;
|
|
24
|
+
export interface ConvertedFillStyle {
|
|
25
|
+
color: string;
|
|
26
|
+
alpha: number;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ConvertedFillStyle, ConvertedStrokeStyle, FillStyle, StrokeStyle } from './FillTypes';
|
|
2
|
+
export declare function toStrokeStyle(style: StrokeStyle, defaultStyle: ConvertedStrokeStyle): {
|
|
3
|
+
color: string;
|
|
4
|
+
alpha: number;
|
|
5
|
+
width: number;
|
|
6
|
+
alignment: number;
|
|
7
|
+
cap: "butt" | "round" | "square";
|
|
8
|
+
join: "round" | "bevel" | "miter";
|
|
9
|
+
miterLimit: number;
|
|
10
|
+
pixelLine: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function toFillStyle(value: FillStyle, defaultStyle: ConvertedFillStyle): {
|
|
13
|
+
color: string;
|
|
14
|
+
alpha: number;
|
|
15
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GraphicsPath } from '../path/GraphicsPath';
|
|
2
|
+
/**
|
|
3
|
+
* Computes the maximum miter ratio from polygon corner angles in a graphics path.
|
|
4
|
+
* The miter ratio determines how much the stroke padding must expand to contain miter joins
|
|
5
|
+
* at sharp angles. Returns a value >= 1, clamped by the miterLimit.
|
|
6
|
+
* @param path - The graphics path containing polygon shapes
|
|
7
|
+
* @param miterLimit - The maximum allowed miter ratio
|
|
8
|
+
* @returns The maximum miter ratio found in all polygon corners, clamped by miterLimit
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function getMaxMiterRatio(path: GraphicsPath, miterLimit: number): number;
|
package/dist/scene/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Container } from '../container/Container';
|
|
2
|
+
import { Mask } from '../container/mixins/effectMixin';
|
|
1
3
|
import { Instruction } from '../../renderer/InstructionSet';
|
|
2
4
|
import { Bounds } from '../../maths/Bounds';
|
|
3
|
-
import { Mask } from '../container/mixins/effectMixin';
|
|
4
|
-
import { Container } from '../container/Container';
|
|
5
5
|
export interface StencilMaskInstruction extends Instruction {
|
|
6
6
|
mask: StencilMask;
|
|
7
7
|
action: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { InstructionSet } from '../../renderer/InstructionSet';
|
|
2
1
|
import { MaskEffect } from '../container/mixins/effectMixin';
|
|
3
2
|
import { StencilMaskInstruction } from './StencilMask';
|
|
4
3
|
import { CanvasRenderer } from '../../renderer';
|
|
4
|
+
import { InstructionSet } from '../../renderer/InstructionSet';
|
|
5
5
|
export declare class StencilMaskPipe {
|
|
6
6
|
static desc: {
|
|
7
7
|
readonly name: "stencilMask";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { ContainerOptions } from '..';
|
|
1
2
|
import { Vector2 } from '../../maths';
|
|
2
|
-
import { ViewContainer } from '../ViewContainer';
|
|
3
3
|
import { Texture } from '../../renderer/texture/Texture';
|
|
4
|
-
import {
|
|
4
|
+
import { ViewContainer } from '../ViewContainer';
|
|
5
5
|
export interface SpriteOptions extends ContainerOptions {
|
|
6
6
|
texture?: Texture;
|
|
7
7
|
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { CanvasRenderer } from '../../renderer';
|
|
2
1
|
import { Sprite } from './Sprite';
|
|
2
|
+
import { CanvasRenderer } from '../../renderer';
|
|
3
3
|
import { InstructionSet } from '../../renderer/InstructionSet';
|
|
4
|
-
|
|
4
|
+
import { RenderPipe } from '../../renderer/RenderPipe';
|
|
5
|
+
export declare class SpritePipe implements RenderPipe<Sprite> {
|
|
5
6
|
private _renderer;
|
|
6
7
|
static desc: {
|
|
7
8
|
readonly name: "sprite";
|
|
8
9
|
};
|
|
9
10
|
constructor(renderer: CanvasRenderer);
|
|
10
11
|
addRenderable(sprite: Sprite, instructionSet: InstructionSet): void;
|
|
12
|
+
private _updateBatchableSprite;
|
|
13
|
+
validateRenderable(sprite: Sprite): boolean;
|
|
14
|
+
private _getRuntimeSprite;
|
|
15
|
+
private _initCacheSprite;
|
|
11
16
|
destroy(): void;
|
|
12
17
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { ContainerOptions } from '..';
|
|
2
|
+
import { DestroyOptions } from '../container/destroyTypes';
|
|
3
|
+
import { TextStyleOptions, TextStyle } from './TextStyle';
|
|
4
|
+
import { Vector2 } from '../../maths';
|
|
1
5
|
import { ObservablePoint } from '../../maths/Point';
|
|
2
6
|
import { ViewContainer } from '../ViewContainer';
|
|
3
|
-
import { Vector2 } from '../../maths';
|
|
4
|
-
import { TextStyle, TextStyleOptions } from './TextStyle';
|
|
5
|
-
import { DestroyOptions } from '../container/destroyTypes';
|
|
6
|
-
import { ContainerOptions } from '..';
|
|
7
7
|
export interface TextOptions extends ContainerOptions {
|
|
8
8
|
text?: string | number;
|
|
9
9
|
style?: TextStyleOptions;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { CanvasRenderer } from '../../renderer';
|
|
2
1
|
import { Text } from './Text';
|
|
3
|
-
import { InstructionSet } from '../../renderer/InstructionSet';
|
|
4
2
|
import { Texture } from '../../main';
|
|
5
|
-
|
|
3
|
+
import { CanvasRenderer } from '../../renderer';
|
|
4
|
+
import { InstructionSet } from '../../renderer/InstructionSet';
|
|
5
|
+
import { RenderPipe } from '../../renderer/RenderPipe';
|
|
6
|
+
export declare class TextPipe implements RenderPipe<Text> {
|
|
6
7
|
static desc: {
|
|
7
8
|
readonly name: "text";
|
|
8
9
|
};
|
|
@@ -17,7 +18,7 @@ export declare class TextPipe {
|
|
|
17
18
|
roundPixels: number;
|
|
18
19
|
renderable: Text;
|
|
19
20
|
texture: Texture | null;
|
|
20
|
-
destroy
|
|
21
|
+
destroy(): void;
|
|
21
22
|
};
|
|
22
23
|
private _getRuntimeText;
|
|
23
24
|
private _updateRuntimeText;
|
|
@@ -333,7 +333,7 @@ export type TextStyleWhiteSpace = 'normal' | 'pre' | 'pre-line';
|
|
|
333
333
|
* @category text
|
|
334
334
|
* @standard
|
|
335
335
|
*/
|
|
336
|
-
export
|
|
336
|
+
export interface TextDropShadow {
|
|
337
337
|
/**
|
|
338
338
|
* The opacity of the drop shadow.
|
|
339
339
|
* - Range: 0 to 1
|
|
@@ -399,7 +399,7 @@ export type TextDropShadow = {
|
|
|
399
399
|
* @default 5
|
|
400
400
|
*/
|
|
401
401
|
distance: number;
|
|
402
|
-
}
|
|
402
|
+
}
|
|
403
403
|
/**
|
|
404
404
|
* Constructor options used for `TextStyle` instances. Defines the visual appearance and layout of text.
|
|
405
405
|
* @example
|
|
@@ -607,7 +607,7 @@ export declare class TextStyle {
|
|
|
607
607
|
set fill(value: string);
|
|
608
608
|
get align(): TextStyleAlign;
|
|
609
609
|
set align(value: TextStyleAlign);
|
|
610
|
-
get
|
|
610
|
+
get wordWrap(): boolean;
|
|
611
611
|
set wordWrap(value: boolean);
|
|
612
612
|
get fontFamily(): string | string[];
|
|
613
613
|
set fontFamily(value: string | string[]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CanvasRenderer } from '../../renderer';
|
|
2
1
|
import { Text } from './Text';
|
|
3
2
|
import { TextStyle } from './TextStyle';
|
|
3
|
+
import { CanvasRenderer } from '../../renderer';
|
|
4
4
|
import { Texture } from '../../renderer/texture/Texture';
|
|
5
5
|
import { TextureSource } from '../../renderer/texture/TextureSource';
|
|
6
6
|
export declare class TextSystem {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CanvasAndContext } from '../../renderer/CanvasPool';
|
|
2
1
|
import { TextStyle } from './TextStyle';
|
|
2
|
+
import { CanvasAndContext } from '../../renderer/CanvasPool';
|
|
3
3
|
import { Rectangle } from '../../maths/shapes/Rectangle';
|
|
4
4
|
export declare const NEWLINE_MATCH_REGEX: RegExp;
|
|
5
5
|
/**
|
|
@@ -27,9 +27,9 @@ export declare class TextMetrics {
|
|
|
27
27
|
maxLineWidth: number;
|
|
28
28
|
fontProperties: FontMetrics;
|
|
29
29
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
* String used for calculate font metrics.
|
|
31
|
+
* These characters are all tall to help calculate the height required for text.
|
|
32
|
+
*/
|
|
33
33
|
static METRICS_STRING: string;
|
|
34
34
|
/** Baseline symbol for calculate font metrics. */
|
|
35
35
|
static BASELINE_SYMBOL: string;
|
|
@@ -44,22 +44,22 @@ export declare class TextMetrics {
|
|
|
44
44
|
static measureText(text: string, style: TextStyle): TextMetrics;
|
|
45
45
|
static _measureText(text: string, letterSpacing: number): number;
|
|
46
46
|
/**
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
* A Unicode "character", or "grapheme cluster", can be composed of multiple Unicode code points,
|
|
48
|
+
* such as letters with diacritical marks (e.g. `'\u0065\u0301'`, letter e with acute)
|
|
49
|
+
* or emojis with modifiers (e.g. `'\uD83E\uDDD1\u200D\uD83D\uDCBB'`, technologist).
|
|
50
|
+
* The new `Intl.Segmenter` API in ES2022 can split the string into grapheme clusters correctly. If it is not available,
|
|
51
|
+
* PixiJS will fallback to use the iterator of String, which can only spilt the string into code points.
|
|
52
|
+
* If you want to get full functionality in environments that don't support `Intl.Segmenter` (such as Firefox),
|
|
53
|
+
* you can use other libraries such as [grapheme-splitter]{@link https://www.npmjs.com/package/grapheme-splitter}
|
|
54
|
+
* or [graphemer]{@link https://www.npmjs.com/package/graphemer} to create a polyfill. Since these libraries can be
|
|
55
|
+
* relatively large in size to handle various Unicode grapheme clusters properly, PixiJS won't use them directly.
|
|
56
|
+
*/
|
|
57
57
|
static graphemeSegmenter: (s: string) => string[];
|
|
58
58
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
* Calculates the ascent, descent and fontSize of a given font-style
|
|
60
|
+
* @param font - String representing the style of the font
|
|
61
|
+
* @returns Font properties object
|
|
62
|
+
*/
|
|
63
63
|
static measureFont(font: string): FontMetrics;
|
|
64
64
|
}
|
|
65
65
|
export declare function createCanvas(width?: number, height?: number): HTMLCanvasElement;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { Container } from '../scene/container/Container';
|
|
2
1
|
import { CanvasRenderer } from '../renderer';
|
|
3
|
-
import { Vector2 } from '../maths';
|
|
4
2
|
import { FederatedEventMap } from '../events/FederatedEventMap';
|
|
3
|
+
import { Container } from '../scene/container/Container';
|
|
5
4
|
import { FederatedEvent } from '../events/FederatedEvent';
|
|
5
|
+
import { Vector2 } from '../maths';
|
|
6
6
|
export type EventMode = 'none' | 'static' | 'passive';
|
|
7
|
-
|
|
8
|
-
fn(...args: any[])
|
|
7
|
+
interface EmitterListener {
|
|
8
|
+
fn: (...args: any[]) => any;
|
|
9
9
|
context: any;
|
|
10
10
|
once: boolean;
|
|
11
|
-
}
|
|
11
|
+
}
|
|
12
12
|
export type EmitterListeners = Record<string, EmitterListener | EmitterListener[]>;
|
|
13
13
|
export declare class EventSystem {
|
|
14
14
|
renderer: CanvasRenderer;
|
|
15
15
|
domElement: HTMLElement;
|
|
16
16
|
rootTarget: Container;
|
|
17
17
|
resolution: number;
|
|
18
|
+
private eventPool;
|
|
18
19
|
private readonly _allInteractiveElements;
|
|
19
20
|
private _hitElements;
|
|
20
21
|
private readonly _rootPointerEvent;
|
|
@@ -43,6 +44,10 @@ export declare class EventSystem {
|
|
|
43
44
|
_onPointerUp(nativeEvent: PointerEvent): void;
|
|
44
45
|
_isInteractive(eventMode: EventMode): eventMode is "static";
|
|
45
46
|
private _bootstrapEvent;
|
|
47
|
+
allocateEvent<T extends FederatedEvent>(constructor: {
|
|
48
|
+
new (ctx: EventSystem): T;
|
|
49
|
+
}): T;
|
|
50
|
+
private freeEvent;
|
|
46
51
|
createPointEvent(from: FederatedEvent, type?: string, target?: Container): FederatedEvent;
|
|
47
52
|
clonePointEvent(from: FederatedEvent, type?: string): FederatedEvent;
|
|
48
53
|
mapPositionToPoint(point: Vector2, x: number, y: number): Vector2;
|
|
@@ -2,11 +2,11 @@ import { Rectangle } from '../maths';
|
|
|
2
2
|
import { CanvasRenderer } from '../renderer';
|
|
3
3
|
import { RenderTexture } from '../renderer/texture/RenderTexture';
|
|
4
4
|
import { Container } from '../scene';
|
|
5
|
-
export
|
|
5
|
+
export interface GenerateTextureOptions {
|
|
6
6
|
target: Container;
|
|
7
7
|
frame?: Rectangle;
|
|
8
8
|
resolution?: number;
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
10
|
export declare class ExtractSystem {
|
|
11
11
|
static desc: {
|
|
12
12
|
readonly name: "extract";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Rectangle } from '../maths';
|
|
2
2
|
import { Texture } from '../renderer/texture/Texture';
|
|
3
3
|
import { CanvasSource } from '../renderer/texture/TextureSource';
|
|
4
|
-
export
|
|
4
|
+
export interface ViewSystemOptions {
|
|
5
5
|
width?: number;
|
|
6
6
|
height?: number;
|
|
7
7
|
resolution?: number;
|
|
8
8
|
autoDensity?: boolean;
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
10
|
export declare class ViewSystem {
|
|
11
11
|
static desc: {
|
|
12
12
|
readonly name: "view";
|