@paulbarmstrong/js-to-sqf 0.1.2-alpha → 0.1.4-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.
- package/LICENSE +21 -21
- package/README.md +7 -7
- package/index.d.ts +77 -18
- package/package.json +36 -36
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Paul B. Armstrong
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Paul B. Armstrong
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
### @paulbarmstrong/js-to-sqf
|
|
2
|
-
|
|
3
|
-
This is a typescript types library defining SQF (Status Quo Format) commands and functions. The purpose is to make it easy to author code which can be transpiled to SQF by the [@paulbarmstrong/js-to-sqf-cli](https://github.com/paulbarmstrong/js-to-sqf-cli) tool.
|
|
4
|
-
|
|
5
|
-
#### Usage
|
|
6
|
-
|
|
7
|
-
See https://github.com/paulbarmstrong/js-to-sqf-cli
|
|
1
|
+
### @paulbarmstrong/js-to-sqf
|
|
2
|
+
|
|
3
|
+
This is a typescript types library defining SQF (Status Quo Format) commands and functions. The purpose is to make it easy to author code which can be transpiled to SQF by the [@paulbarmstrong/js-to-sqf-cli](https://github.com/paulbarmstrong/js-to-sqf-cli) tool.
|
|
4
|
+
|
|
5
|
+
#### Usage
|
|
6
|
+
|
|
7
|
+
See https://github.com/paulbarmstrong/js-to-sqf-cli
|
package/index.d.ts
CHANGED
|
@@ -5076,18 +5076,6 @@ export function ctrlText(idc: number): string
|
|
|
5076
5076
|
*/
|
|
5077
5077
|
export function ctrlTextV2(controlName: Control): string
|
|
5078
5078
|
|
|
5079
|
-
/**
|
|
5080
|
-
* Limit the speed of an AI-driven vehicle or AI person to given value. It has
|
|
5081
|
-
* continuous effect and AI will not break through the speed limitation until one
|
|
5082
|
-
* is contacted, engaged or regrouped.
|
|
5083
|
-
*
|
|
5084
|
-
* @param speed - in km/h; By default, it's 2 * maxSpeed of the vehicle/unit (which is defined in
|
|
5085
|
-
* config)
|
|
5086
|
-
* @see {@link https://community.bistudio.com/wiki/limitSpeed}
|
|
5087
|
-
* @sqfsyntaxtype binary
|
|
5088
|
-
*/
|
|
5089
|
-
export function limitSpeed(objectName: GameObject, speed: number | boolean): void
|
|
5090
|
-
|
|
5091
5079
|
/**
|
|
5092
5080
|
* Adds a row of strings.
|
|
5093
5081
|
*
|
|
@@ -5144,57 +5132,63 @@ export function lnbCurSelRowV2(ctrl: Control): number
|
|
|
5144
5132
|
* Returns the additional text (invisible) in an item with the given position of
|
|
5145
5133
|
* the 2D listbox.
|
|
5146
5134
|
*
|
|
5135
|
+
* @param cell - list item position in format [row, column]
|
|
5147
5136
|
* @returns string
|
|
5148
5137
|
* @see {@link https://community.bistudio.com/wiki/lnbData}
|
|
5149
5138
|
* @sqfsyntaxtype unary
|
|
5150
5139
|
*/
|
|
5151
|
-
export function lnbData(idc: number | Control,
|
|
5140
|
+
export function lnbData(idc: number | Control, cell: [number, number]): string
|
|
5152
5141
|
|
|
5153
5142
|
/**
|
|
5154
5143
|
* Returns the additional text (invisible) in an item with the given position of
|
|
5155
5144
|
* the 2D listbox.
|
|
5156
5145
|
*
|
|
5146
|
+
* @param cell - list item position in format [row, column]
|
|
5157
5147
|
* @returns string
|
|
5158
5148
|
* @see {@link https://community.bistudio.com/wiki/lnbData}
|
|
5159
5149
|
* @sqfsyntaxtype binary
|
|
5160
5150
|
*/
|
|
5161
|
-
export function lnbDataV2(ctrl: Control,
|
|
5151
|
+
export function lnbDataV2(ctrl: Control, cell: [number, number]): string
|
|
5162
5152
|
|
|
5163
5153
|
/**
|
|
5164
5154
|
* Sets the additional text (invisible) on the item with the given position of the
|
|
5165
5155
|
* 2D listbox.
|
|
5166
5156
|
*
|
|
5157
|
+
* @param cell - list item position in format [row, column]
|
|
5167
5158
|
* @param data - the invisible text to add
|
|
5168
5159
|
* @see {@link https://community.bistudio.com/wiki/lnbSetData}
|
|
5169
5160
|
* @sqfsyntaxtype unary
|
|
5170
5161
|
*/
|
|
5171
|
-
export function lnbSetData(idc: number,
|
|
5162
|
+
export function lnbSetData(idc: number, cell: [number, number], data: string): void
|
|
5172
5163
|
|
|
5173
5164
|
/**
|
|
5174
5165
|
* Sets the additional text (invisible) on the item with the given position of the
|
|
5175
5166
|
* 2D listbox.
|
|
5176
5167
|
*
|
|
5168
|
+
* @param cell - list item position in format [row, column]
|
|
5177
5169
|
* @param data - the invisible text to add
|
|
5178
5170
|
* @see {@link https://community.bistudio.com/wiki/lnbSetData}
|
|
5179
5171
|
* @sqfsyntaxtype binary
|
|
5180
5172
|
*/
|
|
5181
|
-
export function lnbSetDataV2(ctrl: Control,
|
|
5173
|
+
export function lnbSetDataV2(ctrl: Control, cell: [number, number], data: string): void
|
|
5182
5174
|
|
|
5183
5175
|
/**
|
|
5184
5176
|
* Sets the text in the item with the given position of the 2D listbox.
|
|
5185
5177
|
*
|
|
5178
|
+
* @param cell - list item position in format [row, column]
|
|
5186
5179
|
* @see {@link https://community.bistudio.com/wiki/lnbSetText}
|
|
5187
5180
|
* @sqfsyntaxtype unary
|
|
5188
5181
|
*/
|
|
5189
|
-
export function lnbSetText(idc: number,
|
|
5182
|
+
export function lnbSetText(idc: number, cell: [number, number], data: string): void
|
|
5190
5183
|
|
|
5191
5184
|
/**
|
|
5192
5185
|
* Sets the text in the item with the given position of the 2D listbox.
|
|
5193
5186
|
*
|
|
5187
|
+
* @param cell - list item position in format [row, column]
|
|
5194
5188
|
* @see {@link https://community.bistudio.com/wiki/lnbSetText}
|
|
5195
5189
|
* @sqfsyntaxtype binary
|
|
5196
5190
|
*/
|
|
5197
|
-
export function lnbSetTextV2(ctrl: Control,
|
|
5191
|
+
export function lnbSetTextV2(ctrl: Control, cell: [number, number], data: string): void
|
|
5198
5192
|
|
|
5199
5193
|
/**
|
|
5200
5194
|
* Parses the string, interpreting its content as a floating point number. ⚠This
|
|
@@ -5210,6 +5204,62 @@ export function lnbSetTextV2(ctrl: Control, row: number, column: number, data: s
|
|
|
5210
5204
|
*/
|
|
5211
5205
|
export function parseNumber(value: string | boolean | any): number
|
|
5212
5206
|
|
|
5207
|
+
/**
|
|
5208
|
+
* Return a UniqueID of the given unit (player). The returned string is the
|
|
5209
|
+
* player's steamID64: private _steamProfileUrl =
|
|
5210
|
+
* "http://steamcommunity.com/profiles/" + (getPlayerUID player); ⚠Prior to Arma 2:
|
|
5211
|
+
* Operation Arrowhead v1.60, the result always consisted of a stringified number
|
|
5212
|
+
* (see getPlayerUIDOld), but always had to be considered and processed as a
|
|
5213
|
+
* String. Converting it to a Number could cause precision problems, as Number
|
|
5214
|
+
* cannot accurately represent integers above 16777216 (224). Moreover, games since
|
|
5215
|
+
* Arma 2: Operation Arrowhead v1.61 provide a value that is not all-numeric.
|
|
5216
|
+
* ⓘPrior to Arma 3 v2.02, in some cases the identity of certain player units could
|
|
5217
|
+
* fail to propagate to other clients and the server, which caused isPlayer and
|
|
5218
|
+
* getPlayerUID to incorrectly return false and "" respectively, where the affected
|
|
5219
|
+
* units were not local. See this bug report (GitHub) for more info. This was
|
|
5220
|
+
* supposedly fixed, but you should remain vigilant toward false negatives
|
|
5221
|
+
* nonetheless.
|
|
5222
|
+
*
|
|
5223
|
+
* @returns can be "_SP_AI_" or "_SP_PLAYER_" in SP, "" or UID in MP
|
|
5224
|
+
* @see {@link https://community.bistudio.com/wiki/getPlayerUID}
|
|
5225
|
+
* @sqfsyntaxtype unary
|
|
5226
|
+
*/
|
|
5227
|
+
export function getPlayerUID(unit: GameObject): string
|
|
5228
|
+
|
|
5229
|
+
/**
|
|
5230
|
+
* Returns true if the machine executing the command is the server in a multiplayer
|
|
5231
|
+
* game or is running single player. It will return true for both dedicated and
|
|
5232
|
+
* player-hosted server. See also Multiplayer Scripting/machines.
|
|
5233
|
+
*
|
|
5234
|
+
* @returns boolean
|
|
5235
|
+
* @see {@link https://community.bistudio.com/wiki/isServer}
|
|
5236
|
+
* @sqfsyntaxtype nullary
|
|
5237
|
+
*/
|
|
5238
|
+
export function isServer(): boolean
|
|
5239
|
+
|
|
5240
|
+
/**
|
|
5241
|
+
* Returns the machine network ID of the client that initiated Remote Execution.
|
|
5242
|
+
* ⚠Running this command
|
|
5243
|
+
* • in a Single Player environment
|
|
5244
|
+
* • outside of a remote-executed context
|
|
5245
|
+
* • in a remote-executed context received from a Headless Client will return 0 by
|
|
5246
|
+
* design. To check if the context is remote executed, use isRemoteExecuted or
|
|
5247
|
+
* isRemoteExecutedJIP.
|
|
5248
|
+
*
|
|
5249
|
+
* @returns returns zero in the specific cases listed in the Description
|
|
5250
|
+
* @see {@link https://community.bistudio.com/wiki/remoteExecutedOwner}
|
|
5251
|
+
* @sqfsyntaxtype nullary
|
|
5252
|
+
*/
|
|
5253
|
+
export function remoteExecutedOwner(): number
|
|
5254
|
+
|
|
5255
|
+
/**
|
|
5256
|
+
* Sets the position of a location.
|
|
5257
|
+
*
|
|
5258
|
+
* @see {@link https://community.bistudio.com/wiki/setPosition}
|
|
5259
|
+
* @sqfsyntaxtype binary
|
|
5260
|
+
*/
|
|
5261
|
+
export function setPosition(location: Location, pos: PositionAGL): void
|
|
5262
|
+
|
|
5213
5263
|
|
|
5214
5264
|
export namespace bis {
|
|
5215
5265
|
/**
|
|
@@ -5387,4 +5437,13 @@ export function stringToMarker(data: string): string
|
|
|
5387
5437
|
*/
|
|
5388
5438
|
export function triggerToMarker(trigger: GameObject, markerName: string): GameObject
|
|
5389
5439
|
|
|
5440
|
+
/**
|
|
5441
|
+
* Example (Click to enlarge) Display a text in the "mission" GUI area with some
|
|
5442
|
+
* effects. Good for the beginning of a mission.
|
|
5443
|
+
*
|
|
5444
|
+
* @see {@link https://community.bistudio.com/wiki/BIS_fnc_infoText}
|
|
5445
|
+
* @sqfsyntaxtype unary
|
|
5446
|
+
*/
|
|
5447
|
+
export function infoText(Array of Strings: any): void
|
|
5448
|
+
|
|
5390
5449
|
}
|
package/package.json
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@paulbarmstrong/js-to-sqf",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"publishConfig": {
|
|
6
|
-
"access": "public"
|
|
7
|
-
},
|
|
8
|
-
"types": "index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./index.d.ts"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"index.d.ts"
|
|
16
|
-
],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"generate": "node generate.js"
|
|
19
|
-
},
|
|
20
|
-
"repository": {
|
|
21
|
-
"type": "git",
|
|
22
|
-
"url": "git+https://github.com/paulbarmstrong/js-to-sqf.git"
|
|
23
|
-
},
|
|
24
|
-
"keywords": [
|
|
25
|
-
"sqf",
|
|
26
|
-
"types",
|
|
27
|
-
"typescript"
|
|
28
|
-
],
|
|
29
|
-
"author": "",
|
|
30
|
-
"license": "ISC",
|
|
31
|
-
"bugs": {
|
|
32
|
-
"url": "https://github.com/paulbarmstrong/js-to-sqf/issues"
|
|
33
|
-
},
|
|
34
|
-
"homepage": "https://github.com/paulbarmstrong/js-to-sqf#readme",
|
|
35
|
-
"description": "Type definitions for the js-to-sqf ecosystem"
|
|
36
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@paulbarmstrong/js-to-sqf",
|
|
3
|
+
"version": "0.1.4-alpha",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"types": "index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"index.d.ts"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"generate": "node generate.js"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/paulbarmstrong/js-to-sqf.git"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"sqf",
|
|
26
|
+
"types",
|
|
27
|
+
"typescript"
|
|
28
|
+
],
|
|
29
|
+
"author": "",
|
|
30
|
+
"license": "ISC",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/paulbarmstrong/js-to-sqf/issues"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://github.com/paulbarmstrong/js-to-sqf#readme",
|
|
35
|
+
"description": "Type definitions for the js-to-sqf ecosystem"
|
|
36
|
+
}
|