@rbxts/planck 0.2.2 → 0.2.4

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.
@@ -7,7 +7,7 @@ declare const timePassed: (time: number) => Condition;
7
7
  declare const exported: {
8
8
  timePassed: (time: number) => Condition;
9
9
  runOnce: () => Condition;
10
- onEvent: <T extends unknown[]>(instance: EventInstance | EventLike, event?: string) => LuaTuple<[Condition, IterableFunction<T>, () => void]>;
10
+ onEvent: <T extends unknown[]>(instance: EventInstance<T>, event?: string) => LuaTuple<[Condition, () => IterableFunction<T>, () => void]>;
11
11
  isNot: (condition: Condition) => Condition;
12
12
  cleanupCondition: (condition: Condition) => void
13
13
  }
package/out/types.d.ts CHANGED
@@ -77,17 +77,17 @@ export interface SystemTable<T extends unknown[]> {
77
77
 
78
78
  export type System<T extends unknown[]> = SystemFn<T> | SystemTable<T>;
79
79
 
80
- export type EventLike = {
81
- connect(callback: (...args: unknown[]) => void): void;
80
+ export type EventLike<T extends unknown[] = unknown[]> = {
81
+ connect(callback: (...args: T) => void): void;
82
82
  } | {
83
- Connect(callback: (...args: unknown[]) => void): void;
83
+ Connect(callback: (...args: T) => void): void;
84
84
  } | {
85
- on(callback: (...args: unknown[]) => void): void;
85
+ on(callback: (...args: T) => void): void;
86
86
  } | {
87
- On(callback: (...args: unknown[]) => void): void;
87
+ On(callback: (...args: T) => void): void;
88
88
  }
89
89
 
90
- export type EventInstance = Instance | EventLike | RBXScriptSignal;
90
+ export type EventInstance<T extends unknown[] = unknown[]> = Instance | EventLike<T> | RBXScriptSignal;
91
91
  export type Disconnectable = RBXScriptConnection | { Disconnect(): void } | { disconnect(): void } | { Destroy(): void } | { destroy(): void; }
92
92
  export type ConnectFn = (callback: (...args: unknown[]) => void) => Disconnectable;
93
93
 
@@ -97,9 +97,9 @@ export interface Utils {
97
97
  getSystemName: <T extends unknown[]>(system: SystemFn<T>) => string
98
98
  isPhase: (phase: Phase) => Phase | undefined
99
99
  isPipeline: (pipeline: Pipeline) => Pipeline | undefined
100
- getEventIdentifier: (instance: EventInstance, event?: string) => string
101
- isValidEvent: (instance: EventInstance, event?: string) => boolean
102
- getConnectedFunction: (instance: EventInstance, event?: string) => ConnectFn | 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
103
  disconnectEvent: (disconectable: Disconnectable) => void
104
104
  }
105
105
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/planck",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "An agnostic scheduler for ECS",
5
5
  "main": "out/init.lua",
6
6
  "repository": {