@s2script/sdk 0.4.0 → 0.5.0

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/chat.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  /** @s2script/chat — print messages to player chat. NO runtime code (injected at load). */
2
- import type { HookResultValue } from "./events";
3
2
 
4
3
  export declare const Chat: {
5
4
  /**
@@ -13,10 +12,4 @@ export declare const Chat: {
13
12
  toSlot(slot: number, message: string): void;
14
13
  /** Print to every live player's chat. */
15
14
  toAll(message: string): void;
16
- /**
17
- * Subscribe to raw player chat. The handler receives the speaker's `slot`, the raw `text`, and
18
- * `teamonly`. Returning `>= HookResult.Handled` (2) suppresses the broadcast (SM-parity). Non-command
19
- * chat lines are delivered here; the `@`-trigger layer subscribes through this.
20
- */
21
- onMessage(handler: (slot: number, text: string, teamonly: boolean) => HookResultValue | void): void;
22
15
  };
package/clients.d.ts CHANGED
@@ -36,24 +36,6 @@ export declare class Client {
36
36
  voiceMuted: boolean;
37
37
  }
38
38
  export declare const Clients: {
39
- /** Fires when a client connects (all clients incl. bots; carries name/xuid). May be async. */
40
- onConnect(handler: (client: Client) => void | Promise<void>): void;
41
- /** Fires when a client is put in the server (controller/pawn context now exists). May be async. */
42
- onPutInServer(handler: (client: Client) => void | Promise<void>): void;
43
- /** Fires when a client goes active (spawned / in-game). May be async. */
44
- onActive(handler: (client: Client) => void | Promise<void>): void;
45
- /** Fires when a client is fully connected. May be async. */
46
- onFullyConnect(handler: (client: Client) => void | Promise<void>): void;
47
- /** Fires when a client disconnects. Only `.slot` is guaranteed live here — capture identity earlier if needed. */
48
- onDisconnect(handler: (client: Client) => void): void;
49
- /** Fires when a client's settings (name/cvars) change. */
50
- onSettingsChanged(handler: (client: Client) => void): void;
51
- /**
52
- * Fires while a client transmits voice. Throttled to at most one dispatch per client per second;
53
- * the FIRST packet of a transmission always fires (a lazy mute-on-talk lands immediately).
54
- * Handlers should be idempotent. Never fires for bots.
55
- */
56
- onVoice(handler: (client: Client) => void): void;
57
39
  /** The client in `slot`, or null if the slot is empty. */
58
40
  fromSlot(slot: number): Client | null;
59
41
  /** Every currently-connected client. */
package/commands.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** @s2script/commands — register server commands. NO runtime code (injected at load). */
2
- export interface CommandContext {
2
+ export interface CommandInvocation {
3
3
  /** 0-based caller slot, or -1 for the server console. */
4
4
  readonly callerSlot: number;
5
5
  /** argString split on whitespace (0-based; the command name is NOT included). Kept for compat. */
@@ -33,9 +33,6 @@ export interface ChatTrigger {
33
33
  }
34
34
 
35
35
  export declare const Commands: {
36
- register(name: string, handler: (ctx: CommandContext) => void): void;
37
- registerServer(name: string, handler: (ctx: CommandContext) => void): void;
38
- registerAdmin(name: string, flags: number, handler: (ctx: CommandContext) => void): void;
39
36
  /** Invoke a registered command by name in THIS plugin (applying its gating). Returns true if it exists. */
40
37
  dispatch(name: string, slot: number, argString: string): boolean;
41
38
  /** Parse a chat message for a trigger (`!`/`/`). Returns the parsed trigger, or null if it's ordinary chat. */
package/config.d.ts CHANGED
@@ -7,8 +7,6 @@ export declare const config: {
7
7
  getInt(key: string): number;
8
8
  getFloat(key: string): number;
9
9
  getBool(key: string): boolean;
10
- /** Opt into live-reload: the handler fires with the re-materialized config when the file changes. */
11
- onChange(handler: (cfg: Config) => void): void;
12
10
  /** Read a raw file from the configs dir (name includes its extension, e.g. "maplist.txt"). null if absent. */
13
11
  readFile(name: string): string | null;
14
12
  /** Write a raw file to the configs dir (creates/overwrites). */
package/cookies.d.ts CHANGED
@@ -19,7 +19,4 @@ export declare const Cookies: {
19
19
  * clientprefs plugin to persist directly next frame — an offline SteamID never fires the disconnect
20
20
  * flush. No-op for "0" (bot/unset). */
21
21
  setAuthId(steamId: string, cookie: Cookie, value: string): void;
22
- /** Fires once per client, after that client's cookies finish loading (`OnClientCookiesCached`
23
- * parity) — post-frame, after the load's async DB read completes. */
24
- onCached(handler: (client: Client) => void): void;
25
22
  };
package/damage.d.ts CHANGED
@@ -17,8 +17,3 @@ export interface DamageInfo {
17
17
  /** The victim — the entity taking damage (the hooked `this`), or null if stale. */
18
18
  readonly victim: EntityRef | null;
19
19
  }
20
-
21
- export declare const Damage: {
22
- /** Register a pre-damage hook. The handler reads/modifies the DamageInfo in place (damage=0 blocks). */
23
- onPre(handler: (info: DamageInfo) => void): void;
24
- };