@modlock/modlock 0.1.85 → 0.1.87
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/host.gen.d.ts +44 -2
- package/index.d.ts +3 -0
- package/index.js +1129 -121
- package/package.json +6 -6
- package/persist.d.ts +81 -0
- package/service-later.d.ts +17 -0
- package/stragglers.d.ts +36 -0
- package/ui.d.ts +15 -3
package/host.gen.d.ts
CHANGED
|
@@ -43,6 +43,8 @@ export type ModRole = 'unspecified' | 'developer' | 'tester';
|
|
|
43
43
|
* game's abilities move as Mirage's Tornado pulls the camera back.
|
|
44
44
|
*/
|
|
45
45
|
export type CameraParam = 'distance' | 'fieldOfView' | 'target' | 'verticalOffset' | 'horizontalOffset';
|
|
46
|
+
/** ServiceFailure says why a service call ended without an answer. */
|
|
47
|
+
export type ServiceFailure = 'none' | 'refused' | 'timeout' | 'unavailable';
|
|
46
48
|
/** Ability is one ability a hero owns. */
|
|
47
49
|
export interface Ability {
|
|
48
50
|
/** name is the ability's name, such as citadel_ability_hornet_snipe. */
|
|
@@ -1397,12 +1399,28 @@ export interface Wheel {
|
|
|
1397
1399
|
/** fraction is the pointer's horizontal position, bounded from 0 to 1. */
|
|
1398
1400
|
readonly fraction: number;
|
|
1399
1401
|
}
|
|
1400
|
-
/**
|
|
1402
|
+
/**
|
|
1403
|
+
* UiPressEvent reports a press on a button in a player's interface, or a
|
|
1404
|
+
* press a layout's script sent with an action and a payload.
|
|
1405
|
+
*/
|
|
1401
1406
|
export interface UiPressEvent {
|
|
1402
1407
|
/** player is the player who pressed. */
|
|
1403
1408
|
readonly player: Player;
|
|
1404
|
-
/**
|
|
1409
|
+
/**
|
|
1410
|
+
* node is the id of the pressed button, or of the layout whose script
|
|
1411
|
+
* sent the press.
|
|
1412
|
+
*/
|
|
1405
1413
|
readonly node: string;
|
|
1414
|
+
/**
|
|
1415
|
+
* action names a layout's press, as its script sent it: one to 64
|
|
1416
|
+
* letters, digits, '_', '-' and '.'. It is empty for a button's press.
|
|
1417
|
+
*/
|
|
1418
|
+
readonly action: string;
|
|
1419
|
+
/**
|
|
1420
|
+
* payload is the text a layout's press carries, which the layout library
|
|
1421
|
+
* writes as JSON: valid UTF-8 of at most 180 bytes.
|
|
1422
|
+
*/
|
|
1423
|
+
readonly payload: string;
|
|
1406
1424
|
}
|
|
1407
1425
|
/**
|
|
1408
1426
|
* UiInputEvent reports a change the player made to an input in their
|
|
@@ -1557,6 +1575,17 @@ export interface ServiceReply {
|
|
|
1557
1575
|
/** payload is the answer. */
|
|
1558
1576
|
payload: Uint8Array;
|
|
1559
1577
|
}
|
|
1578
|
+
/** ServiceRepliedEvent ends one started service call. */
|
|
1579
|
+
export interface ServiceRepliedEvent {
|
|
1580
|
+
/** call is the number StartServiceCall returned. */
|
|
1581
|
+
readonly call: bigint;
|
|
1582
|
+
/** payload is the answer, when failure is none. */
|
|
1583
|
+
readonly payload: Uint8Array;
|
|
1584
|
+
/** failure says why the call ended without an answer. */
|
|
1585
|
+
readonly failure?: ServiceFailure;
|
|
1586
|
+
/** error describes the failure. */
|
|
1587
|
+
readonly error: string;
|
|
1588
|
+
}
|
|
1560
1589
|
/** PrecacheOptions names what the next world loads ahead of use. */
|
|
1561
1590
|
export interface PrecacheOptions {
|
|
1562
1591
|
/** heroes are hero names, such as hero_wraith. */
|
|
@@ -2194,6 +2223,17 @@ export declare function remapInput(from: bigint, to: bigint, repeat?: boolean):
|
|
|
2194
2223
|
* service defines the payload's encoding.
|
|
2195
2224
|
*/
|
|
2196
2225
|
export declare function callService(service: string, method: string, payload: Uint8Array): Uint8Array | undefined;
|
|
2226
|
+
/**
|
|
2227
|
+
* startServiceCall calls method of a service the host provides and
|
|
2228
|
+
* returns at once with a number; the answer arrives in a later frame as a
|
|
2229
|
+
* ServiceReplied event carrying that number. Every call ends once: with
|
|
2230
|
+
* the reply, the service's refusal, a timeout or no provider at all. A
|
|
2231
|
+
* service nobody provides is never asked. The host waits at most 30
|
|
2232
|
+
* seconds, or the call's shorter timeout, and drops the mod's waiting
|
|
2233
|
+
* calls when the mod stops or reloads. A service that answers at once
|
|
2234
|
+
* answers this way too, in the next frame.
|
|
2235
|
+
*/
|
|
2236
|
+
export declare function startServiceCall(service: string, method: string, payload: Uint8Array, timeoutMilliseconds: number): bigint | undefined;
|
|
2197
2237
|
/**
|
|
2198
2238
|
* createEntity creates an entity the server knows by its designer name,
|
|
2199
2239
|
* such as npc_trooper_boss or prop_dynamic, with spawn key values and fields
|
|
@@ -2379,6 +2419,8 @@ export interface ModHandlers {
|
|
|
2379
2419
|
uiInput(event: UiInputEvent): void;
|
|
2380
2420
|
/** serve calls a service the mod serves from the host. */
|
|
2381
2421
|
serve(event: ServiceCall): ServiceReply;
|
|
2422
|
+
/** serviceReplied ends one StartServiceCall, in a frame after the call. */
|
|
2423
|
+
serviceReplied(event: ServiceRepliedEvent): void;
|
|
2382
2424
|
/**
|
|
2383
2425
|
* damage offers one hit before the game applies it, while the mod asked
|
|
2384
2426
|
* for damage. The mod's answer may block the hit or change its amount.
|
package/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { type AbilityCastEvent, type KillEvent, type DamageEvent, type ChatEvent, type DamagedEvent, type DamageResult, type FrameEvent, type HealEvent, type ImpactEvent, type LandedEvent, type LaunchEvent, type LevelEvent, type MeleeEvent, type ModifierFiredEvent, type ParryEvent, type Pawn, Player, type PlayerJoinedEvent, type PlayerLeftEvent } from './host.gen.js';
|
|
3
3
|
export * as vector from './vector.js';
|
|
4
4
|
export { Buttons, Layers } from './bits.js';
|
|
5
|
+
export { callServiceLater, type ServiceDone } from './service-later.js';
|
|
5
6
|
export { after, every, sequence, type Timer } from './timer.js';
|
|
6
7
|
export { type CameraMove, type CameraPlayOptions, cameraPulse, type CameraPulseOptions, cameraShake, type CameraShakeOptions, playCamera, setOrbitCamera, } from './camera.js';
|
|
7
8
|
export * as curve from './curve.js';
|
|
@@ -21,11 +22,13 @@ export { connection, players } from './players.js';
|
|
|
21
22
|
export { afterMatch, fewestPlayed, leaderboard, leastUsed, nextMatch, ratingChange, ratingStep, settle, type Standing, Standings, startingRating, } from './rotation.js';
|
|
22
23
|
export { bystanderStates, holdBystander } from './bystander.js';
|
|
23
24
|
export { Strays, strayGraceSeconds } from './strays.js';
|
|
25
|
+
export { Stragglers, stragglerConnectSeconds, type StragglersOptions, } from './stragglers.js';
|
|
24
26
|
export { type Check, ProbeRun } from './probe.js';
|
|
25
27
|
export { poseAt, type Pose, Puppet, type PuppetOptions, type PuppetState, ghostStates, ticksPerSecond, type Track, trackTicks, } from './puppet.js';
|
|
26
28
|
export { type HeroSnapshot, restoreHero } from './restore.js';
|
|
27
29
|
export { type ReplayedHit, replayDamage } from './replayed-damage.js';
|
|
28
30
|
export { type CatalogEntry, Dropper, dropperButtons } from './dropper.js';
|
|
31
|
+
export { persist, type PersistChange, type PersistChanges, type PersistDone, type PersistOptions, type PersistRead, type PersistRecord, type PersistValue, } from './persist.js';
|
|
29
32
|
export { type BoardPage, type BoardRead, type BoardRow, type BoardWindow, type MatchPlace, readBoard, reportMatch, reportScore, type ScoreOptions, } from './scores.js';
|
|
30
33
|
export { decodeSpot, encodeSpot, LoadedSpot, loadSpot, type Placed, type Spot, type SpotObject, triggers, } from './spot.js';
|
|
31
34
|
export { type ButtonProps, type Child, type Component, type Edges, type ElementProps, Fragment, type Gradient, type HeroLookName, type HeroProps, hide, hideHud, cursorFree, freeCursor, abilityBarPresses, type AbilityBarHandler, abilityDisplay, type AbilityRow, type ShownAbility, type HudPart, type ImageProps, type JSX, jsx, jsxs, type LabelProps, type LayoutProps, type Length, type Overflow, type PanelProps, route, type Scaling, type Shadow, sheet, show, type Style, toast, type Transition, type UiElement, uiSound, } from './ui.js';
|