@rbxts/replion 1.0.0 → 1.0.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/README.md +1 -1
- package/package.json +1 -1
- package/src/Client.lua +1 -0
- package/src/index.d.ts +37 -17
package/README.md
CHANGED
package/package.json
CHANGED
package/src/Client.lua
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -1,20 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Connection } from '@rbxts/sleitnick-signal';
|
|
2
|
+
|
|
3
|
+
declare namespace Replion {
|
|
4
|
+
interface ServerConfig<T extends object> {
|
|
5
|
+
channel: string;
|
|
6
|
+
replicateTo?: Player;
|
|
7
|
+
data: T;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
class Server<T extends object> {
|
|
11
|
+
constructor(config: ServerConfig<T>);
|
|
12
|
+
|
|
13
|
+
set<K extends keyof T>(key: K, value: T[K] | ((oldValue: T[K]) => T[K])): void;
|
|
14
|
+
set(path: string[], value: any | ((oldValue: any) => any)): void;
|
|
15
|
+
|
|
16
|
+
get(): T;
|
|
17
|
+
get<K extends keyof T>(key: K): T[K];
|
|
18
|
+
get(path: string[]): any;
|
|
19
|
+
|
|
20
|
+
destroy(): void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
class Client<T extends object> {
|
|
24
|
+
static waitForReplion<T extends object>(channel: string): Client<T>;
|
|
25
|
+
|
|
26
|
+
get(): T;
|
|
27
|
+
get<K extends keyof T>(key: K): T[K];
|
|
28
|
+
get(path: string[]): any;
|
|
29
|
+
|
|
30
|
+
observe(key: undefined, callback: (newValue: T, oldValue: T | undefined) => void): Connection;
|
|
31
|
+
observe<K extends keyof T>(
|
|
32
|
+
key: K,
|
|
33
|
+
callback: (newValue: T[K], oldValue: T[K] | undefined) => void,
|
|
34
|
+
): Connection;
|
|
5
35
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function state<T>(): State<T | undefined>;
|
|
9
|
-
|
|
10
|
-
function observeAttribute<T extends AttributeValue>(instance: Instance, attribute: string, callback: (value: T | undefined) => (() => void) | void): () => void;
|
|
11
|
-
function observeState<T>(state: State<T>, callback: (value: T) => void): () => void;
|
|
12
|
-
function observePlayers(callback: (player: Player) => (() => void) | void): () => void;
|
|
13
|
-
function observeCharacters(callback: (char: Model, player: Player) => (() => void) | void): () => void;
|
|
14
|
-
function observeAttribute<T extends AttributeValue>(instance: Instance, attribute: string, callback: (value: T | undefined) => (() => void) | void): () => void;
|
|
15
|
-
function observeChildren(instance: Instance, callback: (child: Instance) => (() => void) | void): () => void;
|
|
16
|
-
function observeTag<T extends Instance>(tag: string, callback: (instance: T) => (() => void) | void, ancestors?: Instance[]): () => void;
|
|
17
|
-
function observeProperty<P extends Instance, K extends InstancePropertyNames<P>>(instance: P, property: K, callback: (value: P[K]) => (() => void) | void): () => void;
|
|
36
|
+
destroy(): void;
|
|
37
|
+
}
|
|
18
38
|
}
|
|
19
39
|
|
|
20
|
-
export =
|
|
40
|
+
export = Replion;
|