factorio-test 1.0.1 → 1.1.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.
Files changed (2) hide show
  1. package/index.d.ts +6 -3
  2. package/package.json +5 -3
package/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  /** @noSelfInFile */
2
- /// <reference types="luassert-tstl" />
3
2
 
4
3
  declare var test: FactorioTest.TestCreator
5
4
  declare var it: FactorioTest.TestCreator
@@ -41,13 +40,17 @@ declare namespace FactorioTest {
41
40
  type HookFn = TestFn
42
41
  type OnTickFn = (tick: number) => void | boolean
43
42
 
43
+ type MutableValues<A extends readonly any[]> = {
44
+ -readonly [K in keyof A]: A[K]
45
+ }
46
+
44
47
  /** @noSelf */
45
48
  interface TestCreatorBase {
46
49
  (name: string, func: TestFn): TestBuilder
47
50
 
48
51
  each<const V extends readonly any[]>(
49
52
  values: readonly V[],
50
- ): (name: string, func: (...values: V) => void) => TestBuilder<typeof func>
53
+ ): (name: string, func: (...values: MutableValues<V>) => void) => TestBuilder<typeof func>
51
54
  each<const T>(values: readonly T[]): (name: string, func: (value: T) => void) => TestBuilder<typeof func>
52
55
  }
53
56
 
@@ -68,7 +71,7 @@ declare namespace FactorioTest {
68
71
  interface DescribeBlockCreatorBase {
69
72
  (name: string, func: TestFn): void
70
73
 
71
- each<const V extends readonly any[]>(values: readonly V[]): (name: string, func: (...values: V) => void) => void
74
+ each<const V extends readonly any[]>(values: readonly V[]): (name: string, func: (...values: MutableValues<V>) => void) => void
72
75
  each<const T>(values: readonly T[]): (name: string, func: (value: T) => void) => void
73
76
  }
74
77
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "factorio-test",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Type definitions for using Factorio Test with TypescriptToLua",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/GlassBricks/FactorioTest",
@@ -8,7 +8,9 @@
8
8
  "index.d.ts"
9
9
  ],
10
10
  "peerDependencies": {
11
- "luassert-tstl": ">=0.2.3",
12
- "typed-factorio": "^1.14.0"
11
+ "typed-factorio": ">=1.14.0"
12
+ },
13
+ "optionalDependencies": {
14
+ "luassert-tstl": ">=0.2.3"
13
15
  }
14
16
  }