bevy-ts 0.1.0-alpha.1 → 0.1.0-alpha.2
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/package.json +6 -6
- package/protocol.d.ts +181 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bevy-ts",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
4
|
"description": "TypeScript for Bevy: components, systems and hot reload without recompiling Rust",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"plugins"
|
|
55
55
|
],
|
|
56
56
|
"optionalDependencies": {
|
|
57
|
-
"@bevy-ts/darwin-arm64": "0.1.0-alpha.
|
|
58
|
-
"@bevy-ts/darwin-x64": "0.1.0-alpha.
|
|
59
|
-
"@bevy-ts/linux-arm64": "0.1.0-alpha.
|
|
60
|
-
"@bevy-ts/linux-x64": "0.1.0-alpha.
|
|
61
|
-
"@bevy-ts/win32-x64": "0.1.0-alpha.
|
|
57
|
+
"@bevy-ts/darwin-arm64": "0.1.0-alpha.2",
|
|
58
|
+
"@bevy-ts/darwin-x64": "0.1.0-alpha.2",
|
|
59
|
+
"@bevy-ts/linux-arm64": "0.1.0-alpha.2",
|
|
60
|
+
"@bevy-ts/linux-x64": "0.1.0-alpha.2",
|
|
61
|
+
"@bevy-ts/win32-x64": "0.1.0-alpha.2"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"json-schema-to-typescript": "^15.0.4",
|
package/protocol.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @generated by packages/bevy-ts/scripts/gen-protocol.mjs from protocol/bevy-ts.openrpc.json. Do not edit.
|
|
2
2
|
|
|
3
3
|
/** The protocol version these types describe. */
|
|
4
|
-
export const PROTOCOL_VERSION: "1.
|
|
4
|
+
export const PROTOCOL_VERSION: "1.10.0";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* An entity id: Entity::to_bits.
|
|
@@ -52,13 +52,29 @@ export type TsxNodeId = string;
|
|
|
52
52
|
* via the `definition` "TsxProvenance".
|
|
53
53
|
*/
|
|
54
54
|
export type TsxProvenance = "controlled" | "initial" | "default" | "bound" | "override";
|
|
55
|
+
/**
|
|
56
|
+
* A ViewportInput type.
|
|
57
|
+
*
|
|
58
|
+
* This interface was referenced by `ProtocolTypes`'s JSON-Schema
|
|
59
|
+
* via the `definition` "InputType".
|
|
60
|
+
*/
|
|
61
|
+
export type InputType = "pointer" | "wheel" | "gesture" | "key" | "ime" | "touch" | "gamepad" | "focus" | "visible";
|
|
55
62
|
/**
|
|
56
63
|
* One input event from the viewer.
|
|
57
64
|
*
|
|
58
65
|
* This interface was referenced by `ProtocolTypes`'s JSON-Schema
|
|
59
66
|
* via the `definition` "ViewportInput".
|
|
60
67
|
*/
|
|
61
|
-
export type ViewportInput =
|
|
68
|
+
export type ViewportInput =
|
|
69
|
+
| PointerEvent
|
|
70
|
+
| WheelEvent
|
|
71
|
+
| GestureEvent
|
|
72
|
+
| KeyEvent
|
|
73
|
+
| ImeEvent
|
|
74
|
+
| FocusEvent
|
|
75
|
+
| VisibleEvent
|
|
76
|
+
| TouchEvent
|
|
77
|
+
| GamepadEvent;
|
|
62
78
|
/**
|
|
63
79
|
* What a viewport shows: "game", or a preview from asset_preview.
|
|
64
80
|
*
|
|
@@ -876,6 +892,10 @@ export interface Modifiers {
|
|
|
876
892
|
ctrl?: boolean;
|
|
877
893
|
alt?: boolean;
|
|
878
894
|
meta?: boolean;
|
|
895
|
+
/**
|
|
896
|
+
* Caps Lock on (1.9). The engine may ignore it.
|
|
897
|
+
*/
|
|
898
|
+
caps?: boolean;
|
|
879
899
|
}
|
|
880
900
|
/**
|
|
881
901
|
* A pointer event in the hole.
|
|
@@ -899,6 +919,10 @@ export interface PointerEvent {
|
|
|
899
919
|
dx?: number;
|
|
900
920
|
dy?: number;
|
|
901
921
|
mods?: Modifiers;
|
|
922
|
+
/**
|
|
923
|
+
* Buttons held during the event (1.9). The engine may ignore it.
|
|
924
|
+
*/
|
|
925
|
+
buttons?: ("left" | "right" | "middle" | "back" | "forward")[];
|
|
902
926
|
}
|
|
903
927
|
/**
|
|
904
928
|
* Scroll, with precise deltas in pixels or lines.
|
|
@@ -930,6 +954,15 @@ export interface GestureEvent {
|
|
|
930
954
|
* Pinch: scale delta; rotate: radians.
|
|
931
955
|
*/
|
|
932
956
|
delta?: number;
|
|
957
|
+
/**
|
|
958
|
+
* Points from the hole's top left (1.9).
|
|
959
|
+
*/
|
|
960
|
+
x?: number;
|
|
961
|
+
y?: number;
|
|
962
|
+
/**
|
|
963
|
+
* As WheelEvent.phase (1.9). The engine may ignore it.
|
|
964
|
+
*/
|
|
965
|
+
phase?: "started" | "moved" | "ended" | "cancelled";
|
|
933
966
|
}
|
|
934
967
|
/**
|
|
935
968
|
* A key.
|
|
@@ -990,6 +1023,150 @@ export interface VisibleEvent {
|
|
|
990
1023
|
type: "visible";
|
|
991
1024
|
on: boolean;
|
|
992
1025
|
}
|
|
1026
|
+
/**
|
|
1027
|
+
* Touches on a phone's screen (1.10).
|
|
1028
|
+
*
|
|
1029
|
+
* This interface was referenced by `ProtocolTypes`'s JSON-Schema
|
|
1030
|
+
* via the `definition` "TouchEvent".
|
|
1031
|
+
*/
|
|
1032
|
+
export interface TouchEvent {
|
|
1033
|
+
type: "touch";
|
|
1034
|
+
kind: "start" | "move" | "end" | "cancel";
|
|
1035
|
+
/**
|
|
1036
|
+
* Every touch still down after the event. A touch absent that was down has ended (cancelled, on cancel).
|
|
1037
|
+
*/
|
|
1038
|
+
touches: TouchPoint[];
|
|
1039
|
+
mods?: Modifiers;
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* One touch down.
|
|
1043
|
+
*
|
|
1044
|
+
* This interface was referenced by `ProtocolTypes`'s JSON-Schema
|
|
1045
|
+
* via the `definition` "TouchPoint".
|
|
1046
|
+
*/
|
|
1047
|
+
export interface TouchPoint {
|
|
1048
|
+
/**
|
|
1049
|
+
* Stable while the touch is down.
|
|
1050
|
+
*/
|
|
1051
|
+
id: number;
|
|
1052
|
+
/**
|
|
1053
|
+
* Points from the hole's top left.
|
|
1054
|
+
*/
|
|
1055
|
+
x: number;
|
|
1056
|
+
y: number;
|
|
1057
|
+
/**
|
|
1058
|
+
* The contact's radius in points.
|
|
1059
|
+
*/
|
|
1060
|
+
rx?: number;
|
|
1061
|
+
ry?: number;
|
|
1062
|
+
/**
|
|
1063
|
+
* 0 to 1.
|
|
1064
|
+
*/
|
|
1065
|
+
force?: number;
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* A gamepad on the viewer's device, W3C Gamepad API standard mapping (1.10). A state is sent only on change.
|
|
1069
|
+
*
|
|
1070
|
+
* This interface was referenced by `ProtocolTypes`'s JSON-Schema
|
|
1071
|
+
* via the `definition` "GamepadEvent".
|
|
1072
|
+
*/
|
|
1073
|
+
export interface GamepadEvent {
|
|
1074
|
+
type: "gamepad";
|
|
1075
|
+
kind: "connected" | "state" | "disconnected";
|
|
1076
|
+
/**
|
|
1077
|
+
* The W3C Gamepad index.
|
|
1078
|
+
*/
|
|
1079
|
+
index: number;
|
|
1080
|
+
/**
|
|
1081
|
+
* The W3C Gamepad id.
|
|
1082
|
+
*/
|
|
1083
|
+
id?: string;
|
|
1084
|
+
/**
|
|
1085
|
+
* In the W3C standard mapping's order; on connected and state.
|
|
1086
|
+
*/
|
|
1087
|
+
buttons?: GamepadButtonState[];
|
|
1088
|
+
/**
|
|
1089
|
+
* In the W3C standard mapping's order, -1 to 1, y down; on connected and state.
|
|
1090
|
+
*/
|
|
1091
|
+
axes?: number[];
|
|
1092
|
+
}
|
|
1093
|
+
/**
|
|
1094
|
+
* One button of a gamepad.
|
|
1095
|
+
*
|
|
1096
|
+
* This interface was referenced by `ProtocolTypes`'s JSON-Schema
|
|
1097
|
+
* via the `definition` "GamepadButtonState".
|
|
1098
|
+
*/
|
|
1099
|
+
export interface GamepadButtonState {
|
|
1100
|
+
pressed: boolean;
|
|
1101
|
+
/**
|
|
1102
|
+
* 0 to 1.
|
|
1103
|
+
*/
|
|
1104
|
+
value: number;
|
|
1105
|
+
}
|
|
1106
|
+
/**
|
|
1107
|
+
* Who is viewing (1.10).
|
|
1108
|
+
*
|
|
1109
|
+
* This interface was referenced by `ProtocolTypes`'s JSON-Schema
|
|
1110
|
+
* via the `definition` "ViewerInfo".
|
|
1111
|
+
*/
|
|
1112
|
+
export interface ViewerInfo {
|
|
1113
|
+
/**
|
|
1114
|
+
* app: abyme.app's surface view; stream: abyme-stream.
|
|
1115
|
+
*/
|
|
1116
|
+
kind: "app" | "stream";
|
|
1117
|
+
/**
|
|
1118
|
+
* The name of the device that shows the surface.
|
|
1119
|
+
*/
|
|
1120
|
+
device?: string;
|
|
1121
|
+
/**
|
|
1122
|
+
* The device is a phone.
|
|
1123
|
+
*/
|
|
1124
|
+
mobile?: boolean;
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* hello, either way.
|
|
1128
|
+
*
|
|
1129
|
+
* This interface was referenced by `ProtocolTypes`'s JSON-Schema
|
|
1130
|
+
* via the `definition` "HelloMessage".
|
|
1131
|
+
*/
|
|
1132
|
+
export interface HelloMessage {
|
|
1133
|
+
viewer?: ViewerInfo1;
|
|
1134
|
+
/**
|
|
1135
|
+
* From the engine (1.10): the input types it reads.
|
|
1136
|
+
*/
|
|
1137
|
+
inputs?: InputType[];
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* From the viewer (1.10); absent from an older one.
|
|
1141
|
+
*/
|
|
1142
|
+
export interface ViewerInfo1 {
|
|
1143
|
+
/**
|
|
1144
|
+
* app: abyme.app's surface view; stream: abyme-stream.
|
|
1145
|
+
*/
|
|
1146
|
+
kind: "app" | "stream";
|
|
1147
|
+
/**
|
|
1148
|
+
* The name of the device that shows the surface.
|
|
1149
|
+
*/
|
|
1150
|
+
device?: string;
|
|
1151
|
+
/**
|
|
1152
|
+
* The device is a phone.
|
|
1153
|
+
*/
|
|
1154
|
+
mobile?: boolean;
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* To the viewer a newer hello replaced (1.10).
|
|
1158
|
+
*
|
|
1159
|
+
* This interface was referenced by `ProtocolTypes`'s JSON-Schema
|
|
1160
|
+
* via the `definition` "ReplacedMessage".
|
|
1161
|
+
*/
|
|
1162
|
+
export interface ReplacedMessage {
|
|
1163
|
+
/**
|
|
1164
|
+
* The new viewer's, as its hello gave it; {} when it named none.
|
|
1165
|
+
*/
|
|
1166
|
+
viewer: {
|
|
1167
|
+
[k: string]: unknown;
|
|
1168
|
+
};
|
|
1169
|
+
}
|
|
993
1170
|
/**
|
|
994
1171
|
* This interface was referenced by `ProtocolTypes`'s JSON-Schema
|
|
995
1172
|
* via the `definition` "ViewportAttachParams".
|
|
@@ -1905,8 +2082,9 @@ export type MethodName = keyof Methods;
|
|
|
1905
2082
|
|
|
1906
2083
|
/** Notifications on a viewport's Mach channel: params, and the side that sends each. */
|
|
1907
2084
|
export interface ChannelMessages {
|
|
1908
|
-
"hello": { params:
|
|
2085
|
+
"hello": { params: HelloMessage; from: "both" };
|
|
1909
2086
|
"bye": { params: Empty; from: "viewer" };
|
|
2087
|
+
"replaced": { params: ReplacedMessage; from: "engine" };
|
|
1910
2088
|
"input": { params: ViewportInput; from: "viewer" };
|
|
1911
2089
|
"tick": { params: TickMessage; from: "viewer" };
|
|
1912
2090
|
"resize": { params: ViewportResizeParams; from: "viewer" };
|