@companion-module/base 1.14.0 → 1.99.0-0-nightly-feat-split-api-20251221-153951-fa12995

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 (116) hide show
  1. package/README.md +12 -11
  2. package/dist/__mocks__/net.d.ts +30 -0
  3. package/dist/__mocks__/net.js +108 -0
  4. package/dist/__mocks__/net.js.map +1 -0
  5. package/dist/__mocks__/util.d.ts +8 -0
  6. package/dist/__mocks__/util.js +44 -0
  7. package/dist/__mocks__/util.js.map +1 -0
  8. package/dist/common/json-value.d.ts +0 -1
  9. package/dist/common/osc.d.ts +0 -1
  10. package/dist/entrypoint.d.ts +9 -1
  11. package/dist/entrypoint.js +4 -122
  12. package/dist/entrypoint.js.map +1 -1
  13. package/dist/helpers/__tests__/tcp.spec.d.ts +1 -0
  14. package/dist/helpers/__tests__/tcp.spec.js +210 -0
  15. package/dist/helpers/__tests__/tcp.spec.js.map +1 -0
  16. package/dist/helpers/__tests__/udp.spec.d.ts +1 -0
  17. package/dist/helpers/__tests__/udp.spec.js +200 -0
  18. package/dist/helpers/__tests__/udp.spec.js.map +1 -0
  19. package/dist/helpers/index.d.ts +0 -1
  20. package/dist/helpers/tcp.d.ts +0 -1
  21. package/dist/helpers/telnet.d.ts +0 -1
  22. package/dist/helpers/udp.d.ts +0 -1
  23. package/dist/host-api/context.d.ts +59 -0
  24. package/dist/host-api/{api.js → context.js} +6 -1
  25. package/dist/host-api/context.js.map +1 -0
  26. package/dist/instance-base.d.ts +0 -1
  27. package/dist/logging.d.ts +20 -0
  28. package/dist/logging.js +25 -0
  29. package/dist/logging.js.map +1 -0
  30. package/dist/main.d.ts +8 -0
  31. package/dist/main.js +14 -0
  32. package/dist/main.js.map +1 -0
  33. package/dist/manifest.d.ts +0 -1
  34. package/dist/module-api/__tests__/shared-udp-socket.spec.d.ts +1 -0
  35. package/dist/module-api/__tests__/shared-udp-socket.spec.js +272 -0
  36. package/dist/module-api/__tests__/shared-udp-socket.spec.js.map +1 -0
  37. package/dist/module-api/action.d.ts +0 -1
  38. package/dist/module-api/base.d.ts +3 -17
  39. package/dist/module-api/base.js +47 -321
  40. package/dist/module-api/base.js.map +1 -1
  41. package/dist/module-api/common.d.ts +0 -1
  42. package/dist/module-api/config.d.ts +0 -1
  43. package/dist/module-api/enums.d.ts +0 -2
  44. package/dist/module-api/enums.js.map +1 -1
  45. package/dist/module-api/feedback.d.ts +0 -1
  46. package/dist/module-api/http.d.ts +0 -1
  47. package/dist/module-api/index.d.ts +0 -1
  48. package/dist/module-api/input.d.ts +0 -1
  49. package/dist/module-api/preset.d.ts +0 -1
  50. package/dist/module-api/shared-udp-socket.d.ts +2 -4
  51. package/dist/module-api/shared-udp-socket.js +13 -15
  52. package/dist/module-api/shared-udp-socket.js.map +1 -1
  53. package/dist/module-api/style.d.ts +0 -1
  54. package/dist/module-api/upgrade.d.ts +0 -1
  55. package/dist/module-api/variable.d.ts +0 -1
  56. package/dist/util.d.ts +0 -1
  57. package/package.json +7 -35
  58. package/dist/common/json-value.d.ts.map +0 -1
  59. package/dist/common/osc.d.ts.map +0 -1
  60. package/dist/entrypoint.d.ts.map +0 -1
  61. package/dist/helpers/index.d.ts.map +0 -1
  62. package/dist/helpers/tcp.d.ts.map +0 -1
  63. package/dist/helpers/telnet.d.ts.map +0 -1
  64. package/dist/helpers/udp.d.ts.map +0 -1
  65. package/dist/host-api/api.d.ts +0 -389
  66. package/dist/host-api/api.d.ts.map +0 -1
  67. package/dist/host-api/api.js.map +0 -1
  68. package/dist/host-api/ipc-wrapper.d.ts +0 -37
  69. package/dist/host-api/ipc-wrapper.d.ts.map +0 -1
  70. package/dist/host-api/ipc-wrapper.js +0 -129
  71. package/dist/host-api/ipc-wrapper.js.map +0 -1
  72. package/dist/host-api/versions.d.ts +0 -12
  73. package/dist/host-api/versions.d.ts.map +0 -1
  74. package/dist/host-api/versions.js +0 -5
  75. package/dist/host-api/versions.js.map +0 -1
  76. package/dist/index.d.ts +0 -8
  77. package/dist/index.d.ts.map +0 -1
  78. package/dist/index.js +0 -22
  79. package/dist/index.js.map +0 -1
  80. package/dist/instance-base.d.ts.map +0 -1
  81. package/dist/internal/actions.d.ts +0 -16
  82. package/dist/internal/actions.d.ts.map +0 -1
  83. package/dist/internal/actions.js +0 -223
  84. package/dist/internal/actions.js.map +0 -1
  85. package/dist/internal/base.d.ts +0 -11
  86. package/dist/internal/base.d.ts.map +0 -1
  87. package/dist/internal/base.js +0 -39
  88. package/dist/internal/base.js.map +0 -1
  89. package/dist/internal/feedback.d.ts +0 -20
  90. package/dist/internal/feedback.d.ts.map +0 -1
  91. package/dist/internal/feedback.js +0 -307
  92. package/dist/internal/feedback.js.map +0 -1
  93. package/dist/internal/upgrade.d.ts +0 -15
  94. package/dist/internal/upgrade.d.ts.map +0 -1
  95. package/dist/internal/upgrade.js +0 -174
  96. package/dist/internal/upgrade.js.map +0 -1
  97. package/dist/manifest.d.ts.map +0 -1
  98. package/dist/module-api/action.d.ts.map +0 -1
  99. package/dist/module-api/base.d.ts.map +0 -1
  100. package/dist/module-api/common.d.ts.map +0 -1
  101. package/dist/module-api/config.d.ts.map +0 -1
  102. package/dist/module-api/enums.d.ts.map +0 -1
  103. package/dist/module-api/feedback.d.ts.map +0 -1
  104. package/dist/module-api/http.d.ts.map +0 -1
  105. package/dist/module-api/index.d.ts.map +0 -1
  106. package/dist/module-api/input.d.ts.map +0 -1
  107. package/dist/module-api/preset.d.ts.map +0 -1
  108. package/dist/module-api/shared-udp-socket.d.ts.map +0 -1
  109. package/dist/module-api/style.d.ts.map +0 -1
  110. package/dist/module-api/upgrade.d.ts.map +0 -1
  111. package/dist/module-api/variable.d.ts.map +0 -1
  112. package/dist/util.d.ts.map +0 -1
  113. package/lib/debounce-fn/index.d.ts +0 -83
  114. package/lib/debounce-fn/index.js +0 -78
  115. package/lib/debounce-fn/license +0 -9
  116. package/lib/debounce-fn/readme.md +0 -64
