@asyra/system-context 0.2.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 (150) hide show
  1. package/.turbo/turbo-test$colon$ci.log +77 -0
  2. package/.turbo/turbo-test$colon$local.log +23 -0
  3. package/.turbo/turbo-test.log +359 -0
  4. package/README.md +1 -0
  5. package/coverage/base.css +224 -0
  6. package/coverage/block-navigation.js +87 -0
  7. package/coverage/clover.xml +345 -0
  8. package/coverage/coverage-final.json +5831 -0
  9. package/coverage/favicon.png +0 -0
  10. package/coverage/index.html +176 -0
  11. package/coverage/prettify.css +1 -0
  12. package/coverage/prettify.js +2 -0
  13. package/coverage/sort-arrow-sprite.png +0 -0
  14. package/coverage/sorter.js +196 -0
  15. package/coverage/src/apis/index.html +206 -0
  16. package/coverage/src/apis/index.ts.html +133 -0
  17. package/coverage/src/apis/key-state.ts.html +124 -0
  18. package/coverage/src/apis/mouse-state.ts.html +124 -0
  19. package/coverage/src/apis/primary-tool-state.ts.html +124 -0
  20. package/coverage/src/apis/root.ts.html +139 -0
  21. package/coverage/src/apis/system-state.ts.html +112 -0
  22. package/coverage/src/apis/target-state.ts.html +121 -0
  23. package/coverage/src/index.html +131 -0
  24. package/coverage/src/index.ts.html +97 -0
  25. package/coverage/src/states/index.html +191 -0
  26. package/coverage/src/states/index.ts.html +139 -0
  27. package/coverage/src/states/key-state.ts.html +148 -0
  28. package/coverage/src/states/mouse-state.ts.html +184 -0
  29. package/coverage/src/states/primary-tool-state.ts.html +130 -0
  30. package/coverage/src/states/system-state.ts.html +130 -0
  31. package/coverage/src/states/target-state.ts.html +154 -0
  32. package/coverage/src/subscribe/index.html +191 -0
  33. package/coverage/src/subscribe/index.ts.html +187 -0
  34. package/coverage/src/subscribe/key-state.ts.html +109 -0
  35. package/coverage/src/subscribe/mouse-state.ts.html +109 -0
  36. package/coverage/src/subscribe/primary-tool-state.ts.html +136 -0
  37. package/coverage/src/subscribe/system-state.ts.html +94 -0
  38. package/coverage/src/subscribe/target-state.ts.html +109 -0
  39. package/coverage/src/system-context.ts.html +247 -0
  40. package/coverage/src/types/deps.ts.html +145 -0
  41. package/coverage/src/types/index.html +221 -0
  42. package/coverage/src/types/index.ts.html +157 -0
  43. package/coverage/src/types/key-state.ts.html +118 -0
  44. package/coverage/src/types/mouse-state.ts.html +118 -0
  45. package/coverage/src/types/primary-tool-state.ts.html +121 -0
  46. package/coverage/src/types/root.ts.html +106 -0
  47. package/coverage/src/types/system-state.ts.html +106 -0
  48. package/coverage/src/types/target-state.ts.html +118 -0
  49. package/dist/__tests__/system-context.test.d.ts +1 -0
  50. package/dist/__tests__/system-context.test.js +63 -0
  51. package/dist/apis/index.d.ts +13 -0
  52. package/dist/apis/index.js +14 -0
  53. package/dist/apis/key-state.d.ts +2 -0
  54. package/dist/apis/key-state.js +8 -0
  55. package/dist/apis/mouse-state copy.d.ts +2 -0
  56. package/dist/apis/mouse-state copy.js +8 -0
  57. package/dist/apis/mouse-state.d.ts +2 -0
  58. package/dist/apis/mouse-state.js +8 -0
  59. package/dist/apis/primary-tool-state.d.ts +2 -0
  60. package/dist/apis/primary-tool-state.js +8 -0
  61. package/dist/apis/root.d.ts +2 -0
  62. package/dist/apis/root.js +15 -0
  63. package/dist/apis/system-state.d.ts +2 -0
  64. package/dist/apis/system-state.js +5 -0
  65. package/dist/apis/target-state.d.ts +2 -0
  66. package/dist/apis/target-state.js +8 -0
  67. package/dist/index.d.ts +3 -0
  68. package/dist/index.js +3 -0
  69. package/dist/states/index.d.ts +6 -0
  70. package/dist/states/index.js +6 -0
  71. package/dist/states/key-state.d.ts +9 -0
  72. package/dist/states/key-state.js +16 -0
  73. package/dist/states/mouse-state copy.d.ts +9 -0
  74. package/dist/states/mouse-state copy.js +28 -0
  75. package/dist/states/mouse-state.d.ts +9 -0
  76. package/dist/states/mouse-state.js +28 -0
  77. package/dist/states/primary-tool-state.d.ts +8 -0
  78. package/dist/states/primary-tool-state.js +11 -0
  79. package/dist/states/system-state.d.ts +8 -0
  80. package/dist/states/system-state.js +11 -0
  81. package/dist/states/target-state.d.ts +9 -0
  82. package/dist/states/target-state.js +17 -0
  83. package/dist/subscribe/index.d.ts +2 -0
  84. package/dist/subscribe/index.js +24 -0
  85. package/dist/subscribe/key-state.d.ts +2 -0
  86. package/dist/subscribe/key-state.js +6 -0
  87. package/dist/subscribe/mouse-state copy.d.ts +2 -0
  88. package/dist/subscribe/mouse-state copy.js +6 -0
  89. package/dist/subscribe/mouse-state.d.ts +2 -0
  90. package/dist/subscribe/mouse-state.js +6 -0
  91. package/dist/subscribe/primary-tool-state.d.ts +2 -0
  92. package/dist/subscribe/primary-tool-state.js +10 -0
  93. package/dist/subscribe/root.d.ts +2 -0
  94. package/dist/subscribe/root.js +7 -0
  95. package/dist/subscribe/system-state.d.ts +1 -0
  96. package/dist/subscribe/system-state.js +3 -0
  97. package/dist/subscribe/target-state.d.ts +2 -0
  98. package/dist/subscribe/target-state.js +6 -0
  99. package/dist/system-context.d.ts +17 -0
  100. package/dist/system-context.js +30 -0
  101. package/dist/types/deps.d.ts +12 -0
  102. package/dist/types/deps.js +1 -0
  103. package/dist/types/index.d.ts +9 -0
  104. package/dist/types/index.js +1 -0
  105. package/dist/types/key-state.d.ts +8 -0
  106. package/dist/types/key-state.js +1 -0
  107. package/dist/types/mouse-state copy.d.ts +8 -0
  108. package/dist/types/mouse-state copy.js +1 -0
  109. package/dist/types/mouse-state.d.ts +8 -0
  110. package/dist/types/mouse-state.js +1 -0
  111. package/dist/types/primary-tool-state.d.ts +8 -0
  112. package/dist/types/primary-tool-state.js +1 -0
  113. package/dist/types/root.d.ts +5 -0
  114. package/dist/types/root.js +1 -0
  115. package/dist/types/system-state.d.ts +5 -0
  116. package/dist/types/system-state.js +1 -0
  117. package/dist/types/target-state.d.ts +8 -0
  118. package/dist/types/target-state.js +1 -0
  119. package/package.json +28 -0
  120. package/src/__tests__/system-context.test.ts +79 -0
  121. package/src/apis/index.ts +16 -0
  122. package/src/apis/key-state.ts +13 -0
  123. package/src/apis/mouse-state.ts +13 -0
  124. package/src/apis/primary-tool-state.ts +13 -0
  125. package/src/apis/root.ts +18 -0
  126. package/src/apis/system-state.ts +9 -0
  127. package/src/apis/target-state.ts +12 -0
  128. package/src/index.ts +4 -0
  129. package/src/states/index.ts +18 -0
  130. package/src/states/key-state.ts +21 -0
  131. package/src/states/mouse-state.ts +33 -0
  132. package/src/states/primary-tool-state.ts +15 -0
  133. package/src/states/system-state.ts +15 -0
  134. package/src/states/target-state.ts +23 -0
  135. package/src/subscribe/index.ts +34 -0
  136. package/src/subscribe/key-state.ts +8 -0
  137. package/src/subscribe/mouse-state.ts +8 -0
  138. package/src/subscribe/primary-tool-state.ts +17 -0
  139. package/src/subscribe/system-state.ts +3 -0
  140. package/src/subscribe/target-state.ts +8 -0
  141. package/src/system-context.ts +54 -0
  142. package/src/types/deps.ts +20 -0
  143. package/src/types/index.ts +24 -0
  144. package/src/types/key-state.ts +11 -0
  145. package/src/types/mouse-state.ts +11 -0
  146. package/src/types/primary-tool-state.ts +12 -0
  147. package/src/types/root.ts +7 -0
  148. package/src/types/system-state.ts +7 -0
  149. package/src/types/target-state.ts +11 -0
  150. package/tsconfig.json +17 -0
