@paulbarmstrong/js-to-sqf 0.1.0-alpha → 0.1.1-alpha

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 +177 -11
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -58,6 +58,28 @@ declare class Control {}
58
58
  */
59
59
  declare class DiaryRecord {}
60
60
 
61
+ /**
62
+ * A location is an extended type of marker. For example city names displayed on
63
+ * the map are locations; their information can be accessed and modified with
64
+ * Location commands.
65
+ * @see {@link https://community.bistudio.com/wiki/Location}
66
+ */
67
+ declare class Location {}
68
+
69
+ /**
70
+ * A Task is a Data Type that contains a task's details, such as location, title
71
+ * and description.
72
+ * @see {@link https://community.bistudio.com/wiki/Task}
73
+ */
74
+ declare class Task {}
75
+
76
+ /**
77
+ * A Script Handle, used to identify scripts in script operations called using
78
+ * spawn or execVM.
79
+ * @see {@link https://community.bistudio.com/wiki/Script_Handle}
80
+ */
81
+ declare class ScriptHandle {}
82
+
61
83
  /**
62
84
  * Data type representing a side.
63
85
  * @see {@link https://community.bistudio.com/wiki/Side}
@@ -1585,6 +1607,28 @@ export function configFile(): ConfigFile
1585
1607
  */
1586
1608
  export function configName(config: Config): string
1587
1609
 
1610
+ /**
1611
+ * A non-existing Config. ⚠Unlike other null values (objNull, grpNull, etc),
1612
+ * configNull returns true when compared to itself. configNull == configNull; //
1613
+ * returns true isNull configNull; // returns true configNull isEqualTo configNull;
1614
+ * // returns true configNull == configFile >> "ANonExistentEntry"; // returns true
1615
+ *
1616
+ * @returns Config
1617
+ * @see {@link https://community.bistudio.com/wiki/configNull}
1618
+ * @sqfsyntaxtype nullary
1619
+ */
1620
+ export function configNull(): Config
1621
+
1622
+ /**
1623
+ * A non-existing Control. To compare non-existent objects use isNull or isEqualTo
1624
+ * (see examples).
1625
+ *
1626
+ * @returns Control
1627
+ * @see {@link https://community.bistudio.com/wiki/controlNull}
1628
+ * @sqfsyntaxtype nullary
1629
+ */
1630
+ export function controlNull(): Control
1631
+
1588
1632
  /**
1589
1633
  * Copies ANSI text string to the clipboard. If Unicode support is desired, see
1590
1634
  * forceUnicode.
@@ -2217,6 +2261,23 @@ export function detach(object: GameObject): void
2217
2261
  */
2218
2262
  export function diag_log(output: any): void
2219
2263
 
2264
+ /**
2265
+ * A non-existent Diary Record. To compare non-existent objects use isNull or
2266
+ * isEqualTo: diaryRecordNull == diaryRecordNull; // false isNull diaryRecordNull;
2267
+ * // true diaryRecordNull isEqualTo diaryRecordNull; // true ⓘBefore Arma 3 v2.00,
2268
+ * isNull did not work with the diary record type and diaryRecordNull did not
2269
+ * exist. In order to verify a null record, it is possible to create a variable and
2270
+ * compare against it: private _diaryRecordNull = objNull createDiaryRecord [];
2271
+ * private _createdRecord = player createDiaryRecord ["Diary", ["Title",
2272
+ * "Description"]]; if (_createdRecord isEqualTo _diaryRecordNull) then { hint
2273
+ * "Failed"; };
2274
+ *
2275
+ * @returns DiaryRecord
2276
+ * @see {@link https://community.bistudio.com/wiki/diaryRecordNull}
2277
+ * @sqfsyntaxtype nullary
2278
+ */
2279
+ export function diaryRecordNull(): DiaryRecord
2280
+
2220
2281
  /**
2221
2282
  * Adds an event handler to the given display. See User Interface Event Handlers
2222
2283
  * for the full list of event names. If applicable, see DIK_KeyCodes for a list of
@@ -2257,6 +2318,17 @@ export function displayCtrl(display: Display, idc: number): Control
2257
2318
  */
