@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,6 +1,6 @@
|
|
|
1
|
-
import { Vector2 } from '../maths';
|
|
2
1
|
import { Container } from '../scene';
|
|
3
2
|
import { EventSystem } from '../system';
|
|
3
|
+
import { Vector2 } from '../maths';
|
|
4
4
|
export declare class FederatedEvent {
|
|
5
5
|
readonly system: EventSystem;
|
|
6
6
|
target: Container;
|
|
@@ -11,6 +11,6 @@ export declare class FederatedEvent {
|
|
|
11
11
|
screen: Vector2;
|
|
12
12
|
path: Container[];
|
|
13
13
|
constructor(system: EventSystem);
|
|
14
|
-
getLocalPosition(container: Container, points?: Vector2):
|
|
14
|
+
getLocalPosition(container: Container, points?: Vector2): import('../maths').Vector2Data;
|
|
15
15
|
composedPath(): Container[];
|
|
16
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FederatedEvent } from './FederatedEvent';
|
|
2
|
-
export
|
|
2
|
+
export interface FederatedEventMap {
|
|
3
3
|
pointerdown: FederatedEvent;
|
|
4
4
|
pointermove: FederatedEvent;
|
|
5
5
|
globalpointermove: FederatedEvent;
|
|
@@ -7,7 +7,7 @@ export type FederatedEventMap = {
|
|
|
7
7
|
pointerupoutside: FederatedEvent;
|
|
8
8
|
pointerover: FederatedEvent;
|
|
9
9
|
pointerout: FederatedEvent;
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
11
|
export type FederatedEventEmitterTypes = {
|
|
12
12
|
[K in keyof FederatedEventMap]: [event: FederatedEventMap[K]];
|
|
13
13
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from './renderer';
|
|
2
1
|
export * from './app';
|
|
3
|
-
export * from './
|
|
2
|
+
export * from './assets/Assets';
|
|
4
3
|
export * from './maths';
|
|
5
4
|
export * from './maths';
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './renderer/texture/Texture';
|
|
5
|
+
export * from './renderer';
|
|
8
6
|
export * from './renderer/texture/RenderTexture';
|
|
9
|
-
export * from './
|
|
7
|
+
export * from './renderer/texture/Texture';
|
|
8
|
+
export * from './scene';
|
|
9
|
+
export * from './ticker';
|
package/dist/maths/Bounds.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Matrix } from './Matrix';
|
|
2
|
-
import { Container } from '../scene/container/Container';
|
|
3
2
|
import { Rectangle } from './shapes/Rectangle';
|
|
4
3
|
export declare class Bounds {
|
|
5
4
|
minX: number;
|
|
@@ -9,9 +8,13 @@ export declare class Bounds {
|
|
|
9
8
|
matrix: Matrix;
|
|
10
9
|
private _rectangle;
|
|
11
10
|
constructor(minX?: number, minY?: number, maxX?: number, maxY?: number);
|
|
11
|
+
get x(): number;
|
|
12
|
+
set x(value: number);
|
|
13
|
+
get y(): number;
|
|
14
|
+
set y(value: number);
|
|
12
15
|
clone(): Bounds;
|
|
13
16
|
isEmpty(): boolean;
|
|
14
|
-
clear():
|
|
17
|
+
clear(): this;
|
|
15
18
|
pad(paddingX: number, paddingY?: number): this;
|
|
16
19
|
get width(): number;
|
|
17
20
|
set width(value: number);
|
|
@@ -28,5 +31,5 @@ export declare class Bounds {
|
|
|
28
31
|
addFrame(x0: number, y0: number, x1: number, y1: number, matrix?: Matrix): void;
|
|
29
32
|
get rectangle(): Rectangle;
|
|
30
33
|
addBoundsMask(mask: Bounds): void;
|
|
34
|
+
containsPoint(x: number, y: number): boolean;
|
|
31
35
|
}
|
|
32
|
-
export declare function getLocalBounds(target: Container, bounds: Bounds, relativeMatrix?: Matrix): Bounds;
|
package/dist/maths/Matrix.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Vector2Data, Vector2 } from '.';
|
|
2
2
|
/**
|
|
3
3
|
* Two Pi.
|
|
4
4
|
* @type {number}
|
|
@@ -6,12 +6,6 @@ import { Vector2, Vector2Data } from '.';
|
|
|
6
6
|
* @standard
|
|
7
7
|
*/
|
|
8
8
|
export declare const PI_2: number;
|
|
9
|
-
/**
|
|
10
|
-
* The data structure that contains the position, scale, pivot, skew and rotation of an object.
|
|
11
|
-
* This is used by the {@link Matrix} class to decompose the matrix into its components.
|
|
12
|
-
* @category maths
|
|
13
|
-
* @advanced
|
|
14
|
-
*/
|
|
15
9
|
/**
|
|
16
10
|
* The data structure that contains the position, scale, pivot, skew and rotation of an object.
|
|
17
11
|
* This is used by the {@link Matrix} class to decompose the matrix into its components.
|
|
@@ -37,17 +31,19 @@ export declare class Matrix {
|
|
|
37
31
|
tx: number;
|
|
38
32
|
ty: number;
|
|
39
33
|
constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);
|
|
34
|
+
static get IDENTITY(): Matrix;
|
|
40
35
|
/**
|
|
41
36
|
* A * B
|
|
42
37
|
*/
|
|
43
38
|
static append(A: Matrix, B: Matrix): Matrix;
|
|
44
|
-
|
|
39
|
+
identity(): this;
|
|
40
|
+
apply(pos: Vector2Data, newPos?: Vector2Data): Vector2Data;
|
|
45
41
|
translate(x: number, y: number): this;
|
|
46
42
|
rotate(angle: number): this;
|
|
47
43
|
scale(x: number, y: number): this;
|
|
48
|
-
appendFrom(a: Matrix, b: Matrix):
|
|
44
|
+
appendFrom(a: Matrix, b: Matrix): this;
|
|
49
45
|
set(a: number, b: number, c: number, d: number, tx: number, ty: number): void;
|
|
50
|
-
applyInverse(pos: Vector2Data, newPos?:
|
|
46
|
+
applyInverse(pos: Vector2Data, newPos?: Vector2Data): Vector2Data;
|
|
51
47
|
copyFrom(matrix: Matrix): this;
|
|
52
48
|
/**
|
|
53
49
|
* Decomposes the matrix into its individual transform components.
|
package/dist/maths/Point.d.ts
CHANGED
package/dist/maths/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { ShapePrimitive } from '../../scene/graphics/path/ShapePath';
|
|
1
2
|
import { Rectangle } from './Rectangle';
|
|
2
|
-
export declare class Polygon {
|
|
3
|
+
export declare class Polygon implements ShapePrimitive {
|
|
3
4
|
points: number[];
|
|
4
5
|
closePath: boolean;
|
|
5
6
|
readonly type = "polygon";
|
|
6
7
|
construction(): void;
|
|
7
8
|
get lastX(): number;
|
|
8
9
|
get lastY(): number;
|
|
9
|
-
|
|
10
|
+
strokeContains(x: number, y: number, strokeWidth: number, alignment?: number): boolean;
|
|
11
|
+
contains(x: number, y: number): boolean;
|
|
12
|
+
getBounds(out?: Rectangle): Rectangle;
|
|
10
13
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { ShapePrimitive } from '../../scene/graphics/path/ShapePath';
|
|
2
|
+
export declare class Rectangle implements ShapePrimitive {
|
|
2
3
|
x: number;
|
|
3
4
|
y: number;
|
|
4
5
|
width: number;
|
|
@@ -7,5 +8,6 @@ export declare class Rectangle {
|
|
|
7
8
|
constructor(x?: number, y?: number, width?: number, height?: number);
|
|
8
9
|
getBounds(): Rectangle;
|
|
9
10
|
copyFrom(rectangle: Rectangle): Rectangle;
|
|
11
|
+
strokeContains(x: number, y: number, strokeWidth: number, alignment?: number): boolean;
|
|
10
12
|
contains(x: number, y: number): boolean;
|
|
11
13
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Bounds } from './Bounds';
|
|
2
|
+
import { Matrix } from './Matrix';
|
|
3
|
+
export declare const matrixPool: import('../utils/pool/Pool').Pool<Matrix, {}>;
|
|
4
|
+
export declare const boundsPool: import('../utils/pool/Pool').Pool<Bounds, {}>;
|
|
5
|
+
/**
|
|
6
|
+
* Calculates the squared distance from a point to a line segment defined by two endpoints.
|
|
7
|
+
* @param x - x coordinate of the point
|
|
8
|
+
* @param y - y coordinate of the point
|
|
9
|
+
* @param x1 - x coordinate of the first endpoint of the line segment
|
|
10
|
+
* @param y1 - y coordinate of the first endpoint of the line segment
|
|
11
|
+
* @param x2 - x coordinate of the second endpoint of the line segment
|
|
12
|
+
* @param y2 - y coordinate of the second endpoint of the line segment
|
|
13
|
+
* @returns The squared distance from the point to the line segment
|
|
14
|
+
* @category maths
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare function squaredDistanceToLineSegment(x: number, y: number, x1: number, y1: number, x2: number, y2: number): number;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InstructionSet } from './InstructionSet';
|
|
2
|
+
import { Renderable } from '../scene';
|
|
3
|
+
export interface RenderPipe<RENDERABLE = Renderable> {
|
|
4
|
+
validateRenderable: (renderable: RENDERABLE) => boolean;
|
|
5
|
+
addRenderable: (renderable: RENDERABLE, instructionSet: InstructionSet) => void;
|
|
6
|
+
}
|
package/dist/renderer/index.d.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { Matrix } from '../maths';
|
|
2
|
-
import {
|
|
3
|
-
import { Container } from '../scene/container/Container';
|
|
2
|
+
import { TextureSource } from './texture/TextureSource';
|
|
4
3
|
import { RenderGroup } from '../scene/container/RenderGroup';
|
|
4
|
+
import { ExtractSystemTypes } from '../utils/type';
|
|
5
|
+
import { default as EventEmitter } from 'eventemitter3';
|
|
6
|
+
import { BatchPipe } from '../scene/batcher';
|
|
7
|
+
import { Container } from '../scene/container/Container';
|
|
8
|
+
import { GraphicsPipe } from '../scene/graphics';
|
|
9
|
+
import { StencilMaskPipe } from '../scene/mask/StencilMaskPipe';
|
|
5
10
|
import { SpritePipe } from '../scene/sprite/SpritePipe';
|
|
6
11
|
import { TextPipe } from '../scene/text/TextPipe';
|
|
7
|
-
import { GraphicsPipe } from '../scene/graphics';
|
|
8
|
-
import { BatchPipe } from '../scene/batcher';
|
|
9
12
|
import { TextSystem } from '../scene/text/TextSystem';
|
|
10
|
-
import { StencilMaskPipe } from '../scene/mask/StencilMaskPipe';
|
|
11
|
-
import { ExtractSystemTypes } from '../utils/type';
|
|
12
|
-
import { ExtractSystem } from '../system/ExtractSystem';
|
|
13
13
|
import { CanvasContextSystem } from '../system/CanvasContextSystem';
|
|
14
|
-
import {
|
|
14
|
+
import { ExtractSystem } from '../system/ExtractSystem';
|
|
15
15
|
import { ViewSystem } from '../system/ViewSystem';
|
|
16
|
-
import {
|
|
16
|
+
import { EventSystem, RenderGroupSystem } from '../system';
|
|
17
17
|
declare const systems: (typeof ViewSystem | typeof EventSystem | typeof RenderGroupSystem | typeof TextSystem | typeof ExtractSystem | typeof CanvasContextSystem)[];
|
|
18
18
|
declare const pipes: (typeof GraphicsPipe | typeof BatchPipe | typeof TextPipe | typeof SpritePipe | typeof StencilMaskPipe)[];
|
|
19
|
-
|
|
19
|
+
interface RenderOptions {
|
|
20
20
|
clearColor?: string;
|
|
21
21
|
container: Container;
|
|
22
22
|
transform?: Matrix;
|
|
23
23
|
target?: {
|
|
24
24
|
source: TextureSource;
|
|
25
25
|
};
|
|
26
|
-
}
|
|
26
|
+
}
|
|
27
27
|
export type CanvasSystems = ExtractSystemTypes<typeof systems>;
|
|
28
28
|
export type CanvasPipes = ExtractSystemTypes<typeof pipes>;
|
|
29
29
|
export interface RendererOptions {
|
|
@@ -34,12 +34,12 @@ export interface RendererOptions {
|
|
|
34
34
|
autoStart?: boolean;
|
|
35
35
|
resolution?: number;
|
|
36
36
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
* Should the canvas be resized to preserve its screen width and height regardless
|
|
38
|
+
* of the resolution of the renderer.
|
|
39
|
+
*/
|
|
40
40
|
autoDensity?: boolean;
|
|
41
41
|
}
|
|
42
|
-
export interface CanvasRenderer extends CanvasSystems {
|
|
42
|
+
export interface CanvasRenderer extends CanvasSystems, EventEmitter {
|
|
43
43
|
}
|
|
44
44
|
export declare class CanvasRenderer extends EventEmitter {
|
|
45
45
|
uid: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { default as EventEmitter } from 'eventemitter3';
|
|
1
2
|
import { Rectangle } from '../../maths';
|
|
2
3
|
import { TextureSource } from './TextureSource';
|
|
3
|
-
import { default as EventEmitter } from 'eventemitter3';
|
|
4
4
|
export interface TextureOptions<TextureSourceType extends TextureSource = TextureSource> {
|
|
5
5
|
source?: TextureSourceType;
|
|
6
6
|
label?: string;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { default as EventEmitter } from 'eventemitter3';
|
|
2
|
-
export
|
|
2
|
+
export interface TextureSourceOptions<T extends Record<string, any> = any> {
|
|
3
3
|
label?: string;
|
|
4
4
|
resource?: T;
|
|
5
5
|
width?: number;
|
|
6
6
|
height?: number;
|
|
7
7
|
resolution?: number;
|
|
8
|
-
}
|
|
8
|
+
}
|
|
9
9
|
export declare class TextureSource<T extends Record<string, any> = any> extends EventEmitter {
|
|
10
10
|
static defaultOptions: {
|
|
11
11
|
resolution: number;
|
|
12
12
|
};
|
|
13
|
+
readonly uid: number;
|
|
13
14
|
label: string;
|
|
14
15
|
/**
|
|
15
16
|
* @internal
|
|
@@ -20,7 +21,7 @@ export declare class TextureSource<T extends Record<string, any> = any> extends
|
|
|
20
21
|
/** the pixel height of this texture source. This is the REAL pure number, not accounting resolution */
|
|
21
22
|
pixelHeight: number;
|
|
22
23
|
/**
|
|
23
|
-
|
|
24
|
+
*/
|
|
24
25
|
/**
|
|
25
26
|
* the width of this texture source, accounting for resolution
|
|
26
27
|
* eg pixelWidth 200, resolution 2, then width will be 100
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ContainerOptions, Container } from './container/Container';
|
|
2
|
+
import { DestroyOptions } from './container/destroyTypes';
|
|
3
3
|
import { Vector2 } from '../maths';
|
|
4
4
|
import { InstructionSet } from '../renderer/InstructionSet';
|
|
5
|
-
import {
|
|
5
|
+
import { Bounds } from '../maths/Bounds';
|
|
6
6
|
export type Renderable = ViewContainer;
|
|
7
7
|
export interface RuntimeData {
|
|
8
8
|
destroy: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InstructionSet } from '../../renderer/InstructionSet';
|
|
2
1
|
import { BatchableElement } from './BatcherPipe';
|
|
2
|
+
import { InstructionSet } from '../../renderer/InstructionSet';
|
|
3
3
|
export declare class Batcher {
|
|
4
4
|
renderPipeId: string;
|
|
5
5
|
elements: BatchableElement[];
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { CanvasRenderer } from '../../renderer';
|
|
2
|
-
import { Batcher } from './Batcher';
|
|
3
|
-
import { Matrix } from '../../maths';
|
|
4
|
-
import { Instruction, InstructionSet } from '../../renderer/InstructionSet';
|
|
5
1
|
import { Container } from '../../main';
|
|
2
|
+
import { Matrix } from '../../maths';
|
|
6
3
|
import { Bounds } from '../../maths/Bounds';
|
|
4
|
+
import { CanvasRenderer } from '../../renderer';
|
|
5
|
+
import { Instruction, InstructionSet } from '../../renderer/InstructionSet';
|
|
7
6
|
import { Texture } from '../../renderer/texture/Texture';
|
|
8
|
-
|
|
7
|
+
import { Batcher } from './Batcher';
|
|
8
|
+
export interface BatchableElement {
|
|
9
9
|
renderable: Container;
|
|
10
10
|
texture: Texture;
|
|
11
11
|
transform: Matrix;
|
|
12
12
|
bounds: Bounds;
|
|
13
13
|
roundPixels: number;
|
|
14
14
|
getColor: () => number;
|
|
15
|
-
}
|
|
15
|
+
}
|
|
16
16
|
export declare class Batch implements Instruction {
|
|
17
17
|
renderPipeId: string;
|
|
18
18
|
elements: BatchableElement[];
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Matrix, Rectangle, Vector2, Vector2Data } from '../../maths';
|
|
2
|
-
import { EventMode } from '../../system';
|
|
3
|
-
import { RenderGroup } from './RenderGroup';
|
|
4
|
-
import { ObservablePoint } from '../../maths/Point';
|
|
5
|
-
import { default as EventEmitter } from 'eventemitter3';
|
|
6
|
-
import { FederatedEventEmitterTypes } from '../../events/FederatedEventMap';
|
|
7
|
-
import { EffectMixin, EffectMixinConstructor } from './mixins/effectMixin';
|
|
8
|
-
import { InstructionSet } from '../../renderer/InstructionSet';
|
|
9
|
-
import { SortMixin, SortMixinConstructor } from './mixins/sortMixin';
|
|
10
|
-
import { MeasureMixin, MeasureMixinConstructor } from './mixins/measureMixin';
|
|
11
1
|
import { DestroyOptions } from './destroyTypes';
|
|
12
2
|
import { ChildrenHelperMixin } from './mixins/childrenHelperMixin';
|
|
3
|
+
import { EffectMixin, EffectMixinConstructor } from './mixins/effectMixin';
|
|
4
|
+
import { MeasureMixin, MeasureMixinConstructor } from './mixins/measureMixin';
|
|
13
5
|
import { OnRenderMixin, OnRenderMixinConstructor } from './mixins/onRenderMixin';
|
|
6
|
+
import { SortMixin, SortMixinConstructor } from './mixins/sortMixin';
|
|
7
|
+
import { FederatedEventEmitterTypes } from '../../events/FederatedEventMap';
|
|
8
|
+
import { Rectangle, Vector2Data, Matrix, Vector2 } from '../../maths';
|
|
9
|
+
import { InstructionSet } from '../../renderer/InstructionSet';
|
|
10
|
+
import { EventMode } from '../../system';
|
|
11
|
+
import { default as EventEmitter } from 'eventemitter3';
|
|
12
|
+
import { ObservablePoint } from '../../maths/Point';
|
|
13
|
+
import { RenderGroup } from './RenderGroup';
|
|
14
14
|
/** @internal */
|
|
15
15
|
export declare const UPDATE_COLOR = 1;
|
|
16
16
|
/** @internal */
|
|
@@ -20,16 +20,16 @@ export declare const UPDATE_VISIBLE = 4;
|
|
|
20
20
|
/** @internal */
|
|
21
21
|
export declare const UPDATE_TRANSFORM = 8;
|
|
22
22
|
export type ContainerChild = Container;
|
|
23
|
-
export
|
|
24
|
-
contains(x: number, y: number)
|
|
25
|
-
}
|
|
23
|
+
export interface IHitArea {
|
|
24
|
+
contains: (x: number, y: number) => boolean;
|
|
25
|
+
}
|
|
26
26
|
export interface ContainerEvents extends FederatedEventEmitterTypes {
|
|
27
27
|
destroyed: [container: Container];
|
|
28
28
|
visibleChanged: [visible: boolean];
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
interface AnyEvent {
|
|
31
31
|
[K: ({} & string) | ({} & symbol)]: any;
|
|
32
|
-
}
|
|
32
|
+
}
|
|
33
33
|
export interface ContainerOptions<C extends ContainerChild = ContainerChild> extends EffectMixinConstructor, SortMixinConstructor, MeasureMixinConstructor, OnRenderMixinConstructor {
|
|
34
34
|
label?: string;
|
|
35
35
|
isRenderGroup?: boolean;
|
|
@@ -139,8 +139,8 @@ export declare class Container<C extends ContainerChild = ContainerChild> extend
|
|
|
139
139
|
*/
|
|
140
140
|
groupColor: number;
|
|
141
141
|
/**
|
|
142
|
-
* @internal
|
|
143
142
|
* TODO: tint
|
|
143
|
+
* @internal
|
|
144
144
|
*/
|
|
145
145
|
localColor: number;
|
|
146
146
|
/**
|
|
@@ -203,10 +203,10 @@ export declare class Container<C extends ContainerChild = ContainerChild> extend
|
|
|
203
203
|
addChild<U extends C[]>(...children: U): U[0];
|
|
204
204
|
removeChild<U extends C[]>(...children: U): U[0] | undefined;
|
|
205
205
|
_onUpdate(point?: Vector2): void;
|
|
206
|
-
toGlobal(position: Vector2Data, skipUpdate?: boolean):
|
|
207
|
-
toLocal(position: Vector2Data, from?: Container, skipUpdate?: boolean):
|
|
208
|
-
getGlobalTransform(skipUpdate?: boolean): Matrix;
|
|
209
|
-
getGlobalPosition(skipUpdate?: boolean): Vector2;
|
|
206
|
+
toGlobal(position: Vector2Data, target?: Vector2Data, skipUpdate?: boolean): Vector2Data;
|
|
207
|
+
toLocal(position: Vector2Data, from?: Container, target?: Vector2Data, skipUpdate?: boolean): Vector2Data;
|
|
208
|
+
getGlobalTransform(matrix?: Matrix, skipUpdate?: boolean): Matrix;
|
|
209
|
+
getGlobalPosition(point?: Vector2, skipUpdate?: boolean): Vector2;
|
|
210
210
|
destroy(options?: DestroyOptions): void;
|
|
211
211
|
}
|
|
212
212
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Matrix } from '../../maths';
|
|
2
|
-
import { Container } from './Container';
|
|
3
|
-
import { InstructionSet } from '../../renderer/InstructionSet';
|
|
4
1
|
import { ViewContainer } from '../ViewContainer';
|
|
2
|
+
import { Container } from './Container';
|
|
5
3
|
import { CanvasRenderer } from '../../renderer';
|
|
4
|
+
import { Matrix } from '../../maths';
|
|
5
|
+
import { InstructionSet } from '../../renderer/InstructionSet';
|
|
6
6
|
export declare class RenderGroup {
|
|
7
7
|
worldTransform: Matrix;
|
|
8
8
|
localTransform: Matrix;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { MaskEffect } from '../mixins/effectMixin';
|
|
1
2
|
import { Vector2Data } from '../../../maths';
|
|
2
3
|
import { Bounds } from '../../../maths/Bounds';
|
|
3
|
-
import { MaskEffect } from '../mixins/effectMixin';
|
|
4
4
|
/** @internal */
|
|
5
5
|
export declare class DummyEffect implements MaskEffect {
|
|
6
6
|
pipe: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { ContainerOptions, Container } from '../Container';
|
|
1
2
|
import { Vector2 } from '../../../maths';
|
|
2
|
-
import { Container, ContainerOptions } from '../Container';
|
|
3
3
|
import { Bounds } from '../../../maths/Bounds';
|
|
4
4
|
interface DummyViewOptions extends ContainerOptions {
|
|
5
5
|
x?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Container, ContainerChild } from '../..';
|
|
2
2
|
export interface ChildrenHelperMixin<C = Container> {
|
|
3
|
-
removeChildren(beginIndex?: number, endIndex?: number)
|
|
3
|
+
removeChildren: (beginIndex?: number, endIndex?: number) => C[];
|
|
4
4
|
}
|
|
5
5
|
export declare const childrenHelperMixin: ChildrenHelperMixin<ContainerChild>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Container } from '../Container';
|
|
2
|
-
import { StencilMask } from '../../mask/StencilMask';
|
|
3
2
|
import { Graphics } from '../../graphics';
|
|
3
|
+
import { StencilMask } from '../../mask/StencilMask';
|
|
4
4
|
export type Mask = Graphics | null;
|
|
5
5
|
export type MaskEffect = StencilMask;
|
|
6
6
|
export interface EffectMixinConstructor {
|
|
@@ -10,7 +10,7 @@ export interface EffectMixin extends Required<EffectMixinConstructor> {
|
|
|
10
10
|
effects?: MaskEffect[];
|
|
11
11
|
_maskEffect?: MaskEffect;
|
|
12
12
|
mask: Mask;
|
|
13
|
-
addEffect(effect: MaskEffect)
|
|
14
|
-
removeEffect(effect: MaskEffect)
|
|
13
|
+
addEffect: (effect: MaskEffect) => void;
|
|
14
|
+
removeEffect: (effect: MaskEffect) => void;
|
|
15
15
|
}
|
|
16
16
|
export declare const effectMixin: Partial<Container>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ViewContainerOptions, ViewContainer } from '../ViewContainer';
|
|
2
|
+
import { FillStyle, StrokeStyle } from './utils/FillTypes';
|
|
2
3
|
import { GraphicsContext } from './GraphicsContext';
|
|
3
4
|
export interface GraphicsOptions extends ViewContainerOptions {
|
|
4
5
|
context?: GraphicsContext;
|
|
@@ -9,6 +10,10 @@ export declare class Graphics extends ViewContainer {
|
|
|
9
10
|
constructor(options?: GraphicsOptions | GraphicsContext);
|
|
10
11
|
get context(): GraphicsContext;
|
|
11
12
|
set context(value: GraphicsContext);
|
|
13
|
+
get fillStyle(): GraphicsContext['fillStyle'];
|
|
14
|
+
set fillStyle(value: FillStyle);
|
|
15
|
+
get strokeStyle(): GraphicsContext['strokeStyle'];
|
|
16
|
+
set strokeStyle(value: StrokeStyle);
|
|
12
17
|
setStrokeStyle(...args: Parameters<GraphicsContext['setStrokeStyle']>): this;
|
|
13
18
|
rect(x: number, y: number, w: number, h: number): this;
|
|
14
19
|
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cpy2y: number, x: number, y: number): this;
|
|
@@ -17,7 +22,7 @@ export declare class Graphics extends ViewContainer {
|
|
|
17
22
|
stroke(...args: Parameters<GraphicsContext['stroke']>): this;
|
|
18
23
|
beginPath(): this;
|
|
19
24
|
closePath(): this;
|
|
20
|
-
fill(
|
|
25
|
+
fill(styel?: FillStyle): this;
|
|
21
26
|
private _callContextMethod;
|
|
22
27
|
protected updateBounds(): void;
|
|
23
28
|
get bounds(): import('../../maths/Bounds').Bounds;
|
|
@@ -1,52 +1,33 @@
|
|
|
1
|
+
import { ConvertedFillStyle, ConvertedStrokeStyle, FillStyle, StrokeStyle } from './utils/FillTypes';
|
|
2
|
+
import { Vector2Data } from '../../maths';
|
|
1
3
|
import { Bounds } from '../../maths/Bounds';
|
|
2
4
|
import { GraphicsPath } from './path/GraphicsPath';
|
|
3
|
-
interface
|
|
4
|
-
width?: number;
|
|
5
|
-
/**
|
|
6
|
-
* 1: inside
|
|
7
|
-
* 0.5: center
|
|
8
|
-
* 0: outside
|
|
9
|
-
*/
|
|
10
|
-
alignment?: number;
|
|
11
|
-
cap?: 'butt' | 'round' | 'square';
|
|
12
|
-
join?: 'round' | 'bevel' | 'miter';
|
|
13
|
-
miterLimit?: number;
|
|
14
|
-
pixelLine?: boolean;
|
|
15
|
-
alpha?: number;
|
|
16
|
-
}
|
|
17
|
-
interface FillStyle {
|
|
18
|
-
color?: string;
|
|
19
|
-
}
|
|
20
|
-
type FillInstruction = {
|
|
5
|
+
interface FillInstruction {
|
|
21
6
|
action: 'fill';
|
|
22
7
|
data: {
|
|
23
8
|
style: ConvertedFillStyle;
|
|
24
9
|
path: GraphicsPath;
|
|
25
10
|
};
|
|
26
|
-
}
|
|
27
|
-
|
|
11
|
+
}
|
|
12
|
+
interface StrokeInstruction {
|
|
28
13
|
action: 'stroke';
|
|
29
14
|
data: {
|
|
30
15
|
style: ConvertedStrokeStyle;
|
|
31
16
|
path: GraphicsPath;
|
|
32
17
|
};
|
|
33
|
-
}
|
|
18
|
+
}
|
|
34
19
|
type GraphicsInstruction = FillInstruction | StrokeInstruction;
|
|
35
|
-
type ConvertedStrokeStyle = Required<StrokeAttributes & Omit<Required<FillStyle>, 'color'> & {
|
|
36
|
-
color: string;
|
|
37
|
-
}>;
|
|
38
|
-
type ConvertedFillStyle = {
|
|
39
|
-
color: string;
|
|
40
|
-
alpha: number;
|
|
41
|
-
};
|
|
42
20
|
export declare class GraphicsContext {
|
|
43
|
-
_strokeStyle: ConvertedStrokeStyle;
|
|
44
21
|
static defaultStrokeStyle: ConvertedStrokeStyle;
|
|
22
|
+
static defaultFillStyle: ConvertedFillStyle;
|
|
23
|
+
private _strokeStyle;
|
|
24
|
+
private _fillStyle;
|
|
45
25
|
private _activePath;
|
|
46
26
|
private _bounds;
|
|
47
27
|
private _boundsDirty;
|
|
28
|
+
private _tick;
|
|
48
29
|
instructions: GraphicsInstruction[];
|
|
49
|
-
setStrokeStyle(style:
|
|
30
|
+
setStrokeStyle(style: StrokeStyle): void;
|
|
50
31
|
clear(): this;
|
|
51
32
|
protected onUpdate(): void;
|
|
52
33
|
moveTo(x: number, y: number): this;
|
|
@@ -55,10 +36,15 @@ export declare class GraphicsContext {
|
|
|
55
36
|
rect(x: number, y: number, w: number, h: number): this;
|
|
56
37
|
beginPath(): this;
|
|
57
38
|
closePath(): this;
|
|
58
|
-
|
|
59
|
-
|
|
39
|
+
get fillStyle(): ConvertedFillStyle;
|
|
40
|
+
set fillStyle(value: FillStyle);
|
|
41
|
+
get strokeStyle(): ConvertedStrokeStyle;
|
|
42
|
+
set strokeStyle(value: StrokeStyle);
|
|
43
|
+
fill(style?: FillStyle): this;
|
|
44
|
+
stroke(style?: StrokeStyle): this;
|
|
60
45
|
private _initNextPathLocation;
|
|
61
46
|
get bounds(): Bounds;
|
|
47
|
+
containsPoint(point: Vector2Data): boolean;
|
|
62
48
|
clone(): GraphicsContext;
|
|
63
49
|
}
|
|
64
50
|
export {};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { CanvasRenderer } from '../../renderer';
|
|
2
1
|
import { Graphics } from './Graphics';
|
|
3
|
-
import { InstructionSet } from '../../renderer/InstructionSet';
|
|
4
2
|
import { ShapePrimitive } from './path/ShapePath';
|
|
5
|
-
|
|
3
|
+
import { CanvasRenderer } from '../../renderer';
|
|
4
|
+
import { InstructionSet } from '../../renderer/InstructionSet';
|
|
5
|
+
import { RenderPipe } from '../../renderer/RenderPipe';
|
|
6
|
+
export declare class GraphicsPipe implements RenderPipe<Graphics> {
|
|
6
7
|
private _renderer;
|
|
7
8
|
static desc: {
|
|
8
9
|
readonly name: "graphics";
|
|
9
10
|
};
|
|
10
11
|
constructor(renderer: CanvasRenderer);
|
|
11
12
|
addRenderable(graphics: Graphics, instructionSet: InstructionSet): void;
|
|
13
|
+
validateRenderable(_renderable: Graphics): boolean;
|
|
12
14
|
execute(instruction: Graphics): void;
|
|
13
15
|
destroy(): void;
|
|
14
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|