@rbxts/tether 1.4.2 → 1.4.3
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local RunService = TS.import(script, TS.getModule(script, "@rbxts", "services")).RunService
|
|
4
|
-
local repr = TS.import(script, TS.getModule(script, "@rbxts", "repr").out)
|
|
4
|
+
local repr = TS.import(script, TS.getModule(script, "@rbxts", "repr").out).default
|
|
5
5
|
local DropRequest = TS.import(script, script.Parent, "middleware").DropRequest
|
|
6
6
|
local bufferToString = TS.import(script, script.Parent, "utility").bufferToString
|
|
7
7
|
local BLOB_SIZE = 5
|
|
@@ -89,6 +89,7 @@ do
|
|
|
89
89
|
local data = _param.data
|
|
90
90
|
local getRawData = _param.getRawData
|
|
91
91
|
local _binding = getRawData()
|
|
92
|
+
local messageBuf = _binding.messageBuf
|
|
92
93
|
local buf = _binding.buf
|
|
93
94
|
local blobs = _binding.blobs
|
|
94
95
|
local bufferSize = if buf == nil then 0 else buffer.len(buf)
|
|
@@ -98,7 +99,7 @@ do
|
|
|
98
99
|
}), "\n"), "\n ") else "unknown"
|
|
99
100
|
local text = { "\n", horizontalLine, "\n", "Packet sent to ", (if RunService:IsServer() then "client" else "server"), "!\n", " - Message: ", tostring(message), "\n", " - Data: ", repr(data, {
|
|
100
101
|
pretty = true,
|
|
101
|
-
}), "\n", " - Raw data:\n", " - Buffer: ", bufferToString(buf), "\n", " - Blobs: ", repr(blobs, {
|
|
102
|
+
}), "\n", " - Raw data:\n", " - Message Buffer: ", bufferToString(messageBuf), "\n", " - Buffer: ", bufferToString(buf), "\n", " - Blobs: ", repr(blobs, {
|
|
102
103
|
pretty = false,
|
|
103
104
|
robloxClassName = true,
|
|
104
105
|
}), "\n", " - Packet size: ", tostring(bufferSize + blobsSize), " bytes\n", " - Buffer: ", tostring(bufferSize), " bytes\n", " - Blobs: ", tostring(blobsSize), " bytes\n", " - Schema: ", schemaString, "\n", horizontalLine, "\n" }
|
|
@@ -3,7 +3,7 @@ local TS = _G[script]
|
|
|
3
3
|
local Players = TS.import(script, TS.getModule(script, "@rbxts", "services")).Players
|
|
4
4
|
local Destroyable = TS.import(script, TS.getModule(script, "@rbxts", "destroyable").out).default
|
|
5
5
|
local Object = TS.import(script, TS.getModule(script, "@rbxts", "object-utils"))
|
|
6
|
-
local repr = TS.import(script, TS.getModule(script, "@rbxts", "repr").out)
|
|
6
|
+
local repr = TS.import(script, TS.getModule(script, "@rbxts", "repr").out).default
|
|
7
7
|
local _middleware = TS.import(script, script.Parent.Parent, "middleware")
|
|
8
8
|
local DropRequest = _middleware.DropRequest
|
|
9
9
|
local MiddlewareProvider = _middleware.MiddlewareProvider
|
package/out/structs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Modding } from "@flamework/core";
|
|
2
|
-
import type { SerializerMetadata, SerializedData,
|
|
2
|
+
import type { SerializerMetadata, SerializedData, SchemaGuard } from "@rbxts/serio";
|
|
3
3
|
export type MessageCallback<T = unknown> = ServerMessageCallback<T> | ClientMessageCallback<T>;
|
|
4
4
|
export type FunctionMessageCallback<T = unknown, R = unknown> = ServerFunctionMessageCallback<T, R> | ClientFunctionMessageCallback<T, R>;
|
|
5
5
|
export type ClientMessageCallback<T = unknown> = (data: T) => void;
|
|
@@ -15,36 +15,11 @@ export interface SerializedPacket extends SerializedData {
|
|
|
15
15
|
readonly messageBuf: buffer;
|
|
16
16
|
}
|
|
17
17
|
export type MessageEvent = (...packets: SerializedPacket[]) => void;
|
|
18
|
-
type Prev = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24];
|
|
19
|
-
type ReplaceByMapWithDepth<T, Depth extends number = 24> = [
|
|
20
|
-
Depth
|
|
21
|
-
] extends [never] ? T : T extends Callback ? T : T extends Vector ? Vector3 : T extends Transform ? CFrame : T extends String ? string : T extends buffer ? buffer : T extends {
|
|
22
|
-
_packed: [infer V];
|
|
23
|
-
} ? ReplaceByMapWithDepth<V, Prev[Depth]> : T extends {
|
|
24
|
-
_list: [infer V];
|
|
25
|
-
} ? ReplaceByMapWithDepth<V, Depth> : T extends {
|
|
26
|
-
_tuple: [infer A];
|
|
27
|
-
} ? ReplaceByMapWithDepth<A, Prev[Depth]> : T extends {
|
|
28
|
-
_set: [infer V];
|
|
29
|
-
} ? Set<ReplaceByMapWithDepth<V, Prev[Depth]>> : T extends {
|
|
30
|
-
_set: infer T extends unknown[];
|
|
31
|
-
} ? Map<ReplaceByMapWithDepth<T[number], Prev[Depth]>, ReplaceByMapWithDepth<T[number], Prev[Depth]>> : T extends {
|
|
32
|
-
_map: [infer K, infer V];
|
|
33
|
-
} ? Map<ReplaceByMapWithDepth<K, Prev[Depth]>, ReplaceByMapWithDepth<V, Prev[Depth]>> : T extends {
|
|
34
|
-
_map: [infer V];
|
|
35
|
-
} ? Map<ReplaceByMapWithDepth<V, Prev[Depth]>, ReplaceByMapWithDepth<V, Prev[Depth]>> : T extends u8 | u16 | u24 | u32 | i8 | i16 | i24 | i32 | f16 | f24 | f32 | f64 ? number : T extends Color3 ? {
|
|
36
|
-
R: number;
|
|
37
|
-
G: number;
|
|
38
|
-
B: number;
|
|
39
|
-
} : T extends any[] ? ReplaceByMapWithDepth<T[number], Prev[Depth]>[] : T extends ReadonlyMap<unknown, unknown> ? T : T extends object ? {
|
|
40
|
-
[K in keyof T]: ReplaceByMapWithDepth<T[K], Prev[Depth]>;
|
|
41
|
-
} : T;
|
|
42
18
|
export interface MessageMetadata<MessageData, Kind extends keyof MessageData> {
|
|
43
|
-
readonly guard:
|
|
19
|
+
readonly guard: SchemaGuard<MessageData[Kind]>;
|
|
44
20
|
readonly serializerMetadata: MessageData[Kind] extends undefined ? undefined : Modding.Many<SerializerMetadata<MessageData[Kind]>>;
|
|
45
21
|
}
|
|
46
22
|
export type Guard<T = unknown> = (value: unknown) => value is T;
|
|
47
23
|
export type MessageEmitterMetadata<MessageData> = {
|
|
48
24
|
readonly [Kind in keyof MessageData]: MessageMetadata<MessageData, Kind>;
|
|
49
25
|
};
|
|
50
|
-
export {};
|
package/out/utility.luau
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rbxts/tether",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"main": "out/init.luau",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"setup-rokit": "rokit trust lune-org/lune && rokit trust rojo-rbx/rojo && rokit install",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"rbxts-transformer-flamework": "^1.3.2",
|
|
37
37
|
"roblox-ts": "^3.0.0",
|
|
38
38
|
"ts-toolbelt": "^9.6.0",
|
|
39
|
-
"typescript": "^5"
|
|
39
|
+
"typescript": "^5.5.3"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@flamework/core": "^1.3.2",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@rbxts/flamework-meta-utils": "^1.0.7",
|
|
45
45
|
"@rbxts/object-utils": "^1.0.4",
|
|
46
46
|
"@rbxts/repr": "^1.0.3",
|
|
47
|
-
"@rbxts/serio": "^1.0
|
|
47
|
+
"@rbxts/serio": "^1.1.0",
|
|
48
48
|
"@rbxts/services": "^1.6.0",
|
|
49
49
|
"@rbxts/trash": "^1.0.8"
|
|
50
50
|
}
|