@rbxts/scribe-leaderstats 2.6.0 → 2.7.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/Scribe-source-map.json +1 -1
- package/index.d.ts +2 -1
- package/init.luau +5 -2
- package/package.json +2 -2
package/Scribe-source-map.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2.
|
|
1
|
+
{"version":"2.7.0","format":1,"description":"Segments are [packedLine, sourceLine]. Use the last segment at or before the packed line, then add its line offset.","files":{"addons/leaderstats/ScribeLeaderstats.luau":{"sourceSha256":"e852365896572bb33d23ae4eb702b86a3f1bd82a8d2de05b244fd8689691f40e","packedSha256":"e852365896572bb33d23ae4eb702b86a3f1bd82a8d2de05b244fd8689691f40e","segments":[[1,1]],"packagePath":"init.luau"}}}
|
package/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type Scribe from "@rbxts/scribe";
|
|
|
3
3
|
/** Optional server-side bridge to Roblox's built-in player list. */
|
|
4
4
|
declare namespace ScribeLeaderstats {
|
|
5
5
|
interface DataAPI {
|
|
6
|
+
/** Waits for player data; returns undefined and a reason if unavailable. */
|
|
6
7
|
readonly WaitForData: (this: void, player: Player, timeout?: number) => LuaTuple<[
|
|
7
8
|
{ readonly Get: (this: void) => unknown } | undefined,
|
|
8
9
|
string | undefined,
|
|
@@ -35,7 +36,7 @@ declare namespace ScribeLeaderstats {
|
|
|
35
36
|
IsServer?: (this: void) => boolean;
|
|
36
37
|
Warn?: (this: void, message: string) => void;
|
|
37
38
|
}
|
|
38
|
-
/**
|
|
39
|
+
/** Mirrors selected fields into leaderstats; all are public, including ServerOnly/Session paths. */
|
|
39
40
|
function Start<Data extends DataAPI>(data: Data, stats: Stats<NoInfer<Data>>, dependencies?: Dependencies): Handle;
|
|
40
41
|
}
|
|
41
42
|
|
package/init.luau
CHANGED
|
@@ -8,8 +8,8 @@ local RunService = game:GetService("RunService")
|
|
|
8
8
|
export type Stats = { [string]: string }
|
|
9
9
|
export type Handle = { Stop: (self: Handle) -> () }
|
|
10
10
|
export type DataAPI = {
|
|
11
|
-
WaitForData: (player: Player, timeout: number?) -> (any?, string?),
|
|
12
|
-
SessionEnded: { Connect: (self: any, callback: (player: Player, reason: string) -> ()) -> any },
|
|
11
|
+
read WaitForData: (player: Player, timeout: number?) -> (any?, string?),
|
|
12
|
+
read SessionEnded: { read Connect: (self: any, callback: (player: Player, reason: string) -> ()) -> any },
|
|
13
13
|
}
|
|
14
14
|
--- Test dependencies; normal game code omits this argument.
|
|
15
15
|
export type Dependencies = {
|
|
@@ -36,6 +36,9 @@ local function scalarClass(value: any): string?
|
|
|
36
36
|
return (classes :: any)[type(value)]
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
+
--[[
|
|
40
|
+
Mirrors selected Scribe fields into public leaderstats on the server.
|
|
41
|
+
]]
|
|
39
42
|
function ScribeLeaderstats.Start(data: DataAPI, stats: Stats, dependencies: Dependencies?): Handle
|
|
40
43
|
local deps: Dependencies = dependencies or {}
|
|
41
44
|
local isServer = deps.IsServer or function()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rbxts/scribe-leaderstats",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Optional leaderstats addon for Scribe",
|
|
5
5
|
"main": "init.luau",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"homepage": "https://scribe.ericplane.dev/",
|
|
13
13
|
"author": "ericplane",
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@rbxts/scribe": "^2.
|
|
15
|
+
"@rbxts/scribe": "^2.7.0"
|
|
16
16
|
},
|
|
17
17
|
"publishConfig": {
|
|
18
18
|
"access": "public"
|