2258
2319
  export function displayCtrlV2(idc: number): Control
2259
2320
 
2321
+ /**
2322
+ * A non-existing Display. To compare non-existent displays use isNull or
2323
+ * isEqualTo: displayNull == displayNull; // false isNull displayNull; // true
2324
+ * displayNull isEqualTo displayNull; // true
2325
+ *
2326
+ * @returns Display
2327
+ * @see {@link https://community.bistudio.com/wiki/displayNull}
2328
+ * @sqfsyntaxtype nullary
2329
+ */
2330
+ export function displayNull(): Display
2331
+
2260
2332
  /**
2261
2333
  * Remove a given event handler from the given display.
2262
2334
  *
@@ -2289,7 +2361,7 @@ export function distance(param1: GameObject | PositionAGL | Position2D, param2:
2289
2361
  * @see {@link https://community.bistudio.com/wiki/distance}
2290
2362
  * @sqfsyntaxtype binary
2291
2363
  */
2292
- export function distanceV2(location1: any | PositionAGL | Position2D, location2: any | PositionAGL | Position2D): number
2364
+ export function distanceV2(location1: Location | PositionAGL | Position2D, location2: Location | PositionAGL | Position2D): number
2293
2365
 
2294
2366
  /**
2295
2367
  * Returns a distance in meters between Objects, Positions or Locations. ⚠If
@@ -2751,7 +2823,7 @@ export function getPos(object: GameObject): PositionAGLS
2751
2823
  * @see {@link https://community.bistudio.com/wiki/getPos}
2752
2824
  * @sqfsyntaxtype unary
2753
2825
  */
2754
- export function getPosV2(location: any): PositionAGL
2826
+ export function getPosV2(location: Location): PositionAGL
2755
2827
 
2756
2828
  /**
2757
2829
  * Returns object or location position. If the argument is an object, the return
@@ -3342,6 +3414,17 @@ export function local(object: GameObject | Group): boolean
3342
3414
  */
3343
3415
  export function localNamespace(): Namespace
3344
3416
 
3417
+ /**
3418
+ * A non-existing Location. To compare non-existent locations use isNull or
3419
+ * isEqualTo: locationNull == locationNull; // false isNull locationNull; // true
3420
+ * locationNull isEqualTo locationNull; // true
3421
+ *
3422
+ * @returns Location
3423
+ * @see {@link https://community.bistudio.com/wiki/locationNull}
3424
+ * @sqfsyntaxtype nullary
3425
+ */
3426
+ export function locationNull(): Location
3427
+
3345
3428
  /**
3346
3429
  * Lock vehicle (disable mounting / dismounting) for player. This command will
3347
3430
  * remove user get in/get out actions but will not stop player getting into or out
@@ -3527,7 +3610,7 @@ export function name(object: GameObject): string
3527
3610
  * @see {@link https://community.bistudio.com/wiki/name}
3528
3611
  * @sqfsyntaxtype unary
3529
3612
  */
3530
- export function nameV2(location: any): string
3613
+ export function nameV2(location: Location): string
3531
3614
 
3532
3615
  /**
3533
3616
  * When argument is Object, the command returns the name given to a unit using the
@@ -3553,7 +3636,7 @@ export function nameV3(namespace: Namespace): string
3553
3636
  * @see {@link https://community.bistudio.com/wiki/name}
3554
3637
  * @sqfsyntaxtype unary
3555
3638
  */
3556
- export function nameV4(scriptHandle: any): string
3639
+ export function nameV4(scriptHandle: ScriptHandle): string
3557
3640
 
3558
3641
  /**
3559
3642
  * Returns the nearest object of given type (or inherited classes) to given
@@ -3766,7 +3849,7 @@ export function position(object: GameObject): PositionAGLS
3766
3849
  * @see {@link https://community.bistudio.com/wiki/position}
3767
3850
  * @sqfsyntaxtype unary
3768
3851
  */
3769
- export function positionV2(location: any): PositionAGL
3852
+ export function positionV2(location: Location): PositionAGL
3770
3853
 
