warscript 0.0.1-dev.c37d12c → 0.0.1-dev.c8d6bc0

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 (35) hide show
  1. package/attributes.d.ts +13 -0
  2. package/attributes.lua +16 -0
  3. package/core/types/handle.d.ts +2 -1
  4. package/core/types/handle.lua +5 -0
  5. package/engine/behaviour/ability/apply-unit-behavior.d.ts +8 -4
  6. package/engine/behaviour/ability/apply-unit-behavior.lua +31 -9
  7. package/engine/internal/ability.d.ts +1 -1
  8. package/engine/internal/mechanics/ability-duration.d.ts +1 -3
  9. package/engine/internal/mechanics/ability-duration.lua +2 -0
  10. package/engine/internal/mechanics/cast-ability.d.ts +2 -0
  11. package/engine/internal/mechanics/cast-ability.lua +86 -0
  12. package/engine/internal/unit/detach-missiles.d.ts +7 -0
  13. package/engine/internal/unit/detach-missiles.lua +30 -0
  14. package/engine/object-data/entry/ability-type/blink.d.ts +10 -0
  15. package/engine/object-data/entry/ability-type/blink.lua +39 -0
  16. package/engine/object-data/entry/ability-type.d.ts +1 -0
  17. package/engine/object-data/entry/ability-type.lua +1 -0
  18. package/engine/object-data/entry/buff-type/applicable.lua +27 -71
  19. package/engine/object-data/entry/unit-type.d.ts +21 -0
  20. package/engine/object-data/entry/unit-type.lua +198 -44
  21. package/engine/object-field/ability.d.ts +7 -5
  22. package/engine/object-field/ability.lua +6 -0
  23. package/engine/object-field/unit.d.ts +1 -0
  24. package/engine/object-field/unit.lua +3 -0
  25. package/engine/object-field.d.ts +6 -5
  26. package/engine/object-field.lua +37 -18
  27. package/engine/standard/entries/unit-type.d.ts +3 -0
  28. package/engine/standard/entries/unit-type.lua +3 -0
  29. package/engine/unit.d.ts +1 -0
  30. package/engine/unit.lua +1 -0
  31. package/global/vec2.lua +1 -0
  32. package/package.json +2 -3
  33. package/utility/linked-set.d.ts +1 -0
  34. package/utility/linked-set.lua +16 -0
  35. package/utility/types.d.ts +2 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "warscript",
4
- "version": "0.0.1-dev.c37d12c",
4
+ "version": "0.0.1-dev.c8d6bc0",
5
5
  "description": "A typescript library for Warcraft III using Warpack.",
6
6
  "keywords": [
7
7
  "warcraft",
@@ -22,8 +22,7 @@
22
22
  },
23
23
  "peerDependencies": {
24
24
  "@warscript/language-extensions": "^0.0.1",
25
- "@warscript/tstl-plugin": "^0.0.1",
26
- "typescript-to-lua": "^1.24.1",
25
+ "@warscript/tstl-plugin": "^0.0.3",
27
26
  "lua-types": "^2.13.1",
28
27
  "warpack": "0.0.1-dev.5bdabe5"
29
28
  },
@@ -44,6 +44,7 @@ export declare class LinkedSet<T extends AnyNotNil> implements ReadonlyLinkedSet
44
44
  sortBy<R>(selector: ((value: T) => R) | KeysOfType<T, R>): void;
45
45
  protected __pairs(this: LinkedSet<T>): LuaIterator<T | undefined, IteratorState<T>>;
46
46
  }
47
+ export declare const emptyLinkedSet: <T extends AnyNotNil>() => ReadonlyLinkedSet<T>;
47
48
  export declare const linkedSetOf: <T extends AnyNotNil>(...elements: readonly T[]) => LinkedSet<T>;
48
49
  export declare const linkedSetOfNotNull: <T extends AnyNotNil>(...elements: readonly (T | null | undefined)[]) => LinkedSet<T>;
49
50
  export {};
@@ -2,9 +2,12 @@ local ____lualib = require("lualib_bundle")
2
2
  local __TS__Class = ____lualib.__TS__Class
3
3
  local __TS__New = ____lualib.__TS__New
4
4
  local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
5
+ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
5
6
  local ____exports = {}
6
7
  local ____arrays = require("utility.arrays")
7
8
  local sortBy = ____arrays.sortBy
9
+ local ____exception = require("exception")
10
+ local UnsupportedOperationException = ____exception.UnsupportedOperationException
8
11
  local function linkedSetNext(state)
9
12
  local n = state.n
10
13
  state.n = state.t[n]
@@ -161,6 +164,19 @@ __TS__SetDescriptor(
161
164
  end},
162
165
  true
163
166
  )
167
+ local EmptyLinkedSet = __TS__Class()
168
+ EmptyLinkedSet.name = "EmptyLinkedSet"
169
+ __TS__ClassExtends(EmptyLinkedSet, ____exports.LinkedSet)
170
+ function EmptyLinkedSet.prototype.add(self)
171
+ error(
172
+ __TS__New(UnsupportedOperationException),
173
+ 0
174
+ )
175
+ end
176
+ local EMPTY_LINKED_SET = __TS__New(EmptyLinkedSet)
177
+ ____exports.emptyLinkedSet = function()
178
+ return EMPTY_LINKED_SET
179
+ end
164
180
  ____exports.linkedSetOf = function(...)
165
181
  local linkedSet = __TS__New(____exports.LinkedSet)
166
182
  for i = 1, select("#", ...) do
@@ -12,14 +12,14 @@ export type ValueOf<T> = T[keyof T];
12
12
  export type EntryOf<T> = ValueOf<{
13
13
  [K in keyof T]: [K, T[K]];
14
14
  }>;
15
- export type MutableKeys<T extends object> = {
15
+ export type MutableKeys<T extends object> = keyof T & {
16
16
  [P in keyof T]-?: IfEquals<{
17
17
  [Q in P]: T[P];
18
18
  }, {
19
19
  -readonly [Q in P]: T[P];
20
20
  }, P>;
21
21
  }[keyof T];
22
- export type ReadonlyKeys<T extends object> = {
22
+ export type ReadonlyKeys<T extends object> = keyof T & {
23
23
  [P in keyof T]-?: IfEquals<{
24
24
  [Q in P]: T[P];
25
25
  }, {