@rbxts/planck 0.2.5 → 0.3.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 +40 -51
- package/{out → src}/DependencyGraph.luau +220 -180
- package/src/Phase.d.ts +23 -0
- package/{out → src}/Phase.luau +41 -41
- package/src/Pipeline.d.ts +26 -0
- package/{out → src}/Pipeline.luau +86 -86
- package/src/Scheduler.d.ts +385 -0
- package/{out → src}/Scheduler.luau +207 -44
- package/src/__tests__/InitializerSystems.test.luau +660 -0
- package/src/__tests__/Scheduler.test.luau +313 -0
- package/src/__tests__/conditions.test.luau +147 -0
- package/src/__tests__/hooks.test.luau +54 -0
- package/src/__tests__/systems.test.luau +192 -0
- package/src/conditions.d.ts +69 -0
- package/{out → src}/conditions.luau +189 -151
- package/{out → src}/hooks.luau +163 -145
- package/src/index.d.ts +12 -0
- package/src/init.luau +207 -0
- package/src/utils.d.ts +10 -0
- package/{out → src}/utils.luau +197 -161
- package/out/Phase.d.ts +0 -8
- package/out/Pipeline.d.ts +0 -11
- package/out/Scheduler.d.ts +0 -31
- package/out/conditions.d.ts +0 -14
- package/out/hooks.d.ts +0 -4
- package/out/index.d.ts +0 -18
- package/out/init.luau +0 -143
- package/out/types.d.ts +0 -113
- package/out/utils.d.ts +0 -4
package/out/types.d.ts
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import Phase from "./Phase";
|
|
2
|
-
import Pipeline from "./Pipeline";
|
|
3
|
-
import Scheduler from "./Scheduler";
|
|
4
|
-
|
|
5
|
-
export type SystemInfo<T extends unknown[]> = {
|
|
6
|
-
readonly system: SystemFn<T>;
|
|
7
|
-
readonly phase: Phase;
|
|
8
|
-
readonly name: string;
|
|
9
|
-
readonly logs: string[];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export interface Hooks {
|
|
14
|
-
readonly Hooks: {
|
|
15
|
-
readonly SystemAdd: "SystemAdd";
|
|
16
|
-
readonly SystemRemove: "SystemRemove";
|
|
17
|
-
readonly SystemReplace: "SystemReplace";
|
|
18
|
-
readonly SystemError: "SystemError";
|
|
19
|
-
|
|
20
|
-
readonly OuterSystemCall: "OuterSystemCall";
|
|
21
|
-
readonly InnerSystemCall: "InnerSystemCall";
|
|
22
|
-
readonly SystemCall: "SystemCall";
|
|
23
|
-
|
|
24
|
-
readonly PhaseAdd: "PhaseAdd";
|
|
25
|
-
readonly PhaseBegan: "PhaseBegan";
|
|
26
|
-
}
|
|
27
|
-
systemAdd: <T extends unknown[] = unknown[]>(scheduler: Scheduler<T>, systemInfo: SystemInfo<T>) => void;
|
|
28
|
-
systemRemove: <T extends unknown[] = unknown[]>(scheduler: Scheduler<T>, systemInfo: SystemInfo<T>) => void;
|
|
29
|
-
systemReplace: <T extends unknown[] = unknown[]>(scheduler: Scheduler<T>, oldSystemInfo: SystemInfo<T>, newSystemInfo: SystemInfo<T>) => void;
|
|
30
|
-
systemCall: <T extends unknown[] = unknown[]>(scheduler: Scheduler<T>, hookName: "OuterSystemCall" | "InnerSystemCall" | "SystemCall", systemInfo: SystemInfo<T>, nextFn: () => void) => void;
|
|
31
|
-
systemError: <T extends unknown[] = unknown[]>(scheduler: Scheduler<T>, systemInfo: SystemInfo<T>, error: string) => void;
|
|
32
|
-
phaseAdd: <T extends unknown[] = unknown[]>(scheduler: Scheduler<T>, phase: Phase) => void;
|
|
33
|
-
phaseBegan: <T extends unknown[] = unknown[]>(scheduler: Scheduler<T>, phase: Phase) => void;
|
|
34
|
-
}
|
|
35
|
-
type SystemAddHookArgs<T extends unknown[]> = {
|
|
36
|
-
scheduler: Scheduler<T>,
|
|
37
|
-
system: SystemInfo<T>
|
|
38
|
-
}
|
|
39
|
-
type SystemRemoveHookArgs<T extends unknown[]> = SystemAddHookArgs<T>;
|
|
40
|
-
type SystemReplaceHookArgs<T extends unknown[]> = {
|
|
41
|
-
scheduler: Scheduler<T>,
|
|
42
|
-
old: SystemInfo<T>,
|
|
43
|
-
new: SystemInfo<T>
|
|
44
|
-
}
|
|
45
|
-
type SystemErrorHookArgs<T extends unknown[]> = SystemAddHookArgs<T> & { error: string };
|
|
46
|
-
type SystemCallHookArgs<T extends unknown[]> = {
|
|
47
|
-
scheduler: undefined;
|
|
48
|
-
system: SystemInfo<T>;
|
|
49
|
-
nextFn: () => void;
|
|
50
|
-
}
|
|
51
|
-
type PhaseAddHookArgs<T extends unknown[]> = {
|
|
52
|
-
scheduler: Scheduler<T>;
|
|
53
|
-
phase: Phase;
|
|
54
|
-
}
|
|
55
|
-
type PhaseBeganHookArgs<T extends unknown[]> = PhaseAddHookArgs<T>;
|
|
56
|
-
type HookFunctionMap<T extends unknown[] = unknown[]> = {
|
|
57
|
-
SystemAdd: SystemAddHookArgs<T>;
|
|
58
|
-
SystemRemove: SystemRemoveHookArgs<T>;
|
|
59
|
-
SystemReplace: SystemReplaceHookArgs<T>;
|
|
60
|
-
SystemError: SystemErrorHookArgs<T>;
|
|
61
|
-
OuterSystemCall: SystemCallHookArgs<T>;
|
|
62
|
-
InnerSystemCall: SystemCallHookArgs<T>;
|
|
63
|
-
SystemCall: SystemCallHookArgs<T>;
|
|
64
|
-
PhaseAdd: PhaseAddHookArgs<T>;
|
|
65
|
-
PhaseBegan: PhaseBeganHookArgs<T>;
|
|
66
|
-
}
|
|
67
|
-
// Utility type to get the correct function type based on the hook name
|
|
68
|
-
type HookFunctionArgs<K extends keyof HookFunctionMap, T extends unknown[]> = HookFunctionMap<T>[K];
|
|
69
|
-
|
|
70
|
-
export type SystemFn<T extends unknown[]> = ((...args: T) => unknown[]) | ((...args: T) => void);
|
|
71
|
-
|
|
72
|
-
export interface SystemTable<T extends unknown[]> {
|
|
73
|
-
readonly system: SystemFn<T>;
|
|
74
|
-
readonly phase?: Phase
|
|
75
|
-
readonly [key: string]: unknown
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export type System<T extends unknown[]> = SystemFn<T> | SystemTable<T>;
|
|
79
|
-
|
|
80
|
-
export type EventLike<T extends unknown[] = unknown[]> = {
|
|
81
|
-
connect(callback: (...args: T) => void): void;
|
|
82
|
-
} | {
|
|
83
|
-
Connect(callback: (...args: T) => void): void;
|
|
84
|
-
} | {
|
|
85
|
-
on(callback: (...args: T) => void): void;
|
|
86
|
-
} | {
|
|
87
|
-
On(callback: (...args: T) => void): void;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export type EventInstance<T extends unknown[] = unknown[]> = Instance | EventLike<T> | RBXScriptSignal;
|
|
91
|
-
export type Disconnectable = RBXScriptConnection | { Disconnect(): void } | { disconnect(): void } | { Destroy(): void } | { destroy(): void; }
|
|
92
|
-
export type ConnectFn = (callback: (...args: unknown[]) => void) => Disconnectable;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
export interface Utils {
|
|
96
|
-
getSystem: <T extends unknown[]>(system: System<T>) => SystemFn<T> | undefined
|
|
97
|
-
getSystemName: <T extends unknown[]>(system: SystemFn<T>) => string
|
|
98
|
-
isPhase: (phase: Phase) => Phase | undefined
|
|
99
|
-
isPipeline: (pipeline: Pipeline) => Pipeline | undefined
|
|
100
|
-
getEventIdentifier: <T extends unknown[]>(instance: EventInstance<T>, event?: string) => string
|
|
101
|
-
isValidEvent: <T extends unknown[]>(instance: EventInstance<T>, event?: string) => boolean
|
|
102
|
-
getConnectedFunction: <T extends unknown[]>(instance: EventInstance<T>, event?: string) => ConnectFn | undefined
|
|
103
|
-
disconnectEvent: (disconectable: Disconnectable) => void
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export interface Plugin {
|
|
107
|
-
build(schedular: Scheduler<unknown[]>): void
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
package/out/utils.d.ts
DELETED