3771
3854
  /**
3772
3855
  * Returns the global namespace attached to the active user profile. Use
@@ -3992,6 +4075,18 @@ export function screenToWorld(screen: Position2D): PositionAGL
3992
4075
  */
3993
4076
  export function screenToWorldV2(camera: GameObject, screen: Position2D): PositionAGL
3994
4077
 
4078
+ /**
4079
+ * A non-existing or completed Script Handle. To compare non-existent scripts use
4080
+ * isNull or isEqualTo: scriptNull == scriptNull; // ERROR! == cannot be used with
4081
+ * script object isNull scriptNull; // true scriptNull isEqualTo scriptNull; //
4082
+ * true
4083
+ *
4084
+ * @returns NULL script
4085
+ * @see {@link https://community.bistudio.com/wiki/scriptNull}
4086
+ * @sqfsyntaxtype nullary
4087
+ */
4088
+ export function scriptNull(): ScriptHandle
4089
+
3995
4090
  /**
3996
4091
  * Returns server's namespace. This namespace is only available on the server for
3997
4092
  * the server's uptime duration (same as uiNamespace). All server event handlers,
@@ -4423,7 +4518,7 @@ export function setWaypointType(waypoint: Waypoint, type: string): void
4423
4518
  * @see {@link https://community.bistudio.com/wiki/side}
4424
4519
  * @sqfsyntaxtype unary
4425
4520
  */
4426
- export function side(target: any): Side
4521
+ export function side(target: any | Location): Side
4427
4522
 
4428
4523
  /**
4429
4524
  * Types text to the side radio channel by the specified unit. Use clearRadio to
@@ -4453,6 +4548,25 @@ export function sideChat(unit: GameObject, chatText: string): void
4453
4548
  */
4454
4549
  export function sideChatV2(side: Side, identity: string, chatText: string): void
4455
4550
 
4551
+ /**
4552
+ * Returns empty side, for example static buildings in Eden Editor.
4553
+ *
4554
+ * @returns Side
4555
+ * @see {@link https://community.bistudio.com/wiki/sideEmpty}
4556
+ * @sqfsyntaxtype nullary
4557
+ */
4558
+ export function sideEmpty(): Side
4559
+
4560
+ /**
4561
+ * The unknown side. Used when the side of a unit is unknown, e.g. for spotted
4562
+ * targets with insufficient information.
4563
+ *
4564
+ * @returns Side
4565
+ * @see {@link https://community.bistudio.com/wiki/sideUnknown}
4566
+ * @sqfsyntaxtype nullary
4567
+ */
4568
+ export function sideUnknown(): Side
4569
+
4456
4570
  /**
4457
4571
  * Suspends code execution for given time in seconds. The sleep precision is given
4458
4572
  * by a framerate, the delay given is the minimal delay expected. Must be called
@@ -4499,7 +4613,7 @@ export function sort(array: Array<any>, order: boolean): void
4499
4613
  * @see {@link https://community.bistudio.com/wiki/spawn}
4500
4614
  * @sqfsyntaxtype binary
4501
4615
  */
4502
- export function spawn(arguments: Array<any>, code: Function): any
4616
+ export function spawn(arguments: Array<any>, code: Function): ScriptHandle
4503
4617
 
4504
4618
  /**
4505
4619
  * Adds given set of compiled instructions to the scheduler. Exactly when the code
@@ -4518,7 +4632,7 @@ export function spawn(arguments: Array<any>, code: Function): any
4518
4632
  * @see {@link https://community.bistudio.com/wiki/spawn}
4519
4633
  * @sqfsyntaxtype unary
4520
4634
  */
4521
- export function spawnV2(code: Function): any
4635
+ export function spawnV2(code: Function): ScriptHandle
4522
4636
 
4523
4637
  /**
4524
4638
  * Adds given set of compiled instructions to the scheduler. Exactly when the code
@@ -4538,7 +4652,7 @@ export function spawnV2(code: Function): any
4538
4652
  * @see {@link https://community.bistudio.com/wiki/spawn}
4539
4653
  * @sqfsyntaxtype unary
4540
4654
  */
