bc-stubs 116.0.0 → 117.0.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.
@@ -302,6 +302,7 @@ declare namespace AssetPoseMapping {
302
302
  let Yoked_8: "Yoked";
303
303
  export { Yoked_8 as Yoked };
304
304
  }
305
+ let ItemHead: {};
305
306
  namespace ItemLegs {
306
307
  let AllFours_15: "Hide";
307
308
  export { AllFours_15 as AllFours };
@@ -287,13 +287,23 @@ interface AssetGroupDefinitionBase extends AssetCommonPropertiesGroupAsset, Asse
287
287
  */
288
288
  Clothing?: boolean;
289
289
 
290
- // Set to TRUE if all assets in that group should allow editing opacity, set value on asset level to override
290
+ /**
291
+ * Set to TRUE if all assets in that group should allow editing opacity, set value on asset level to override
292
+ *
293
+ * @default false
294
+ */
291
295
  EditOpacity?: boolean;
292
296
 
293
- // The default minimum opacity for that group, set value on asset level to override
297
+ /**
298
+ * The default minimum opacity for that group, set value on asset level to override
299
+ * @default 1
300
+ */
294
301
  MinOpacity?: number;
295
302
 
296
- // The default maximum opacity for that group, set value on asset level to override
303
+ /**
304
+ * The default maximum opacity for that group, set value on asset level to override
305
+ * @default 1
306
+ */
297
307
  MaxOpacity?: number;
298
308
 
299
309
  /** Whether the group is considered underwear
@@ -521,6 +531,12 @@ interface AssetDefinitionBase extends AssetCommonPropertiesGroupAsset, AssetComm
521
531
  /** A list of screens where current asset won't be shown. */
522
532
  NotVisibleOnScreen?: string[];
523
533
 
534
+ /** A list of Asset Groups to overwrite. */
535
+ StyleOverride?: string[];
536
+
537
+ /** A list of supported styles, anything not listed will be excluded */
538
+ SupportedStyles?: string[];
539
+
524
540
  /**
525
541
  * Whether the asset can be worn.
526
542
  *
@@ -809,7 +825,7 @@ type AssetDefinition = (
809
825
  interface AssetLayerMaskTexureDefinition {
810
826
  /** The groups that will be affected */
811
827
  Groups?: AssetGroupName[];
812
- /** If true, the texture mask will apply to all layers in the groups specified, event if their priority is higher than the mask layer */
828
+ /** If true, the texture mask will apply to all layers in the groups specified, event if their priority is higher than the mask layer */
813
829
  ApplyToAbove?: boolean;
814
830
  }
815
831
 
@@ -2,6 +2,16 @@
2
2
 
3
3
  type MemberNumber = number;
4
4
 
