@neurodevs/node-tdd 1.0.6 → 1.0.7
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.
- package/package.json +1 -1
- package/.nvmrc +0 -1
- package/.vscode/launch.json +0 -53
- package/.vscode/settings.json +0 -62
- package/.vscode/tasks.json +0 -99
- package/build/__tests__/MockFetch.d.ts +0 -18
- package/build/__tests__/MockFetch.js +0 -55
- package/build/__tests__/MockFetch.js.map +0 -1
- package/build/__tests__/behavioral/AbstractModuleTest.test.d.ts +0 -5
- package/build/__tests__/behavioral/AbstractModuleTest.test.js +0 -22
- package/build/__tests__/behavioral/AbstractModuleTest.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/AllHooksCalledEvenIfNotDefined.test.d.ts +0 -5
- package/build/__tests__/behavioral/utilities/AllHooksCalledEvenIfNotDefined.test.js +0 -34
- package/build/__tests__/behavioral/utilities/AllHooksCalledEvenIfNotDefined.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/Assert.test.d.ts +0 -45
- package/build/__tests__/behavioral/utilities/Assert.test.js +0 -645
- package/build/__tests__/behavioral/utilities/Assert.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/InstanceParentTestCanAccessParentMethods.test.d.ts +0 -4
- package/build/__tests__/behavioral/utilities/InstanceParentTestCanAccessParentMethods.test.js +0 -23
- package/build/__tests__/behavioral/utilities/InstanceParentTestCanAccessParentMethods.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/MockFetch.test.d.ts +0 -28
- package/build/__tests__/behavioral/utilities/MockFetch.test.js +0 -211
- package/build/__tests__/behavioral/utilities/MockFetch.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/StackCleaner.test.d.ts +0 -4
- package/build/__tests__/behavioral/utilities/StackCleaner.test.js +0 -46
- package/build/__tests__/behavioral/utilities/StackCleaner.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/StaticParentTestCanAccessParentMethods.test.d.ts +0 -7
- package/build/__tests__/behavioral/utilities/StaticParentTestCanAccessParentMethods.test.js +0 -32
- package/build/__tests__/behavioral/utilities/StaticParentTestCanAccessParentMethods.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/StaticTestInheritsAbstractSpruceTestProperly.test.d.ts +0 -4
- package/build/__tests__/behavioral/utilities/StaticTestInheritsAbstractSpruceTestProperly.test.js +0 -19
- package/build/__tests__/behavioral/utilities/StaticTestInheritsAbstractSpruceTestProperly.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/Stringify.test.d.ts +0 -5
- package/build/__tests__/behavioral/utilities/Stringify.test.js +0 -127
- package/build/__tests__/behavioral/utilities/Stringify.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/TestDecoratorResolver.test.d.ts +0 -7
- package/build/__tests__/behavioral/utilities/TestDecoratorResolver.test.js +0 -38
- package/build/__tests__/behavioral/utilities/TestDecoratorResolver.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/TestOnBasic.test.d.ts +0 -12
- package/build/__tests__/behavioral/utilities/TestOnBasic.test.js +0 -68
- package/build/__tests__/behavioral/utilities/TestOnBasic.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/TestOnInstance.test.d.ts +0 -28
- package/build/__tests__/behavioral/utilities/TestOnInstance.test.js +0 -289
- package/build/__tests__/behavioral/utilities/TestOnInstance.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTest.test.d.ts +0 -9
- package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTest.test.js +0 -118
- package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTest.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTestWithHooks.test.d.ts +0 -5
- package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTestWithHooks.test.js +0 -78
- package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTestWithHooks.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/TestOnInstanceWithParentBeforeAll.test.d.ts +0 -4
- package/build/__tests__/behavioral/utilities/TestOnInstanceWithParentBeforeAll.test.js +0 -23
- package/build/__tests__/behavioral/utilities/TestOnInstanceWithParentBeforeAll.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/TestOnInstanceWithTwoLevelsOfInheritence.test.d.ts +0 -4
- package/build/__tests__/behavioral/utilities/TestOnInstanceWithTwoLevelsOfInheritence.test.js +0 -24
- package/build/__tests__/behavioral/utilities/TestOnInstanceWithTwoLevelsOfInheritence.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/TestResolver.test.d.ts +0 -7
- package/build/__tests__/behavioral/utilities/TestResolver.test.js +0 -38
- package/build/__tests__/behavioral/utilities/TestResolver.test.js.map +0 -1
- package/build/__tests__/behavioral/utilities/TestResolverOnStatic.test.d.ts +0 -4
- package/build/__tests__/behavioral/utilities/TestResolverOnStatic.test.js +0 -20
- package/build/__tests__/behavioral/utilities/TestResolverOnStatic.test.js.map +0 -1
- package/build/__tests__/behavioral/workspace/JestJsonParser.test.d.ts +0 -18
- package/build/__tests__/behavioral/workspace/JestJsonParser.test.js +0 -267
- package/build/__tests__/behavioral/workspace/JestJsonParser.test.js.map +0 -1
- package/build/__tests__/behavioral/workspace/TestReporter.test.d.ts +0 -27
- package/build/__tests__/behavioral/workspace/TestReporter.test.js +0 -508
- package/build/__tests__/behavioral/workspace/TestReporter.test.js.map +0 -1
- package/build/__tests__/behavioral/workspace/TestRunner.test.d.ts +0 -15
- package/build/__tests__/behavioral/workspace/TestRunner.test.js +0 -99
- package/build/__tests__/behavioral/workspace/TestRunner.test.js.map +0 -1
- package/build/__tests__/behavioral/workspace/Widgets.test.d.ts +0 -16
- package/build/__tests__/behavioral/workspace/Widgets.test.js +0 -134
- package/build/__tests__/behavioral/workspace/Widgets.test.js.map +0 -1
- package/build/__tests__/mock-terminal-kit.d.ts +0 -79
- package/build/__tests__/mock-terminal-kit.js +0 -103
- package/build/__tests__/mock-terminal-kit.js.map +0 -1
- package/build/__tests__/support/AbstractForInstanceTest.d.ts +0 -4
- package/build/__tests__/support/AbstractForInstanceTest.js +0 -9
- package/build/__tests__/support/AbstractForInstanceTest.js.map +0 -1
- package/build/__tests__/support/AbstractLevelOneTest.d.ts +0 -3
- package/build/__tests__/support/AbstractLevelOneTest.js +0 -4
- package/build/__tests__/support/AbstractLevelOneTest.js.map +0 -1
- package/build/__tests__/support/AbstractLevelTwoTest.d.ts +0 -7
- package/build/__tests__/support/AbstractLevelTwoTest.js +0 -14
- package/build/__tests__/support/AbstractLevelTwoTest.js.map +0 -1
- package/build/__tests__/support/AbstractStaticTest.d.ts +0 -7
- package/build/__tests__/support/AbstractStaticTest.js +0 -14
- package/build/__tests__/support/AbstractStaticTest.js.map +0 -1
- package/build/__tests__/support/AbstractTestOnInstanceTest.d.ts +0 -22
- package/build/__tests__/support/AbstractTestOnInstanceTest.js +0 -23
- package/build/__tests__/support/AbstractTestOnInstanceTest.js.map +0 -1
- package/build/__tests__/support/AbstractTestOnInstanceWithHooks.d.ts +0 -26
- package/build/__tests__/support/AbstractTestOnInstanceWithHooks.js +0 -59
- package/build/__tests__/support/AbstractTestOnInstanceWithHooks.js.map +0 -1
- package/build/__tests__/support/jest.setup.d.ts +0 -1
- package/build/__tests__/support/jest.setup.js +0 -4
- package/build/__tests__/support/jest.setup.js.map +0 -1
- package/build/__tests__/support/onTestFileResult.d.ts +0 -244
- package/build/__tests__/support/onTestFileResult.js +0 -980
- package/build/__tests__/support/onTestFileResult.js.map +0 -1
- package/eslint.config.js +0 -3
- package/prettier.config.js +0 -3
- package/src/.spruce/settings.json +0 -4
- package/src/__tests__/MockFetch.ts +0 -100
- package/src/__tests__/behavioral/AbstractModuleTest.test.ts +0 -15
- package/src/__tests__/behavioral/utilities/AllHooksCalledEvenIfNotDefined.test.ts +0 -31
- package/src/__tests__/behavioral/utilities/Assert.test.ts +0 -826
- package/src/__tests__/behavioral/utilities/InstanceParentTestCanAccessParentMethods.test.ts +0 -14
- package/src/__tests__/behavioral/utilities/MockFetch.test.ts +0 -240
- package/src/__tests__/behavioral/utilities/StackCleaner.test.ts +0 -46
- package/src/__tests__/behavioral/utilities/StaticParentTestCanAccessParentMethods.test.ts +0 -34
- package/src/__tests__/behavioral/utilities/StaticTestInheritsAbstractSpruceTestProperly.test.ts +0 -11
- package/src/__tests__/behavioral/utilities/Stringify.test.ts +0 -169
- package/src/__tests__/behavioral/utilities/TestDecoratorResolver.test.ts +0 -51
- package/src/__tests__/behavioral/utilities/TestOnBasic.test.ts +0 -62
- package/src/__tests__/behavioral/utilities/TestOnInstance.test.ts +0 -439
- package/src/__tests__/behavioral/utilities/TestOnInstanceExtendsTest.test.ts +0 -237
- package/src/__tests__/behavioral/utilities/TestOnInstanceExtendsTestWithHooks.test.ts +0 -85
- package/src/__tests__/behavioral/utilities/TestOnInstanceWithParentBeforeAll.test.ts +0 -14
- package/src/__tests__/behavioral/utilities/TestOnInstanceWithTwoLevelsOfInheritence.test.ts +0 -16
- package/src/__tests__/behavioral/utilities/TestResolver.test.ts +0 -48
- package/src/__tests__/behavioral/utilities/TestResolverOnStatic.test.ts +0 -12
- package/src/__tests__/behavioral/workspace/JestJsonParser.test.ts +0 -357
- package/src/__tests__/behavioral/workspace/TestReporter.test.ts +0 -584
- package/src/__tests__/behavioral/workspace/TestRunner.test.ts +0 -87
- package/src/__tests__/behavioral/workspace/Widgets.test.ts +0 -131
- package/src/__tests__/mock-terminal-kit.ts +0 -115
- package/src/__tests__/support/AbstractForInstanceTest.ts +0 -12
- package/src/__tests__/support/AbstractLevelOneTest.ts +0 -3
- package/src/__tests__/support/AbstractLevelTwoTest.ts +0 -16
- package/src/__tests__/support/AbstractStaticTest.ts +0 -16
- package/src/__tests__/support/AbstractTestOnInstanceTest.ts +0 -30
- package/src/__tests__/support/AbstractTestOnInstanceWithHooks.ts +0 -138
- package/src/__tests__/support/jest.setup.ts +0 -2
- package/src/__tests__/support/onTestFileResult.ts +0 -1008
- package/src/impl/AbstractModuleTest.ts +0 -67
- package/src/index.ts +0 -12
- package/src/utilities/AssertionError.ts +0 -14
- package/src/utilities/StackCleaner.ts +0 -14
- package/src/utilities/TestDecoratorResolver.ts +0 -118
- package/src/utilities/assert.ts +0 -583
- package/src/utilities/assert.utility.ts +0 -295
- package/src/utilities/decorators.ts +0 -167
- package/src/workspace/CommandService.ts +0 -256
- package/src/workspace/JestJsonParser.ts +0 -255
- package/src/workspace/TKButtonWidget.ts +0 -54
- package/src/workspace/TestLogItemGenerator.ts +0 -184
- package/src/workspace/TestReporter.ts +0 -880
- package/src/workspace/TestRunner.ts +0 -128
- package/src/workspace/TkBaseWidget.ts +0 -249
- package/src/workspace/TkInputWidget.ts +0 -83
- package/src/workspace/TkLayoutCellWidget.ts +0 -46
- package/src/workspace/TkLayoutWidget.ts +0 -181
- package/src/workspace/TkMenuBarWidget.ts +0 -95
- package/src/workspace/TkPopupWidget.ts +0 -47
- package/src/workspace/TkProgressBarWidget.ts +0 -54
- package/src/workspace/TkTextWidget.ts +0 -167
- package/src/workspace/TkWindowWidget.ts +0 -122
- package/src/workspace/WidgetFactory.ts +0 -33
- package/src/workspace/button.types.ts +0 -19
- package/src/workspace/duration.utility.ts +0 -34
- package/src/workspace/factory.types.ts +0 -101
- package/src/workspace/input.types.ts +0 -22
- package/src/workspace/keySelectChoices.ts +0 -134
- package/src/workspace/layout.types.ts +0 -40
- package/src/workspace/menuBar.types.ts +0 -24
- package/src/workspace/popup.types.ts +0 -17
- package/src/workspace/progressBar.types.ts +0 -13
- package/src/workspace/table.types.ts +0 -9
- package/src/workspace/termKit.utility.ts +0 -130
- package/src/workspace/terminal-kit.d.ts +0 -28
- package/src/workspace/test.types.ts +0 -34
- package/src/workspace/testRunner.cli.ts +0 -166
- package/src/workspace/text.types.ts +0 -27
- package/src/workspace/widget.utilities.ts +0 -35
- package/src/workspace/widgets.types.ts +0 -102
- package/src/workspace/window.types.ts +0 -22
- package/tsconfig.json +0 -24
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
type KeySelectChoices = [
|
|
2
|
-
{ label: 'ESCAPE'; value: 'ESCAPE' },
|
|
3
|
-
{ label: 'SPACE'; value: ' ' },
|
|
4
|
-
{ label: 'TAB'; value: 'TAB' },
|
|
5
|
-
{ label: 'ENTER'; value: 'ENTER' },
|
|
6
|
-
{ label: 'SHIFT_TAB'; value: 'SHIFT_TAB' },
|
|
7
|
-
{ label: 'ALT_TAB'; value: 'ALT_TAB' },
|
|
8
|
-
{ label: 'ALT_ENTER'; value: 'ALT_ENTER' },
|
|
9
|
-
{ label: 'UP'; value: 'UP' },
|
|
10
|
-
{ label: 'DOWN'; value: 'DOWN' },
|
|
11
|
-
{ label: 'RIGHT'; value: 'RIGHT' },
|
|
12
|
-
{ label: 'LEFT'; value: 'LEFT' },
|
|
13
|
-
{ label: 'SHIFT_UP'; value: 'SHIFT_UP' },
|
|
14
|
-
{ label: 'SHIFT_DOWN'; value: 'SHIFT_DOWN' },
|
|
15
|
-
{ label: 'SHIFT_RIGHT'; value: 'SHIFT_RIGHT' },
|
|
16
|
-
{ label: 'SHIFT_LEFT'; value: 'SHIFT_LEFT' },
|
|
17
|
-
{ label: 'ALT_UP'; value: 'ALT_UP' },
|
|
18
|
-
{ label: 'ALT_DOWN'; value: 'ALT_DOWN' },
|
|
19
|
-
{ label: 'ALT_RIGHT'; value: 'ALT_RIGHT' },
|
|
20
|
-
{ label: 'ALT_LEFT'; value: 'ALT_LEFT' },
|
|
21
|
-
{ label: 'CTRL_UP'; value: 'CTRL_UP' },
|
|
22
|
-
{ label: 'CTRL_DOWN'; value: 'CTRL_DOWN' },
|
|
23
|
-
{ label: 'CTRL_RIGHT'; value: 'CTRL_RIGHT' },
|
|
24
|
-
{ label: 'CTRL_LEFT'; value: 'CTRL_LEFT' },
|
|
25
|
-
{ label: 'BACKSPACE'; value: 'BACKSPACE' },
|
|
26
|
-
{ label: 'INSERT'; value: 'INSERT' },
|
|
27
|
-
{ label: 'DELETE'; value: 'DELETE' },
|
|
28
|
-
{ label: 'HOME'; value: 'HOME' },
|
|
29
|
-
{ label: 'END'; value: 'END' },
|
|
30
|
-
{ label: 'PAGE_UP'; value: 'PAGE_UP' },
|
|
31
|
-
{ label: 'PAGE_DOWN'; value: 'PAGE_DOWN' },
|
|
32
|
-
{ label: 'CTRL_INSERT'; value: 'CTRL_INSERT' },
|
|
33
|
-
{ label: 'CTRL_DELETE'; value: 'CTRL_DELETE' },
|
|
34
|
-
{ label: 'CTRL_HOME'; value: 'CTRL_HOME' },
|
|
35
|
-
{ label: 'CTRL_END'; value: 'CTRL_END' },
|
|
36
|
-
{ label: 'CTRL_PAGE_UP'; value: 'CTRL_PAGE_UP' },
|
|
37
|
-
{ label: 'CTRL_PAGE_DOWN'; value: 'CTRL_PAGE_DOWN' },
|
|
38
|
-
{ label: 'SHIFT_INSERT'; value: 'SHIFT_INSERT' },
|
|
39
|
-
{ label: 'SHIFT_DELETE'; value: 'SHIFT_DELETE' },
|
|
40
|
-
{ label: 'SHIFT_HOME'; value: 'SHIFT_HOME' },
|
|
41
|
-
{ label: 'SHIFT_END'; value: 'SHIFT_END' },
|
|
42
|
-
{ label: 'SHIFT_PAGE_UP'; value: 'SHIFT_PAGE_UP' },
|
|
43
|
-
{ label: 'SHIFT_PAGE_DOWN'; value: 'SHIFT_PAGE_DOWN' },
|
|
44
|
-
{ label: 'ALT_BACKSPACE'; value: 'ALT_BACKSPACE' },
|
|
45
|
-
{ label: 'ALT_INSERT'; value: 'ALT_INSERT' },
|
|
46
|
-
{ label: 'ALT_DELETE'; value: 'ALT_DELETE' },
|
|
47
|
-
{ label: 'ALT_HOME'; value: 'ALT_HOME' },
|
|
48
|
-
{ label: 'ALT_END'; value: 'ALT_END' },
|
|
49
|
-
{ label: 'ALT_PAGE_UP'; value: 'ALT_PAGE_UP' },
|
|
50
|
-
{ label: 'ALT_PAGE_DOWN'; value: 'ALT_PAGE_DOWN' },
|
|
51
|
-
{ label: 'KP_NUMLOCK'; value: 'KP_NUMLOCK' },
|
|
52
|
-
{ label: 'KP_DIVIDE'; value: 'KP_DIVIDE' },
|
|
53
|
-
{ label: 'KP_MULTIPLY'; value: 'KP_MULTIPLY' },
|
|
54
|
-
{ label: 'KP_MINUS'; value: 'KP_MINUS' },
|
|
55
|
-
{ label: 'KP_0'; value: 'KP_0' },
|
|
56
|
-
{ label: 'KP_1'; value: 'KP_1' },
|
|
57
|
-
{ label: 'KP_2'; value: 'KP_2' },
|
|
58
|
-
{ label: 'KP_3'; value: 'KP_3' },
|
|
59
|
-
{ label: 'KP_4'; value: 'KP_4' },
|
|
60
|
-
{ label: 'KP_5'; value: 'KP_5' },
|
|
61
|
-
{ label: 'KP_6'; value: 'KP_6' },
|
|
62
|
-
{ label: 'KP_7'; value: 'KP_7' },
|
|
63
|
-
{ label: 'KP_8'; value: 'KP_8' },
|
|
64
|
-
{ label: 'KP_9'; value: 'KP_9' },
|
|
65
|
-
{ label: 'KP_PLUS'; value: 'KP_PLUS' },
|
|
66
|
-
{ label: 'KP_DELETE'; value: 'KP_DELETE' },
|
|
67
|
-
{ label: 'KP_ENTER'; value: 'KP_ENTER' },
|
|
68
|
-
{ label: 'F1'; value: 'F1' },
|
|
69
|
-
{ label: 'F2'; value: 'F2' },
|
|
70
|
-
{ label: 'F3'; value: 'F3' },
|
|
71
|
-
{ label: 'F4'; value: 'F4' },
|
|
72
|
-
{ label: 'F5'; value: 'F5' },
|
|
73
|
-
{ label: 'F6'; value: 'F6' },
|
|
74
|
-
{ label: 'F7'; value: 'F7' },
|
|
75
|
-
{ label: 'F8'; value: 'F8' },
|
|
76
|
-
{ label: 'F9'; value: 'F9' },
|
|
77
|
-
{ label: 'F10'; value: 'F10' },
|
|
78
|
-
{ label: 'F11'; value: 'F11' },
|
|
79
|
-
{ label: 'F12'; value: 'F12' },
|
|
80
|
-
{ label: 'SHIFT_F1'; value: 'SHIFT_F1' },
|
|
81
|
-
{ label: 'SHIFT_F2'; value: 'SHIFT_F2' },
|
|
82
|
-
{ label: 'SHIFT_F3'; value: 'SHIFT_F3' },
|
|
83
|
-
{ label: 'SHIFT_F4'; value: 'SHIFT_F4' },
|
|
84
|
-
{ label: 'SHIFT_F5'; value: 'SHIFT_F5' },
|
|
85
|
-
{ label: 'SHIFT_F6'; value: 'SHIFT_F6' },
|
|
86
|
-
{ label: 'SHIFT_F7'; value: 'SHIFT_F7' },
|
|
87
|
-
{ label: 'SHIFT_F8'; value: 'SHIFT_F8' },
|
|
88
|
-
{ label: 'SHIFT_F9'; value: 'SHIFT_F9' },
|
|
89
|
-
{ label: 'SHIFT_F10'; value: 'SHIFT_F10' },
|
|
90
|
-
{ label: 'SHIFT_F11'; value: 'SHIFT_F11' },
|
|
91
|
-
{ label: 'SHIFT_F12'; value: 'SHIFT_F12' },
|
|
92
|
-
{ label: 'CTRL_F1'; value: 'CTRL_F1' },
|
|
93
|
-
{ label: 'CTRL_F2'; value: 'CTRL_F2' },
|
|
94
|
-
{ label: 'CTRL_F3'; value: 'CTRL_F3' },
|
|
95
|
-
{ label: 'CTRL_F4'; value: 'CTRL_F4' },
|
|
96
|
-
{ label: 'CTRL_F5'; value: 'CTRL_F5' },
|
|
97
|
-
{ label: 'CTRL_F6'; value: 'CTRL_F6' },
|
|
98
|
-
{ label: 'CTRL_F7'; value: 'CTRL_F7' },
|
|
99
|
-
{ label: 'CTRL_F8'; value: 'CTRL_F8' },
|
|
100
|
-
{ label: 'CTRL_F9'; value: 'CTRL_F9' },
|
|
101
|
-
{ label: 'CTRL_F10'; value: 'CTRL_F10' },
|
|
102
|
-
{ label: 'CTRL_F11'; value: 'CTRL_F11' },
|
|
103
|
-
{ label: 'CTRL_F12'; value: 'CTRL_F12' },
|
|
104
|
-
{ label: 'CTRL_SHIFT_F1'; value: 'CTRL_SHIFT_F1' },
|
|
105
|
-
{ label: 'CTRL_SHIFT_F2'; value: 'CTRL_SHIFT_F2' },
|
|
106
|
-
{ label: 'CTRL_SHIFT_F3'; value: 'CTRL_SHIFT_F3' },
|
|
107
|
-
{ label: 'CTRL_SHIFT_F4'; value: 'CTRL_SHIFT_F4' },
|
|
108
|
-
{ label: 'CTRL_SHIFT_F5'; value: 'CTRL_SHIFT_F5' },
|
|
109
|
-
{ label: 'CTRL_SHIFT_F6'; value: 'CTRL_SHIFT_F6' },
|
|
110
|
-
{ label: 'CTRL_SHIFT_F7'; value: 'CTRL_SHIFT_F7' },
|
|
111
|
-
{ label: 'CTRL_SHIFT_F8'; value: 'CTRL_SHIFT_F8' },
|
|
112
|
-
{ label: 'CTRL_SHIFT_F9'; value: 'CTRL_SHIFT_F9' },
|
|
113
|
-
{ label: 'CTRL_SHIFT_F10'; value: 'CTRL_SHIFT_F10' },
|
|
114
|
-
{ label: 'CTRL_SHIFT_F11'; value: 'CTRL_SHIFT_F11' },
|
|
115
|
-
{ label: 'CTRL_SHIFT_F12'; value: 'CTRL_SHIFT_F12' },
|
|
116
|
-
{ label: 'NUL'; value: 'NUL' },
|
|
117
|
-
{ label: 'ALT_SPACE'; value: 'ALT_SPACE' },
|
|
118
|
-
{ label: 'CTRL_ALT_SPACE'; value: 'CTRL_ALT_SPACE' },
|
|
119
|
-
{ label: 'CURSOR_LOCATION'; value: 'CURSOR_LOCATION' },
|
|
120
|
-
{ label: 'SCREEN_SIZE'; value: 'SCREEN_SIZE' },
|
|
121
|
-
{ label: 'COLOR_REGISTER'; value: 'COLOR_REGISTER' },
|
|
122
|
-
{ label: 'FOCUS_IN'; value: 'FOCUS_IN' },
|
|
123
|
-
{ label: 'FOCUS_OUT'; value: 'FOCUS_OUT' },
|
|
124
|
-
{ label: 'CLIPBOARD'; value: 'CLIPBOARD' },
|
|
125
|
-
{ label: 'MOUSE'; value: 'MOUSE' },
|
|
126
|
-
{ label: 'CTRL_C'; value: 'CTRL_C' },
|
|
127
|
-
{ label: 'CTRL_A'; value: 'CTRL_A' },
|
|
128
|
-
{ label: 'A'; value: 'A' },
|
|
129
|
-
{ label: 'a'; value: 'a' },
|
|
130
|
-
]
|
|
131
|
-
|
|
132
|
-
export type Key = string
|
|
133
|
-
|
|
134
|
-
export default [] as unknown as KeySelectChoices
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { WidgetFrameAttribute, BaseWidget } from './widgets.types.js'
|
|
2
|
-
|
|
3
|
-
// ** Layout Widget ** //
|
|
4
|
-
|
|
5
|
-
export interface LayoutWidgetOptions {
|
|
6
|
-
rows: LayoutRow[]
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface LayoutRow {
|
|
10
|
-
id?: string
|
|
11
|
-
columns: LayoutColumn[]
|
|
12
|
-
height?: WidgetFrameAttribute
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface LayoutColumn {
|
|
16
|
-
id: string
|
|
17
|
-
width?: WidgetFrameAttribute
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface LayoutWidget extends BaseWidget {
|
|
21
|
-
readonly type: 'layout'
|
|
22
|
-
getRows(): any[]
|
|
23
|
-
addRow(row: LayoutRow): void
|
|
24
|
-
addColumn(rowIdx: number, colunm: LayoutColumn): void
|
|
25
|
-
removeRow(rowIdx: number): void
|
|
26
|
-
removeColumn(rowIdx: number, columnIdx: number): void
|
|
27
|
-
setRowHeight(rowIdx: number, height: WidgetFrameAttribute): void
|
|
28
|
-
setColumnWidth(options: {
|
|
29
|
-
rowIdx: number
|
|
30
|
-
columnIdx: number
|
|
31
|
-
width: WidgetFrameAttribute
|
|
32
|
-
}): void
|
|
33
|
-
updateLayout(): void
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface LayoutCellWidgetOptions {}
|
|
37
|
-
|
|
38
|
-
export interface LayoutCellWidget extends BaseWidget {
|
|
39
|
-
readonly type: 'layoutCell'
|
|
40
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { BaseWidget } from './widgets.types.js'
|
|
2
|
-
|
|
3
|
-
export const menuBarEventContract = {
|
|
4
|
-
eventSignatures: {
|
|
5
|
-
select: {},
|
|
6
|
-
},
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export type MenuBarEventContract = typeof menuBarEventContract
|
|
10
|
-
|
|
11
|
-
export interface MenuBarWidgetOptions {
|
|
12
|
-
items: MenuBarWidgetItem[]
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface MenuBarWidgetItem {
|
|
16
|
-
label: string
|
|
17
|
-
value: string
|
|
18
|
-
items?: MenuBarWidgetItem[]
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface MenuBarWidget extends BaseWidget<MenuBarEventContract> {
|
|
22
|
-
setTextForItem(value: string, text: string): void
|
|
23
|
-
readonly type: 'menuBar'
|
|
24
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { BaseWidget } from './widgets.types.js'
|
|
2
|
-
|
|
3
|
-
export const popupEventContract = {
|
|
4
|
-
eventSignatures: {
|
|
5
|
-
close: {},
|
|
6
|
-
},
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export type PopupEventContract = typeof popupEventContract
|
|
10
|
-
|
|
11
|
-
export interface PopupWidgetOptions {
|
|
12
|
-
title?: string
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface PopupWidget extends BaseWidget<PopupEventContract> {
|
|
16
|
-
readonly type: 'popup'
|
|
17
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BaseWidget } from './widgets.types.js'
|
|
2
|
-
|
|
3
|
-
export interface ProgressBarWidgetOptions {
|
|
4
|
-
label?: string
|
|
5
|
-
progress: number
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface ProgressBarWidget extends BaseWidget {
|
|
9
|
-
readonly type: 'progressBar'
|
|
10
|
-
|
|
11
|
-
setLabel(label?: string): void
|
|
12
|
-
setProgress(progress: number): void
|
|
13
|
-
}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { isObject } from 'lodash-es'
|
|
2
|
-
import { BaseWidget, WidgetFrame } from './widgets.types.js'
|
|
3
|
-
import widgetUtil from './widget.utilities.js'
|
|
4
|
-
|
|
5
|
-
const termKitUtil = {
|
|
6
|
-
buildFrame(frame: Partial<WidgetFrame>, parent?: BaseWidget | null) {
|
|
7
|
-
const calculated = widgetUtil.buildFrame(frame, parent)
|
|
8
|
-
return {
|
|
9
|
-
x: calculated.left,
|
|
10
|
-
y: calculated.top,
|
|
11
|
-
width: calculated.width,
|
|
12
|
-
height: calculated.height,
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
mapWidgetOptionsToTermKitOptions(options: Record<string, any>) {
|
|
17
|
-
const mapped: Record<string, any> = {}
|
|
18
|
-
const keys = Object.keys(options)
|
|
19
|
-
const ignores = [
|
|
20
|
-
'shouldLockHeightWithParent',
|
|
21
|
-
'shouldLockWidthWithParent',
|
|
22
|
-
'shouldLockBottomWithParent',
|
|
23
|
-
'term',
|
|
24
|
-
]
|
|
25
|
-
|
|
26
|
-
if (options.backgroundColor) {
|
|
27
|
-
mapped.attr = {
|
|
28
|
-
...mapped.attr,
|
|
29
|
-
bgColor: options.backgroundColor,
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (options.foregroundColor) {
|
|
34
|
-
mapped.attr = {
|
|
35
|
-
...mapped.attr,
|
|
36
|
-
color: options.foregroundColor,
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
for (const key of keys) {
|
|
41
|
-
const item = options[key]
|
|
42
|
-
if (Array.isArray(item)) {
|
|
43
|
-
mapped[key] = []
|
|
44
|
-
for (const i of item) {
|
|
45
|
-
mapped[key].push(this.mapWidgetOptionsToTermKitOptions(i))
|
|
46
|
-
}
|
|
47
|
-
} else {
|
|
48
|
-
switch (key) {
|
|
49
|
-
case 'left':
|
|
50
|
-
mapped.x = item
|
|
51
|
-
break
|
|
52
|
-
case 'top':
|
|
53
|
-
mapped.y = item
|
|
54
|
-
break
|
|
55
|
-
case 'width':
|
|
56
|
-
if (typeof item === 'string') {
|
|
57
|
-
mapped.widthPercent = parseInt(item)
|
|
58
|
-
} else {
|
|
59
|
-
mapped.width = item
|
|
60
|
-
}
|
|
61
|
-
break
|
|
62
|
-
case 'height':
|
|
63
|
-
if (typeof item === 'string') {
|
|
64
|
-
mapped.heightPercent = parseInt(item)
|
|
65
|
-
} else {
|
|
66
|
-
mapped.height = item
|
|
67
|
-
}
|
|
68
|
-
break
|
|
69
|
-
case 'parent':
|
|
70
|
-
mapped.parent = item.getTermKitElement()
|
|
71
|
-
break
|
|
72
|
-
default:
|
|
73
|
-
if (ignores.indexOf(key) > -1) {
|
|
74
|
-
break
|
|
75
|
-
}
|
|
76
|
-
if (typeof item !== 'function' && isObject(item)) {
|
|
77
|
-
mapped[key] =
|
|
78
|
-
this.mapWidgetOptionsToTermKitOptions(item)
|
|
79
|
-
} else {
|
|
80
|
-
mapped[key] = item
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return mapped
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
mapTermKitOptionsToWidgetOptions(options: Record<string, any>) {
|
|
89
|
-
const mapped: Record<string, any> = {}
|
|
90
|
-
const keys = Object.keys(options)
|
|
91
|
-
|
|
92
|
-
for (const key of keys) {
|
|
93
|
-
const item = options[key]
|
|
94
|
-
if (Array.isArray(item)) {
|
|
95
|
-
mapped[key] = []
|
|
96
|
-
for (const i of item) {
|
|
97
|
-
mapped[key].push(this.mapTermKitOptionsToWidgetOptions(i))
|
|
98
|
-
}
|
|
99
|
-
} else {
|
|
100
|
-
switch (key) {
|
|
101
|
-
case 'left':
|
|
102
|
-
mapped.x = item
|
|
103
|
-
break
|
|
104
|
-
case 'top':
|
|
105
|
-
mapped.y = item
|
|
106
|
-
break
|
|
107
|
-
case 'widthPercent':
|
|
108
|
-
mapped.width = `${item}%`
|
|
109
|
-
break
|
|
110
|
-
case 'heightPercent':
|
|
111
|
-
mapped.height = `${item}%`
|
|
112
|
-
break
|
|
113
|
-
case 'parent':
|
|
114
|
-
mapped.parent = item.getTermKitElement()
|
|
115
|
-
break
|
|
116
|
-
default:
|
|
117
|
-
if (typeof item !== 'function' && isObject(item)) {
|
|
118
|
-
mapped[key] =
|
|
119
|
-
this.mapTermKitOptionsToWidgetOptions(item)
|
|
120
|
-
} else {
|
|
121
|
-
mapped[key] = item
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return mapped
|
|
127
|
-
},
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export default termKitUtil
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
declare module 'terminal-kit' {
|
|
2
|
-
export interface Terminal {
|
|
3
|
-
(text?: string, ...args: any[]): Terminal
|
|
4
|
-
hideCursor(hide?: boolean): void
|
|
5
|
-
windowTitle(title: string): void
|
|
6
|
-
styleReset(): void
|
|
7
|
-
grabInput(state: boolean, extra?: boolean): Promise<void>
|
|
8
|
-
clear(): void
|
|
9
|
-
on(event: string, listener: (...args: any[]) => void): this
|
|
10
|
-
removeAllListeners(event?: string): this
|
|
11
|
-
createDocument(options?: any): any
|
|
12
|
-
[key: string]: any
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const terminal: Terminal
|
|
16
|
-
|
|
17
|
-
export { terminal }
|
|
18
|
-
export default { terminal } & Record<string, any>
|
|
19
|
-
|
|
20
|
-
export class Palette {}
|
|
21
|
-
export class Button {}
|
|
22
|
-
export class DropDownMenu {}
|
|
23
|
-
export class InlineInput {}
|
|
24
|
-
export class Layout {}
|
|
25
|
-
export class Bar {}
|
|
26
|
-
export class TextBox {}
|
|
27
|
-
export class Window {}
|
|
28
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export type TestResultStatus = 'running' | 'passed' | 'failed'
|
|
2
|
-
export type TestRunnerStatus = 'running' | 'stopped' | 'ready'
|
|
3
|
-
|
|
4
|
-
export interface TestFileTest {
|
|
5
|
-
name: string
|
|
6
|
-
status:
|
|
7
|
-
| 'passed'
|
|
8
|
-
| 'failed'
|
|
9
|
-
| 'skipped'
|
|
10
|
-
| 'pending'
|
|
11
|
-
| 'todo'
|
|
12
|
-
| 'disabled'
|
|
13
|
-
| 'focused'
|
|
14
|
-
errorMessages?: string[]
|
|
15
|
-
duration: number
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface SpruceTestFile {
|
|
19
|
-
path: string
|
|
20
|
-
status: TestResultStatus
|
|
21
|
-
tests?: TestFileTest[]
|
|
22
|
-
errorMessage?: string
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface TestResults {
|
|
26
|
-
totalTests?: number
|
|
27
|
-
totalPassed?: number
|
|
28
|
-
totalFailed?: number
|
|
29
|
-
totalSkipped?: number
|
|
30
|
-
totalTodo?: number
|
|
31
|
-
totalTestFiles: number
|
|
32
|
-
totalTestFilesComplete?: number
|
|
33
|
-
testFiles?: SpruceTestFile[]
|
|
34
|
-
}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import chokidar from 'chokidar'
|
|
2
|
-
import { spawn } from 'child_process'
|
|
3
|
-
import path from 'path'
|
|
4
|
-
import CommandServiceImpl from './CommandService.js'
|
|
5
|
-
import TestReporter from './TestReporter.js'
|
|
6
|
-
import TestRunner from './TestRunner.js'
|
|
7
|
-
|
|
8
|
-
const args = process.argv.slice(2)
|
|
9
|
-
const get = (flag: string) => {
|
|
10
|
-
const i = args.indexOf(flag)
|
|
11
|
-
return i !== -1 ? args[i + 1] : undefined
|
|
12
|
-
}
|
|
13
|
-
const has = (flag: string) => args.includes(flag)
|
|
14
|
-
|
|
15
|
-
const pattern = get('--pattern') ?? null
|
|
16
|
-
const watchMode = (get('--watchMode') ?? 'off') as 'off' | 'standard' | 'smart'
|
|
17
|
-
const inspectPort = parseInt(get('--inspect') ?? '0', 10) || null
|
|
18
|
-
const cwd = process.cwd()
|
|
19
|
-
|
|
20
|
-
let currentPattern = pattern
|
|
21
|
-
let isDebugging = inspectPort !== null
|
|
22
|
-
let currentWatchMode = watchMode
|
|
23
|
-
let runner: TestRunner | null = null
|
|
24
|
-
let running = false
|
|
25
|
-
|
|
26
|
-
const reporter = new TestReporter({
|
|
27
|
-
cwd,
|
|
28
|
-
filterPattern: pattern ?? undefined,
|
|
29
|
-
watchMode,
|
|
30
|
-
isDebugging,
|
|
31
|
-
status: has('--shouldHoldAtStart') ? 'stopped' : 'ready',
|
|
32
|
-
handleStartStop: () => {
|
|
33
|
-
if (running) {
|
|
34
|
-
runner?.kill()
|
|
35
|
-
} else {
|
|
36
|
-
runTests()
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
handleRestart: () => {
|
|
40
|
-
runner?.kill()
|
|
41
|
-
setTimeout(runTests, 100)
|
|
42
|
-
},
|
|
43
|
-
handleQuit: () => {
|
|
44
|
-
runner?.kill()
|
|
45
|
-
process.exit(0)
|
|
46
|
-
},
|
|
47
|
-
handleFilterPatternChange: (p?: string) => {
|
|
48
|
-
currentPattern = p ?? null
|
|
49
|
-
if (running) {
|
|
50
|
-
runner?.kill()
|
|
51
|
-
setTimeout(runTests, 100)
|
|
52
|
-
} else {
|
|
53
|
-
runTests()
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
handleToggleDebug: () => {
|
|
57
|
-
isDebugging = !isDebugging
|
|
58
|
-
reporter.setIsDebugging(isDebugging)
|
|
59
|
-
},
|
|
60
|
-
handletoggleStandardWatch: () => {
|
|
61
|
-
currentWatchMode = currentWatchMode === 'standard' ? 'off' : 'standard'
|
|
62
|
-
reporter.setWatchMode(currentWatchMode)
|
|
63
|
-
},
|
|
64
|
-
handleToggleSmartWatch: () => {
|
|
65
|
-
currentWatchMode = currentWatchMode === 'smart' ? 'off' : 'smart'
|
|
66
|
-
reporter.setWatchMode(currentWatchMode)
|
|
67
|
-
},
|
|
68
|
-
handleOpenTestFile: (filePath: string) => {
|
|
69
|
-
const fullPath = path.isAbsolute(filePath)
|
|
70
|
-
? filePath
|
|
71
|
-
: path.join(cwd, 'src', '__tests__', filePath)
|
|
72
|
-
spawn('code', [fullPath], { detached: true, stdio: 'ignore' }).unref()
|
|
73
|
-
},
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
async function runTests() {
|
|
77
|
-
if (running) {
|
|
78
|
-
return
|
|
79
|
-
}
|
|
80
|
-
running = true
|
|
81
|
-
|
|
82
|
-
try {
|
|
83
|
-
reporter.setStatus('running')
|
|
84
|
-
} catch (err) {
|
|
85
|
-
running = false
|
|
86
|
-
reporter.appendError(`setStatus error: ${err}`)
|
|
87
|
-
return
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const commandSvc = new CommandServiceImpl(cwd)
|
|
91
|
-
runner = new TestRunner({ cwd, commandService: commandSvc })
|
|
92
|
-
|
|
93
|
-
runner.on('did-update', ({ results }) => {
|
|
94
|
-
try {
|
|
95
|
-
reporter.updateResults(results)
|
|
96
|
-
} catch (err) {
|
|
97
|
-
reporter.appendError(`updateResults error: ${err}`)
|
|
98
|
-
}
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
runner.on('did-error', ({ message }) => {
|
|
102
|
-
reporter.appendError(message)
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
try {
|
|
106
|
-
await runner.run({
|
|
107
|
-
pattern: currentPattern,
|
|
108
|
-
debugPort: isDebugging ? (inspectPort ?? 5200) : null,
|
|
109
|
-
})
|
|
110
|
-
} catch (err) {
|
|
111
|
-
reporter.appendError(`Test run failed: ${err}`)
|
|
112
|
-
} finally {
|
|
113
|
-
running = false
|
|
114
|
-
reporter.setStatus('stopped')
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
let debounceTimer: ReturnType<typeof setTimeout> | null = null
|
|
119
|
-
|
|
120
|
-
function scheduleRerun(changedFile?: string) {
|
|
121
|
-
if (debounceTimer) {
|
|
122
|
-
clearTimeout(debounceTimer)
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (currentWatchMode === 'smart' && changedFile) {
|
|
126
|
-
const rel = path.relative(cwd, changedFile)
|
|
127
|
-
const base = path.basename(rel, path.extname(rel))
|
|
128
|
-
reporter.startCountdownTimer(2)
|
|
129
|
-
debounceTimer = setTimeout(() => {
|
|
130
|
-
currentPattern = base
|
|
131
|
-
reporter.setFilterPattern(base)
|
|
132
|
-
runner?.kill()
|
|
133
|
-
setTimeout(runTests, 100)
|
|
134
|
-
}, 2000)
|
|
135
|
-
} else if (currentWatchMode === 'standard') {
|
|
136
|
-
reporter.startCountdownTimer(2)
|
|
137
|
-
debounceTimer = setTimeout(() => {
|
|
138
|
-
runner?.kill()
|
|
139
|
-
setTimeout(runTests, 100)
|
|
140
|
-
}, 2000)
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
async function main() {
|
|
145
|
-
await reporter.start()
|
|
146
|
-
|
|
147
|
-
await new Promise((r) => setTimeout(r, 50))
|
|
148
|
-
|
|
149
|
-
if (!has('--shouldHoldAtStart')) {
|
|
150
|
-
runTests()
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (currentWatchMode !== 'off') {
|
|
154
|
-
const watcher = chokidar.watch(path.join(cwd, 'src'), {
|
|
155
|
-
ignored: /node_modules/,
|
|
156
|
-
ignoreInitial: true,
|
|
157
|
-
})
|
|
158
|
-
watcher.on('change', scheduleRerun)
|
|
159
|
-
watcher.on('add', scheduleRerun)
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
main().catch((err) => {
|
|
164
|
-
console.error(err)
|
|
165
|
-
process.exit(1)
|
|
166
|
-
})
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { BaseWidget } from './widgets.types.js'
|
|
2
|
-
|
|
3
|
-
// ** Text Widget ** //
|
|
4
|
-
|
|
5
|
-
export const textEventContract = {
|
|
6
|
-
eventSignatures: {
|
|
7
|
-
click: {},
|
|
8
|
-
},
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type TextEventContract = typeof textEventContract
|
|
12
|
-
|
|
13
|
-
export interface TextWidgetOptions {
|
|
14
|
-
isScrollEnabled?: boolean
|
|
15
|
-
shouldAutoScrollWhenAppendingContent?: boolean
|
|
16
|
-
wordWrap?: boolean
|
|
17
|
-
text?: string
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface TextWidget extends BaseWidget<TextEventContract> {
|
|
21
|
-
readonly type: 'text'
|
|
22
|
-
getText(): string
|
|
23
|
-
setText(content: string): void
|
|
24
|
-
getScrollX(): number
|
|
25
|
-
getScrollY(): number
|
|
26
|
-
scrollToTop(): void
|
|
27
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BaseWidget,
|
|
3
|
-
WidgetFrame,
|
|
4
|
-
WidgetFrameCalculated,
|
|
5
|
-
} from './widgets.types.js'
|
|
6
|
-
|
|
7
|
-
const widgetUtil = {
|
|
8
|
-
buildFrame(frame?: Partial<WidgetFrame>, parent?: BaseWidget | null) {
|
|
9
|
-
let { left, top, height, width } = frame || {}
|
|
10
|
-
|
|
11
|
-
if (typeof width === 'string') {
|
|
12
|
-
if (!parent) {
|
|
13
|
-
throw new Error(
|
|
14
|
-
'I can only calculate percentage sizes if a parent is passed.'
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
width = parent.getFrame().width * (parseInt(width, 10) / 100)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (typeof height === 'string') {
|
|
22
|
-
if (!parent) {
|
|
23
|
-
throw new Error(
|
|
24
|
-
'I can only calculate percentage sizes if a parent is passed.'
|
|
25
|
-
)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
height = parent.getFrame().height * (parseInt(height, 10) / 100)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return { left, top, height, width } as Partial<WidgetFrameCalculated>
|
|
32
|
-
},
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export default widgetUtil
|