bloxd.io.d.ts 1.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.
- package/api-type-def/clientOption/clientOptions/canChange.d.ts +79 -0
- package/api-type-def/clientOption/clientOptions/crouchingSpeed.d.ts +55 -0
- package/api-type-def/clientOption/clientOptions/index.d.ts +68 -0
- package/api-type-def/clientOption/clientOptions/runningSpeed.d.ts +60 -0
- package/api-type-def/clientOption/clientOptions/speedMultiplier.d.ts +61 -0
- package/api-type-def/clientOption/clientOptions/walkingSpeed.d.ts +60 -0
- package/api-type-def/clientOption/index.d.ts +43 -0
- package/api-type-def/entitySetting/entitySettings/example.d.ts +90 -0
- package/api-type-def/entitySetting/entitySettings/index.d.ts +83 -0
- package/api-type-def/entitySetting/entitySettings/opacity.d.ts +96 -0
- package/api-type-def/entitySetting/entitySettings/overlayColour.d.ts +92 -0
- package/api-type-def/entitySetting/entitySettings/zIndex.d.ts +91 -0
- package/api-type-def/entitySetting/index.d.ts +101 -0
- package/api-type-def/index.d.ts +14 -0
- package/api-type-def/mobSetting/index.d.ts +71 -0
- package/api-type-def/mobSetting/mobSettings/index.d.ts +4 -0
- package/api-type-def/mobSetting/mobSettings/maxHealth.d.ts +0 -0
- package/api-type-def/mobSetting/mobSettings/variation.d.ts +155 -0
- package/api-type-def/normal/forceRespawn.d.ts +12 -0
- package/api-type-def/normal/getNumPlayers.d.ts +11 -0
- package/api-type-def/normal/getPlayerIds.d.ts +12 -0
- package/api-type-def/normal/getPlayerPartyWhenJoined.d.ts +14 -0
- package/api-type-def/normal/getUnitCoordinatesLifeformWithin.d.ts +14 -0
- package/api-type-def/normal/health/applyHealthChange.d.ts +19 -0
- package/api-type-def/normal/health/applyMeleeHit.d.ts +33 -0
- package/api-type-def/normal/health/attemptApplyDamage.d.ts +33 -0
- package/api-type-def/normal/health/getHealth.d.ts +17 -0
- package/api-type-def/normal/health/index.d.ts +15 -0
- package/api-type-def/normal/health/isAlive.d.ts +13 -0
- package/api-type-def/normal/health/killLifeform.d.ts +14 -0
- package/api-type-def/normal/health/setHealth.d.ts +23 -0
- package/api-type-def/normal/index.d.ts +28 -0
- package/api-type-def/normal/killstreak/clearKillstreak.d.ts +13 -0
- package/api-type-def/normal/killstreak/getCurrentKillstreak.d.ts +13 -0
- package/api-type-def/normal/killstreak/index.d.ts +5 -0
- package/api-type-def/normal/playerIsInGame.d.ts +12 -0
- package/api-type-def/normal/playerIsLoggedIn.d.ts +11 -0
- package/api-type-def/normal/positions/getPosition.d.ts +12 -0
- package/api-type-def/normal/positions/index.d.ts +4 -0
- package/api-type-def/normal/positions/setPosition.d.ts +24 -0
- package/api-type-def/normal/shields/getShieldAmount.d.ts +15 -0
- package/api-type-def/normal/shields/index.d.ts +6 -0
- package/api-type-def/normal/shields/setShieldAmount.d.ts +14 -0
- package/api-type-def/normal/shops/index.d.ts +3 -0
- package/api-type-def/normal/shops/showShopTutorial.d.ts +13 -0
- package/api-type-def/normal/standingOns/getBlockCoordinatesPlayerStandingOn.d.ts +16 -0
- package/api-type-def/normal/standingOns/getBlockTypesPlayerStandingOn.d.ts +14 -0
- package/api-type-def/normal/standingOns/index.d.ts +6 -0
- package/bloxd-api.d.ts +12 -0
- package/package.json +28 -0
- package/readme.md +3 -0
- package/type/ApplyMeleeHitOverrides.d.ts +8 -0
- package/type/Coordinate.d.ts +1 -0
- package/type/Direction.d.ts +1 -0
- package/type/Health.d.ts +1 -0
- package/type/LifeFormBodyPart.d.ts +7 -0
- package/type/Party.d.ts +2 -0
- package/type/PlayerAttemptDamageOtherPlayerOpts.d.ts +20 -0
- package/type/ShieldAmount.d.ts +1 -0
- package/type/WhoDidDamage.d.ts +5 -0
- package/type/WhoKilled.d.ts +3 -0
- package/type/block/AllBlockId.d.ts +1 -0
- package/type/block/AllBlockName.d.ts +1 -0
- package/type/block/Block.d.ts +4 -0
- package/type/block/BlockId.d.ts +4 -0
- package/type/block/BlockName.d.ts +7 -0
- package/type/block/index.d.ts +5 -0
- package/type/color/Array255Color.d.ts +8 -0
- package/type/color/Array255ColorWithA.d.ts +10 -0
- package/type/color/index.d.ts +2 -0
- package/type/dbId/PlayerDbId.d.ts +2 -0
- package/type/dbId/index.d.ts +1 -0
- package/type/id/EntityId.d.ts +4 -0
- package/type/id/Id.d.ts +2 -0
- package/type/id/LifeFormId.d.ts +4 -0
- package/type/id/MobId.d.ts +4 -0
- package/type/id/PlayerId.d.ts +4 -0
- package/type/id/index.d.ts +5 -0
- package/type/index.d.ts +18 -0
- package/type/item/AllItemId.d.ts +4 -0
- package/type/item/AllItemName.d.ts +974 -0
- package/type/item/Item.d.ts +4 -0
- package/type/item/ItemId.d.ts +4 -0
- package/type/item/ItemName.d.ts +4 -0
- package/type/item/index.d.ts +5 -0
- package/type/mob/MobType.d.ts +29 -0
- package/type/mob/index.d.ts +1 -0
- package/type/particle/ParticlePresetOpts.d.ts +20 -0
- package/type/particle/ParticleSystemBlendMode.d.ts +21 -0
- package/type/particle/PresetId.d.ts +116 -0
- package/type/particle/TempParticleSystemOpts.d.ts +33 -0
- package/type/particle/Texture.d.ts +12 -0
- package/type/particle/index.d.ts +5 -0
- package/type/sound/AllSoundName.d.ts +1 -0
- package/type/sound/SoundName.d.ts +3 -0
- package/type/sound/index.d.ts +2 -0
- package/type/utilType.d.ts +3 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { PlayerId } from "../../../type";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Whether the player can change blocks
|
|
5
|
+
* @type {boolean}
|
|
6
|
+
* @default true
|
|
7
|
+
*/
|
|
8
|
+
type ValueType = boolean;
|
|
9
|
+
|
|
10
|
+
interface SetClientOption {
|
|
11
|
+
/**
|
|
12
|
+
* set status player who can changing block
|
|
13
|
+
*
|
|
14
|
+
* option docment:
|
|
15
|
+
* Whether the player can change blocks
|
|
16
|
+
*
|
|
17
|
+
* @overload
|
|
18
|
+
*
|
|
19
|
+
* @param {PlayerId} playerId
|
|
20
|
+
* @param {"canchange"} option
|
|
21
|
+
* @param {true} value
|
|
22
|
+
*/
|
|
23
|
+
setClientOption(playerId: PlayerId, option: "canChange", value: true): void;
|
|
24
|
+
/**
|
|
25
|
+
* set status player who can not changing block
|
|
26
|
+
*
|
|
27
|
+
* option docment:
|
|
28
|
+
* Whether the player can change blocks
|
|
29
|
+
*
|
|
30
|
+
* @overload
|
|
31
|
+
*
|
|
32
|
+
* @param {PlayerId} playerId
|
|
33
|
+
* @param {"canchange"} option
|
|
34
|
+
* @param {false} value
|
|
35
|
+
* @returns {void}
|
|
36
|
+
*/
|
|
37
|
+
setClientOption(playerId: PlayerId, option: "canChange", value: false): void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface GetClientOption {
|
|
41
|
+
/**
|
|
42
|
+
* get player can change block
|
|
43
|
+
*
|
|
44
|
+
* option docment:
|
|
45
|
+
* Whether the player can change blocks
|
|
46
|
+
*
|
|
47
|
+
* @overload
|
|
48
|
+
*
|
|
49
|
+
* @param {PlayerId} playerId
|
|
50
|
+
* @param {"canChange"} option
|
|
51
|
+
* @returns {boolean}
|
|
52
|
+
*/
|
|
53
|
+
getClientOption(playerId: PlayerId, option: "canChange"): boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface SetClientOptionToDefault {
|
|
57
|
+
/**
|
|
58
|
+
* set canChange option to default
|
|
59
|
+
* canChange default is `true`
|
|
60
|
+
*
|
|
61
|
+
* option docment:
|
|
62
|
+
* Whether the player can change blocks
|
|
63
|
+
*
|
|
64
|
+
* @overload
|
|
65
|
+
*
|
|
66
|
+
* @param {PlayerId} playerId
|
|
67
|
+
* @param {"canChange"} option
|
|
68
|
+
* @returns {void}
|
|
69
|
+
*/
|
|
70
|
+
setClientOptionToDefault(playerId: PlayerId, option: "canChange"): void;
|
|
71
|
+
}
|
|
72
|
+
type ExportTypes = {
|
|
73
|
+
SetClientOption: SetClientOption;
|
|
74
|
+
SetClientOptionToDefault: SetClientOptionToDefault;
|
|
75
|
+
GetClientOption: GetClientOption;
|
|
76
|
+
name: "canChange";
|
|
77
|
+
ValueType: ValueType;
|
|
78
|
+
};
|
|
79
|
+
export default ExportTypes;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { PlayerId } from "../../../type";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Speed multiplier for the player when crouching.
|
|
5
|
+
* Players are used to the default bloxd movement behaviour and speed,
|
|
6
|
+
* and may be put off from your game if different muscle memory is required.
|
|
7
|
+
* We suggest applying speed or slowness effects instead, using api.applyEffect.
|
|
8
|
+
* @type {number}
|
|
9
|
+
* @default 2
|
|
10
|
+
*/
|
|
11
|
+
type ValueType = number;
|
|
12
|
+
|
|
13
|
+
interface SetClientOption {
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @param {PlayerId} playerId
|
|
17
|
+
* @param {"crouchingSpeed"} option
|
|
18
|
+
* @param {number} value
|
|
19
|
+
* @returns {void}
|
|
20
|
+
*/
|
|
21
|
+
setClientOption(
|
|
22
|
+
playerId: PlayerId,
|
|
23
|
+
option: "crouchingSpeed",
|
|
24
|
+
value: number,
|
|
25
|
+
): void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface GetClientOption {
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @param {PlayerId} playerId
|
|
32
|
+
* @param {"crouchingSpeed"} option
|
|
33
|
+
* @returns {number}
|
|
34
|
+
*/
|
|
35
|
+
getClientOption(playerId: PlayerId, option: "crouchingSpeed"): number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface SetClientOptionToDefault {
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @param {PlayerId} playerId
|
|
42
|
+
* @param {"crouchingSpeed"} option
|
|
43
|
+
* @returns {void}
|
|
44
|
+
*/
|
|
45
|
+
setClientOptionToDefault(playerId: PlayerId, option: "crouchingSpeed"): void;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type ExportTypes = {
|
|
49
|
+
SetClientOption: SetClientOption;
|
|
50
|
+
SetClientOptionToDefault: SetClientOptionToDefault;
|
|
51
|
+
GetClientOption: GetClientOption;
|
|
52
|
+
name: "crouchingSpeed";
|
|
53
|
+
ValueType: ValueType;
|
|
54
|
+
};
|
|
55
|
+
export default ExportTypes;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { MargeObject } from "../../../type/utilType";
|
|
2
|
+
import canChange from "./canChange";
|
|
3
|
+
import crouchingSpeed from "./crouchingSpeed";
|
|
4
|
+
import walkingSpeed from "./walkingSpeed";
|
|
5
|
+
import runningSpeed from "./runningSpeed";
|
|
6
|
+
import speedMultiplier from "./speedMultiplier";
|
|
7
|
+
|
|
8
|
+
type ClientOptionExportFormat = {
|
|
9
|
+
name: string;
|
|
10
|
+
ValueType: any;
|
|
11
|
+
SetClientOption: {
|
|
12
|
+
setClientOption: (playerId: never, option: never, value: never) => void;
|
|
13
|
+
};
|
|
14
|
+
SetClientOptionToDefault: {
|
|
15
|
+
setClientOptionToDefault: (playerId: never, option: never) => void;
|
|
16
|
+
};
|
|
17
|
+
GetClientOption: {
|
|
18
|
+
getClientOption: (playerId: never, option: never) => any;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type AllClientOptionUnion =
|
|
23
|
+
| canChange
|
|
24
|
+
| crouchingSpeed
|
|
25
|
+
| walkingSpeed
|
|
26
|
+
| runningSpeed
|
|
27
|
+
| speedMultiplier;
|
|
28
|
+
|
|
29
|
+
type GenerateClientOptions<U extends ClientOptionExportFormat> = {
|
|
30
|
+
[K in U as K["name"]]: K["ValueType"];
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type ClientOptions = GenerateClientOptions<AllClientOptionUnion>;
|
|
34
|
+
|
|
35
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
|
|
36
|
+
k: infer I,
|
|
37
|
+
) => void
|
|
38
|
+
? I
|
|
39
|
+
: never;
|
|
40
|
+
type GenerateClientOptionInterface<
|
|
41
|
+
U extends ClientOptionExportFormat,
|
|
42
|
+
K extends keyof any,
|
|
43
|
+
> = MargeObject<
|
|
44
|
+
UnionToIntersection<
|
|
45
|
+
U extends any ? (K extends keyof U ? U[K] : never) : never
|
|
46
|
+
>
|
|
47
|
+
>;
|
|
48
|
+
|
|
49
|
+
export type SetClientOption = GenerateClientOptionInterface<
|
|
50
|
+
AllClientOptionUnion,
|
|
51
|
+
"SetClientOption"
|
|
52
|
+
>;
|
|
53
|
+
|
|
54
|
+
export type GetClientOption = GenerateClientOptionInterface<
|
|
55
|
+
AllClientOptionUnion,
|
|
56
|
+
"GetClientOption"
|
|
57
|
+
>;
|
|
58
|
+
|
|
59
|
+
export type SetClientOptionToDefault = GenerateClientOptionInterface<
|
|
60
|
+
AllClientOptionUnion,
|
|
61
|
+
"SetClientOptionToDefault"
|
|
62
|
+
>;
|
|
63
|
+
|
|
64
|
+
export * from "./canChange";
|
|
65
|
+
export * from "./speedMultiplier";
|
|
66
|
+
export * from "./crouchingSpeed";
|
|
67
|
+
export * from "./walkingSpeed";
|
|
68
|
+
export * from "./runningSpeed";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { PlayerId } from "../../../type";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Running speed for the player.
|
|
5
|
+
* STRONGLY recommend using `speedMultiplier` unless you have a specific use case for this, runningSpeed doesn't make UX sense on mobile.
|
|
6
|
+
* (Walking speed is ignored for mobile players, mobile player speed is determined by joystick input and the max of runningSpeed & walkingSpeed).
|
|
7
|
+
*
|
|
8
|
+
* Players are used to the default bloxd movement behaviour and speed,
|
|
9
|
+
* and may be put off from your game if different muscle memory is required.
|
|
10
|
+
* We suggest applying speed or slowness effects instead, using api.applyEffect.
|
|
11
|
+
*
|
|
12
|
+
* The only use case for walkingSpeed/runningSpeed over speedMultiplier or speed effects is to disable running or to inverse walking/running (so you run by default and e.g. hold shift to go slower).
|
|
13
|
+
* @type {number}
|
|
14
|
+
* @default 7
|
|
15
|
+
*/
|
|
16
|
+
type ValueType = number;
|
|
17
|
+
|
|
18
|
+
interface SetClientOption {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param {PlayerId} playerId
|
|
22
|
+
* @param {"runningSpeed"} option
|
|
23
|
+
* @param {number} value
|
|
24
|
+
* @returns {void}
|
|
25
|
+
*/
|
|
26
|
+
setClientOption(
|
|
27
|
+
playerId: PlayerId,
|
|
28
|
+
option: "runningSpeed",
|
|
29
|
+
value: number,
|
|
30
|
+
): void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface GetClientOption {
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @param {PlayerId} playerId
|
|
37
|
+
* @param {"runningSpeed"} option
|
|
38
|
+
* @returns {number}
|
|
39
|
+
*/
|
|
40
|
+
getClientOption(playerId: PlayerId, option: "runningSpeed"): number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface SetClientOptionToDefault {
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @param {PlayerId} playerId
|
|
47
|
+
* @param {"runningSpeed"} option
|
|
48
|
+
* @returns {void}
|
|
49
|
+
*/
|
|
50
|
+
setClientOptionToDefault(playerId: PlayerId, option: "runningSpeed"): void;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
type ExportTypes = {
|
|
54
|
+
SetClientOption: SetClientOption;
|
|
55
|
+
SetClientOptionToDefault: SetClientOptionToDefault;
|
|
56
|
+
GetClientOption: GetClientOption;
|
|
57
|
+
name: "runningSpeed";
|
|
58
|
+
ValueType: ValueType;
|
|
59
|
+
};
|
|
60
|
+
export default ExportTypes;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { PlayerId } from "../../../type";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Speed multiplier for the player.
|
|
5
|
+
* Players are used to the default bloxd movement behaviour and speed,
|
|
6
|
+
* and may be put off from your game if different muscle memory is required.
|
|
7
|
+
* We suggest applying speed or slowness effects instead, using api.applyEffect.
|
|
8
|
+
*
|
|
9
|
+
* @type {number}
|
|
10
|
+
* @default 1
|
|
11
|
+
*/
|
|
12
|
+
type ValueType = number;
|
|
13
|
+
|
|
14
|
+
interface SetClientOption {
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @overload
|
|
18
|
+
*
|
|
19
|
+
* @param {PlayerId} playerId
|
|
20
|
+
* @param {"speedMultiplier"} option
|
|
21
|
+
* @param {number} value
|
|
22
|
+
* @returns {void}
|
|
23
|
+
*/
|
|
24
|
+
setClientOption(
|
|
25
|
+
playerId: PlayerId,
|
|
26
|
+
option: "speedMultiplier",
|
|
27
|
+
value: number,
|
|
28
|
+
): void;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface GetClientOption {
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @overload
|
|
35
|
+
*
|
|
36
|
+
* @param {PlayerId} playerId
|
|
37
|
+
* @param {"speedMultiplier"} option
|
|
38
|
+
* @returns {number}
|
|
39
|
+
*/
|
|
40
|
+
getClientOption(playerId: PlayerId, option: "speedMultiplier"): number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface SetClientOptionToDefault {
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @overload
|
|
47
|
+
*
|
|
48
|
+
* @param {PlayerId} playerId
|
|
49
|
+
* @param {"speedMultiplier"} option
|
|
50
|
+
* @returns {void}
|
|
51
|
+
*/
|
|
52
|
+
setClientOptionToDefault(playerId: PlayerId, option: "speedMultiplier"): void;
|
|
53
|
+
}
|
|
54
|
+
type ExportTypes = {
|
|
55
|
+
SetClientOption: SetClientOption;
|
|
56
|
+
SetClientOptionToDefault: SetClientOptionToDefault;
|
|
57
|
+
GetClientOption: GetClientOption;
|
|
58
|
+
name: "speedMultiplier";
|
|
59
|
+
ValueType: ValueType;
|
|
60
|
+
};
|
|
61
|
+
export default ExportTypes;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { PlayerId } from "../../../type";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Walking speed for the player.
|
|
5
|
+
* STRONGLY recommend using `speedMultiplier` unless you have a specific use case for this, walkingSpeed doesn't make UX sense on mobile.
|
|
6
|
+
* (Walking speed ignored for mobile players, mobile player speed is determined by joystick input and the max of runningSpeed & walkingSpeed).
|
|
7
|
+
*
|
|
8
|
+
* Players are used to the default bloxd movement behaviour and speed,
|
|
9
|
+
* and may be put off from your game if different muscle memory is required.
|
|
10
|
+
* We suggest applying speed or slowness effects instead, using api.applyEffect.
|
|
11
|
+
*
|
|
12
|
+
* The only use case for walkingSpeed/runningSpeed over speedMultiplier or speed effects is to disable running or to inverse walking/running (so you run by default and e.g. hold shift to go slower).
|
|
13
|
+
* @type {number}
|
|
14
|
+
* @default 4
|
|
15
|
+
*/
|
|
16
|
+
type ValueType = number;
|
|
17
|
+
|
|
18
|
+
interface SetClientOption {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param {PlayerId} playerId
|
|
22
|
+
* @param {"walkingSpeed"} option
|
|
23
|
+
* @param {number} value
|
|
24
|
+
* @returns {void}
|
|
25
|
+
*/
|
|
26
|
+
setClientOption(
|
|
27
|
+
playerId: PlayerId,
|
|
28
|
+
option: "walkingSpeed",
|
|
29
|
+
value: number,
|
|
30
|
+
): void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface GetClientOption {
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @param {PlayerId} playerId
|
|
37
|
+
* @param {"walkingSpeed"} option
|
|
38
|
+
* @returns {number}
|
|
39
|
+
*/
|
|
40
|
+
getClientOption(playerId: PlayerId, option: "walkingSpeed"): number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface SetClientOptionToDefault {
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @param {PlayerId} playerId
|
|
47
|
+
* @param {"walkingSpeed"} option
|
|
48
|
+
* @returns {void}
|
|
49
|
+
*/
|
|
50
|
+
setClientOptionToDefault(playerId: PlayerId, option: "walkingSpeed"): void;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
type ExportTypes = {
|
|
54
|
+
SetClientOption: SetClientOption;
|
|
55
|
+
SetClientOptionToDefault: SetClientOptionToDefault;
|
|
56
|
+
GetClientOption: GetClientOption;
|
|
57
|
+
name: "walkingSpeed";
|
|
58
|
+
ValueType: ValueType;
|
|
59
|
+
};
|
|
60
|
+
export default ExportTypes;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { PlayerId, MargeObject } from "../../type";
|
|
2
|
+
import {
|
|
3
|
+
ClientOptions,
|
|
4
|
+
SetClientOption,
|
|
5
|
+
GetClientOption,
|
|
6
|
+
SetClientOptionToDefault,
|
|
7
|
+
} from "./clientOptions";
|
|
8
|
+
export * from "./clientOptions";
|
|
9
|
+
|
|
10
|
+
interface RootSetClientOption {
|
|
11
|
+
setClientOption<TOption extends keyof ClientOptions>(
|
|
12
|
+
playerId: PlayerId,
|
|
13
|
+
option: TOption,
|
|
14
|
+
value: ClientOptions[TOption],
|
|
15
|
+
): void;
|
|
16
|
+
}
|
|
17
|
+
interface SetClientOptions {
|
|
18
|
+
setClientOptions(playerId: PlayerId, options: Partial<ClientOptions>): void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface RootGetClientOption {
|
|
22
|
+
getClientOption<TOption extends keyof ClientOptions>(
|
|
23
|
+
playerId: PlayerId,
|
|
24
|
+
option: TOption,
|
|
25
|
+
): ClientOptions[TOption];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface RootSetClientOptionToDefault {
|
|
29
|
+
setClientOptionToDefault<TOption extends keyof ClientOptions>(
|
|
30
|
+
playerId: PlayerId,
|
|
31
|
+
option: TOption,
|
|
32
|
+
): void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type ClientOptionApi = MargeObject<
|
|
36
|
+
SetClientOption &
|
|
37
|
+
RootSetClientOption &
|
|
38
|
+
GetClientOption &
|
|
39
|
+
RootGetClientOption &
|
|
40
|
+
SetClientOptions &
|
|
41
|
+
SetClientOptionToDefault &
|
|
42
|
+
RootSetClientOptionToDefault
|
|
43
|
+
>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { EntityId, PlayerId } from "../../../type";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
type ValueType = never;
|
|
7
|
+
|
|
8
|
+
declare const name: "example";
|
|
9
|
+
|
|
10
|
+
interface SetTargetedPlayerSettingForEveryone {
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param {PlayerId} targetedPlayerId
|
|
14
|
+
* @param {"example"} settingName
|
|
15
|
+
* @param {!!--never--!!} settingValue
|
|
16
|
+
* @param {boolean} includeNewJoiners
|
|
17
|
+
*/
|
|
18
|
+
setTargetedPlayerSettingForEveryone(
|
|
19
|
+
targetedPlayerId: PlayerId,
|
|
20
|
+
settingName: typeof name,
|
|
21
|
+
settingValue: ValueType,
|
|
22
|
+
includeNewJoiners?: boolean,
|
|
23
|
+
): void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface SetEveryoneSettingForPlayer {
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @overload
|
|
30
|
+
*
|
|
31
|
+
* @param {PlayerId} playerId
|
|
32
|
+
* @param {"example"} settingName
|
|
33
|
+
* @param {!!--never--!!} settingValue
|
|
34
|
+
* @param {boolean} [includeNewJoiners]
|
|
35
|
+
* @returns {void}
|
|
36
|
+
*/
|
|
37
|
+
setEveryoneSettingForPlayer(
|
|
38
|
+
playerId: PlayerId,
|
|
39
|
+
settingName: typeof name,
|
|
40
|
+
settingValue: ValueType,
|
|
41
|
+
includeNewJoiners?: boolean,
|
|
42
|
+
): void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface SetOtherEntitySetting {
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @overload
|
|
49
|
+
*
|
|
50
|
+
* @param {PlayerId}
|
|
51
|
+
* @param {"example"} settingName
|
|
52
|
+
* @param {!!--never--!!} settingValue
|
|
53
|
+
* @param {boolean} [includeNewJoiners]
|
|
54
|
+
* @returns {void}
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
setOtherEntitySetting(
|
|
58
|
+
relevantPlayerId: PlayerId,
|
|
59
|
+
targetedEntityId: EntityId,
|
|
60
|
+
settingName: typeof name,
|
|
61
|
+
settingValue: ValueType,
|
|
62
|
+
): void;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface GetOtherEntitySetting {
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
* @overload
|
|
69
|
+
*
|
|
70
|
+
* @param {PlayerId} relevantPlayerId
|
|
71
|
+
* @param {EntityId} targetedEntityId
|
|
72
|
+
* @param {"example"} settingName
|
|
73
|
+
* @returns {!!--never--!!}
|
|
74
|
+
*/
|
|
75
|
+
getOtherEntitySetting(
|
|
76
|
+
relevantPlayerId: PlayerId,
|
|
77
|
+
targetedEntityId: EntityId,
|
|
78
|
+
settingName: typeof name,
|
|
79
|
+
): ValueType;
|
|
80
|
+
}
|
|
81
|
+
type ExportTypes = {
|
|
82
|
+
name: typeof name;
|
|
83
|
+
ValueType: ValueType;
|
|
84
|
+
SetTargetedPlayerSettingForEveryone: SetTargetedPlayerSettingForEveryone;
|
|
85
|
+
SetEveryoneSettingForPlayer: SetEveryoneSettingForPlayer;
|
|
86
|
+
SetOtherEntitySetting: SetOtherEntitySetting;
|
|
87
|
+
GetOtherEntitySetting: GetOtherEntitySetting;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export default ExportTypes;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { EntityId, MargeObject, PlayerId } from "../../../type";
|
|
2
|
+
import Opacity from "./opacity";
|
|
3
|
+
import ZIndex from "./zIndex";
|
|
4
|
+
import OverlayColour from "./overlayColour";
|
|
5
|
+
|
|
6
|
+
type EntitySettingExportFormat = {
|
|
7
|
+
name: string;
|
|
8
|
+
ValueType: any;
|
|
9
|
+
SetTargetedPlayerSettingForEveryone: {
|
|
10
|
+
setTargetedPlayerSettingForEveryone: (
|
|
11
|
+
targetedPlayerId: PlayerId,
|
|
12
|
+
settingName: never,
|
|
13
|
+
settingValue: never,
|
|
14
|
+
includeNewJoiners?: boolean,
|
|
15
|
+
) => void;
|
|
16
|
+
};
|
|
17
|
+
SetEveryoneSettingForPlayer: {
|
|
18
|
+
setEveryoneSettingForPlayer: (
|
|
19
|
+
playerId: PlayerId,
|
|
20
|
+
settingName: never,
|
|
21
|
+
settingValue: never,
|
|
22
|
+
includeNewJoiners?: boolean,
|
|
23
|
+
) => void;
|
|
24
|
+
};
|
|
25
|
+
SetOtherEntitySetting: {
|
|
26
|
+
setOtherEntitySetting: (
|
|
27
|
+
relevantPlayerId: PlayerId,
|
|
28
|
+
targetedEntityId: EntityId,
|
|
29
|
+
settingName: never,
|
|
30
|
+
settingValue: never,
|
|
31
|
+
) => void;
|
|
32
|
+
};
|
|
33
|
+
GetOtherEntitySetting: {
|
|
34
|
+
getOtherEntitySetting: (
|
|
35
|
+
relevantPlayerId: PlayerId,
|
|
36
|
+
targetedEntityId: EntityId,
|
|
37
|
+
settingName: never,
|
|
38
|
+
) => any;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
type AllEntitySettingUnion = Opacity | ZIndex | OverlayColour;
|
|
43
|
+
|
|
44
|
+
type GenerateClientOptions<U extends EntitySettingExportFormat> = {
|
|
45
|
+
[K in U as K["name"]]: K["ValueType"];
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type EntitySettings = GenerateClientOptions<AllEntitySettingUnion>;
|
|
49
|
+
|
|
50
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
|
|
51
|
+
k: infer I,
|
|
52
|
+
) => void
|
|
53
|
+
? I
|
|
54
|
+
: never;
|
|
55
|
+
type GenerateEntitySettingInterface<
|
|
56
|
+
U extends EntitySettingExportFormat,
|
|
57
|
+
K extends keyof any,
|
|
58
|
+
> = MargeObject<
|
|
59
|
+
UnionToIntersection<
|
|
60
|
+
U extends any ? (K extends keyof U ? U[K] : never) : never
|
|
61
|
+
>
|
|
62
|
+
>;
|
|
63
|
+
|
|
64
|
+
export type SetTargetedPlayerSettingForEveryone =
|
|
65
|
+
GenerateEntitySettingInterface<
|
|
66
|
+
AllEntitySettingUnion,
|
|
67
|
+
"SetTargetedPlayerSettingForEveryone"
|
|
68
|
+
>;
|
|
69
|
+
|
|
70
|
+
export type SetEveryoneSettingForPlayer = GenerateEntitySettingInterface<
|
|
71
|
+
AllEntitySettingUnion,
|
|
72
|
+
"SetEveryoneSettingForPlayer"
|
|
73
|
+
>;
|
|
74
|
+
|
|
75
|
+
export type SetOtherEntitySetting = GenerateEntitySettingInterface<
|
|
76
|
+
AllEntitySettingUnion,
|
|
77
|
+
"SetOtherEntitySetting"
|
|
78
|
+
>;
|
|
79
|
+
|
|
80
|
+
export type GetOtherEntitySetting = GenerateEntitySettingInterface<
|
|
81
|
+
AllEntitySettingUnion,
|
|
82
|
+
"GetOtherEntitySetting"
|
|
83
|
+
>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { EntityId, PlayerId } from "../../../type";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Opacity of the entity
|
|
5
|
+
* Fractional values will use dithering
|
|
6
|
+
* 0 opacity will hide the entity but not its name tag
|
|
7
|
+
* @type {number}
|
|
8
|
+
* @default 1
|
|
9
|
+
*/
|
|
10
|
+
type ValueType = number;
|
|
11
|
+
|
|
12
|
+
interface SetTargetedPlayerSettingForEveryone {
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @overload
|
|
16
|
+
*
|
|
17
|
+
* @param {PlayerId} targetedPlayerId
|
|
18
|
+
* @param {"opacity"} settingName
|
|
19
|
+
* @param {Opacity} settingValue
|
|
20
|
+
* @param {boolean} [includeNewJoiners]
|
|
21
|
+
* @returns {void}
|
|
22
|
+
*/
|
|
23
|
+
setTargetedPlayerSettingForEveryone(
|
|
24
|
+
targetedPlayerId: PlayerId,
|
|
25
|
+
settingName: "opacity",
|
|
26
|
+
settingValue: ValueType,
|
|
27
|
+
includeNewJoiners?: boolean,
|
|
28
|
+
): void;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface SetEveryoneSettingForPlayer {
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @overload
|
|
35
|
+
*
|
|
36
|
+
* @param {PlayerId} playerId
|
|
37
|
+
* @param {"opacity"} settingName
|
|
38
|
+
* @param {Opacity} settingValue
|
|
39
|
+
* @param {boolean} [includeNewJoiners]
|
|
40
|
+
* @returns {void}
|
|
41
|
+
*/
|
|
42
|
+
setEveryoneSettingForPlayer(
|
|
43
|
+
playerId: PlayerId,
|
|
44
|
+
settingName: "opacity",
|
|
45
|
+
settingValue: ValueType,
|
|
46
|
+
includeNewJoiners?: boolean,
|
|
47
|
+
): void;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface SetOtherEntitySetting {
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @overload
|
|
54
|
+
*
|
|
55
|
+
* @param {PlayerId}
|
|
56
|
+
* @param {"opacity"} settingName
|
|
57
|
+
* @param {Opacity} settingValue
|
|
58
|
+
* @param {boolean} [includeNewJoiners]
|
|
59
|
+
* @returns {void}
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
setOtherEntitySetting(
|
|
63
|
+
relevantPlayerId: PlayerId,
|
|
64
|
+
targetedEntityId: EntityId,
|
|
65
|
+
settingName: "opacity",
|
|
66
|
+
settingValue: ValueType,
|
|
67
|
+
): void;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface GetOtherEntitySetting {
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @overload
|
|
74
|
+
*
|
|
75
|
+
* @param {PlayerId} relevantPlayerId
|
|
76
|
+
* @param {EntityId} targetedEntityId
|
|
77
|
+
* @param {"opacity"} settingName
|
|
78
|
+
* @returns {void}
|
|
79
|
+
*/
|
|
80
|
+
getOtherEntitySetting(
|
|
81
|
+
relevantPlayerId: PlayerId,
|
|
82
|
+
targetedEntityId: EntityId,
|
|
83
|
+
settingName: "opacity",
|
|
84
|
+
): ValueType;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
type ExportTypes = {
|
|
88
|
+
name: "opacity";
|
|
89
|
+
ValueType: ValueType;
|
|
90
|
+
SetTargetedPlayerSettingForEveryone: SetTargetedPlayerSettingForEveryone;
|
|
91
|
+
SetEveryoneSettingForPlayer: SetEveryoneSettingForPlayer;
|
|
92
|
+
SetOtherEntitySetting: SetOtherEntitySetting;
|
|
93
|
+
GetOtherEntitySetting: GetOtherEntitySetting;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export default ExportTypes;
|