@@ -0,0 +1,121 @@
1
+
2
+ <!doctype html>
3
+ <html lang="en">
4
+
5
+ <head>
6
+ <title>Code coverage report for src/types/primary-tool-state.ts</title>
7
+ <meta charset="utf-8" />
8
+ <link rel="stylesheet" href="../../prettify.css" />
9
+ <link rel="stylesheet" href="../../base.css" />
10
+ <link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
11
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
12
+ <style type='text/css'>
13
+ .coverage-summary .sorter {
14
+ background-image: url(../../sort-arrow-sprite.png);
15
+ }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <div class='wrapper'>
21
+ <div class='pad1'>
22
+ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/types</a> primary-tool-state.ts</h1>
23
+ <div class='clearfix'>
24
+
25
+ <div class='fl pad1y space-right2'>
26
+ <span class="strong">0% </span>
27
+ <span class="quiet">Statements</span>
28
+ <span class='fraction'>0/0</span>
29
+ </div>
30
+
31
+
32
+ <div class='fl pad1y space-right2'>
33
+ <span class="strong">0% </span>
34
+ <span class="quiet">Branches</span>
35
+ <span class='fraction'>1/1</span>
36
+ </div>
37
+
38
+
39
+ <div class='fl pad1y space-right2'>
40
+ <span class="strong">0% </span>
41
+ <span class="quiet">Functions</span>
42
+ <span class='fraction'>1/1</span>
43
+ </div>
44
+
45
+
46
+ <div class='fl pad1y space-right2'>
47
+ <span class="strong">0% </span>
48
+ <span class="quiet">Lines</span>
49
+ <span class='fraction'>0/0</span>
50
+ </div>
51
+
52
+
53
+ </div>
54
+ <p class="quiet">
55
+ Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
+ </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input type="search" id="fileSearch">
61
+ </div>
62
+ </template>
63
+ </div>
64
+ <div class='status-line low'></div>
65
+ <pre><table class="coverage">
66
+ <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
67
+ <a name='L2'></a><a href='#L2'>2</a>
68
+ <a name='L3'></a><a href='#L3'>3</a>
69
+ <a name='L4'></a><a href='#L4'>4</a>
70
+ <a name='L5'></a><a href='#L5'>5</a>
71
+ <a name='L6'></a><a href='#L6'>6</a>
72
+ <a name='L7'></a><a href='#L7'>7</a>
73
+ <a name='L8'></a><a href='#L8'>8</a>
74
+ <a name='L9'></a><a href='#L9'>9</a>
75
+ <a name='L10'></a><a href='#L10'>10</a>
76
+ <a name='L11'></a><a href='#L11'>11</a>
77
+ <a name='L12'></a><a href='#L12'>12</a>
78
+ <a name='L13'></a><a href='#L13'>13</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
79
+ <span class="cline-any cline-neutral">&nbsp;</span>
80
+ <span class="cline-any cline-neutral">&nbsp;</span>
81
+ <span class="cline-any cline-neutral">&nbsp;</span>
82
+ <span class="cline-any cline-neutral">&nbsp;</span>
83
+ <span class="cline-any cline-neutral">&nbsp;</span>
84
+ <span class="cline-any cline-neutral">&nbsp;</span>
85
+ <span class="cline-any cline-neutral">&nbsp;</span>
86
+ <span class="cline-any cline-neutral">&nbsp;</span>
87
+ <span class="cline-any cline-neutral">&nbsp;</span>
88
+ <span class="cline-any cline-neutral">&nbsp;</span>
89
+ <span class="cline-any cline-neutral">&nbsp;</span>
90
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { PrimaryToolType } from '@asyra/utils'
91
+ &nbsp;
92
+ export interface PrimaryToolStateRawAPIs {
93
+ getCurrentPrimaryTool: () =&gt; PrimaryToolType
94
+ }
95
+ &nbsp;
96
+ export interface PrimaryToolStateActionAPIs {
97
+ switchPrimaryTool: (tool: PrimaryToolType) =&gt; void
98
+ }
99
+ &nbsp;
100
+ export type PrimaryToolStateAPIs = PrimaryToolStateRawAPIs &amp;
101
+ PrimaryToolStateActionAPIs
102
+ &nbsp;</pre></td></tr></table></pre>
103
+
104
+ <div class='push'></div><!-- for sticky footer -->
105
+ </div><!-- /wrapper -->
106
+ <div class='footer quiet pad2 space-top1 center small'>
107
+ Code coverage generated by
108
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
109
+ at 2026-01-20T18:50:39.117Z
110
+ </div>
111
+ <script src="../../prettify.js"></script>
112
+ <script>
113
+ window.onload = function () {
114
+ prettyPrint();
115
+ };
116
+ </script>
117
+ <script src="../../sorter.js"></script>
118
+ <script src="../../block-navigation.js"></script>
119
+ </body>
120
+ </html>
121
+
@@ -0,0 +1,106 @@
1
+
2
+ <!doctype html>
3
+ <html lang="en">
4
+
5
+ <head>
6
+ <title>Code coverage report for src/types/root.ts</title>
7
+ <meta charset="utf-8" />
8
+ <link rel="stylesheet" href="../../prettify.css" />
9
+ <link rel="stylesheet" href="../../base.css" />
10
+ <link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
11
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
12
+ <style type='text/css'>
13
+ .coverage-summary .sorter {
14
+ background-image: url(../../sort-arrow-sprite.png);
15
+ }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <div class='wrapper'>
21
+ <div class='pad1'>
22
+ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/types</a> root.ts</h1>
23
+ <div class='clearfix'>
24
+
25
+ <div class='fl pad1y space-right2'>
26
+ <span class="strong">0% </span>
27
+ <span class="quiet">Statements</span>
28
+ <span class='fraction'>0/0</span>
29
+ </div>
30
+
31
+
32
+ <div class='fl pad1y space-right2'>
33
+ <span class="strong">0% </span>
34
+ <span class="quiet">Branches</span>
35
+ <span class='fraction'>1/1</span>
36
+ </div>
37
+
38
+
39
+ <div class='fl pad1y space-right2'>
40
+ <span class="strong">0% </span>
41
+ <span class="quiet">Functions</span>
42
+ <span class='fraction'>1/1</span>
43
+ </div>
44
+
45
+
46
+ <div class='fl pad1y space-right2'>
47
+ <span class="strong">0% </span>
48
+ <span class="quiet">Lines</span>
49
+ <span class='fraction'>0/0</span>
50
+ </div>
51
+
52
+
53
+ </div>
54
+ <p class="quiet">
55
+ Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
+ </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input type="search" id="fileSearch">
61
+ </div>
62
+ </template>
63
+ </div>
64
+ <div class='status-line low'></div>
65
+ <pre><table class="coverage">
66
+ <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
67
+ <a name='L2'></a><a href='#L2'>2</a>
68
+ <a name='L3'></a><a href='#L3'>3</a>
69
+ <a name='L4'></a><a href='#L4'>4</a>
70
+ <a name='L5'></a><a href='#L5'>5</a>
71
+ <a name='L6'></a><a href='#L6'>6</a>
72
+ <a name='L7'></a><a href='#L7'>7</a>
73
+ <a name='L8'></a><a href='#L8'>8</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
74
+ <span class="cline-any cline-neutral">&nbsp;</span>
75
+ <span class="cline-any cline-neutral">&nbsp;</span>
76
+ <span class="cline-any cline-neutral">&nbsp;</span>
77
+ <span class="cline-any cline-neutral">&nbsp;</span>
78
+ <span class="cline-any cline-neutral">&nbsp;</span>
79
+ <span class="cline-any cline-neutral">&nbsp;</span>
80
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { SystemContextSnapshot } from '@asyra/utils'
81
+ &nbsp;
82
+ export interface RootRawAPIs {
83
+ getSystemContextSnapshot: () =&gt; SystemContextSnapshot
84
+ }
85
+ &nbsp;
86
+ export type RootAPIs = RootRawAPIs
87
+ &nbsp;</pre></td></tr></table></pre>
88
+
89
+ <div class='push'></div><!-- for sticky footer -->
90
+ </div><!-- /wrapper -->
91
+ <div class='footer quiet pad2 space-top1 center small'>
92
+ Code coverage generated by
93
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
94
+ at 2026-01-20T18:50:39.117Z
95
+ </div>
96
+ <script src="../../prettify.js"></script>
97
+ <script>
98
+ window.onload = function () {
99
+ prettyPrint();
100
+ };
101
+ </script>
102
+ <script src="../../sorter.js"></script>
103
+ <script src="../../block-navigation.js"></script>
104
+ </body>
105
+ </html>
106
+
@@ -0,0 +1,106 @@
1
+
2
+ <!doctype html>
3
+ <html lang="en">
4
+
5
+ <head>
6
+ <title>Code coverage report for src/types/system-state.ts</title>
7
+ <meta charset="utf-8" />
8
+ <link rel="stylesheet" href="../../prettify.css" />
9
+ <link rel="stylesheet" href="../../base.css" />
10
+ <link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
11
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
12
+ <style type='text/css'>
13
+ .coverage-summary .sorter {
14
+ background-image: url(../../sort-arrow-sprite.png);
15
+ }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <div class='wrapper'>
21
+ <div class='pad1'>
22
+ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/types</a> system-state.ts</h1>
23
+ <div class='clearfix'>
24
+
25
+ <div class='fl pad1y space-right2'>
26
+ <span class="strong">0% </span>
27
+ <span class="quiet">Statements</span>
28
+ <span class='fraction'>0/0</span>
29
+ </div>
30
+
31
+
32
+ <div class='fl pad1y space-right2'>
33
+ <span class="strong">0% </span>
34
+ <span class="quiet">Branches</span>
35
+ <span class='fraction'>1/1</span>
36
+ </div>
37
+
38
+
39
+ <div class='fl pad1y space-right2'>
40
+ <span class="strong">0% </span>
41
+ <span class="quiet">Functions</span>
42
+ <span class='fraction'>1/1</span>
43
+ </div>
44
+
45
+
46
+ <div class='fl pad1y space-right2'>
47
+ <span class="strong">0% </span>
48
+ <span class="quiet">Lines</span>
49
+ <span class='fraction'>0/0</span>
50
+ </div>
51
+
52
+
53
+ </div>
54
+ <p class="quiet">
55
+ Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
+ </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input type="search" id="fileSearch">
61
+ </div>
62
+ </template>
63
+ </div>
64
+ <div class='status-line low'></div>
65
+ <pre><table class="coverage">
66
+ <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
67
+ <a name='L2'></a><a href='#L2'>2</a>
68
+ <a name='L3'></a><a href='#L3'>3</a>
69
+ <a name='L4'></a><a href='#L4'>4</a>
70
+ <a name='L5'></a><a href='#L5'>5</a>
71
+ <a name='L6'></a><a href='#L6'>6</a>
72
+ <a name='L7'></a><a href='#L7'>7</a>
73
+ <a name='L8'></a><a href='#L8'>8</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
74
+ <span class="cline-any cline-neutral">&nbsp;</span>
75
+ <span class="cline-any cline-neutral">&nbsp;</span>
76
+ <span class="cline-any cline-neutral">&nbsp;</span>
77
+ <span class="cline-any cline-neutral">&nbsp;</span>
78
+ <span class="cline-any cline-neutral">&nbsp;</span>
79
+ <span class="cline-any cline-neutral">&nbsp;</span>
80
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { SystemMode } from '@asyra/utils'
81
+ &nbsp;
82
+ export interface SystemStateRawAPIs {
83
+ getSystemMode: () =&gt; SystemMode
84
+ }
85
+ &nbsp;
86
+ export type SystemStateAPIs = SystemStateRawAPIs
87
+ &nbsp;</pre></td></tr></table></pre>
88
+
89
+ <div class='push'></div><!-- for sticky footer -->
90
+ </div><!-- /wrapper -->
91
+ <div class='footer quiet pad2 space-top1 center small'>
92
+ Code coverage generated by
93
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
94
+ at 2026-01-20T18:50:39.117Z
95
+ </div>
96
+ <script src="../../prettify.js"></script>
97
+ <script>
98
+ window.onload = function () {
99
+ prettyPrint();
100
+ };
101
+ </script>
102
+ <script src="../../sorter.js"></script>
103
+ <script src="../../block-navigation.js"></script>
104
+ </body>
105
+ </html>
106
+
@@ -0,0 +1,118 @@
1
+
2
+ <!doctype html>
3
+ <html lang="en">
4
+
5
+ <head>
6
+ <title>Code coverage report for src/types/target-state.ts</title>
7
+ <meta charset="utf-8" />
8
+ <link rel="stylesheet" href="../../prettify.css" />
9
+ <link rel="stylesheet" href="../../base.css" />
10
+ <link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
11
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
12
+ <style type='text/css'>
13
+ .coverage-summary .sorter {
14
+ background-image: url(../../sort-arrow-sprite.png);
15
+ }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <div class='wrapper'>
21
+ <div class='pad1'>
22
+ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/types</a> target-state.ts</h1>
23
+ <div class='clearfix'>
24
+
25
+ <div class='fl pad1y space-right2'>
26
+ <span class="strong">0% </span>
27
+ <span class="quiet">Statements</span>
28
+ <span class='fraction'>0/0</span>
29
+ </div>
30
+
31
+
32
+ <div class='fl pad1y space-right2'>
33
+ <span class="strong">0% </span>
34
+ <span class="quiet">Branches</span>
35
+ <span class='fraction'>1/1</span>
36
+ </div>
37
+
38
+
39
+ <div class='fl pad1y space-right2'>
40
+ <span class="strong">0% </span>
41
+ <span class="quiet">Functions</span>
42
+ <span class='fraction'>1/1</span>
43
+ </div>
44
+
45
+
46
+ <div class='fl pad1y space-right2'>
47
+ <span class="strong">0% </span>
48
+ <span class="quiet">Lines</span>
49
+ <span class='fraction'>0/0</span>
50
+ </div>
51
+
52
+
53
+ </div>
54
+ <p class="quiet">
55
+ Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
+ </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input type="search" id="fileSearch">
61
+ </div>
62
+ </template>
63
+ </div>
64
+ <div class='status-line low'></div>
65
+ <pre><table class="coverage">
66
+ <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
67
+ <a name='L2'></a><a href='#L2'>2</a>
68
+ <a name='L3'></a><a href='#L3'>3</a>
69
+ <a name='L4'></a><a href='#L4'>4</a>
70
+ <a name='L5'></a><a href='#L5'>5</a>
71
+ <a name='L6'></a><a href='#L6'>6</a>
72
+ <a name='L7'></a><a href='#L7'>7</a>
73
+ <a name='L8'></a><a href='#L8'>8</a>
74
+ <a name='L9'></a><a href='#L9'>9</a>
75
+ <a name='L10'></a><a href='#L10'>10</a>
76
+ <a name='L11'></a><a href='#L11'>11</a>
77
+ <a name='L12'></a><a href='#L12'>12</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
78
+ <span class="cline-any cline-neutral">&nbsp;</span>
79
+ <span class="cline-any cline-neutral">&nbsp;</span>
80
+ <span class="cline-any cline-neutral">&nbsp;</span>
81
+ <span class="cline-any cline-neutral">&nbsp;</span>
82
+ <span class="cline-any cline-neutral">&nbsp;</span>
83
+ <span class="cline-any cline-neutral">&nbsp;</span>
84
+ <span class="cline-any cline-neutral">&nbsp;</span>
85
+ <span class="cline-any cline-neutral">&nbsp;</span>
86
+ <span class="cline-any cline-neutral">&nbsp;</span>
87
+ <span class="cline-any cline-neutral">&nbsp;</span>
88
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { TargetSnapshot } from '@asyra/utils'
89
+ &nbsp;
90
+ export interface TargetStateRawAPIs {
91
+ getTargetState: () =&gt; TargetSnapshot
92
+ }
93
+ &nbsp;
94
+ export interface TargetStateActionAPIs {
95
+ updateHoveredElementId: (elementId: string | null) =&gt; void
96
+ }
97
+ &nbsp;
98
+ export type TargetStateAPIs = TargetStateActionAPIs &amp; TargetStateRawAPIs
99
+ &nbsp;</pre></td></tr></table></pre>
100
+
101
+ <div class='push'></div><!-- for sticky footer -->
102
+ </div><!-- /wrapper -->
103
+ <div class='footer quiet pad2 space-top1 center small'>
104
+ Code coverage generated by
105
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
106
+ at 2026-01-20T18:50:39.117Z
107
+ </div>
108
+ <script src="../../prettify.js"></script>
109
+ <script>
110
+ window.onload = function () {
111
+ prettyPrint();
112
+ };
113
+ </script>
114
+ <script src="../../sorter.js"></script>
115
+ <script src="../../block-navigation.js"></script>
116
+ </body>
117
+ </html>
118
+
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,63 @@
1
+ import { describe, it, expect, beforeEach } from 'vitest';
2
+ import { SystemContext } from '../system-context';
3
+ import { KeyState } from '../states/key-state';
4
+ import { MouseState } from '../states/mouse-state';
5
+ import { PrimaryToolState } from '../states/primary-tool-state';
6
+ import { SystemState } from '../states/system-state';
7
+ import { TargetState } from '../states/target-state';
8
+ import { DefaultKeySnapshot, DefaultPosition, MouseButton, PrimaryToolType } from '@asyra/utils';
9
+ describe('SystemContext', () => {
10
+ let systemContext;
11
+ let keyState;
12
+ let mouseState;
13
+ let primaryToolState;
14
+ let systemState;
15
+ let targetState;
16
+ beforeEach(() => {
17
+ keyState = new KeyState();
18
+ mouseState = new MouseState();
19
+ primaryToolState = new PrimaryToolState();
20
+ systemState = new SystemState();
21
+ targetState = new TargetState();
22
+ systemContext = new SystemContext({
23
+ keyState,
24
+ mouseState,
25
+ primaryToolState,
26
+ systemState,
27
+ targetState
28
+ });
29
+ });
30
+ it('should initialize with the correct default state', () => {
31
+ expect(systemContext.getKeyState()).toEqual(DefaultKeySnapshot);
32
+ expect(systemContext.getMouseState()).toEqual({
33
+ dragStart: DefaultPosition,
34
+ position: DefaultPosition,
35
+ delta: DefaultPosition,
36
+ button: MouseButton.NONE,
37
+ down: false,
38
+ dragging: false
39
+ });
40
+ expect(systemContext.getCurrentPrimaryTool()).toEqual(PrimaryToolType.SELECT);
41
+ });
42
+ it('should update mouse state correctly', () => {
43
+ const newMouseSnapshot = {
44
+ position: { x: 100, y: 200 },
45
+ delta: { x: 1, y: 1 },
46
+ button: MouseButton.LEFT,
47
+ down: true,
48
+ dragging: true,
49
+ dragStart: { x: 99, y: 199 }
50
+ };
51
+ systemContext.updateMouseState(newMouseSnapshot);
52
+ expect(systemContext.getMouseState()).toEqual(newMouseSnapshot);
53
+ });
54
+ it('should update tool state correctly', () => {
55
+ systemContext.switchPrimaryTool(PrimaryToolType.RECTANGLE);
56
+ expect(systemContext.getCurrentPrimaryTool()).toEqual(PrimaryToolType.RECTANGLE);
57
+ });
58
+ it('should update key state correctly', () => {
59
+ const newKeySnapshot = { ...DefaultKeySnapshot, shift: true };
60
+ systemContext.updateKeyState(newKeySnapshot);
61
+ expect(systemContext.getKeyState()).toEqual(newKeySnapshot);
62
+ });
63
+ });
@@ -0,0 +1,13 @@
1
+ import { HandlerDeps } from '../types';
2
+ export declare const createAllAPIs: (deps: HandlerDeps) => {
3
+ updateHoveredElementId: (elementId: string | null) => void;
4
+ getTargetState: () => import("@asyra/utils").TargetSnapshot;
5
+ updateKeyState: (keySnapshot: import("@asyra/utils").KeySnapshot) => void;
6
+ getKeyState: () => import("@asyra/utils").KeySnapshot;
7
+ getSystemMode: () => import("@asyra/utils").SystemMode;
8
+ updateMouseState: (mouseSnapshot: import("@asyra/utils").MouseSnapshot) => void;
9
+ getMouseState: () => import("@asyra/utils").MouseSnapshot;
10
+ getCurrentPrimaryTool: () => import("@asyra/utils").PrimaryToolType;
11
+ switchPrimaryTool: (tool: import("@asyra/utils").PrimaryToolType) => void;
12
+ getSystemContextSnapshot: () => import("@asyra/utils").SystemContextSnapshot;
13
+ };
@@ -0,0 +1,14 @@
1
+ import { createRootAPIs } from './root';
2
+ import { createMouseStateAPIs } from './mouse-state';
3
+ import { createPrimaryToolStateAPIs } from './primary-tool-state';
4
+ import { createSystemAPIs } from './system-state';
5
+ import { createKeyStateAPIs } from './key-state';
6
+ import { createTargetStateAPIs } from './target-state';
7
+ export const createAllAPIs = (deps) => ({
8
+ ...createRootAPIs(deps),
9
+ ...createPrimaryToolStateAPIs(deps.primaryToolState),
10
+ ...createMouseStateAPIs(deps.mouseState),
11
+ ...createSystemAPIs(deps.systemState),
12
+ ...createKeyStateAPIs(deps.keyState),
13
+ ...createTargetStateAPIs(deps.targetState)
14
+ });
@@ -0,0 +1,2 @@
1
+ import { HandlerDeps, KeyStateAPIs } from '../types';
2
+ export declare const createKeyStateAPIs: (keyState: HandlerDeps["keyState"]) => KeyStateAPIs;
@@ -0,0 +1,8 @@
1
+ export const createKeyStateAPIs = (keyState) => ({
2
+ updateKeyState(keySnapshot) {
3
+ keyState.set(keySnapshot);
4
+ },
5
+ getKeyState() {
6
+ return keyState.current;
7
+ }
8
+ });
@@ -0,0 +1,2 @@
1
+ import { HandlerDeps, MouseStateAPIs } from '../types';
2
+ export declare const createMouseStateAPIs: (mouseState: HandlerDeps["mouseState"]) => MouseStateAPIs;
@@ -0,0 +1,8 @@
1
+ export const createMouseStateAPIs = (mouseState) => ({
2
+ updateMouseState(mouseSnapshot) {
3
+ mouseState.set(mouseSnapshot);
4
+ },
5
+ getMouseState() {
6
+ return mouseState.current;
7
+ }
8
+ });
@@ -0,0 +1,2 @@
1
+ import { HandlerDeps, MouseStateAPIs } from '../types';
2
+ export declare const createMouseStateAPIs: (mouseState: HandlerDeps["mouseState"]) => MouseStateAPIs;
@@ -0,0 +1,8 @@
1
+ export const createMouseStateAPIs = (mouseState) => ({
2
+ updateMouseState(mouseSnapshot) {
3
+ mouseState.set(mouseSnapshot);
4
+ },
5
+ getMouseState() {
6
+ return mouseState.current;
7
+ }
8
+ });
@@ -0,0 +1,2 @@
1
+ import { HandlerDeps, PrimaryToolStateAPIs } from '../types';
2
+ export declare const createPrimaryToolStateAPIs: (primaryToolState: HandlerDeps["primaryToolState"]) => PrimaryToolStateAPIs;
@@ -0,0 +1,8 @@
1
+ export const createPrimaryToolStateAPIs = (primaryToolState) => ({
2
+ getCurrentPrimaryTool() {
3
+ return primaryToolState.current;
4
+ },
5
+ switchPrimaryTool(tool) {
6
+ primaryToolState.set(tool);
7
+ }
8
+ });
@@ -0,0 +1,2 @@
1
+ import { HandlerDeps, RootAPIs } from '../types';
2
+ export declare const createRootAPIs: (deps: HandlerDeps) => RootAPIs;
@@ -0,0 +1,15 @@
1
+ export const createRootAPIs = (deps) => ({
2
+ getSystemContextSnapshot() {
3
+ return {
4
+ primaryTool: deps.primaryToolState.current,
5
+ mouse: deps.mouseState.current,
6
+ system: {
7
+ mode: deps.systemState.mode,
8
+ featureFlags: {},
9
+ permissions: {}
10
+ },
11
+ key: deps.keyState.current,
12
+ target: deps.targetState.current
13
+ };
14
+ }
15
+ });
@@ -0,0 +1,2 @@
1
+ import { HandlerDeps, SystemStateAPIs } from '../types';
2
+ export declare const createSystemAPIs: (systemState: HandlerDeps["systemState"]) => SystemStateAPIs;
@@ -0,0 +1,5 @@
1
+ export const createSystemAPIs = (systemState) => ({
2
+ getSystemMode() {
3
+ return systemState.mode;
4
+ }
5
+ });
@@ -0,0 +1,2 @@
1
+ import { HandlerDeps, TargetStateAPIs } from '../types';
2
+ export declare const createTargetStateAPIs: (targetState: HandlerDeps["targetState"]) => TargetStateAPIs;
@@ -0,0 +1,8 @@
1
+ export const createTargetStateAPIs = (targetState) => ({
2
+ updateHoveredElementId(elementId) {
3
+ targetState.updateHoveredElementId(elementId);
4
+ },
5
+ getTargetState() {
6
+ return targetState.current;
7
+ }
8
+ });