@specter-automation/test 1.0.107
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/dist/core/component-registry.d.ts +12 -0
- package/dist/core/component-registry.js +25 -0
- package/dist/core/conditions/input-conditions.d.ts +81 -0
- package/dist/core/conditions/input-conditions.js +197 -0
- package/dist/core/events.d.ts +133 -0
- package/dist/core/events.js +6 -0
- package/dist/core/locators/actor-locator.d.ts +425 -0
- package/dist/core/locators/actor-locator.js +1006 -0
- package/dist/core/locators/ai-controller-locator.d.ts +6 -0
- package/dist/core/locators/ai-controller-locator.js +19 -0
- package/dist/core/locators/index.d.ts +6 -0
- package/dist/core/locators/index.js +22 -0
- package/dist/core/locators/movement-locator.d.ts +27 -0
- package/dist/core/locators/movement-locator.js +78 -0
- package/dist/core/locators/skeleton-locator.d.ts +13 -0
- package/dist/core/locators/skeleton-locator.js +35 -0
- package/dist/core/locators/specter-locator.d.ts +110 -0
- package/dist/core/locators/specter-locator.js +323 -0
- package/dist/core/locators/widget-locator.d.ts +104 -0
- package/dist/core/locators/widget-locator.js +297 -0
- package/dist/core/specter-client.d.ts +352 -0
- package/dist/core/specter-client.js +883 -0
- package/dist/core/specter-input-sequence.d.ts +96 -0
- package/dist/core/specter-input-sequence.js +180 -0
- package/dist/core/specter-keyboard.d.ts +21 -0
- package/dist/core/specter-keyboard.js +63 -0
- package/dist/core/specter-keys.d.ts +1 -0
- package/dist/core/specter-keys.js +2 -0
- package/dist/core/specter-network.d.ts +34 -0
- package/dist/core/specter-network.js +59 -0
- package/dist/core/specter-reporter.d.ts +23 -0
- package/dist/core/specter-reporter.js +403 -0
- package/dist/core/test-wrapper.d.ts +25 -0
- package/dist/core/test-wrapper.js +200 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +29 -0
- package/dist/matchers/actor-matchers.d.ts +492 -0
- package/dist/matchers/actor-matchers.js +841 -0
- package/dist/matchers/gas-matchers.d.ts +198 -0
- package/dist/matchers/gas-matchers.js +539 -0
- package/dist/matchers/locator-matchers.d.ts +80 -0
- package/dist/matchers/locator-matchers.js +214 -0
- package/dist/matchers/material-matchers.d.ts +74 -0
- package/dist/matchers/material-matchers.js +295 -0
- package/dist/matchers/widget-matchers.d.ts +81 -0
- package/dist/matchers/widget-matchers.js +110 -0
- package/package.json +33 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MovementLocator } from "./locators/movement-locator";
|
|
2
|
+
import { SkeletonLocator } from "./locators/skeleton-locator";
|
|
3
|
+
export interface ComponentLocatorMap {
|
|
4
|
+
'skeleton': SkeletonLocator;
|
|
5
|
+
'movement': MovementLocator;
|
|
6
|
+
}
|
|
7
|
+
export declare const ComponentRegistry: Record<string, {
|
|
8
|
+
locatorClass: any;
|
|
9
|
+
defaultUE5Class: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function getComponent<K extends keyof ComponentLocatorMap>(name: K): ComponentLocatorMap[K];
|
|
12
|
+
export declare function getComponent<T = any>(name: string): T;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComponentRegistry = void 0;
|
|
4
|
+
exports.getComponent = getComponent;
|
|
5
|
+
const movement_locator_1 = require("./locators/movement-locator");
|
|
6
|
+
const skeleton_locator_1 = require("./locators/skeleton-locator");
|
|
7
|
+
// 2. The Runtime Registry (For Execution & Client Injection)
|
|
8
|
+
exports.ComponentRegistry = {
|
|
9
|
+
'skeleton': {
|
|
10
|
+
locatorClass: skeleton_locator_1.SkeletonLocator,
|
|
11
|
+
defaultUE5Class: 'SkeletalMeshComponent'
|
|
12
|
+
},
|
|
13
|
+
'movement': {
|
|
14
|
+
locatorClass: movement_locator_1.MovementLocator,
|
|
15
|
+
defaultUE5Class: 'CharacterMovementComponent'
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
function getComponent(name) {
|
|
19
|
+
const registryEntry = exports.ComponentRegistry[name];
|
|
20
|
+
if (!registryEntry) {
|
|
21
|
+
throw new Error(`Specter: Component locator '${name}' not found in registry. Did you forget to register it?`);
|
|
22
|
+
}
|
|
23
|
+
// Instantiate and return the locator dynamically
|
|
24
|
+
return new registryEntry.locatorClass();
|
|
25
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Vector3 } from '../specter-client';
|
|
2
|
+
import { ActorLocator } from '../locators/actor-locator';
|
|
3
|
+
export interface LocationCondition {
|
|
4
|
+
/** Target 3D coordinate to reach */
|
|
5
|
+
target: Vector3;
|
|
6
|
+
/** Allowed distance tolerance in cm (default: 50cm) */
|
|
7
|
+
tolerance?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface DistanceCondition {
|
|
10
|
+
/** Distance in units to move from starting position before stopping */
|
|
11
|
+
movedDistance?: number;
|
|
12
|
+
/** Target actor or point to get within distance of */
|
|
13
|
+
withinDistanceOf?: {
|
|
14
|
+
target: ActorLocator | Vector3;
|
|
15
|
+
distance: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface PropertyCondition {
|
|
19
|
+
/** UPROPERTY name on the Actor or Component */
|
|
20
|
+
name: string;
|
|
21
|
+
/** Expected value to match */
|
|
22
|
+
value: any;
|
|
23
|
+
/** Comparison operator (default: '===') */
|
|
24
|
+
operator?: '===' | '!==' | '>' | '<' | '>=' | '<=';
|
|
25
|
+
/** Optional specific component name */
|
|
26
|
+
component?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface AttributeCondition {
|
|
29
|
+
/** Gameplay Attribute Set name (e.g., 'HealthSet', 'CombatSet') */
|
|
30
|
+
set: string;
|
|
31
|
+
/** Attribute name (e.g., 'Health', 'MovementSpeed') */
|
|
32
|
+
name: string;
|
|
33
|
+
/** Target attribute value to compare against */
|
|
34
|
+
value: number;
|
|
35
|
+
/** Comparison operator (default: '===') */
|
|
36
|
+
operator?: '===' | '!==' | '>' | '<' | '>=' | '<=';
|
|
37
|
+
}
|
|
38
|
+
export interface SpecterCondition {
|
|
39
|
+
/** Target location to reach (or { target, tolerance }) */
|
|
40
|
+
location?: Vector3 | LocationCondition;
|
|
41
|
+
/** Distance moved from initial location or proximity to target */
|
|
42
|
+
distance?: DistanceCondition | number;
|
|
43
|
+
/** Checks if the actor has a specific GameplayTag or Actor tag */
|
|
44
|
+
hasTag?: string;
|
|
45
|
+
/** Checks if the actor no longer has a specific tag */
|
|
46
|
+
hasNotTag?: string;
|
|
47
|
+
/** Checks if a UPROPERTY matches an expected value or comparison */
|
|
48
|
+
property?: PropertyCondition;
|
|
49
|
+
/** Checks if a Gameplay Attribute matches an expected value */
|
|
50
|
+
attribute?: AttributeCondition;
|
|
51
|
+
/** Custom async predicate returning true/false */
|
|
52
|
+
predicate?: (actor?: ActorLocator) => Promise<boolean> | boolean;
|
|
53
|
+
}
|
|
54
|
+
export type ConditionFunction = (actor?: ActorLocator) => Promise<boolean> | boolean;
|
|
55
|
+
export interface InputConditionalOptions {
|
|
56
|
+
/** Drive/hold input until this condition becomes true */
|
|
57
|
+
until?: SpecterCondition | ConditionFunction;
|
|
58
|
+
/** Drive/hold input while this condition remains true */
|
|
59
|
+
while?: SpecterCondition | ConditionFunction;
|
|
60
|
+
/** Wait until this condition is true before triggering the input */
|
|
61
|
+
when?: SpecterCondition | ConditionFunction;
|
|
62
|
+
/** Max time to wait/drive in milliseconds (default: 5000ms) */
|
|
63
|
+
timeout?: number;
|
|
64
|
+
/** Polling / pulse interval in milliseconds (default: 16ms / ~60fps) */
|
|
65
|
+
intervalMs?: number;
|
|
66
|
+
/** Whether to hide this step in the Specter Test Runner live reporter */
|
|
67
|
+
bHideStep?: boolean;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Evaluates whether a SpecterCondition is satisfied.
|
|
71
|
+
*/
|
|
72
|
+
export declare function evaluateCondition(condition: SpecterCondition | ConditionFunction, actor?: ActorLocator, startLocation?: Vector3): Promise<boolean>;
|
|
73
|
+
/**
|
|
74
|
+
* Runs a continuous or guarded input loop based on InputConditionalOptions.
|
|
75
|
+
*/
|
|
76
|
+
export declare function runConditionalInputLoop(params: {
|
|
77
|
+
driveFn: () => Promise<void>;
|
|
78
|
+
releaseFn?: () => Promise<void>;
|
|
79
|
+
options: InputConditionalOptions;
|
|
80
|
+
actor?: ActorLocator;
|
|
81
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.evaluateCondition = evaluateCondition;
|
|
4
|
+
exports.runConditionalInputLoop = runConditionalInputLoop;
|
|
5
|
+
const actor_locator_1 = require("../locators/actor-locator");
|
|
6
|
+
function calculateDistance(a, b) {
|
|
7
|
+
const dx = (a.x ?? 0) - (b.x ?? 0);
|
|
8
|
+
const dy = (a.y ?? 0) - (b.y ?? 0);
|
|
9
|
+
const dz = (a.z ?? 0) - (b.z ?? 0);
|
|
10
|
+
return Math.sqrt(dx * dx + dy * dy + dz * dz);
|
|
11
|
+
}
|
|
12
|
+
function compareValues(actual, expected, op = '===') {
|
|
13
|
+
switch (op) {
|
|
14
|
+
case '===': return actual === expected;
|
|
15
|
+
case '!==': return actual !== expected;
|
|
16
|
+
case '>': return Number(actual) > Number(expected);
|
|
17
|
+
case '<': return Number(actual) < Number(expected);
|
|
18
|
+
case '>=': return Number(actual) >= Number(expected);
|
|
19
|
+
case '<=': return Number(actual) <= Number(expected);
|
|
20
|
+
default: return actual === expected;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Evaluates whether a SpecterCondition is satisfied.
|
|
25
|
+
*/
|
|
26
|
+
async function evaluateCondition(condition, actor, startLocation) {
|
|
27
|
+
if (typeof condition === 'function') {
|
|
28
|
+
return await condition(actor);
|
|
29
|
+
}
|
|
30
|
+
// 1. Custom Predicate
|
|
31
|
+
if (condition.predicate) {
|
|
32
|
+
const result = await condition.predicate(actor);
|
|
33
|
+
if (!result)
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
// 2. Location Check
|
|
37
|
+
if (condition.location && actor) {
|
|
38
|
+
let targetLoc;
|
|
39
|
+
let tolerance = 50;
|
|
40
|
+
if ('target' in condition.location) {
|
|
41
|
+
targetLoc = condition.location.target;
|
|
42
|
+
tolerance = condition.location.tolerance ?? 50;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
targetLoc = condition.location;
|
|
46
|
+
}
|
|
47
|
+
const currentLoc = await actor.getLocation();
|
|
48
|
+
const dist = calculateDistance(currentLoc, targetLoc);
|
|
49
|
+
if (dist > tolerance)
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
// 3. Distance Check
|
|
53
|
+
if (condition.distance !== undefined && actor) {
|
|
54
|
+
if (typeof condition.distance === 'number') {
|
|
55
|
+
if (startLocation) {
|
|
56
|
+
const currentLoc = await actor.getLocation();
|
|
57
|
+
const distMoved = calculateDistance(currentLoc, startLocation);
|
|
58
|
+
if (distMoved < condition.distance)
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
const distCond = condition.distance;
|
|
64
|
+
if (distCond.movedDistance !== undefined && startLocation) {
|
|
65
|
+
const currentLoc = await actor.getLocation();
|
|
66
|
+
const distMoved = calculateDistance(currentLoc, startLocation);
|
|
67
|
+
if (distMoved < distCond.movedDistance)
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
if (distCond.withinDistanceOf) {
|
|
71
|
+
const currentLoc = await actor.getLocation();
|
|
72
|
+
let targetLoc;
|
|
73
|
+
if (distCond.withinDistanceOf.target instanceof actor_locator_1.ActorLocator) {
|
|
74
|
+
targetLoc = await distCond.withinDistanceOf.target.getLocation();
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
targetLoc = distCond.withinDistanceOf.target;
|
|
78
|
+
}
|
|
79
|
+
const dist = calculateDistance(currentLoc, targetLoc);
|
|
80
|
+
if (dist > distCond.withinDistanceOf.distance)
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// 4. Tag Checks (Gameplay Tags or Actor Tags)
|
|
86
|
+
if (condition.hasTag && actor) {
|
|
87
|
+
const hasTag = await actor.hasGameplayTag(condition.hasTag);
|
|
88
|
+
if (!hasTag)
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
if (condition.hasNotTag && actor) {
|
|
92
|
+
const hasTag = await actor.hasGameplayTag(condition.hasNotTag);
|
|
93
|
+
if (hasTag)
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
// 5. Property Check
|
|
97
|
+
if (condition.property && actor) {
|
|
98
|
+
const propVal = await actor.getPropertyValue(condition.property.name);
|
|
99
|
+
if (!compareValues(propVal, condition.property.value, condition.property.operator || '===')) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// 6. GAS Attribute Check
|
|
104
|
+
if (condition.attribute && actor) {
|
|
105
|
+
const attrVal = await actor.getAttributeValue(condition.attribute.set, condition.attribute.name);
|
|
106
|
+
if (!compareValues(attrVal, condition.attribute.value, condition.attribute.operator || '===')) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Runs a continuous or guarded input loop based on InputConditionalOptions.
|
|
114
|
+
*/
|
|
115
|
+
async function runConditionalInputLoop(params) {
|
|
116
|
+
const { driveFn, releaseFn, options, actor } = params;
|
|
117
|
+
const timeout = options.timeout ?? 5000;
|
|
118
|
+
const intervalMs = options.intervalMs ?? 16;
|
|
119
|
+
const startTime = Date.now();
|
|
120
|
+
// 1. "when" condition: wait for condition before firing once
|
|
121
|
+
if (options.when) {
|
|
122
|
+
while (true) {
|
|
123
|
+
const isMet = await evaluateCondition(options.when, actor);
|
|
124
|
+
if (isMet) {
|
|
125
|
+
await driveFn();
|
|
126
|
+
if (releaseFn)
|
|
127
|
+
await releaseFn();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (Date.now() - startTime >= timeout) {
|
|
131
|
+
throw new Error(`Timed out after ${timeout}ms waiting for 'when' condition before triggering input.`);
|
|
132
|
+
}
|
|
133
|
+
await new Promise(r => setTimeout(r, intervalMs));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// 2. Initial state capture (e.g. start location for distance calculations)
|
|
137
|
+
let startLocation;
|
|
138
|
+
if (actor) {
|
|
139
|
+
try {
|
|
140
|
+
startLocation = await actor.getLocation();
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
// Ignore if actor isn't ready
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// 3. "until" condition: continuously drive input until condition becomes true
|
|
147
|
+
if (options.until) {
|
|
148
|
+
try {
|
|
149
|
+
while (true) {
|
|
150
|
+
// Check condition first
|
|
151
|
+
const isMet = await evaluateCondition(options.until, actor, startLocation);
|
|
152
|
+
if (isMet) {
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
if (Date.now() - startTime >= timeout) {
|
|
156
|
+
throw new Error(`Timed out after ${timeout}ms waiting for 'until' condition while driving input.`);
|
|
157
|
+
}
|
|
158
|
+
// Inject input tick asynchronously
|
|
159
|
+
await driveFn();
|
|
160
|
+
await new Promise(r => setTimeout(r, intervalMs));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
finally {
|
|
164
|
+
if (releaseFn) {
|
|
165
|
+
await releaseFn().catch(() => { });
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
// 4. "while" condition: continuously drive input while condition remains true
|
|
171
|
+
if (options.while) {
|
|
172
|
+
try {
|
|
173
|
+
while (true) {
|
|
174
|
+
const isMet = await evaluateCondition(options.while, actor, startLocation);
|
|
175
|
+
if (!isMet) {
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
if (Date.now() - startTime >= timeout) {
|
|
179
|
+
// While loop completes on timeout or condition flip
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
await driveFn();
|
|
183
|
+
await new Promise(r => setTimeout(r, intervalMs));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
finally {
|
|
187
|
+
if (releaseFn) {
|
|
188
|
+
await releaseFn().catch(() => { });
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
// 5. Default fallback: single fire
|
|
194
|
+
await driveFn();
|
|
195
|
+
if (releaseFn)
|
|
196
|
+
await releaseFn();
|
|
197
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in event maps for different Unreal Engine domains.
|
|
3
|
+
* Users can extend custom events via TypeScript module augmentation.
|
|
4
|
+
*/
|
|
5
|
+
export interface SpecterActorEvents {
|
|
6
|
+
OnTakeAnyDamage: {
|
|
7
|
+
damage: number;
|
|
8
|
+
damageType: string;
|
|
9
|
+
instigator: string;
|
|
10
|
+
};
|
|
11
|
+
OnTakePointDamage: {
|
|
12
|
+
damage: number;
|
|
13
|
+
hitLocation: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
z: number;
|
|
17
|
+
};
|
|
18
|
+
shotDirection: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
z: number;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
OnActorBeginOverlap: {
|
|
25
|
+
otherActor: string;
|
|
26
|
+
};
|
|
27
|
+
OnActorEndOverlap: {
|
|
28
|
+
otherActor: string;
|
|
29
|
+
};
|
|
30
|
+
OnDestroyed: {
|
|
31
|
+
actorName: string;
|
|
32
|
+
};
|
|
33
|
+
OnAudioFinished: void;
|
|
34
|
+
OnNiagaraSystemFinished: void;
|
|
35
|
+
OnControlMappingsRebuilt: void;
|
|
36
|
+
OnComponentHit: {
|
|
37
|
+
otherActor: string;
|
|
38
|
+
hitLocation: {
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
z: number;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
OnMovementModeChanged: {
|
|
45
|
+
characterName?: string;
|
|
46
|
+
movementMode?: string;
|
|
47
|
+
previousMode?: string;
|
|
48
|
+
isFalling?: boolean;
|
|
49
|
+
isSwimming?: boolean;
|
|
50
|
+
isFlying?: boolean;
|
|
51
|
+
isMovingOnGround?: boolean;
|
|
52
|
+
isCrouching?: boolean;
|
|
53
|
+
};
|
|
54
|
+
OnLanded: {
|
|
55
|
+
impactPoint?: {
|
|
56
|
+
x: number;
|
|
57
|
+
y: number;
|
|
58
|
+
z: number;
|
|
59
|
+
};
|
|
60
|
+
impactNormal?: {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
z: number;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export interface SpecterWidgetEvents {
|
|
68
|
+
OnClicked: void;
|
|
69
|
+
OnHovered: void;
|
|
70
|
+
OnUnhovered: void;
|
|
71
|
+
OnTextChanged: {
|
|
72
|
+
text: string;
|
|
73
|
+
};
|
|
74
|
+
OnCheckStateChanged: {
|
|
75
|
+
isChecked: boolean;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export interface SpecterWorldEvents {
|
|
79
|
+
mapLoaded: {
|
|
80
|
+
mapName: string;
|
|
81
|
+
};
|
|
82
|
+
playerJoined: {
|
|
83
|
+
playerId: number;
|
|
84
|
+
playerName: string;
|
|
85
|
+
};
|
|
86
|
+
playerLeft: {
|
|
87
|
+
playerId: number;
|
|
88
|
+
};
|
|
89
|
+
gameStateReady: void;
|
|
90
|
+
actorSpawned: {
|
|
91
|
+
actorName: string;
|
|
92
|
+
className: string;
|
|
93
|
+
};
|
|
94
|
+
collision: {
|
|
95
|
+
actorA: string;
|
|
96
|
+
actorB: string;
|
|
97
|
+
location: {
|
|
98
|
+
x: number;
|
|
99
|
+
y: number;
|
|
100
|
+
z: number;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
OnLevelLoaded: {
|
|
104
|
+
levelName: string;
|
|
105
|
+
packagePath: string;
|
|
106
|
+
};
|
|
107
|
+
OnLevelShown: {
|
|
108
|
+
levelName: string;
|
|
109
|
+
packagePath: string;
|
|
110
|
+
};
|
|
111
|
+
OnLevelHidden: {
|
|
112
|
+
levelName: string;
|
|
113
|
+
packagePath: string;
|
|
114
|
+
};
|
|
115
|
+
OnMatchStateChanged: {
|
|
116
|
+
oldState: string;
|
|
117
|
+
newState: string;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
export interface CustomActorEvents {
|
|
121
|
+
}
|
|
122
|
+
export interface CustomWidgetEvents {
|
|
123
|
+
}
|
|
124
|
+
export interface CustomWorldEvents {
|
|
125
|
+
}
|
|
126
|
+
export type ActorEventMap = SpecterActorEvents & CustomActorEvents & Record<string, any>;
|
|
127
|
+
export type WidgetEventMap = SpecterWidgetEvents & CustomWidgetEvents & Record<string, any>;
|
|
128
|
+
export type WorldEventMap = SpecterWorldEvents & CustomWorldEvents & Record<string, any>;
|
|
129
|
+
export type EventPredicate<T = any> = (data: T) => boolean;
|
|
130
|
+
export interface WaitForEventOptions<T = any> {
|
|
131
|
+
timeout?: number;
|
|
132
|
+
predicate?: EventPredicate<T>;
|
|
133
|
+
}
|