camstreamerlib 4.0.0-beta.6 → 4.0.0-beta.61

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 (265) hide show
  1. package/README.md +142 -38
  2. package/cjs/CamOverlayAPI.js +135 -92
  3. package/cjs/CamScripterAPI.js +52 -42
  4. package/cjs/CamStreamerAPI.js +83 -39
  5. package/cjs/CamSwitcherAPI.js +142 -124
  6. package/cjs/PlaneTrackerAPI.js +247 -0
  7. package/cjs/VapixAPI.js +323 -233
  8. package/cjs/{CreatePackage.js → bin/CreatePackage.js} +22 -19
  9. package/cjs/errors/errors.js +113 -1
  10. package/cjs/index.js +28 -5
  11. package/cjs/internal/ProxyClient.js +28 -32
  12. package/cjs/{CamSwitcherEvents.js → internal/WsEvents.js} +28 -22
  13. package/cjs/internal/types.js +2 -0
  14. package/cjs/internal/utils.js +22 -3
  15. package/cjs/{CamOverlayDrawingAPI.js → node/CamOverlayDrawingAPI.js} +17 -14
  16. package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Frame.js +33 -0
  17. package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Painter.js +5 -17
  18. package/cjs/node/CamOverlayPainter/ResourceManager.js +72 -0
  19. package/cjs/{CamScripterAPICameraEventsGenerator.js → node/CamScripterAPICameraEventsGenerator.js} +16 -13
  20. package/cjs/node/DefaultClient.js +10 -12
  21. package/cjs/{internal → node}/Digest.js +8 -5
  22. package/cjs/node/Digest.test.js +13 -0
  23. package/cjs/node/HttpRequestSender.js +14 -4
  24. package/cjs/node/HttpServer.js +15 -12
  25. package/cjs/{VapixEvents.js → node/VapixEvents.js} +10 -10
  26. package/cjs/node/WsClient.js +30 -20
  27. package/cjs/node/events/AxisCameraStationEvents.js +53 -0
  28. package/cjs/node/events/GenetecAgent.js +123 -0
  29. package/cjs/node/index.js +38 -5
  30. package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +92 -0
  31. package/cjs/types/CamOverlayAPI/accuweatherSchema.js +47 -0
  32. package/cjs/types/CamOverlayAPI/customGraphicsSchema.js +72 -0
  33. package/cjs/types/CamOverlayAPI/imagesSchema.js +9 -0
  34. package/cjs/types/CamOverlayAPI/index.js +27 -0
  35. package/cjs/types/CamOverlayAPI/infotickerSchema.js +26 -0
  36. package/cjs/types/CamOverlayAPI/pipSchema.js +39 -0
  37. package/cjs/types/CamOverlayAPI/ptzCompassSchema.js +26 -0
  38. package/cjs/types/CamOverlayAPI/ptzSchema.js +12 -0
  39. package/cjs/types/CamOverlayAPI/scoreBoardSchema.js +132 -0
  40. package/cjs/types/CamOverlayAPI/screenSharingSchema.js +8 -0
  41. package/cjs/types/CamOverlayAPI/serviceCommonTypes.js +91 -0
  42. package/cjs/types/CamOverlayAPI/webCameraSharingSchema.js +8 -0
  43. package/cjs/types/CamOverlayDrawingAPI.js +2 -0
  44. package/cjs/types/CamOverlayPainter.js +14 -0
  45. package/cjs/types/CamScripterAPI.js +24 -8
  46. package/cjs/types/CamScripterAPICameraEventsGenerator.js +2 -0
  47. package/cjs/types/CamStreamerAPI.js +34 -3
  48. package/cjs/types/CamSwitcherAPI.js +38 -1
  49. package/cjs/types/GenetecAgent.js +31 -0
  50. package/cjs/types/PlaneTrackerAPI.js +310 -0
  51. package/cjs/types/VapixAPI.js +71 -13
  52. package/cjs/types/VapixEvents.js +2 -0
  53. package/cjs/types/common.js +4 -2
  54. package/cjs/types/ws/CamOverlayEvents.js +19 -0
  55. package/cjs/types/ws/CamStreamerEvents.js +32 -0
  56. package/cjs/types/{CamSwitcherEvents.js → ws/CamSwitcherEvents.js} +8 -0
  57. package/cjs/types/ws/PlaneTrackerEvents.js +194 -0
  58. package/cjs/web/DefaultClient.js +26 -10
  59. package/cjs/web/WsClient.js +16 -18
  60. package/cjs/ws/CamOverlayEvents.js +24 -0
  61. package/cjs/ws/CamStreamerEvents.js +24 -0
  62. package/cjs/ws/CamSwitcherEvents.js +24 -0
  63. package/cjs/ws/PlaneTrackerEvents.js +30 -0
  64. package/esm/CamOverlayAPI.js +131 -88
  65. package/esm/CamScripterAPI.js +48 -38
  66. package/esm/CamStreamerAPI.js +81 -38
  67. package/esm/CamSwitcherAPI.js +138 -120
  68. package/esm/PlaneTrackerAPI.js +243 -0
  69. package/esm/VapixAPI.js +315 -225
  70. package/esm/{CreatePackage.js → bin/CreatePackage.js} +3 -3
  71. package/esm/errors/errors.js +96 -0
  72. package/esm/index.js +20 -4
  73. package/esm/internal/ProxyClient.js +28 -32
  74. package/esm/{CamSwitcherEvents.js → internal/WsEvents.js} +26 -20
  75. package/esm/internal/utils.js +17 -1
  76. package/esm/{CamOverlayDrawingAPI.js → node/CamOverlayDrawingAPI.js} +12 -12
  77. package/esm/{CamOverlayPainter → node/CamOverlayPainter}/Frame.js +33 -0
  78. package/esm/{CamOverlayPainter → node/CamOverlayPainter}/Painter.js +2 -13
  79. package/esm/{CamOverlayPainter → node/CamOverlayPainter}/ResourceManager.js +7 -5
  80. package/esm/{CamScripterAPICameraEventsGenerator.js → node/CamScripterAPICameraEventsGenerator.js} +11 -11
  81. package/esm/node/DefaultClient.js +10 -12
  82. package/esm/{internal → node}/Digest.js +1 -1
  83. package/esm/node/Digest.test.js +11 -0
  84. package/esm/node/HttpRequestSender.js +14 -4
  85. package/esm/node/HttpServer.js +5 -5
  86. package/esm/{VapixEvents.js → node/VapixEvents.js} +10 -10
  87. package/esm/node/WsClient.js +22 -15
  88. package/esm/{events → node/events}/AxisCameraStationEvents.js +18 -13
  89. package/esm/node/events/GenetecAgent.js +119 -0
  90. package/esm/node/index.js +17 -2
  91. package/esm/types/CamOverlayAPI/CamOverlayAPI.js +76 -0
  92. package/esm/types/CamOverlayAPI/accuweatherSchema.js +44 -0
  93. package/esm/types/CamOverlayAPI/customGraphicsSchema.js +69 -0
  94. package/esm/types/CamOverlayAPI/imagesSchema.js +6 -0
  95. package/esm/types/CamOverlayAPI/index.js +11 -0
  96. package/esm/types/CamOverlayAPI/infotickerSchema.js +23 -0
  97. package/esm/types/CamOverlayAPI/pipSchema.js +36 -0
  98. package/esm/types/CamOverlayAPI/ptzCompassSchema.js +23 -0
  99. package/esm/types/CamOverlayAPI/ptzSchema.js +9 -0
  100. package/esm/types/CamOverlayAPI/scoreBoardSchema.js +129 -0
  101. package/esm/types/CamOverlayAPI/screenSharingSchema.js +5 -0
  102. package/esm/types/CamOverlayAPI/serviceCommonTypes.js +88 -0
  103. package/esm/types/CamOverlayAPI/webCameraSharingSchema.js +5 -0
  104. package/esm/types/CamOverlayPainter.js +11 -0
  105. package/esm/types/CamScripterAPI.js +23 -7
  106. package/esm/types/CamScripterAPICameraEventsGenerator.js +1 -0
  107. package/esm/types/CamStreamerAPI.js +33 -2
  108. package/esm/types/CamSwitcherAPI.js +38 -1
  109. package/esm/types/GenetecAgent.js +28 -0
  110. package/esm/types/PlaneTrackerAPI.js +307 -0
  111. package/esm/types/VapixAPI.js +70 -12
  112. package/esm/types/VapixEvents.js +1 -0
  113. package/esm/types/common.js +3 -1
  114. package/esm/types/ws/CamOverlayEvents.js +16 -0
  115. package/esm/types/ws/CamStreamerEvents.js +29 -0
  116. package/esm/types/{CamSwitcherEvents.js → ws/CamSwitcherEvents.js} +8 -0
  117. package/esm/types/ws/PlaneTrackerEvents.js +191 -0
  118. package/esm/web/DefaultClient.js +26 -10
  119. package/esm/web/WsClient.js +16 -18
  120. package/esm/ws/CamOverlayEvents.js +20 -0
  121. package/esm/ws/CamStreamerEvents.js +20 -0
  122. package/esm/ws/CamSwitcherEvents.js +20 -0
  123. package/esm/ws/PlaneTrackerEvents.js +26 -0
  124. package/package.json +29 -11
  125. package/types/CamOverlayAPI.d.ts +867 -0
  126. package/types/CamScripterAPI.d.ts +46 -0
  127. package/types/CamStreamerAPI.d.ts +64 -0
  128. package/types/CamSwitcherAPI.d.ts +167 -0
  129. package/types/PlaneTrackerAPI.d.ts +229 -0
  130. package/types/VapixAPI.d.ts +118 -0
  131. package/types/bin/CreatePackage.d.ts +1 -0
  132. package/types/errors/errors.d.ts +83 -0
  133. package/types/index.d.ts +27 -0
  134. package/types/internal/ProxyClient.d.ts +10 -0
  135. package/types/internal/WsEvents.d.ts +37 -0
  136. package/types/internal/types.d.ts +47 -0
  137. package/{cjs → types}/internal/utils.d.ts +4 -1
  138. package/{cjs → types}/internal/versionCompare.d.ts +2 -2
  139. package/types/node/CamOverlayDrawingAPI.d.ts +41 -0
  140. package/{esm → types/node}/CamOverlayPainter/Frame.d.ts +8 -37
  141. package/{cjs → types/node}/CamOverlayPainter/Painter.d.ts +5 -21
  142. package/types/node/CamOverlayPainter/ResourceManager.d.ts +15 -0
  143. package/types/node/CamScripterAPICameraEventsGenerator.d.ts +31 -0
  144. package/types/node/DefaultClient.d.ts +16 -0
  145. package/types/node/Digest.test.d.ts +1 -0
  146. package/{esm → types}/node/HttpRequestSender.d.ts +1 -0
  147. package/{cjs → types}/node/HttpServer.d.ts +2 -2
  148. package/types/node/VapixEvents.d.ts +16 -0
  149. package/types/node/WsClient.d.ts +30 -0
  150. package/types/node/events/AxisCameraStationEvents.d.ts +12 -0
  151. package/types/node/events/GenetecAgent.d.ts +16 -0
  152. package/types/node/index.d.ts +17 -0
  153. package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +4330 -0
  154. package/types/types/CamOverlayAPI/accuweatherSchema.d.ts +84 -0
  155. package/types/types/CamOverlayAPI/customGraphicsSchema.d.ts +700 -0
  156. package/types/types/CamOverlayAPI/imagesSchema.d.ts +95 -0
  157. package/types/types/CamOverlayAPI/index.d.ts +11 -0
  158. package/types/types/CamOverlayAPI/infotickerSchema.d.ts +96 -0
  159. package/types/types/CamOverlayAPI/pipSchema.d.ts +125 -0
  160. package/types/types/CamOverlayAPI/ptzCompassSchema.d.ts +96 -0
  161. package/types/types/CamOverlayAPI/ptzSchema.d.ts +118 -0
  162. package/types/types/CamOverlayAPI/scoreBoardSchema.d.ts +357 -0
  163. package/types/types/CamOverlayAPI/screenSharingSchema.d.ts +58 -0
  164. package/types/types/CamOverlayAPI/serviceCommonTypes.d.ts +145 -0
  165. package/types/types/CamOverlayAPI/webCameraSharingSchema.d.ts +58 -0
  166. package/types/types/CamOverlayDrawingAPI.d.ts +48 -0
  167. package/types/types/CamOverlayPainter.d.ts +76 -0
  168. package/types/types/CamScripterAPI.d.ts +130 -0
  169. package/types/types/CamScripterAPICameraEventsGenerator.d.ts +45 -0
  170. package/types/types/CamStreamerAPI.d.ts +272 -0
  171. package/{esm → types}/types/CamSwitcherAPI.d.ts +145 -66
  172. package/{esm/events → types/types}/GenetecAgent.d.ts +47 -47
  173. package/types/types/PlaneTrackerAPI.d.ts +918 -0
  174. package/{cjs → types}/types/VapixAPI.d.ts +647 -465
  175. package/types/types/VapixEvents.d.ts +15 -0
  176. package/{cjs → types}/types/common.d.ts +17 -5
  177. package/types/types/ws/CamOverlayEvents.d.ts +88 -0
  178. package/types/types/ws/CamStreamerEvents.d.ts +249 -0
  179. package/{cjs/types → types/types/ws}/CamSwitcherEvents.d.ts +77 -0
  180. package/types/types/ws/PlaneTrackerEvents.d.ts +1597 -0
  181. package/types/web/DefaultClient.d.ts +8 -0
  182. package/types/web/WsClient.d.ts +17 -0
  183. package/types/ws/CamOverlayEvents.d.ts +8 -0
  184. package/types/ws/CamStreamerEvents.d.ts +8 -0
  185. package/types/ws/CamSwitcherEvents.d.ts +8 -0
  186. package/types/ws/PlaneTrackerEvents.d.ts +9 -0
  187. package/cjs/CamOverlayAPI.d.ts +0 -31
  188. package/cjs/CamOverlayDrawingAPI.d.ts +0 -86
  189. package/cjs/CamOverlayPainter/Frame.d.ts +0 -96
  190. package/cjs/CamOverlayPainter/ResourceManager.d.ts +0 -14
  191. package/cjs/CamOverlayPainter/ResourceManager.js +0 -46
  192. package/cjs/CamScripterAPI.d.ts +0 -19
  193. package/cjs/CamScripterAPICameraEventsGenerator.d.ts +0 -74
  194. package/cjs/CamStreamerAPI.d.ts +0 -16
  195. package/cjs/CamSwitcherAPI.d.ts +0 -48
  196. package/cjs/CamSwitcherEvents.d.ts +0 -18
  197. package/cjs/VapixAPI.d.ts +0 -66
  198. package/cjs/VapixEvents.d.ts +0 -43
  199. package/cjs/errors/errors.d.ts +0 -34
  200. package/cjs/events/AxisCameraStationEvents.d.ts +0 -9
  201. package/cjs/events/AxisCameraStationEvents.js +0 -48
  202. package/cjs/events/GenetecAgent.d.ts +0 -174
  203. package/cjs/events/GenetecAgent.js +0 -123
  204. package/cjs/index.d.ts +0 -11
  205. package/cjs/internal/ProxyClient.d.ts +0 -11
  206. package/cjs/internal/common.d.ts +0 -39
  207. package/cjs/internal/common.js +0 -27
  208. package/cjs/node/DefaultClient.d.ts +0 -15
  209. package/cjs/node/HttpRequestSender.d.ts +0 -28
  210. package/cjs/node/WsClient.d.ts +0 -39
  211. package/cjs/node/WsEventClient.d.ts +0 -13
  212. package/cjs/node/WsEventClient.js +0 -22
  213. package/cjs/types/CamOverlayAPI.d.ts +0 -188
  214. package/cjs/types/CamOverlayAPI.js +0 -47
  215. package/cjs/types/CamScripterAPI.d.ts +0 -67
  216. package/cjs/types/CamStreamerAPI.d.ts +0 -139
  217. package/cjs/types/CamSwitcherAPI.d.ts +0 -814
  218. package/cjs/web/DefaultClient.d.ts +0 -6
  219. package/cjs/web/WsClient.d.ts +0 -13
  220. package/cjs/web/index.d.ts +0 -2
  221. package/esm/CamOverlayAPI.d.ts +0 -31
  222. package/esm/CamOverlayDrawingAPI.d.ts +0 -86
  223. package/esm/CamOverlayPainter/Painter.d.ts +0 -48
  224. package/esm/CamOverlayPainter/ResourceManager.d.ts +0 -14
  225. package/esm/CamScripterAPI.d.ts +0 -19
  226. package/esm/CamScripterAPICameraEventsGenerator.d.ts +0 -74
  227. package/esm/CamStreamerAPI.d.ts +0 -16
  228. package/esm/CamSwitcherAPI.d.ts +0 -48
  229. package/esm/CamSwitcherEvents.d.ts +0 -18
  230. package/esm/VapixAPI.d.ts +0 -66
  231. package/esm/VapixEvents.d.ts +0 -43
  232. package/esm/errors/errors.d.ts +0 -34
  233. package/esm/events/AxisCameraStationEvents.d.ts +0 -9
  234. package/esm/events/GenetecAgent.js +0 -119
  235. package/esm/index.d.ts +0 -11
  236. package/esm/internal/Digest.d.ts +0 -4
  237. package/esm/internal/ProxyClient.d.ts +0 -11
  238. package/esm/internal/common.d.ts +0 -39
  239. package/esm/internal/common.js +0 -20
  240. package/esm/internal/constants.d.ts +0 -1
  241. package/esm/internal/transformers.d.ts +0 -5
  242. package/esm/internal/utils.d.ts +0 -11
  243. package/esm/internal/versionCompare.d.ts +0 -6
  244. package/esm/node/DefaultClient.d.ts +0 -15
  245. package/esm/node/HttpServer.d.ts +0 -21
  246. package/esm/node/WsClient.d.ts +0 -39
  247. package/esm/node/WsEventClient.d.ts +0 -13
  248. package/esm/node/WsEventClient.js +0 -18
  249. package/esm/node/index.d.ts +0 -2
  250. package/esm/types/CamOverlayAPI.d.ts +0 -188
  251. package/esm/types/CamOverlayAPI.js +0 -44
  252. package/esm/types/CamScripterAPI.d.ts +0 -67
  253. package/esm/types/CamStreamerAPI.d.ts +0 -139
  254. package/esm/types/CamSwitcherEvents.d.ts +0 -491
  255. package/esm/types/VapixAPI.d.ts +0 -1683
  256. package/esm/types/common.d.ts +0 -37
  257. package/esm/web/DefaultClient.d.ts +0 -6
  258. package/esm/web/WsClient.d.ts +0 -13
  259. package/esm/web/index.d.ts +0 -2
  260. /package/{cjs/CreatePackage.d.ts → esm/internal/types.js} +0 -0
  261. /package/esm/{CreatePackage.d.ts → types/CamOverlayDrawingAPI.js} +0 -0
  262. /package/{cjs → types}/internal/constants.d.ts +0 -0
  263. /package/{cjs → types}/internal/transformers.d.ts +0 -0
  264. /package/{cjs/internal → types/node}/Digest.d.ts +0 -0
  265. /package/{cjs/node → types/web}/index.d.ts +0 -0