4541
- export function spawnV3(name: string): any
4655
+ export function spawnV3(name: string): ScriptHandle
4542
4656
 
4543
4657
  /**
4544
4658
  * Converts any value into a string, depending on its type. If an Object has a
@@ -4562,6 +4676,58 @@ export function str(value: any): string
4562
4676
  */
4563
4677
  export function systemChat(text: string): void
4564
4678
 
4679
+ /**
4680
+ * A non-existing Task. To compare non-existent tasks use isNull or isEqualTo:
4681
+ * taskNull == taskNull; // false isNull taskNull; // true taskNull isEqualTo
4682
+ * taskNull; // true
4683
+ *
4684
+ * @returns Task
4685
+ * @see {@link https://community.bistudio.com/wiki/taskNull}
4686
+ * @sqfsyntaxtype nullary
4687
+ */
4688
+ export function taskNull(): Task
4689
+
4690
+ /**
4691
+ * A non-existent Team Member. To compare non-existent team members use isNull or
4692
+ * isEqualTo: teamMemberNull == teamMemberNull; // false isNull teamMemberNull; //
4693
+ * true teamMemberNull isEqualTo teamMemberNull; // true
4694
+ *
4695
+ * @returns TeamMember
4696
+ * @see {@link https://community.bistudio.com/wiki/teamMemberNull}
4697
+ * @sqfsyntaxtype nullary
4698
+ */
4699
+ export function teamMemberNull(): TeamMember
4700
+
4701
+ /**
4702
+ * Returns the Data Type of an expression. The type is returned as on of the
4703
+ * following all-uppercase strings:
4704
+ * • "ARRAY"
4705
+ * • "BOOL"
4706
+ * • "CODE"
4707
+ * • "CONFIG"
4708
+ * • "CONTROL"
4709
+ * • "DISPLAY"
4710
+ * • "GROUP"
4711
+ * • "OBJECT"
4712
+ * • "SCALAR" (and "NaN")
4713
+ * • "SCRIPT"
4714
+ * • "SIDE"
4715
+ * • "STRING"
4716
+ * • "TEXT"
4717
+ * • 1.08 "LOCATION"
4718
+ * • 1.00 "TEAM_MEMBER"
4719
+ * • 1.00 "NAMESPACE"
4720
+ * • 1.00 "DIARY_RECORD"
4721
+ * • 1.00 "TASK"
4722
+ * • 2.02 "HASHMAP" They represent the available Data Types in Arma. For type
4723
+ * comparison, use isEqualType command instead.
4724
+ *
4725
+ * @returns string
4726
+ * @see {@link https://community.bistudio.com/wiki/typeName}
4727
+ * @sqfsyntaxtype unary
4728
+ */
4729
+ export function typeName(anything: any): string
4730
+
4565
4731
  /**
4566
4732
  * Returns the class name of given target.
4567
4733
  *
@@ -4719,7 +4885,7 @@ export function waitUntilV2(condition: Function, timeout: number, interval?: num
4719
4885
  * @see {@link https://community.bistudio.com/wiki/waitUntil}
4720
4886
  * @sqfsyntaxtype unary
4721
4887
  */
4722
- export function waitUntilV3(scriptHandle: any): any
4888
+ export function waitUntilV3(scriptHandle: ScriptHandle): any
4723
4889
 
4724
4890
  /**
4725
4891
  * Suspends execution of scheduled script until the given condition satisfied.
@@ -4742,7 +4908,7 @@ export function waitUntilV3(scriptHandle: any): any
4742
4908
  * @see {@link https://community.bistudio.com/wiki/waitUntil}
4743
4909
  * @sqfsyntaxtype unary
4744
4910
  */
4745
- export function waitUntilV4(scriptHandle: any, timeout: number): any
4911
+ export function waitUntilV4(scriptHandle: ScriptHandle, timeout: number): any
4746
4912
 
4747
4913
  /**
4748
4914
  * Get provided waypoint's position.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paulbarmstrong/js-to-sqf",
3
- "version": "0.1.0-alpha",
3
+ "version": "0.1.1-alpha",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"