@companion-module/base 1.13.3 → 1.13.4

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 (132) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/common/json-value.d.ts +33 -0
  3. package/dist/common/json-value.d.ts.map +1 -0
  4. package/dist/common/json-value.js +5 -0
  5. package/dist/common/json-value.js.map +1 -0
  6. package/dist/common/osc.d.ts +17 -0
  7. package/dist/common/osc.d.ts.map +1 -0
  8. package/dist/common/osc.js +7 -0
  9. package/dist/common/osc.js.map +1 -0
  10. package/dist/entrypoint.d.ts +11 -0
  11. package/dist/entrypoint.d.ts.map +1 -0
  12. package/dist/entrypoint.js +134 -0
  13. package/dist/entrypoint.js.map +1 -0
  14. package/dist/helpers/index.d.ts +4 -0
  15. package/dist/helpers/index.d.ts.map +1 -0
  16. package/dist/helpers/index.js +10 -0
  17. package/dist/helpers/index.js.map +1 -0
  18. package/dist/helpers/tcp.d.ts +31 -0
  19. package/dist/helpers/tcp.d.ts.map +1 -0
  20. package/dist/helpers/tcp.js +164 -0
  21. package/dist/helpers/tcp.js.map +1 -0
  22. package/dist/helpers/telnet.d.ts +18 -0
  23. package/dist/helpers/telnet.d.ts.map +1 -0
  24. package/dist/helpers/telnet.js +169 -0
  25. package/dist/helpers/telnet.js.map +1 -0
  26. package/dist/helpers/udp.d.ts +33 -0
  27. package/dist/helpers/udp.d.ts.map +1 -0
  28. package/dist/helpers/udp.js +126 -0
  29. package/dist/helpers/udp.js.map +1 -0
  30. package/dist/host-api/api.d.ts +383 -0
  31. package/dist/host-api/api.d.ts.map +1 -0
  32. package/dist/host-api/api.js +9 -0
  33. package/dist/host-api/api.js.map +1 -0
  34. package/dist/host-api/ipc-wrapper.d.ts +37 -0
  35. package/dist/host-api/ipc-wrapper.d.ts.map +1 -0
  36. package/dist/host-api/ipc-wrapper.js +129 -0
  37. package/dist/host-api/ipc-wrapper.js.map +1 -0
  38. package/dist/host-api/versions.d.ts +12 -0
  39. package/dist/host-api/versions.d.ts.map +1 -0
  40. package/dist/host-api/versions.js +5 -0
  41. package/dist/host-api/versions.js.map +1 -0
  42. package/dist/index.d.ts +8 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +22 -0
  45. package/dist/index.js.map +1 -0
  46. package/dist/instance-base.d.ts +12 -0
  47. package/dist/instance-base.d.ts.map +1 -0
  48. package/dist/instance-base.js +3 -0
  49. package/dist/instance-base.js.map +1 -0
  50. package/dist/internal/actions.d.ts +16 -0
  51. package/dist/internal/actions.d.ts.map +1 -0
  52. package/dist/internal/actions.js +207 -0
  53. package/dist/internal/actions.js.map +1 -0
  54. package/dist/internal/base.d.ts +11 -0
  55. package/dist/internal/base.d.ts.map +1 -0
  56. package/dist/internal/base.js +39 -0
  57. package/dist/internal/base.js.map +1 -0
  58. package/dist/internal/feedback.d.ts +20 -0
  59. package/dist/internal/feedback.d.ts.map +1 -0
  60. package/dist/internal/feedback.js +307 -0
  61. package/dist/internal/feedback.js.map +1 -0
  62. package/dist/internal/upgrade.d.ts +15 -0
  63. package/dist/internal/upgrade.d.ts.map +1 -0
  64. package/dist/internal/upgrade.js +174 -0
  65. package/dist/internal/upgrade.js.map +1 -0
  66. package/dist/manifest.d.ts +5 -0
  67. package/dist/manifest.d.ts.map +1 -0
  68. package/dist/manifest.js +37 -0
  69. package/dist/manifest.js.map +1 -0
  70. package/dist/module-api/action.d.ts +100 -0
  71. package/dist/module-api/action.d.ts.map +1 -0
  72. package/dist/module-api/action.js +3 -0
  73. package/dist/module-api/action.js.map +1 -0
  74. package/dist/module-api/base.d.ts +199 -0
  75. package/dist/module-api/base.d.ts.map +1 -0
  76. package/dist/module-api/base.js +481 -0
  77. package/dist/module-api/base.js.map +1 -0
  78. package/dist/module-api/common.d.ts +14 -0
  79. package/dist/module-api/common.d.ts.map +1 -0
  80. package/dist/module-api/common.js +3 -0
  81. package/dist/module-api/common.js.map +1 -0
  82. package/dist/module-api/config.d.ts +12 -0
  83. package/dist/module-api/config.d.ts.map +1 -0
  84. package/dist/module-api/config.js +3 -0
  85. package/dist/module-api/config.js.map +1 -0
  86. package/dist/module-api/enums.d.ts +31 -0
  87. package/dist/module-api/enums.d.ts.map +1 -0
  88. package/dist/module-api/enums.js +37 -0
  89. package/dist/module-api/enums.js.map +1 -0
  90. package/dist/module-api/feedback.d.ts +147 -0
  91. package/dist/module-api/feedback.d.ts.map +1 -0
  92. package/dist/module-api/feedback.js +3 -0
  93. package/dist/module-api/feedback.js.map +1 -0
  94. package/dist/module-api/http.d.ts +17 -0
  95. package/dist/module-api/http.d.ts.map +1 -0
  96. package/dist/module-api/http.js +3 -0
  97. package/dist/module-api/http.js.map +1 -0
  98. package/dist/module-api/index.d.ts +13 -0
  99. package/dist/module-api/index.d.ts.map +1 -0
  100. package/dist/module-api/index.js +15 -0
  101. package/dist/module-api/index.js.map +1 -0
  102. package/dist/module-api/input.d.ts +392 -0
  103. package/dist/module-api/input.d.ts.map +1 -0
  104. package/dist/module-api/input.js +3 -0
  105. package/dist/module-api/input.js.map +1 -0
  106. package/dist/module-api/preset.d.ts +111 -0
  107. package/dist/module-api/preset.d.ts.map +1 -0
  108. package/dist/module-api/preset.js +3 -0
  109. package/dist/module-api/preset.js.map +1 -0
  110. package/dist/module-api/shared-udp-socket.d.ts +60 -0
  111. package/dist/module-api/shared-udp-socket.d.ts.map +1 -0
  112. package/dist/module-api/shared-udp-socket.js +178 -0
  113. package/dist/module-api/shared-udp-socket.js.map +1 -0
  114. package/dist/module-api/style.d.ts +20 -0
  115. package/dist/module-api/style.d.ts.map +1 -0
  116. package/dist/module-api/style.js +3 -0
  117. package/dist/module-api/style.js.map +1 -0
  118. package/dist/module-api/upgrade.d.ts +118 -0
  119. package/dist/module-api/upgrade.d.ts.map +1 -0
  120. package/dist/module-api/upgrade.js +95 -0
  121. package/dist/module-api/upgrade.js.map +1 -0
  122. package/dist/module-api/variable.d.ts +18 -0
  123. package/dist/module-api/variable.d.ts.map +1 -0
  124. package/dist/module-api/variable.js +3 -0
  125. package/dist/module-api/variable.js.map +1 -0
  126. package/dist/util.d.ts +97 -0
  127. package/dist/util.d.ts.map +1 -0
  128. package/dist/util.js +177 -0
  129. package/dist/util.js.map +1 -0
  130. package/generated/manifest.d.ts +133 -0
  131. package/generated/validate_manifest.js +1 -0
  132. package/package.json +1 -1