@@ -1,17 +1,20 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const AdmZip = require("adm-zip");
4
- const Path = require("path");
5
- const fs = require("fs");
6
+ const adm_zip_1 = __importDefault(require("adm-zip"));
7
+ const path_1 = __importDefault(require("path"));
8
+ const fs_1 = __importDefault(require("fs"));
6
9
  const child_process_1 = require("child_process");
7
10
  const productionModulesFolder = 'production_modules';
8
11
  function isDirectory(path) {
9
- const stat = fs.statSync(path);
12
+ const stat = fs_1.default.statSync(path);
10
13
  return stat.isDirectory();
11
14
  }
12
15
  function getPackageInfo(folder) {
13
16
  try {
14
- const manifest = fs.readFileSync(Path.join(folder, 'manifest.json'));
17
+ const manifest = fs_1.default.readFileSync(path_1.default.join(folder, 'manifest.json'));
15
18
  const manifestParsed = JSON.parse(manifest.toString());
16
19
  return {
17
20
  packageName: manifestParsed.package_name,
@@ -23,10 +26,10 @@ function getPackageInfo(folder) {
23
26
  }
24
27
  }
25
28
  function createZipArchive(zip, folder, options) {
26
- const zipFileRegex = new RegExp(`${Path.basename(folder)}(_[0-9]){3}\\.zip`);
27
- const files = fs.readdirSync(folder);
29
+ const zipFileRegex = new RegExp(`${path_1.default.basename(folder)}(_[0-9]){3}\\.zip`);
30
+ const files = fs_1.default.readdirSync(folder);
28
31
  for (const file of files) {
29
- const path = Path.join(folder, file);
32
+ const path = path_1.default.join(folder, file);
30
33
  const isDir = isDirectory(path);
31
34
  if (file[0] === '.' ||
32
35
  zipFileRegex.test(file) ||
@@ -39,7 +42,7 @@ function createZipArchive(zip, folder, options) {
39
42
  zip.addLocalFolder(path);
40
43
  }
41
44
  else if (file === productionModulesFolder && options.includeNodeModules) {
42
- zip.addLocalFolder(Path.join(productionModulesFolder, 'node_modules'), 'node_modules');
45
+ zip.addLocalFolder(path_1.default.join(productionModulesFolder, 'node_modules'), 'node_modules');
43
46
  }
44
47
  else if (isDir) {
45
48
  zip.addLocalFolder(path, file);
@@ -50,13 +53,13 @@ function createZipArchive(zip, folder, options) {
50
53
  }
51
54
  }
52
55
  function installDependencies() {
53
- if (!fs.existsSync(productionModulesFolder)) {
54
- fs.mkdirSync(productionModulesFolder, {});
56
+ if (!fs_1.default.existsSync(productionModulesFolder)) {
57
+ fs_1.default.mkdirSync(productionModulesFolder, {});
55
58
  }
56
- fs.cpSync('package.json', Path.join(productionModulesFolder, 'package.json'));
57
- fs.cpSync('package-lock.json', Path.join(productionModulesFolder, 'package-lock.json'));
59
+ fs_1.default.cpSync('package.json', path_1.default.join(productionModulesFolder, 'package.json'));
60
+ fs_1.default.cpSync('package-lock.json', path_1.default.join(productionModulesFolder, 'package-lock.json'));
58
61
  (0, child_process_1.execSync)(`npm ci --omit=dev`, {
59
- cwd: Path.join(process.cwd(), productionModulesFolder),
62
+ cwd: path_1.default.join(process.cwd(), productionModulesFolder),
60
63
  });
61
64
  }
62
65
  function main(args) {
@@ -80,26 +83,26 @@ function main(args) {
80
83
  if (options.includeNodeModules) {
81
84
  installDependencies();
82
85
  }
83
- if (fs.existsSync('dist')) {
86
+ if (fs_1.default.existsSync('dist')) {
84
87
  options.typeScriptPackage = true;
85
88
  }
86
- const folder = Path.resolve('.');
89
+ const folder = path_1.default.resolve('.');
87
90
  const packageInfo = getPackageInfo(folder);
88
91
  if (packageInfo === undefined) {
89
92
  console.error('Package info not found');
90
93
  process.exit(1);
91
94
  }
92
95
  const zipFile = `${options.outputFolder}/${packageInfo.packageName}_${packageInfo.packageVersion}.zip`;
93
- if (fs.existsSync(zipFile)) {
96
+ if (fs_1.default.existsSync(zipFile)) {
94
97
  try {
95
- fs.unlinkSync(zipFile);
98
+ fs_1.default.unlinkSync(zipFile);
96
99
  }
97
100
  catch (error) {
98
101
  console.error('An error occured: ', error);
99
102
  process.exit(1);
100
103
  }
101
104
  }
102
- const zip = new AdmZip();
105
+ const zip = new adm_zip_1.default();
103
106
  createZipArchive(zip, folder, options);
104
107
  zip.writeZip(zipFile);
105
108
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AddNewClipError = exports.FetchDeviceInfoError = exports.NoDeviceInfoError = exports.MaxFPSError = exports.SDCardJobError = exports.SDCardActionError = exports.ApplicationAPIError = exports.ParsingBlobError = exports.ServiceNotFoundError = exports.ServiceUnavailableError = void 0;
3
+ exports.BadRequestError = exports.ServerError = exports.InvalidAltitudeError = exports.InvalidLatLngError = exports.CannotSetCoordsInAutoModeError = exports.ImportSettingsError = exports.ResetCalibrationError = exports.TimezoneFetchError = exports.TimezoneNotSetupError = exports.UtcTimeFetchError = exports.WsAuthorizationError = exports.StorageDataFetchError = exports.PtzNotSupportedError = exports.AddNewClipError = exports.FetchDeviceInfoError = exports.NoDeviceInfoError = exports.MaxFPSError = exports.SDCardJobError = exports.SDCardActionError = exports.ApplicationAPIError = exports.SettingParameterError = exports.ParameterNotFoundError = exports.JsonParseError = exports.ParsingBlobError = exports.ServiceNotFoundError = exports.ServiceUnavailableError = void 0;
4
4
  class ServiceUnavailableError extends Error {
5
5
  constructor() {
6
6
  super('Service is unavailable.');
@@ -22,6 +22,27 @@ class ParsingBlobError extends Error {
22
22
  }
23
23
  }
24
24
  exports.ParsingBlobError = ParsingBlobError;
25
+ class JsonParseError extends Error {
26
+ constructor(paramName, data) {
27
+ super(`Error: in JSON parsing of ${paramName}. Cannot parse: ${data}`);
28
+ this.name = 'JsonParseError';
29
+ }
30
+ }
31
+ exports.JsonParseError = JsonParseError;
32
+ class ParameterNotFoundError extends Error {
33
+ constructor(paramName) {
34
+ super(`Error: no parameter '${paramName}' was found`);
35
+ this.name = 'ParameterNotFoundError';
36
+ }
37
+ }
38
+ exports.ParameterNotFoundError = ParameterNotFoundError;
39
+ class SettingParameterError extends Error {
40
+ constructor(message) {
41
+ super(`Error setting parameter to camera: ${message}`);
42
+ this.name = 'SettingParameterError';
43
+ }
44
+ }
45
+ exports.SettingParameterError = SettingParameterError;
25
46
  class ApplicationAPIError extends Error {
26
47
  constructor(action, res) {
27
48
  super(`[APP ${action}] Error: ` + res);
@@ -77,3 +98,94 @@ class AddNewClipError extends Error {
77
98
  }
78
99
  }
79
100
  exports.AddNewClipError = AddNewClipError;
101
+ class PtzNotSupportedError extends Error {
102
+ constructor() {
103
+ super('Ptz not supported.');
104
+ this.name = 'PtzNotSupportedError';
105
+ }
106
+ }
107
+ exports.PtzNotSupportedError = PtzNotSupportedError;
108
+ class StorageDataFetchError extends Error {
109
+ constructor(err) {
110
+ super('Error fetching storage data: ' + err);
111
+ this.name = 'StorageDataFetchError';
112
+ }
113
+ }
114
+ exports.StorageDataFetchError = StorageDataFetchError;
115
+ class WsAuthorizationError extends Error {
116
+ constructor(message) {
117
+ super('Server error on ws authorization: ' + message);
118
+ this.name = 'WsAuthorizationError';
119
+ }
120
+ }
121
+ exports.WsAuthorizationError = WsAuthorizationError;
122
+ class UtcTimeFetchError extends Error {
123
+ constructor(message) {
124
+ super('Server error on get UTC time: ' + message);
125
+ this.name = 'UtcTimeFetchError';
126
+ }
127
+ }
128
+ exports.UtcTimeFetchError = UtcTimeFetchError;
129
+ class TimezoneNotSetupError extends Error {
130
+ constructor() {
131
+ super('Time zone not setup on the device');
132
+ this.name = 'TimezoneNotSetupError';
133
+ }
134
+ }
135
+ exports.TimezoneNotSetupError = TimezoneNotSetupError;
136
+ class TimezoneFetchError extends Error {
137
+ constructor(err) {
138
+ super('Error fetching time zone information: ' + err);
139
+ this.name = 'TimezoneFetchError';
140
+ }
141
+ }
142
+ exports.TimezoneFetchError = TimezoneFetchError;
143
+ class ResetCalibrationError extends Error {
144
+ constructor(type, err) {
145
+ super('Error resetting ' + type.toLowerCase() + ' calibration: ' + err);
146
+ this.name = 'ResetCalibrationError';
147
+ }
148
+ }
149
+ exports.ResetCalibrationError = ResetCalibrationError;
150
+ class ImportSettingsError extends Error {
151
+ constructor(err) {
152
+ super('Error importing settings: ' + err);
153
+ this.name = 'ImportSettingsError';
154
+ }
155
+ }
156
+ exports.ImportSettingsError = ImportSettingsError;
157
+ class CannotSetCoordsInAutoModeError extends Error {
158
+ constructor() {
159
+ super("The automatic mode doesn't allow control of the camera.");
160
+ this.name = 'CannotSetCoordsInAutoModeError';
161
+ }
162
+ }
163
+ exports.CannotSetCoordsInAutoModeError = CannotSetCoordsInAutoModeError;
164
+ class InvalidLatLngError extends Error {
165
+ constructor() {
166
+ super('The provided latitude or longitude parameters are invalid.');
167
+ this.name = 'InvalidLatLngError';
168
+ }
169
+ }
170
+ exports.InvalidLatLngError = InvalidLatLngError;
171
+ class InvalidAltitudeError extends Error {
172
+ constructor() {
173
+ super('The provided altitude parameter is invalid.');
174
+ this.name = 'InvalidAltitudeError';
175
+ }
176
+ }
177
+ exports.InvalidAltitudeError = InvalidAltitudeError;
178
+ class ServerError extends Error {
179
+ constructor() {
180
+ super('An internal server error occurred.');
181
+ this.name = 'ServerError';
182
+ }
183
+ }
184
+ exports.ServerError = ServerError;
185
+ class BadRequestError extends Error {
186
+ constructor(err) {
187
+ super('An unknown error occurred: ' + err);
188
+ this.name = 'UnknownError';
189
+ }
190
+ }
191
+ exports.BadRequestError = BadRequestError;
package/cjs/index.js CHANGED
@@ -14,18 +14,41 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.VapixAPI = exports.CamSwitcherEvents = exports.CamSwitcherAPI = void 0;
18
- __exportStar(require("./internal/common"), exports);
17
+ exports.VapixAPI = exports.CamScripterAPI = exports.PlaneTrackerEvents = exports.PlaneTrackerAPI = exports.CamSwitcherEvents = exports.CamSwitcherAPI = exports.CamOverlayEvents = exports.CamOverlayAPI = exports.CamStreamerEvents = exports.CamStreamerAPI = void 0;
18
+ __exportStar(require("./errors/errors"), exports);
19
+ __exportStar(require("./internal/types"), exports);
19
20
  __exportStar(require("./internal/constants"), exports);
20
21
  __exportStar(require("./internal/utils"), exports);
21
22
  __exportStar(require("./internal/versionCompare"), exports);
23
+ __exportStar(require("./internal/ProxyClient"), exports);
22
24
  __exportStar(require("./types/common"), exports);
25
+ var CamStreamerAPI_1 = require("./CamStreamerAPI");
26
+ Object.defineProperty(exports, "CamStreamerAPI", { enumerable: true, get: function () { return CamStreamerAPI_1.CamStreamerAPI; } });
27
+ __exportStar(require("./types/CamStreamerAPI"), exports);
28
+ var CamStreamerEvents_1 = require("./ws/CamStreamerEvents");
29
+ Object.defineProperty(exports, "CamStreamerEvents", { enumerable: true, get: function () { return CamStreamerEvents_1.CamStreamerEvents; } });
30
+ __exportStar(require("./types/ws/CamStreamerEvents"), exports);
31
+ var CamOverlayAPI_1 = require("./CamOverlayAPI");
32
+ Object.defineProperty(exports, "CamOverlayAPI", { enumerable: true, get: function () { return CamOverlayAPI_1.CamOverlayAPI; } });
33
+ __exportStar(require("./types/CamOverlayAPI"), exports);
34
+ var CamOverlayEvents_1 = require("./ws/CamOverlayEvents");
35
+ Object.defineProperty(exports, "CamOverlayEvents", { enumerable: true, get: function () { return CamOverlayEvents_1.CamOverlayEvents; } });
36
+ __exportStar(require("./types/ws/CamOverlayEvents"), exports);
23
37
  var CamSwitcherAPI_1 = require("./CamSwitcherAPI");
24
38
  Object.defineProperty(exports, "CamSwitcherAPI", { enumerable: true, get: function () { return CamSwitcherAPI_1.CamSwitcherAPI; } });
25
- var CamSwitcherEvents_1 = require("./CamSwitcherEvents");
39
+ __exportStar(require("./types/CamSwitcherAPI"), exports);
40
+ var CamSwitcherEvents_1 = require("./ws/CamSwitcherEvents");
26
41
  Object.defineProperty(exports, "CamSwitcherEvents", { enumerable: true, get: function () { return CamSwitcherEvents_1.CamSwitcherEvents; } });
42
+ __exportStar(require("./types/ws/CamSwitcherEvents"), exports);
43
+ var PlaneTrackerAPI_1 = require("./PlaneTrackerAPI");
44
+ Object.defineProperty(exports, "PlaneTrackerAPI", { enumerable: true, get: function () { return PlaneTrackerAPI_1.PlaneTrackerAPI; } });
45
+ __exportStar(require("./types/PlaneTrackerAPI"), exports);
46
+ var PlaneTrackerEvents_1 = require("./ws/PlaneTrackerEvents");
47
+ Object.defineProperty(exports, "PlaneTrackerEvents", { enumerable: true, get: function () { return PlaneTrackerEvents_1.PlaneTrackerEvents; } });
48
+ __exportStar(require("./types/ws/PlaneTrackerEvents"), exports);
49
+ var CamScripterAPI_1 = require("./CamScripterAPI");
50
+ Object.defineProperty(exports, "CamScripterAPI", { enumerable: true, get: function () { return CamScripterAPI_1.CamScripterAPI; } });
51
+ __exportStar(require("./types/CamScripterAPI"), exports);
27
52
  var VapixAPI_1 = require("./VapixAPI");
28
53
  Object.defineProperty(exports, "VapixAPI", { enumerable: true, get: function () { return VapixAPI_1.VapixAPI; } });
29
- __exportStar(require("./types/CamSwitcherEvents"), exports);
30
- __exportStar(require("./types/CamSwitcherAPI"), exports);
31
54
  __exportStar(require("./types/VapixAPI"), exports);
@@ -4,41 +4,37 @@ exports.ProxyClient = void 0;
4
4
  const utils_1 = require("./utils");
5
5
  class ProxyClient {
6
6
  client;
7
- getProxyUrl;
8
- constructor(client, getProxyUrl) {
7
+ proxyParams;
8
+ constructor(client, proxyParams) {
9
9
  this.client = client;
10
- this.getProxyUrl = getProxyUrl;
10
+ this.proxyParams = proxyParams;
11
11
  }
12
- get = (proxy, path, parameters, headers = {}) => {
13
- const url = (0, utils_1.addParametersToPath)(path, parameters);
14
- const { realUrl, realHeaders } = this.getReal(proxy, url, headers);
15
- return this.client.get(realUrl, {}, realHeaders);
16
- };
17
- post = (proxy, path, data, parameters, headers) => {
18
- const url = (0, utils_1.addParametersToPath)(path, parameters);
19
- const { realUrl, realHeaders } = this.getReal(proxy, url, headers);
20
- return this.client.post(realUrl, data, {}, realHeaders);
21
- };
22
- getReal = (proxy, url, headers) => {
23
- if (proxy !== null) {
24
- return {
25
- realUrl: this.getProxyUrl(),
26
- realHeaders: {
27
- ...(headers ?? {}),
28
- 'x-target-camera-protocol': proxy.port === 443 ? 'https' : 'http',
29
- 'x-target-camera-path': url,
30
- 'x-target-camera-ip': proxy.ip,
31
- 'x-target-camera-mdns': proxy.mdnsName,
32
- 'x-target-camera-port': String(proxy.port),
33
- 'x-target-camera-pass': encodeURIComponent(proxy.pass),
34
- 'x-target-camera-user': encodeURIComponent(proxy.user),
35
- },
36
- };
37
- }
12
+ get(params) {
13
+ const { path, parameters, headers, timeout } = params;
14
+ const targetPath = (0, utils_1.addParametersToPath)(path, parameters);
15
+ const { realPath, realHeaders } = this.getReal(targetPath, headers);
16
+ return this.client.get({ path: realPath, headers: realHeaders, timeout });
17
+ }
18
+ post(params) {
19
+ const { path, data, parameters, headers, timeout } = params;
20
+ const targetPath = (0, utils_1.addParametersToPath)(path, parameters);
21
+ const { realPath, realHeaders } = this.getReal(targetPath, headers);
22
+ return this.client.post({ path: realPath, data, headers: realHeaders, timeout });
23
+ }
24
+ getReal(targetPath, headers) {
38
25
  return {
39
- realUrl: url,
40
- realHeaders: headers,
26
+ realPath: this.proxyParams.path,
27
+ realHeaders: {
28
+ ...(headers ?? {}),
29
+ 'x-target-camera-protocol': this.proxyParams.target.port === 443 ? 'https' : 'http',
30
+ 'x-target-camera-path': targetPath,
31
+ 'x-target-camera-ip': this.proxyParams.target.ip,
32
+ 'x-target-camera-mdns': this.proxyParams.target.mdnsName,
33
+ 'x-target-camera-port': String(this.proxyParams.target.port),
34
+ 'x-target-camera-pass': this.proxyParams.target.pass,
35
+ 'x-target-camera-user': this.proxyParams.target.user,
36
+ },
41
37
  };
42
- };
38
+ }
43
39
  }
44
40
  exports.ProxyClient = ProxyClient;
@@ -1,23 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CamSwitcherEvents = void 0;
4
- const CamSwitcherEvents_1 = require("./types/CamSwitcherEvents");
5
- class CamSwitcherEvents {
6
- isDestroyed = false;
7
- ws = null;
3
+ exports.WsEvents = void 0;
4
+ class WsEvents {
5
+ validate;
6
+ ws;
7
+ _isDestroyed = false;
8
8
  listeners = {};
9
- setWebsocket(ws) {
10
- if (this.ws) {
11
- this.ws.destroy();
12
- }
9
+ constructor(validate, ws) {
10
+ this.validate = validate;
13
11
  this.ws = ws;
14
- this.ws.onmessage = (e) => this.onMessage(e);
12
+ this.ws.onMessage = (e) => this.onMessage(e);
13
+ }
14
+ get isDestroyed() {
15
+ return this._isDestroyed;
15
16
  }
16
17
  resendInitData() {
17
18
  const request = {
18
19
  command: 'sendInitData',
19
20
  };
20
- this.ws?.send(JSON.stringify(request));
21
+ this.ws.send(JSON.stringify(request));
21
22
  }
22
23
  addListener(type, listener, id) {
23
24
  const typeList = this.listeners[type];
@@ -31,23 +32,26 @@ class CamSwitcherEvents {
31
32
  const typeList = this.listeners[type];
32
33
  if (typeList) {
33
34
  delete typeList[id];
35
+ if (Object.keys(typeList).length === 0) {
36
+ delete this.listeners[type];
37
+ }
34
38
  }
35
39
  }
36
- onMessage(evt) {
40
+ onMessage(incomeData) {
37
41
  if (this.isDestroyed) {
38
42
  return;
39
43
  }
40
44
  try {
41
- const eventData = JSON.parse(evt.data);
42
- const data = CamSwitcherEvents_1.cswEventsSchema.parse(eventData);
43
- if (data.type === 'init') {
45
+ const eventData = JSON.parse(incomeData.toString());
46
+ const data = this.validate(eventData);
47
+ if (isInitEvent(data)) {
44
48
  this.processMessage(data.data, true);
45
49
  return;
46
50
  }
47
51
  this.processMessage(data, false);
48
52
  }
49
53
  catch (error) {
50
- console.error('Error parsing event data:', evt.data, error);
54
+ console.error('Error parsing event data:', incomeData.toString(), error);
51
55
  }
52
56
  }
53
57
  processMessage(event, isInit) {
@@ -56,12 +60,14 @@ class CamSwitcherEvents {
56
60
  list.forEach((listener) => listener(event, isInit));
57
61
  }
58
62
  destroy() {
59
- this.isDestroyed = true;
60
- if (this.ws) {
61
- this.ws.destroy();
62
- this.ws = null;
63
- }
63
+ this._isDestroyed = true;
64
+ this.ws.onMessage = () => { };
65
+ this.ws.onOpen = () => Promise.reject(new Error('Websocket is destroyed'));
66
+ this.ws.destroy();
64
67
  this.listeners = {};
65
68
  }
66
69
  }
67
- exports.CamSwitcherEvents = CamSwitcherEvents;
70
+ exports.WsEvents = WsEvents;
71
+ const isInitEvent = (event) => {
72
+ return event.type === 'init';
73
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isLoopPlayType = exports.isPlaylist = exports.isTracker = exports.isClip = exports.isStream = exports.isCamera = exports.arrayToUrl = exports.paramToUrl = exports.addParametersToPath = void 0;
4
- const common_1 = require("./common");
3
+ exports.isNullish = exports.pad = exports.responseStringify = exports.isLoopPlayType = exports.isPlaylist = exports.isTracker = exports.isClip = exports.isStream = exports.isCamera = exports.arrayToUrl = exports.paramToUrl = exports.addParametersToPath = void 0;
5
4
  const addParametersToPath = (path, params) => {
6
5
  if (params === undefined || Object.keys(params).length === 0) {
7
6
  return path;
@@ -17,7 +16,7 @@ const paramToUrl = (params) => {
17
16
  let output = '';
18
17
  for (const key in params) {
19
18
  const value = params[key];
20
- if ((0, common_1.isNullish)(value)) {
19
+ if (isNullish(value)) {
21
20
  continue;
22
21
  }
23
22
  output += `${encodeURIComponent(key)}=${encodeURIComponent(value)}&`;
@@ -44,3 +43,23 @@ const isPlaylist = (id) => id?.charAt(0) === 'p';
44
43
  exports.isPlaylist = isPlaylist;
45
44
  const isLoopPlayType = (playType) => playType.includes('LOOP');
46
45
  exports.isLoopPlayType = isLoopPlayType;
46
+ async function responseStringify(res) {
47
+ return JSON.stringify({
48
+ status: res.status,
49
+ body: await res.text(),
50
+ });
51
+ }
52
+ exports.responseStringify = responseStringify;
53
+ function pad(num, size) {
54
+ const sign = Math.sign(num) === -1 ? '-' : '';
55
+ return (sign +
56
+ new Array(size)
57
+ .concat([Math.abs(num)])
58
+ .join('0')
59
+ .slice(-size));
60
+ }
61
+ exports.pad = pad;
62
+ function isNullish(value) {
63
+ return value === null || value === undefined;
64
+ }
65
+ exports.isNullish = isNullish;
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.CamOverlayDrawingAPI = void 0;
4
- const EventEmitter = require("events");
5
- const WsClient_1 = require("./node/WsClient");
6
- class CamOverlayDrawingAPI extends EventEmitter {
7
+ const events_1 = __importDefault(require("events"));
8
+ const WsClient_1 = require("./WsClient");
9
+ class CamOverlayDrawingAPI extends events_1.default {
7
10
  tls;
8
11
  tlsInsecure;
9
12
  ip;
@@ -37,14 +40,14 @@ class CamOverlayDrawingAPI extends EventEmitter {
37
40
  this.sendMessages = {};
38
41
  this.wsConnected = false;
39
42
  this.createWsClient();
40
- EventEmitter.call(this);
43
+ events_1.default.call(this);
41
44
  }
42
45
  connect() {
43
46
  this.ws.open();
44
47
  this.startMsgsTimeoutCheck();
45
48
  }
46
49
  disconnect() {
47
- this.ws.close();
50
+ this.ws.destroy();
48
51
  this.stopMsgsTimeoutCheck();
49
52
  }
50
53
  isConnected() {
@@ -101,23 +104,23 @@ class CamOverlayDrawingAPI extends EventEmitter {
101
104
  tlsInsecure: this.tlsInsecure,
102
105
  };
103
106
  this.ws = new WsClient_1.WsClient(options);
104
- this.ws.on('open', () => {
107
+ this.ws.onOpen = () => {
105
108
  console.log('CamOverlay connection opened');
106
109
  this.wsConnected = true;
107
110
  this.emit('open');
108
- });
109
- this.ws.on('message', (msgData) => this.incomingWsMessageHandler(msgData));
110
- this.ws.on('error', (error) => {
111
+ };
112
+ this.ws.onMessage = (data) => this.incomingWsMessageHandler(data.toString());
113
+ this.ws.onError = (error) => {
111
114
  this.reportError(error);
112
- });
113
- this.ws.on('close', () => {
115
+ };
116
+ this.ws.onClose = () => {
114
117
  console.log('CamOverlay connection closed');
115
118
  this.wsConnected = false;
116
119
  this.reportClose();
117
- });
120
+ };
118
121
  }
119
122
  incomingWsMessageHandler(msgData) {
120
- const dataJSON = JSON.parse(msgData.toString());
123
+ const dataJSON = JSON.parse(msgData);
121
124
  let errorResponse;
122
125
  if ('error' in dataJSON) {
123
126
  errorResponse = dataJSON;
@@ -174,7 +177,7 @@ class CamOverlayDrawingAPI extends EventEmitter {
174
177
  headerView.setInt8(0, 1);
175
178
  headerView.setInt32(1, jsonBuffer.byteLength);
176
179
  const msgBuffer = Buffer.concat([Buffer.from(header), jsonBuffer, data]);
177
- this.ws.send(msgBuffer);
180
+ this.ws.send(msgBuffer.buffer);
178
181
  this.sendMessages[this.callId] = { resolve, reject, sentTimestamp: Date.now() };
179
182
  }
180
183
  catch (err) {
@@ -57,6 +57,14 @@ class Frame extends events_1.EventEmitter {
57
57
  this.width = width;
58
58
  this.height = height;
59
59
  }
60
+ getFrameInfo() {
61
+ return {
62
+ x: this.posX,
63
+ y: this.posY,
64
+ width: this.width,
65
+ height: this.height,
66
+ };
67
+ }
60
68
  setText(text, align, textType = 'TFM_OVERFLOW', fontColor) {
61
69
  this.text = text;
62
70
  this.align = align;
@@ -76,6 +84,16 @@ class Frame extends events_1.EventEmitter {
76
84
  this.fontName = undefined;
77
85
  this.font = fontData;
78
86
  }
87
+ getTextInfo() {
88
+ return {
89
+ text: this.text,
90
+ textAlign: this.align,
91
+ textType: this.textType,
92
+ fontColor: this.fontColor,
93
+ font: this.font,
94
+ fontName: this.fontName,
95
+ };
96
+ }
79
97
  setBgColor(color) {
80
98
  this.bgColor = color;
81
99
  }
@@ -92,6 +110,14 @@ class Frame extends events_1.EventEmitter {
92
110
  setBgType(type) {
93
111
  this.bgType = type;
94
112
  }
113
+ getBgInfo() {
114
+ return {
115
+ bgColor: this.bgColor,
116
+ bgImage: this.bgImage,
117
+ bgImageName: this.bgImageName,
118
+ bgType: this.bgType,
119
+ };
120
+ }
95
121
  setBorderRadius(radius) {
96
122
  this.borderRadius = radius;
97
123
  }
@@ -101,6 +127,13 @@ class Frame extends events_1.EventEmitter {
101
127
  setBorderColor(color) {
102
128
  this.borderColor = color;
103
129
  }
130
+ getBorderInfo() {
131
+ return {
132
+ borderRadius: this.borderRadius,
133
+ borderWidth: this.borderWidth,
134
+ borderColor: this.borderColor,
135
+ };
136
+ }
104
137
  setCustomDraw(customDraw) {
105
138
  this.customDraw = customDraw;
106
139
  }
@@ -1,22 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ResourceManager = exports.Frame = exports.Painter = exports.COORD = void 0;
3
+ exports.Painter = void 0;
4
4
  const CamOverlayDrawingAPI_1 = require("../CamOverlayDrawingAPI");
5
5
  const ResourceManager_1 = require("./ResourceManager");
6
- exports.ResourceManager = ResourceManager_1.default;
7
6
  const Frame_1 = require("./Frame");
8
- Object.defineProperty(exports, "Frame", { enumerable: true, get: function () { return Frame_1.Frame; } });
9
- exports.COORD = {
10
- top_left: [-1, -1],
11
- center_left: [-1, 0],
12
- bottom_left: [-1, 1],
13
- top_center: [0, -1],
14
- center: [0, 0],
15
- bottom_center: [0, 1],
16
- top_right: [1, -1],
17
- center_right: [1, 0],
18
- bottom_right: [1, 1],
19
- };
7
+ const CamOverlayPainter_1 = require("../../types/CamOverlayPainter");
20
8
  class Painter extends Frame_1.Frame {
21
9
  screenWidth;
22
10
  screenHeight;
@@ -27,11 +15,11 @@ class Painter extends Frame_1.Frame {
27
15
  layers = [];
28
16
  constructor(opt, coopt) {
29
17
  super(opt);
30
- this.coAlignment = exports.COORD[opt.coAlignment];
18
+ this.coAlignment = CamOverlayPainter_1.COORD[opt.coAlignment];
31
19
  this.screenWidth = opt.screenWidth;
32
20
  this.screenHeight = opt.screenHeight;
33
21
  this.cod = new CamOverlayDrawingAPI_1.CamOverlayDrawingAPI(coopt);
34
- this.rm = new ResourceManager_1.default(this.cod);
22
+ this.rm = new ResourceManager_1.ResourceManager(this.cod);
35
23
  }
36
24
  get camOverlayDrawingAPI() {
37
25
  return this.cod;
@@ -71,7 +59,7 @@ class Painter extends Frame_1.Frame {
71
59
  this.screenHeight = sh;
72
60
  }
73
61
  setCoAlignment(coAlignment) {
74
- this.coAlignment = exports.COORD[coAlignment];
62
+ this.coAlignment = CamOverlayPainter_1.COORD[coAlignment];
75
63
  }
76
64
  layoutChanged() {
77
65
  this.refreshLayers = true;