1
- // need to Fix something in ember-statechart-component
2
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3
- // @ts-nocheck
4
1
import { assert } from ' @ember/debug' ;
5
- import { fn , hash } from ' @ember/helper' ;
2
+ import { fn } from ' @ember/helper' ;
6
3
7
4
import { modifier } from ' ember-modifier' ;
8
5
@@ -14,12 +11,16 @@ import { ResizeHandle } from './resize-handle';
14
11
import { isHorizontalSplit , LayoutState , setupResizeObserver } from ' ./state' ;
15
12
16
13
import type { TOC } from ' @ember/component/template-only' ;
14
+ import type { ReactiveActorFrom } from ' ember-statechart-component' ;
15
+
16
+ type ReactiveActor = ReactiveActorFrom <typeof LayoutState >;
17
17
18
18
const setupState = modifier ((element : Element , [send ]: [(event : string ) => void ]) => {
19
19
assert (` Element is not resizable ` , element instanceof HTMLElement );
20
20
21
21
let observer = setupResizeObserver (() => send (' RESIZE' ));
22
22
23
+ // @ts-expect-error need to fix the type of this for ember-statechart-component
23
24
send ({
24
25
type: ' CONTAINER_FOUND' ,
25
26
container: element ,
@@ -37,15 +38,15 @@ const effect = (fn: (...args: unknown[]) => void) => {
37
38
fn ();
38
39
};
39
40
40
- const isResizable = (state ) => {
41
+ const isResizable = (state : ReactiveActor ) => {
41
42
return ! (state .matches (' hasContainer.minimized' ) || state .matches (' hasContainer.maximized' ));
42
43
};
43
44
44
45
/**
45
46
* true for horizontally split
46
47
* false for vertically split
47
48
*/
48
- const containerDirection = (state ) => {
49
+ const containerDirection = (state : ReactiveActor ) => {
49
50
if (state .matches (' hasContainer.default.horizontallySplit' )) {
50
51
return true ;
51
52
}
0 commit comments