@league-of-foundry-developers/foundry-vtt-types 9.255.0 → 9.255.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/foundry/common/types.mjs.d.ts +120 -8
- package/src/foundry/common/utils/http.mjs.d.ts +52 -0
- package/src/foundry/common/utils/module.mjs.d.ts +1 -0
- package/src/foundry/common/utils/semaphore.mjs.d.ts +6 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +8 -6
- package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +4 -4
- package/src/foundry/foundry.js/avClient.d.ts +15 -1
- package/src/foundry/foundry.js/avClients/index.d.ts +0 -1
- package/src/foundry/foundry.js/avClients/simplePeerAVClient.d.ts +31 -4
- package/src/foundry/foundry.js/avMaster.d.ts +21 -48
- package/src/foundry/foundry.js/avSettings.d.ts +19 -46
- package/src/foundry/foundry.js/clientDocumentMixin.d.ts +2 -2
- package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +28 -6
- package/src/foundry/foundry.js/clientDocuments/actor.d.ts +13 -70
- package/src/foundry/foundry.js/clientDocuments/canvasDocuments/tokenDocument.d.ts +42 -9
- package/src/foundry/foundry.js/clientDocuments/folder.d.ts +22 -20
- package/src/foundry/foundry.js/clientDocuments/item.d.ts +5 -23
- package/src/foundry/foundry.js/clientDocuments/macro.d.ts +10 -0
- package/src/foundry/foundry.js/clientDocuments/playlistSound.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/prototypeToken.d.ts +24 -14
- package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +16 -14
- package/src/foundry/foundry.js/clientDocuments/scene.d.ts +12 -7
- package/src/foundry/foundry.js/clientDocuments/user.d.ts +2 -12
- package/src/foundry/foundry.js/clientSettings.d.ts +38 -86
- package/src/foundry/foundry.js/gamepadManager.d.ts +12 -0
- package/src/foundry/foundry.js/globalVariables.d.ts +0 -31
- package/src/foundry/foundry.js/pixi/containers/baseGrid.d.ts +21 -6
- package/src/foundry/foundry.js/pixi/containers/baseGrids/hexagonalGrid.d.ts +13 -8
- package/src/foundry/foundry.js/pixi/containers/baseGrids/squareGrid.d.ts +5 -3
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/gridLayer.d.ts +14 -5
- package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +9 -55
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientSound.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/drawing.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/measuredTemplate.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/note.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/tile.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +3 -0
- package/src/foundry/index.d.ts +0 -4
- package/src/foundry/foundry.js/avClients/easyRTCClient.d.ts +0 -392
- package/src/foundry/foundry.js/features.d.ts +0 -0
- package/src/foundry/foundry.js/fonts.d.ts +0 -24
@@ -20,6 +20,11 @@ declare global {
|
|
20
20
|
context?: ConstructorParameters<typeof foundry.documents.BaseRollTable>[1]
|
21
21
|
);
|
22
22
|
|
23
|
+
/**
|
24
|
+
* Provide a thumbnail image path used to represent this document.
|
25
|
+
*/
|
26
|
+
get thumbnail(): this['data']['img'];
|
27
|
+
|
23
28
|
/**
|
24
29
|
* Display a result drawn from a RollTable in the Chat Log along.
|
25
30
|
* Optionally also display the Roll which produced the result and configure aspects of the displayed messages.
|
@@ -65,6 +70,9 @@ declare global {
|
|
65
70
|
* Note that this function only performs the roll and identifies the result, the RollTable#draw function should be
|
66
71
|
* called to formalize the draw from the table.
|
67
72
|
*
|
73
|
+
* @param options - (default: `{}`)
|
74
|
+
* @returns The Roll and results drawn by that Roll
|
75
|
+
*
|
68
76
|
* @example
|
69
77
|
* ```typescript
|
70
78
|
* // Draw results using the default table formula
|
@@ -75,7 +83,7 @@ declare global {
|
|
75
83
|
* const customResults = await table.roll({roll});
|
76
84
|
* ```
|
77
85
|
*/
|
78
|
-
roll(options?: RollTable.RollOptions): Promise<RollTableDraw>;
|
86
|
+
roll(options?: RollTable.RollOptions | undefined): Promise<RollTableDraw>;
|
79
87
|
|
80
88
|
/**
|
81
89
|
* Get an Array of valid results for a given rolled total
|
@@ -103,28 +111,22 @@ declare global {
|
|
103
111
|
): void;
|
104
112
|
|
105
113
|
/** @override */
|
106
|
-
toCompendium(
|
107
|
-
|
108
|
-
|
109
|
-
> & {
|
114
|
+
toCompendium(
|
115
|
+
pack?: CompendiumCollection<CompendiumCollection.Metadata> | null | undefined,
|
116
|
+
options?: ClientDocumentMixin.CompendiumExportOptions | undefined
|
117
|
+
): Omit<foundry.data.RollTableData['_source'], '_id' | 'folder' | 'permission'> & {
|
110
118
|
permission?: foundry.data.RollTableData extends { toObject(): infer U } ? U : never;
|
111
119
|
};
|
112
120
|
|
113
121
|
/**
|
114
|
-
* Create a new RollTable
|
115
|
-
* @param folder - The Folder
|
122
|
+
* Create a new RollTable document using all of the Documents from a specific Folder as new results.
|
123
|
+
* @param folder - The Folder document from which to create a roll table
|
116
124
|
* @param options - Additional options passed to the RollTable.create method
|
117
125
|
*/
|
118
126
|
static fromFolder(
|
119
127
|
folder: InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseFolder>>,
|
120
128
|
options?: DocumentModificationOptions
|
121
129
|
): Promise<InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseRollTable>> | undefined>;
|
122
|
-
|
123
|
-
/**
|
124
|
-
* The RollTable#getTableResult method is deprecated in favor of RollTable#results#get and will be removed in 0.9.0
|
125
|
-
* @deprecated since 0.8.0
|
126
|
-
*/
|
127
|
-
getTableResult(id: string): ReturnType<this['results']['get']>;
|
128
130
|
}
|
129
131
|
|
130
132
|
namespace RollTable {
|
@@ -190,7 +192,7 @@ declare global {
|
|
190
192
|
roll?: Roll;
|
191
193
|
|
192
194
|
/**
|
193
|
-
* If a RollTable
|
195
|
+
* If a RollTable document is drawn as a result, recursively roll it
|
194
196
|
* @defaultValue `true`
|
195
197
|
*/
|
196
198
|
recursive?: boolean;
|
@@ -68,18 +68,23 @@ declare global {
|
|
68
68
|
*/
|
69
69
|
get img(): this['data']['img'];
|
70
70
|
|
71
|
+
/**
|
72
|
+
* Provide a thumbnail image path used to represent this document.
|
73
|
+
*/
|
74
|
+
get thumbnail(): this['data']['thumb'];
|
75
|
+
|
71
76
|
/**
|
72
77
|
* A convenience accessor for whether the Scene is currently viewed
|
73
78
|
*/
|
74
79
|
get isView(): boolean;
|
75
80
|
|
76
81
|
/**
|
77
|
-
* A reference to the JournalEntry
|
82
|
+
* A reference to the JournalEntry document associated with this Scene, or null
|
78
83
|
*/
|
79
84
|
get journal(): InstanceType<ConfiguredDocumentClass<typeof JournalEntry>> | null;
|
80
85
|
|
81
86
|
/**
|
82
|
-
* A reference to the Playlist
|
87
|
+
* A reference to the Playlist document for this Scene, or null
|
83
88
|
*/
|
84
89
|
get playlist(): InstanceType<ConfiguredDocumentClass<typeof Playlist>> | null;
|
85
90
|
|
@@ -435,10 +440,10 @@ declare global {
|
|
435
440
|
): void;
|
436
441
|
|
437
442
|
/** @override */
|
438
|
-
toCompendium(
|
439
|
-
|
440
|
-
|
441
|
-
> & {
|
443
|
+
toCompendium(
|
444
|
+
pack?: CompendiumCollection<CompendiumCollection.Metadata> | null | undefined,
|
445
|
+
options?: ClientDocumentMixin.CompendiumExportOptions | undefined
|
446
|
+
): Omit<foundry.data.SceneData['_source'], '_id' | 'folder' | 'permission'> & {
|
442
447
|
permission?: foundry.data.SceneData extends { toObject(): infer U } ? U : never;
|
443
448
|
};
|
444
449
|
|
@@ -451,7 +456,7 @@ declare global {
|
|
451
456
|
}
|
452
457
|
}
|
453
458
|
|
454
|
-
interface ThumbnailCreationData {
|
459
|
+
interface ThumbnailCreationData extends ImageHelper.TextureToImageOptions {
|
455
460
|
/**
|
456
461
|
* A background image to use for thumbnail creation, otherwise the current scene
|
457
462
|
* background is used.
|
@@ -90,7 +90,7 @@ declare global {
|
|
90
90
|
|
91
91
|
/**
|
92
92
|
* Assign a Macro to a numbered hotbar slot between 1 and 50
|
93
|
-
* @param macro - The Macro
|
93
|
+
* @param macro - The Macro document to assign
|
94
94
|
* @param slot - A specific numbered hotbar slot to fill
|
95
95
|
* @param fromSlot - An optional origin slot from which the Macro is being shifted
|
96
96
|
* @returns A Promise which resolves once the User update is complete
|
@@ -120,7 +120,7 @@ declare global {
|
|
120
120
|
broadcastActivity(activityData?: ActivityData): void;
|
121
121
|
|
122
122
|
/**
|
123
|
-
* Get an Array of Macro
|
123
|
+
* Get an Array of Macro Documents on this User's Hotbar by page
|
124
124
|
* @param page - The hotbar page number
|
125
125
|
* (default: `1`)
|
126
126
|
*/
|
@@ -145,16 +145,6 @@ declare global {
|
|
145
145
|
/** @override */
|
146
146
|
_onDelete(options: DocumentModificationOptions, userId: string): void;
|
147
147
|
|
148
|
-
/**
|
149
|
-
* @deprecated since 0.8.0
|
150
|
-
*/
|
151
|
-
isRole(role: Parameters<User['hasRole']>[0]): boolean;
|
152
|
-
|
153
|
-
/**
|
154
|
-
* @deprecated since 0.8.0
|
155
|
-
*/
|
156
|
-
setPermission(permission: keyof typeof CONST.USER_PERMISSIONS, allowed: boolean): Promise<this>;
|
157
|
-
|
158
148
|
/** @remarks This property is set by PlayerList.getData() */
|
159
149
|
charname?: string;
|
160
150
|
|
@@ -20,12 +20,12 @@ declare global {
|
|
20
20
|
/**
|
21
21
|
* A object of registered game settings for this scope
|
22
22
|
*/
|
23
|
-
settings: Map<string,
|
23
|
+
settings: Map<string, SettingConfig>;
|
24
24
|
|
25
25
|
/**
|
26
26
|
* Registered settings menus which trigger secondary applications
|
27
27
|
*/
|
28
|
-
menus: Map<string,
|
28
|
+
menus: Map<string, SettingSubmenuConfig>;
|
29
29
|
|
30
30
|
/**
|
31
31
|
* The storage interfaces used for persisting settings
|
@@ -47,12 +47,12 @@ declare global {
|
|
47
47
|
/**
|
48
48
|
* Register a new game setting under this setting scope
|
49
49
|
*
|
50
|
-
* @param
|
51
|
-
* @param key
|
52
|
-
* @param data
|
53
|
-
* @typeParam
|
54
|
-
* @typeParam K
|
55
|
-
* @typeParam T
|
50
|
+
* @param namespace - The namespace under which the setting is registered
|
51
|
+
* @param key - The key name for the setting under the namespace module
|
52
|
+
* @param data - Configuration for setting data
|
53
|
+
* @typeParam N - The namespace under which the setting is registered, as a type
|
54
|
+
* @typeParam K - The key name for the setting under the namespace module, as a type
|
55
|
+
* @typeParam T - The type of the setting value
|
56
56
|
*
|
57
57
|
* @example
|
58
58
|
* ```typescript
|
@@ -95,22 +95,22 @@ declare global {
|
|
95
95
|
* });
|
96
96
|
* ```
|
97
97
|
*/
|
98
|
-
register<
|
99
|
-
|
98
|
+
register<N extends string, K extends string, T>(
|
99
|
+
namespace: N,
|
100
100
|
key: K,
|
101
|
-
data: ClientSettings.Values[`${
|
102
|
-
? ClientSettings.
|
103
|
-
: ClientSettings.
|
101
|
+
data: ClientSettings.Values[`${N}.${K}`] extends string | number | boolean | Array<any> | object
|
102
|
+
? ClientSettings.PartialSettingConfig<ClientSettings.Values[`${N}.${K}`]>
|
103
|
+
: ClientSettings.PartialSettingConfig<T>
|
104
104
|
): void;
|
105
105
|
|
106
106
|
/**
|
107
107
|
* Register a new sub-settings menu
|
108
108
|
*
|
109
|
-
* @param
|
110
|
-
* @param key
|
111
|
-
* @param data
|
112
|
-
* @typeParam
|
113
|
-
* @typeParam K
|
109
|
+
* @param namespace - The namespace under which the menu is registered
|
110
|
+
* @param key - The key name for the setting under the namespace module
|
111
|
+
* @param data - Configuration for setting data
|
112
|
+
* @typeParam N - The namespace under which the menu is registered, as a type
|
113
|
+
* @typeParam K - The key name for the setting under the namespace module, as a type
|
114
114
|
*
|
115
115
|
* @example
|
116
116
|
* ```typescript
|
@@ -125,19 +125,19 @@ declare global {
|
|
125
125
|
* });
|
126
126
|
* ```
|
127
127
|
*/
|
128
|
-
registerMenu<
|
129
|
-
|
128
|
+
registerMenu<N extends string, K extends string>(
|
129
|
+
namespace: N,
|
130
130
|
key: K,
|
131
|
-
data: ClientSettings.
|
131
|
+
data: ClientSettings.PartialSettingSubmenuConfig
|
132
132
|
): void;
|
133
133
|
|
134
134
|
/**
|
135
|
-
* Get the value of a game setting for a certain
|
135
|
+
* Get the value of a game setting for a certain namespace and setting key
|
136
136
|
*
|
137
|
-
* @param
|
138
|
-
* @param key
|
139
|
-
* @typeParam
|
140
|
-
* @typeParam K
|
137
|
+
* @param namespace - The namespace under which the setting is registered
|
138
|
+
* @param key - The setting key to retrieve
|
139
|
+
* @typeParam N - The namespace under which the setting is registered, as a type
|
140
|
+
* @typeParam K - The setting key to retrieve, as a type
|
141
141
|
*
|
142
142
|
* @example
|
143
143
|
* ```typescript
|
@@ -145,17 +145,17 @@ declare global {
|
|
145
145
|
* game.settings.get("myModule", "myClientSetting");
|
146
146
|
* ```
|
147
147
|
*/
|
148
|
-
get<
|
148
|
+
get<N extends string, K extends string>(namespace: N, key: K): ClientSettings.Values[`${N}.${K}`];
|
149
149
|
|
150
150
|
/**
|
151
|
-
* Set the value of a game setting for a certain
|
151
|
+
* Set the value of a game setting for a certain namespace and setting key
|
152
152
|
*
|
153
|
-
* @param
|
154
|
-
* @param key
|
155
|
-
* @param value
|
156
|
-
* @typeParam
|
157
|
-
* @typeParam K
|
158
|
-
* @typeParam V
|
153
|
+
* @param namespace - The namespace under which the setting is registered
|
154
|
+
* @param key - The setting key to retrieve
|
155
|
+
* @param value - The data to assign to the setting key
|
156
|
+
* @typeParam N - The namespace under which the setting is registered, as a type
|
157
|
+
* @typeParam K - The setting key to retrieve, as a type
|
158
|
+
* @typeParam V - The type of the value being set
|
159
159
|
*
|
160
160
|
* @example
|
161
161
|
* ```typescript
|
@@ -163,65 +163,17 @@ declare global {
|
|
163
163
|
* game.settings.set("myModule", "myClientSetting", "b");
|
164
164
|
* ```
|
165
165
|
*/
|
166
|
-
set<
|
167
|
-
|
166
|
+
set<N extends string, K extends string, V extends ClientSettings.Values[`${N}.${K}`]>(
|
167
|
+
namespace: N,
|
168
168
|
key: K,
|
169
169
|
value: V
|
170
170
|
): Promise<V>;
|
171
171
|
}
|
172
172
|
|
173
173
|
namespace ClientSettings {
|
174
|
-
|
175
|
-
key: string;
|
176
|
-
module: string;
|
177
|
-
}
|
178
|
-
|
179
|
-
interface CompleteMenuSetting extends PartialMenuSetting {
|
180
|
-
key: string;
|
181
|
-
module: string;
|
182
|
-
}
|
183
|
-
|
184
|
-
interface PartialSetting<T = unknown> {
|
185
|
-
choices?: Record<string, string>;
|
186
|
-
config?: boolean;
|
187
|
-
default?: T;
|
188
|
-
hint?: string;
|
189
|
-
name?: string;
|
190
|
-
onChange?: (value: T) => void;
|
191
|
-
range?: T extends number
|
192
|
-
? {
|
193
|
-
max: number;
|
194
|
-
min: number;
|
195
|
-
step: number;
|
196
|
-
}
|
197
|
-
: undefined;
|
198
|
-
filePicker?: T extends string ? true | 'audio' | 'image' | 'video' | 'imagevideo' | 'folder' : undefined;
|
199
|
-
scope: string;
|
200
|
-
type?: T extends boolean
|
201
|
-
? typeof Boolean
|
202
|
-
: T extends number
|
203
|
-
? typeof Number
|
204
|
-
: T extends bigint
|
205
|
-
? typeof BigInt
|
206
|
-
: T extends string
|
207
|
-
? typeof String
|
208
|
-
: T extends symbol
|
209
|
-
? typeof Symbol
|
210
|
-
: ConstructorOf<T>;
|
211
|
-
}
|
212
|
-
|
213
|
-
interface PartialMenuSetting {
|
214
|
-
hint?: string;
|
215
|
-
icon?: string;
|
216
|
-
label?: string;
|
217
|
-
name?: string;
|
218
|
-
restricted: boolean;
|
219
|
-
type: ConstructorOf<FormApplication<FormApplicationOptions, object, undefined>>;
|
220
|
-
}
|
174
|
+
type PartialSettingConfig<T = unknown> = InexactPartial<Omit<SettingConfig<T>, 'key' | 'namespace'>>;
|
221
175
|
|
222
|
-
|
223
|
-
[key: string]: PartialMenuSetting;
|
224
|
-
}
|
176
|
+
type PartialSettingSubmenuConfig = Omit<SettingSubmenuConfig, 'key' | 'namespace'>;
|
225
177
|
|
226
178
|
interface Values {
|
227
179
|
'core.animateRollTable': boolean;
|
@@ -2,6 +2,18 @@
|
|
2
2
|
declare class GamepadManager {
|
3
3
|
constructor();
|
4
4
|
|
5
|
+
/**
|
6
|
+
* @defaultValue `null`
|
7
|
+
* @internal
|
8
|
+
*/
|
9
|
+
protected _gamepadPoller: number | null;
|
10
|
+
|
11
|
+
/**
|
12
|
+
* The connected Gamepads
|
13
|
+
* @internal
|
14
|
+
*/
|
15
|
+
protected _connectedGamepads: Map<string, ConnectedGamepad>;
|
16
|
+
|
5
17
|
/**
|
6
18
|
* How often Gamepad polling should check for button presses
|
7
19
|
* @defaultValue `100`
|
@@ -70,37 +70,6 @@ declare global {
|
|
70
70
|
/** The client-side console is the default logger */
|
71
71
|
let logger: typeof console;
|
72
72
|
|
73
|
-
/**
|
74
|
-
* @deprecated since 0.8.0
|
75
|
-
* You are referencing the FEATURES object which has been deprecated as it is no longer an agreed-upon method for how to track evolution of the Foundry Virtual Tabletop API. Discussion about alternate approaches is actively ongoing within the League of Developers community. For the time being the recommendation is to test against game.data.version to understand the current Foundry VTT version which is active. The FEATURES object will be removed in 0.9.0.
|
76
|
-
*/
|
77
|
-
let FEATURES: {
|
78
|
-
readonly ACTIVE_EFFECTS: 2;
|
79
|
-
readonly ACTORS: 3;
|
80
|
-
readonly AUDIO_VIDEO: 2;
|
81
|
-
readonly CHAT: 3;
|
82
|
-
readonly COMBAT: 3;
|
83
|
-
readonly COMPENDIUM: 3;
|
84
|
-
readonly DICE: 2;
|
85
|
-
readonly DRAWINGS: 3;
|
86
|
-
readonly ENTITIES: 5;
|
87
|
-
readonly GRID: 2;
|
88
|
-
readonly ITEMS: 3;
|
89
|
-
readonly JOURNAL: 2;
|
90
|
-
readonly LIGHTING: 3;
|
91
|
-
readonly LOCALIZATION: 2;
|
92
|
-
readonly MACROS: 2;
|
93
|
-
readonly NOTES: 2;
|
94
|
-
readonly PLAYLISTS: 2;
|
95
|
-
readonly ROLL_TABLES: 2;
|
96
|
-
readonly SETTINGS: 3;
|
97
|
-
readonly SOUND: 2;
|
98
|
-
readonly TEMPLATES: 2;
|
99
|
-
readonly TILES: 3;
|
100
|
-
readonly TOKENS: 4;
|
101
|
-
readonly WALLS: 3;
|
102
|
-
};
|
103
|
-
|
104
73
|
/**
|
105
74
|
* @defaultValue `undefined`
|
106
75
|
* Initialized between the `'DOMContentLoaded'` event and the `'init'` hook event.
|
@@ -22,7 +22,12 @@ declare class BaseGrid extends PIXI.Container {
|
|
22
22
|
*/
|
23
23
|
highlight: PIXI.Container;
|
24
24
|
|
25
|
-
|
25
|
+
/**
|
26
|
+
* Draw the grid. Subclasses are expected to override this method to perform their type-specific drawing logic.
|
27
|
+
* @param preview - Override settings used in place of those saved to the scene data.
|
28
|
+
* (default: `{}`)
|
29
|
+
*/
|
30
|
+
draw(preview?: BaseGrid.Preview | undefined): this;
|
26
31
|
|
27
32
|
/**
|
28
33
|
* Highlight a grid position for a certain coordinates
|
@@ -94,7 +99,7 @@ declare class BaseGrid extends PIXI.Container {
|
|
94
99
|
* (default: `{}`)
|
95
100
|
* @returns An Array of distance measurements for each segment
|
96
101
|
*/
|
97
|
-
measureDistances(segments: GridLayer.Segment[], options?:
|
102
|
+
measureDistances(segments: GridLayer.Segment[], options?: MeasureDistancesOptions | undefined): number[];
|
98
103
|
|
99
104
|
/**
|
100
105
|
* Get the grid row and column positions which are neighbors of a certain position
|
@@ -114,6 +119,20 @@ declare namespace BaseGrid {
|
|
114
119
|
even?: boolean;
|
115
120
|
}
|
116
121
|
|
122
|
+
interface Preview {
|
123
|
+
/**
|
124
|
+
* The grid color.
|
125
|
+
* @defaultValue `null`
|
126
|
+
*/
|
127
|
+
gridColor?: string | null | undefined;
|
128
|
+
|
129
|
+
/**
|
130
|
+
* The grid transparency.
|
131
|
+
* @defaultValue `null`
|
132
|
+
*/
|
133
|
+
gridAlpha?: number | null | undefined;
|
134
|
+
}
|
135
|
+
|
117
136
|
interface HighlightGridPositionOptions {
|
118
137
|
/**
|
119
138
|
* The x-coordinate of the highlighted position
|
@@ -149,8 +168,4 @@ declare namespace BaseGrid {
|
|
149
168
|
*/
|
150
169
|
shape?: PIXI.Polygon | null;
|
151
170
|
}
|
152
|
-
|
153
|
-
interface MeasureDistancesOptions {
|
154
|
-
gridSpaces?: boolean;
|
155
|
-
}
|
156
171
|
}
|
@@ -28,7 +28,7 @@ declare class HexagonalGrid extends BaseGrid {
|
|
28
28
|
get hexPoints(): PointArray[];
|
29
29
|
|
30
30
|
/** @override */
|
31
|
-
draw(): this;
|
31
|
+
draw(preview?: BaseGrid.Preview | undefined): this;
|
32
32
|
|
33
33
|
/**
|
34
34
|
* A convenience method for getting all the polygon points relative to a top-left [x,y] coordinate pair
|
@@ -39,10 +39,17 @@ declare class HexagonalGrid extends BaseGrid {
|
|
39
39
|
*/
|
40
40
|
getPolygon(x: number, y: number, w?: number, h?: number): PointArray[];
|
41
41
|
|
42
|
-
|
42
|
+
/**
|
43
|
+
* Draw the grid lines.
|
44
|
+
* @param preview - Override settings used in place of those saved to the scene data.
|
45
|
+
* @internal
|
46
|
+
*/
|
47
|
+
protected _drawGrid(preview?: BaseGrid.Preview | undefined): PIXI.Graphics;
|
43
48
|
|
49
|
+
/** @internal */
|
44
50
|
protected _drawRows(grid: PIXI.Graphics, nrows: number, ncols: number): void;
|
45
51
|
|
52
|
+
/** @internal */
|
46
53
|
protected _drawColumns(grid: PIXI.Graphics, nrows: number, ncols: number): void;
|
47
54
|
|
48
55
|
/**
|
@@ -67,7 +74,8 @@ declare class HexagonalGrid extends BaseGrid {
|
|
67
74
|
*/
|
68
75
|
getSnappedPosition(x: number, y: number, interval?: number | null): { x: number; y: number };
|
69
76
|
|
70
|
-
|
77
|
+
/** @internal */
|
78
|
+
protected _getClosestVertex(xc: number, yc: number, ox: number, oy: number): { x: number; y: number };
|
71
79
|
|
72
80
|
/** @override */
|
73
81
|
shiftPosition(x: number, y: number, dx: number, dy: number): PointArray;
|
@@ -81,11 +89,8 @@ declare class HexagonalGrid extends BaseGrid {
|
|
81
89
|
/** @override */
|
82
90
|
getNeighbors(row: number, col: number): PointArray[];
|
83
91
|
|
84
|
-
/**
|
85
|
-
|
86
|
-
* @param options - (default: `{}`)
|
87
|
-
*/
|
88
|
-
measureDistances(segments: GridLayer.Segment[], options?: BaseGrid.MeasureDistancesOptions): number[];
|
92
|
+
/** @override */
|
93
|
+
measureDistances(segments: GridLayer.Segment[], options?: MeasureDistancesOptions): number[];
|
89
94
|
|
90
95
|
/**
|
91
96
|
* Convert an offset coordinate (row, col) into a cube coordinate (q, r, s).
|
@@ -3,9 +3,10 @@
|
|
3
3
|
*/
|
4
4
|
declare class SquareGrid extends BaseGrid {
|
5
5
|
/** @override */
|
6
|
-
draw(): this;
|
6
|
+
draw(preview?: BaseGrid.Preview | undefined): this;
|
7
7
|
|
8
|
-
|
8
|
+
/** @internal */
|
9
|
+
protected _drawLine(
|
9
10
|
points: [x1: number, y1: number, x2: number, y2: number],
|
10
11
|
lineColor: number,
|
11
12
|
lineAlpha: number
|
@@ -35,6 +36,7 @@ declare class SquareGrid extends BaseGrid {
|
|
35
36
|
*/
|
36
37
|
shiftPosition(x: number, y: number, dx: number, dy: number): PointArray;
|
37
38
|
|
39
|
+
/** @internal */
|
38
40
|
protected _getNearestVertex(x: number, y: number): PointArray;
|
39
41
|
|
40
42
|
/**
|
@@ -47,7 +49,7 @@ declare class SquareGrid extends BaseGrid {
|
|
47
49
|
* @override
|
48
50
|
* @param options - (default: `{}`)
|
49
51
|
*/
|
50
|
-
measureDistances(segments: GridLayer.Segment[], options?:
|
52
|
+
measureDistances(segments: GridLayer.Segment[], options?: MeasureDistancesOptions): number[];
|
51
53
|
|
52
54
|
/** @override */
|
53
55
|
getNeighbors(row: number, col: number): PointArray[];
|
@@ -92,9 +92,11 @@ declare class GridLayer extends CanvasLayer<GridLayer.LayerOptions> {
|
|
92
92
|
getCenter(x: number, y: number): PointArray;
|
93
93
|
|
94
94
|
/**
|
95
|
-
* Measure the
|
96
|
-
* @param origin
|
97
|
-
* @param target
|
95
|
+
* Measure the distance between two point coordinates.
|
96
|
+
* @param origin - The origin point
|
97
|
+
* @param target - The target point
|
98
|
+
* @param options - Additional options which modify the measurement
|
99
|
+
* (default: `{}`)
|
98
100
|
* @returns The measured distance between these points
|
99
101
|
*
|
100
102
|
* @example
|
@@ -110,15 +112,17 @@ declare class GridLayer extends CanvasLayer<GridLayer.LayerOptions> {
|
|
110
112
|
target: {
|
111
113
|
x: number;
|
112
114
|
y: number;
|
113
|
-
}
|
115
|
+
},
|
116
|
+
options?: MeasureDistancesOptions | undefined
|
114
117
|
): number;
|
115
118
|
|
116
119
|
/**
|
117
120
|
* Measure the distance traveled over an array of distance segments.
|
118
121
|
* @param segments - An array of measured segments
|
119
122
|
* @param options - Additional options which modify the measurement
|
123
|
+
* (default: `{}`)
|
120
124
|
*/
|
121
|
-
measureDistances(segments: GridLayer.Segment[], options?:
|
125
|
+
measureDistances(segments: GridLayer.Segment[], options?: MeasureDistancesOptions | undefined): number[];
|
122
126
|
|
123
127
|
/**
|
124
128
|
* Define a new Highlight graphic
|
@@ -194,3 +198,8 @@ interface DrawOptions {
|
|
194
198
|
*/
|
195
199
|
gridAlpha?: number | null;
|
196
200
|
}
|
201
|
+
|
202
|
+
interface MeasureDistancesOptions {
|
203
|
+
/** Return the distance in grid increments rather than the co-ordinate distance. */
|
204
|
+
gridSpaces?: boolean;
|
205
|
+
}
|