5
+ type ChatRoomMapPos = {
6
+ X: number;
7
+ Y: number;
8
+ }
9
+
10
+ type ChatRoomMapData = {
11
+ Pos: ChatRoomMapPos
12
+ PrivateState: Record<string, Object>
13
+ }
14
+
5
15
  interface ServerAccountImmutableData {
6
16
  /** Socket ID */
7
17
  ID: string;
@@ -153,7 +163,7 @@ type ServerItemPermissionsPacked = Partial<Record<AssetGroupName, Record<string,
153
163
 
154
164
  interface ServerMapDataResponse {
155
165
  MemberNumber: number;
156
- MapData: ChatRoomMapPos;
166
+ MapData: ChatRoomMapData;
157
167
  }
158
168
 
159
169
  type ServerAccountDataSynced = Omit<ServerAccountData, "Money" | "FriendList" | "AccountName">;
@@ -1075,7 +1085,7 @@ interface ClientToServerEvents {
1075
1085
  ChatRoomCharacterPoseUpdate: (data: ServerCharacterPoseUpdate) => void;
1076
1086
  ChatRoomCharacterArousalUpdate: (data: ServerCharacterArousalUpdate) => void;
1077
1087
  ChatRoomCharacterItemUpdate: (data: ServerCharacterItemUpdate) => void;
1078
- ChatRoomCharacterMapDataUpdate: (data: ChatRoomMapPos) => void;
1088
+ ChatRoomCharacterMapDataUpdate: (data: ChatRoomMapData) => void;
1079
1089
 
1080
1090
  ChatRoomAdmin: (data: ServerChatRoomAdminRequest) => void;
1081
1091
  ChatRoomAllowItem: (data: ServerChatRoomAllowItemRequest) => void;
@@ -0,0 +1,10 @@
1
+ declare namespace Timer {
2
+ type CustomTimerType = 'background' | 'foreground' | 'universal';
3
+ type CustomTimer = {
4
+ callback: () => void;
5
+ timeMs: number;
6
+ repeat: boolean;
7
+ type: CustomTimerType;
8
+ lastTime: number;
9
+ };
10
+ }
@@ -0,0 +1,73 @@
1
+ declare namespace Toasts {
2
+ /**
3
+ * Defines the type and style of a toast notification.
4
+ * Includes standard types like 'info', 'success', 'warning', 'error',
5
+ * and allows for custom string-based types.
6
+ */
7
+ type Type = 'info' | 'success' | 'warning' | 'error' | (string & {});
8
+
9
+ /**
10
+ * Describes why a toast was closed.
11
+ * Includes predefined reasons like 'timeout', 'manual', 'click', 'external',
12
+ * and allows for custom string-based reasons.
13
+ * Used in the {@link Toasts.Options.onClose} callback.
14
+ */
15
+ type CloseReason = 'timeout' | 'click' | 'external' | (string & {});
16
+
17
+ /**
18
+ * Describes the color of an icon. Might help when default icons looks like shit.
19
+ * 'accent' is the same as the accent color of the toast, e.g. text.
20
+ */
21
+ type IconColor = 'black' | 'white' | 'accent' | 'default';
22
+
23
+ /** Configuration options for displaying a toast notification. */
24
+ interface Options {
25
+ /** Text content of the toast. */
26
+ message: string;
27
+ /** Title of the toast. */
28
+ title?: string;
29
+ /** Type and style of the toast. */
30
+ type?: Type;
31
+ /** How long (in milliseconds) the toast remains visible. */
32
+ duration?: number;
33
+ /** Whether to show a progress bar. */
34
+ progress?: boolean;
35
+ /** Whether to stop the progress bar animation when the mouse hovers over the toast. */
36
+ stopProgressOnHover?: boolean;
37
+ /** Callback when the toast is clicked. */
38
+ onClick?: (ev: MouseEvent, toast: ToastElement) => void;
39
+ /** Callback when the toast is displayed. */
40
+ onShow?: (toast: ToastElement) => void;
41
+ /** Callback when the toast is closed, with a reason. */
42
+ onClose?: (toast: ToastElement, reason: CloseReason) => void;
43
+ /** Optional icon to display alongside the message. */
44
+ icon?: string;
45
+ /** Optional icon color. */
46
+ iconColor?: IconColor;
47
+ /** Optional array of action buttons to render inside the toast. */
48
+ buttons?: ToastButton[];
49
+ }
50
+ /**
51
+ * Defines a button to be rendered inside a toast notification.
52
+ * - label:
53
+ * - onClick:
54
+ */
55
+ interface ToastButton {
56
+ /** Text displayed on the button. */
57
+ label: string;
58
+ /** Handler invoked when the button is clicked.
59
+ * The `this` context is bound to the actual HTMLButtonElement created for this toast. */
60
+ onClick: (this: HTMLButtonElement, ev: MouseEvent, toast: ToastElement) => void;
61
+ }
62
+
63
+ /**
64
+ * Represents the DOM element for a rendered toast.
65
+ * Extends HTMLDivElement and may include an internal `_dismiss` method
66
+ * that can be programmatically called to close the toast with a given reason.
67
+ */
68
+ interface ToastElement extends HTMLDivElement {
69
+ _dismiss?: (reason: CloseReason) => void;
70
+ }
71
+
72
+ }
73
+
@@ -186,6 +186,8 @@ declare namespace ElementButton {
186
186
  * Setting this option to `true` disables that behavior, clicking an already enabled button thus firing its click events once again rather than aborting.
187
187
  */
188
188
  allowRequiredClick?: boolean;
189
+ /** The {@link HTMLButtonElement.name} of the button */
190
+ name?: string;
189
191
  }
190
192
  }
191
193
 
@@ -203,6 +205,16 @@ declare namespace ElementCheckbox {
203
205
  * Defaults to `"on"` if not specified.
204
206
  */
205
207
  value?: string | number;
208
+ /** Whether the checkbox should serve as a checkbox or radio button */
209
+ type?: "checkbox" | "radio";
210
+ /** If a `radio` {@link Options.type} is specified, this mandates that a radio _must_ be selected within its {@link Options.name}-defined group */
211
+ required?: boolean;
212
+ /**
213
+ * The name of the input.
214
+ *
215
+ * Particularly important when a `radio` {@link Options.type} is specified, as all radios with the same name define a group of options.
216
+ */
217
+ name?: string;
206
218
  }
207
219
  }
208
220
 
@@ -524,8 +536,8 @@ type AssetGroupScriptName = 'ItemScript';
524
536
 
525
537
  type AssetGroupBodyName =
