@plugify-plugins/s2sdk-types 1.1.13 → 1.1.14

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.
Files changed (2) hide show
  1. package/index.d.ts +32 -14
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -213,6 +213,22 @@ declare module ":s2sdk" {
213
213
  Stop = 3
214
214
  }
215
215
 
216
+ /**
217
+ * @description Enum representing the type of callback.
218
+ */
219
+ export enum HookMode {
220
+
221
+ /**
222
+ * @description Callback will be executed before the original function
223
+ * */
224
+ Pre = 0,
225
+
226
+ /**
227
+ * @description Callback will be executed after the original function
228
+ * */
229
+ Post = 1
230
+ }
231
+
216
232
  /**
217
233
  * @description undefined
218
234
  */
@@ -1551,8 +1567,9 @@ declare module ":s2sdk" {
1551
1567
  * @param description A brief description of what the command does.
1552
1568
  * @param flags Command flags that define the behavior of the command.
1553
1569
  * @param callback A callback function that is invoked when the command is executed.
1570
+ * @param type Whether the hook was in post mode (after processing) or pre mode (before processing).
1554
1571
  */
1555
- export function AddAdminCommand(name: string, adminFlags: number, description: string, flags: ConVarFlag, callback: typeof Callbacks.CommandCallback): boolean;
1572
+ export function AddAdminCommand(name: string, adminFlags: number, description: string, flags: ConVarFlag, callback: typeof Callbacks.CommandCallback, type: HookMode): boolean;
1556
1573
 
1557
1574
  /**
1558
1575
  * @description Creates a console command or hooks an already existing one.
@@ -1563,8 +1580,9 @@ declare module ":s2sdk" {
1563
1580
  * @param description A brief description of what the command does.
1564
1581
  * @param flags Command flags that define the behavior of the command.
1565
1582
  * @param callback A callback function that is invoked when the command is executed.
1583
+ * @param type Whether the hook was in post mode (after processing) or pre mode (before processing).
1566
1584
  */
1567
- export function AddConsoleCommand(name: string, description: string, flags: ConVarFlag, callback: typeof Callbacks.CommandCallback): boolean;
1585
+ export function AddConsoleCommand(name: string, description: string, flags: ConVarFlag, callback: typeof Callbacks.CommandCallback, type: HookMode): boolean;
1568
1586
 
1569
1587
  /**
1570
1588
  * @description Removes a console command from the system.
@@ -1583,9 +1601,9 @@ declare module ":s2sdk" {
1583
1601
  *
1584
1602
  * @param name The name of the command.
1585
1603
  * @param callback The callback function that will be invoked when the command is executed.
1586
- * @param post A boolean indicating whether the callback should fire after the command is executed.
1604
+ * @param type Whether the hook was in post mode (after processing) or pre mode (before processing).
1587
1605
  */
1588
- export function AddCommandListener(name: string, callback: typeof Callbacks.CommandCallback, post: boolean): boolean;
1606
+ export function AddCommandListener(name: string, callback: typeof Callbacks.CommandCallback, type: HookMode): boolean;
1589
1607
 
1590
1608
  /**
1591
1609
  * @description Removes a callback that fires when a command is sent to the server.
@@ -1594,9 +1612,9 @@ declare module ":s2sdk" {
1594
1612
  *
1595
1613
  * @param name The name of the command.
1596
1614
  * @param callback The callback function to be removed.
1597
- * @param post A boolean indicating whether the callback should be removed for post-execution.
1615
+ * @param type Whether the hook was in post mode (after processing) or pre mode (before processing).
1598
1616
  */
1599
- export function RemoveCommandListener(name: string, callback: typeof Callbacks.CommandCallback, post: boolean): boolean;
1617
+ export function RemoveCommandListener(name: string, callback: typeof Callbacks.CommandCallback, type: HookMode): boolean;
1600
1618
 
1601
1619
  /**
1602
1620
  * @description Executes a server command as if it were run on the server console or through RCON.
@@ -2813,9 +2831,9 @@ declare module ":s2sdk" {
2813
2831
  * @param szClassname The class name of the entity to hook the output for.
2814
2832
  * @param szOutput The output event name to hook.
2815
2833
  * @param callback The callback function to invoke when the output is fired.
2816
- * @param post Indicates whether the hook should be a post-hook (true) or pre-hook (false).
2834
+ * @param type Whether the hook was in post mode (after processing) or pre mode (before processing).
2817
2835
  */
2818
- export function HookEntityOutput(szClassname: string, szOutput: string, callback: typeof Callbacks.HookEntityOutputCallback, post: boolean): void;
2836
+ export function HookEntityOutput(szClassname: string, szOutput: string, callback: typeof Callbacks.HookEntityOutputCallback, type: HookMode): boolean;
2819
2837
 
2820
2838
  /**
2821
2839
  * @description Removes an entity output hook.
@@ -2825,9 +2843,9 @@ declare module ":s2sdk" {
2825
2843
  * @param szClassname The class name of the entity from which to unhook the output.
2826
2844
  * @param szOutput The output event name to unhook.
2827
2845
  * @param callback The callback function that was previously hooked.
2828
- * @param post Indicates whether the hook was a post-hook (true) or pre-hook (false).
2846
+ * @param type Whether the hook was in post mode (after processing) or pre mode (before processing).
2829
2847
  */
2830
- export function UnhookEntityOutput(szClassname: string, szOutput: string, callback: typeof Callbacks.HookEntityOutputCallback, post: boolean): void;
2848
+ export function UnhookEntityOutput(szClassname: string, szOutput: string, callback: typeof Callbacks.HookEntityOutputCallback, type: HookMode): boolean;
2831
2849
 
2832
2850
  /**
2833
2851
  * @description Searches for an entity by classname.
@@ -3223,9 +3241,9 @@ declare module ":s2sdk" {
3223
3241
  *
3224
3242
  * @param name The name of the event to hook.
3225
3243
  * @param pCallback The callback function to call when the event is fired.
3226
- * @param post A boolean indicating whether the hook should be for a post event.
3244
+ * @param type Whether the hook was in post mode (after processing) or pre mode (before processing).
3227
3245
  */
3228
- export function HookEvent(name: string, pCallback: typeof Callbacks.EventCallback, post: boolean): number;
3246
+ export function HookEvent(name: string, pCallback: typeof Callbacks.EventCallback, type: HookMode): number;
3229
3247
 
3230
3248
  /**
3231
3249
  * @description Removes a hook for when a game event is fired.
@@ -3234,9 +3252,9 @@ declare module ":s2sdk" {
3234
3252
  *
3235
3253
  * @param name The name of the event to unhook.
3236
3254
  * @param pCallback The callback function to remove.
3237
- * @param post A boolean indicating whether the hook is for a post event.
3255
+ * @param type Whether the hook was in post mode (after processing) or pre mode (before processing).
3238
3256
  */
3239
- export function UnhookEvent(name: string, pCallback: typeof Callbacks.EventCallback, post: boolean): number;
3257
+ export function UnhookEvent(name: string, pCallback: typeof Callbacks.EventCallback, type: HookMode): number;
3240
3258
 
3241
3259
  /**
3242
3260
  * @description Creates a game event to be fired later.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plugify-plugins/s2sdk-types",
3
- "version": "1.1.13",
3
+ "version": "1.1.14",
4
4
  "description": "generated typescript types to write plugins on plugify",
5
5
  "types": "index.d.ts",
6
6
  "scripts": {},