@league-of-foundry-developers/foundry-vtt-types 13.346.0-beta.20250731052244 → 13.346.0-beta.20250801172911
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/package.json +1 -1
- package/src/configuration/hooks.d.mts +2 -1
- package/src/foundry/client/canvas/animation/_types.d.mts +1 -1
- package/src/foundry/client/canvas/animation/canvas-animation.d.mts +95 -44
- package/src/foundry/client/canvas/animation/chat-bubbles.d.mts +79 -8
- package/src/foundry/client/canvas/animation/smooth-noise.d.mts +23 -8
- package/src/foundry/client/canvas/board.d.mts +180 -31
- package/src/foundry/client/canvas/groups/canvas-group-mixin.d.mts +4 -3
- package/src/foundry/client/canvas/groups/visibility.d.mts +104 -60
- package/src/foundry/client/canvas/interaction/mouse-handler.d.mts +143 -85
- package/src/foundry/client/canvas/interaction/ping/alert.d.mts +14 -11
- package/src/foundry/client/canvas/interaction/ping/arrow.d.mts +5 -5
- package/src/foundry/client/canvas/interaction/ping/chevron.d.mts +27 -56
- package/src/foundry/client/canvas/interaction/ping/ping.d.mts +22 -17
- package/src/foundry/client/canvas/interaction/ping/pulse.d.mts +15 -44
- package/src/foundry/client/canvas/interaction/render-flags.d.mts +29 -15
- package/src/foundry/client/canvas/interaction/ruler/base-ruler.d.mts +230 -3
- package/src/foundry/client/canvas/interaction/ruler/ruler.d.mts +139 -434
- package/src/foundry/client/canvas/layers/controls.d.mts +1 -1
- package/src/foundry/client/canvas/layers/masks/vision.d.mts +28 -40
- package/src/foundry/client/canvas/perception/detection-mode.d.mts +62 -30
- package/src/foundry/client/canvas/perception/detection-modes/darkvision.d.mts +3 -2
- package/src/foundry/client/canvas/perception/detection-modes/invisibility-perception.d.mts +8 -3
- package/src/foundry/client/canvas/perception/detection-modes/light-perception.d.mts +6 -5
- package/src/foundry/client/canvas/perception/detection-modes/super-perception.d.mts +8 -3
- package/src/foundry/client/canvas/perception/detection-modes/tremor-perception.d.mts +8 -3
- package/src/foundry/client/canvas/perception/fog.d.mts +43 -42
- package/src/foundry/client/canvas/perception/perception-manager.d.mts +21 -23
- package/src/foundry/client/canvas/perception/vision-mode.d.mts +73 -62
- package/src/foundry/client/canvas/placeables/tokens/ring.d.mts +2 -2
- package/src/foundry/client/canvas/placeables/tokens/ruler.d.mts +5 -40
- package/src/foundry/client/canvas/sources/base-light-source.d.mts +4 -0
- package/src/foundry/client/canvas/sources/point-light-source.d.mts +2 -2
- package/src/foundry/client/canvas/sources/rendered-effect-source.d.mts +12 -5
- package/src/foundry/client/config.d.mts +4 -0
- package/src/foundry/client/documents/user.d.mts +2 -2
- package/src/foundry/client/hooks.d.mts +7 -0
- package/src/foundry/common/grid/base.d.mts +7 -1
- package/src/foundry/common/utils/color.d.mts +2 -1
- package/src/foundry/common/utils/event-emitter.d.mts +2 -1
@@ -4,8 +4,10 @@ import type { CanvasAnimation } from "#client/canvas/animation/_module.d.mts";
|
|
4
4
|
|
5
5
|
/**
|
6
6
|
* A class to manage a user ping on the canvas.
|
7
|
+
* @privateRemarks Foundry doesn't mark this abstract, but because of {@linkcode animate} always passing a bound {@linkcode _animateFrame},
|
8
|
+
* and the implementation here just throws, it is effectively abstract.
|
7
9
|
*/
|
8
|
-
declare class Ping extends PIXI.Container {
|
10
|
+
declare abstract class Ping extends PIXI.Container {
|
9
11
|
/**
|
10
12
|
* @param origin - The canvas coordinates of the origin of the ping.
|
11
13
|
* @param options - Additional options to configure the ping animation.
|
@@ -14,15 +16,19 @@ declare class Ping extends PIXI.Container {
|
|
14
16
|
|
15
17
|
options: Ping.ConstructorOptions;
|
16
18
|
|
17
|
-
|
19
|
+
/**
|
20
|
+
* The color of the ping
|
21
|
+
* @defaultValue {@linkcode Color.from | Color.from("#ff6400")}
|
22
|
+
*/
|
23
|
+
protected _color: Color;
|
18
24
|
|
19
|
-
/** @remarks `
|
25
|
+
/** @remarks Passing `options: boolean` is disallowed, as the body does `options.children = true` */
|
20
26
|
override destroy(options?: PIXI.IDestroyOptions): void;
|
21
27
|
|
22
28
|
/**
|
23
29
|
* Start the ping animation.
|
24
30
|
* @returns Returns true if the animation ran to completion, false otherwise.
|
25
|
-
* @privateRemarks This calls
|
31
|
+
* @privateRemarks This calls {@linkcode CanvasAnimation.animate} with an empty attribute array for the first argument,
|
26
32
|
* meaning no chance of early return, so no `| void` in the return type
|
27
33
|
*/
|
28
34
|
animate(): Promise<boolean>;
|
@@ -31,8 +37,9 @@ declare class Ping extends PIXI.Container {
|
|
31
37
|
* On each tick, advance the animation.
|
32
38
|
* @param dt - The number of ms that elapsed since the previous frame.
|
33
39
|
* @param animation - The animation state.
|
40
|
+
* @remarks Simply throws in {@linkcode Ping}; subclasses must implement a valid {@linkcode CanvasAnimation.OnTickFunction}
|
34
41
|
*/
|
35
|
-
protected _animateFrame(dt: number, animation: CanvasAnimation.AnimationData): void;
|
42
|
+
protected abstract _animateFrame(dt: number, animation: CanvasAnimation.AnimationData<this>): void;
|
36
43
|
}
|
37
44
|
|
38
45
|
declare namespace Ping {
|
@@ -46,34 +53,32 @@ declare namespace Ping {
|
|
46
53
|
/**
|
47
54
|
* The duration of the animation in milliseconds.
|
48
55
|
* @defaultValue `900`
|
49
|
-
* @remarks Can't be `
|
50
|
-
*
|
51
|
-
*
|
56
|
+
* @remarks Can't be `undefined` because the default is provided via `mergeObject`
|
57
|
+
*
|
58
|
+
* See {@linkcode CanvasAnimation.AnimateOptions.duration}
|
52
59
|
*/
|
53
|
-
duration: number
|
60
|
+
duration: number;
|
54
61
|
|
55
62
|
/**
|
56
63
|
* The size of the ping graphic.
|
57
64
|
* @defaultValue `128`
|
58
|
-
* @remarks Can't be `
|
59
|
-
* This value is not used in the base `Ping` class, but is used by subclasses to define radius and padding in
|
60
|
-
* ways where `undefined` produces `NaN` and values of `0` (ie, cast `null`) are nonsensical
|
65
|
+
* @remarks Can't be `undefined` because the default is provided via `mergeObject`
|
61
66
|
*/
|
62
67
|
size: number;
|
63
68
|
|
64
69
|
/**
|
65
70
|
* The color of the ping graphic.
|
66
|
-
* @defaultValue
|
67
|
-
* @remarks Can't be `
|
68
|
-
* and passing either to `Color.from` produces a `Color(NaN)`, which may cause breakage in subclasses or when
|
69
|
-
* passed to PIXI methods
|
71
|
+
* @defaultValue `"#ff6400"`
|
72
|
+
* @remarks Can't be `undefined` because the default is provided via `mergeObject`
|
70
73
|
*/
|
71
74
|
color: Color.Source;
|
72
75
|
|
73
76
|
/**
|
74
77
|
* The name for the ping animation to pass to {@linkcode CanvasAnimation.animate}.
|
78
|
+
*
|
79
|
+
* See {@linkcode CanvasAnimation.AnimateOptions.name}
|
75
80
|
*/
|
76
|
-
name: PropertyKey | undefined
|
81
|
+
name: PropertyKey | undefined;
|
77
82
|
}>;
|
78
83
|
|
79
84
|
interface ConstructorOptions extends Ping._ConstructorOptions {}
|
@@ -11,57 +11,28 @@ declare class PulsePing extends Ping {
|
|
11
11
|
* @param origin - The canvas coordinates of the origin of the ping.
|
12
12
|
* @param options - Additional options to configure the ping animation.
|
13
13
|
*/
|
14
|
-
constructor(
|
15
|
-
origin: Canvas.Point,
|
16
|
-
|
17
|
-
/** @privateRemarks Can't be `null` as it's directly assigned to `Ping#options` which has properties accessed null-unsafely */
|
18
|
-
options?: PulsePing.ConstructorOptions,
|
19
|
-
);
|
14
|
+
constructor(origin: Canvas.Point, options?: PulsePing.ConstructorOptions);
|
20
15
|
|
21
16
|
override options: PulsePing.ConstructorOptions;
|
22
17
|
|
23
|
-
|
18
|
+
/** @deprecated Made hard private in v13 (this warning will be removed in v14) */
|
19
|
+
_color2: never;
|
24
20
|
|
25
|
-
/**
|
26
|
-
|
27
|
-
* @defaultValue `this.options.size / 2`
|
28
|
-
*/
|
29
|
-
_r: number;
|
21
|
+
/** @deprecated Made hard private in v13 (this warning will be removed in v14) */
|
22
|
+
_r: never;
|
30
23
|
|
31
|
-
/**
|
32
|
-
|
33
|
-
* @defaultValue `this._r / 5`
|
34
|
-
*/
|
35
|
-
_r0: number;
|
24
|
+
/** @deprecated Made hard private in v13 (this warning will be removed in v14) */
|
25
|
+
_r0: never;
|
36
26
|
|
37
|
-
/**
|
38
|
-
|
39
|
-
*
|
40
|
-
* The animation for each ring can be separated into two consecutive stages.
|
41
|
-
* Stage 1: Fade in a white ring with radius r0.
|
42
|
-
* Stage 2: Expand radius outward. While the radius is expanding outward, we have two additional, consecutive
|
43
|
-
* animations:
|
44
|
-
* Stage 2.1: Transition color from white to the configured color.
|
45
|
-
* Stage 2.2: Fade out.
|
46
|
-
* 1/5th of the animation time is allocated to Stage 1. 4/5ths are allocated to Stage 2. Of those 4/5ths, 2/5ths
|
47
|
-
* are allocated to Stage 2.1, and 2/5ths are allocated to Stage 2.2.
|
48
|
-
*/
|
49
|
-
protected _computeTimeSlices(): void;
|
27
|
+
/** @deprecated Made hard private in v13 (this warning will be removed in v14) */
|
28
|
+
protected _computeTimeSlices(): never;
|
50
29
|
|
51
30
|
override animate(): Promise<boolean>;
|
52
31
|
|
53
|
-
override _animateFrame(dt: number, animation: CanvasAnimation.AnimationData): void;
|
32
|
+
protected override _animateFrame(dt: number, animation: CanvasAnimation.AnimationData<this>): void;
|
54
33
|
|
55
|
-
/**
|
56
|
-
|
57
|
-
* @param from - The color to transition from.
|
58
|
-
* @param to - The color to transition to.
|
59
|
-
* @param duration - The length of the transition in milliseconds.
|
60
|
-
* @param t - The current time along the duration.
|
61
|
-
* @returns The incremental color between from and to.
|
62
|
-
* @privateRemarks Foundry marked `@private`, and only types the return as `number`, instead of the more accurate `Color`
|
63
|
-
*/
|
64
|
-
protected _colorTransition(from: Color, to: Color, duration: number, t: number): Color;
|
34
|
+
/** @deprecated Made hard private in v13 (this warning will be removed in v14) */
|
35
|
+
protected _colorTransition(from: never, to: never, duration: never, t: never): never;
|
65
36
|
|
66
37
|
/**
|
67
38
|
* Draw the shape for this ping.
|
@@ -70,7 +41,9 @@ declare class PulsePing extends Ping {
|
|
70
41
|
* @param alpha - The alpha of the shape.
|
71
42
|
* @param size - The size of the shape to draw.
|
72
43
|
*/
|
73
|
-
protected _drawShape(g: PIXI.Graphics, color: number
|
44
|
+
protected _drawShape(g: PIXI.Graphics, color: number, alpha: number, size: number): void;
|
45
|
+
|
46
|
+
#PulsePing: true;
|
74
47
|
}
|
75
48
|
|
76
49
|
declare namespace PulsePing {
|
@@ -82,14 +55,12 @@ declare namespace PulsePing {
|
|
82
55
|
/**
|
83
56
|
* The number of rings used in the animation.
|
84
57
|
* @defaultValue `3`
|
85
|
-
* @remarks Can't be `null` as it only has a parameter default and a coerced `0` ring count is nonsensical
|
86
58
|
*/
|
87
59
|
rings: number;
|
88
60
|
|
89
61
|
/**
|
90
62
|
* The alternate color that the rings begin at. Use white for a 'flashing' effect.
|
91
63
|
* @defaultValue `#ffffff`
|
92
|
-
* @remarks Can't be `null` as it only has a parameter default and `Color(NaN)`s are to be avoided
|
93
64
|
*/
|
94
65
|
color2: Color.Source;
|
95
66
|
}>;
|
@@ -9,6 +9,7 @@ import type {
|
|
9
9
|
PhantomConstructor,
|
10
10
|
} from "#utils";
|
11
11
|
import type { LogCompatibilityWarningOptions } from "#common/utils/logging.d.mts";
|
12
|
+
import type { Canvas } from "#client/canvas/_module.d.mts";
|
12
13
|
|
13
14
|
declare class RenderFlagObject {
|
14
15
|
/** @privateRemarks All mixin classes should accept anything for its constructor. */
|
@@ -24,8 +25,9 @@ declare class RenderFlagObject {
|
|
24
25
|
* The ticker priority when RenderFlags of this class are handled.
|
25
26
|
* Valid values are OBJECTS or PERCEPTION.
|
26
27
|
* @defaultValue `"OBJECTS"`
|
28
|
+
* @remarks Must match a key of {@linkcode Canvas.pendingRenderFlags}
|
27
29
|
*/
|
28
|
-
static RENDER_FLAG_PRIORITY:
|
30
|
+
static RENDER_FLAG_PRIORITY: RenderFlags.Priority;
|
29
31
|
|
30
32
|
/**
|
31
33
|
* Status flags which are applied at render-time to update the PlaceableObject.
|
@@ -57,19 +59,14 @@ type _RenderFlag<Keys extends string> = InexactPartial<{
|
|
57
59
|
reset: Keys[];
|
58
60
|
|
59
61
|
/**
|
60
|
-
* Is this flag deprecated? The deprecation options are passed to
|
61
|
-
*
|
62
|
-
* unless message is passed with the options.
|
62
|
+
* Is this flag deprecated? The deprecation options are passed to {@linkcode foundry.utils.logCompatibilityWarning}.
|
63
|
+
* The deprecation message is auto-generated unless message is passed with the options.
|
63
64
|
* By default the message is logged only once.
|
64
65
|
*/
|
65
66
|
deprecated: {
|
66
67
|
message: string;
|
67
68
|
} & LogCompatibilityWarningOptions;
|
68
69
|
|
69
|
-
/**
|
70
|
-
* @remarks Possibly meant to be a sub-property of deprecated,
|
71
|
-
* the runtime check in `RenderFlags##set` looks for this as a top level property
|
72
|
-
*/
|
73
70
|
alias: boolean;
|
74
71
|
}>;
|
75
72
|
|
@@ -94,11 +91,19 @@ declare class RenderFlags<Flags extends RenderFlags.ValidateFlags<Flags>> extend
|
|
94
91
|
*/
|
95
92
|
constructor(flags: Flags, config?: RenderFlags.Config);
|
96
93
|
|
97
|
-
|
94
|
+
/** @remarks `defineProperty`'d at construction with `enumerable: false, writable: false` and the value frozen. */
|
95
|
+
readonly flags: Readonly<Flags>;
|
98
96
|
|
97
|
+
/** @remarks `defineProperty`'d at construction with `enumerable: false, writable: false` */
|
99
98
|
readonly object: RenderFlagObject;
|
100
99
|
|
101
|
-
|
100
|
+
/**
|
101
|
+
* The update priority when these render flags are applied.
|
102
|
+
* Valid options are `"OBJECTS"` or `"PERCEPTION"`.
|
103
|
+
*
|
104
|
+
* @remarks `defineProperty`'d at construction with `enumerable: false, writable: false`
|
105
|
+
*/
|
106
|
+
readonly priority: RenderFlags.Priority;
|
102
107
|
|
103
108
|
/**
|
104
109
|
* @returns The flags which were previously set that have been cleared.
|
@@ -128,12 +133,21 @@ declare namespace RenderFlags {
|
|
128
133
|
object?: RenderFlagObject;
|
129
134
|
|
130
135
|
/**
|
131
|
-
* The
|
132
|
-
*
|
133
|
-
* @
|
136
|
+
* The ticker priority at which these render flags are handled
|
137
|
+
* @defaultValue {@linkcode PIXI.UPDATE_PRIORITY.OBJECTS}
|
138
|
+
* @remarks The default value does *not* match the type as of 13.346, this is a core bug: {@link https://github.com/foundryvtt/foundryvtt/issues/13171}.
|
139
|
+
* Due to this the property has been marked required here, it can go back to optional if the default is fixed.
|
140
|
+
*
|
141
|
+
* See {@linkcode RenderFlags.priority | RenderFlags#priority}
|
134
142
|
*/
|
135
|
-
priority
|
143
|
+
priority: Priority;
|
136
144
|
}
|
145
|
+
|
146
|
+
/**
|
147
|
+
* @remarks {@linkcode RenderFlags.set | RenderFlags#set} and {@linkcode RenderFlags.clear | RenderFlags#clear}
|
148
|
+
* both access {@linkcode Canvas.pendingRenderFlags | canvas.pendingRenderFlags[priority]}
|
149
|
+
*/
|
150
|
+
type Priority = keyof Canvas.PendingRenderFlags;
|
137
151
|
}
|
138
152
|
|
139
153
|
/**
|
@@ -175,7 +189,7 @@ declare namespace RenderFlagsMixin {
|
|
175
189
|
type _KeyOf<T> = keyof T;
|
176
190
|
|
177
191
|
type ToBooleanFlags<RenderFlags extends object> = {
|
178
|
-
[K in _KeyOf<RenderFlags>]?: boolean |
|
192
|
+
[K in _KeyOf<RenderFlags>]?: boolean | undefined;
|
179
193
|
};
|
180
194
|
}
|
181
195
|
|
@@ -1,13 +1,240 @@
|
|
1
|
-
import type { Identity } from "#utils";
|
2
|
-
import type { RenderFlagsMixin } from "../render-flags.d.mts";
|
1
|
+
import type { Identity, InexactPartial, IntentionalPartial, MaybePromise } from "#utils";
|
2
|
+
import type { RenderFlagsMixin, RenderFlag } from "../render-flags.d.mts";
|
3
|
+
import type { Canvas } from "#client/canvas/_module.d.mts";
|
4
|
+
import type { PIXI } from "#configuration";
|
5
|
+
|
6
|
+
/**
|
7
|
+
* The ruler that is used to measure distances on the Canvas.
|
8
|
+
*/
|
9
|
+
declare abstract class BaseRuler extends RenderFlagsMixin() {
|
10
|
+
/**
|
11
|
+
* @param user - The User for whom to construct the Ruler instance
|
12
|
+
*/
|
13
|
+
constructor(user: User.Implementation);
|
14
|
+
|
15
|
+
static override RENDER_FLAGS: BaseRuler.RENDER_FLAGS;
|
16
|
+
|
17
|
+
/**
|
18
|
+
* Is the Ruler ready to measure?
|
19
|
+
*/
|
20
|
+
static get canMeasure(): boolean;
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Snaps the given point to the grid.
|
24
|
+
* @param point - The point that is to be snapped
|
25
|
+
* @returns The snapped point
|
26
|
+
* @remarks Despite forwarding to {@linkcode foundry.grid.BaseGrid.getSnappedPoint | canvas.grid.getSnappedPoint},
|
27
|
+
* since this only takes `{x, y}` in, it will only return `{x, y}`, never with `elevation`
|
28
|
+
*/
|
29
|
+
static getSnappedPoint(point: Canvas.Point): Canvas.Point;
|
30
|
+
|
31
|
+
/**
|
32
|
+
* The User who this Ruler belongs to.
|
33
|
+
*/
|
34
|
+
get user(): User.Implementation;
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Is this Ruler active? True, if the path of the Ruler is nonempty.
|
38
|
+
*/
|
39
|
+
get active(): boolean;
|
40
|
+
|
41
|
+
/**
|
42
|
+
* The Ruler is visible if it is active and either not hidden or its User is the current User.
|
43
|
+
*/
|
44
|
+
get visible(): boolean;
|
45
|
+
|
46
|
+
/**
|
47
|
+
* The sequence of points that the Ruler measures.
|
48
|
+
* @defaultValue `[]`
|
49
|
+
* @remarks The `path` setter freezes both the outer array and each element
|
50
|
+
*/
|
51
|
+
get path(): BaseRuler.Path;
|
52
|
+
|
53
|
+
set path(value);
|
54
|
+
|
55
|
+
/**
|
56
|
+
* The first point of the path, or undefined if the path is empty.
|
57
|
+
*/
|
58
|
+
get origin(): Canvas.ElevatedPoint | undefined;
|
59
|
+
|
60
|
+
/**
|
61
|
+
* The last point of the path, or undefined if the path is empty.
|
62
|
+
* @remarks Returns `this.#path.at(-1)`, so could be the same as {@linkcode origin | #origin} if the path is
|
63
|
+
* only one point long for whatever reason
|
64
|
+
*/
|
65
|
+
get destination(): Canvas.ElevatedPoint | undefined;
|
66
|
+
|
67
|
+
/**
|
68
|
+
* Is this Ruler hidden? If true, only the User of the Ruler can see it.
|
69
|
+
* @defaultValue `false`
|
70
|
+
*/
|
71
|
+
get hidden(): boolean;
|
72
|
+
|
73
|
+
set hidden(value);
|
74
|
+
|
75
|
+
/**
|
76
|
+
* Called when the Ruler's path has changed.
|
77
|
+
*/
|
78
|
+
protected _onPathChange(): void;
|
79
|
+
|
80
|
+
/**
|
81
|
+
* Called when the Ruler becomes hidden or unhidden.
|
82
|
+
*/
|
83
|
+
protected _onHiddenChange(): void;
|
84
|
+
|
85
|
+
/**
|
86
|
+
* Reset the path and the hidden state of the Ruler.
|
87
|
+
*/
|
88
|
+
reset(): void;
|
89
|
+
|
90
|
+
/**
|
91
|
+
* Draw the Ruler.
|
92
|
+
*/
|
93
|
+
abstract draw(): MaybePromise<void>;
|
94
|
+
|
95
|
+
/**
|
96
|
+
* Destroy the Ruler.
|
97
|
+
*/
|
98
|
+
abstract destroy(): void;
|
99
|
+
|
100
|
+
/**
|
101
|
+
* Refresh the Ruler.
|
102
|
+
*/
|
103
|
+
refresh(): void;
|
104
|
+
|
105
|
+
/**
|
106
|
+
* Refresh the Ruler.
|
107
|
+
*/
|
108
|
+
protected abstract _refresh(): void;
|
109
|
+
|
110
|
+
override applyRenderFlags(): void;
|
111
|
+
|
112
|
+
/**
|
113
|
+
* Add a waypoint.
|
114
|
+
* @param point - The (unsnapped) waypoint
|
115
|
+
* @param options - Additional options
|
116
|
+
*/
|
117
|
+
protected _addDragWaypoint(point: Canvas.Point, options?: BaseRuler.AddDragWaypointOptions): void;
|
118
|
+
|
119
|
+
/**
|
120
|
+
* Remove the second to last waypoint.
|
121
|
+
*/
|
122
|
+
protected _removeDragWaypoint(): void;
|
123
|
+
|
124
|
+
/**
|
125
|
+
* Change the elevation of the destination.
|
126
|
+
* @param delta - The number vertical steps
|
127
|
+
* @param options - Additional options
|
128
|
+
*/
|
129
|
+
protected _changeDragElevation(delta: number, options?: BaseRuler.ChangeDragElevationOptions): void;
|
130
|
+
|
131
|
+
/**
|
132
|
+
* Handle the beginning of a new Ruler measurement workflow.
|
133
|
+
* @param event - The drag start event
|
134
|
+
*/
|
135
|
+
protected _onDragStart(event: PIXI.FederatedEvent): void;
|
136
|
+
|
137
|
+
/**
|
138
|
+
* Handle the end of the Ruler measurement workflow
|
139
|
+
* @param event - The drag cancel event
|
140
|
+
* @returns If false, the cancellation of the drag workflow is prevented
|
141
|
+
*/
|
142
|
+
protected _onDragCancel(event: PIXI.FederatedEvent): boolean | void;
|
143
|
+
|
144
|
+
/**
|
145
|
+
* Handle left-click events on the Canvas during Ruler measurement.
|
146
|
+
* @param event - The pointer-down event
|
147
|
+
*/
|
148
|
+
protected _onClickLeft(event: PIXI.FederatedEvent): void;
|
149
|
+
|
150
|
+
/**
|
151
|
+
* Handle right-click events on the Canvas during Ruler measurement.
|
152
|
+
* @param event - The pointer-down event
|
153
|
+
*/
|
154
|
+
protected _onClickRight(event: PIXI.FederatedEvent): void;
|
155
|
+
|
156
|
+
/**
|
157
|
+
* Continue a Ruler measurement workflow for left-mouse movements on the Canvas.
|
158
|
+
* @param event - The mouse move event
|
159
|
+
*/
|
160
|
+
protected _onMouseMove(event: PIXI.FederatedEvent): void;
|
161
|
+
|
162
|
+
/**
|
163
|
+
* Conclude a Ruler measurement workflow by releasing the left-mouse button.
|
164
|
+
* @param event - The pointer-up event
|
165
|
+
*/
|
166
|
+
protected _onMouseUp(event: PIXI.FederatedEvent): void;
|
167
|
+
|
168
|
+
/**
|
169
|
+
* Adjust the elevation of Ruler waypoints by scrolling up/down.
|
170
|
+
* @param event - The mousewheel event
|
171
|
+
*/
|
172
|
+
protected _onMouseWheel(event: WheelEvent): void;
|
173
|
+
|
174
|
+
/**
|
175
|
+
* @deprecated "`BaseRuler#clear` is deprecated in favor of {@linkcode BaseRuler.reset | BaseRuler#reset}." (since v13, until v15)
|
176
|
+
*/
|
177
|
+
clear(): void;
|
178
|
+
|
179
|
+
/**
|
180
|
+
* @deprecated "`BaseRuler#update` is deprecated. Set {@linkcode BaseRuler.path | BaseRuler#path}
|
181
|
+
* and {@linkcode BaseRuler.hidden | BaseRuler#hidden} instead." (since v13, until v15)
|
182
|
+
*/
|
183
|
+
update(data?: BaseRuler.UpdateData): void;
|
3
184
|
|
4
|
-
declare class BaseRuler extends RenderFlagsMixin() {
|
5
185
|
#BaseRuler: true;
|
6
186
|
}
|
7
187
|
|
8
188
|
declare namespace BaseRuler {
|
9
189
|
interface Any extends AnyBaseRuler {}
|
10
190
|
interface AnyConstructor extends Identity<typeof AnyBaseRuler> {}
|
191
|
+
|
192
|
+
interface RENDER_FLAGS extends RenderFlagsMixin.RENDER_FLAGS {
|
193
|
+
/** @defaultValue `{}` */
|
194
|
+
refresh: RenderFlag<this, "refresh">;
|
195
|
+
}
|
196
|
+
|
197
|
+
type Path = ReadonlyArray<Readonly<Canvas.ElevatedPoint>>;
|
198
|
+
|
199
|
+
/** @internal */
|
200
|
+
type _AddDragWaypointOptions = InexactPartial<{
|
201
|
+
/**
|
202
|
+
* Snap the added waypoint?
|
203
|
+
* @defaultValue `false`
|
204
|
+
*/
|
205
|
+
snap: boolean;
|
206
|
+
}>;
|
207
|
+
|
208
|
+
interface AddDragWaypointOptions extends _AddDragWaypointOptions {}
|
209
|
+
|
210
|
+
/** @internal */
|
211
|
+
type _ChangeDragElevationOptions = InexactPartial<{
|
212
|
+
/**
|
213
|
+
* Round elevations to multiples of the grid distance divided by {@linkcode CONFIG.Canvas.elevationSnappingPrecision}?
|
214
|
+
* If false, rounds to multiples of the grid distance.
|
215
|
+
* @defaultValue `false`
|
216
|
+
*/
|
217
|
+
precise: boolean;
|
218
|
+
}>;
|
219
|
+
|
220
|
+
interface ChangeDragElevationOptions extends _ChangeDragElevationOptions {}
|
221
|
+
|
222
|
+
/** @internal */
|
223
|
+
type _UpdateData = IntentionalPartial<{
|
224
|
+
/**
|
225
|
+
* @defaultValue `[]`
|
226
|
+
* @remarks Can't be `undefined` because of an `in` check.
|
227
|
+
*/
|
228
|
+
path: Canvas.ElevatedPoint[];
|
229
|
+
|
230
|
+
/**
|
231
|
+
* @defaultValue `false`
|
232
|
+
* @remarks Can't be `undefined` because of an `in` check.
|
233
|
+
*/
|
234
|
+
hidden: boolean;
|
235
|
+
}>;
|
236
|
+
|
237
|
+
interface UpdateData extends _UpdateData {}
|
11
238
|
}
|
12
239
|
|
13
240
|
export default BaseRuler;
|