camstreamerlib 4.0.0-beta.8 → 4.0.0-beta.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +143 -38
- package/cjs/CamOverlayAPI.d.ts +863 -27
- package/cjs/CamOverlayAPI.js +135 -92
- package/cjs/CamScripterAPI.d.ts +44 -17
- package/cjs/CamScripterAPI.js +52 -42
- package/cjs/CamStreamerAPI.d.ts +137 -14
- package/cjs/CamStreamerAPI.js +117 -44
- package/cjs/CamSwitcherAPI.d.ts +158 -43
- package/cjs/CamSwitcherAPI.js +138 -122
- package/cjs/PlaneTrackerAPI.d.ts +239 -0
- package/cjs/PlaneTrackerAPI.js +247 -0
- package/cjs/VapixAPI.d.ts +94 -42
- package/cjs/VapixAPI.js +314 -232
- package/cjs/{CreatePackage.js → bin/CreatePackage.js} +44 -18
- package/cjs/errors/errors.d.ts +69 -4
- package/cjs/errors/errors.js +138 -7
- package/cjs/index.d.ts +20 -4
- package/cjs/index.js +28 -5
- package/cjs/internal/ProxyClient.d.ts +8 -9
- package/cjs/internal/ProxyClient.js +28 -32
- package/cjs/internal/WsEvents.d.ts +37 -0
- package/cjs/{CamSwitcherEvents.js → internal/WsEvents.js} +28 -22
- package/cjs/internal/types.d.ts +47 -0
- package/cjs/internal/types.js +2 -0
- package/cjs/internal/utils.d.ts +3 -1
- package/cjs/internal/utils.js +15 -3
- package/cjs/internal/versionCompare.d.ts +2 -2
- package/cjs/node/CamOverlayDrawingAPI.d.ts +41 -0
- package/cjs/{CamOverlayDrawingAPI.js → node/CamOverlayDrawingAPI.js} +28 -20
- package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Frame.d.ts +8 -37
- package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Frame.js +33 -0
- package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Painter.d.ts +5 -21
- package/cjs/{CamOverlayPainter → node/CamOverlayPainter}/Painter.js +5 -17
- package/cjs/node/CamOverlayPainter/ResourceManager.d.ts +15 -0
- package/cjs/node/CamOverlayPainter/ResourceManager.js +72 -0
- package/cjs/node/CamScripterAPICameraEventsGenerator.d.ts +31 -0
- package/cjs/{CamScripterAPICameraEventsGenerator.js → node/CamScripterAPICameraEventsGenerator.js} +13 -13
- package/cjs/node/DefaultClient.d.ts +6 -5
- package/cjs/node/DefaultClient.js +10 -12
- package/cjs/{internal → node}/Digest.js +24 -1
- package/cjs/node/Digest.test.js +13 -0
- package/cjs/node/HttpRequestSender.d.ts +1 -0
- package/cjs/node/HttpRequestSender.js +14 -4
- package/cjs/node/HttpServer.d.ts +1 -1
- package/cjs/node/HttpServer.js +29 -6
- package/cjs/node/TimeZoneDaemon.d.ts +6 -0
- package/cjs/node/TimeZoneDaemon.js +29 -0
- package/cjs/node/VapixEvents.d.ts +16 -0
- package/cjs/{VapixEvents.js → node/VapixEvents.js} +10 -10
- package/cjs/node/WsClient.d.ts +9 -18
- package/cjs/node/WsClient.js +27 -20
- package/cjs/node/events/AxisCameraStationEvents.d.ts +12 -0
- package/cjs/node/events/AxisCameraStationEvents.js +53 -0
- package/cjs/node/events/GenetecAgent.d.ts +16 -0
- package/cjs/node/events/GenetecAgent.js +124 -0
- package/cjs/node/index.d.ts +18 -2
- package/cjs/node/index.js +39 -5
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +4330 -0
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +92 -0
- package/cjs/types/CamOverlayAPI/accuweatherSchema.d.ts +84 -0
- package/cjs/types/CamOverlayAPI/accuweatherSchema.js +47 -0
- package/cjs/types/CamOverlayAPI/customGraphicsSchema.d.ts +700 -0
- package/cjs/types/CamOverlayAPI/customGraphicsSchema.js +72 -0
- package/cjs/types/CamOverlayAPI/imagesSchema.d.ts +95 -0
- package/cjs/types/CamOverlayAPI/imagesSchema.js +9 -0
- package/cjs/types/CamOverlayAPI/index.d.ts +11 -0
- package/cjs/types/CamOverlayAPI/index.js +27 -0
- package/cjs/types/CamOverlayAPI/infotickerSchema.d.ts +96 -0
- package/cjs/types/CamOverlayAPI/infotickerSchema.js +26 -0
- package/cjs/types/CamOverlayAPI/pipSchema.d.ts +125 -0
- package/cjs/types/CamOverlayAPI/pipSchema.js +39 -0
- package/cjs/types/CamOverlayAPI/ptzCompassSchema.d.ts +96 -0
- package/cjs/types/CamOverlayAPI/ptzCompassSchema.js +26 -0
- package/cjs/types/CamOverlayAPI/ptzSchema.d.ts +118 -0
- package/cjs/types/CamOverlayAPI/ptzSchema.js +12 -0
- package/cjs/types/CamOverlayAPI/scoreBoardSchema.d.ts +357 -0
- package/cjs/types/CamOverlayAPI/scoreBoardSchema.js +132 -0
- package/cjs/types/CamOverlayAPI/screenSharingSchema.d.ts +58 -0
- package/cjs/types/CamOverlayAPI/screenSharingSchema.js +8 -0
- package/cjs/types/CamOverlayAPI/serviceCommonTypes.d.ts +145 -0
- package/cjs/types/CamOverlayAPI/serviceCommonTypes.js +91 -0
- package/cjs/types/CamOverlayAPI/webCameraSharingSchema.d.ts +58 -0
- package/cjs/types/CamOverlayAPI/webCameraSharingSchema.js +8 -0
- package/cjs/types/CamOverlayDrawingAPI.d.ts +48 -0
- package/cjs/types/CamOverlayDrawingAPI.js +2 -0
- package/cjs/types/CamOverlayPainter.d.ts +76 -0
- package/cjs/types/CamOverlayPainter.js +14 -0
- package/cjs/types/CamScripterAPI.d.ts +86 -23
- package/cjs/types/CamScripterAPI.js +24 -8
- package/cjs/types/CamScripterAPICameraEventsGenerator.d.ts +45 -0
- package/cjs/types/CamScripterAPICameraEventsGenerator.js +2 -0
- package/cjs/types/CamStreamerAPI/CamStreamerAPI.d.ts +577 -0
- package/cjs/types/CamStreamerAPI/CamStreamerAPI.js +49 -0
- package/cjs/types/CamStreamerAPI/facebookSchema.d.ts +21 -0
- package/cjs/types/CamStreamerAPI/facebookSchema.js +11 -0
- package/cjs/types/CamStreamerAPI/hlsSchema.d.ts +21 -0
- package/cjs/types/CamStreamerAPI/hlsSchema.js +11 -0
- package/cjs/types/CamStreamerAPI/index.d.ts +9 -0
- package/cjs/types/CamStreamerAPI/index.js +25 -0
- package/cjs/types/CamStreamerAPI/mpegDvbSchema.d.ts +72 -0
- package/cjs/types/CamStreamerAPI/mpegDvbSchema.js +28 -0
- package/cjs/types/{CamStreamerAPI.d.ts → CamStreamerAPI/oldStreamSchema.d.ts} +76 -7
- package/cjs/types/CamStreamerAPI/oldStreamSchema.js +53 -0
- package/cjs/types/CamStreamerAPI/rtmpSchema.d.ts +21 -0
- package/cjs/types/CamStreamerAPI/rtmpSchema.js +11 -0
- package/cjs/types/CamStreamerAPI/sdCardSchema.d.ts +21 -0
- package/cjs/types/CamStreamerAPI/sdCardSchema.js +11 -0
- package/cjs/types/CamStreamerAPI/streamCommonTypes.d.ts +20 -0
- package/cjs/types/CamStreamerAPI/streamCommonTypes.js +19 -0
- package/cjs/types/CamStreamerAPI/windySchema.d.ts +21 -0
- package/cjs/types/CamStreamerAPI/windySchema.js +11 -0
- package/cjs/types/CamStreamerAPI/youtubeSchema.d.ts +21 -0
- package/cjs/types/CamStreamerAPI/youtubeSchema.js +11 -0
- package/cjs/types/CamSwitcherAPI.d.ts +145 -66
- package/cjs/types/CamSwitcherAPI.js +38 -1
- package/cjs/{events → types}/GenetecAgent.d.ts +47 -47
- package/cjs/types/GenetecAgent.js +31 -0
- package/cjs/types/PlaneTrackerAPI.d.ts +980 -0
- package/cjs/types/PlaneTrackerAPI.js +333 -0
- package/cjs/types/VapixAPI.d.ts +254 -164
- package/cjs/types/VapixAPI.js +66 -11
- package/cjs/types/VapixEvents.d.ts +15 -0
- package/cjs/types/VapixEvents.js +2 -0
- package/cjs/types/common.d.ts +18 -5
- package/cjs/types/common.js +5 -2
- package/cjs/types/ws/CamOverlayEvents.d.ts +88 -0
- package/cjs/types/ws/CamOverlayEvents.js +19 -0
- package/cjs/types/ws/CamStreamerEvents.d.ts +249 -0
- package/cjs/types/ws/CamStreamerEvents.js +32 -0
- package/cjs/types/ws/PlaneTrackerEvents.d.ts +1637 -0
- package/cjs/types/ws/PlaneTrackerEvents.js +196 -0
- package/cjs/web/DefaultClient.d.ts +7 -5
- package/cjs/web/DefaultClient.js +26 -10
- package/cjs/web/WsClient.d.ts +9 -5
- package/cjs/web/WsClient.js +16 -18
- package/cjs/ws/CamOverlayEvents.d.ts +8 -0
- package/cjs/ws/CamOverlayEvents.js +24 -0
- package/cjs/ws/CamStreamerEvents.d.ts +8 -0
- package/cjs/ws/CamStreamerEvents.js +24 -0
- package/cjs/ws/CamSwitcherEvents.d.ts +8 -0
- package/cjs/ws/CamSwitcherEvents.js +24 -0
- package/cjs/ws/PlaneTrackerEvents.d.ts +9 -0
- package/cjs/ws/PlaneTrackerEvents.js +30 -0
- package/esm/CamOverlayAPI.js +135 -92
- package/esm/CamScripterAPI.js +50 -40
- package/esm/CamStreamerAPI.js +115 -43
- package/esm/CamSwitcherAPI.js +136 -120
- package/esm/PlaneTrackerAPI.js +243 -0
- package/esm/VapixAPI.js +314 -232
- package/esm/{CreatePackage.js → bin/CreatePackage.js} +16 -16
- package/esm/errors/errors.js +120 -6
- package/esm/index.js +20 -4
- package/esm/internal/ProxyClient.js +28 -32
- package/esm/{CamSwitcherEvents.js → internal/WsEvents.js} +26 -20
- package/esm/internal/types.js +1 -0
- package/esm/internal/utils.js +11 -1
- package/esm/{CamOverlayDrawingAPI.js → node/CamOverlayDrawingAPI.js} +26 -18
- package/esm/{CamOverlayPainter → node/CamOverlayPainter}/Frame.js +33 -0
- package/esm/{CamOverlayPainter → node/CamOverlayPainter}/Painter.js +2 -13
- package/esm/{CamOverlayPainter → node/CamOverlayPainter}/ResourceManager.js +7 -5
- package/esm/{CamScripterAPICameraEventsGenerator.js → node/CamScripterAPICameraEventsGenerator.js} +11 -11
- package/esm/node/DefaultClient.js +10 -12
- package/esm/node/Digest.test.js +11 -0
- package/esm/node/HttpRequestSender.js +14 -4
- package/esm/node/HttpServer.js +1 -1
- package/esm/node/TimeZoneDaemon.js +25 -0
- package/esm/{VapixEvents.js → node/VapixEvents.js} +10 -10
- package/esm/node/WsClient.js +22 -15
- package/esm/{events → node/events}/AxisCameraStationEvents.js +18 -13
- package/esm/node/events/GenetecAgent.js +120 -0
- package/esm/node/index.js +18 -2
- package/esm/types/CamOverlayAPI/CamOverlayAPI.js +76 -0
- package/esm/types/CamOverlayAPI/accuweatherSchema.js +44 -0
- package/esm/types/CamOverlayAPI/customGraphicsSchema.js +69 -0
- package/esm/types/CamOverlayAPI/imagesSchema.js +6 -0
- package/esm/types/CamOverlayAPI/index.js +11 -0
- package/esm/types/CamOverlayAPI/infotickerSchema.js +23 -0
- package/esm/types/CamOverlayAPI/pipSchema.js +36 -0
- package/esm/types/CamOverlayAPI/ptzCompassSchema.js +23 -0
- package/esm/types/CamOverlayAPI/ptzSchema.js +9 -0
- package/esm/types/CamOverlayAPI/scoreBoardSchema.js +129 -0
- package/esm/types/CamOverlayAPI/screenSharingSchema.js +5 -0
- package/esm/types/CamOverlayAPI/serviceCommonTypes.js +88 -0
- package/esm/types/CamOverlayAPI/webCameraSharingSchema.js +5 -0
- package/esm/types/CamOverlayDrawingAPI.js +1 -0
- package/esm/types/CamOverlayPainter.js +11 -0
- package/esm/types/CamScripterAPI.js +23 -7
- package/esm/types/CamScripterAPICameraEventsGenerator.js +1 -0
- package/esm/types/CamStreamerAPI/CamStreamerAPI.js +39 -0
- package/esm/types/CamStreamerAPI/facebookSchema.js +5 -0
- package/esm/types/CamStreamerAPI/hlsSchema.js +5 -0
- package/esm/types/CamStreamerAPI/index.js +9 -0
- package/esm/types/CamStreamerAPI/mpegDvbSchema.js +22 -0
- package/esm/types/CamStreamerAPI/oldStreamSchema.js +50 -0
- package/esm/types/CamStreamerAPI/rtmpSchema.js +5 -0
- package/esm/types/CamStreamerAPI/sdCardSchema.js +5 -0
- package/esm/types/CamStreamerAPI/streamCommonTypes.js +16 -0
- package/esm/types/CamStreamerAPI/windySchema.js +5 -0
- package/esm/types/CamStreamerAPI/youtubeSchema.js +5 -0
- package/esm/types/CamSwitcherAPI.js +38 -1
- package/esm/types/GenetecAgent.js +28 -0
- package/esm/types/PlaneTrackerAPI.js +330 -0
- package/esm/types/VapixAPI.js +65 -10
- package/esm/types/VapixEvents.js +1 -0
- package/esm/types/common.js +4 -1
- package/esm/types/ws/CamOverlayEvents.js +16 -0
- package/esm/types/ws/CamStreamerEvents.js +29 -0
- package/esm/types/ws/PlaneTrackerEvents.js +193 -0
- package/esm/web/DefaultClient.js +26 -10
- package/esm/web/WsClient.js +16 -18
- package/esm/ws/CamOverlayEvents.js +20 -0
- package/esm/ws/CamStreamerEvents.js +20 -0
- package/esm/ws/CamSwitcherEvents.js +20 -0
- package/esm/ws/PlaneTrackerEvents.js +26 -0
- package/package.json +44 -11
- package/types/CamOverlayAPI.d.ts +867 -0
- package/types/CamScripterAPI.d.ts +46 -0
- package/types/CamStreamerAPI.d.ts +139 -0
- package/types/CamSwitcherAPI.d.ts +167 -0
- package/types/PlaneTrackerAPI.d.ts +239 -0
- package/types/VapixAPI.d.ts +118 -0
- package/types/bin/CreatePackage.d.ts +1 -0
- package/types/errors/errors.d.ts +102 -0
- package/types/index.d.ts +27 -0
- package/types/internal/ProxyClient.d.ts +10 -0
- package/types/internal/WsEvents.d.ts +37 -0
- package/types/internal/types.d.ts +47 -0
- package/{esm → types}/internal/utils.d.ts +3 -1
- package/{esm → types}/internal/versionCompare.d.ts +2 -2
- package/types/node/CamOverlayDrawingAPI.d.ts +41 -0
- package/{esm → types/node}/CamOverlayPainter/Frame.d.ts +8 -37
- package/{esm → types/node}/CamOverlayPainter/Painter.d.ts +5 -21
- package/types/node/CamOverlayPainter/ResourceManager.d.ts +15 -0
- package/types/node/CamScripterAPICameraEventsGenerator.d.ts +31 -0
- package/types/node/DefaultClient.d.ts +16 -0
- package/types/node/Digest.test.d.ts +1 -0
- package/{esm → types}/node/HttpRequestSender.d.ts +1 -0
- package/{esm → types}/node/HttpServer.d.ts +1 -1
- package/types/node/TimeZoneDaemon.d.ts +6 -0
- package/types/node/VapixEvents.d.ts +16 -0
- package/types/node/WsClient.d.ts +30 -0
- package/types/node/events/AxisCameraStationEvents.d.ts +12 -0
- package/types/node/events/GenetecAgent.d.ts +16 -0
- package/types/node/index.d.ts +18 -0
- package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +4330 -0
- package/types/types/CamOverlayAPI/accuweatherSchema.d.ts +84 -0
- package/types/types/CamOverlayAPI/customGraphicsSchema.d.ts +700 -0
- package/types/types/CamOverlayAPI/imagesSchema.d.ts +95 -0
- package/types/types/CamOverlayAPI/index.d.ts +11 -0
- package/types/types/CamOverlayAPI/infotickerSchema.d.ts +96 -0
- package/types/types/CamOverlayAPI/pipSchema.d.ts +125 -0
- package/types/types/CamOverlayAPI/ptzCompassSchema.d.ts +96 -0
- package/types/types/CamOverlayAPI/ptzSchema.d.ts +118 -0
- package/types/types/CamOverlayAPI/scoreBoardSchema.d.ts +357 -0
- package/types/types/CamOverlayAPI/screenSharingSchema.d.ts +58 -0
- package/types/types/CamOverlayAPI/serviceCommonTypes.d.ts +145 -0
- package/types/types/CamOverlayAPI/webCameraSharingSchema.d.ts +58 -0
- package/types/types/CamOverlayDrawingAPI.d.ts +48 -0
- package/types/types/CamOverlayPainter.d.ts +76 -0
- package/types/types/CamScripterAPI.d.ts +130 -0
- package/types/types/CamScripterAPICameraEventsGenerator.d.ts +45 -0
- package/types/types/CamStreamerAPI/CamStreamerAPI.d.ts +577 -0
- package/types/types/CamStreamerAPI/facebookSchema.d.ts +21 -0
- package/types/types/CamStreamerAPI/hlsSchema.d.ts +21 -0
- package/types/types/CamStreamerAPI/index.d.ts +9 -0
- package/types/types/CamStreamerAPI/mpegDvbSchema.d.ts +72 -0
- package/{esm/types/CamStreamerAPI.d.ts → types/types/CamStreamerAPI/oldStreamSchema.d.ts} +76 -7
- package/types/types/CamStreamerAPI/rtmpSchema.d.ts +21 -0
- package/types/types/CamStreamerAPI/sdCardSchema.d.ts +21 -0
- package/types/types/CamStreamerAPI/streamCommonTypes.d.ts +20 -0
- package/types/types/CamStreamerAPI/windySchema.d.ts +21 -0
- package/types/types/CamStreamerAPI/youtubeSchema.d.ts +21 -0
- package/{esm → types}/types/CamSwitcherAPI.d.ts +145 -66
- package/{esm/events → types/types}/GenetecAgent.d.ts +47 -47
- package/types/types/PlaneTrackerAPI.d.ts +980 -0
- package/{esm → types}/types/VapixAPI.d.ts +254 -164
- package/types/types/VapixEvents.d.ts +15 -0
- package/{esm → types}/types/common.d.ts +18 -5
- package/types/types/ws/CamOverlayEvents.d.ts +88 -0
- package/types/types/ws/CamStreamerEvents.d.ts +249 -0
- package/types/types/ws/PlaneTrackerEvents.d.ts +1637 -0
- package/types/web/DefaultClient.d.ts +8 -0
- package/types/web/WsClient.d.ts +17 -0
- package/types/ws/CamOverlayEvents.d.ts +8 -0
- package/types/ws/CamStreamerEvents.d.ts +8 -0
- package/types/ws/CamSwitcherEvents.d.ts +8 -0
- package/types/ws/PlaneTrackerEvents.d.ts +9 -0
- package/cjs/CamOverlayDrawingAPI.d.ts +0 -86
- package/cjs/CamOverlayPainter/ResourceManager.d.ts +0 -14
- package/cjs/CamOverlayPainter/ResourceManager.js +0 -46
- package/cjs/CamScripterAPICameraEventsGenerator.d.ts +0 -74
- package/cjs/CamSwitcherEvents.d.ts +0 -18
- package/cjs/VapixEvents.d.ts +0 -43
- package/cjs/events/AxisCameraStationEvents.d.ts +0 -9
- package/cjs/events/AxisCameraStationEvents.js +0 -48
- package/cjs/events/GenetecAgent.js +0 -123
- package/cjs/internal/common.d.ts +0 -39
- package/cjs/internal/common.js +0 -27
- package/cjs/node/WsEventClient.d.ts +0 -13
- package/cjs/node/WsEventClient.js +0 -22
- package/cjs/types/CamOverlayAPI.d.ts +0 -188
- package/cjs/types/CamOverlayAPI.js +0 -47
- package/cjs/types/CamStreamerAPI.js +0 -28
- package/esm/CamOverlayAPI.d.ts +0 -31
- package/esm/CamOverlayDrawingAPI.d.ts +0 -86
- package/esm/CamOverlayPainter/ResourceManager.d.ts +0 -14
- package/esm/CamScripterAPI.d.ts +0 -19
- package/esm/CamScripterAPICameraEventsGenerator.d.ts +0 -74
- package/esm/CamStreamerAPI.d.ts +0 -16
- package/esm/CamSwitcherAPI.d.ts +0 -52
- package/esm/CamSwitcherEvents.d.ts +0 -18
- package/esm/VapixAPI.d.ts +0 -66
- package/esm/VapixEvents.d.ts +0 -43
- package/esm/errors/errors.d.ts +0 -37
- package/esm/events/AxisCameraStationEvents.d.ts +0 -9
- package/esm/events/GenetecAgent.js +0 -119
- package/esm/index.d.ts +0 -11
- package/esm/internal/ProxyClient.d.ts +0 -11
- package/esm/internal/common.d.ts +0 -39
- package/esm/internal/common.js +0 -20
- package/esm/node/DefaultClient.d.ts +0 -15
- package/esm/node/WsClient.d.ts +0 -39
- package/esm/node/WsEventClient.d.ts +0 -13
- package/esm/node/WsEventClient.js +0 -18
- package/esm/types/CamOverlayAPI.d.ts +0 -188
- package/esm/types/CamOverlayAPI.js +0 -44
- package/esm/types/CamScripterAPI.d.ts +0 -67
- package/esm/types/CamStreamerAPI.js +0 -25
- package/esm/web/DefaultClient.d.ts +0 -6
- package/esm/web/WsClient.d.ts +0 -13
- package/esm/web/index.d.ts +0 -2
- /package/cjs/{CreatePackage.d.ts → bin/CreatePackage.d.ts} +0 -0
- /package/cjs/{internal → node}/Digest.d.ts +0 -0
- /package/{esm/CreatePackage.d.ts → cjs/node/Digest.test.d.ts} +0 -0
- /package/cjs/types/{CamSwitcherEvents.d.ts → ws/CamSwitcherEvents.d.ts} +0 -0
- /package/cjs/types/{CamSwitcherEvents.js → ws/CamSwitcherEvents.js} +0 -0
- /package/esm/{internal → node}/Digest.js +0 -0
- /package/esm/types/{CamSwitcherEvents.js → ws/CamSwitcherEvents.js} +0 -0
- /package/{esm → types}/internal/constants.d.ts +0 -0
- /package/{esm → types}/internal/transformers.d.ts +0 -0
- /package/{esm/internal → types/node}/Digest.d.ts +0 -0
- /package/{esm/types → types/types/ws}/CamSwitcherEvents.d.ts +0 -0
- /package/{esm/node → types/web}/index.d.ts +0 -0
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
exports.WsEvents = void 0;
|
|
4
|
+
class WsEvents {
|
|
5
|
+
validate;
|
|
6
|
+
ws;
|
|
7
|
+
_isDestroyed = false;
|
|
8
8
|
listeners = {};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
this.ws.destroy();
|
|
12
|
-
}
|
|
9
|
+
constructor(validate, ws) {
|
|
10
|
+
this.validate = validate;
|
|
13
11
|
this.ws = ws;
|
|
14
|
-
this.ws.
|
|
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
|
|
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(
|
|
40
|
+
onMessage(incomeData) {
|
|
37
41
|
if (this.isDestroyed) {
|
|
38
42
|
return;
|
|
39
43
|
}
|
|
40
44
|
try {
|
|
41
|
-
const eventData = JSON.parse(
|
|
42
|
-
const data =
|
|
43
|
-
if (data
|
|
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:',
|
|
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.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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.
|
|
70
|
+
exports.WsEvents = WsEvents;
|
|
71
|
+
const isInitEvent = (event) => {
|
|
72
|
+
return event.type === 'init';
|
|
73
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export type Options = {
|
|
2
|
+
ip?: string;
|
|
3
|
+
port?: number;
|
|
4
|
+
user?: string;
|
|
5
|
+
pass?: string;
|
|
6
|
+
tls?: boolean;
|
|
7
|
+
tlsInsecure?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type HttpOptions = Options & {
|
|
10
|
+
keepAlive?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type TParameters = Record<string, string | number | boolean | null | undefined>;
|
|
13
|
+
export type TResponse = {
|
|
14
|
+
json: () => Promise<any>;
|
|
15
|
+
text: () => Promise<string>;
|
|
16
|
+
blob: () => Promise<unknown>;
|
|
17
|
+
status: number;
|
|
18
|
+
ok: boolean;
|
|
19
|
+
statusText: string;
|
|
20
|
+
};
|
|
21
|
+
export type TGetParams = {
|
|
22
|
+
path: string;
|
|
23
|
+
parameters?: TParameters;
|
|
24
|
+
headers?: Record<string, string>;
|
|
25
|
+
timeout?: number;
|
|
26
|
+
};
|
|
27
|
+
export type TPostParams<Data> = {
|
|
28
|
+
path: string;
|
|
29
|
+
data: string | Data;
|
|
30
|
+
parameters?: TParameters;
|
|
31
|
+
headers?: Record<string, string>;
|
|
32
|
+
timeout?: number;
|
|
33
|
+
};
|
|
34
|
+
export interface IClient<TRes extends TResponse, Data> {
|
|
35
|
+
get: (params: TGetParams) => Promise<TRes>;
|
|
36
|
+
post: (params: TPostParams<Data>) => Promise<TRes>;
|
|
37
|
+
}
|
|
38
|
+
export type TBlobResponse<Client extends IClient<TResponse, any>> = Awaited<ReturnType<Awaited<ReturnType<Client['get']>>['blob']>>;
|
|
39
|
+
export interface IWsClient {
|
|
40
|
+
onMessage: null | ((data: ArrayBuffer | string) => void);
|
|
41
|
+
onOpen: () => void;
|
|
42
|
+
onClose: () => void;
|
|
43
|
+
onError: (error: Error) => void;
|
|
44
|
+
send: (data: ArrayBuffer | string) => void;
|
|
45
|
+
reconnect: () => void;
|
|
46
|
+
destroy: () => void;
|
|
47
|
+
}
|
package/cjs/internal/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TPlaylistPlayType } from '../types/CamSwitcherAPI';
|
|
2
|
-
import { TParameters } from './
|
|
2
|
+
import { TParameters } from './types';
|
|
3
3
|
export declare const addParametersToPath: (path: string, params?: TParameters) => string;
|
|
4
4
|
export declare const paramToUrl: (params?: TParameters) => string;
|
|
5
5
|
export declare const arrayToUrl: (arr: string | string[]) => string;
|
|
@@ -9,3 +9,5 @@ export declare const isClip: (id?: string) => boolean;
|
|
|
9
9
|
export declare const isTracker: (id?: string) => boolean;
|
|
10
10
|
export declare const isPlaylist: (id?: string) => boolean;
|
|
11
11
|
export declare const isLoopPlayType: (playType: TPlaylistPlayType) => boolean;
|
|
12
|
+
export declare function pad(num: number, size: number): string;
|
|
13
|
+
export declare function isNullish<T>(value: T | undefined | null): value is undefined | null;
|
package/cjs/internal/utils.js
CHANGED
|
@@ -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.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 (
|
|
19
|
+
if (isNullish(value)) {
|
|
21
20
|
continue;
|
|
22
21
|
}
|
|
23
22
|
output += `${encodeURIComponent(key)}=${encodeURIComponent(value)}&`;
|
|
@@ -44,3 +43,16 @@ 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
|
+
function pad(num, size) {
|
|
47
|
+
const sign = Math.sign(num) === -1 ? '-' : '';
|
|
48
|
+
return (sign +
|
|
49
|
+
new Array(size)
|
|
50
|
+
.concat([Math.abs(num)])
|
|
51
|
+
.join('0')
|
|
52
|
+
.slice(-size));
|
|
53
|
+
}
|
|
54
|
+
exports.pad = pad;
|
|
55
|
+
function isNullish(value) {
|
|
56
|
+
return value === null || value === undefined;
|
|
57
|
+
}
|
|
58
|
+
exports.isNullish = isNullish;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const assertVersionString: (s: string, msg?: string) => void;
|
|
2
2
|
export declare const isFirmwareVersionAtLeast: (version: string, compareVersion: string) => boolean;
|
|
3
3
|
export declare const isVersionAtLeast: (version: string, compareVersion: string) => boolean;
|
|
4
|
-
export declare const firmwareVersionCompare: (a: string, b: string) =>
|
|
5
|
-
export declare const versionCompare: (a: string, b: string) =>
|
|
4
|
+
export declare const firmwareVersionCompare: (a: string, b: string) => 0 | 1 | -1;
|
|
5
|
+
export declare const versionCompare: (a: string, b: string) => 0 | 1 | -1;
|
|
6
6
|
export declare const fixVersionToDots: (version: string) => string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
import { EventEmitter } from 'events';
|
|
5
|
+
import { CamOverlayDrawingOptions, TCairoCreateResponse, TCairoResponse, TUploadImageResponse, TWriteTextParams } from '../types/CamOverlayDrawingAPI';
|
|
6
|
+
export declare class CamOverlayDrawingAPI extends EventEmitter {
|
|
7
|
+
private tls;
|
|
8
|
+
private tlsInsecure;
|
|
9
|
+
private ip;
|
|
10
|
+
private port;
|
|
11
|
+
private user;
|
|
12
|
+
private pass;
|
|
13
|
+
private cameraList;
|
|
14
|
+
private zIndex;
|
|
15
|
+
private callId;
|
|
16
|
+
private sendMessages;
|
|
17
|
+
private timeoutCheckTimer;
|
|
18
|
+
private wsConnected;
|
|
19
|
+
private ws;
|
|
20
|
+
constructor(options?: CamOverlayDrawingOptions);
|
|
21
|
+
connect(): void;
|
|
22
|
+
disconnect(): void;
|
|
23
|
+
isConnected(): boolean;
|
|
24
|
+
cairo(command: string, ...params: unknown[]): Promise<TCairoResponse | TCairoCreateResponse>;
|
|
25
|
+
writeText(...params: TWriteTextParams): Promise<TCairoResponse>;
|
|
26
|
+
uploadImageData(imgBuffer: Buffer): Promise<TUploadImageResponse>;
|
|
27
|
+
uploadFontData(fontBuffer: Buffer): Promise<TCairoCreateResponse>;
|
|
28
|
+
showCairoImage(cairoImage: string, posX: number, posY: number): Promise<TCairoResponse>;
|
|
29
|
+
showCairoImageAbsolute(cairoImage: string, posX: number, posY: number, width: number, height: number): Promise<TCairoResponse>;
|
|
30
|
+
removeImage(): Promise<TCairoResponse>;
|
|
31
|
+
private createWsClient;
|
|
32
|
+
private incomingWsMessageHandler;
|
|
33
|
+
private sendMessage;
|
|
34
|
+
private sendBinaryMessage;
|
|
35
|
+
private startMsgsTimeoutCheck;
|
|
36
|
+
private stopMsgsTimeoutCheck;
|
|
37
|
+
private reconnectWithError;
|
|
38
|
+
private reportMessage;
|
|
39
|
+
private reportError;
|
|
40
|
+
private reportClose;
|
|
41
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CamOverlayDrawingAPI = void 0;
|
|
4
|
-
const
|
|
5
|
-
const WsClient_1 = require("./
|
|
6
|
-
class CamOverlayDrawingAPI extends EventEmitter {
|
|
4
|
+
const events_1 = require("events");
|
|
5
|
+
const WsClient_1 = require("./WsClient");
|
|
6
|
+
class CamOverlayDrawingAPI extends events_1.EventEmitter {
|
|
7
7
|
tls;
|
|
8
8
|
tlsInsecure;
|
|
9
9
|
ip;
|
|
@@ -37,14 +37,14 @@ class CamOverlayDrawingAPI extends EventEmitter {
|
|
|
37
37
|
this.sendMessages = {};
|
|
38
38
|
this.wsConnected = false;
|
|
39
39
|
this.createWsClient();
|
|
40
|
-
EventEmitter.call(this);
|
|
40
|
+
events_1.EventEmitter.call(this);
|
|
41
41
|
}
|
|
42
42
|
connect() {
|
|
43
43
|
this.ws.open();
|
|
44
44
|
this.startMsgsTimeoutCheck();
|
|
45
45
|
}
|
|
46
46
|
disconnect() {
|
|
47
|
-
this.ws.
|
|
47
|
+
this.ws.destroy();
|
|
48
48
|
this.stopMsgsTimeoutCheck();
|
|
49
49
|
}
|
|
50
50
|
isConnected() {
|
|
@@ -101,23 +101,23 @@ class CamOverlayDrawingAPI extends EventEmitter {
|
|
|
101
101
|
tlsInsecure: this.tlsInsecure,
|
|
102
102
|
};
|
|
103
103
|
this.ws = new WsClient_1.WsClient(options);
|
|
104
|
-
this.ws.
|
|
104
|
+
this.ws.onOpen = () => {
|
|
105
105
|
console.log('CamOverlay connection opened');
|
|
106
106
|
this.wsConnected = true;
|
|
107
107
|
this.emit('open');
|
|
108
|
-
}
|
|
109
|
-
this.ws.
|
|
110
|
-
this.ws.
|
|
108
|
+
};
|
|
109
|
+
this.ws.onMessage = (data) => this.incomingWsMessageHandler(data.toString());
|
|
110
|
+
this.ws.onError = (error) => {
|
|
111
111
|
this.reportError(error);
|
|
112
|
-
}
|
|
113
|
-
this.ws.
|
|
112
|
+
};
|
|
113
|
+
this.ws.onClose = () => {
|
|
114
114
|
console.log('CamOverlay connection closed');
|
|
115
115
|
this.wsConnected = false;
|
|
116
116
|
this.reportClose();
|
|
117
|
-
}
|
|
117
|
+
};
|
|
118
118
|
}
|
|
119
119
|
incomingWsMessageHandler(msgData) {
|
|
120
|
-
const dataJSON = JSON.parse(msgData
|
|
120
|
+
const dataJSON = JSON.parse(msgData);
|
|
121
121
|
let errorResponse;
|
|
122
122
|
if ('error' in dataJSON) {
|
|
123
123
|
errorResponse = dataJSON;
|
|
@@ -168,13 +168,21 @@ class CamOverlayDrawingAPI extends EventEmitter {
|
|
|
168
168
|
throw new Error('No CamOverlay connection');
|
|
169
169
|
}
|
|
170
170
|
msgJson.call_id = ++this.callId;
|
|
171
|
-
const
|
|
172
|
-
const
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
const
|
|
177
|
-
|
|
171
|
+
const jsonString = JSON.stringify(msgJson);
|
|
172
|
+
const jsonByteLength = Buffer.byteLength(jsonString);
|
|
173
|
+
const headerLength = 5;
|
|
174
|
+
const totalLength = headerLength + jsonByteLength + data.byteLength;
|
|
175
|
+
const arrayBuffer = new ArrayBuffer(totalLength);
|
|
176
|
+
const view = new DataView(arrayBuffer);
|
|
177
|
+
view.setInt8(0, 1);
|
|
178
|
+
view.setInt32(1, jsonByteLength);
|
|
179
|
+
const jsonBuffer = new Uint8Array(arrayBuffer, 5, jsonByteLength);
|
|
180
|
+
for (let i = 0; i < jsonString.length; i++) {
|
|
181
|
+
jsonBuffer[i] = jsonString.charCodeAt(i);
|
|
182
|
+
}
|
|
183
|
+
const dataBuffer = new Uint8Array(arrayBuffer, 5 + jsonByteLength, data.byteLength);
|
|
184
|
+
data.copy(dataBuffer);
|
|
185
|
+
this.ws.send(arrayBuffer);
|
|
178
186
|
this.sendMessages[this.callId] = { resolve, reject, sentTimestamp: Date.now() };
|
|
179
187
|
}
|
|
180
188
|
catch (err) {
|
|
@@ -1,42 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
-
import { CamOverlayDrawingAPI
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export type TTmf = 'TFM_OVERFLOW' | 'TFM_SCALE' | 'TFM_TRUNCATE';
|
|
8
|
-
export type TObjectFitType = 'fill' | 'fit' | 'none';
|
|
9
|
-
export type TFrameOptions = {
|
|
10
|
-
enabled?: boolean;
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
width: number;
|
|
14
|
-
height: number;
|
|
15
|
-
text?: string;
|
|
16
|
-
fontColor?: TRgb;
|
|
17
|
-
font?: string;
|
|
18
|
-
bgColor?: TRgba;
|
|
19
|
-
bgImage?: string;
|
|
20
|
-
bgType?: TObjectFitType;
|
|
21
|
-
borderRadius?: number;
|
|
22
|
-
borderWidth?: number;
|
|
23
|
-
borderColor?: TRgba;
|
|
24
|
-
customDraw?: TDrawingCallback;
|
|
25
|
-
layer?: number;
|
|
26
|
-
};
|
|
27
|
-
export type TFrameInfo = {
|
|
28
|
-
width: number;
|
|
29
|
-
height: number;
|
|
30
|
-
};
|
|
31
|
-
export type TDrawingCallback = (cod: CamOverlayDrawingAPI, cairo: string, info: TFrameInfo) => Promise<void>;
|
|
32
|
-
export interface Frame {
|
|
33
|
-
on(event: 'open', listener: () => void): this;
|
|
34
|
-
on(event: 'close', listener: () => void): this;
|
|
35
|
-
on(event: 'layoutChanged', listener: () => void): this;
|
|
36
|
-
emit(event: 'open'): boolean;
|
|
37
|
-
emit(event: 'close'): boolean;
|
|
38
|
-
emit(event: 'layoutChanged'): boolean;
|
|
39
|
-
}
|
|
3
|
+
import { CamOverlayDrawingAPI } from '../CamOverlayDrawingAPI';
|
|
4
|
+
import { TAlign, TCairoCreateResponse, TUploadImageResponse } from '../../types/CamOverlayDrawingAPI';
|
|
5
|
+
import { ResourceManager } from './ResourceManager';
|
|
6
|
+
import { TBg, TBorder, TDrawingCallback, TFrame, TFrameOptions, TObjectFitType, TRgb, TRgba, TText, TTmf } from '../../types/CamOverlayPainter';
|
|
40
7
|
export declare class Frame extends EventEmitter {
|
|
41
8
|
protected enabled: boolean;
|
|
42
9
|
protected posX: number;
|
|
@@ -64,17 +31,21 @@ export declare class Frame extends EventEmitter {
|
|
|
64
31
|
disable(): void;
|
|
65
32
|
setFramePosition(x: number, y: number): void;
|
|
66
33
|
setFrameSize(width: number, height: number): void;
|
|
34
|
+
getFrameInfo(): TFrame;
|
|
67
35
|
setText(text: string, align: TAlign, textType?: TTmf, fontColor?: TRgb): void;
|
|
68
36
|
setFontColor(fontColor: TRgb): void;
|
|
69
37
|
setFont(fontName: string): void;
|
|
70
38
|
setFontData(fontData: TCairoCreateResponse): void;
|
|
39
|
+
getTextInfo(): TText;
|
|
71
40
|
setBgColor(color: TRgba): void;
|
|
72
41
|
setBgImage(imageName: string, type?: TObjectFitType): void;
|
|
73
42
|
setBgImageData(imageData: TUploadImageResponse, type?: TObjectFitType): void;
|
|
74
43
|
setBgType(type: TObjectFitType): void;
|
|
44
|
+
getBgInfo(): TBg;
|
|
75
45
|
setBorderRadius(radius: number): void;
|
|
76
46
|
setBorderWidth(width: number): void;
|
|
77
47
|
setBorderColor(color: TRgba): void;
|
|
48
|
+
getBorderInfo(): TBorder;
|
|
78
49
|
setCustomDraw(customDraw: TDrawingCallback): void;
|
|
79
50
|
resetFont(): void;
|
|
80
51
|
resetBgColor(): void;
|
|
@@ -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,23 +1,8 @@
|
|
|
1
|
-
import { CamOverlayDrawingAPI
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
readonly center_left: readonly [-1, 0];
|
|
7
|
-
readonly bottom_left: readonly [-1, 1];
|
|
8
|
-
readonly top_center: readonly [0, -1];
|
|
9
|
-
readonly center: readonly [0, 0];
|
|
10
|
-
readonly bottom_center: readonly [0, 1];
|
|
11
|
-
readonly top_right: readonly [1, -1];
|
|
12
|
-
readonly center_right: readonly [1, 0];
|
|
13
|
-
readonly bottom_right: readonly [1, 1];
|
|
14
|
-
};
|
|
15
|
-
type TCoAlignment = keyof typeof COORD;
|
|
16
|
-
export type TPainterOptions = TFrameOptions & {
|
|
17
|
-
screenWidth: number;
|
|
18
|
-
screenHeight: number;
|
|
19
|
-
coAlignment: TCoAlignment;
|
|
20
|
-
};
|
|
1
|
+
import { CamOverlayDrawingAPI } from '../CamOverlayDrawingAPI';
|
|
2
|
+
import { CamOverlayDrawingOptions } from '../../types/CamOverlayDrawingAPI';
|
|
3
|
+
import { ResourceManager } from './ResourceManager';
|
|
4
|
+
import { Frame } from './Frame';
|
|
5
|
+
import { TCoAlignment, TPainterOptions } from '../../types/CamOverlayPainter';
|
|
21
6
|
export declare class Painter extends Frame {
|
|
22
7
|
private screenWidth;
|
|
23
8
|
private screenHeight;
|
|
@@ -45,4 +30,3 @@ export declare class Painter extends Frame {
|
|
|
45
30
|
private cleanupSurface;
|
|
46
31
|
private positionConvertor;
|
|
47
32
|
}
|
|
48
|
-
export { Frame, TFrameOptions as FrameOptions, ResourceManager, CamOverlayDrawingOptions };
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
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
|
-
|
|
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 =
|
|
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.
|
|
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 =
|
|
62
|
+
this.coAlignment = CamOverlayPainter_1.COORD[coAlignment];
|
|
75
63
|
}
|
|
76
64
|
layoutChanged() {
|
|
77
65
|
this.refreshLayers = true;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CamOverlayDrawingAPI } from '../CamOverlayDrawingAPI';
|
|
2
|
+
import { TUploadImageResponse, TCairoCreateResponse } from '../../types/CamOverlayDrawingAPI';
|
|
3
|
+
export declare class ResourceManager {
|
|
4
|
+
private co;
|
|
5
|
+
private imgFileNames;
|
|
6
|
+
private fontFileNames;
|
|
7
|
+
private images;
|
|
8
|
+
private fonts;
|
|
9
|
+
constructor(co: CamOverlayDrawingAPI);
|
|
10
|
+
registerImage(moniker: string, fileName: string): void;
|
|
11
|
+
registerFont(moniker: string, fileName: string): void;
|
|
12
|
+
image(moniker: string): Promise<TUploadImageResponse | undefined>;
|
|
13
|
+
font(moniker: string): Promise<TCairoCreateResponse | undefined>;
|
|
14
|
+
clear(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ResourceManager = void 0;
|
|
27
|
+
const fs = __importStar(require("fs/promises"));
|
|
28
|
+
class ResourceManager {
|
|
29
|
+
co;
|
|
30
|
+
imgFileNames = {};
|
|
31
|
+
fontFileNames = {};
|
|
32
|
+
images = {};
|
|
33
|
+
fonts = {};
|
|
34
|
+
constructor(co) {
|
|
35
|
+
this.co = co;
|
|
36
|
+
}
|
|
37
|
+
registerImage(moniker, fileName) {
|
|
38
|
+
this.imgFileNames[moniker] = process.env.INSTALL_PATH + '/images/' + fileName;
|
|
39
|
+
}
|
|
40
|
+
registerFont(moniker, fileName) {
|
|
41
|
+
this.fontFileNames[moniker] = process.env.INSTALL_PATH + '/fonts/' + fileName;
|
|
42
|
+
}
|
|
43
|
+
async image(moniker) {
|
|
44
|
+
if (this.images[moniker] !== undefined) {
|
|
45
|
+
return this.images[moniker];
|
|
46
|
+
}
|
|
47
|
+
const path = this.imgFileNames[moniker];
|
|
48
|
+
if (path !== undefined) {
|
|
49
|
+
const imgData = await fs.readFile(path);
|
|
50
|
+
this.images[moniker] = await this.co.uploadImageData(imgData);
|
|
51
|
+
return this.images[moniker];
|
|
52
|
+
}
|
|
53
|
+
throw new Error('Error! Unknown image requested!');
|
|
54
|
+
}
|
|
55
|
+
async font(moniker) {
|
|
56
|
+
if (this.fonts[moniker] !== undefined) {
|
|
57
|
+
return this.fonts[moniker];
|
|
58
|
+
}
|
|
59
|
+
const path = this.fontFileNames[moniker];
|
|
60
|
+
if (path !== undefined) {
|
|
61
|
+
const fontData = await fs.readFile(path);
|
|
62
|
+
this.fonts[moniker] = await this.co.uploadFontData(fontData);
|
|
63
|
+
return this.fonts[moniker];
|
|
64
|
+
}
|
|
65
|
+
throw new Error('Error! Unknown font requested!');
|
|
66
|
+
}
|
|
67
|
+
clear() {
|
|
68
|
+
this.images = {};
|
|
69
|
+
this.fonts = {};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.ResourceManager = ResourceManager;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import { Options } from '../internal/types';
|
|
4
|
+
import { TCamScripterEvent, TEventDeclaration, TEventUndeclaration, TCamScripterResponse } from '../types/CamScripterAPICameraEventsGenerator';
|
|
5
|
+
export declare class CamScripterAPICameraEventsGenerator extends EventEmitter {
|
|
6
|
+
private tls;
|
|
7
|
+
private tlsInsecure;
|
|
8
|
+
private ip;
|
|
9
|
+
private port;
|
|
10
|
+
private user;
|
|
11
|
+
private pass;
|
|
12
|
+
private callId;
|
|
13
|
+
private sendMessages;
|
|
14
|
+
private timeoutCheckTimer;
|
|
15
|
+
private wsConnected;
|
|
16
|
+
private ws;
|
|
17
|
+
constructor(options?: Options);
|
|
18
|
+
connect(): void;
|
|
19
|
+
disconnect(): void;
|
|
20
|
+
declareEvent(eventDeclaration: TEventDeclaration): Promise<TCamScripterResponse>;
|
|
21
|
+
undeclareEvent(eventUndeclaration: TEventUndeclaration): Promise<TCamScripterResponse>;
|
|
22
|
+
sendEvent(event: TCamScripterEvent): Promise<TCamScripterResponse>;
|
|
23
|
+
private createWsClient;
|
|
24
|
+
private incomingWsMessageHandler;
|
|
25
|
+
private sendMessage;
|
|
26
|
+
private startMsgsTimeoutCheck;
|
|
27
|
+
private stopMsgsTimeoutCheck;
|
|
28
|
+
private reconnectWithError;
|
|
29
|
+
private reportErr;
|
|
30
|
+
private reportClose;
|
|
31
|
+
}
|