@@ -0,0 +1,100 @@
1
+ import type { CompanionCommonCallbackContext } from './common.js';
2
+ import type { CompanionOptionValues, CompanionInputFieldCheckbox, CompanionInputFieldColor, CompanionInputFieldDropdown, CompanionInputFieldMultiDropdown, CompanionInputFieldNumber, CompanionInputFieldStaticText, CompanionInputFieldTextInput, CompanionInputFieldCustomVariable } from './input.js';
3
+ import type { CompanionVariableValue } from './variable.js';
4
+ export type SomeCompanionActionInputField = CompanionInputFieldStaticText | CompanionInputFieldColor | CompanionInputFieldTextInput | CompanionInputFieldDropdown | CompanionInputFieldMultiDropdown | CompanionInputFieldNumber | CompanionInputFieldCheckbox | CompanionInputFieldCustomVariable;
5
+ /**
6
+ * Utility functions available in the context of the current action
7
+ */
8
+ export interface CompanionActionContext extends CompanionCommonCallbackContext {
9
+ /**
10
+ * @deprecated Experimental: This method may change without notice. Do not use!
11
+ * Set the value of a custom variable
12
+ * @param variableName
13
+ * @param value
14
+ * @returns Promise which resolves upon success, or rejects if the variable no longer exists
15
+ */
16
+ setCustomVariableValue(variableName: string, value: CompanionVariableValue): void;
17
+ }
18
+ /**
19
+ * The definition of an action
20
+ */
21
+ export interface CompanionActionDefinition {
22
+ /** Name to show in the actions list */
23
+ name: string;
24
+ /** Additional description of the action */
25
+ description?: string;
26
+ /** The input fields for the action */
27
+ options: SomeCompanionActionInputField[];
28
+ /**
29
+ * Ignore changes to certain options and don't allow them to trigger the subscribe/unsubscribe callbacks
30
+ * This allows for ensuring that the subscribe callback is only called when values the action cares about change
31
+ */
32
+ optionsToIgnoreForSubscribe?: string[];
33
+ /**
34
+ * If true, the unsubscribe callback will not be called when the options change, only when the action is removed or disabled
35
+ */
36
+ skipUnsubscribeOnOptionsChange?: boolean;
37
+ /** Called to execute the action */
38
+ callback: (action: CompanionActionEvent, context: CompanionActionContext) => Promise<void> | void;
39
+ /**
40
+ * Called to report the existence of an action
41
+ * Useful to ensure necessary data is loaded
42
+ */
43
+ subscribe?: (action: CompanionActionInfo, context: CompanionActionContext) => Promise<void> | void;
44
+ /**
45
+ * Called to report an action has been edited/removed
46
+ * Useful to cleanup subscriptions setup in subscribe
47
+ */
48
+ unsubscribe?: (action: CompanionActionInfo, context: CompanionActionContext) => Promise<void> | void;
49
+ /**
50
+ * The user requested to 'learn' the values for this action.
51
+ */
52
+ learn?: (action: CompanionActionEvent, context: CompanionActionContext) => CompanionOptionValues | undefined | Promise<CompanionOptionValues | undefined>;
53
+ /**
54
+ * Timeout for the 'learn' function (in milliseconds)
55
+ * Companion sets a default value of 5s, to ensure that the learn does not get stuck never completing
56
+ * You can change this if this number does not work for you, but you should keep it to a sensible value
57
+ */
58
+ learnTimeout?: number;
59
+ }
60
+ /**
61
+ * The definitions of a group of actions
62
+ */
63
+ export interface CompanionActionDefinitions {
64
+ [actionId: string]: CompanionActionDefinition | undefined;
65
+ }
66
+ /**
67
+ * Basic information about an instance of an action
68
+ */
69
+ export interface CompanionActionInfo {
70
+ /** The unique id for this action */
71
+ readonly id: string;
72
+ /** The unique id for the location of this action */
73
+ readonly controlId: string;
74
+ /** The id of the action definition */
75
+ readonly actionId: string;
76
+ /** The user selected options for the action */
77
+ readonly options: CompanionOptionValues;
78
+ }
79
+ /**
80
+ * Extended information for execution of an action
81
+ */
82
+ export interface CompanionActionEvent extends CompanionActionInfo {
83
+ /** Identifier of the surface which triggered this action */
84
+ readonly surfaceId: string | undefined;
85
+ }
86
+ /**
87
+ * Information about an action which has been recorded
88
+ */
89
+ export interface CompanionRecordedAction {
90
+ /** The id of the action definition */
91
+ actionId: string;
92
+ /** The user selected options for the action */
93
+ options: CompanionOptionValues;
94
+ /**
95
+ * Delay to give to this action
96
+ * This is always relative to the previous action
97
+ */
98
+ delay?: number;
99
+ }
100
+ //# sourceMappingURL=action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/module-api/action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,KAAK,EACX,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,EACxB,2BAA2B,EAC3B,gCAAgC,EAChC,yBAAyB,EACzB,6BAA6B,EAC7B,4BAA4B,EAC5B,iCAAiC,EACjC,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAE3D,MAAM,MAAM,6BAA6B,GACtC,6BAA6B,GAC7B,wBAAwB,GACxB,4BAA4B,GAC5B,2BAA2B,GAC3B,gCAAgC,GAChC,yBAAyB,GACzB,2BAA2B,GAC3B,iCAAiC,CAAA;AAEpC;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,8BAA8B;IAC7E;;;;;;OAMG;IACH,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAAA;CACjF;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,sCAAsC;IACtC,OAAO,EAAE,6BAA6B,EAAE,CAAA;IAExC;;;OAGG;IACH,2BAA2B,CAAC,EAAE,MAAM,EAAE,CAAA;IAEtC;;OAEG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAA;IAExC,mCAAmC;IACnC,QAAQ,EAAE,CAAC,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IACjG;;;OAGG;IACH,SAAS,CA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, "__esModule", { value: true });
3
+ //# sourceMappingURL=action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action.js","sourceRoot":"","sources":["../../src/module-api/action.ts"],"names":[],"mappings":""}
@@ -0,0 +1,199 @@
1
+ import type { CompanionActionDefinitions, CompanionRecordedAction } from './action.js';
2
+ import type { CompanionFeedbackDefinitions } from './feedback.js';
3
+ import type { CompanionPresetDefinitions } from './preset.js';
4
+ import type { InstanceStatus, LogLevel } from './enums.js';
5
+ import type { InstanceBaseShared } from '../instance-base.js';
6
+ import type { CompanionVariableDefinition, CompanionVariableValue, CompanionVariableValues } from './variable.js';
7
+ import type { OSCSomeArguments } from '../common/osc.js';
8
+ import type { SomeCompanionConfigField } from './config.js';
9
+ import type { CompanionHTTPRequest, CompanionHTTPResponse } from './http.js';
10
+ import { SharedUdpSocket, SharedUdpSocketMessageCallback, SharedUdpSocketOptions } from './shared-udp-socket.js';
11
+ export interface InstanceBaseOptions {
12
+ /**
13
+ * Disable enforcement of variables requiring a definition.
14
+ * It is not recommended to set this, unless you know what you are doing.
15
+ */
16
+ disableVariableValidation: boolean;
17
+ }
18
+ export declare abstract class InstanceBase<TConfig, TSecrets = undefined> implements InstanceBaseShared<TConfig, TSecrets> {
19
+ #private;
20
+ readonly id: string;
21
+ get instanceOptions(): InstanceBaseOptions;
22
+ /**
23
+ * The user chosen name for this instance.
24
+ * This can be changed just before `configUpdated` is called
25
+ */
26
+ get label(): string;
27
+ /**
28
+ * Create an instance of the module
29
+ */
30
+ constructor(internal: unknown);
31
+ private _handleInit;
32
+ private _handleDestroy;
33
+ private _handleConfigUpdateAndLabel;
34
+ private _handleExecuteAction;
35
+ private _handleUpdateFeedbacks;
36
+ private _handleUpdateActions;
37
+ private _handleUpgradeActionsAndFeedbacks;
38
+ private _handleGetConfigFields;
39
+ private _handleHttpRequest;
40
+ private _handleLearnAction;
41
+ private _handleLearnFeedback;
42
+ private _handleStartStopRecordActions;
43
+ private _handleSharedUdpSocketMessage;
44
+ private _handleSharedUdpSocketError;
45
+ /**
46
+ * Main initialization function called
47
+ * once the module is OK to start doing things.
48
+ */
49
+ abstract init(config: TConfig, isFirstInit: boolean, secrets: TSecrets): Promise<void>;
50
+ /**
51
+ * Clean up the instance before it is destroyed.
52
+ */
53
+ abstract destroy(): Promise<void>;
54
+ /**
55
+ * Called when the configuration is updated.
56
+ * @param config The new config object
57
+ */
58
+ abstract configUpdated(config: TConfig, secrets: TSecrets): Promise<void>;
59
+ /**
60
+ * Save an updated configuration object
61
+ * Note: The whole config object and the keys of the secrets object are reported to the webui, so be careful how sensitive data is stored
62
+ * @param newConfig The new config object, or undefined to not update the config
63
+ * @param newSecrets The new secrets object, or undefined to not update the secrets
64
+ */
65
+ saveConfig(this: InstanceBase<TConfig, undefined>, newConfig: TConfig | undefined, newSecrets?: undefined): void;
66
+ saveConfig(this: InstanceBase<TConfig, TSecrets>, newConfig: TConfig | undefined, newSecrets: TSecrets | undefined): void;
67
+ /**
68
+ * Creates the configuration fields for web config
69
+ */
70
+ abstract getConfigFields(): SomeCompanionConfigField[];
71
+ /**
72
+ * Handle HTTP requests from Companion
73
+ * @param request partial request object from Express
74
+ */
75
+ handleHttpRequest?(request: CompanionHTTPRequest): CompanionHTTPResponse | Promise<CompanionHTTPResponse>;
76
+ /**
77
+ * Handle request from Companion to start/stop recording actions
78
+ * @param isRecording whether recording is now running
79
+ */
80
+ handleStartStopRecordActions?(isRecording: boolean): void;
81
+ /**
82
+ * Set the action definitions for this instance
83
+ * @param actions The action definitions
84
+ */
85
+ setActionDefinitions(actions: CompanionActionDefinitions): void;
86
+ /**
87
+ * Set the feedback definitions for this instance
88
+ * @param feedbacks The feedback definitions
89
+ */
90
+ setFeedbackDefinitions(feedbacks: CompanionFeedbackDefinitions): void;
91
+ /**
92
+ * Set the peset definitions for this instance
93
+ * @param presets The preset definitions
94
+ */
95
+ setPresetDefinitions(presets: CompanionPresetDefinitions): void;
96
+ /**
97
+ * Set the variable definitions for this instance
98
+ * @param variables The variable definitions
99
+ */
100
+ setVariableDefinitions(variables: CompanionVariableDefinition[]): void;
101
+ /**
102
+ * Set the values of some variables
103
+ * @param values The new values for the variables
104
+ */
105
+ setVariableValues(values: CompanionVariableValues): void;
106
+ /**
107
+ * Get the last set value of a variable from this connection
108
+ * @param variableId id of the variable
109
+ * @returns The value
110
+ */
111
+ getVariableValue(variableId: string): CompanionVariableValue | undefined;
112
+ /**
113
+ * @deprecated Companion now handles this for you, for actions and feedbacks. If you need this for another purpose, let us know as we intend to remove this
114
+ *
115
+ * Parse and replace all the variables in a string
116
+ * Note: You must not use this for feedbacks, as your feedback will not update when the variable changes.
117
+ * There is an alternate version of this supplied to each of the action/feedback callbacks that tracks
118
+ * usages properly and will retrigger the feedback when the variables change.
119
+ * @param text The text to parse
120
+ * @returns The string with variables replaced with their values
121
+ */
122
+ parseVariablesInString(text: string): Promise<string>;
123
+ /**
124
+ * Request all feedbacks of the specified types to be checked for changes
125
+ * @param feedbackTypes The feedback types to check
126
+ */
127
+ checkFeedbacks(...feedbackTypes: string[]): void;
128
+ /**
129
+ * Request the specified feedback instances to be checked for changes
130
+ * @param feedbackIds The ids of the feedback instances to check
131
+ */
132
+ checkFeedbacksById(...feedbackIds: string[]): void;
133
+ /**
134
+ * Call subscribe on all currently known placed actions.
135
+ * It can be useful to trigger this upon establishing a connection, to ensure all data is loaded.
136
+ * @param actionIds The actionIds to call subscribe for. If no values are provided, then all are called.
137
+ */
138
+ subscribeActions(...actionIds: string[]): void;
139
+ /**
140
+ * Call unsubscribe on all currently known placed actions.
141
+ * It can be useful to do some cleanup upon a connection closing.
142
+ * @param actionIds The actionIds to call subscribe for. If no values are provided, then all are called.
143
+ */
144
+ unsubscribeActions(...actionIds: string[]): void;
145
+ /**
146
+ * Call subscribe on all currently known placed feedbacks.
147
+ * It can be useful to trigger this upon establishing a connection, to ensure all data is loaded.
148
+ * @param feedbackIds The feedbackIds to call subscribe for. If no values are provided, then all are called.
149
+ */
150
+ subscribeFeedbacks(...feedbackIds: string[]): void;
151
+ /**
152
+ * Call unsubscribe on all currently known placed feedbacks.
153
+ * It can be useful to do some cleanup upon a connection closing.
154
+ * @param feedbackIds The feedbackIds to call subscribe for. If no values are provided, then all are called.
155
+ */
156
+ unsubscribeFeedbacks(...feedbackIds: string[]): void;
157
+ /**
158
+ * Add an action to the current recording session
159
+ * @param action The action to be added to the recording session
160
+ * @param uniquenessId A unique id for the action being recorded. This should be different for each action, but by passing the same as a previous call will replace the previous value.
161
+ */
162
+ recordAction(action: CompanionRecordedAction, uniquenessId?: string): void;
163
+ /**
164
+ * Send an osc message from the system osc sender
165
+ * @param host destination ip address
166
+ * @param port destination port number
167
+ * @param path message path
168
+ * @param args mesage arguments
169
+ */
170
+ oscSend(host: string, port: number, path: string, args: OSCSomeArguments): void;
171
+ /**
172
+ * Update the status of this connection
173
+ * @param status The status level
174
+ * @param message Additional information about the status
175
+ *
176
+ * ### Example
177
+ * ```js
178
+ * this.updateStatus(InstanceStatus.Ok)
179
+ * ```
180
+ */
181
+ updateStatus(status: InstanceStatus, message?: string | null): void;
182
+ /**
183
+ * Write a line to the log
184
+ * @param level The level of the message
185
+ * @param message The message text to write
186
+ */
187
+ log(level: LogLevel, message: string): void;
188
+ /**
189
+ * Create a shared udp socket.
190
+ * This can be neccessary for modules where the device/software sends UDP messages to a hardcoded port number. In those
191
+ * cases if you don't use this then it won't be possible to use multiple instances of you module.
192
+ * The api here is a subset of the `Socket` from the builtin `node:dgram`, but with Companion hosting the sockets instead of the module.
193
+ * @param type Type of udp to use
194
+ * @param callback Message received callback
195
+ */
196
+ createSharedUdpSocket(type: 'udp4' | 'udp6', callback?: SharedUdpSocketMessageCallback): SharedUdpSocket;
197
+ createSharedUdpSocket(options: SharedUdpSocketOptions, callback?: SharedUdpSocketMessageCallback): SharedUdpSocket;
198
+ }
199
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/module-api/base.ts"],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