@companion-module/base 0.0.3

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 (95) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +14 -0
  3. package/dist/common/osc.d.ts +17 -0
  4. package/dist/common/osc.d.ts.map +1 -0
  5. package/dist/common/osc.js +7 -0
  6. package/dist/common/osc.js.map +1 -0
  7. package/dist/entrypoint.d.ts +12 -0
  8. package/dist/entrypoint.d.ts.map +1 -0
  9. package/dist/entrypoint.js +131 -0
  10. package/dist/entrypoint.js.map +1 -0
  11. package/dist/host-api/api.d.ts +212 -0
  12. package/dist/host-api/api.d.ts.map +1 -0
  13. package/dist/host-api/api.js +9 -0
  14. package/dist/host-api/api.js.map +1 -0
  15. package/dist/host-api/versions.d.ts +7 -0
  16. package/dist/host-api/versions.d.ts.map +1 -0
  17. package/dist/host-api/versions.js +5 -0
  18. package/dist/host-api/versions.js.map +1 -0
  19. package/dist/index.d.ts +6 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +15 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/instance-base.d.ts +12 -0
  24. package/dist/instance-base.d.ts.map +1 -0
  25. package/dist/instance-base.js +3 -0
  26. package/dist/instance-base.js.map +1 -0
  27. package/dist/internal/base.d.ts +24 -0
  28. package/dist/internal/base.d.ts.map +1 -0
  29. package/dist/internal/base.js +57 -0
  30. package/dist/internal/base.js.map +1 -0
  31. package/dist/internal/feedback.d.ts +5 -0
  32. package/dist/internal/feedback.d.ts.map +1 -0
  33. package/dist/internal/feedback.js +34 -0
  34. package/dist/internal/feedback.js.map +1 -0
  35. package/dist/internal/upgrade.d.ts +18 -0
  36. package/dist/internal/upgrade.d.ts.map +1 -0
  37. package/dist/internal/upgrade.js +126 -0
  38. package/dist/internal/upgrade.js.map +1 -0
  39. package/dist/manifest.d.ts +42 -0
  40. package/dist/manifest.d.ts.map +1 -0
  41. package/dist/manifest.js +9 -0
  42. package/dist/manifest.js.map +1 -0
  43. package/dist/module-api/action.d.ts +59 -0
  44. package/dist/module-api/action.d.ts.map +1 -0
  45. package/dist/module-api/action.js +3 -0
  46. package/dist/module-api/action.js.map +1 -0
  47. package/dist/module-api/base.d.ts +137 -0
  48. package/dist/module-api/base.d.ts.map +1 -0
  49. package/dist/module-api/base.js +613 -0
  50. package/dist/module-api/base.js.map +1 -0
  51. package/dist/module-api/config.d.ts +12 -0
  52. package/dist/module-api/config.d.ts.map +1 -0
  53. package/dist/module-api/config.js +3 -0
  54. package/dist/module-api/config.js.map +1 -0
  55. package/dist/module-api/enums.d.ts +21 -0
  56. package/dist/module-api/enums.d.ts.map +1 -0
  57. package/dist/module-api/enums.js +20 -0
  58. package/dist/module-api/enums.js.map +1 -0
  59. package/dist/module-api/feedback.d.ts +106 -0
  60. package/dist/module-api/feedback.d.ts.map +1 -0
  61. package/dist/module-api/feedback.js +3 -0
  62. package/dist/module-api/feedback.js.map +1 -0
  63. package/dist/module-api/http.d.ts +17 -0
  64. package/dist/module-api/http.d.ts.map +1 -0
  65. package/dist/module-api/http.js +3 -0
  66. package/dist/module-api/http.js.map +1 -0
  67. package/dist/module-api/index.d.ts +10 -0
  68. package/dist/module-api/index.d.ts.map +1 -0
  69. package/dist/module-api/index.js +13 -0
  70. package/dist/module-api/index.js.map +1 -0
  71. package/dist/module-api/input.d.ts +136 -0
  72. package/dist/module-api/input.d.ts.map +1 -0
  73. package/dist/module-api/input.js +3 -0
  74. package/dist/module-api/input.js.map +1 -0
  75. package/dist/module-api/preset.d.ts +102 -0
  76. package/dist/module-api/preset.d.ts.map +1 -0
  77. package/dist/module-api/preset.js +3 -0
  78. package/dist/module-api/preset.js.map +1 -0
  79. package/dist/module-api/style.d.ts +20 -0
  80. package/dist/module-api/style.d.ts.map +1 -0
  81. package/dist/module-api/style.js +3 -0
  82. package/dist/module-api/style.js.map +1 -0
  83. package/dist/module-api/upgrade.d.ts +95 -0
  84. package/dist/module-api/upgrade.d.ts.map +1 -0
  85. package/dist/module-api/upgrade.js +56 -0
  86. package/dist/module-api/upgrade.js.map +1 -0
  87. package/dist/module-api/variable.d.ts +18 -0
  88. package/dist/module-api/variable.d.ts.map +1 -0
  89. package/dist/module-api/variable.js +3 -0
  90. package/dist/module-api/variable.js.map +1 -0
  91. package/dist/util.d.ts +12 -0
  92. package/dist/util.d.ts.map +1 -0
  93. package/dist/util.js +37 -0
  94. package/dist/util.js.map +1 -0
  95. package/package.json +32 -0
