bloxd.io.d.ts 1.0.2 → 1.2.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.
- package/api-type-def/normal/index.d.ts +5 -11
- package/api-type-def/normal/message/broadcastMessage.d.ts +18 -0
- package/api-type-def/normal/message/index.d.ts +6 -0
- package/api-type-def/normal/message/sendFlyingMiddleMessage.d.ts +22 -0
- package/api-type-def/normal/message/sendMessage.d.ts +28 -0
- package/api-type-def/normal/{getPlayerIds.d.ts → player/getPlayerIds.d.ts} +1 -1
- package/api-type-def/normal/{getPlayerPartyWhenJoined.d.ts → player/getPlayerPartyWhenJoined.d.ts} +1 -1
- package/api-type-def/normal/player/index.d.ts +10 -0
- package/api-type-def/normal/{playerIsInGame.d.ts → player/playerIsInGame.d.ts} +1 -1
- package/api-type-def/normal/{playerIsLoggedIn.d.ts → player/playerIsLoggedIn.d.ts} +1 -1
- package/api-type-def/normal/shops/configureShopCategory.d.ts +17 -0
- package/api-type-def/normal/shops/createShopItem.d.ts +22 -0
- package/api-type-def/normal/shops/deleteShopItem.d.ts +16 -0
- package/api-type-def/normal/shops/index.d.ts +9 -2
- package/api-type-def/normal/shops/updateShopItem.d.ts +21 -0
- package/package.json +1 -1
- package/type/color/StringColor.d.ts +179 -0
- package/type/color/index.d.ts +1 -0
- package/type/index.d.ts +2 -0
- package/type/message/CustomTextStyling.d.ts +9 -0
- package/type/message/EntityName.d.ts +9 -0
- package/type/message/StyledIcon.d.ts +11 -0
- package/type/message/StyledText.d.ts +7 -0
- package/type/message/TextStyle.d.ts +9 -0
- package/type/message/TranslatedText.d.ts +6 -0
- package/type/message/index.d.ts +6 -0
- package/type/shop/ShopCategoryConfig.d.ts +10 -0
- package/type/shop/ShopCategoryKey.d.ts +1 -0
- package/type/shop/ShopItem.d.ts +23 -0
- package/type/shop/ShopItemBadgeType.d.ts +1 -0
- package/type/shop/ShopItemKey.d.ts +1 -0
- package/type/shop/ShopItemUserInput.d.ts +18 -0
- package/type/shop/index.d.ts +6 -0
- /package/api-type-def/normal/{getNumPlayers.d.ts → player/getNumPlayers.d.ts} +0 -0
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import GetPlayerIdsInterface from "./getPlayerIds";
|
|
2
|
-
import PlayerIsInGameInterface from "./playerIsInGame";
|
|
3
|
-
import PlayerIsLoggedInInterface from "./playerIsLoggedIn";
|
|
4
|
-
import GetPlayerPartyWhenJoinedInterface from "./getPlayerPartyWhenJoined";
|
|
5
|
-
import GetNumPlayersInterface from "./getNumPlayers";
|
|
6
1
|
import GetUnitCoordinatesLifeformWithinInterface from "./getUnitCoordinatesLifeformWithin";
|
|
7
2
|
import { ShopApis } from "./shops";
|
|
8
3
|
import { ShieldApis } from "./shields";
|
|
@@ -10,19 +5,18 @@ import { PositionApis } from "./positions";
|
|
|
10
5
|
import { StandingOnApis } from "./standingOns";
|
|
11
6
|
import { HealthApis } from "./health";
|
|
12
7
|
import { KillstreakApis } from "./killstreak";
|
|
8
|
+
import { MessageApis } from "./message";
|
|
9
|
+
import { PlayerApis } from "./player";
|
|
13
10
|
import { MargeObject } from "../../type";
|
|
14
11
|
|
|
15
12
|
type AllNormalApiIntersection = PositionApis &
|
|
16
|
-
|
|
17
|
-
PlayerIsInGameInterface &
|
|
18
|
-
PlayerIsLoggedInInterface &
|
|
19
|
-
GetPlayerPartyWhenJoinedInterface &
|
|
20
|
-
GetNumPlayersInterface &
|
|
13
|
+
PlayerApis &
|
|
21
14
|
StandingOnApis &
|
|
22
15
|
GetUnitCoordinatesLifeformWithinInterface &
|
|
23
16
|
ShopApis &
|
|
24
17
|
ShieldApis &
|
|
25
18
|
HealthApis &
|
|
26
|
-
KillstreakApis
|
|
19
|
+
KillstreakApis &
|
|
20
|
+
MessageApis;
|
|
27
21
|
|
|
28
22
|
export type NormalApi = MargeObject<AllNormalApiIntersection>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CustomTextStyling } from "../../../type/message";
|
|
2
|
+
|
|
3
|
+
interface BroadcastMessageInterface {
|
|
4
|
+
/**
|
|
5
|
+
* Send a message to everyone
|
|
6
|
+
*
|
|
7
|
+
* @param {string | CustomTextStyling} message - The text contained within the message. Can use `Custom Text Styling`.
|
|
8
|
+
* @param { { fontWeight?: number | string; color?: string } } [style] - An optional style argument. Can contain values for fontWeight and color of the message.
|
|
9
|
+
* style is ignored if message uses custom text styling (i.e. is not a string).
|
|
10
|
+
* @returns {void}
|
|
11
|
+
*/
|
|
12
|
+
broadcastMessage(
|
|
13
|
+
message: string | CustomTextStyling,
|
|
14
|
+
style?: { fontWeight?: number | string; color?: string },
|
|
15
|
+
): void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default BroadcastMessageInterface;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import BroadcastMessageInterface from "./broadcastMessage";
|
|
2
|
+
import SendMessageInterface from "./sendMessage";
|
|
3
|
+
import SendFlyingMiddleMessage from "./sendFlyingMiddleMessage";
|
|
4
|
+
export type MessageApis = BroadcastMessageInterface &
|
|
5
|
+
SendMessageInterface &
|
|
6
|
+
SendFlyingMiddleMessage;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CustomTextStyling, PlayerId } from "../../../type";
|
|
2
|
+
|
|
3
|
+
interface SendFlyingMiddleMessage {
|
|
4
|
+
/**
|
|
5
|
+
* Send a flying middle message to a specific player
|
|
6
|
+
*
|
|
7
|
+
* @param {PlayerId} playerId - Id of the player
|
|
8
|
+
* @param {string | CustomTextStyling} message - The text contained within the message. Can be either a string or use `Custom Text Styling`.
|
|
9
|
+
* @param {number} distanceFromAction - The distance from the action that has caused this message to be displayed,
|
|
10
|
+
* this value will be used to determine how the message flies across the screen.
|
|
11
|
+
* @param {number} [lifetimeMs] - How long the message will be visible in milliseconds. Defaults to 1000ms.
|
|
12
|
+
* @returns {void}
|
|
13
|
+
*/
|
|
14
|
+
sendFlyingMiddleMessage(
|
|
15
|
+
playerId: PlayerId,
|
|
16
|
+
message: string | CustomTextStyling,
|
|
17
|
+
distanceFromAction?: number,
|
|
18
|
+
lifetimeMs?: number,
|
|
19
|
+
): void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default SendFlyingMiddleMessage;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PlayerId, CustomTextStyling } from "../../../type";
|
|
2
|
+
|
|
3
|
+
interface SendMessageInterface {
|
|
4
|
+
/**
|
|
5
|
+
* Send a message to a specific player
|
|
6
|
+
*
|
|
7
|
+
* @param {PlayerId} playerId - Id of the player
|
|
8
|
+
* @param {string} message - The text contained within the message.
|
|
9
|
+
* @param { { fontWeight?: number | string; color?: string } } [style] - An optional style argument. Can contain values for fontWeight and color of the message.
|
|
10
|
+
* @returns {void}
|
|
11
|
+
*/
|
|
12
|
+
sendMessage(
|
|
13
|
+
playerId: PlayerId,
|
|
14
|
+
message: string,
|
|
15
|
+
style: { fontWeight?: number | string; color?: string },
|
|
16
|
+
): void;
|
|
17
|
+
/**
|
|
18
|
+
* Send a message to a specific player
|
|
19
|
+
*
|
|
20
|
+
* @param {PlayerId} playerId - Id of the player
|
|
21
|
+
* @param {CustomTextStyling} message - The text contained within the message.
|
|
22
|
+
*
|
|
23
|
+
* @returns {void}
|
|
24
|
+
*/
|
|
25
|
+
sendMessage(playerId: PlayerId, message: CustomTextStyling): void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default SendMessageInterface;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import GetPlayerIdsInterface from "./getPlayerIds";
|
|
2
|
+
import GetNumPlayersInterface from "./getNumPlayers";
|
|
3
|
+
import GetPlayerPartyWhenJoinedInterface from "./getPlayerPartyWhenJoined";
|
|
4
|
+
import PlayerIsInGameInterface from "./playerIsInGame";
|
|
5
|
+
import PlayerIsLoggedInInterface from "./playerIsLoggedIn";
|
|
6
|
+
export type PlayerApis = GetNumPlayersInterface &
|
|
7
|
+
GetPlayerIdsInterface &
|
|
8
|
+
GetPlayerPartyWhenJoinedInterface &
|
|
9
|
+
PlayerIsInGameInterface &
|
|
10
|
+
PlayerIsLoggedInInterface;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ShopCategoryConfig, ShopCategoryKey } from "../../../type";
|
|
2
|
+
|
|
3
|
+
interface ConfigureShopCategory {
|
|
4
|
+
/**
|
|
5
|
+
* Set properties of a shop category.
|
|
6
|
+
*
|
|
7
|
+
* @param {ShopCategoryKey} categoryKey - The key of the category to configure
|
|
8
|
+
* @param {ShopCategoryConfig} config - Category configuration properties
|
|
9
|
+
* @returns {void}
|
|
10
|
+
*/
|
|
11
|
+
configureShopCategory(
|
|
12
|
+
categoryKey: ShopCategoryKey,
|
|
13
|
+
config: ShopCategoryConfig,
|
|
14
|
+
): void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default ConfigureShopCategory;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ShopCategoryKey, ShopItem, ShopItemKey } from "../../../type";
|
|
2
|
+
|
|
3
|
+
interface CreateShopItemInterface {
|
|
4
|
+
/**
|
|
5
|
+
* Create a new shop item under the given category.
|
|
6
|
+
* Will create a new category if it does not exist.
|
|
7
|
+
* If the shop item already exists then it will be replaced.
|
|
8
|
+
* If any per-player overrides exist under the same categoryKey and itemKey then they will be deleted.
|
|
9
|
+
*
|
|
10
|
+
* @param {ShopCategoryKey} categoryKey - The key of the category to create the item in
|
|
11
|
+
* @param {ShopItemKey} itemKey - The unique key for the item
|
|
12
|
+
* @param {ShopItem} item - The shop item to create (will be mutated)
|
|
13
|
+
* @returns {void}
|
|
14
|
+
*/
|
|
15
|
+
createShopItem(
|
|
16
|
+
categoryKey: ShopCategoryKey,
|
|
17
|
+
itemKey: ShopItemKey,
|
|
18
|
+
item: ShopItem,
|
|
19
|
+
): void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default CreateShopItemInterface;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ShopCategoryKey, ShopItemKey } from "../../../type";
|
|
2
|
+
|
|
3
|
+
interface DeleteShopItemInterface {
|
|
4
|
+
/**
|
|
5
|
+
* Delete an existing shop item.
|
|
6
|
+
* Throws an error if the item does not exist.
|
|
7
|
+
* Will also delete all per-player overrides for the shop item.
|
|
8
|
+
*
|
|
9
|
+
* @param {ShopCategoryKey} categoryKey - The key of the category containing the item
|
|
10
|
+
* @param {ShopItemKey} itemKey - The unique key for the item
|
|
11
|
+
* @returns {void}
|
|
12
|
+
*/
|
|
13
|
+
deleteShopItem(categoryKey: ShopCategoryKey, itemKey: ShopItemKey): void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default DeleteShopItemInterface;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import ShowShopTutorialInterface from "./showShopTutorial";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import CreateShopItemInterface from "./createShopItem";
|
|
3
|
+
import UpdateShopItemInterface from "./updateShopItem";
|
|
4
|
+
import DeleteShopItemInterface from "./deleteShopItem";
|
|
5
|
+
import ConfigureShopCategory from "./configureShopCategory";
|
|
6
|
+
export type ShopApis = ShowShopTutorialInterface &
|
|
7
|
+
CreateShopItemInterface &
|
|
8
|
+
UpdateShopItemInterface &
|
|
9
|
+
DeleteShopItemInterface &
|
|
10
|
+
ConfigureShopCategory;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ShopCategoryKey, ShopItem, ShopItemKey } from "../../../type";
|
|
2
|
+
|
|
3
|
+
interface UpdateShopItemInterface {
|
|
4
|
+
/**
|
|
5
|
+
* Update selected properties of an existing shop item.
|
|
6
|
+
* For example, { canBuy: true } to allow players to purchase the item.
|
|
7
|
+
* Throws an error if the item does not exist.
|
|
8
|
+
*
|
|
9
|
+
* @param {ShopCategoryKey} categoryKey - The key of the category containing the item
|
|
10
|
+
* @param {ShopItemKey} itemKey - The unique key for the item
|
|
11
|
+
* @param {Partial<ShopItem>} changes - Partial shop item properties to update
|
|
12
|
+
* @returns {void}
|
|
13
|
+
*/
|
|
14
|
+
updateShopItem(
|
|
15
|
+
categoryKey: ShopCategoryKey,
|
|
16
|
+
itemKey: ShopItemKey,
|
|
17
|
+
changes: Partial<ShopItem>,
|
|
18
|
+
): void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default UpdateShopItemInterface;
|
package/package.json
CHANGED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* this type is color.
|
|
3
|
+
* allow all css color type.
|
|
4
|
+
* @example
|
|
5
|
+
* `#ff0000` | `rgb(255,0,0)` | `red` | `Red` | `#f00` | `rgba(255,0,0,1)` | `hsl(0,100%,50%)` | `hsla(0,100%,50%,1)` is all red
|
|
6
|
+
*/
|
|
7
|
+
export type StringColor =
|
|
8
|
+
// Hex colors
|
|
9
|
+
| `#${string}`
|
|
10
|
+
// RGB and RGBA
|
|
11
|
+
| `rgb(${string})`
|
|
12
|
+
| `rgba(${string})`
|
|
13
|
+
// HSL and HSLA
|
|
14
|
+
| `hsl(${string})`
|
|
15
|
+
| `hsla(${string})`
|
|
16
|
+
// HWB
|
|
17
|
+
| `hwb(${string})`
|
|
18
|
+
// LAB and LCH
|
|
19
|
+
| `lab(${string})`
|
|
20
|
+
| `lch(${string})`
|
|
21
|
+
// OKLAB and OKLCH
|
|
22
|
+
| `oklab(${string})`
|
|
23
|
+
| `oklch(${string})`
|
|
24
|
+
// color() function
|
|
25
|
+
| `color(${string})`
|
|
26
|
+
// Special values
|
|
27
|
+
| "currentColor"
|
|
28
|
+
| "transparent"
|
|
29
|
+
// CSS named colors (full list)
|
|
30
|
+
| "aliceblue"
|
|
31
|
+
| "antiquewhite"
|
|
32
|
+
| "aqua"
|
|
33
|
+
| "aquamarine"
|
|
34
|
+
| "azure"
|
|
35
|
+
| "beige"
|
|
36
|
+
| "bisque"
|
|
37
|
+
| "black"
|
|
38
|
+
| "blanchedalmond"
|
|
39
|
+
| "blue"
|
|
40
|
+
| "blueviolet"
|
|
41
|
+
| "brown"
|
|
42
|
+
| "burlywood"
|
|
43
|
+
| "cadetblue"
|
|
44
|
+
| "chartreuse"
|
|
45
|
+
| "chocolate"
|
|
46
|
+
| "coral"
|
|
47
|
+
| "cornflowerblue"
|
|
48
|
+
| "cornsilk"
|
|
49
|
+
| "crimson"
|
|
50
|
+
| "cyan"
|
|
51
|
+
| "darkblue"
|
|
52
|
+
| "darkcyan"
|
|
53
|
+
| "darkgoldenrod"
|
|
54
|
+
| "darkgray"
|
|
55
|
+
| "darkgreen"
|
|
56
|
+
| "darkgrey"
|
|
57
|
+
| "darkkhaki"
|
|
58
|
+
| "darkmagenta"
|
|
59
|
+
| "darkolivegreen"
|
|
60
|
+
| "darkorange"
|
|
61
|
+
| "darkorchid"
|
|
62
|
+
| "darkred"
|
|
63
|
+
| "darksalmon"
|
|
64
|
+
| "darkseagreen"
|
|
65
|
+
| "darkslateblue"
|
|
66
|
+
| "darkslategray"
|
|
67
|
+
| "darkslategrey"
|
|
68
|
+
| "darkturquoise"
|
|
69
|
+
| "darkviolet"
|
|
70
|
+
| "deeppink"
|
|
71
|
+
| "deepskyblue"
|
|
72
|
+
| "dimgray"
|
|
73
|
+
| "dimgrey"
|
|
74
|
+
| "dodgerblue"
|
|
75
|
+
| "firebrick"
|
|
76
|
+
| "floralwhite"
|
|
77
|
+
| "forestgreen"
|
|
78
|
+
| "fuchsia"
|
|
79
|
+
| "gainsboro"
|
|
80
|
+
| "ghostwhite"
|
|
81
|
+
| "gold"
|
|
82
|
+
| "goldenrod"
|
|
83
|
+
| "gray"
|
|
84
|
+
| "green"
|
|
85
|
+
| "greenyellow"
|
|
86
|
+
| "grey"
|
|
87
|
+
| "honeydew"
|
|
88
|
+
| "hotpink"
|
|
89
|
+
| "indianred"
|
|
90
|
+
| "indigo"
|
|
91
|
+
| "ivory"
|
|
92
|
+
| "khaki"
|
|
93
|
+
| "lavender"
|
|
94
|
+
| "lavenderblush"
|
|
95
|
+
| "lawngreen"
|
|
96
|
+
| "lemonchiffon"
|
|
97
|
+
| "lightblue"
|
|
98
|
+
| "lightcoral"
|
|
99
|
+
| "lightcyan"
|
|
100
|
+
| "lightgoldenrodyellow"
|
|
101
|
+
| "lightgray"
|
|
102
|
+
| "lightgreen"
|
|
103
|
+
| "lightgrey"
|
|
104
|
+
| "lightpink"
|
|
105
|
+
| "lightsalmon"
|
|
106
|
+
| "lightseagreen"
|
|
107
|
+
| "lightskyblue"
|
|
108
|
+
| "lightslategray"
|
|
109
|
+
| "lightslategrey"
|
|
110
|
+
| "lightsteelblue"
|
|
111
|
+
| "lightyellow"
|
|
112
|
+
| "lime"
|
|
113
|
+
| "limegreen"
|
|
114
|
+
| "linen"
|
|
115
|
+
| "magenta"
|
|
116
|
+
| "maroon"
|
|
117
|
+
| "mediumaquamarine"
|
|
118
|
+
| "mediumblue"
|
|
119
|
+
| "mediumorchid"
|
|
120
|
+
| "mediumpurple"
|
|
121
|
+
| "mediumseagreen"
|
|
122
|
+
| "mediumslateblue"
|
|
123
|
+
| "mediumspringgreen"
|
|
124
|
+
| "mediumturquoise"
|
|
125
|
+
| "mediumvioletred"
|
|
126
|
+
| "midnightblue"
|
|
127
|
+
| "mintcream"
|
|
128
|
+
| "mistyrose"
|
|
129
|
+
| "moccasin"
|
|
130
|
+
| "navajowhite"
|
|
131
|
+
| "navy"
|
|
132
|
+
| "oldlace"
|
|
133
|
+
| "olive"
|
|
134
|
+
| "olivedrab"
|
|
135
|
+
| "orange"
|
|
136
|
+
| "orangered"
|
|
137
|
+
| "orchid"
|
|
138
|
+
| "palegoldenrod"
|
|
139
|
+
| "palegreen"
|
|
140
|
+
| "paleturquoise"
|
|
141
|
+
| "palevioletred"
|
|
142
|
+
| "papayawhip"
|
|
143
|
+
| "peachpuff"
|
|
144
|
+
| "peru"
|
|
145
|
+
| "pink"
|
|
146
|
+
| "plum"
|
|
147
|
+
| "powderblue"
|
|
148
|
+
| "purple"
|
|
149
|
+
| "rebeccapurple"
|
|
150
|
+
| "red"
|
|
151
|
+
| "rosybrown"
|
|
152
|
+
| "royalblue"
|
|
153
|
+
| "saddlebrown"
|
|
154
|
+
| "salmon"
|
|
155
|
+
| "sandybrown"
|
|
156
|
+
| "seagreen"
|
|
157
|
+
| "seashell"
|
|
158
|
+
| "sienna"
|
|
159
|
+
| "silver"
|
|
160
|
+
| "skyblue"
|
|
161
|
+
| "slateblue"
|
|
162
|
+
| "slategray"
|
|
163
|
+
| "slategrey"
|
|
164
|
+
| "snow"
|
|
165
|
+
| "springgreen"
|
|
166
|
+
| "steelblue"
|
|
167
|
+
| "tan"
|
|
168
|
+
| "teal"
|
|
169
|
+
| "thistle"
|
|
170
|
+
| "tomato"
|
|
171
|
+
| "turquoise"
|
|
172
|
+
| "violet"
|
|
173
|
+
| "wheat"
|
|
174
|
+
| "white"
|
|
175
|
+
| "whitesmoke"
|
|
176
|
+
| "yellow"
|
|
177
|
+
| "yellowgreen"
|
|
178
|
+
// fallback allowance for any other valid CSS color syntaxes not listed above
|
|
179
|
+
| string;
|
package/type/color/index.d.ts
CHANGED
package/type/index.d.ts
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CustomTextStyling } from "..";
|
|
2
|
+
|
|
3
|
+
export type ShopCategoryConfig = Partial<{
|
|
4
|
+
autoSelectCategory: boolean;
|
|
5
|
+
customTitle: string; // Supports translation keys and ordinary text
|
|
6
|
+
redDot: boolean;
|
|
7
|
+
forceRemoveRedDot: boolean;
|
|
8
|
+
sortPriority: number;
|
|
9
|
+
description: string | CustomTextStyling;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ShopCategoryKey = string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ShopItemBadgeType, ShopItemUserInput } from ".";
|
|
2
|
+
import { CustomTextStyling, StringColor } from "..";
|
|
3
|
+
|
|
4
|
+
export type ShopItem = {
|
|
5
|
+
image: string;
|
|
6
|
+
cost?: number;
|
|
7
|
+
currency?: string;
|
|
8
|
+
amount?: number; // Display amount shown on the shop tile image (0 and 1 are not displayed)
|
|
9
|
+
imageColour?: StringColor;
|
|
10
|
+
canBuy?: boolean;
|
|
11
|
+
isSelected?: boolean;
|
|
12
|
+
buyButtonText?: string | CustomTextStyling;
|
|
13
|
+
customTitle?: string | CustomTextStyling;
|
|
14
|
+
description?: string | CustomTextStyling;
|
|
15
|
+
onBoughtMessage?: string | CustomTextStyling;
|
|
16
|
+
redDot?: boolean;
|
|
17
|
+
forceRemoveRedDot?: boolean;
|
|
18
|
+
badge?: { text: string | CustomTextStyling; type: ShopItemBadgeType };
|
|
19
|
+
userInput?: ShopItemUserInput;
|
|
20
|
+
sell?: boolean; // Optional, defaults to false. If true, the sign of "cost" is flipped. So a "cost" of -25 would give the player 25 currency AND be displayed as "25" (instead of -25)
|
|
21
|
+
sortPriority?: number; // Descending, bigger number means closer to the top
|
|
22
|
+
hidden?: boolean;
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ShopItemBadgeType = "new" | "lucky";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ShopItemKey = string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PlayerId } from "..";
|
|
2
|
+
|
|
3
|
+
export type ShopItemUserInput =
|
|
4
|
+
| {
|
|
5
|
+
type: "text";
|
|
6
|
+
placeholderText?: string;
|
|
7
|
+
wordCharsOnly?: boolean;
|
|
8
|
+
initialValue?: string;
|
|
9
|
+
} // wordCharsOnly defaults to false. If true, only allows \w character (alphanumeric and _). initialValue always takes precedence as the text input value when set.
|
|
10
|
+
| { type: "number"; placeholderText?: string; initialValue?: string }
|
|
11
|
+
| {
|
|
12
|
+
type: "dropdown";
|
|
13
|
+
dropdownOptions: readonly (string | { option: string; cost: number })[];
|
|
14
|
+
shouldResetSelectionOnOptionsChange?: boolean; // Defaults to false. If true, the selection will reset to the first option when dropdownOptions changes.
|
|
15
|
+
initialValue?: string;
|
|
16
|
+
}
|
|
17
|
+
| { type: "player"; excludedPlayers?: PlayerId[] } // Defaults to excluding the current player
|
|
18
|
+
| { type: "color"; initialValue?: string };
|
|
File without changes
|