526
538
  ExpressionGroupName | 'AnkletLeft' | 'AnkletRight' | 'ArmsLeft' | 'ArmsRight' |
527
- 'BodyLower' | 'BodyUpper' | 'BodyMarkings' | 'Bra' | 'Bracelet' | 'Cloth' |
528
- 'ClothAccessory' | 'ClothLower' | 'Corset' | 'EyeShadow' | 'FacialHair' | 'Garters' | 'Glasses' | 'Gloves' |
539
+ 'BodyStyle' | 'BodyLower' | 'BodyUpper' | 'BodyMarkings' | 'Bra' | 'Bracelet' | 'Cloth' |
540
+ 'ClothAccessory' | 'ClothLower' | 'ClothOuter' | 'Corset' | 'EyeShadow' | 'FacialHair' | 'Garters' | 'Glasses' | 'Gloves' |
529
541
  'HairAccessory1' | 'HairAccessory2' | 'HairAccessory3' | 'HairBack' |
530
542
  'HairFront' | 'HandAccessoryLeft' | 'HandAccessoryRight' | 'FacialHair' | 'Hat' | 'Head' | 'Height' | 'Jewelry' | 'Mask' |
531
543
  'Necklace' | 'Nipples' | 'Panties' | 'Pronouns' |
@@ -1034,6 +1046,8 @@ interface AssetGroup {
1034
1046
  readonly FreezeActivePose?: never;
1035
1047
  readonly PreviewZone?: RectTuple;
1036
1048
  readonly DynamicGroupName: AssetGroupName;
1049
+ readonly StyleOverride?: string [];
1050
+ readonly SupportedStyles?: string [];
1037
1051
 
1038
1052
  readonly MirrorActivitiesFrom?: AssetGroupItemName;
1039
1053
  readonly ArousalZone?: AssetGroupItemName;
@@ -1223,6 +1237,8 @@ interface Asset {
1223
1237
  readonly HideItemAttribute: readonly AssetAttribute[];
1224
1238
  readonly Require: readonly AssetGroupBodyName[];
1225
1239
  readonly SetPose?: readonly AssetPoseName[];
1240
+ readonly StyleOverride?: string[];
1241
+ readonly SupportedStyles?: string[];
1226
1242
  /** @deprecated - Superceded by {@link Asset.PoseMapping} */
1227
1243
  readonly AllowPose?: never;
1228
1244
  /** @deprecated - Superceded by {@link Asset.PoseMapping} */
@@ -2348,7 +2364,8 @@ interface GameplaySettingsType {
2348
2364
  interface AudioSettingsType {
2349
2365
  Volume: number;
2350
2366
  MusicVolume: number;
2351
- PlayBeeps: boolean;
2367
+ /** @deprecated */
2368
+ PlayBeeps: never;
2352
2369
  /** Play items sounds in chatrooms */
2353
2370
  PlayItem: boolean;
2354
2371
  /** Play sounds only if the player is involved */
@@ -4246,6 +4263,45 @@ interface CratingValidationStruct {
4246
4263
  StatusCode: CraftingStatusType;
4247
4264
  }
4248
4265
 
4266
+ declare namespace CraftingJSON {
4267
+ /** The data structure as returned by {@link CraftingJSON.encode} */
4268
+ export interface DataEncoded {
4269
+ /** The version of the file format */
4270
+ version: 1;
4271
+ /** The date & time on which the crafts were exported (see {@link Date.toLocaleString}) */
4272
+ date: string;
4273
+ /** A list of base64-encoded {@link CraftingItem} object strings or null if the craft is empty */
4274
+ crafts: (null | string)[];
4275
+ }
4276
+
4277
+ export interface DataDecoded extends Omit<DataEncoded, "crafts" | "date"> {
4278
+ crafts: (null | CraftingItem)[];
4279
+ }
4280
+
4281
+ interface ParsingOutputBase {
4282
+ /** The status code */
4283
+ status: CraftingStatusType;
4284
+ /** All crafted item indices within the `data.crafts` list that encountered a critical error during their validation */
4285
+ errors?: Set<number>;
4286
+ /** The decoded crafted item JSON data */
4287
+ data?: CraftingJSON.DataDecoded;
4288
+ }
4289
+
4290
+ interface ParsingOutputErr extends ParsingOutputBase {
4291
+ status: 0;
4292
+ errors?: never;
4293
+ data?: never;
4294
+ }
4295
+
4296
+ interface ParsingOutputOk extends Required<ParsingOutputBase> {
4297
+ status: 1 | 2;
4298
+ }
4299
+
4300
+ /** A status object based on the stringified JSON data as decoded by {@link CraftingJSON.decode} */
4301
+ export type ParsingOutput = ParsingOutputErr | ParsingOutputOk;
4302
+ }
4303
+
4304
+
4249
4305
  //#endregion
4250
4306
 
4251
4307
  //#region Color
@@ -4446,6 +4502,10 @@ interface NotificationData {
4446
4502
  memberNumber?: number,
4447
4503
  characterName?: string,
4448
4504
  chatRoomName?: string,
4505
+ /**
4506
+ * If this is set, the beep sound will ring even if we have focus
4507
+ */
4508
+ alarmWhenFocused?: boolean,
4449
4509
  }
4450
4510
 
4451
4511
  interface NotificationBeep {
@@ -4795,16 +4855,6 @@ interface ChatRoomView extends Pick<ScreenFunctions, "Run" | "MouseDown" | "Mous
4795
4855
 
4796
4856
  type ChatRoomMapType = "Always" | "Hybrid" | "Never";
4797
4857
 
4798
- type ChatRoomMapPos = {
4799
- X: number;
4800
- Y: number;
4801
- }
4802
-
4803
- type ChatRoomMapData = {
4804
- Pos: ChatRoomMapPos
4805
- PrivateState: Record<string, Object>
4806
- }
4807
-
4808
4858
  type ChatRoomMapDirection = "" | "R" | "L" | "D" | "U";
4809
4859
 
4810
4860
  type ChatRoomMapObjectType = (
@@ -20,6 +20,10 @@ declare function FriendListBeepMenuClose(): void;
20
20
  * Sends the beep and message on send click
21
21
  */
22
22
  declare function FriendListBeepMenuSend(): void;
23
+ /**
24
+ * Opens the friendlist from any screen
25
+ */
26
+ declare function FriendListShow(): void;
23
27
  /**
24
28
  * Shows the wanted beep on click from beep list
25
29
  * @param {number} i index of the beep
@@ -245,8 +245,8 @@ declare function ChatRoomMapViewUpdateRoomSync(): void;
245
245
  */
246
246
  declare function ChatRoomMapViewUpdatePlayerSync(): void;
247
247
  /**
248
- * Updates a single character's expression in the chatroom.
249
- * @param {ServerMapDataResponse} data - Data object containing the new character expression data.
248
+ * Updates a character's map data
249
+ * @param {ServerMapDataResponse} data - Data object containing the new character map data.
250
250
  * @returns {void} - Nothing.
251
251
  */
252
252
  declare function ChatRoomMapViewSyncMapData(data: ServerMapDataResponse): void;
@@ -0,0 +1,86 @@
1
+ declare namespace CraftingJSON {
2
+ let _craftListCache: null | {
3
+ name: string;
4
+ status: CraftingStatusType;
5
+ craft: null | CraftingItem;
6
+ }[];
7
+ /** Get the event listeners for drag and dropping */
8
+ function getDragListeners(): {
9
+ dragenter: (this: HTMLElement, ev: DragEvent) => void;
10
+ dragleave: (this: HTMLElement, ev: DragEvent) => void;
11
+ dragstart: (this: HTMLElement, ev: DragEvent) => void;
12
+ };
13
+ /**
14
+ * @private
15
+ * @param {Element} fieldset
16
+ * @param {Element} radioContainer
17
+ * @param {Map<{ inputNew: HTMLInputElement, inputOld: HTMLInputElement }, boolean>} checkLog
18
+ */
19
+ function _queueAdvance(fieldset: Element, radioContainer: Element, checkLog: Map<{
20
+ inputNew: HTMLInputElement;
21
+ inputOld: HTMLInputElement;
22
+ }, boolean>): void;
23
+ namespace eventListeners {
24
+ function focusTooltip(this: HTMLElement): void;
25
+ function blurTooltip(this: HTMLElement): void;
26
+ function hoverinTooltip(this: HTMLElement): void;
27
+ function hoveroutTooltip(this: HTMLElement): void;
28
+ function dragover(this: HTMLElement, ev: DragEvent): void;
29
+ function drop(this: HTMLElement, ev: DragEvent): void;
30
+ function dragend(this: HTMLElement, ev: DragEvent): void;
31
+ function clickCancel(this: HTMLElement): void;
32
+ function clickAccept(this: HTMLElement, ev: Event): void;
33
+ let changeFile: (this: HTMLInputElement) => Promise<void>;
34
+ function inputFile(this: HTMLInputElement): void;
35
+ function clickSelectNew(this: HTMLElement): void;
36
+ function clickSelectOld(this: HTMLElement): void;
37
+ function clickError(this: HTMLElement): void;
38
+ function inputSearch(this: HTMLInputElement): void;
39
+ function focusSearch(this: HTMLInputElement): void;
40
+ function keydownDocument(this: Document, ev: KeyboardEvent): void;
41
+ function pasteDocument(this: Document, ev: ClipboardEvent): void;
42
+ }
43
+ /**
44
+ * Encode the passed list of crafting items into a JSON-valid object
45
+ * @param {readonly (null | CraftingItem)[]} crafts - The list of crafting items
46
+ * @returns {CraftingJSON.DataEncoded} The encoded object of JSON-valid crafts
47
+ */
48
+ function encode(crafts: readonly (null | CraftingItem)[]): CraftingJSON.DataEncoded;
49
+ /**
50
+ * Decode the passed stringified object of crafting JSON data
51
+ * @param {string} craftsJSON - The stringified and to-be decoded crafted JSON data
52
+ * @returns {CraftingJSON.ParsingOutput} - The decoded crafted JSON data
53
+ */
54
+ function decode(craftsJSON: string): CraftingJSON.ParsingOutput;
55
+ /**
56
+ * Return a single `<label>`-embedded `<input type="radio">` element
57
+ * @param {null | CraftingItem} craft
58
+ * @param {string} tooltipID
59
+ * @param {{ name: string, checked: boolean, disabled: boolean, value: string }} options
60
+ * @returns {HTMLElement}
61
+ */
62
+ function createRadio(craft: null | CraftingItem, tooltipID: string, options: {
63
+ name: string;
64
+ checked: boolean;
65
+ disabled: boolean;
66
+ value: string;
67
+ }): HTMLElement;
68
+ /**
69
+ * Return a list of `<input type="radio">`-containing `<fieldset>` elements
70
+ * @param {readonly { name: string, status: CraftingStatusType, craft: null | CraftingItem }[]} items
71
+ * @param {Node} tooltipContainer
72
+ */
73
+ function createRadioGroups(items: readonly {
74
+ name: string;
75
+ status: CraftingStatusType;
76
+ craft: null | CraftingItem;
77
+ }[], tooltipContainer: Node): HTMLFieldSetElement[];
78
+ /**
79
+ * Create and return the `<dialog>` and its shadowroot-containing `<div>` parent
80
+ * @param {null | Node} parent The parent node, if any
81
+ */
82
+ function createDialog(parent?: null | Node): {
83
+ root: HTMLDivElement;
84
+ dialog: HTMLDialogElement;
85
+ };
86
+ }
@@ -1,3 +1,4 @@
1
+ declare function CommonPrefersReducedMotion(): boolean;
1
2
  /**
2
3
  * Checks if a variable is a number
3
4
  * @param {any} n - Variable to check for
@@ -29,14 +30,17 @@ declare function CommonGetBrowser(): {
29
30
  */
30
31
  declare function CommonParseCSV(str: string): string[][];
31
32
  /**
32
- * Read a CSV file from cache, or fetch it from the server
33
- * @param {string} Array - Name of where the cached text is stored
34
- * @param {string} Path - Path/Group in which the screen is located
35
- * @param {string} Screen - Screen for which the file is for
36
- * @param {string} File - Name of the file to get
37
- * @returns {void} - Nothing
33
+ * Read a CSV file from the server
34
+ *
35
+ * If the file has been cached already it'll use that.
36
+ *
37
+ * @warning Note that due to the way fetching is async, the
38
+ * array you'll get back won't be populated until the fetch completes
39
+ *
40
+ * @param {string} url - URL to load
41
+ * @returns {string[][]}
38
42
  */
39
- declare function CommonReadCSV(Array: string, Path: string, Screen: string, File: string): void;
43
+ declare function CommonReadCSV(url: string): string[][];
40
44
  /**
41
45
  * AJAX utility to get a file and return its content. By default will retry requests 10 times
42
46
  * @param {string} Path - Path of the resource to request
@@ -576,11 +580,46 @@ declare function CommonVariableContainer<T1, T2 = {}>(defaults: T1, extraVars?:
576
580
  replacer?: (this: any, key: string, value: any) => any;
577
581
  reviver?: (this: any, key: string, value: any) => any;
578
582
  }): VariableContainer<T1, T2>;
583
+ /**
584
+ * Partition the string into separate parts using the given replacer keys, replacing them with replacer values
585
+ * @template T
586
+ * @param {string} string
587
+ * @param {Record<string, T>} replacers
588
+ * @returns {(string | T)[]}
589
+ */
590
+ declare function CommonStringPartitionReplace<T>(string: string, replacers: Record<string, T>): (string | T)[];
579
591
  /**
580
592
  *
581
593
  * @param {RoomName} screen
582
594
  */
583
595
  declare function CommonScreenName(screen: RoomName): string;
596
+ /**
597
+ * Generates the path to a translation CSV file for a screen
598
+ *
599
+ * @param {string} [module] - The screen's module
600
+ * @param {string} [screen] - The screen's name
601
+ * @param {string} [group] - The text group
602
+ * @returns {string | undefined}
603
+ */
604
+ declare function ScreenFileGetTranslation(module?: string, screen?: string, group?: string): string | undefined;
605
+ /**
606
+ * Generates the path to a CSV Dialog file for a screen
607
+ *
608
+ * @param {string} npcType - The dialog file name
609
+ * @param {string} [module] - The screen's module
610
+ * @param {string} [screen] - The screen's name
611
+ * @returns {string}
612
+ */
613
+ declare function ScreenFileGetDialog(npcType: string, module?: string, screen?: string): string;
614
+ /**
615
+ * Generate a path to one of our Screen assets
616
+ *
617
+ * @param {string} file
618
+ * @param {string} [module]
619
+ * @param {string} [screen]
620
+ * @returns
621
+ */
622
+ declare function ScreenFileGetPath(file: string, module?: string, screen?: string): string;
584
623
  /** @type {PlayerCharacter} */
585
624
  declare var Player: PlayerCharacter;
586
625
  /**
@@ -684,3 +723,12 @@ declare namespace CommonKey {
684
723
  */
685
724
  function NavigationKeyDown(scrollableElem: HTMLElement, event: KeyboardEvent, getArrowScrollDistance: (scrollableElem: HTMLElement) => number): boolean;
686
725
  }
726
+ /**
727
+ * Escapes any potential regex syntax characters in a string, and returns a new string that can be safely used as a literal pattern for the {@link RegExp} constructor.
728
+ * @license MIT - Copyright (c) 2014-2025 Denis Pushkarev, core-js 3.40.0 - 2025.01.08
729
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/escape
730
+ * @see https://github.com/zloirock/core-js/blob/v3.40.0/packages/core-js/modules/esnext.regexp.escape.js
731
+ * @param S The string to escape.
732
+ * @returns A new string that can be safely used as a literal pattern for the {@link RegExp} constructor.
733
+ */
734
+ declare var CommonRegEscape: Function;
@@ -4,6 +4,15 @@
4
4
  * @returns {void} - Nothing
5
5
  */
6
6
  declare function CommonDrawCanvasPrepare(C: Character): void;
7
+ /**
8
+ * @param {Character} C - The character to prepare
9
+ * @param {AssetGroup} group - The asset group
10
+ * @param {AssetGroupName} groupName - The asset group.
11
+ * @param {AssetPoseName | PoseType} pose - The pose the user is in.
12
+ * @param {Asset} asset - target asset
13
+ * @returns {string} baseURL - URL pointing to asset art to load
14
+ */
15
+ declare function AssetBaseURL(C: Character, group: AssetGroup, groupName: AssetGroupName, pose: AssetPoseName | PoseType, asset: Asset): string;
7
16
  /**
8
17
  * @typedef { Map<AssetGroupName, TextureAlphaMask[]> } MaskLayersMap
9
18
  * @param {Character} C - The character to prepare
@@ -225,6 +225,14 @@ declare function ElementCreateSearchInput(id: string | null, dataCallback: () =>
225
225
  parent?: null | Node;
226
226
  maxLength?: null | number;
227
227
  }): HTMLInputElement;
228
+ /**
229
+ * Returns the element's document- or shadow-root.
230
+ *
231
+ * If an element is not part of the DOM tree, thus lacking a document- or shadow-root, then {@link document} is returned.
232
+ * @param {Node} elem
233
+ * @returns {Document | ShadowRoot}
234
+ */
235
+ declare function ElementGetRoot(elem: Node): Document | ShadowRoot;
228
236
  /**
229
237
  * Return whether an element is visible or not.
230
238
  *
@@ -345,7 +353,7 @@ declare namespace ElementButton {
345
353
  let _KeyDown: (this: HTMLButtonElement, ev: KeyboardEvent) => Promise<void>;
346
354
  let _KeyUp: (this: HTMLButtonElement, ev: KeyboardEvent) => Promise<void>;
347
355
  function _MouseDown(this: HTMLButtonElement, ev: MouseEvent): void;
348
- function _MouseUp(this: Document, ev: MouseEvent): void;
356
+ function _MouseUp(this: Document | ShadowRoot, ev: MouseEvent): void;
349
357
  function _GetClickTouchListeners(): {
350
358
  click: (this: HTMLButtonElement, ev: MouseEvent | PointerEvent) => void;
351
359
  touchend: (this: HTMLButtonElement, ev: TouchEvent) => void;
@@ -421,6 +429,11 @@ declare namespace ElementButton {
421
429
  * @returns {HTMLButtonElement} - The created button
422
430
  */
423
431
  function CreateForAsset(idPrefix: string | null, asset: Asset | Item, C: null | Character, onClick: (this: HTMLButtonElement, ev: MouseEvent | TouchEvent) => any, options?: null | ElementButton.Options, htmlOptions?: null | Partial<Record<"button" | "tooltip" | "img" | "label", Omit<HTMLOptions<any>, "tag">>>): HTMLButtonElement;
432
+ /**
433
+ * @param {CraftingItem} craft
434
+ * @returns {HTMLElement[]}
435
+ */
436
+ function CreateCraftTooltipContent(craft: CraftingItem): HTMLElement[];
424
437
  /**
425
438
  * Create a button for an activity, including image, label and icons.
426
439
  * @param {string | null} idPrefix - The ID of the to-be created search button
@@ -487,12 +500,14 @@ declare namespace ElementMenu {
487
500
  export function PrependItem(menu: HTMLElement, ...menuitems: readonly HTMLElement[]): void;
488
501
  }
489
502
  declare namespace ElementCheckbox {
503
+ function _pointerdown(this: HTMLInputElement, ev: PointerEvent): void;
504
+ function _pointerup(this: Document | ShadowRoot, ev: PointerEvent): void;
490
505
  /**
491
506
  * Construct an return a DOM checkbox element (`<input type="checkbox">`)
492
507
  * @param {null | string} id - The ID of the element, or `null` if one must be assigned automatically
493
- * @param {(this: HTMLInputElement, ev: Event) => any} onChange - The change event listener to-be fired upon checkbox clicks
508
+ * @param {null | ((this: HTMLInputElement, ev: Event) => any)} onChange - The change event listener to-be fired upon checkbox clicks
494
509
  * @param {null | ElementCheckbox.Options} options - High level options for the to-be created checkbox
495
510
  * @param {null | Partial<Record<"checkbox", Omit<HTMLOptions<any>, "tag">>>} htmlOptions - Additional {@link ElementCreate} options to-be applied to the respective (child) element
496
511
  */
497
- function Create(id: null | string, onChange: (this: HTMLInputElement, ev: Event) => any, options?: null | ElementCheckbox.Options, htmlOptions?: null | Partial<Record<"checkbox", Omit<HTMLOptions<any>, "tag">>>): HTMLElement;
512
+ function Create(id?: null | string, onChange?: null | ((this: HTMLInputElement, ev: Event) => any), options?: null | ElementCheckbox.Options, htmlOptions?: null | Partial<Record<"checkbox", Omit<HTMLOptions<any>, "tag">>>): HTMLElement;
498
513
  }
@@ -189,23 +189,44 @@ declare function ServerAccountQueryResult(data: ServerAccountQueryResponse): voi
189
189
  * @returns {void} - Nothing
190
190
  */
191
191
  declare function ServerAccountBeep(data: ServerAccountBeepResponse): void;
192
+ /**
193
+ * Send a beep message to another player
194
+ * @param {number} target - The member number of the target. We must be friend with them
195
+ * @param {string} [msg] - The message to send to the target.
196
+ * @param {object} [options] - Options for the beep message
197
+ * @param {boolean} [options.includeRoom] - If set, we'll include the current room data we're in
198
+ */
199
+ declare function ServerSendBeepMessage(target: number, msg?: string, options?: {
200
+ includeRoom?: boolean;
201
+ }): void;
192
202
  /**
193
203
  * Show a message as a beep
194
204
  * @param {string} message
195
205
  * @param {number} duration
196
206
  * @param {object} [options]
197
207
  * @param {(this: HTMLDivElement, event: MouseEvent) => void} [options.onClick]
208
+ * @param {number} [options.memberNumber]
209
+ * @param {string} [options.memberName]
210
+ * @param {string} [options.chatRoomName]
198
211
  * @param {boolean} [options.silent]
199
212
  */
200
213
  declare function ServerShowBeep(message: string, duration: number, options?: {
201
214
  onClick?: (this: HTMLDivElement, event: MouseEvent) => void;
215
+ memberNumber?: number;
216
+ memberName?: string;
217
+ chatRoomName?: string;
202
218
  silent?: boolean;
203
219
  }): void;
204
- /** Draws the last beep sent by the server if the timer is still valid, used during the drawing process */
220
+ /** Draws the last beep sent by the server if the timer is still valid, used during the drawing process
221
+ * @deprecated
222
+ */
205
223
  declare function ServerDrawBeep(): void;
206
224
  /** Handles a click on the beep rectangle if mail is included */
207
225
  declare function ServerClickBeep(): void;
208
- /** Opens the friendlist from any screen */
226
+ /**
227
+ * Opens the friendlist from any screen
228
+ * @deprecated Use {@link FriendListShow()};
229
+ */
209
230
  declare function ServerOpenFriendList(): void;
210
231
  /**
211
232
  * Callback used to parse received information related to the player ownership data
@@ -365,6 +386,7 @@ declare namespace ServerAccountDataSyncedValidate {
365
386
  }[], C: Character): Reputation[];
366
387
  function WhiteList(arg: number[], C: Character): number[];
367
388
  function BlackList(arg: number[], C: Character): number[];
389
+ function MapData(arg: Partial<ChatRoomMapData>, C: Character): ChatRoomMapData;
368
390
  }
369
391
  type ServerChatRoomChecksOptions = {
370
392
  screen?: string;
@@ -80,6 +80,33 @@ declare namespace TextItem {
80
80
  * @param {TextItemOption} previousOption
81
81
  */
82
82
  function PublishAction(data: TextItemData, C: Character, item: Item, newOption: TextItemOption, previousOption: TextItemOption): void;
83
+ /**
84
+ * Usage AfterDraw: (...args) => TextItem.GenericTextDrawHook(...args, {Width: 128, Height: 128, XOffset: 0, YOffset: 10, drawOptions: { fontSize: 12 }})
85
+ * @param {TextItemData} data
86
+ * @param {((drawData: DynamicDrawingData<Record<string, unknown>>) => void) | null} originalFunction
87
+ * @param {{C: Character; A: Asset; CA: Item; X: number; Y: number; Property: ItemProperties; drawCanvas: DrawCanvasCallback; drawCanvasBlink: DrawCanvasCallback; AlphaMasks: RectTuple[]; L: string; Color: string}} drawArgs
88
+ * @param {{Width?: number; Height?: number; XOffset?: number; YOffset?: number; LayerName?: string; drawOptions?: DynamicDrawOptions;}} options
89
+ */
90
+ function GenericTextDrawHook(data: TextItemData, originalFunction: ((drawData: DynamicDrawingData<Record<string, unknown>>) => void) | null, { C, A, CA, X, Y, Property, drawCanvas, drawCanvasBlink, AlphaMasks, L, Color, }: {
91
+ C: Character;
92
+ A: Asset;
93
+ CA: Item;
94
+ X: number;
95
+ Y: number;
96
+ Property: ItemProperties;
97
+ drawCanvas: DrawCanvasCallback;
98
+ drawCanvasBlink: DrawCanvasCallback;
99
+ AlphaMasks: RectTuple[];
100
+ L: string;
101
+ Color: string;
102
+ }, { Width, Height, XOffset, YOffset, LayerName, drawOptions }: {
103
+ Width?: number;
104
+ Height?: number;
105
+ XOffset?: number;
106
+ YOffset?: number;
107
+ LayerName?: string;
108
+ drawOptions?: DynamicDrawOptions;
109
+ }): void;
83
110
  }
84
111
  /**
85
112
  * Throttled callback for handling text changes.
@@ -53,6 +53,15 @@ declare function TimerProcess(): void;
53
53
  * @returns {string} - The time string in the HH:MM:SS format
54
54
  */
55
55
  declare function TimermsToTime(s: number): string;
56
+ /**
57
+ * Creates a timer. Returns a function to remove the timer.
58
+ * @param {() => void} callback - A function called when the timer expires
59
+ * @param {number} timeMs - Time in ms before the timer expires
60
+ * @param {boolean} [repeat] - Whether the timer should repeat. Default is false
61
+ * @param {'background' | 'foreground' | 'universal'} [type] - The type of timer. Default is universal
62
+ * @returns {() => void} - A function to remove the timer.
63
+ */
64
+ declare function TimerCreate(callback: () => void, timeMs: number, repeat?: boolean, type?: "background" | "foreground" | "universal"): () => void;
56
65
  declare var CurrentTime: number;
57
66
  declare var TimerRunInterval: number;
58
67
  declare var TimerLastTime: number;
@@ -60,3 +69,5 @@ declare var TimerLastCycleCall: number;
60
69
  declare var TimerLastArousalProgress: number;
61
70
  declare var TimerLastArousalProgressCount: number;
62
71
  declare var TimerLastArousalDecay: number;
72
+ /** @type {Timer.CustomTimer[]} */
73
+ declare var Timers: Timer.CustomTimer[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bc-stubs",
3
- "version": "116.0.0",
3
+ "version": "117.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@github.com/bananarama92/BC-stubs.git"