@rbxts/scribe 2.5.0 → 2.6.1

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/types/index.d.ts CHANGED
@@ -1,226 +1,281 @@
1
- import type * as Schema from "./schema";
2
- import type * as API from "./api";
3
- import type * as Common from "./common";
4
-
5
- declare const Scribe: Scribe.ScribeModule;
6
-
7
- declare namespace Scribe {
8
- interface ScribeModule {
9
- <T, S = {}, C = {}>(options: API.ScribeOptions<T, S, C>): API.Bundle<T, S, C>;
10
- readonly new: <T, S = {}, C = {}>(this: void, options: API.ScribeOptions<T, S, C>) => API.Bundle<T, S, C>;
11
- readonly Version: string;
12
- readonly ServerOnly: <T>(this: void, value: T) => Schema.ServerOnly<T>;
13
- readonly Shared: <T>(this: void, value: T) => Schema.Shared<T>;
14
- readonly Session: <T>(this: void, value: T) => Schema.Session<T>;
15
- readonly Int: (this: void, value: number, meta?: NumberMeta) => number;
16
- readonly Number: (this: void, value: number, meta?: FloatMeta) => number;
17
- readonly Big: (this: void, value?: number | string, meta?: BigMeta) => Schema.BigSchema;
18
- readonly String: (this: void, value: string, meta?: StringMeta) => string;
19
- readonly Enum: <K extends string>(this: void, value: NoInfer<K>, members: readonly K[]) => Schema.EnumValue<K>;
20
- readonly Flags: <K extends string>(this: void, members: readonly K[]) => Schema.Flags<K>;
21
- readonly Timed: <T>(this: void, value: T) => Schema.Timed<T>;
22
- readonly Dynamic: <T>(this: void, factory: (this: void) => T) => T;
23
- /** Annotate compute arguments: the enclosing template is not in scope here. */
24
- readonly Derived: <T, A extends unknown[]>(this: void, output: T, inputs: readonly string[], compute: (this: void, ...args: A) => Schema.ValueOf<T>) => Schema.Derived<T>;
25
- readonly Optional: <T>(this: void, value: T) => Schema.Optional<T>;
26
- readonly ArrayOf: <T>(this: void, shape: T, options?: ArrayOpts) => Schema.ArrayOf<T>;
27
- readonly SetOf: <T>(this: void, element: T, options?: SetOpts) => Schema.SetOf<T>;
28
- readonly MapOf: <K extends "integer" | "string", T>(this: void, keyType: K, shape: T, options?: DictOpts) => Schema.MapOf<K, T>;
29
- readonly DictOf: <T>(this: void, shape: T, options?: DictOpts) => Schema.DictOf<T>;
30
- readonly Vector3: (this: void, value: Vector3) => Vector3;
31
- readonly Vector2: (this: void, value: Vector2) => Vector2;
32
- readonly Vector3int16: (this: void, value: Vector3int16) => Vector3int16;
33
- readonly Vector2int16: (this: void, value: Vector2int16) => Vector2int16;
34
- readonly CFrame: (this: void, value: CFrame, meta?: CFrameMeta) => CFrame;
35
- readonly Color3: (this: void, value: Color3) => Color3;
36
- readonly BrickColor: (this: void, value: BrickColor) => BrickColor;
37
- readonly UDim: (this: void, value: UDim) => UDim;
38
- readonly UDim2: (this: void, value: UDim2) => UDim2;
39
- readonly Rect: (this: void, value: Rect) => Rect;
40
- readonly NumberRange: (this: void, value: NumberRange) => NumberRange;
41
- readonly NumberSequence: (this: void, value: NumberSequence) => NumberSequence;
42
- readonly ColorSequence: (this: void, value: ColorSequence) => ColorSequence;
43
- readonly DateTime: (this: void, value: DateTime) => DateTime;
44
- readonly EnumItem: <T extends EnumItem>(this: void, value: T) => T;
45
- readonly Font: (this: void, value: Font) => Font;
46
- readonly PhysicalProperties: (this: void, value: PhysicalProperties) => PhysicalProperties;
47
- readonly Short: (this: void, value?: number | Schema.BigValue, decimals?: number) => string;
48
- readonly SetShortSuffixes: (this: void, suffixes: readonly string[]) => void;
49
- readonly Configure: (this: void, config: Common.ConfigureOptions) => void;
50
- readonly GetProfileKeyPrefix: (this: void) => string;
51
- readonly GetStatus: (this: void) => Common.Status;
52
- readonly OnStatusChanged: Common.Signal<[Common.Status, Common.Status]>;
53
- readonly OnIssue: Common.Signal<[Common.LogEntry]>;
54
- readonly AddLogSink: (this: void, callback: (this: void, entry: Common.LogEntry) => void, options?: Common.LogSinkOptions) => Schema.Disconnect;
55
- readonly RegisterAddon: (this: void, name: string, actions: Common.AddonActions) => Schema.Disconnect;
56
- readonly GetRecentLogs: (this: void, filter?: Common.LogFilter) => Common.LogEntry[];
57
- readonly GetMetrics: (this: void) => Common.Metrics;
58
- readonly GetPercentiles: (this: void) => Common.PercentileSnapshot;
59
- readonly GetBudgetSnapshot: (this: void) => Common.BudgetSnapshot;
60
- readonly GetLeaderboardSnapshot: (this: void) => Common.LeaderboardSnapshotEntry[];
61
- readonly RequestFailed: Common.RequestFailedMarker;
62
- readonly Datatypes: {
63
- readonly IsSupported: (this: void, name: string) => boolean;
64
- readonly PrecisionValues: (this: void, name: string) => string[] | undefined;
65
- readonly Pack: <K extends keyof DatatypeValues>(this: void, name: K, value: DatatypeValues[K], precision?: K extends "CFrame" ? "exact" : never) => buffer;
66
- readonly Unpack: <K extends keyof DatatypeValues>(this: void, name: K, bytes: buffer) => DatatypeValues[K];
67
- readonly NONFINITE: "Scribe:nonfinite:";
68
- };
69
-
70
- }
71
-
72
- interface NumberMeta { Min?: number; Max?: number; }
73
- interface DatatypeValues {
74
- Vector3: Vector3; Vector2: Vector2; Vector3int16: Vector3int16; Vector2int16: Vector2int16;
75
- CFrame: CFrame; Color3: Color3; BrickColor: BrickColor; UDim: UDim; UDim2: UDim2;
76
- Rect: Rect; NumberRange: NumberRange; NumberSequence: NumberSequence; ColorSequence: ColorSequence;
77
- DateTime: DateTime; EnumItem: EnumItem; Font: Font; PhysicalProperties: PhysicalProperties;
78
- }
79
- interface FloatMeta extends NumberMeta { Precision?: number | "f32"; }
80
- interface BigMeta { Min?: number | string; Max?: number | string; }
81
- interface StringMeta { MaxLength?: number; }
82
- interface CFrameMeta { Precision?: "exact"; }
83
- interface ArrayOpts { MaxItems?: number; Evict?: "Front" | "Back"; }
84
- interface SetOpts { MaxItems?: number; }
85
- interface DictOpts { MaxKeys?: number; MaxKeyLength?: number; }
86
- type MapKeyType = "integer" | "string";
87
- export type ServerOnly<T> = Schema.ServerOnly<T>;
88
- export type Shared<T> = Schema.Shared<T>;
89
- export type Session<T> = Schema.Session<T>;
90
- export type Timed<T> = Schema.Timed<T>;
91
- export type Derived<T> = Schema.Derived<T>;
92
- export type Optional<T> = Schema.Optional<T>;
93
- export type ArrayOf<T> = Schema.ArrayOf<T>;
94
- export type DictOf<T> = Schema.DictOf<T>;
95
- export type MapOf<K extends "integer" | "string", T> = Schema.MapOf<K, T>;
96
- export type SetOf<T> = Schema.SetOf<T>;
97
- export type Flags<K extends string = string> = Schema.Flags<K>;
98
- export type EnumValue<K extends string> = Schema.EnumValue<K>;
99
- export type BigSchema = Schema.BigSchema;
100
- export type Disconnect = Schema.Disconnect;
101
- export type BigOperand = Schema.BigOperand;
102
- export type BigValue = Schema.BigValue;
103
- export type Datatype = Schema.Datatype;
104
- export type AtomicValue = Schema.AtomicValue;
105
- export type ValueOf<T> = Schema.ValueOf<T>;
106
- export type DeepReadonly<T> = Schema.DeepReadonly<T>;
107
- export type InputOf<T> = Schema.InputOf<T>;
108
- export type ElementInput<T> = Schema.ElementInput<T>;
109
- export type ClientSchema<T> = Schema.ClientSchema<T>;
110
- export type SharedSchema<T> = Schema.SharedSchema<T>;
111
- export type ReadableNode<T> = Schema.ReadableNode<T>;
112
- export type Accessor<T, Root extends boolean = false, Missing extends boolean = false, ReadOnly extends boolean = false, Closed extends boolean = false> = Schema.Accessor<T, Root, Missing, ReadOnly, Closed>;
113
- export type PlayerData<T> = Schema.PlayerData<T>;
114
- export type ReadonlyAccessor<T, Root extends boolean = false> = Schema.ReadonlyAccessor<T, Root>;
115
- export type NumericPaths<T, IncludeBig extends boolean = false, Depth extends unknown[] = []> = Schema.NumericPaths<T, IncludeBig, Depth>;
116
- export type LeaderboardConfig<T = unknown> = API.LeaderboardConfig<T>;
117
- export type ProductConfig<T = unknown> = API.ProductConfig<T>;
118
- export type PurchaseSpec<T = unknown> = API.PurchaseSpec<T>;
119
- export type CommandArguments<F> = API.CommandArguments<F>;
120
- export type CommandReturn<F> = API.CommandReturn<F>;
121
- export type CommandHandler<F> = API.CommandHandler<F>;
122
- export type CommandSpec = API.CommandSpec;
123
- export type RequestFunction<C> = API.RequestFunction<C>;
124
- export type RequestOnceFunction<C> = API.RequestOnceFunction<C>;
125
- export type RegisterCommand<C> = API.RegisterCommand<C>;
126
- export type MockCommand<C> = API.MockCommand<C>;
127
- export type ServerStore<S> = API.ServerStore<S>;
128
- export type ClientServerStore<S> = API.ClientServerStore<S>;
129
- export type SharedData<T> = API.SharedData<T>;
130
- export type ServerAPI<T, C = {}> = API.ServerAPI<T, C>;
131
- export type ServerData<T, S = {}, C = {}> = API.ServerData<T, S, C>;
132
- export type MockValues<T> = API.MockValues<T>;
133
- export type ClientAPI<T, C = {}> = API.ClientAPI<T, C>;
134
- export type ClientData<T, S = {}, C = {}> = API.ClientData<T, S, C>;
135
- export type Bundle<T, S = {}, C = {}> = API.Bundle<T, S, C>;
136
- export type ScribeOptions<T, S = {}, C = {}> = API.ScribeOptions<T, S, C>;
137
- export type UnknownRecord = Common.UnknownRecord;
138
- export type PathSegment = Common.PathSegment;
139
- export type Path = Common.Path;
140
- export type OpKind = Common.OpKind;
141
- export type Op = Common.Op;
142
- export type ScribeTransport = Common.ScribeTransport;
143
- export type Connection = Common.Connection;
144
- export type Signal<Args extends unknown[]> = Common.Signal<Args>;
145
- export type LogLevel = Common.LogLevel;
146
- export type LogCategory = Common.LogCategory;
147
- export type LogCode = Common.LogCode;
148
- export type LogEntry = Common.LogEntry;
149
- export type LogSinkOptions = Common.LogSinkOptions;
150
- export type LogFilter = Common.LogFilter;
151
- export type Status = Common.Status;
152
- export type SessionState = Common.SessionState;
153
- export type LoadPhase = Common.LoadPhase;
154
- export type Visibility = Common.Visibility;
155
- export type LifecycleReason = Common.LifecycleReason;
156
- export type RequestReason = Common.RequestReason;
157
- export type RequestFailedMarker = Common.RequestFailedMarker;
158
- export type RequestFailure = Common.RequestFailure;
159
- export type ProductState = Common.ProductState;
160
- export type PurchaseReason = Common.PurchaseReason;
161
- export type GiftReason = Common.GiftReason;
162
- export type OperationResult = Common.OperationResult;
163
- export type SaveInfo = Common.SaveInfo;
164
- export type SaveEvent = Common.SaveEvent;
165
- export type Anomaly = Common.Anomaly;
166
- export type GiftReceived = Common.GiftReceived;
167
- export type VersionRecord = Common.VersionRecord;
168
- export type ViolationKind = Common.ViolationKind;
169
- export type SchemaViolation = Common.SchemaViolation;
170
- export type FlushOptions = Common.FlushOptions;
171
- export type UpdateOfflineOptions = Common.UpdateOfflineOptions;
172
- export type RestoreOptions = Common.RestoreOptions;
173
- export type CooldownOptions = Common.CooldownOptions;
174
- export type MigrationContext = Common.MigrationContext;
175
- export type BigScore = Common.BigScore;
176
- export type LeaderboardEntry = Common.LeaderboardEntry;
177
- export type LeaderboardStatus = Common.LeaderboardStatus;
178
- export type LeaderboardStatusInfo = Common.LeaderboardStatusInfo;
179
- export type LeaderboardSnapshotEntry = Common.LeaderboardSnapshotEntry;
180
- export type PassConfig = Common.PassConfig;
181
- export type PurchaseFilter = Common.PurchaseFilter;
182
- export type PurchaseEntry = Common.PurchaseEntry;
183
- export type PurchaseLogOptions = Common.PurchaseLogOptions;
184
- export type ProductInfo = Common.ProductInfo;
185
- export type PolicyInfo = Common.PolicyInfo;
186
- export type ReceiptInfo = Common.ReceiptInfo;
187
- export type EconomyMeta = Common.EconomyMeta;
188
- export type EconomyFieldSpec = Common.EconomyFieldSpec;
189
- export type EconomyCurrencyConfig = Common.EconomyCurrencyConfig;
190
- export type EconomyLogFn = Common.EconomyLogFn;
191
- export type EconomyConfig = Common.EconomyConfig;
192
- export type ExchangeableSpec = Common.ExchangeableSpec;
193
- export type ExchangeLeg = Common.ExchangeLeg;
194
- export type OpenLeg = Common.OpenLeg;
195
- export type OpenExchange = Common.OpenExchange;
196
- export type ExchangeAPI = Common.ExchangeAPI;
197
- export type BudgetSnapshot = Common.BudgetSnapshot;
198
- export type MetricObservation = Common.MetricObservation;
199
- export type Metrics = Common.Metrics;
200
- export type Percentiles = Common.Percentiles;
201
- export type PercentileSnapshot = Common.PercentileSnapshot;
202
- export type AddonAction = Common.AddonAction;
203
- export type AddonActions = Common.AddonActions;
204
- export type ConfigureOptions = Common.ConfigureOptions;
205
- export type StatusThresholds = Common.StatusThresholds;
206
- export type PeriodResetOptions = Common.PeriodResetOptions;
207
- export type MockState = Common.MockState;
208
- interface ScribeModule {
209
- readonly Reason: { readonly LoadFailed: "load-failed"; readonly MigrationFailed: "migration-failed"; readonly Erasing: "erasing"; readonly SessionEnded: "session-ended"; readonly PlayerLeft: "player-left"; readonly Shutdown: "shutdown"; readonly StillLoading: "still-loading"; readonly Timeout: "timeout"; };
210
- readonly RequestReason: { readonly RateLimited: "rate-limited"; readonly NotReady: "not-ready"; readonly UnknownCommand: "unknown-command"; readonly BadArgs: "bad-args"; readonly BadIdempotencyKey: "bad-idempotency-key"; readonly Error: "error"; readonly ReplyEncodeFailed: "reply-encode-failed"; readonly Timeout: "timeout"; readonly SendFailed: "send-failed"; readonly EditMode: "edit-mode"; readonly MockError: "mock-error"; };
211
- readonly PurchaseReason: { readonly DataNotLoaded: "player data not loaded"; readonly InvalidCostSpec: "invalid Cost spec"; readonly InvalidCostAmount: "invalid Cost amount"; readonly InvalidCostPath: "invalid cost path"; readonly CostPathNotSpendable: "cost path is not a spendable number"; readonly InsufficientFunds: "insufficient funds"; readonly PaidRandomRestricted: "paid random items are not available for this account"; readonly PolicyPending: "cannot check account settings right now; try again in a moment"; };
212
- readonly GiftReason: { readonly ProductRetired: "product retired"; readonly BuyerDataNotLoaded: "buyer data not loaded"; readonly InvalidRecipient: "invalid recipient"; readonly CannotGiftYourself: "cannot gift yourself"; readonly GiftCooldown: "gift cooldown"; readonly TooManyPending: "too many pending gifts"; readonly DataServicesDown: "data services are experiencing issues; try again later"; readonly RecipientAlreadyOwns: "recipient already owns this"; readonly CreditReserveFailed: "could not reserve gift credit; try again later"; readonly DeliveryFailed: "could not deliver gift; try again later"; readonly DeliveryUnconfirmed: "gift delivery could not be confirmed; do not send it again"; readonly AlreadyPending: "a gift of this item is already pending; try again shortly"; readonly IntentRecordFailed: "could not record gift intent; try again later"; readonly PaidRandomRestricted: "paid random items are not available for this account"; readonly PolicyPending: "cannot check account settings right now; try again in a moment"; };
213
- readonly ProductState: { readonly Purchasable: "purchasable"; readonly Owned: "owned"; readonly PaidRandomRestricted: "paid-random-restricted"; readonly PolicyPending: "policy-pending"; readonly NotLoaded: "not-loaded"; };
214
- readonly OpKind: { readonly Init: "Init"; readonly Set: "Set"; readonly Insert: "Insert"; readonly Remove: "Remove"; readonly Clear: "Clear"; };
215
- readonly LogLevel: { readonly Debug: "Debug"; readonly Info: "Info"; readonly Warn: "Warn"; readonly Error: "Error"; readonly Fatal: "Fatal"; };
216
- readonly LogCategory: { readonly Persistence: "Persistence"; readonly Replication: "Replication"; readonly Transport: "Transport"; readonly Commands: "Commands"; readonly Leaderboards: "Leaderboards"; readonly Monetization: "Monetization"; readonly Gifting: "Gifting"; readonly Integrity: "Integrity"; readonly Lifecycle: "Lifecycle"; readonly Derived: "Derived"; readonly Exchanges: "Exchanges"; };
217
- readonly Status: { readonly Healthy: "Healthy"; readonly Degraded: "Degraded"; readonly Outage: "Outage"; };
218
- readonly LeaderboardStatus: { readonly Starting: "Starting"; readonly Healthy: "Healthy"; readonly Degraded: "Degraded"; };
219
- readonly SessionState: { readonly Loading: "Loading"; readonly Ready: "Ready"; readonly SessionEnded: "SessionEnded"; };
220
- readonly LoadPhase: { readonly WaitingForErase: "WaitingForErase"; readonly AcquiringSession: "AcquiringSession"; readonly ReadingProfile: "ReadingProfile"; readonly Retrying: "Retrying"; readonly Initializing: "Initializing"; readonly Importing: "Importing"; readonly ImportThrottled: "ImportThrottled"; };
221
- readonly Visibility: { readonly Replicated: "Replicated"; readonly ServerOnly: "ServerOnly"; readonly Shared: "Shared"; };
222
- readonly LifecycleReason: ScribeModule["Reason"];
223
- }
224
- }
225
-
226
- export = Scribe;
1
+ import type * as Schema from "./schema";
2
+ import type * as API from "./api";
3
+ import type * as Common from "./common";
4
+
5
+ declare const Scribe: Scribe.ScribeModule;
6
+
7
+ declare namespace Scribe {
8
+ interface ScribeModule {
9
+ /** Creates the server and client APIs from a shared template. */
10
+ <T, S = {}, C = {}>(options: API.ScribeOptions<T, S, C>): API.Bundle<T, S, C>;
11
+ /** Creates the server and client APIs from a shared template. */
12
+ readonly new: <T, S = {}, C = {}>(this: void, options: API.ScribeOptions<T, S, C>) => API.Bundle<T, S, C>;
13
+ readonly Version: string;
14
+ /** Keeps a field and its subtree off the client. */
15
+ readonly ServerOnly: <T>(this: void, value: T) => Schema.ServerOnly<T>;
16
+ /** Replicates a root field to every client. */
17
+ readonly Shared: <T>(this: void, value: T) => Schema.Shared<T>;
18
+ /** Keeps a root field unsaved; its visibility wrappers still apply. */
19
+ readonly Session: <T>(this: void, value: T) => Schema.Session<T>;
20
+ /** Declares integer data with optional bounds. */
21
+ readonly Int: (this: void, value: number, meta?: NumberMeta) => number;
22
+ /** Declares floating-point data with optional bounds and wire precision. */
23
+ readonly Number: (this: void, value: number, meta?: FloatMeta) => number;
24
+ /** Declares large-range numbers; numeric strings are limited to 256 bytes. */
25
+ readonly Big: (this: void, value?: number | string, meta?: BigMeta) => Schema.BigSchema;
26
+ /** Declares string data with an optional byte limit. */
27
+ readonly String: (this: void, value: string, meta?: StringMeta) => string;
28
+ /** Restricts a string field to the declared members. */
29
+ readonly Enum: <K extends string>(this: void, value: NoInfer<K>, members: readonly K[]) => Schema.EnumValue<K>;
30
+ /** Stores up to 32 named booleans as one field. */
31
+ readonly Flags: <K extends string>(this: void, members: readonly K[]) => Schema.Flags<K>;
32
+ /** Declares a leaf reset to its default after SetTimed expires. */
33
+ readonly Timed: <T>(this: void, value: T) => Schema.Timed<T>;
34
+ /** Builds a default per profile with the supplied factory. */
35
+ readonly Dynamic: <T>(this: void, factory: (this: void) => T) => T;
36
+ /** Computes a read-only field from paths; annotate compute arguments explicitly. */
37
+ readonly Derived: <T, A extends unknown[]>(this: void, output: T, inputs: readonly string[], compute: (this: void, ...args: A) => Schema.ValueOf<T>) => Schema.Derived<T>;
38
+ /** Allows an absent leaf value without seeding the inner default. */
39
+ readonly Optional: <T>(this: void, value: T) => Schema.Optional<T>;
40
+ /** Declares a typed array with optional size and eviction limits. */
41
+ readonly ArrayOf: <T>(this: void, shape: T, options?: ArrayOpts) => Schema.ArrayOf<T>;
42
+ /** Declares unique scalar members with an optional size limit. */
43
+ readonly SetOf: <T>(this: void, element: T, options?: SetOpts) => Schema.SetOf<T>;
44
+ /** Declares a map with integer or string keys and a value schema. */
45
+ readonly MapOf: <K extends "integer" | "string", T>(this: void, keyType: K, shape: T, options?: DictOpts) => Schema.MapOf<K, T>;
46
+ /** Declares string-keyed values with a schema and optional limits. */
47
+ readonly DictOf: <T>(this: void, shape: T, options?: DictOpts) => Schema.DictOf<T>;
48
+ /** Declares Vector3 data, packed for storage and replication. */
49
+ readonly Vector3: (this: void, value: Vector3) => Vector3;
50
+ /** Declares Vector2 data, packed for storage and replication. */
51
+ readonly Vector2: (this: void, value: Vector2) => Vector2;
52
+ /** Declares Vector3int16 data, packed for storage and replication. */
53
+ readonly Vector3int16: (this: void, value: Vector3int16) => Vector3int16;
54
+ /** Declares Vector2int16 data, packed for storage and replication. */
55
+ readonly Vector2int16: (this: void, value: Vector2int16) => Vector2int16;
56
+ /** Declares packed CFrame data; Precision = "exact" preserves its f32 components. */
57
+ readonly CFrame: (this: void, value: CFrame, meta?: CFrameMeta) => CFrame;
58
+ /** Declares Color3 data, packed for storage and replication. */
59
+ readonly Color3: (this: void, value: Color3) => Color3;
60
+ /** Declares BrickColor data, packed for storage and replication. */
61
+ readonly BrickColor: (this: void, value: BrickColor) => BrickColor;
62
+ /** Declares UDim data, packed for storage and replication. */
63
+ readonly UDim: (this: void, value: UDim) => UDim;
64
+ /** Declares UDim2 data, packed for storage and replication. */
65
+ readonly UDim2: (this: void, value: UDim2) => UDim2;
66
+ /** Declares Rect data, packed for storage and replication. */
67
+ readonly Rect: (this: void, value: Rect) => Rect;
68
+ /** Declares NumberRange data, packed for storage and replication. */
69
+ readonly NumberRange: (this: void, value: NumberRange) => NumberRange;
70
+ /** Declares NumberSequence data, packed for storage and replication. */
71
+ readonly NumberSequence: (this: void, value: NumberSequence) => NumberSequence;
72
+ /** Declares ColorSequence data, packed for storage and replication. */
73
+ readonly ColorSequence: (this: void, value: ColorSequence) => ColorSequence;
74
+ /** Declares DateTime data, packed for storage and replication. */
75
+ readonly DateTime: (this: void, value: DateTime) => DateTime;
76
+ /** Declares EnumItem data, packed for storage and replication. */
77
+ readonly EnumItem: <T extends EnumItem>(this: void, value: T) => T;
78
+ /** Declares Font data, packed for storage and replication. */
79
+ readonly Font: (this: void, value: Font) => Font;
80
+ /** Declares PhysicalProperties data, packed for storage and replication. */
81
+ readonly PhysicalProperties: (this: void, value: PhysicalProperties) => PhysicalProperties;
82
+ /** Formats a number or Big value with suffixes and decimal places. */
83
+ readonly Short: (this: void, value?: number | Schema.BigValue, decimals?: number) => string;
84
+ /** Replaces suffixes used by Short; the first suffix must be empty. */
85
+ readonly SetShortSuffixes: (this: void, suffixes: readonly string[]) => void;
86
+ /** Sets process-wide options before any bundle is built; conflicting calls error. */
87
+ readonly Configure: (this: void, config: Common.ConfigureOptions) => void;
88
+ /** Returns the server bundle prefix, or PLAYER_ before setup and on clients. */
89
+ readonly GetProfileKeyPrefix: (this: void) => string;
90
+ /** Returns current DataStore health. */
91
+ readonly GetStatus: (this: void) => Common.Status;
92
+ /** Fires when data-service health changes, with the new and previous status. */
93
+ readonly OnStatusChanged: Common.Signal<[Common.Status, Common.Status]>;
94
+ /** Fires for each Error or Fatal log entry. */
95
+ readonly OnIssue: Common.Signal<[Common.LogEntry]>;
96
+ /** Adds a filtered, bounded log sink; returns its disconnect function. */
97
+ readonly AddLogSink: (this: void, callback: (this: void, entry: Common.LogEntry) => void, options?: Common.LogSinkOptions) => Schema.Disconnect;
98
+ /** Registers plugin actions; returned cleanup removes only this registration. */
99
+ readonly RegisterAddon: (this: void, name: string, actions: Common.AddonActions) => Schema.Disconnect;
100
+ /** Returns filtered retained logs, oldest first; Limit keeps the newest entries. */
101
+ readonly GetRecentLogs: (this: void, filter?: Common.LogFilter) => Common.LogEntry[];
102
+ /** Returns this context's counters and distribution summaries. */
103
+ readonly GetMetrics: (this: void) => Common.Metrics;
104
+ /** Returns recent distribution percentiles with sample age and window size. */
105
+ readonly GetPercentiles: (this: void) => Common.PercentileSnapshot;
106
+ /** Reads current DataStore allowances; Available is false if the query fails. */
107
+ readonly GetBudgetSnapshot: (this: void) => Common.BudgetSnapshot;
108
+ /** Returns cached board health without DataStore requests; empty on clients. */
109
+ readonly GetLeaderboardSnapshot: (this: void) => Common.LeaderboardSnapshotEntry[];
110
+ /** Distinguishes framework request failures from handler replies. */
111
+ readonly RequestFailed: Common.RequestFailedMarker;
112
+ /** Codec helpers for packing and unpacking Roblox datatypes. */
113
+ readonly Datatypes: {
114
+ /** Checks whether a datatype has a registered codec. */
115
+ readonly IsSupported: (this: void, name: string) => boolean;
116
+ /** Lists supported precision options, or returns `undefined` when none exist. */
117
+ readonly PrecisionValues: (this: void, name: string) => string[] | undefined;
118
+ /** Encodes a supported datatype into a buffer. */
119
+ readonly Pack: <K extends keyof DatatypeValues>(this: void, name: K, value: DatatypeValues[K], precision?: K extends "CFrame" ? "exact" : never) => buffer;
120
+ /** Decodes a buffer into the named datatype. */
121
+ readonly Unpack: <K extends keyof DatatypeValues>(this: void, name: K, bytes: buffer) => DatatypeValues[K];
122
+ readonly NONFINITE: "Scribe:nonfinite:";
123
+ };
124
+
125
+ }
126
+
127
+ interface NumberMeta { Min?: number; Max?: number; }
128
+ interface DatatypeValues {
129
+ Vector3: Vector3; Vector2: Vector2; Vector3int16: Vector3int16; Vector2int16: Vector2int16;
130
+ CFrame: CFrame; Color3: Color3; BrickColor: BrickColor; UDim: UDim; UDim2: UDim2;
131
+ Rect: Rect; NumberRange: NumberRange; NumberSequence: NumberSequence; ColorSequence: ColorSequence;
132
+ DateTime: DateTime; EnumItem: EnumItem; Font: Font; PhysicalProperties: PhysicalProperties;
133
+ }
134
+ interface FloatMeta extends NumberMeta { Precision?: number | "f32"; }
135
+ interface BigMeta { Min?: number | string; Max?: number | string; }
136
+ interface StringMeta { MaxLength?: number; }
137
+ interface CFrameMeta { Precision?: "exact"; }
138
+ interface ArrayOpts { MaxItems?: number; Evict?: "Front" | "Back"; }
139
+ interface SetOpts { MaxItems?: number; }
140
+ interface DictOpts { MaxKeys?: number; MaxKeyLength?: number; }
141
+ type MapKeyType = "integer" | "string";
142
+ export type ServerOnly<T> = Schema.ServerOnly<T>;
143
+ export type Shared<T> = Schema.Shared<T>;
144
+ export type Session<T> = Schema.Session<T>;
145
+ export type Timed<T> = Schema.Timed<T>;
146
+ export type Derived<T> = Schema.Derived<T>;
147
+ export type Optional<T> = Schema.Optional<T>;
148
+ export type ArrayOf<T> = Schema.ArrayOf<T>;
149
+ export type DictOf<T> = Schema.DictOf<T>;
150
+ export type MapOf<K extends "integer" | "string", T> = Schema.MapOf<K, T>;
151
+ export type SetOf<T> = Schema.SetOf<T>;
152
+ export type Flags<K extends string = string> = Schema.Flags<K>;
153
+ export type EnumValue<K extends string> = Schema.EnumValue<K>;
154
+ export type BigSchema = Schema.BigSchema;
155
+ export type Disconnect = Schema.Disconnect;
156
+ export type BigOperand = Schema.BigOperand;
157
+ export type BigValue = Schema.BigValue;
158
+ export type Datatype = Schema.Datatype;
159
+ export type AtomicValue = Schema.AtomicValue;
160
+ export type ValueOf<T> = Schema.ValueOf<T>;
161
+ export type DeepReadonly<T> = Schema.DeepReadonly<T>;
162
+ export type InputOf<T> = Schema.InputOf<T>;
163
+ export type ElementInput<T> = Schema.ElementInput<T>;
164
+ export type ClientSchema<T> = Schema.ClientSchema<T>;
165
+ export type SharedSchema<T> = Schema.SharedSchema<T>;
166
+ export type ReadableNode<T> = Schema.ReadableNode<T>;
167
+ export type Accessor<T, Root extends boolean = false, Missing extends boolean = false, ReadOnly extends boolean = false, Closed extends boolean = false, Client extends boolean = false> = Schema.Accessor<T, Root, Missing, ReadOnly, Closed, Client>;
168
+ export type PlayerData<T> = Schema.PlayerData<T>;
169
+ export type ReadonlyAccessor<T, Root extends boolean = false> = Schema.ReadonlyAccessor<T, Root>;
170
+ export type NumericPaths<T, IncludeBig extends boolean = false, Depth extends unknown[] = []> = Schema.NumericPaths<T, IncludeBig, Depth>;
171
+ export type LeaderboardConfig<T = unknown> = API.LeaderboardConfig<T>;
172
+ export type ProductConfig<T = unknown> = API.ProductConfig<T>;
173
+ export type PurchaseSpec<T = unknown> = API.PurchaseSpec<T>;
174
+ export type CommandArguments<F> = API.CommandArguments<F>;
175
+ export type CommandReturn<F> = API.CommandReturn<F>;
176
+ export type CommandHandler<F> = API.CommandHandler<F>;
177
+ export type CommandSpec = API.CommandSpec;
178
+ export type RequestFunction<C> = API.RequestFunction<C>;
179
+ export type RequestOnceFunction<C> = API.RequestOnceFunction<C>;
180
+ export type RegisterCommand<C> = API.RegisterCommand<C>;
181
+ export type MockCommand<C> = API.MockCommand<C>;
182
+ export type ServerStore<S> = API.ServerStore<S>;
183
+ export type ClientServerStore<S> = API.ClientServerStore<S>;
184
+ export type SharedData<T> = API.SharedData<T>;
185
+ export type ServerAPI<T, C = {}> = API.ServerAPI<T, C>;
186
+ export type ServerData<T, S = {}, C = {}> = API.ServerData<T, S, C>;
187
+ export type MockValues<T> = API.MockValues<T>;
188
+ export type ClientAPI<T, C = {}> = API.ClientAPI<T, C>;
189
+ export type ClientData<T, S = {}, C = {}> = API.ClientData<T, S, C>;
190
+ export type Bundle<T, S = {}, C = {}> = API.Bundle<T, S, C>;
191
+ export type ScribeOptions<T, S = {}, C = {}> = API.ScribeOptions<T, S, C>;
192
+ export type UnknownRecord = Common.UnknownRecord;
193
+ export type PathSegment = Common.PathSegment;
194
+ export type Path = Common.Path;
195
+ export type OpKind = Common.OpKind;
196
+ export type Op = Common.Op;
197
+ export type ScribeTransport = Common.ScribeTransport;
198
+ export type Connection = Common.Connection;
199
+ export type Signal<Args extends unknown[]> = Common.Signal<Args>;
200
+ export type LogLevel = Common.LogLevel;
201
+ export type LogCategory = Common.LogCategory;
202
+ export type LogCode = Common.LogCode;
203
+ export type LogEntry = Common.LogEntry;
204
+ export type LogSinkOptions = Common.LogSinkOptions;
205
+ export type LogFilter = Common.LogFilter;
206
+ export type Status = Common.Status;
207
+ export type SessionState = Common.SessionState;
208
+ export type LoadPhase = Common.LoadPhase;
209
+ export type Visibility = Common.Visibility;
210
+ export type LifecycleReason = Common.LifecycleReason;
211
+ export type RequestReason = Common.RequestReason;
212
+ export type RequestFailedMarker = Common.RequestFailedMarker;
213
+ export type RequestFailure = Common.RequestFailure;
214
+ export type ProductState = Common.ProductState;
215
+ export type PurchaseReason = Common.PurchaseReason;
216
+ export type GiftReason = Common.GiftReason;
217
+ export type OperationResult = Common.OperationResult;
218
+ export type SaveInfo = Common.SaveInfo;
219
+ export type SaveEvent = Common.SaveEvent;
220
+ export type Anomaly = Common.Anomaly;
221
+ export type GiftReceived = Common.GiftReceived;
222
+ export type VersionRecord = Common.VersionRecord;
223
+ export type ViolationKind = Common.ViolationKind;
224
+ export type SchemaViolation = Common.SchemaViolation;
225
+ export type FlushOptions = Common.FlushOptions;
226
+ export type UpdateOfflineOptions = Common.UpdateOfflineOptions;
227
+ export type RestoreOptions = Common.RestoreOptions;
228
+ export type CooldownOptions = Common.CooldownOptions;
229
+ export type MigrationContext = Common.MigrationContext;
230
+ export type BigScore = Common.BigScore;
231
+ export type LeaderboardEntry = Common.LeaderboardEntry;
232
+ export type LeaderboardStatus = Common.LeaderboardStatus;
233
+ export type LeaderboardStatusInfo = Common.LeaderboardStatusInfo;
234
+ export type LeaderboardSnapshotEntry = Common.LeaderboardSnapshotEntry;
235
+ export type PassConfig = Common.PassConfig;
236
+ export type PurchaseFilter = Common.PurchaseFilter;
237
+ export type PurchaseEntry = Common.PurchaseEntry;
238
+ export type PurchaseLogOptions = Common.PurchaseLogOptions;
239
+ export type ProductInfo = Common.ProductInfo;
240
+ export type PolicyInfo = Common.PolicyInfo;
241
+ export type ReceiptInfo = Common.ReceiptInfo;
242
+ export type EconomyMeta = Common.EconomyMeta;
243
+ export type EconomyFieldSpec = Common.EconomyFieldSpec;
244
+ export type EconomyCurrencyConfig = Common.EconomyCurrencyConfig;
245
+ export type EconomyLogFn = Common.EconomyLogFn;
246
+ export type EconomyConfig = Common.EconomyConfig;
247
+ export type ExchangeableSpec = Common.ExchangeableSpec;
248
+ export type ExchangeLeg = Common.ExchangeLeg;
249
+ export type OpenLeg = Common.OpenLeg;
250
+ export type OpenExchange = Common.OpenExchange;
251
+ export type ExchangeAPI = Common.ExchangeAPI;
252
+ export type BudgetSnapshot = Common.BudgetSnapshot;
253
+ export type MetricObservation = Common.MetricObservation;
254
+ export type Metrics = Common.Metrics;
255
+ export type Percentiles = Common.Percentiles;
256
+ export type PercentileSnapshot = Common.PercentileSnapshot;
257
+ export type AddonAction = Common.AddonAction;
258
+ export type AddonActions = Common.AddonActions;
259
+ export type ConfigureOptions = Common.ConfigureOptions;
260
+ export type StatusThresholds = Common.StatusThresholds;
261
+ export type PeriodResetOptions = Common.PeriodResetOptions;
262
+ export type MockState = Common.MockState;
263
+ interface ScribeModule {
264
+ readonly Reason: { readonly LoadFailed: "load-failed"; readonly MigrationFailed: "migration-failed"; readonly Erasing: "erasing"; readonly SessionEnded: "session-ended"; readonly PlayerLeft: "player-left"; readonly Shutdown: "shutdown"; readonly StillLoading: "still-loading"; readonly Timeout: "timeout"; };
265
+ readonly RequestReason: { readonly RateLimited: "rate-limited"; readonly NotReady: "not-ready"; readonly UnknownCommand: "unknown-command"; readonly BadArgs: "bad-args"; readonly BadIdempotencyKey: "bad-idempotency-key"; readonly Error: "error"; readonly ReplyEncodeFailed: "reply-encode-failed"; readonly Timeout: "timeout"; readonly SendFailed: "send-failed"; readonly EditMode: "edit-mode"; readonly MockError: "mock-error"; };
266
+ readonly PurchaseReason: { readonly DataNotLoaded: "player data not loaded"; readonly InvalidCostSpec: "invalid Cost spec"; readonly InvalidCostAmount: "invalid Cost amount"; readonly InvalidCostPath: "invalid cost path"; readonly CostPathNotSpendable: "cost path is not a spendable number"; readonly InsufficientFunds: "insufficient funds"; readonly PaidRandomRestricted: "paid random items are not available for this account"; readonly PolicyPending: "cannot check account settings right now; try again in a moment"; readonly InvalidIdempotencyKey: "invalid IdempotencyKey"; };
267
+ readonly GiftReason: { readonly ProductRetired: "product retired"; readonly BuyerDataNotLoaded: "buyer data not loaded"; readonly InvalidRecipient: "invalid recipient"; readonly CannotGiftYourself: "cannot gift yourself"; readonly GiftCooldown: "gift cooldown"; readonly TooManyPending: "too many pending gifts"; readonly DataServicesDown: "data services are experiencing issues; try again later"; readonly RecipientAlreadyOwns: "recipient already owns this"; readonly CreditReserveFailed: "could not reserve gift credit; try again later"; readonly DeliveryFailed: "could not deliver gift; try again later"; readonly DeliveryUnconfirmed: "gift delivery could not be confirmed; do not send it again"; readonly AlreadyPending: "a gift of this item is already pending; try again shortly"; readonly IntentRecordFailed: "could not record gift intent; try again later"; readonly PaidRandomRestricted: "paid random items are not available for this account"; readonly PolicyPending: "cannot check account settings right now; try again in a moment"; };
268
+ readonly ProductState: { readonly Purchasable: "purchasable"; readonly Owned: "owned"; readonly PaidRandomRestricted: "paid-random-restricted"; readonly PolicyPending: "policy-pending"; readonly NotLoaded: "not-loaded"; };
269
+ readonly OpKind: { readonly Init: "Init"; readonly Set: "Set"; readonly Insert: "Insert"; readonly Remove: "Remove"; readonly Clear: "Clear"; };
270
+ readonly LogLevel: { readonly Debug: "Debug"; readonly Info: "Info"; readonly Warn: "Warn"; readonly Error: "Error"; readonly Fatal: "Fatal"; };
271
+ readonly LogCategory: { readonly Persistence: "Persistence"; readonly Replication: "Replication"; readonly Transport: "Transport"; readonly Commands: "Commands"; readonly Leaderboards: "Leaderboards"; readonly Monetization: "Monetization"; readonly Gifting: "Gifting"; readonly Integrity: "Integrity"; readonly Lifecycle: "Lifecycle"; readonly Derived: "Derived"; readonly Exchanges: "Exchanges"; };
272
+ readonly Status: { readonly Healthy: "Healthy"; readonly Degraded: "Degraded"; readonly Outage: "Outage"; };
273
+ readonly LeaderboardStatus: { readonly Starting: "Starting"; readonly Healthy: "Healthy"; readonly Degraded: "Degraded"; };
274
+ readonly SessionState: { readonly Loading: "Loading"; readonly Ready: "Ready"; readonly SessionEnded: "SessionEnded"; };
275
+ readonly LoadPhase: { readonly WaitingForErase: "WaitingForErase"; readonly AcquiringSession: "AcquiringSession"; readonly ReadingProfile: "ReadingProfile"; readonly Retrying: "Retrying"; readonly Initializing: "Initializing"; readonly Importing: "Importing"; readonly ImportThrottled: "ImportThrottled"; };
276
+ readonly Visibility: { readonly Replicated: "Replicated"; readonly ServerOnly: "ServerOnly"; readonly Shared: "Shared"; };
277
+ readonly LifecycleReason: ScribeModule["Reason"];
278
+ }
279
+ }
280
+
281
+ export = Scribe;