Skip to content

Commit 7526f9d

Browse files
committed
fix: update typings
1 parent 8771517 commit 7526f9d

File tree

5 files changed

+28
-26
lines changed

5 files changed

+28
-26
lines changed

src/__tests__/atemState.spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ test('Unit test: Atem State: Set State', function () {
44
const state = new AtemState()
55

66
const newObj = new StateObject()
7-
newObj.video.auxilliaries = [0, 0, 1]
7+
;(newObj.video.auxilliaries as number[]) = [0, 0, 1]
88
state.setState(newObj)
99

1010
expect(state.getState()).toMatchObject({ video: { auxilliaries: [0, 0, 1] } })
@@ -14,11 +14,11 @@ test('Unit test: Atem State: Diff State', function () {
1414
const state = new AtemState()
1515

1616
const newObj = new StateObject()
17-
newObj.video.auxilliaries = [0, 0, 1]
17+
;(newObj.video.auxilliaries as number[]) = [0, 0, 1]
1818
state.setState(newObj)
1919

2020
const newObj2 = new StateObject()
21-
newObj2.video.auxilliaries = [0, 0, 2]
21+
;(newObj2.video.auxilliaries as number[]) = [0, 0, 2]
2222
const commands = state.diffState(newObj2)
2323

2424
expect(commands).toHaveLength(1)

src/defaults.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export namespace Defaults {
168168
lightSourceDirection: 0,
169169
lightSourceAltitude: 0,
170170

171-
maskEnabled: false,
171+
// maskEnabled: false,
172172
maskTop: 0,
173173
maskBottom: 0,
174174
maskLeft: 0,

src/resolvers/__tests__/auxiliaries.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { State as StateObject } from '../../'
33
import { Commands, Enums } from 'atem-connection'
44

55
const STATE1 = new StateObject()
6-
STATE1.video.auxilliaries = [ 0, 0, 0, 2 ]
6+
;(STATE1.video.auxilliaries as number[]) = [ 0, 0, 0, 2 ]
77

88
const STATE2 = new StateObject()
9-
STATE2.video.auxilliaries = [ 1, 0, 2, 0 ]
9+
;(STATE2.video.auxilliaries as number[]) = [ 1, 0, 2, 0 ]
1010

1111
test('Unit: auxiliaries: same state gives no commands', function () {
1212
// same state gives no commands:

src/resolvers/__tests__/media.spec.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import * as media from '../media'
22
import { State as StateObject } from '../../'
33
import { Commands, Enums } from 'atem-connection'
4+
import { MediaPlayerState } from '../../../../tv-automation-atem-connection/dist/state/media';
45

56
const STATE1 = new StateObject()
6-
STATE1.media.players = [
7+
;(STATE1.media.players as MediaPlayerState[]) = [
78
{
89
playing: false,
910
loop: false,
@@ -24,7 +25,7 @@ STATE1.media.players = [
2425
}
2526
]
2627
const STATE2 = new StateObject()
27-
STATE2.media.players = [
28+
;(STATE2.media.players as MediaPlayerState[]) = [
2829
{
2930
playing: true,
3031
loop: false,

src/resolvers/__tests__/supersourceBox.spec.ts

+19-18
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,30 @@ import { jsonClone } from '../../util'
66

77
const STATE1 = new StateObject()
88
const SSRC1 = STATE1.video.getSuperSource(0)
9-
SSRC1.boxes = [ jsonClone(Defaults.Video.SuperSourceBox), jsonClone(Defaults.Video.SuperSourceBox), jsonClone(Defaults.Video.SuperSourceBox), jsonClone(Defaults.Video.SuperSourceBox) ]
9+
SSRC1.boxes[0] = jsonClone(Defaults.Video.SuperSourceBox)
10+
SSRC1.boxes[1] = jsonClone(Defaults.Video.SuperSourceBox)
11+
SSRC1.boxes[2] = jsonClone(Defaults.Video.SuperSourceBox)
12+
SSRC1.boxes[3] = jsonClone(Defaults.Video.SuperSourceBox)
1013
SSRC1.border = jsonClone(Defaults.Video.SuperSourceBorder)
1114
SSRC1.properties = jsonClone(Defaults.Video.SuperSourceProperties)
1215

1316
const STATE2 = new StateObject()
1417
const SSRC2 = STATE2.video.getSuperSource(0)
15-
SSRC2.boxes = [
16-
{
17-
enabled: true,
18-
source: 1,
19-
x: 1,
20-
y: 1,
21-
size: 1,
22-
cropped: true,
23-
cropTop: 1,
24-
cropBottom: 1,
25-
cropLeft: 1,
26-
cropRight: 1
27-
},
28-
jsonClone(Defaults.Video.SuperSourceBox),
29-
jsonClone(Defaults.Video.SuperSourceBox),
30-
jsonClone(Defaults.Video.SuperSourceBox)
31-
]
18+
SSRC2.boxes[0] = {
19+
enabled: true,
20+
source: 1,
21+
x: 1,
22+
y: 1,
23+
size: 1,
24+
cropped: true,
25+
cropTop: 1,
26+
cropBottom: 1,
27+
cropLeft: 1,
28+
cropRight: 1
29+
}
30+
SSRC2.boxes[1] = jsonClone(Defaults.Video.SuperSourceBox),
31+
SSRC2.boxes[2] = jsonClone(Defaults.Video.SuperSourceBox),
32+
SSRC2.boxes[3] = jsonClone(Defaults.Video.SuperSourceBox)
3233
SSRC2.border = jsonClone(Defaults.Video.SuperSourceBorder)
3334
SSRC2.properties = jsonClone(Defaults.Video.SuperSourceProperties)
3435

0 commit comments

Comments
 (0)