-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmbs.d.ts
206 lines (191 loc) · 6.25 KB
/
mbs.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
/**
* MBS: Maid's Bondage Scripts
*
* Copyright (C) 2023-2025 Bananarama92
*
* This program is free software: you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see https://www.gnu.org/licenses/.
*/
/**
* Uncomment the `ItemBundle` declaration below if, for one reason or another, you do not
* have access to the builtin BC type annotations.
*
* Use of the builtin `ItemBundle` BC type is *strongly* recommended.
*/
// type ItemBundle = Record<string, any>;
/** An interface for exposing MBS wheel of fortune data */
interface WheelBundle {
/** The (user-specified) name of the item set. */
name: string;
/** The index of the wheel of fortune item set */
index: number;
/** A list of the minified items associated with the item set */
items: ItemBundle[];
}
/**
* An interface with all available MBS style options.
*
* Note that the option's exact default values are *not* guaranteed by the API, and
* may by changed at any point in the future without an increment of the API version.
*/
interface CSSStyles {
/**
* The background color used for _most_ `div` elements (if they have a background).
* @default "white"
*/
backgroundColor: string;
/**
* The background color used for `button` elements.
* @default "white"
*/
buttonColor: string;
/**
* The background color used when hovering over `button` elements.
* @default "cyan"
*/
buttonHoverColor: string;
/**
* The background color used for tooltips.
* @default "lightyellow"
*/
tooltipColor: string;
/**
* The color used for borders.
* @default "black"
*/
borderColor: string;
/**
* The color used for borders.
* @default "black"
*/
textColor: string;
}
/**
* Maid's Bondage Scripts API: Various additions and utility scripts for BC.
* @version 1.3
*/
declare namespace mbs {
/**
* The (semantic) MBS version.
* Guaranteed to match the `/^([0-9]+)\.([0-9]+)\.([0-9]+)(\.\S+)?$/` regex.
*
* @since API version 1.0
*/
const MBS_VERSION: `${number}.${number}.${number}${string}`;
/**
* The version of the MBS API.
*
* - Changes or removals are accompanied by a `major` increment (and resetting `minor` back to 0)
* - Additions are only accompanied by a `minor` increment
* - Documentation changes can be implemented without incrementing `major` or `minor`
*
* @since API version 1.0
*/
const API_VERSION: {
/** The major API versions; increments are reserved for changes and removals */
readonly major: number,
/** The major API versions; increments are reserved for additions */
readonly minor: number,
};
/**
* Run the MBS test suit.
*
* @since API version 1.0
* @returns Whether the test suite succeeded or not
*/
function runTests(): boolean;
/**
* Return MBS debug output in human-readable, stringified form.
*
* Note that the API provides no guarantees regarding the outputs machine readability.
* While the output type is guaranteed by the API, the exact value is not and MBS is free to change it at any point without prior warning.
*
* As of API version 1.2 the output string is guaranteed to be JSON-safe (see {@link JSON.parse})
*
* @since API version 1.1
* @returns The MBS debug output in stringified form
*/
function getDebug(): string;
/**
* Public MBS API for retrieving wheel outfit data.
*
* @since API version 1.0
*/
namespace wheelOutfits {
/**
* Get a record mapping all (user-specified) outfit names to the actual outfit data.
*
* @since API version 1.0
* @returns All MBS outfit data
*/
function getAll(): Record<string, WheelBundle>;
/**
* Get a single wheel outfit by its name.
*
* @since API version 1.0
* @param name The name of the wheel outfit
* @returns The wheel outfit or `undefined` if it cannot be found
*/
function getByName(name: string): undefined | WheelBundle;
/**
* Get a single wheel outfit by its index.
*
* @since API version 1.0
* @param index The wheel outfit or `undefined` if it cannot be found
* @returns The MBS outfit data or `undefined`
*/
function getByIndex(index: number): undefined | WheelBundle;
/**
* Return a list of all the players wheel outfit names.
*
* @since API version 1.0
* @returns The list of wheel outfit names
*/
function getNames(): string[];
/**
* Return a list of all the players wheel outfit indices.
*
* @since API version 1.0
* @returns The list of wheel outfit indices
*/
function getIndices(): number[];
}
/**
* Public API for modifying MBS's style sheets.
*
*
* Licensed under LGPL-v3 as of API version 1.4
* @since API version 1.3
* @license LPGL-v3
*/
namespace css {
/**
* Set the passed MBS style options.
*
* @since API version 1.3
* @param style A record with one or more of the to-be assigned style options
*/
function setStyle(style: Readonly<Partial<CSSStyles>>): void;
/**
* Get the currently assigned MBS style options.
*
* @since API version 1.3
* @returns A record with the currently assigned style options
*/
function getStyle(): CSSStyles;
/**
* The default MBS style options.
*
* @since API version 1.3
*/
const DEFAULT_STYLE: Readonly<CSSStyles>;
}
}