@@ -0,0 +1,21 @@
1
+ /**
2
+ * All the possible status levels that an instance can use.
3
+ * Note: When adding more, companion needs to be updated to know how they should be displayed
4
+ */
5
+ export declare type InstanceStatus = 'ok' | 'connecting' | 'disconnected' | 'connection_failure' | 'bad_config' | 'unknown_error' | 'unknown_warning';
6
+ export declare type LogLevel = 'info' | 'warn' | 'error' | 'debug';
7
+ export declare namespace Regex {
8
+ const IP = "/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/";
9
+ const HOSTNAME = "/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/";
10
+ const BOOLEAN = "/^(true|false|0|1)$/i";
11
+ const PORT = "/^([1-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|[1-8][0-9]{3}|9[0-8][0-9]{2}|99[0-8][0-9]|999[0-9]|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-4])$/";
12
+ const PERCENT = "/^(100|[0-9]|[0-9][0-9])$/";
13
+ const FLOAT = "/^([0-9]*\\.)?[0-9]+$/";
14
+ const SIGNED_FLOAT = "/^[+-]?([0-9]*\\.)?[0-9]+$/";
15
+ const FLOAT_OR_INT = "/^([0-9]+)(\\.[0-9]+)?$/";
16
+ const NUMBER = "/^\\d+$/";
17
+ const SIGNED_NUMBER = "/^[+-]?\\d+$/";
18
+ const SOMETHING = "/^.+$/";
19
+ const TIMECODE = "/^(0*[0-9]|1[0-9]|2[0-4]):(0*[0-9]|[1-5][0-9]|60):(0*[0-9]|[1-5][0-9]|60):(0*[0-9]|[12][0-9]|30)$/";
20
+ }
21
+ //# sourceMappingURL=enums.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/module-api/enums.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,cAAc,GACvB,IAAI,GACJ,YAAY,GACZ,cAAc,GACd,oBAAoB,GACpB,YAAY,GACZ,eAAe,GACf,iBAAiB,CAAA;AAEpB,oBAAY,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;AAE1D,yBAAiB,KAAK,CAAC;IAEf,MAAM,EAAE,mGAAmG,CAAA;IAC3G,MAAM,QAAQ,iHAC0F,CAAA;IACxG,MAAM,OAAO,0BAA0B,CAAA;IACvC,MAAM,IAAI,4LACyK,CAAA;IACnL,MAAM,OAAO,+BAA+B,CAAA;IAC5C,MAAM,KAAK,2BAA2B,CAAA;IACtC,MAAM,YAAY,gCAAgC,CAAA;IAClD,MAAM,YAAY,6BAA6B,CAAA;IAC/C,MAAM,MAAM,aAAa,CAAA;IACzB,MAAM,aAAa,kBAAkB,CAAA;IACrC,MAAM,SAAS,WAAW,CAAA;IAC1B,MAAM,QAAQ,uGACgF,CAAA;CACrG"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Regex = void 0;
4
+ var Regex;
5
+ (function (Regex) {
6
+ // TODO - are all of these needed?
7
+ Regex.IP = '/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/';
8
+ Regex.HOSTNAME = '/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/';
9
+ Regex.BOOLEAN = '/^(true|false|0|1)$/i';
10
+ Regex.PORT = '/^([1-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|[1-8][0-9]{3}|9[0-8][0-9]{2}|99[0-8][0-9]|999[0-9]|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-4])$/';
11
+ Regex.PERCENT = '/^(100|[0-9]|[0-9][0-9])$/';
12
+ Regex.FLOAT = '/^([0-9]*\\.)?[0-9]+$/';
13
+ Regex.SIGNED_FLOAT = '/^[+-]?([0-9]*\\.)?[0-9]+$/';
14
+ Regex.FLOAT_OR_INT = '/^([0-9]+)(\\.[0-9]+)?$/';
15
+ Regex.NUMBER = '/^\\d+$/';
16
+ Regex.SIGNED_NUMBER = '/^[+-]?\\d+$/';
17
+ Regex.SOMETHING = '/^.+$/';
18
+ Regex.TIMECODE = '/^(0*[0-9]|1[0-9]|2[0-4]):(0*[0-9]|[1-5][0-9]|60):(0*[0-9]|[1-5][0-9]|60):(0*[0-9]|[12][0-9]|30)$/';
19
+ })(Regex = exports.Regex || (exports.Regex = {}));
20
+ //# sourceMappingURL=enums.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/module-api/enums.ts"],"names":[],"mappings":";;;AAeA,IAAiB,KAAK,CAiBrB;AAjBD,WAAiB,KAAK;IACrB,kCAAkC;IACrB,QAAE,GAAG,gGAAgG,CAAA;IACrG,cAAQ,GACpB,8GAA8G,CAAA;IAClG,aAAO,GAAG,uBAAuB,CAAA;IACjC,UAAI,GAChB,yLAAyL,CAAA;IAC7K,aAAO,GAAG,4BAA4B,CAAA;IACtC,WAAK,GAAG,wBAAwB,CAAA;IAChC,kBAAY,GAAG,6BAA6B,CAAA;IAC5C,kBAAY,GAAG,0BAA0B,CAAA;IACzC,YAAM,GAAG,UAAU,CAAA;IACnB,mBAAa,GAAG,eAAe,CAAA;IAC/B,eAAS,GAAG,QAAQ,CAAA;IACpB,cAAQ,GACpB,oGAAoG,CAAA;AACtG,CAAC,EAjBgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAiBrB"}
@@ -0,0 +1,106 @@
1
+ /// <reference types="node" />
2
+ import { SomeCompanionInputField, CompanionOptionValues } from './input.js';
3
+ import { CompanionAdditionalStyleProps, CompanionRequiredStyleProps } from './style.js';
4
+ /**
5
+ * Basic information about an instance of an feedback
6
+ */
7
+ export interface CompanionFeedbackInfo {
8
+ /** The type of the feedback */
9
+ readonly type: 'boolean' | 'advanced';
10
+ /** The unique id for this feedback */
11
+ readonly id: string;
12
+ /** The unique id for the location of this feedback */
13
+ readonly controlId: string;
14
+ /** The id of the feedback definition */
15
+ readonly feedbackId: string;
16
+ /** The user selected options for the feedback */
17
+ readonly options: CompanionOptionValues;
18
+ }
19
+ /**
20
+ * Extended information for execution of a boolean feedback
21
+ */
22
+ export interface CompanionFeedbackBooleanEvent extends CompanionFeedbackInfo {
23
+ /** @deprecated */
24
+ readonly _rawBank: any;
25
+ }
26
+ /**
27
+ * Extended information for execution of an advanced feedback
28
+ */
29
+ export interface CompanionFeedbackAdvancedEvent extends CompanionFeedbackInfo {
30
+ /** If control supports an imageBuffer, the dimensions the buffer must be */
31
+ readonly image?: {
32
+ readonly width: number;
33
+ readonly height: number;
34
+ };
35
+ /** @deprecated */
36
+ readonly _page: number;
37
+ /** @deprecated */
38
+ readonly _bank: number;
39
+ /** @deprecated */
40
+ readonly _rawBank: any;
41
+ }
42
+ /**
43
+ * The resulting style of a boolean feedback
44
+ */
45
+ export declare type CompanionFeedbackButtonStyleResult = Partial<CompanionRequiredStyleProps & CompanionAdditionalStyleProps>;
46
+ /** The resulting style of an advanced feedback */
47
+ export interface CompanionAdvancedFeedbackResult extends CompanionFeedbackButtonStyleResult {
48
+ imageBuffer?: Buffer;
49
+ }
50
+ /**
51
+ * The common definition of a feedback
52
+ */
53
+ export interface CompanionFeedbackDefinitionBase {
54
+ type: 'boolean' | 'advanced';
55
+ /** Name to show in the feedbacks list */
56
+ name: string;
57
+ /** Additional description of the feedback */
58
+ description?: string;
59
+ /** The input fields for the feedback */
60
+ options: SomeCompanionInputField[];
61
+ /**
62
+ * Called to report the existence of an feedback
63
+ * Useful to ensure necessary data is loaded
64
+ */
65
+ subscribe?: (feedback: CompanionFeedbackInfo) => void;
66
+ /**
67
+ * Called to report an feedback has been edited/removed
68
+ * Useful to cleanup subscriptions setup in subscribe
69
+ */
70
+ unsubscribe?: (feedback: CompanionFeedbackInfo) => void;
71
+ /**
72
+ * The user requested to 'learn' the values for this feedback.
73
+ */
74
+ learn?: (action: CompanionFeedbackInfo) => CompanionOptionValues | undefined | Promise<CompanionOptionValues | undefined>;
75
+ }
76
+ /**
77
+ * The definition of a boolean feedback
78
+ */
79
+ export interface CompanionBooleanFeedbackDefinition extends CompanionFeedbackDefinitionBase {
80
+ /** The type of the feedback */
81
+ type: 'boolean';
82
+ /** The default style properties for this feedback */
83
+ defaultStyle: Partial<CompanionFeedbackButtonStyleResult>;
84
+ /** Called to get the feedback value */
85
+ callback: (feedback: CompanionFeedbackBooleanEvent) => boolean;
86
+ }
87
+ /**
88
+ * The definition of an advanced feedback
89
+ */
90
+ export interface CompanionAdvancedFeedbackDefinition extends CompanionFeedbackDefinitionBase {
91
+ /** The type of the feedback */
92
+ type: 'advanced';
93
+ /** Called to get the feedback value */
94
+ callback: (feedback: CompanionFeedbackAdvancedEvent) => CompanionAdvancedFeedbackResult;
95
+ }
96
+ /**
97
+ * The definition of some feedback
98
+ */
99
+ export declare type CompanionFeedbackDefinition = CompanionBooleanFeedbackDefinition | CompanionAdvancedFeedbackDefinition;
100
+ /**
101
+ * The definitions of a group of feedbacks
102
+ */
103
+ export interface CompanionFeedbackDefinitions {
104
+ [id: string]: CompanionFeedbackDefinition | undefined;
105
+ }
106
+ //# sourceMappingURL=feedback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../src/module-api/feedback.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAC3E,OAAO,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAA;AAEvF;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,UAAU,CAAA;IACrC,sCAAsC;IACtC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,sDAAsD;IACtD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,wCAAwC;IACxC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,iDAAiD;IACjD,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAA;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,qBAAqB;IAG3E,kBAAkB;IAClB,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,8BAA+B,SAAQ,qBAAqB;IAG5E,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,CAAC,EAAE;QAChB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;QACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KACvB,CAAA;IAED,kBAAkB;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,kBAAkB;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IAEtB,kBAAkB;IAClB,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAA;CACtB;AAED;;GAEG;AACH,oBAAY,kCAAkC,GAAG,OAAO,CAA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AAC,EAAE,EAAE,MAAM,GAAG,2BAA2B,GAAG,SAAS,CAAA;CACrD"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=feedback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedback.js","sourceRoot":"","sources":["../../src/module-api/feedback.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ export interface CompanionHTTPRequest {
2
+ baseUrl: string;
3
+ body?: string;
4
+ headers: Record<string, string>;
5
+ hostname: string;
6
+ ip: string;
7
+ method: string;
8
+ originalUrl: string;
9
+ path: string;
10
+ query: Record<string, string>;
11
+ }
12
+ export interface CompanionHTTPResponse {
13
+ status?: number;
14
+ headers?: Record<string, any>;
15
+ body?: string;
16
+ }
17
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/module-api/http.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACpC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACrC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAA;CACb"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/module-api/http.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ export * from './action.js';
2
+ export * from './base.js';
3
+ export * from './config.js';
4
+ export * from './enums.js';
5
+ export * from './feedback.js';
6
+ export * from './input.js';
7
+ export * from './preset.js';
8
+ export * from './upgrade.js';
9
+ export * from './variable.js';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/module-api/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./action.js"), exports);
5
+ tslib_1.__exportStar(require("./base.js"), exports);
6
+ tslib_1.__exportStar(require("./config.js"), exports);
7
+ tslib_1.__exportStar(require("./enums.js"), exports);
8
+ tslib_1.__exportStar(require("./feedback.js"), exports);
9
+ tslib_1.__exportStar(require("./input.js"), exports);
10
+ tslib_1.__exportStar(require("./preset.js"), exports);
11
+ tslib_1.__exportStar(require("./upgrade.js"), exports);
12
+ tslib_1.__exportStar(require("./variable.js"), exports);
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/module-api/index.ts"],"names":[],"mappings":";;;AAAA,sDAA2B;AAC3B,oDAAyB;AACzB,sDAA2B;AAC3B,qDAA0B;AAC1B,wDAA6B;AAC7B,qDAA0B;AAC1B,sDAA2B;AAC3B,uDAA4B;AAC5B,wDAA6B"}
@@ -0,0 +1,136 @@
1
+ export declare type InputValue = number | string | boolean | Array<string | number>;
2
+ export interface CompanionOptionValues {
3
+ [key: string]: InputValue | undefined;
4
+ }
5
+ export declare type SomeCompanionInputField = CompanionInputFieldStaticText | CompanionInputFieldColor | CompanionInputFieldTextInput | CompanionInputFieldDropdown | CompanionInputFieldMultiDropdown | CompanionInputFieldNumber | CompanionInputFieldCheckbox;
6
+ /**
7
+ * The common properties for an input field
8
+ */
9
+ export interface CompanionInputFieldBase {
10
+ /** The unique id of this input field */
11
+ id: string;
12
+ /** The type of this input field */
13
+ type: 'static-text' | 'textinput' | 'dropdown' | 'multidropdown' | 'colorpicker' | 'number' | 'checkbox';
14
+ /** The label of the field */
15
+ label: string;
16
+ /** A hover tooltop for this field */
17
+ tooltip?: string;
18
+ /** A function called to check whether this input should be visible, based on the current options selections */
19
+ isVisible?: (options: any) => boolean;
20
+ }
21
+ /**
22
+ * A static un-editable line of text
23
+ */
24
+ export interface CompanionInputFieldStaticText extends CompanionInputFieldBase {
25
+ type: 'static-text';
26
+ /** The text to show */
27
+ value: string;
28
+ }
29
+ /**
30
+ * A colour picker input
31
+ */
32
+ export interface CompanionInputFieldColor extends CompanionInputFieldBase {
33
+ type: 'colorpicker';
34
+ /**
35
+ * The default color value
36
+ */
37
+ default: number;
38
+ }
39
+ /**
40
+ * A basic text input field
41
+ */
42
+ export interface CompanionInputFieldTextInput extends CompanionInputFieldBase {
43
+ type: 'textinput';
44
+ /**
45
+ * The default text value
46
+ */
47
+ default?: string;
48
+ /**
49
+ * Whether a value is required
50
+ * Note: values may not conform to this, it is a visual hint only
51
+ */
52
+ required?: boolean;
53
+ /**
54
+ * A regex to use to inform the user if the current input is valid.
55
+ * Note: values may not conform to this, it is a visual hint only
56
+ */
57
+ regex?: string;
58
+ }
59
+ export declare type DropdownChoiceId = string | number;
60
+ /**
61
+ * An option for a dropdown input
62
+ */
63
+ export interface DropdownChoice {
64
+ /** Value of the option */
65
+ id: DropdownChoiceId;
66
+ /** Label to show to users */
67
+ label: string;
68
+ }
69
+ /**
70
+ * A dropdown input field
71
+ */
72
+ export interface CompanionInputFieldDropdown extends CompanionInputFieldBase {
73
+ type: 'dropdown';
74
+ /** The possible choices */
75
+ choices: DropdownChoice[];
76
+ /** The default selected value */
77
+ default: DropdownChoiceId;
78
+ /** Allow custom values to be defined */
79
+ allowCustom?: boolean;
80
+ /** Check custom value against regex */
81
+ regex?: string;
82
+ /** The minimum number of entries the dropdown must have before it allows searching */
83
+ minChoicesForSearch?: number;
84
+ }
85
+ /**
86
+ * A multi-select dropdown input field
87
+ */
88
+ export interface CompanionInputFieldMultiDropdown extends CompanionInputFieldBase {
89
+ type: 'multidropdown';
90
+ /** The possible choices */
91
+ choices: DropdownChoice[];
92
+ /** The default selected values */
93
+ default: DropdownChoiceId[];
94
+ /** The minimum number of entries the dropdown must have before it allows searching */
95
+ minChoicesForSearch?: number;
96
+ /** The minimum number of selected values */
97
+ minSelection?: number;
98
+ /** The maximum number of selected values */
99
+ maximumSelectionLength?: number;
100
+ }
101
+ /**
102
+ * A checkbox input field
103
+ */
104
+ export interface CompanionInputFieldCheckbox extends CompanionInputFieldBase {
105
+ type: 'checkbox';
106
+ /** The default value */
107
+ default: boolean;
108
+ }
109
+ /**
110
+ * A number input field
111
+ */
112
+ export interface CompanionInputFieldNumber extends CompanionInputFieldBase {
113
+ type: 'number';
114
+ /** The default value */
115
+ default: number;
116
+ /**
117
+ * Whether a value is required
118
+ * Note: values may not conform to this, it is a visual hint only
119
+ */
120
+ required?: boolean;
121
+ /**
122
+ * The minimum value to allow
123
+ * Note: values may not conform to this, it is a visual hint only
124
+ */
125
+ min: number;
126
+ /**
127
+ * The maximum value to allow
128
+ * Note: values may not conform to this, it is a visual hint only
129
+ */
130
+ max: number;
131
+ /** The stepping of the arrows */
132
+ step?: number;
133
+ /** Whether to show a slider for the input */
134
+ range?: boolean;
135
+ }
136
+ //# sourceMappingURL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,CAAA;IAEf;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAA;IAEX,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,6CAA6C;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAA;CACf"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/module-api/input.ts"],"names":[],"mappings":""}
@@ -0,0 +1,102 @@
1
+ import { CompanionFeedbackButtonStyleResult } from './feedback.js';
2
+ import { CompanionOptionValues } from './input.js';
3
+ import { CompanionAdditionalStyleProps, CompanionRequiredStyleProps } from './style.js';
4
+ /**
5
+ * The base options for a preset
6
+ */
7
+ export interface CompanionPresetOptions {
8
+ relativeDelay?: boolean;
9
+ }
10
+ /**
11
+ * The options for a press button preset
12
+ */
13
+ export declare type CompanionPressPresetOptions = CompanionPresetOptions;
14
+ /**
15
+ * The options for a stepped button preset
16
+ */
17
+ export interface CompanionSteppedPresetOptions extends CompanionPresetOptions {
18
+ stepAutoProgress?: boolean;
19
+ }
20
+ /**
21
+ * The style properties for a preset
22
+ */
23
+ export declare type CompanionPresetStyle = CompanionRequiredStyleProps & Partial<CompanionAdditionalStyleProps>;
24
+ /**
25
+ * The configuration of an feedback in a preset
26
+ */
27
+ export interface CompanionPresetFeedback {
28
+ /** The id of the feedback definition */
29
+ feedbackId: string;
30
+ /** The option values for the action */
31
+ options: CompanionOptionValues;
32
+ /**
33
+ * If a boolean feedback, the style effect of the feedback
34
+ */
35
+ style?: CompanionFeedbackButtonStyleResult;
36
+ }
37
+ /**
38
+ * The configuration of an action in a preset
39
+ */
40
+ export interface CompanionPresetAction {
41
+ /** The id of the action definition */
42
+ actionId: string;
43
+ /** The execution delay of the action */
44
+ delay?: number;
45
+ /** The option values for the action */
46
+ options: CompanionOptionValues;
47
+ }
48
+ /**
49
+ * The definition of a press button preset
50
+ */
51
+ export interface CompanionPressButtonPresetDefinition {
52
+ /** The type of this preset */
53
+ type: 'press';
54
+ /** The category of this preset, for grouping */
55
+ category: string;
56
+ /** The name of this preset */
57
+ name: string;
58
+ /** The base style of this preset */
59
+ style: CompanionPresetStyle;
60
+ /** Options for this preset */
61
+ options?: CompanionPressPresetOptions;
62
+ /** The feedbacks on the button */
63
+ feedbacks: CompanionPresetFeedback[];
64
+ actions: {
65
+ /** The button down actions */
66
+ down: CompanionPresetAction[];
67
+ /** The button up actions */
68
+ up: CompanionPresetAction[];
69
+ };
70
+ }
71
+ /**
72
+ * The definition of a stepped button preset
73
+ */
74
+ export interface CompanionSteppedButtonPresetDefinition {
75
+ /** The type of this preset */
76
+ type: 'step';
77
+ /** The category of this preset, for grouping */
78
+ category: string;
79
+ /** The name of this preset */
80
+ name: string;
81
+ /** The base style of this preset */
82
+ style: CompanionPresetStyle;
83
+ /** Options for this preset */
84
+ options?: CompanionSteppedPresetOptions;
85
+ /** The feedbacks on the button */
86
+ feedbacks: CompanionPresetFeedback[];
87
+ /** The steps of this button, and their actions */
88
+ actions: {
89
+ [step: number]: CompanionPresetAction[];
90
+ };
91
+ }
92
+ /**
93
+ * The definition of some preset
94
+ */
95
+ export declare type SomeCompanionPresetDefinition = CompanionSteppedButtonPresetDefinition | CompanionPressButtonPresetDefinition;
96
+ /**
97
+ * The definitions of a group of feedbacks
98
+ */
99
+ export interface CompanionPresetDefinitions {
100
+ [id: string]: SomeCompanionPresetDefinition | undefined;
101
+ }
102
+ //# sourceMappingURL=preset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../src/module-api/preset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,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BAAqB,EAAE,CAAA;KAC3B,CAAA;CACD;AAED;;GAEG;AACH,MAAM,WAAW,sCAAsC;IACtD,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAA;IAChB,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,oCAAoC;IACpC,KAAK,EAAE,oBAAoB,CAAA;IAC3B,8BAA8B;IAC9B,OAAO,CAAC,EAAE,6BAA6B,CAAA;IACvC,kCAAkC;IAClC,SAAS,EAAE,uBAAuB,EAAE,CAAA;IACpC,kDAAkD;IAClD,OAAO,EAAE;QACR,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,EAAE,CAAA;KACvC,CAAA;CACD;AAED;;GAEG;AACH,oBAAY,6BAA6B,GACtC,sCAAsC,GACtC,oCAAoC,CAAA;AAEvC;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C,CAAC,EAAE,EAAE,MAAM,GAAG,6BAA6B,GAAG,SAAS,CAAA;CACvD"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=preset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preset.js","sourceRoot":"","sources":["../../src/module-api/preset.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ export declare type CompanionAlignment = 'left:top' | 'center:top' | 'right:top' | 'left:center' | 'center:center' | 'right:center' | 'left:bottom' | 'center:bottom' | 'right:bottom';
2
+ export declare type CompanionTextSize = 'auto' | '7' | '14' | '18' | '24' | '30' | '44';
3
+ /**
4
+ * The basic style properties for a button
5
+ */
6
+ export interface CompanionRequiredStyleProps {
7
+ text: string;
8
+ size: CompanionTextSize;
9
+ color: number;
10
+ bgcolor: number;
11
+ }
12
+ /**
13
+ * The additional style properties for a button
14
+ */
15
+ export interface CompanionAdditionalStyleProps {
16
+ alignment: CompanionAlignment;
17
+ pngalignment: CompanionAlignment;
18
+ png64?: string;
19
+ }
20
+ //# sourceMappingURL=style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../src/module-api/style.ts"],"names":[],"mappings":"AAAA,oBAAY,kBAAkB,GAC3B,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,eAAe,GACf,cAAc,GACd,aAAa,GACb,eAAe,GACf,cAAc,CAAA;AAEjB,oBAAY,iBAAiB,GAAG,MAAM,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAE/E;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC3C,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,iBAAiB,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC7C,SAAS,EAAE,kBAAkB,CAAA;IAC7B,YAAY,EAAE,kBAAkB,CAAA;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;CACd"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/module-api/style.ts"],"names":[],"mappings":""}
@@ -0,0 +1,95 @@
1
+ import { CompanionFeedbackButtonStyleResult } from './feedback.js';
2
+ import { CompanionOptionValues } from './input.js';
3
+ /** For future use */
4
+ export declare type CompanionUpgradeContext = unknown;
5
+ /**
6
+ * The items for an upgrade script to upgrade
7
+ */
8
+ export interface CompanionStaticUpgradeProps<TConfig> {
9
+ /**
10
+ * The module config to upgrade, if any
11
+ */
12
+ config: TConfig | null;
13
+ /**
14
+ * The actions to upgrade
15
+ */
16
+ actions: CompanionMigrationAction[];
17
+ /**
18
+ * The feedbacks to upgrade
19
+ */
20
+ feedbacks: CompanionMigrationFeedback[];
21
+ }
22
+ /**
23
+ * The result of an upgrade script
24
+ */
25
+ export interface CompanionStaticUpgradeResult<TConfig> {
26
+ /**
27
+ * The updated config, if any changes were made
28
+ */
29
+ updatedConfig: TConfig | null;
30
+ /**
31
+ * Any changed actions
32
+ */
33
+ updatedActions: CompanionMigrationAction[];
34
+ /**
35
+ * Any changed feedbacks
36
+ */
37
+ updatedFeedbacks: CompanionMigrationFeedback[];
38
+ }
39
+ /**
40
+ * The definition of an upgrade script function
41
+ */
42
+ export declare type CompanionStaticUpgradeScript<TConfig> = (context: CompanionUpgradeContext, props: CompanionStaticUpgradeProps<TConfig>) => CompanionStaticUpgradeResult<TConfig>;
43
+ /**
44
+ * An action that could be upgraded
45
+ */
46
+ export interface CompanionMigrationAction {
47
+ /** The unique id for this action */
48
+ readonly id: string;
49
+ /** The unique id for the location of this action */
50
+ readonly controlId: string;
51
+ /** The id of the action definition */
52
+ actionId: string;
53
+ /** The execution delay of the action */
54
+ delay?: number;
55
+ /** The user selected options for the action */
56
+ options: CompanionOptionValues;
57
+ }
58
+ /**
59
+ * A feedback that could be upgraded
60
+ */
61
+ export interface CompanionMigrationFeedback {
62
+ /** The unique id for this feedback */
63
+ readonly id: string;
64
+ /** The unique id for the location of this feedback */
65
+ readonly controlId: string;
66
+ /** The id of the feedback definition */
67
+ feedbackId: string;
68
+ /** The user selected options for the feedback */
69
+ options: CompanionOptionValues;
70
+ /**
71
+ * If the feedback is being converted to a boolean feedback, the style can be set here.
72
+ * If it is already a booelan feedback or is a different type of feedback, this will be ignored
73
+ */
74
+ style?: Partial<CompanionFeedbackButtonStyleResult>;
75
+ }
76
+ /**
77
+ * A helper upgrade script, which does nothing.
78
+ * Useful to replace a script which is no longer needed
79
+ */
80
+ export declare const EmptyUpgradeScript: CompanionStaticUpgradeScript<any>;
81
+ /**
82
+ * Definition of how to convert options to style properties for boolean feedbacks
83
+ */
84
+ export interface CompanionUpgradeToBooleanFeedbackMap {
85
+ [feedback_id: string]: true | {
86
+ [option_key: string]: 'text' | 'size' | 'color' | 'bgcolor' | 'alignment' | 'pngalignment' | 'png64';
87
+ } | undefined;
88
+ }
89
+ /**
90
+ * A helper script to automate the bulk of the process to upgrade feedbacks from 'advanced' to 'boolean'.
91
+ * There are some built in rules for properties names based on the most common cases
92
+ * @param upgradeMap The feedbacks to upgrade and the properties to convert
93
+ */
94
+ export declare function CreateConvertToBooleanFeedbackUpgradeScript<TConfig = unknown>(upgradeMap: CompanionUpgradeToBooleanFeedbackMap): CompanionStaticUpgradeScript<TConfig>;
95
+ //# sourceMappingURL=upgrade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/module-api/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAElD,qBAAqB;AACrB,oBAAY,uBAAuB,GAAG,OAAO,CAAA;AAE7C;;GAEG;AACH,MAAM,WAAW,2BAA2B,CAAC,OAAO;IACnD;;OAEG;IACH,MAAM,EAAE,OAAO,GAAG,IAAI,CAAA;IACtB;;OAEG;IACH,OAAO,EAAE,wBAAwB,EAAE,CAAA;IACnC;;OAEG;IACH,SAAS,EAAE,0BAA0B,EAAE,CAAA;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B,CAAC,OAAO;IACpD;;OAEG;IACH,aAAa,EAAE,OAAO,GAAG,IAAI,CAAA;IAC7B;;OAEG;IACH,cAAc,EAAE,wBAAwB,EAAE,CAAA;IAC1C;;OAEG;IACH,gBAAgB,EAAE,0BAA0B,EAAE,CAAA;CAC9C;AAED;;GAEG;AACH,oBAAY,4BAA4B,CAAC,OAAO,IAAI,CACnD,OAAO,EAAE,uBAAuB,EAChC,KAAK,EAAE,2BAA2B,CAAC,OAAO,CAAC,KACvC,4BAA4B,CAAC,OAAO,CAAC,CAAA;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