bc-stubs 125.0.0 → 125.0.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.
@@ -1819,7 +1819,7 @@ interface Character {
1819
1819
  InventoryData?: string;
1820
1820
  Appearance: Item[];
1821
1821
  /**
1822
- * @private
1822
+ * private
1823
1823
  * @see {@link Character.Stage}
1824
1824
  */
1825
1825
  _Stage: string;
@@ -1827,7 +1827,7 @@ interface Character {
1827
1827
  get Stage(): string;
1828
1828
  set Stage(value: string);
1829
1829
  /**
1830
- * @private
1830
+ * private
1831
1831
  * @see {@link Character.CurrentDialog}
1832
1832
  */
1833
1833
  _CurrentDialog: string;
@@ -1723,7 +1723,7 @@ declare namespace ChatRoomSep {
1723
1723
  let _ClickScrollUp: (this: HTMLButtonElement, event: MouseEvent | TouchEvent) => Promise<void>;
1724
1724
  /**
1725
1725
  * Return a {@link HTMLElement.InnerHTML} representation of the passed button's room name
1726
- * @private
1726
+ * private
1727
1727
  * @param {HTMLButtonElement} button
1728
1728
  * @returns {(string | HTMLElement)[]}
1729
1729
  */
@@ -0,0 +1,651 @@
1
+ /**
2
+ * Returns TRUE if the player is an admin and activated her super powers on the map
3
+ * @returns {boolean} - TRUE if super powers are active
4
+ */
5
+ declare function ChatRoomMapViewHasSuperPowers(): boolean;
6
+ /**
7
+ * When the screen loses focus, we clear the keys pressed because we don't want movement to get stuck
8
+ */
9
+ declare function ChatRoomMapViewBlur(): void;
10
+ /**
11
+ * Initializes the map to its default blank state
12
+ * @param {ChatRoomMapType} mode
13
+ * @returns {ServerChatRoomMapData}
14
+ */
15
+ declare function ChatRoomMapViewInitialize(mode: ChatRoomMapType): ServerChatRoomMapData;
16
+ /**
17
+ * Initializes the player map data to its default blank state
18
+ * @param {Character} C - The character to be initialized
19
+ * @returns {ChatRoomMapData}
20
+ */
21
+ declare function ChatRoomMapViewInitializeCharacter(C: Character): ChatRoomMapData;
22
+ /**
23
+ * Validate the passed chat room map positions.
24
+ * @param {unknown} position
25
+ * @returns {ChatRoomMapPos}
26
+ */
27
+ declare function ChatRoomMapViewValidatePosition(position: unknown): ChatRoomMapPos;
28
+ /**
29
+ * Checks if the coordinates are out of bounds relative to the map
30
+ * @param {ChatRoomMapPos} position
31
+ */
32
+ declare function ChatRoomMapViewIsOutOfBounds(position: ChatRoomMapPos): boolean;
33
+ /**
34
+ * Performs cleanup when leaving the chat room map
35
+ * @returns {void} - Nothing
36
+ */
37
+ declare function ChatRoomMapViewLeave(): void;
38
+ /**
39
+ * Activates the chat room map
40
+ * @returns {void} - Nothing
41
+ */
42
+ declare function ChatRoomMapViewActivate(): void;
43
+ /**
44
+ * Deactivates the chat room map
45
+ * @returns {void} - Nothing
46
+ */
47
+ declare function ChatRoomMapViewDeactivate(): void;
48
+ /**
49
+ * Indicates if the chat room map view is active or not
50
+ * @returns {boolean} - TRUE if the chat room character view is active, false if not
51
+ */
52
+ declare function ChatRoomMapViewIsActive(): boolean;
53
+ declare function ChatRoomMapViewRun(time: number): void;
54
+ /**
55
+ * Returns TRUE if the player can leave from the map
56
+ * @returns {boolean} - True if the player can leave
57
+ */
58
+ declare function ChatRoomMapViewCanLeave(): boolean;
59
+ /**
60
+ * Take a screenshot of the current section of the map
61
+ * @returns {void} - Nothing
62
+ */
63
+ declare function ChatRoomMapViewScreenshot(): void;
64
+ /**
65
+ * Returns TRUE if the player can enter in whisper mode on the current view with the currently focused character
66
+ * @param {Character} C - The character to evaluate
67
+ * @returns {boolean} - TRUE is whipser can be started
68
+ */
69
+ declare function ChatRoomMapViewCanStartWhisper(C: Character): boolean;
70
+ /**
71
+ * Handles the reception of the room properties from the server.
72
+ * @param {ServerChatRoomSyncMessage} data - Room object containing the updated chatroom properties.
73
+ * @returns {void} - Nothing.
74
+ */
75
+ declare function ChatRoomMapViewSyncRoomProperties(data: ServerChatRoomSyncMessage): void;
76
+ /**
77
+ * Gets a index number for the tile and obejct lists and returns the corrosponting coordinates in X and Y
78
+ * @param {number} index - Index number for the tile and object lists
79
+ * @returns {{x: number, y: number}} - Object containing the resulting x and y coordinates.
80
+ */
81
+ declare function ChatRoomMapViewIndexToCoordinates(index: number): {
82
+ x: number;
83
+ y: number;
84
+ };
85
+ /**
86
+ * Gets coordinates in X and Y and returns the corrosponding index number for the tile and object list
87
+ * @param {number} x - X-coordinate to be translated
88
+ * @param {number} y - Y-coordinate to be translated
89
+ * @returns {number} - Index number for the tile and object lists
90
+ */
91
+ declare function ChatRoomMapViewCoordinatesToIndex(x: number, y: number): number;
92
+ /**
93
+ * Calculates the visibility mask and audibility mask for the map
94
+ * @returns {void} - Nothing
95
+ */
96
+ declare function ChatRoomMapViewCalculatePerceptionMasks(): void;
97
+ /**
98
+ * Returns the sight range for the current player, based on the blindness level
99
+ * @returns {number} - The number of visible tiles
100
+ */
101
+ declare function ChatRoomMapViewGetSightRange(): number;
102
+ /**
103
+ * Returns the hearing range for the current player, based on the deafness level
104
+ * @returns {number} - The number of tiles
105
+ */
106
+ declare function ChatRoomMapViewGetHearingRange(): number;
107
+ /**
108
+ * Returns TRUE if the player can see a character at her sight range
109
+ * @param {Character} C - The character to evaluate
110
+ * @returns {boolean} - TRUE if visible
111
+ */
112
+ declare function ChatRoomMapViewCharacterIsVisible(C: Character): boolean;
113
+ /**
114
+ * Returns TRUE if the player can see hear a character at her hearing range
115
+ * @param {Character} C - The character to evaluate
116
+ * @returns {boolean} - TRUE if hearable
117
+ */
118
+ declare function ChatRoomMapViewCharacterIsHearable(C: Character): boolean;
119
+ /**
120
+ * Returns TRUE if the player is on whisper range to another character (1 tile)
121
+ * @param {Character} C - The character to evaluate
122
+ * @returns {boolean} - TRUE if on whisper range
123
+ */
124
+ declare function ChatRoomMapViewCharacterOnWhisperRange(C: Character): boolean;
125
+ /**
126
+ * Returns TRUE if the player is within interaction range of another character
127
+ * @param {Character} C - The character to evaluate
128
+ * @returns {boolean} - TRUE if on interaction range
129
+ */
130
+ declare function ChatRoomMapViewCharacterOnInteractionRange(C: Character): boolean;
131
+ /**
132
+ * Sets the correct wall tile based on it's surrounding (North-West, North-Center, etc.)
133
+ * @param {boolean} CW - If Center West is a wall
134
+ * @param {boolean} CE - If Center East is a wall
135
+ * @param {boolean} SW - If South West is a wall
136
+ * @param {boolean} SC - If South Center is a wall
137
+ * @param {boolean} SE - If South East is a wall
138
+ * @returns {number} - a number linked on the image to use
139
+ */
140
+ declare function ChatRoomMapViewFindWallEffectTile(CW: boolean, CE: boolean, SW: boolean, SC: boolean, SE: boolean): number;
141
+ /**
142
+ * Returns TRUE if the X and Y coordinates is a wall tile, if out of bound we also return TRUE
143
+ * @param {number} X - The X position on the map
144
+ * @param {number} Y - The Y position on the map
145
+ * @returns {boolean} - TRUE if it's a wall
146
+ */
147
+ declare function ChatRoomMapViewIsWall(X: number, Y: number): boolean;
148
+ /**
149
+ * Checks for connectivity in 4 directions based on a provided validation function
150
+ * @param {number} X - The X position on the map
151
+ * @param {number} Y - The Y position on the map
152
+ * @param {function(number, number): boolean} Condition - Function that returns true if the position is connected
153
+ * @returns {{ North: boolean, South: boolean, East: boolean, West: boolean }} - The connectivity status
154
+ */
155
+ declare function ChatRoomMapViewGetConnectivityDirections(X: number, Y: number, Condition: (arg0: number, arg1: number) => boolean): {
156
+ North: boolean;
157
+ South: boolean;
158
+ East: boolean;
159
+ West: boolean;
160
+ };
161
+ /**
162
+ * Returns the object located at a X and Y position on the map, or NULL if nothing
163
+ * @param {number} X - The X position on the map
164
+ * @param {number} Y - The Y position on the map
165
+ * @returns {ChatRoomMapTile | null} - The object at the position
166
+ */
167
+ declare function ChatRoomMapViewGetTileAtPos(X: number, Y: number): ChatRoomMapTile | null;
168
+ /**
169
+ * Returns the object located at a X and Y position on the map, or NULL if nothing
170
+ * @param {number} X - The X position on the map
171
+ * @param {number} Y - The Y position on the map
172
+ * @returns {ChatRoomMapObject | null} - The object at the position
173
+ */
174
+ declare function ChatRoomMapViewGetObjectAtPos(X: number, Y: number): ChatRoomMapObject | null;
175
+ /**
176
+ * Returns TRUE if a given position cannot be entered
177
+ * @param {number} X - The X position on the map
178
+ * @param {number} Y - The Y position on the map
179
+ * @returns {boolean} - TRUE if the position is blocked
180
+ */
181
+ declare function ChatRoomMapViewPositionIsBlocked(X: number, Y: number): boolean;
182
+ /**
183
+ * Returns TRUE if the fog of war feature is currently activated on the map
184
+ * @returns {boolean} - TRUE if fog of war is active
185
+ */
186
+ declare function ChatRoomMapFogIsActive(): boolean;
187
+ /**
188
+ * Returns TRUE if a tile is fully hidden from hide
189
+ * @param {number} X - The X position on the map
190
+ * @param {number} Y - The Y position on the map
191
+ * @returns {boolean} - TRUE if the tile is hidden
192
+ */
193
+ declare function ChatRoomMapViewTileIsHidden(X: number, Y: number): boolean;
194
+ /**
195
+ * Apply a wall "3D" effect on the curent map
196
+ * @param {number} X - The X position on the map
197
+ * @param {number} Y - The Y position on the map
198
+ * @param {number} ScreenX - The X position on the screen
199
+ * @param {number} ScreenY - The Y position on the screen
200
+ * @param {number} TileWidth - The visible width of a tile
201
+ * @param {number} TileHeight - The visible height of a tile
202
+ * @returns {void} - Nothing
203
+ */
204
+ declare function ChatRoomMapViewWallEffect(X: number, Y: number, ScreenX: number, ScreenY: number, TileWidth: number, TileHeight: number): void;
205
+ /**
206
+ * Apply a wall "3D" effect on the curent map
207
+ * @param {number} X - The X position on the map
208
+ * @param {number} Y - The Y position on the map
209
+ * @returns {number} - The effect number
210
+ */
211
+ declare function ChatRoomMapViewFloorWallEffect(X: number, Y: number): number;
212
+ /**
213
+ * Manages collisions, moves the player if she's on a tile that cannot be entered
214
+ * @returns {void} - Nothing
215
+ */
216
+ declare function ChatRoomMapViewCollision(): void;
217
+ /**
218
+ * Find the first {@link ChatRoomCharacter} members at the specified X & Y position
219
+ * @param {number} X - The X position on the screen
220
+ * @param {number} Y - The Y position on the screen
221
+ * @returns {null | Character} A character at the specified X & Y position or, if none can be found, `null`
222
+ */
223
+ declare function ChatRoomMapViewGetCharacterAtPos(X: number, Y: number): null | Character;
224
+ /**
225
+ * Returns a object that contains the entry flag's position with x and y parameters or null if no entry flag is set
226
+ * @returns {ChatRoomMapPos|null}
227
+ */
228
+ declare function ChatRoomMapViewGetEntryFlagPosition(): ChatRoomMapPos | null;
229
+ /**
230
+ * Draw the map grid and character on screen
231
+ * @param {number} Left - The X position on the screen
232
+ * @param {number} Top - The Y position on the screen
233
+ * @param {number} Width - The width size of the drawn map
234
+ * @param {number} Height - The height size of the drawn map
235
+ * @returns {void} - Nothing
236
+ */
237
+ declare function ChatRoomMapViewDrawGrid(Left: number, Top: number, Width: number, Height: number): void;
238
+ /**
239
+ * Sets the next update flag for the room if it's not already set, the delay is 5 seconds
240
+ * @returns {void} - Nothing
241
+ */
242
+ declare function ChatRoomMapViewUpdateFlag(): void;
243
+ /**
244
+ * Sets the next update flags for the player if it's not already set, the delay is 1 seconds for live data and 10 seconds for last map data
245
+ * @param {number} UpdateTimeOffset - A offset for the update time. This can be positive to increase the update time or negative to reduce it.
246
+ * @returns {void} - Nothing
247
+ */
248
+ declare function ChatRoomMapViewUpdatePlayerFlag(UpdateTimeOffset?: number): void;
249
+ /**
250
+ * Updates the room data if needed
251
+ * @returns {void} - Nothing
252
+ */
253
+ declare function ChatRoomMapViewUpdateRoomSync(): void;
254
+ /**
255
+ * Updates the player map data if needed
256
+ * @returns {void} - Nothing
257
+ */
258
+ declare function ChatRoomMapViewUpdatePlayerSync(): void;
259
+ /**
260
+ * Updates a character's map data
261
+ * @param {ServerMapDataResponse} data - Data object containing the new character map data.
262
+ * @returns {void} - Nothing.
263
+ */
264
+ declare function ChatRoomMapViewSyncMapData(data: ServerMapDataResponse): void;
265
+ /**
266
+ * Updates the player last map data if needed
267
+ * @returns {void} - Nothing
268
+ */
269
+ declare function ChatRoomMapViewUpdateLastMapDataSync(): void;
270
+ /**
271
+ * Processes the character movement when the timer has expired
272
+ * @returns {void} - Nothing
273
+ */
274
+ declare function ChatRoomMapViewMovementProcess(): void;
275
+ /**
276
+ * Checks if the player is leashed and if she should follow the leash holder
277
+ * @returns {void} - Nothing
278
+ */
279
+ declare function ChatRoomMapViewLeash(): void;
280
+ /**
281
+ * Draws the map and characters of the chat room map on the left side of the screen
282
+ * @returns {void} - Nothing
283
+ */
284
+ declare function ChatRoomMapViewDraw(): void;
285
+ /**
286
+ * Draws the buttons of the chat room map
287
+ * @returns {void} - Nothing
288
+ */
289
+ declare function ChatRoomMapViewDrawUi(): void;
290
+ /**
291
+ * Change the key of charachter - sender
292
+ * @param {Character} target
293
+ * @param {("gold" | "silver" | "bronze")[]} keys
294
+ */
295
+ declare function ChatRoomMapViewChangeKey(target: Character, keys: ("gold" | "silver" | "bronze")[], boolean: any): void;
296
+ /**
297
+ * Change a key from a character from a hidden message - reciver
298
+ * @param {Character} sender
299
+ * @param {ServerChatRoomMessage} data
300
+ */
301
+ declare function ChatRoomMapViewChangeKeyHiddenMessage(sender: Character, data: ServerChatRoomMessage): void;
302
+ /**
303
+ * Teleport a character to a specific tile
304
+ * @param {Character} target
305
+ * @param {ChatRoomMapPos} position
306
+ */
307
+ declare function ChatRoomMapViewTeleport(target: Character, position: ChatRoomMapPos): void;
308
+ /**
309
+ * Teleport a character to a specific tile from a hidden message
310
+ * @param {Character} sender
311
+ * @param {ServerChatRoomMessage} data
312
+ */
313
+ declare function ChatRoomMapViewTeleportHiddenMessage(sender: Character, data: ServerChatRoomMessage): void;
314
+ /**
315
+ * Check if a tile on the map can be entered by a player, and return the number of milliseconds required to reach it
316
+ * @param {number} X - The X position on the map
317
+ * @param {number} Y - The Y position on the map
318
+ * @returns {number} - The number of milliseconds
319
+ */
320
+ declare function ChatRoomMapViewCanEnterTile(X: number, Y: number): number;
321
+ /**
322
+ * Moves the player
323
+ * @param {"West" | "East" | "North" | "South"} D - The direction being travelled (North, South, East, West)
324
+ * @returns {void} - Nothing
325
+ */
326
+ declare function ChatRoomMapViewMove(D: "West" | "East" | "North" | "South"): void;
327
+ /**
328
+ * Undoes the changes made to the map, from the latest backup in the stack
329
+ * @returns {void} - Nothing
330
+ */
331
+ declare function ChatRoomMapViewUndo(): void;
332
+ declare function ChatRoomMapViewKeyDown(event: KeyboardEvent): boolean;
333
+ declare function ChatRoomMapViewKeyUp(event: KeyboardEvent): boolean;
334
+ /**
335
+ * Handles clicks the chatroom screen view.
336
+ * @returns {void} - Nothing.
337
+ */
338
+ declare function ChatRoomMapViewClick(): void;
339
+ /**
340
+ * Mouse down event is used to draw on screen and handle the tiles buttons
341
+ * @returns {void} - Nothing
342
+ */
343
+ declare function ChatRoomMapViewMouseDown(): void;
344
+ /**
345
+ * Mouse move event is used to draw on screen
346
+ * @returns {void} - Nothing
347
+ */
348
+ declare function ChatRoomMapViewMouseMove(): void;
349
+ declare function ChatRoomMapViewMouseUp(event: MouseEvent | TouchEvent): void;
350
+ declare function ChatRoomMapViewMouseWheel(event: WheelEvent): void;
351
+ /**
352
+ * Copies the current map in the clipboard. Called from the chat field command "mapcopy"
353
+ * @returns {void} - Nothing
354
+ */
355
+ declare function ChatRoomMapViewCopy(): void;
356
+ /**
357
+ * Pastes the current map Param data to load it. Called from the chat field command "mappaste"
358
+ * @param {string} Param - The parameter that comes with the command
359
+ * @returns {void} - Nothing
360
+ */
361
+ declare function ChatRoomMapViewPaste(Param: string): void;
362
+ /**
363
+ * Converts the color in R [0; 255], G [0; 255], B [0; 255], A [0.0; 1.0] format
364
+ * to an HTML color function.
365
+ * @param {[number, number, number, number]} rgba
366
+ * @returns {string}
367
+ */
368
+ declare function RgbaArrayToHTMLColor(rgba: [number, number, number, number]): string;
369
+ declare const ChatRoomMapViewName: "Map";
370
+ declare var ChatRoomMapViewWidth: number;
371
+ declare var ChatRoomMapViewHeight: number;
372
+ declare var ChatRoomMapViewPerceptionRange: number;
373
+ declare var ChatRoomMapViewPerceptionRangeMin: number;
374
+ declare var ChatRoomMapViewPerceptionRangeMax: number;
375
+ declare var ChatRoomMapViewObjectStartID: number;
376
+ declare var ChatRoomMapViewObjectEntryID: number;
377
+ /** @type {"" | "Tile" | "Object" | "TileType" | "ObjectType" | "Effect"} */
378
+ declare var ChatRoomMapViewEditMode: "" | "Tile" | "Object" | "TileType" | "ObjectType" | "Effect";
379
+ /** @type {"" | ChatRoomMapTileType | ChatRoomMapObjectType} */
380
+ declare var ChatRoomMapViewEditSubMode: "" | ChatRoomMapTileType | ChatRoomMapObjectType;
381
+ declare var ChatRoomMapViewEditStarted: boolean;
382
+ /** @type {null | ChatRoomMapDoodad | ChatRoomMapEffect} */
383
+ declare var ChatRoomMapViewEditObject: null | ChatRoomMapDoodad | ChatRoomMapEffect;
384
+ /** @type {number[]} */
385
+ declare var ChatRoomMapViewEditSelection: number[];
386
+ declare var ChatRoomMapViewEditRange: number;
387
+ /** @type {ServerChatRoomMapData[]} */
388
+ declare var ChatRoomMapViewEditBackup: ServerChatRoomMapData[];
389
+ /** @type {null | number} */
390
+ declare var ChatRoomMapViewUpdateRoomNext: null | number;
391
+ /** @type {null | number} */
392
+ declare var ChatRoomMapViewUpdatePlayerNext: null | number;
393
+ /** @type {null | number} */
394
+ declare var ChatRoomMapViewUpdateLastMapDataNext: null | number;
395
+ /** @type {null | Character} */
396
+ declare var ChatRoomMapViewFocusedCharacter: null | Character;
397
+ declare var ChatRoomMapViewFocusedCharacterX: number;
398
+ declare var ChatRoomMapViewFocusedCharacterY: number;
399
+ declare var ChatRoomMapViewSuperPowersActive: boolean;
400
+ declare var ChatRoomMapViewBaseMovementSpeed: number;
401
+ /** @type {null | ChatRoomMapMovement} */
402
+ declare var ChatRoomMapViewMovement: null | ChatRoomMapMovement;
403
+ /** @type {ChatRoomMapType[]} */
404
+ declare var ChatRoomMapViewTypeList: ChatRoomMapType[];
405
+ declare var ChatRoomMapViewUpdatePlayerTime: number;
406
+ declare const ChatRoomMapViewPerceptionRaycastOffset: 0.4999;
407
+ declare const ChatRoomMapViewWhisperRange: 1;
408
+ declare const ChatRoomMapViewInteractionRange: 1;
409
+ declare const ChatRoomMapViewRemoteRange: number;
410
+ /** @type {boolean[]} */
411
+ declare var ChatRoomMapViewVisibilityMask: boolean[];
412
+ /** @type {boolean[]} */
413
+ declare var ChatRoomMapViewAudibilityMask: boolean[];
414
+ declare var ChatRoomMapViewTileFog: string;
415
+ declare var ChatRoomMapViewObjectFog: string;
416
+ declare namespace ChatRoomMapViewKeysPressed {
417
+ let u: boolean;
418
+ let d: boolean;
419
+ let l: boolean;
420
+ let r: boolean;
421
+ }
422
+ declare var ChatRoomMapViewStartOfKeyPress: number;
423
+ declare const ChatRoomMapViewEffectStartID: 10;
424
+ /**
425
+ * A list of predefined lighting effects. May be replaced with a color picker in the future.
426
+ * @type {ChatRoomMapEffect[]}
427
+ * */
428
+ declare const ChatRoomMapViewEffectList: ChatRoomMapEffect[];
429
+ /** @type {ChatRoomMapTile[]} */
430
+ declare const ChatRoomMapViewTileList: ChatRoomMapTile[];
431
+ /** @type {ChatRoomMapObject[]} */
432
+ declare const ChatRoomMapViewObjectList: ChatRoomMapObject[];
433
+ declare namespace ChatRoomMapManager {
434
+ export let Map: {
435
+ /**
436
+ * @type {MapData}
437
+ * private
438
+ */
439
+ _mapData: {
440
+ /**
441
+ * @type {ChatRoomMapEffect[][]}
442
+ */
443
+ effects: ChatRoomMapEffect[][];
444
+ /**
445
+ * Removes all effects from the map.
446
+ */
447
+ removeAllEffects(): void;
448
+ };
449
+ /**
450
+ * @type {number}
451
+ * private
452
+ */
453
+ _dirtyFlags: number;
454
+ /**
455
+ * Get the current active effects array at a given coordinates.
456
+ * @param {number} x
457
+ * @param {number} y
458
+ * @returns {ChatRoomMapEffect[]}
459
+ */
460
+ getEffectsByXY(x: number, y: number): ChatRoomMapEffect[];
461
+ /**
462
+ * Get the current active effects array at a given tile index.
463
+ * @param {number} tileIndex the index of a map tile, as returned by ChatRoomMapViewCoordinatesToIndex.
464
+ * @returns {ChatRoomMapEffect[]}
465
+ */
466
+ getEffectsByIndex(tileIndex: number): ChatRoomMapEffect[];
467
+ /**
468
+ * Sets the list of active effects at given coordinates.
469
+ * @param {number} x
470
+ * @param {number} y
471
+ * @param {ChatRoomMapEffect[]} effects
472
+ * @returns {void}
473
+ */
474
+ setEffectsByXY(x: number, y: number, effects: ChatRoomMapEffect[]): void;
475
+ /**
476
+ * Sets the list of active effects at a given tile index.
477
+ * @param {number} tileIndex
478
+ * @param {ChatRoomMapEffect[]} effects
479
+ * @returns {void}
480
+ */
481
+ setEffectsByIndex(tileIndex: number, effects: ChatRoomMapEffect[]): void;
482
+ /**
483
+ * Clears the list of active effects at given coordinates.
484
+ * @param {number} x
485
+ * @param {number} y
486
+ * @returns {void}
487
+ */
488
+ clearEffectsByXY(x: number, y: number): void;
489
+ /**
490
+ * Clears the list of active effects at a given tile index.
491
+ * @param {number} tileIndex
492
+ * @returns {void}
493
+ */
494
+ clearEffectsByIndex(tileIndex: number): void;
495
+ /**
496
+ * Returns the effects list for each tile in the map, one array element per tile.
497
+ * Currently for efficiency does not copy the underlying array.
498
+ * The users must not modify the returned array directly.
499
+ * @return {ChatRoomMapEffect[][]}
500
+ */
501
+ getAllEffects(): ChatRoomMapEffect[][];
502
+ /**
503
+ * Replaces all current effects with the parsed effects array.
504
+ * For efficiency does not copy the passed effects.
505
+ * The users must not modify the passed effects array afterward.
506
+ * @param {ChatRoomMapEffect[][]} effectsList
507
+ * @returns {void}
508
+ */
509
+ replaceAllEffects(effectsList: ChatRoomMapEffect[][]): void;
510
+ /**
511
+ * Removes all effects from the map.
512
+ * @returns {void}
513
+ */
514
+ removeAllEffects(): void;
515
+ /**
516
+ * Mark a specific part of the map data as dirty, that is, changed and not yet synchronized with the server.
517
+ * @param {number} flag
518
+ * private
519
+ */
520
+ _markDirty(flag: number): void;
521
+ /**
522
+ * Marks a specific part of the map data as clean, that is, synchronized with the server.
523
+ * @returns {void}
524
+ */
525
+ _markClean(flag: any): void;
526
+ /**
527
+ * Marks the current effects data as dirty, that is, changed and not yet synchronized with the server.
528
+ * @returns {void}
529
+ */
530
+ markDirtyEffects(): void;
531
+ /**
532
+ * Marks the current effects data as clean, that is, synchronized with the server.
533
+ * @returns {void}
534
+ */
535
+ markCleanEffects(): void;
536
+ /**
537
+ * Checks whether the current effects data is dirty, that is, whether it needs
538
+ * to be synchronized with the server.
539
+ * @returns {boolean}
540
+ */
541
+ isDirtyEffects(): boolean;
542
+ /**
543
+ * Marks the current tiles data as dirty, that is, changed and not yet synchronized with the server.
544
+ * @returns {void}
545
+ */
546
+ markDirtyTiles(): void;
547
+ /**
548
+ * Marks the current tiles data as clean, that is, synchronized with the server.
549
+ * @returns {void}
550
+ */
551
+ markCleanTiles(): void;
552
+ /**
553
+ * Checks whether the current tiles data is dirty, that is, whether it needs
554
+ * to be synchronized with the server.
555
+ * @returns {boolean}
556
+ */
557
+ isDirtyTiles(): boolean;
558
+ /**
559
+ * Marks the current objects data as dirty, that is, changed and not yet synchronized with the server.
560
+ * @returns {void}
561
+ */
562
+ markDirtyObjects(): void;
563
+ /**
564
+ * Marks the current objects data as clean, that is, synchronized with the server.
565
+ * @returns {void}
566
+ */
567
+ markCleanObjects(): void;
568
+ /**
569
+ * Checks whether the current objects data is dirty, that is, whether it needs
570
+ * to be synchronized with the server.
571
+ * @returns {boolean}
572
+ */
573
+ isDirtyObjects(): boolean;
574
+ /**
575
+ * Mark all data in the current map as clean.
576
+ * @returns {void}
577
+ */
578
+ markCleanAll(): void;
579
+ /**
580
+ * Exports the current map data, including the tiles/objects,
581
+ * as a string that could be copied and stored by the players.
582
+ * @returns {string | undefined} the exported string, or `undefined`
583
+ * if there was an error while exporting the map.
584
+ */
585
+ exportString(): string | undefined;
586
+ /**
587
+ * Imports the map string that was exported earlier with {@link MapManager.exportString}
588
+ * method.
589
+ *
590
+ * This method must be as much compatible as possible, recovering as much information
591
+ * as possible from the exported map strings from any previous version of the game
592
+ * to prevent the players losing their stored maps.
593
+ *
594
+ * This method modifies the state of the current map and returns `true` in case of a successful import.
595
+ * If the string is malformed and cannot be parsed, the method returns `false` and doesn't modify
596
+ * any state.
597
+ * @param {string} mapString
598
+ * @returns {boolean} `true` if the string was successfully parsed and the current map data is updated,
599
+ * `false` otherwise
600
+ */
601
+ importString(mapString: string): boolean;
602
+ /**
603
+ * Encodes the current map data and updates the global {@link ChatRoomData.MapData} value.
604
+ * This function must be called after the map was changed and before it is sent to the server.
605
+ * Ideally we want to have a single function to build the encoded map data only
606
+ * when required, but it would require a significant API change of the outside code.
607
+ *
608
+ * For places where the synchronization happens, see {@link ChatRoomGetSettings} usages.
609
+ *
610
+ * This function is not supposed to fail; if it indicates an error by returning `false`,
611
+ * this means we have a bug in our code.
612
+ * @return {boolean} `true` if we successfully encoded the map data; `false` if
613
+ * there was an error and the global state remains unchanged.
614
+ */
615
+ updateGlobalMapData(): boolean;
616
+ /**
617
+ * Loads the data from {@link ChatRoomData.MapData} and replaces the current map data with the one
618
+ * stored in it.
619
+ * @return {boolean} `true` if the global map data was parsed successfully. `false` if
620
+ * the global map data is invalid, no data is changed in this case.
621
+ */
622
+ loadGlobalMapData(): boolean;
623
+ /**
624
+ * @returns {string | undefined}
625
+ * private
626
+ */
627
+ _encodeEffects(): string | undefined;
628
+ /**
629
+ * @param {string | undefined} str
630
+ * @returns {ChatRoomMapEffect[][] | undefined}
631
+ * private
632
+ */
633
+ _decodeEffects(str: string | undefined): ChatRoomMapEffect[][] | undefined;
634
+ };
635
+ export { OnMapDataUpdated };
636
+ export { OnViewActivate };
637
+ }
638
+ /**
639
+ * This function should be called each time the external code updates {@link ChatRoomData.MapData}.
640
+ *
641
+ * This function decodes the updated map data and replaces
642
+ * the data stored in ${@link ChatRoomMapManager.Map} with the decoded map.
643
+ * @returns {void}
644
+ */
645
+ declare function OnMapDataUpdated(): void;
646
+ /**
647
+ * Initializes the map with the current global data if needed.
648
+ * Must be called in {@link ChatRoomMapViewActivate}.
649
+ * @returns {void}
650
+ */
651
+ declare function OnViewActivate(): void;
@@ -141,7 +141,7 @@ declare let CommandsKey: string;
141
141
  declare let CommandText: TextCache;
142
142
  declare namespace CommandsHelp {
143
143
  /**
144
- * @private
144
+ * private
145
145
  * @param {HTMLElement} help
146
146
  */
147
147
  function _Publish(help: HTMLElement): void;