@@ -1,83 +0,0 @@
1
- declare namespace debounceFn {
2
- interface Options {
3
- /**
4
- Time to wait until the `input` function is called.
5
-
6
- @default 0
7
- */
8
- readonly wait?: number
9
-
10
- /**
11
- Maximum time to wait until the `input` function is called.
12
- Only applies when after is true.
13
- Disabled when 0
14
-
15
- @default 0
16
- */
17
- readonly maxWait?: number
18
-
19
- /**
20
- Trigger the function on the leading edge of the `wait` interval.
21
-
22
- For example, this can be useful for preventing accidental double-clicks on a "submit" button from firing a second time.
23
-
24
- @default false
25
- */
26
- readonly before?: boolean
27
-
28
- /**
29
- Trigger the function on the trailing edge of the `wait` interval.
30
-
31
- @default true
32
- */
33
- readonly after?: boolean
34
- }
35
-
36
- interface BeforeOptions extends Options {
37
- readonly before: true
38
- }
39
-
40
- interface NoBeforeNoAfterOptions extends Options {
41
- readonly after: false
42
- readonly before?: false
43
- }
44
-
45
- interface DebouncedFunction<ArgumentsType extends unknown[], ReturnType> {
46
- (...arguments: ArgumentsType): ReturnType
47
- cancel(): void
48
- }
49
- }
50
-
51
- /**
52
- [Debounce](https://davidwalsh.name/javascript-debounce-function) a function.
53
-
54
- @param input - Function to debounce.
55
- @returns A debounced function that delays calling the `input` function until after `wait` milliseconds have elapsed since the last time the debounced function was called.
56
-
57
- It comes with a `.cancel()` method to cancel any scheduled `input` function calls.
58
-
59
- @example
60
- ```
61
- import debounceFn = require('debounce-fn');
62
-
63
- window.onresize = debounceFn(() => {
64
- // Do something on window resize
65
- }, {wait: 100});
66
- ```
67
- */
68
- declare function debounceFn<ArgumentsType extends unknown[], ReturnType>(
69
- input: (...arguments: ArgumentsType) => ReturnType,
70
- options: debounceFn.BeforeOptions,
71
- ): debounceFn.DebouncedFunction<ArgumentsType, ReturnType>
72
-
73
- declare function debounceFn<ArgumentsType extends unknown[], ReturnType>(
74
- input: (...arguments: ArgumentsType) => ReturnType,
75
- options: debounceFn.NoBeforeNoAfterOptions,
76
- ): debounceFn.DebouncedFunction<ArgumentsType, undefined>
77
-
78
- declare function debounceFn<ArgumentsType extends unknown[], ReturnType>(
79
- input: (...arguments: ArgumentsType) => ReturnType,
80
- options?: debounceFn.Options,
81
- ): debounceFn.DebouncedFunction<ArgumentsType, ReturnType | undefined>
82
-
83
- export = debounceFn
@@ -1,78 +0,0 @@
1
- 'use strict'
2
- // eslint-disable-next-line @typescript-eslint/no-require-imports
3
- const mimicFn = require('mimic-fn')
4
-
5
- module.exports = (inputFunction, options = {}) => {
6
- if (typeof inputFunction !== 'function') {
7
- throw new TypeError(`Expected the first argument to be a function, got \`${typeof inputFunction}\``)
8
- }
9
-
10
- const { wait = 0, maxWait = 0, before = false, after = true } = options
11
-
12
- if (!before && !after) {
13
- throw new Error("Both `before` and `after` are false, function wouldn't be called.")
14
- }
15
-
16
- let timeout
17
- let maxTimeout
18
- let result
19
-
20
- const debouncedFunction = function (...arguments_) {
21
- // eslint-disable-next-line @typescript-eslint/no-this-alias
22
- const context = this
23
-
24
- const later = () => {
25
- timeout = undefined
26
-
27
- if (maxTimeout) {
28
- clearTimeout(maxTimeout)
29
- maxTimeout = undefined
30
- }
31
-
32
- if (after) {
33
- result = inputFunction.apply(context, arguments_)
34
- }
35
- }
36
-
37
- const maxLater = () => {
38
- maxTimeout = undefined
39
-
40
- if (timeout) {
41
- clearTimeout(timeout)
42
- timeout = undefined
43
- }
44
-
45
- result = inputFunction.apply(context, arguments_)
46
- }
47
-
48
- const shouldCallNow = before && !timeout
49
- clearTimeout(timeout)
50
- timeout = setTimeout(later, wait)
51
-
52
- if (maxWait > 0 && !maxTimeout && after) {
53
- maxTimeout = setTimeout(maxLater, maxWait)
54
- }
55
-
56
- if (shouldCallNow) {
57
- result = inputFunction.apply(context, arguments_)
58
- }
59
-
60
- return result
61
- }
62
-
63
- mimicFn(debouncedFunction, inputFunction)
64
-
65
- debouncedFunction.cancel = () => {
66
- if (timeout) {
67
- clearTimeout(timeout)
68
- timeout = undefined
69
- }
70
-
71
- if (maxTimeout) {
72
- clearTimeout(maxTimeout)
73
- maxTimeout = undefined
74
- }
75
- }
76
-
77
- return debouncedFunction
78
- }
@@ -1,9 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,64 +0,0 @@
1
- # debounce-fn
2
-
3
- > [Debounce](https://davidwalsh.name/javascript-debounce-function) a function
4
-
5
- ## Install
6
-
7
- ```
8
- $ npm install debounce-fn
9
- ```
10
-
11
- ## Usage
12
-
13
- ```js
14
- const debounceFn = require('debounce-fn');
15
-
16
- window.onresize = debounceFn(() => {
17
- // Do something on window resize
18
- }, {wait: 100});
19
- ```
20
-
21
- ## API
22
-
23
- ### debounceFn(input, options?)
24
-
25
- Returns a debounced function that delays calling the `input` function until after `wait` milliseconds have elapsed since the last time the debounced function was called.
26
-
27
- It comes with a `.cancel()` method to cancel any scheduled `input` function calls.
28
-
29
- #### input
30
-
31
- Type: `Function`
32
-
33
- Function to debounce.
34
-
35
- #### options
36
-
37
- Type: `object`
38
-
39
- ##### wait
40
-
41
- Type: `number`\
42
- Default: `0`
43
-
44
- Time to wait until the `input` function is called.
45
-
46
- ##### before
47
-
48
- Type: `boolean`\
49
- Default: `false`
50
-
51
- Trigger the function on the leading edge of the `wait` interval.
52
-
53
- For example, can be useful for preventing accidental double-clicks on a "submit" button from firing a second time.
54
-
55
- ##### after
56
-
57
- Type: `boolean`\
58
- Default: `true`
59
-
60
- Trigger the function on the trailing edge of the `wait` interval.
61
-
62
- ## Related
63
-
64
- - [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions