@snap/camera-kit 0.15.0 → 0.16.2
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 +3 -3
- package/docs/html/assets/main.js +4 -3
- package/docs/html/assets/navigation.js +1 -0
- package/docs/html/assets/search.js +1 -1
- package/docs/html/assets/style.css +72 -25
- package/docs/html/classes/CameraKit.html +11 -196
- package/docs/html/classes/CameraKitSession.html +43 -366
- package/docs/html/classes/CameraKitSource.html +14 -223
- package/docs/html/classes/LensPerformanceMeasurement.html +9 -184
- package/docs/html/classes/LensPerformanceMetrics.html +7 -148
- package/docs/html/classes/LensRepository.html +17 -234
- package/docs/html/classes/Transform2D.html +7 -176
- package/docs/html/classes/TypedCustomEvent.html +4 -178
- package/docs/html/classes/TypedEventTarget.html +4 -209
- package/docs/html/enums/Lens_CameraFacing.html +5 -0
- package/docs/html/enums/UserData_Zodiac.html +15 -0
- package/docs/html/functions/ConcatInjectable.html +10 -193
- package/docs/html/functions/Injectable.html +9 -192
- package/docs/html/functions/bootstrapCameraKit.html +6 -147
- package/docs/html/functions/createExtension.html +6 -123
- package/docs/html/functions/createImageSource.html +4 -130
- package/docs/html/functions/createMediaStreamSource.html +4 -130
- package/docs/html/functions/createVideoSource.html +4 -130
- package/docs/html/functions/estimateLensPerformance.html +3 -120
- package/docs/html/functions/lensSourcesFactory.html +6 -127
- package/docs/html/functions/remoteApiServicesFactory.html +3 -121
- package/docs/html/hierarchy.html +1 -0
- package/docs/html/index.html +8 -165
- package/docs/html/interfaces/CameraKitBootstrapConfiguration.html +11 -192
- package/docs/html/interfaces/CameraKitDeviceOptions.html +11 -0
- package/docs/html/interfaces/CameraKitSourceInfo.html +9 -0
- package/docs/html/interfaces/CameraKitSourceSubscriber.html +3 -194
- package/docs/html/interfaces/ComputedFrameMetrics.html +2 -150
- package/docs/html/interfaces/CreateSessionOptions.html +5 -148
- package/docs/html/interfaces/EstimatedLensPerformance.html +3 -146
- package/docs/html/interfaces/FunctionSourceOptions.html +7 -0
- package/docs/html/interfaces/Lens.html +12 -205
- package/docs/html/interfaces/LensCreator.html +3 -0
- package/docs/html/interfaces/LensLaunchData.html +3 -179
- package/docs/html/interfaces/LensSource.html +3 -172
- package/docs/html/interfaces/LoadAssetRequest.html +13 -0
- package/docs/html/interfaces/MediaStreamSourceOptions.html +16 -138
- package/docs/html/interfaces/Preview.html +4 -141
- package/docs/html/interfaces/RemoteApiRequest.html +7 -162
- package/docs/html/interfaces/RemoteApiResponse.html +6 -155
- package/docs/html/interfaces/RemoteApiService.html +9 -171
- package/docs/html/interfaces/Snapcode.html +5 -148
- package/docs/html/interfaces/UriCancelRequest.html +2 -138
- package/docs/html/interfaces/UriRequest.html +2 -154
- package/docs/html/interfaces/UriResponse.html +2 -150
- package/docs/html/interfaces/VideoSourceOptions.html +15 -134
- package/docs/html/modules.html +57 -175
- package/docs/html/types/AssetLoader.html +5 -132
- package/docs/html/types/AssetResponse.html +1 -0
- package/docs/html/types/AssetTiming.html +2 -115
- package/docs/html/types/BenchmarkError.html +1 -112
- package/docs/html/types/BootstrapError.html +2 -115
- package/docs/html/types/CacheKeyNotFoundError.html +1 -112
- package/docs/html/types/CameraKitSessionEventListener.html +2 -115
- package/docs/html/types/CameraKitSessionEvents.html +2 -122
- package/docs/html/types/CameraKitSourceError.html +1 -112
- package/docs/html/types/ConfigurationError.html +2 -115
- package/docs/html/types/FetchHandler.html +1 -0
- package/docs/html/types/Keyboard.html +14 -194
- package/docs/html/types/KeyboardEvents.html +2 -124
- package/docs/html/types/LegalError.html +1 -112
- package/docs/html/types/LensAbortError.html +2 -115
- package/docs/html/types/LensAssetError.html +2 -115
- package/docs/html/types/LensContentValidationError.html +1 -112
- package/docs/html/types/LensError.html +1 -112
- package/docs/html/types/LensExecutionError.html +2 -115
- package/docs/html/types/LensImagePickerError.html +2 -115
- package/docs/html/types/LensLaunchParams.html +2 -0
- package/docs/html/types/LensMetricsEvents.html +2 -115
- package/docs/html/types/LensPerformanceCluster.html +1 -113
- package/docs/html/types/LensView.html +2 -115
- package/docs/html/types/LensWait.html +2 -115
- package/docs/html/types/Matrix.html +3 -0
- package/docs/html/types/PersistentStoreError.html +2 -115
- package/docs/html/types/PlatformNotSupportedError.html +2 -115
- package/docs/html/types/PublicContainer.html +2 -115
- package/docs/html/types/PublicServices.html +2 -0
- package/docs/html/types/RemoteApiCancelRequestHandler.html +2 -0
- package/docs/html/types/RemoteApiRequestHandler.html +2 -139
- package/docs/html/types/RemoteApiServices.html +1 -112
- package/docs/html/types/RemoteApiStatus.html +2 -115
- package/docs/html/types/RenderTarget.html +2 -115
- package/docs/html/types/Uri.html +1 -112
- package/docs/html/types/WebGLError.html +1 -112
- package/docs/html/variables/extensionRequestContext.html +2 -115
- package/docs/md/README.md +3 -3
- package/docs/md/classes/CameraKit.md +15 -15
- package/docs/md/classes/CameraKitSession.md +38 -38
- package/docs/md/classes/CameraKitSource.md +22 -30
- package/docs/md/classes/LensPerformanceMeasurement.md +10 -6
- package/docs/md/classes/LensPerformanceMetrics.md +2 -2
- package/docs/md/classes/LensRepository.md +18 -18
- package/docs/md/classes/Transform2D.md +7 -3
- package/docs/md/classes/TypedCustomEvent.md +10 -6
- package/docs/md/classes/TypedEventTarget.md +12 -8
- package/docs/md/enums/Lens_CameraFacing.md +36 -0
- package/docs/md/enums/UserData_Zodiac.md +106 -0
- package/docs/md/interfaces/CameraKitBootstrapConfiguration.md +2 -2
- package/docs/md/interfaces/CameraKitDeviceOptions.md +41 -0
- package/docs/md/interfaces/CameraKitSourceInfo.md +43 -0
- package/docs/md/interfaces/CameraKitSourceSubscriber.md +7 -7
- package/docs/md/interfaces/ComputedFrameMetrics.md +1 -1
- package/docs/md/interfaces/CreateSessionOptions.md +1 -1
- package/docs/md/interfaces/EstimatedLensPerformance.md +1 -1
- package/docs/md/interfaces/FunctionSourceOptions.md +22 -0
- package/docs/md/interfaces/Lens.md +4 -4
- package/docs/md/interfaces/LensCreator.md +17 -0
- package/docs/md/interfaces/LensLaunchData.md +6 -6
- package/docs/md/interfaces/LensSource.md +5 -5
- package/docs/md/interfaces/LoadAssetRequest.md +49 -0
- package/docs/md/interfaces/MediaStreamSourceOptions.md +46 -1
- package/docs/md/interfaces/Preview.md +1 -1
- package/docs/md/interfaces/RemoteApiRequest.md +2 -2
- package/docs/md/interfaces/RemoteApiResponse.md +2 -2
- package/docs/md/interfaces/RemoteApiService.md +1 -1
- package/docs/md/interfaces/Snapcode.md +1 -1
- package/docs/md/interfaces/UriCancelRequest.md +2 -2
- package/docs/md/interfaces/UriRequest.md +3 -3
- package/docs/md/interfaces/UriResponse.md +2 -2
- package/docs/md/interfaces/VideoSourceOptions.md +44 -1
- package/docs/md/modules.md +183 -201
- package/lib/CameraKit.d.ts +108 -108
- package/lib/CameraKit.js +1 -1
- package/lib/CameraKit.js.map +1 -1
- package/lib/bootstrapCameraKit.d.ts +4 -4
- package/lib/bootstrapCameraKit.js +18 -19
- package/lib/bootstrapCameraKit.js.map +1 -1
- package/lib/clients/createTsProtoClient.d.ts +5 -12
- package/lib/clients/createTsProtoClient.js +1 -2
- package/lib/clients/createTsProtoClient.js.map +1 -1
- package/lib/clients/grpcHandler.d.ts +7 -4
- package/lib/clients/grpcHandler.js +8 -5
- package/lib/clients/grpcHandler.js.map +1 -1
- package/lib/clients/lensesClient.d.ts +3 -3
- package/lib/clients/lensesClient.js +2 -2
- package/lib/clients/lensesClient.js.map +1 -1
- package/lib/clients/metricsClient.d.ts +26 -0
- package/lib/clients/metricsClient.js +120 -0
- package/lib/clients/metricsClient.js.map +1 -0
- package/lib/configuration.js +1 -1
- package/lib/configuration.js.map +1 -1
- package/lib/dependency-injection/Container.d.ts +1 -1
- package/lib/dependency-injection/Container.js +1 -1
- package/lib/dependency-injection/Container.js.map +1 -1
- package/lib/dependency-injection/Injectable.d.ts +6 -6
- package/lib/dependency-injection/Injectable.js.map +1 -1
- package/lib/dependency-injection/RootServices.d.ts +7 -8
- package/lib/dependency-injection/RootServices.js.map +1 -1
- package/lib/environment.d.ts +4 -0
- package/lib/environment.js +2 -0
- package/lib/environment.js.map +1 -0
- package/lib/extensions/RemoteApiServices.d.ts +2 -2
- package/lib/extensions/RemoteApiServices.js +11 -6
- package/lib/extensions/RemoteApiServices.js.map +1 -1
- package/lib/extensions/uriHandlersRegister.d.ts +4 -4
- package/lib/extensions/uriHandlersRegister.js +6 -6
- package/lib/extensions/uriHandlersRegister.js.map +1 -1
- package/lib/generated-proto/blizzard/cameraKitEvents.d.ts +4330 -678
- package/lib/generated-proto/blizzard/cameraKitEvents.js +515 -72
- package/lib/generated-proto/blizzard/cameraKitEvents.js.map +1 -1
- package/lib/generated-proto/pb_schema/camera_kit/v3/business_events.d.ts +3 -11
- package/lib/generated-proto/pb_schema/camera_kit/v3/business_events.js +6 -156
- package/lib/generated-proto/pb_schema/camera_kit/v3/business_events.js.map +1 -1
- package/lib/generated-proto/pb_schema/camera_kit/v3/export.d.ts +19 -19
- package/lib/generated-proto/pb_schema/camera_kit/v3/export.js +13 -27
- package/lib/generated-proto/pb_schema/camera_kit/v3/export.js.map +1 -1
- package/lib/generated-proto/pb_schema/camera_kit/v3/legal_prompt.d.ts +0 -6
- package/lib/generated-proto/pb_schema/camera_kit/v3/legal_prompt.js +2 -83
- package/lib/generated-proto/pb_schema/camera_kit/v3/legal_prompt.js.map +1 -1
- package/lib/generated-proto/pb_schema/camera_kit/v3/lens.d.ts +0 -22
- package/lib/generated-proto/pb_schema/camera_kit/v3/lens.js +0 -263
- package/lib/generated-proto/pb_schema/camera_kit/v3/lens.js.map +1 -1
- package/lib/generated-proto/pb_schema/camera_kit/v3/operational_metrics.d.ts +30 -34
- package/lib/generated-proto/pb_schema/camera_kit/v3/operational_metrics.js +7 -73
- package/lib/generated-proto/pb_schema/camera_kit/v3/operational_metrics.js.map +1 -1
- package/lib/generated-proto/pb_schema/camera_kit/v3/ranking.d.ts +0 -6
- package/lib/generated-proto/pb_schema/camera_kit/v3/ranking.js +0 -110
- package/lib/generated-proto/pb_schema/camera_kit/v3/ranking.js.map +1 -1
- package/lib/generated-proto/pb_schema/camera_kit/v3/service.d.ts +48 -114
- package/lib/generated-proto/pb_schema/camera_kit/v3/service.js +0 -225
- package/lib/generated-proto/pb_schema/camera_kit/v3/service.js.map +1 -1
- package/lib/generated-proto/pb_schema/cdp/cof/benchmark.d.ts +6 -6
- package/lib/generated-proto/pb_schema/cdp/cof/benchmark.js +5 -19
- package/lib/generated-proto/pb_schema/cdp/cof/benchmark.js.map +1 -1
- package/lib/generated-proto/pb_schema/cdp/cof/circumstance_service.d.ts +1422 -1422
- package/lib/generated-proto/pb_schema/cdp/cof/config_request.d.ts +12 -12
- package/lib/generated-proto/pb_schema/cdp/cof/config_request.js +10 -24
- package/lib/generated-proto/pb_schema/cdp/cof/config_request.js.map +1 -1
- package/lib/generated-proto/pb_schema/cdp/cof/config_response.d.ts +207 -207
- package/lib/generated-proto/pb_schema/cdp/cof/config_result.d.ts +530 -530
- package/lib/generated-proto/pb_schema/cdp/cof/config_result.js +10 -24
- package/lib/generated-proto/pb_schema/cdp/cof/config_result.js.map +1 -1
- package/lib/generated-proto/pb_schema/common/value.d.ts +6 -6
- package/lib/generated-proto/pb_schema/common/value.js +4 -18
- package/lib/generated-proto/pb_schema/common/value.js.map +1 -1
- package/lib/generated-proto/pb_schema/google/api/http.d.ts +0 -6
- package/lib/generated-proto/pb_schema/google/api/http.js +0 -77
- package/lib/generated-proto/pb_schema/google/api/http.js.map +1 -1
- package/lib/generated-proto/pb_schema/google/protobuf/any.d.ts +0 -2
- package/lib/generated-proto/pb_schema/google/protobuf/any.js +0 -44
- package/lib/generated-proto/pb_schema/google/protobuf/any.js.map +1 -1
- package/lib/generated-proto/pb_schema/google/protobuf/descriptor.d.ts +4830 -4896
- package/lib/generated-proto/pb_schema/google/protobuf/descriptor.js +10 -997
- package/lib/generated-proto/pb_schema/google/protobuf/descriptor.js.map +1 -1
- package/lib/generated-proto/pb_schema/google/protobuf/timestamp.d.ts +3 -5
- package/lib/generated-proto/pb_schema/google/protobuf/timestamp.js +6 -35
- package/lib/generated-proto/pb_schema/google/protobuf/timestamp.js.map +1 -1
- package/lib/generated-proto/pb_schema/google/protobuf/wrappers.d.ts +6 -6
- package/lib/generated-proto/pb_schema/google/protobuf/wrappers.js +10 -24
- package/lib/generated-proto/pb_schema/google/protobuf/wrappers.js.map +1 -1
- package/lib/generated-proto/pb_schema/lenses/launchdata.d.ts +9 -9
- package/lib/generated-proto/pb_schema/lenses/remote_api/remote_api_service.d.ts +11 -11
- package/lib/generated-proto/pb_schema/lenses/remote_api/remote_api_service.js +6 -20
- package/lib/generated-proto/pb_schema/lenses/remote_api/remote_api_service.js.map +1 -1
- package/lib/generated-proto/pb_schema/lenses/snappable.d.ts +42 -42
- package/lib/generated-proto/pb_schema/lenses/snappable.js +14 -28
- package/lib/generated-proto/pb_schema/lenses/snappable.js.map +1 -1
- package/lib/generated-proto/pb_schema/lenses/user_data.d.ts +8 -8
- package/lib/generated-proto/pb_schema/lenses/user_data.js +8 -22
- package/lib/generated-proto/pb_schema/lenses/user_data.js.map +1 -1
- package/lib/handlers/defaultFetchHandler.d.ts +1 -1
- package/lib/handlers/defaultFetchHandler.js.map +1 -1
- package/lib/handlers/requestStateEmittingHandler.d.ts +5 -6
- package/lib/handlers/requestStateEmittingHandler.js +6 -8
- package/lib/handlers/requestStateEmittingHandler.js.map +1 -1
- package/lib/handlers/responseCachingHandler.d.ts +9 -10
- package/lib/handlers/responseCachingHandler.js +9 -3
- package/lib/handlers/responseCachingHandler.js.map +1 -1
- package/lib/handlers/utils.d.ts +12 -0
- package/lib/handlers/utils.js +19 -0
- package/lib/handlers/utils.js.map +1 -0
- package/lib/index.d.ts +21 -15
- package/lib/index.js +17 -12
- package/lib/index.js.map +1 -1
- package/lib/lens/Lens.d.ts +12 -2
- package/lib/lens/Lens.js +5 -0
- package/lib/lens/Lens.js.map +1 -1
- package/lib/lens/LensLaunchData.d.ts +6 -3
- package/lib/lens/LensLaunchData.js +2 -0
- package/lib/lens/LensLaunchData.js.map +1 -1
- package/lib/lens/LensPersistenceStore.d.ts +1 -1
- package/lib/lens/LensPersistenceStore.js +1 -1
- package/lib/lens/LensPersistenceStore.js.map +1 -1
- package/lib/lens/LensRepository.d.ts +5 -1
- package/lib/lens/LensRepository.js +9 -5
- package/lib/lens/LensRepository.js.map +1 -1
- package/lib/lens/LensSource.d.ts +2 -2
- package/lib/lens/LensSource.js +2 -2
- package/lib/lens/LensSource.js.map +1 -1
- package/lib/lens/assets/LensAssetRepository.d.ts +35 -4
- package/lib/lens/assets/LensAssetRepository.js +9 -9
- package/lib/lens/assets/LensAssetRepository.js.map +1 -1
- package/lib/lens/assets/LensAssetsProvider.d.ts +1 -1
- package/lib/lens/assets/LensAssetsProvider.js +9 -4
- package/lib/lens/assets/LensAssetsProvider.js.map +1 -1
- package/lib/lens/assets/deviceDependentAssetLoader.js +3 -2
- package/lib/lens/assets/deviceDependentAssetLoader.js.map +1 -1
- package/lib/lens/assets/remoteMediaAssetLoaderFactory.js +4 -3
- package/lib/lens/assets/remoteMediaAssetLoaderFactory.js.map +1 -1
- package/lib/lens/assets/staticAssetLoader.js +5 -4
- package/lib/lens/assets/staticAssetLoader.js.map +1 -1
- package/lib/lens/cameraKitLensSource.js.map +1 -1
- package/lib/lens-client-interface/imagePicker.d.ts +2 -1
- package/lib/lens-client-interface/imagePicker.js.map +1 -1
- package/lib/lens-client-interface/lensClientInterface.d.ts +1 -1
- package/lib/lens-client-interface/lensClientInterface.js +1 -1
- package/lib/lens-client-interface/lensClientInterface.js.map +1 -1
- package/lib/lens-core-module/lensCore.d.ts +2 -1
- package/lib/lens-core-module/lensCore.js.map +1 -1
- package/lib/lens-core-module/loader/bootstrapURLs.d.ts +12 -0
- package/lib/lens-core-module/loader/bootstrapURLs.js +48 -0
- package/lib/lens-core-module/loader/bootstrapURLs.js.map +1 -0
- package/lib/lens-core-module/loader/lensCoreFactory.d.ts +0 -12
- package/lib/lens-core-module/loader/lensCoreFactory.js +4 -49
- package/lib/lens-core-module/loader/lensCoreFactory.js.map +1 -1
- package/lib/lensCoreWasmVersions.d.ts +6 -0
- package/lib/lensCoreWasmVersions.js +6 -0
- package/lib/lensCoreWasmVersions.js.map +1 -0
- package/lib/media-sources/CameraKitSource.d.ts +39 -17
- package/lib/media-sources/CameraKitSource.js +8 -2
- package/lib/media-sources/CameraKitSource.js.map +1 -1
- package/lib/media-sources/FunctionSource.d.ts +15 -4
- package/lib/media-sources/FunctionSource.js +1 -2
- package/lib/media-sources/FunctionSource.js.map +1 -1
- package/lib/media-sources/ImageSource.d.ts +3 -5
- package/lib/media-sources/ImageSource.js +1 -3
- package/lib/media-sources/ImageSource.js.map +1 -1
- package/lib/media-sources/MediaStreamSource.d.ts +17 -33
- package/lib/media-sources/MediaStreamSource.js +6 -41
- package/lib/media-sources/MediaStreamSource.js.map +1 -1
- package/lib/media-sources/VideoSource.d.ts +14 -10
- package/lib/media-sources/VideoSource.js +5 -11
- package/lib/media-sources/VideoSource.js.map +1 -1
- package/lib/metrics/businessEventsReporter.d.ts +3 -4
- package/lib/metrics/businessEventsReporter.js +11 -55
- package/lib/metrics/businessEventsReporter.js.map +1 -1
- package/lib/metrics/operational/Count.d.ts +2 -0
- package/lib/metrics/operational/Count.js +6 -1
- package/lib/metrics/operational/Count.js.map +1 -1
- package/lib/metrics/operational/Histogram.d.ts +1 -1
- package/lib/metrics/operational/Histogram.js +7 -3
- package/lib/metrics/operational/Histogram.js.map +1 -1
- package/lib/metrics/operational/Metric.js +2 -0
- package/lib/metrics/operational/Metric.js.map +1 -1
- package/lib/metrics/operational/Timer.d.ts +9 -6
- package/lib/metrics/operational/Timer.js +12 -26
- package/lib/metrics/operational/Timer.js.map +1 -1
- package/lib/metrics/reporters/reportBenchmarks.d.ts +3 -3
- package/lib/metrics/reporters/reportBenchmarks.js +6 -5
- package/lib/metrics/reporters/reportBenchmarks.js.map +1 -1
- package/lib/metrics/reporters/reportGlobalException.d.ts +4 -4
- package/lib/metrics/reporters/reportGlobalException.js +13 -11
- package/lib/metrics/reporters/reportGlobalException.js.map +1 -1
- package/lib/metrics/reporters/reportHttpMetrics.d.ts +3 -3
- package/lib/metrics/reporters/reportHttpMetrics.js +19 -16
- package/lib/metrics/reporters/reportHttpMetrics.js.map +1 -1
- package/lib/metrics/reporters/reportLegalState.d.ts +3 -3
- package/lib/metrics/reporters/reportLegalState.js +7 -9
- package/lib/metrics/reporters/reportLegalState.js.map +1 -1
- package/lib/metrics/reporters/reportLensAndAssetDownload.d.ts +3 -3
- package/lib/metrics/reporters/reportLensAndAssetDownload.js +12 -12
- package/lib/metrics/reporters/reportLensAndAssetDownload.js.map +1 -1
- package/lib/metrics/reporters/reportLensView.d.ts +3 -3
- package/lib/metrics/reporters/reportLensView.js +6 -6
- package/lib/metrics/reporters/reportLensView.js.map +1 -1
- package/lib/metrics/reporters/reportLensWait.d.ts +2 -3
- package/lib/metrics/reporters/reportLensWait.js +1 -3
- package/lib/metrics/reporters/reportLensWait.js.map +1 -1
- package/lib/metrics/reporters/reportPlatformCapabilities.d.ts +3 -3
- package/lib/metrics/reporters/reportPlatformCapabilities.js +6 -5
- package/lib/metrics/reporters/reportPlatformCapabilities.js.map +1 -1
- package/lib/metrics/reporters/reportUserSession.js +3 -3
- package/lib/metrics/reporters/reportUserSession.js.map +1 -1
- package/lib/metrics/reporters/reporters.d.ts +2 -2
- package/lib/namedErrors.d.ts +1 -1
- package/lib/namedErrors.js +1 -1
- package/lib/namedErrors.js.map +1 -1
- package/lib/observable-operators/unsubscribed.d.ts +1 -1
- package/lib/observable-operators/unsubscribed.js +1 -1
- package/lib/observable-operators/unsubscribed.js.map +1 -1
- package/lib/platform/platformCapabilities.d.ts +1 -1
- package/lib/platform/platformCapabilities.js +9 -3
- package/lib/platform/platformCapabilities.js.map +1 -1
- package/lib/platform/platformInfo.d.ts +1 -0
- package/lib/platform/platformInfo.js +3 -3
- package/lib/platform/platformInfo.js.map +1 -1
- package/lib/remote-configuration/cofHandler.d.ts +3 -3
- package/lib/remote-configuration/cofHandler.js +6 -4
- package/lib/remote-configuration/cofHandler.js.map +1 -1
- package/lib/remote-configuration/preloadConfiguration.d.ts +1 -1
- package/lib/remote-configuration/preloadConfiguration.js +1 -1
- package/lib/remote-configuration/preloadConfiguration.js.map +1 -1
- package/lib/remote-configuration/remoteConfiguration.d.ts +7 -6
- package/lib/remote-configuration/remoteConfiguration.js +18 -15
- package/lib/remote-configuration/remoteConfiguration.js.map +1 -1
- package/lib/session/CameraKitSession.d.ts +8 -8
- package/lib/session/CameraKitSession.js +11 -9
- package/lib/session/CameraKitSession.js.map +1 -1
- package/lib/session/LensKeyboard.d.ts +2 -3
- package/lib/session/LensKeyboard.js.map +1 -1
- package/lib/session/LensPerformanceMeasurement.d.ts +1 -1
- package/lib/session/LensPerformanceMeasurement.js +3 -3
- package/lib/session/LensPerformanceMeasurement.js.map +1 -1
- package/lib/session/LensPerformanceMetrics.d.ts +1 -1
- package/lib/session/LensPerformanceMetrics.js.map +1 -1
- package/lib/session/lensState.d.ts +4 -4
- package/lib/session/lensState.js +10 -10
- package/lib/session/lensState.js.map +1 -1
- package/lib/transforms/Transform2D.d.ts +8 -3
- package/lib/transforms/Transform2D.js +1 -1
- package/lib/transforms/Transform2D.js.map +1 -1
- package/lib/utils.d.ts +3 -0
- package/lib/utils.js +4 -0
- package/lib/utils.js.map +1 -0
- package/package.json +27 -6
- package/docs/html/functions/createUserMediaSource.html +0 -138
- package/docs/html/functions/getRequiredBootstrapURLs.html +0 -130
- package/docs/html/types/CameraKitDeviceInfo.html +0 -125
- package/docs/html/types/CameraKitDeviceOptions.html +0 -120
- package/docs/html/types/CameraKitSourceInfo.html +0 -112
- package/docs/html/types/CameraKitSourceOptions.html +0 -118
- package/lib/common/index.d.ts +0 -2
- package/lib/common/index.js +0 -3
- package/lib/common/index.js.map +0 -1
- package/lib/environment.json +0 -1
- package/lib/handlers/index.d.ts +0 -2
- package/lib/handlers/index.js +0 -3
- package/lib/handlers/index.js.map +0 -1
- package/lib/lens-core-module/index.d.ts +0 -3
- package/lib/lens-core-module/index.js +0 -4
- package/lib/lens-core-module/index.js.map +0 -1
- package/lib/lens-core-module/loader/index.d.ts +0 -1
- package/lib/lens-core-module/loader/index.js +0 -2
- package/lib/lens-core-module/loader/index.js.map +0 -1
- package/lib/lensCoreWasmVersions.json +0 -5
- package/lib/metrics/metricsHandler.d.ts +0 -10
- package/lib/metrics/metricsHandler.js +0 -13
- package/lib/metrics/metricsHandler.js.map +0 -1
- package/lib/metrics/operational/operationalMetricsReporter.d.ts +0 -64
- package/lib/metrics/operational/operationalMetricsReporter.js +0 -144
- package/lib/metrics/operational/operationalMetricsReporter.js.map +0 -1
- package/lib/session/index.d.ts +0 -1
- package/lib/session/index.js +0 -2
- package/lib/session/index.js.map +0 -1
- package/lib/transforms/index.d.ts +0 -1
- package/lib/transforms/index.js +0 -2
- package/lib/transforms/index.js.map +0 -1
package/lib/CameraKit.d.ts
CHANGED
|
@@ -110,135 +110,135 @@ export declare class CameraKit {
|
|
|
110
110
|
export declare const cameraKitFactory: {
|
|
111
111
|
(args_0: LensRepository, args_1: MetricsEventTarget, args_2: {
|
|
112
112
|
ErrorType: {
|
|
113
|
-
LensDeserialization: import("./lens-core-module").LensCoreEnumValue;
|
|
114
|
-
Validation: import("./lens-core-module").LensCoreEnumValue;
|
|
115
|
-
Uncategorized: import("./lens-core-module").LensCoreEnumValue;
|
|
116
|
-
LensExecution: import("./lens-core-module").LensCoreEnumValue;
|
|
117
|
-
Abort: import("./lens-core-module").LensCoreEnumValue;
|
|
118
|
-
Uninitialized: import("./lens-core-module").LensCoreEnumValue;
|
|
113
|
+
LensDeserialization: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
114
|
+
Validation: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
115
|
+
Uncategorized: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
116
|
+
LensExecution: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
117
|
+
Abort: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
118
|
+
Uninitialized: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
119
119
|
};
|
|
120
120
|
AssetType: {
|
|
121
|
-
RemoteMediaByUrl: import("./lens-core-module").LensCoreEnumValue;
|
|
122
|
-
DeviceDependent: import("./lens-core-module").LensCoreEnumValue;
|
|
123
|
-
Static: import("./lens-core-module").LensCoreEnumValue;
|
|
124
|
-
URL: import("./lens-core-module").LensCoreEnumValue;
|
|
125
|
-
BitmojiDynamicAsset: import("./lens-core-module").LensCoreEnumValue;
|
|
121
|
+
RemoteMediaByUrl: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
122
|
+
DeviceDependent: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
123
|
+
Static: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
124
|
+
URL: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
125
|
+
BitmojiDynamicAsset: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
126
126
|
};
|
|
127
127
|
CanvasType: {
|
|
128
|
-
None: import("./lens-core-module").LensCoreEnumValue;
|
|
129
|
-
Preview: import("./lens-core-module").LensCoreEnumValue;
|
|
130
|
-
Capture: import("./lens-core-module").LensCoreEnumValue;
|
|
131
|
-
All: import("./lens-core-module").LensCoreEnumValue;
|
|
128
|
+
None: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
129
|
+
Preview: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
130
|
+
Capture: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
131
|
+
All: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
132
132
|
};
|
|
133
133
|
LensApiVisibility: {
|
|
134
|
-
Dev: import("./lens-core-module").LensCoreEnumValue;
|
|
135
|
-
Private: import("./lens-core-module").LensCoreEnumValue;
|
|
136
|
-
Public: import("./lens-core-module").LensCoreEnumValue;
|
|
134
|
+
Dev: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
135
|
+
Private: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
136
|
+
Public: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
137
137
|
};
|
|
138
138
|
DeviceClass: {
|
|
139
|
-
Undefined: import("./lens-core-module").LensCoreEnumValue;
|
|
140
|
-
BarelyWorking: import("./lens-core-module").LensCoreEnumValue;
|
|
141
|
-
LowEnd: import("./lens-core-module").LensCoreEnumValue;
|
|
142
|
-
MidEnd: import("./lens-core-module").LensCoreEnumValue;
|
|
143
|
-
HighEnd: import("./lens-core-module").LensCoreEnumValue;
|
|
139
|
+
Undefined: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
140
|
+
BarelyWorking: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
141
|
+
LowEnd: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
142
|
+
MidEnd: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
143
|
+
HighEnd: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
144
144
|
};
|
|
145
145
|
RenderLoopMode: {
|
|
146
|
-
SetTimeout: import("./lens-core-module").LensCoreEnumValue;
|
|
147
|
-
RequestAnimationFrame: import("./lens-core-module").LensCoreEnumValue;
|
|
146
|
+
SetTimeout: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
147
|
+
RequestAnimationFrame: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
148
148
|
};
|
|
149
149
|
UserDataAccess: {
|
|
150
|
-
Restricted: import("./lens-core-module").LensCoreEnumValue;
|
|
151
|
-
Unrestricted: import("./lens-core-module").LensCoreEnumValue;
|
|
150
|
+
Restricted: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
151
|
+
Unrestricted: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
152
152
|
};
|
|
153
153
|
InterfaceControl: {
|
|
154
|
-
ToggleCameraButton: import("./lens-core-module").LensCoreEnumValue;
|
|
155
|
-
ImagePicker: import("./lens-core-module").LensCoreEnumValue;
|
|
156
|
-
Hint: import("./lens-core-module").LensCoreEnumValue;
|
|
157
|
-
Modal: import("./lens-core-module").LensCoreEnumValue;
|
|
158
|
-
LinkBitmojiCallToAction: import("./lens-core-module").LensCoreEnumValue;
|
|
159
|
-
SnapButton: import("./lens-core-module").LensCoreEnumValue;
|
|
160
|
-
PlayButton: import("./lens-core-module").LensCoreEnumValue;
|
|
161
|
-
All: import("./lens-core-module").LensCoreEnumValue;
|
|
162
|
-
ExitFullScreenButton: import("./lens-core-module").LensCoreEnumValue;
|
|
163
|
-
MemoriesButton: import("./lens-core-module").LensCoreEnumValue;
|
|
164
|
-
LensAttachmentButton: import("./lens-core-module").LensCoreEnumValue;
|
|
165
|
-
ReverseCamera: import("./lens-core-module").LensCoreEnumValue;
|
|
154
|
+
ToggleCameraButton: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
155
|
+
ImagePicker: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
156
|
+
Hint: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
157
|
+
Modal: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
158
|
+
LinkBitmojiCallToAction: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
159
|
+
SnapButton: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
160
|
+
PlayButton: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
161
|
+
All: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
162
|
+
ExitFullScreenButton: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
163
|
+
MemoriesButton: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
164
|
+
LensAttachmentButton: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
165
|
+
ReverseCamera: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
166
166
|
};
|
|
167
167
|
InterfaceAction: {
|
|
168
|
-
EnableHighlight: import("./lens-core-module").LensCoreEnumValue;
|
|
169
|
-
DisableHighlight: import("./lens-core-module").LensCoreEnumValue;
|
|
170
|
-
Trigger: import("./lens-core-module").LensCoreEnumValue;
|
|
171
|
-
Show: import("./lens-core-module").LensCoreEnumValue;
|
|
172
|
-
Hide: import("./lens-core-module").LensCoreEnumValue;
|
|
168
|
+
EnableHighlight: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
169
|
+
DisableHighlight: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
170
|
+
Trigger: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
171
|
+
Show: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
172
|
+
Hide: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
173
173
|
};
|
|
174
174
|
ExternalMediaOrientation: {
|
|
175
|
-
CW0: import("./lens-core-module").LensCoreEnumValue;
|
|
176
|
-
CW90: import("./lens-core-module").LensCoreEnumValue;
|
|
177
|
-
CW180: import("./lens-core-module").LensCoreEnumValue;
|
|
178
|
-
CW270: import("./lens-core-module").LensCoreEnumValue;
|
|
175
|
+
CW0: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
176
|
+
CW90: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
177
|
+
CW180: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
178
|
+
CW270: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
179
179
|
};
|
|
180
180
|
mainScriptUrlOrBlob: string;
|
|
181
181
|
} & {
|
|
182
182
|
getCoreVersion: () => number;
|
|
183
|
-
getOutputCanvases: () => import("./lens-core-module").GetOutputCanvasesOutput;
|
|
183
|
+
getOutputCanvases: () => import("./lens-core-module/generated-types").GetOutputCanvasesOutput;
|
|
184
184
|
startProfiling: () => void;
|
|
185
185
|
endProfiling: () => void;
|
|
186
|
-
registerUriListener: (scheme: string, route: string, listener: import("./lens-core-module").UriListener) => void;
|
|
187
|
-
provideUriResponse: (requestId: string, response: import("
|
|
188
|
-
setRemoteAssetsProvider: (provider: import("./lens-core-module").SetRemoteAssetsProviderInput) => void;
|
|
189
|
-
setRemoteAssetsUploadHandler: (provider: import("./lens-core-module").SetRemoteAssetsUploadHandlerInput) => void;
|
|
190
|
-
provideRemoteAssetsUploadResponse: (assetResponse: import("./lens-core-module").ProvideRemoteAssetsUploadResponseInput) => void;
|
|
191
|
-
registerShowHintCallback: (callback: import("./lens-core-module").ShowHintCallback) => void;
|
|
192
|
-
registerHideHintCallback: (callback: import("./lens-core-module").HideHintCallback) => void;
|
|
193
|
-
registerSavePersistentStoreCallback: (callback: import("./lens-core-module").SavePersistentStoreCallback) => void;
|
|
194
|
-
setInterfaceControlVisibility: (config: import("./lens-core-module").SetInterfaceControlVisibilityInput) => void;
|
|
195
|
-
handleClientInterfaceAction: (config: import("./lens-core-module").HandleClientInterfaceActionInput) => void;
|
|
196
|
-
provideExternalImage: (config: import("./lens-core-module").ProvideExternalImageInput) => void;
|
|
197
|
-
provideExternalVideo: (config: import("./lens-core-module").ProvideExternalVideoInput) => void;
|
|
198
|
-
setScreenDimmingRequestHandler: (callback: import("./lens-core-module").ScreenDimmingRequestHandler) => void;
|
|
199
|
-
setClientInterfaceRequestHandler: (callback: import("./lens-core-module").ClientInterfaceRequestHandler) => void;
|
|
200
|
-
setPreloadedConfiguration: (config: import("./lens-core-module").SetPreloadedConfigurationInput) => void;
|
|
201
|
-
setAllSoundsMuted: (config: import("./lens-core-module").SetAllSoundsMutedInput) => void;
|
|
202
|
-
setSystemFonts: (config: import("./lens-core-module").SetSystemFontsInput) => void;
|
|
203
|
-
registerBeginWebXrHandler: (handler: ((config: import("./lens-core-module").BeginWebXrInput) => void) | null) => void;
|
|
186
|
+
registerUriListener: (scheme: string, route: string, listener: import("./lens-core-module/generated-types").UriListener) => void;
|
|
187
|
+
provideUriResponse: (requestId: string, response: import(".").UriResponse) => void;
|
|
188
|
+
setRemoteAssetsProvider: (provider: import("./lens-core-module/generated-types").SetRemoteAssetsProviderInput) => void;
|
|
189
|
+
setRemoteAssetsUploadHandler: (provider: import("./lens-core-module/generated-types").SetRemoteAssetsUploadHandlerInput) => void;
|
|
190
|
+
provideRemoteAssetsUploadResponse: (assetResponse: import("./lens-core-module/generated-types").ProvideRemoteAssetsUploadResponseInput) => void;
|
|
191
|
+
registerShowHintCallback: (callback: import("./lens-core-module/generated-types").ShowHintCallback) => void;
|
|
192
|
+
registerHideHintCallback: (callback: import("./lens-core-module/generated-types").HideHintCallback) => void;
|
|
193
|
+
registerSavePersistentStoreCallback: (callback: import("./lens-core-module/generated-types").SavePersistentStoreCallback) => void;
|
|
194
|
+
setInterfaceControlVisibility: (config: import("./lens-core-module/generated-types").SetInterfaceControlVisibilityInput) => void;
|
|
195
|
+
handleClientInterfaceAction: (config: import("./lens-core-module/generated-types").HandleClientInterfaceActionInput) => void;
|
|
196
|
+
provideExternalImage: (config: import("./lens-core-module/generated-types").ProvideExternalImageInput) => void;
|
|
197
|
+
provideExternalVideo: (config: import("./lens-core-module/generated-types").ProvideExternalVideoInput) => void;
|
|
198
|
+
setScreenDimmingRequestHandler: (callback: import("./lens-core-module/generated-types").ScreenDimmingRequestHandler) => void;
|
|
199
|
+
setClientInterfaceRequestHandler: (callback: import("./lens-core-module/generated-types").ClientInterfaceRequestHandler) => void;
|
|
200
|
+
setPreloadedConfiguration: (config: import("./lens-core-module/generated-types").SetPreloadedConfigurationInput) => void;
|
|
201
|
+
setAllSoundsMuted: (config: import("./lens-core-module/generated-types").SetAllSoundsMutedInput) => void;
|
|
202
|
+
setSystemFonts: (config: import("./lens-core-module/generated-types").SetSystemFontsInput) => void;
|
|
203
|
+
registerBeginWebXrHandler: (handler: ((config: import("./lens-core-module/generated-types").BeginWebXrInput) => void) | null) => void;
|
|
204
204
|
registerEndWebXrHandler: (handler: (() => void) | null) => void;
|
|
205
205
|
} & {
|
|
206
|
-
processFrame: (input: Omit<import("./lens-core-module").ProcessFrameInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
207
|
-
addLens: (input: Omit<import("./lens-core-module").AddLensInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
208
|
-
replaceLenses: (input: Omit<import("./lens-core-module").ReplaceLensesInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
209
|
-
removeLens: (input: Omit<import("./lens-core-module").RemoveLensInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
206
|
+
processFrame: (input: Omit<import("./lens-core-module/generated-types").ProcessFrameInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
207
|
+
addLens: (input: Omit<import("./lens-core-module/generated-types").AddLensInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
208
|
+
replaceLenses: (input: Omit<import("./lens-core-module/generated-types").ReplaceLensesInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
209
|
+
removeLens: (input: Omit<import("./lens-core-module/generated-types").RemoveLensInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
210
210
|
clearAllLenses: () => Promise<any>;
|
|
211
211
|
teardown: () => Promise<any>;
|
|
212
|
-
useMediaElement: (input: Omit<import("./lens-core-module").UseMediaElementInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
213
|
-
setFPSLimit: (input: Omit<import("./lens-core-module").SetFpsLimitInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
214
|
-
setRenderLoopMode: (input: Omit<import("./lens-core-module").SetRenderLoopInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
215
|
-
pauseCanvas: (input: Omit<import("./lens-core-module").PauseCanvasInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
216
|
-
setRenderSize: (input: Omit<import("./lens-core-module").SetRenderSizeMatchInputResolutionInput, "onFailure" | "onSuccess"> | Omit<import("./lens-core-module").SetRenderSizeExplicitInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
217
|
-
setInputTransform: (input: Omit<import("./lens-core-module").SetInputTransformInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
218
|
-
imageToYuvBuffer: (input: Omit<import("./lens-core-module").ImageToYuvBufferInput, "onFailure" | "onSuccess">) => Promise<ArrayBuffer>;
|
|
219
|
-
yuvBufferToBitmap: (input: Omit<import("./lens-core-module").YuvBufferToBitmapInput, "onFailure" | "onSuccess">) => Promise<ImageBitmap>;
|
|
220
|
-
setOnFrameProcessedCallback: (input: Omit<import("./lens-core-module").SetOnFrameProcessedInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
221
|
-
setDeviceClass: (input: Omit<import("./lens-core-module").SetDeviceClassInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
222
|
-
setAudioParameters: (input: Omit<import("./lens-core-module").SetAudioParametersInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
223
|
-
processAudioSampleBuffer: (input: Omit<import("./lens-core-module").ProcessAudioSampleBufferInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
212
|
+
useMediaElement: (input: Omit<import("./lens-core-module/generated-types").UseMediaElementInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
213
|
+
setFPSLimit: (input: Omit<import("./lens-core-module/generated-types").SetFpsLimitInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
214
|
+
setRenderLoopMode: (input: Omit<import("./lens-core-module/generated-types").SetRenderLoopInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
215
|
+
pauseCanvas: (input: Omit<import("./lens-core-module/generated-types").PauseCanvasInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
216
|
+
setRenderSize: (input: Omit<import("./lens-core-module/generated-types").SetRenderSizeMatchInputResolutionInput, "onFailure" | "onSuccess"> | Omit<import("./lens-core-module/generated-types").SetRenderSizeExplicitInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
217
|
+
setInputTransform: (input: Omit<import("./lens-core-module/generated-types").SetInputTransformInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
218
|
+
imageToYuvBuffer: (input: Omit<import("./lens-core-module/generated-types").ImageToYuvBufferInput, "onFailure" | "onSuccess">) => Promise<ArrayBuffer>;
|
|
219
|
+
yuvBufferToBitmap: (input: Omit<import("./lens-core-module/generated-types").YuvBufferToBitmapInput, "onFailure" | "onSuccess">) => Promise<ImageBitmap>;
|
|
220
|
+
setOnFrameProcessedCallback: (input: Omit<import("./lens-core-module/generated-types").SetOnFrameProcessedInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
221
|
+
setDeviceClass: (input: Omit<import("./lens-core-module/generated-types").SetDeviceClassInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
222
|
+
setAudioParameters: (input: Omit<import("./lens-core-module/generated-types").SetAudioParametersInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
223
|
+
processAudioSampleBuffer: (input: Omit<import("./lens-core-module/generated-types").ProcessAudioSampleBufferInput, "onFailure" | "onSuccess">) => Promise<any>;
|
|
224
224
|
} & {
|
|
225
225
|
initialize(input: {
|
|
226
226
|
canvas?: string | HTMLCanvasElement | undefined;
|
|
227
|
-
outputResolution?: import("./lens-core-module").Dimensions | undefined;
|
|
227
|
+
outputResolution?: import("./lens-core-module/generated-types").Dimensions | undefined;
|
|
228
228
|
showFpsPanel?: boolean | undefined;
|
|
229
229
|
shouldUseWorker?: boolean | undefined;
|
|
230
|
-
onFrameProcessed?: ((arg: import("./lens-core-module").OnFrameProcessedParam) => void) | undefined;
|
|
231
|
-
xrCapabilities?: import("./lens-core-module").XrCapabilities | undefined;
|
|
230
|
+
onFrameProcessed?: ((arg: import("./lens-core-module/generated-types").OnFrameProcessedParam) => void) | undefined;
|
|
231
|
+
xrCapabilities?: import("./lens-core-module/generated-types").XrCapabilities | undefined;
|
|
232
232
|
exceptionHandler?: ((err: LensCoreError) => void) | undefined;
|
|
233
233
|
}): Promise<void>;
|
|
234
234
|
provideRemoteAssetsResponse(input: {
|
|
235
235
|
assetId: string;
|
|
236
|
-
assetType: import("./lens-core-module").LensCoreEnumValue;
|
|
236
|
+
assetType: import("./lens-core-module/generated-types").LensCoreEnumValue;
|
|
237
237
|
assetBuffer?: ArrayBuffer | undefined;
|
|
238
238
|
assetChecksum?: string | undefined;
|
|
239
239
|
onFailure?: ((err: LensCoreError) => void) | undefined;
|
|
240
240
|
}): void;
|
|
241
|
-
playCanvas(input: Omit<import("./lens-core-module").PlayCanvasInput, "onFailure" | "onSuccess" | "onReady">): Promise<void>;
|
|
241
|
+
playCanvas(input: Omit<import("./lens-core-module/generated-types").PlayCanvasInput, "onFailure" | "onSuccess" | "onReady">): Promise<void>;
|
|
242
242
|
}, args_3: PageVisibility, args_4: Container<{
|
|
243
243
|
LensRepository: LensRepository;
|
|
244
244
|
} & {
|
|
@@ -250,6 +250,10 @@ export declare const cameraKitFactory: {
|
|
|
250
250
|
} & {
|
|
251
251
|
lensCore: LensCore;
|
|
252
252
|
} & import("./dependency-injection/RootServices").PublicServices & import("./dependency-injection/types").ServicesFromInjectables<[{
|
|
253
|
+
(): PageVisibility;
|
|
254
|
+
token: "pageVisibility";
|
|
255
|
+
dependencies: [];
|
|
256
|
+
}, {
|
|
253
257
|
(): MetricsEventTarget;
|
|
254
258
|
token: "metricsEventTarget";
|
|
255
259
|
dependencies: [];
|
|
@@ -258,33 +262,33 @@ export declare const cameraKitFactory: {
|
|
|
258
262
|
token: "requestStateEventTarget";
|
|
259
263
|
dependencies: [];
|
|
260
264
|
}, {
|
|
261
|
-
(args_0: import("./configuration").CameraKitConfiguration, args_1: import("
|
|
265
|
+
(args_0: import("./configuration").CameraKitConfiguration, args_1: import(".").FetchHandler): import("./handlers/HandlerChainBuilder").Handler<RequestInfo, Response, RequestInit | undefined>;
|
|
262
266
|
token: "cameraKitServiceFetchHandler";
|
|
263
267
|
dependencies: readonly ["configuration", "defaultFetchHandler"];
|
|
264
268
|
}, {
|
|
265
|
-
(args_0: import("./configuration").CameraKitConfiguration, args_1: import("
|
|
266
|
-
token: "
|
|
269
|
+
(args_0: import("./configuration").CameraKitConfiguration, args_1: import(".").FetchHandler): import("./clients/grpcHandler").GrpcHandler;
|
|
270
|
+
token: "grpcHandlerFactory";
|
|
267
271
|
dependencies: readonly ["configuration", "cameraKitServiceFetchHandler"];
|
|
268
272
|
}, {
|
|
269
273
|
(args_0: import("./clients/grpcHandler").GrpcHandler): import("./clients/lensesClient").LensesClient;
|
|
270
274
|
token: "lensesClient";
|
|
271
|
-
dependencies: readonly ["
|
|
275
|
+
dependencies: readonly ["grpcHandlerFactory"];
|
|
272
276
|
}, {
|
|
273
|
-
(args_0: import("./configuration").CameraKitConfiguration, args_1: import("./handlers/requestStateEmittingHandler").RequestStateEventTarget, args_2: import("./
|
|
277
|
+
(args_0: import("./configuration").CameraKitConfiguration, args_1: import("./handlers/requestStateEmittingHandler").RequestStateEventTarget, args_2: import("./clients/metricsClient").MetricsClient): import("./handlers/HandlerChainBuilder").Handler<Partial<import("./generated-proto/pb_schema/cdp/cof/config_request").ConfigTargetingRequest>, import("./generated-proto/pb_schema/cdp/cof/config_response").ConfigTargetingResponse, import("./remote-configuration/cofHandler").Metadata & {
|
|
274
278
|
signal?: AbortSignal | null | undefined;
|
|
275
279
|
isSideEffect?: boolean | undefined;
|
|
276
280
|
}>;
|
|
277
281
|
token: "cofHandler";
|
|
278
|
-
dependencies: readonly ["configuration", "requestStateEventTarget", "
|
|
282
|
+
dependencies: readonly ["configuration", "requestStateEventTarget", "metricsClient"];
|
|
279
283
|
}, {
|
|
280
284
|
(args_0: import("./configuration").CameraKitConfiguration, args_1: import("./handlers/HandlerChainBuilder").Handler<Partial<import("./generated-proto/pb_schema/cdp/cof/config_request").ConfigTargetingRequest>, import("./generated-proto/pb_schema/cdp/cof/config_response").ConfigTargetingResponse, import("./remote-configuration/cofHandler").Metadata & {
|
|
281
285
|
signal?: AbortSignal | null | undefined;
|
|
282
286
|
isSideEffect?: boolean | undefined;
|
|
283
|
-
}>, args_2: import("./
|
|
287
|
+
}>, args_2: import("./clients/grpcHandler").GrpcHandler): import("./remote-configuration/remoteConfiguration").RemoteConfiguration;
|
|
284
288
|
token: "remoteConfiguration";
|
|
285
|
-
dependencies: readonly ["configuration", "cofHandler", "
|
|
289
|
+
dependencies: readonly ["configuration", "cofHandler", "grpcHandlerFactory"];
|
|
286
290
|
}, {
|
|
287
|
-
(args_0: import("./handlers/requestStateEmittingHandler").RequestStateEventTarget, args_1: import("
|
|
291
|
+
(args_0: import("./handlers/requestStateEmittingHandler").RequestStateEventTarget, args_1: import(".").FetchHandler, args_2: import(".").LensSource[], args_3: import("./lens/assets/LensAssetRepository").LensAssetRepository): LensRepository;
|
|
288
292
|
token: "LensRepository";
|
|
289
293
|
dependencies: readonly ["requestStateEventTarget", "defaultFetchHandler", "lensSources", "lensAssetRepository"];
|
|
290
294
|
}, {
|
|
@@ -292,23 +296,19 @@ export declare const cameraKitFactory: {
|
|
|
292
296
|
token: "lensPersistenceStore";
|
|
293
297
|
dependencies: readonly ["lensCore"];
|
|
294
298
|
}, {
|
|
295
|
-
(args_0: import("./
|
|
296
|
-
token: "
|
|
297
|
-
dependencies: readonly ["
|
|
298
|
-
}, {
|
|
299
|
-
(args_0: import("./handlers").FetchHandler, args_1: PageVisibility, args_2: import("./configuration").CameraKitConfiguration): import("./metrics/operational/operationalMetricsReporter").OperationalMetricsReporter;
|
|
300
|
-
token: "operationalMetricsReporter";
|
|
301
|
-
dependencies: readonly ["metricsHandler", "pageVisibility", "configuration"];
|
|
299
|
+
(args_0: import("rxjs").Subject<import(".").Metric>, args_1: import("./clients/grpcHandler").GrpcHandler, args_2: PageVisibility): import("./clients/metricsClient").MetricsClient;
|
|
300
|
+
token: "metricsClient";
|
|
301
|
+
dependencies: readonly ["externalMetricsSubject", "grpcHandlerFactory", "pageVisibility"];
|
|
302
302
|
}, {
|
|
303
303
|
(args_0: LensCore, args_1: import(".").AssetLoader, args_2: import(".").AssetLoader, args_3: import(".").AssetLoader, args_4: MetricsEventTarget, args_5: import("./handlers/requestStateEmittingHandler").RequestStateEventTarget): import("./lens/assets/LensAssetRepository").LensAssetRepository;
|
|
304
304
|
token: "lensAssetRepository";
|
|
305
305
|
dependencies: readonly ["lensCore", "deviceDependentAssetLoader", "remoteMediaAssetLoader", "staticAssetLoader", "metricsEventTarget", "requestStateEventTarget"];
|
|
306
306
|
}, {
|
|
307
|
-
(args_0: import("
|
|
307
|
+
(args_0: import(".").FetchHandler, args_1: import("./remote-configuration/remoteConfiguration").RemoteConfiguration): import(".").AssetLoader;
|
|
308
308
|
token: "deviceDependentAssetLoader";
|
|
309
309
|
dependencies: readonly ["defaultFetchHandler", "remoteConfiguration"];
|
|
310
310
|
}, {
|
|
311
|
-
(args_0: import("
|
|
311
|
+
(args_0: import(".").FetchHandler): import(".").AssetLoader;
|
|
312
312
|
token: "staticAssetLoader";
|
|
313
313
|
dependencies: readonly ["defaultFetchHandler"];
|
|
314
314
|
}, {
|
|
@@ -324,9 +324,9 @@ export declare const cameraKitFactory: {
|
|
|
324
324
|
token: "logEntries";
|
|
325
325
|
dependencies: [];
|
|
326
326
|
}, {
|
|
327
|
-
(args_0: import("rxjs").Observable<import("./logger/logger").LogEntry>, args_1: MetricsEventTarget, args_2: import("./
|
|
327
|
+
(args_0: import("rxjs").Observable<import("./logger/logger").LogEntry>, args_1: MetricsEventTarget, args_2: import("./clients/metricsClient").MetricsClient): import("./metrics/reporters/reportGlobalException").GlobalExceptionReporter;
|
|
328
328
|
token: "reportGlobalException";
|
|
329
|
-
dependencies: readonly ["logEntries", "metricsEventTarget", "
|
|
329
|
+
dependencies: readonly ["logEntries", "metricsEventTarget", "metricsClient"];
|
|
330
330
|
}]>>): CameraKit;
|
|
331
331
|
token: "CameraKit";
|
|
332
332
|
dependencies: readonly ["LensRepository", "metricsEventTarget", "lensCore", "pageVisibility", "$container"];
|
package/lib/CameraKit.js
CHANGED
|
@@ -99,7 +99,7 @@ export class CameraKit {
|
|
|
99
99
|
};
|
|
100
100
|
/**
|
|
101
101
|
* If/when we add support for multiple concurrent sessions, we'll need to create a copy of the LensCore WASM
|
|
102
|
-
* module. If we move managing web workers into JS,
|
|
102
|
+
* module. If we move managing web workers into JS, spawning a new worker thread with its own copy of LensCore
|
|
103
103
|
* probably becomes a lot more straightforward.
|
|
104
104
|
*
|
|
105
105
|
* Currently chromium has a bug preventing rendering while tab is hidden when LensCore is in worker mode.
|
package/lib/CameraKit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameraKit.js","sourceRoot":"","sources":["../src/CameraKit.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,qBAAqB,EAAkB,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAa,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAG/D,OAAO,EAAoB,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAsB,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,kCAAkC,EAAE,MAAM,6CAA6C,CAAC;AACjG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAI7D,OAAO,EAAkB,qBAAqB,EAAE,MAAM,yB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AK,CAAC,CAAC;YACpE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC5B,OAAO,OAAO,CAAC;QACnB,CAAC;KAAA;IAED;;OAEG;IAEG,OAAO;;YACT,WAAW,EAAE,CAAC;YACd,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;YAC9B,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YACrE,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACvB,CAAC;KAAA;CACJ;AAtFS;IADL,GAAG;;;;8CA2EH;AAMK;IADL,GAAG;;;;wCAMH;AAGL,gBAAgB;AAChB,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CACtC,WAAW,EACX;IACI,qBAAqB,CAAC,KAAK;IAC3B,yBAAyB,CAAC,KAAK;IAC/B,eAAe,CAAC,KAAK;IACrB,qBAAqB,CAAC,KAAK;IAC3B,SAAS;CACH,EACV,CACI,cAA8B,EAC9B,OAA2B,EAC3B,QAAkB,EAClB,cAA8B,EAC9B,SAAkC,EACpC,EAAE,CAAC,IAAI,SAAS,CAAC,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,CAAC,CACnF,CAAC","sourcesContent":["import { lensRepositoryFactory, LensRepository } from \"./lens/LensRepository\";\nimport { CONTAINER, Container } from \"./dependency-injection/Container\";\nimport { Injectable } from \"./dependency-injection/Injectable\";\nimport { LensCoreError } from \"./lens-core-module/lensCoreError\";\nimport { LensCore } from \"./lens-core-module/lensCore\";\nimport { CameraKitSession, cameraKitSessionFactory } from \"./session/CameraKitSession\";\nimport { registerLensAssetsProvider } from \"./lens/assets/LensAssetsProvider\";\nimport { lensCoreFactory } from \"./lens-core-module/loader/lensCoreFactory\";\nimport { configurationToken } from \"./configuration\";\nimport { RootServices } from \"./dependency-injection/RootServices\";\nimport { registerUriHandlers } from \"./extensions/uriHandlersRegister\";\nimport { MetricsEventTarget, metricsEventTargetFactory } from \"./metrics/metricsEventTarget\";\nimport { reportSessionScopedMetrics } from \"./metrics/reporters/reporters\";\nimport { lensStateFactory } from \"./session/lensState\";\nimport { lensKeyboardFactory } from \"./session/LensKeyboard\";\nimport { registerLensClientInterfaceHandler } from \"./lens-client-interface/lensClientInterface\";\nimport { sessionStateFactory } from \"./session/sessionState\";\nimport { lensExecutionError, lensAbortError } from \"./namedErrors\";\nimport { getLogger, resetLogger } from \"./logger/logger\";\nimport { errorLoggingDecorator } from \"./logger/errorLoggingDecorator\";\nimport { TypedEventTarget } from \"./events/TypedEventTarget\";\nimport { TypedCustomEvent } from \"./events/TypedCustomEvent\";\nimport { LensView } from \"./metrics/reporters/reportLensView\";\nimport { LensWait } from \"./metrics/reporters/reportLensWait\";\nimport { PageVisibility, pageVisibilityFactory } from \"./common/pageVisibility\";\nimport { setPreloadedConfiguration } from \"./remote-configuration/preloadConfiguration\";\n\nconst logger = getLogger(\"CameraKit\");\nconst log = errorLoggingDecorator(logger);\n\n/**\n * Metrics event names that are exposed to apps.\n */\nconst publicMetricsEventNames: Array<LensMetricsEvents[\"detail\"][\"name\"]> = [\"lensView\", \"lensWait\"];\n\n/**\n * Lens metrics events.\n *\n * These events are emitted by {@link CameraKit} to report lens usage, performance, apply latency, etc.\n *\n * @category Lenses\n * @category Metrics\n */\nexport type LensMetricsEvents =\n | TypedCustomEvent<LensView[\"name\"], LensView>\n | TypedCustomEvent<LensWait[\"name\"], LensWait>;\n\n/**\n * Options available when creating a {@link CameraKitSession}.\n *\n * @category Rendering\n */\nexport interface CreateSessionOptions {\n /**\n * Optionally provide an existing canvas element, on which the Live RenderTarget will be rendered.\n *\n * If this is not provided, CameraKit will create a new canvas element which can be added to the DOM.\n */\n liveRenderTarget?: HTMLCanvasElement;\n\n /**\n * Browsers optimize tabs when they are hidden - for example, by pausing the execution of requestAnimationFrame\n * callbacks.\n *\n * If you need the CameraKitSession to continue rendering even when the tab is in the background, set this to true.\n * There is a small performance penalty, and it's a good practice to only render in the background if absolutely\n * necessary.\n */\n renderWhileTabHidden?: boolean;\n}\n\n/**\n * The entry point to the CameraKit SDK's API. Most of CameraKit's features are accessed via this class.\n *\n * Applications obtain an instance of CameraKit by calling {@link bootstrapCameraKit}.\n *\n * @example\n * ```ts\n * const cameraKit = await bootstrapCameraKit(config)\n * ```\n *\n * Then this class can be used to:\n * - Create a {@link CameraKitSession} instance, which provides the API for setting up media inputs, applying Lenses,\n * and obtaining rendered `<canvas>` outputs.\n * - Query for lenses using {@link LensRepository}.\n * - Listen for lens usage metrics events using {@link MetricsEventTarget}.\n *\n * @category Rendering\n * @category Lenses\n */\nexport class CameraKit {\n /** @deprecated Use {@link lensRepository} */\n readonly lenses: { repository: LensRepository };\n\n /**\n * Business metrics (e.g. each time a lens is viewed) are emitted here.\n */\n readonly metrics: TypedEventTarget<LensMetricsEvents> = new TypedEventTarget();\n\n private sessions: CameraKitSession[] = [];\n\n /** @internal */\n constructor(\n /**\n * Used to query for lenses and lens groups.\n */\n readonly lensRepository: LensRepository,\n\n private readonly lensCore: LensCore,\n private readonly pageVisibility: PageVisibility,\n private readonly container: Container<RootServices>,\n allMetrics: MetricsEventTarget\n ) {\n this.lenses = { repository: this.lensRepository };\n // Proxy only a subset of all metrics events to the public-facing emitter -- applications don't need to\n // know about most events.\n publicMetricsEventNames.forEach((eventName) => {\n allMetrics.addEventListener(eventName, (e) => this.metrics.dispatchEvent(e));\n });\n }\n\n /**\n * Create a CameraKitSession.\n *\n * This initializes the rendering engine and returns a {@link CameraKitSession} instance, which provides access\n * to Lens rendering.\n *\n * @example\n * ```ts\n * const cameraKit = await bootstrapCameraKit(config)\n * const session = await cameraKit.createSession()\n *\n * const lens = await cameraKit.lensRepository.loadLens(lensId, groupId)\n * session.applyLens(lens)\n * ```\n *\n * @param options\n */\n @log\n async createSession({\n liveRenderTarget,\n renderWhileTabHidden,\n }: CreateSessionOptions = {}): Promise<CameraKitSession> {\n // Any error happened during lens rendering can be processed by subscribing to sessionErrors\n const exceptionHandler = (error: LensCoreError) => {\n if (error.name === \"LensCoreAbortError\") {\n logger.error(\n lensAbortError(\n \"Unrecoverable error occurred during lens execution. \" +\n \"The CameraKitSession will be destroyed.\",\n error\n )\n );\n } else {\n logger.error(\n lensExecutionError(\n \"Error occurred during lens execution. \" +\n \"The lens cannot be rendered and will be removed from the CameraKitSession.\",\n error\n )\n );\n }\n };\n\n /**\n * If/when we add support for multiple concurrent sessions, we'll need to create a copy of the LensCore WASM\n * module. If we move managing web workers into JS, spawing a new worker thread with its own copy of LensCore\n * probably becomes a lot more straightforward.\n *\n * Currently chromium has a bug preventing rendering while tab is hidden when LensCore is in worker mode.\n * In order to process tab while it is hidden, the current stopgap is to pass in renderWhileTabHidden as true,\n * which will initiate session in non worker mode, and set the RenderLoopMode to `SetTimeout`.\n */\n await this.lensCore.initialize({\n canvas: liveRenderTarget,\n shouldUseWorker: !renderWhileTabHidden && this.container.get(configurationToken).shouldUseWorker,\n exceptionHandler,\n });\n\n await this.lensCore.setRenderLoopMode({\n mode: renderWhileTabHidden\n ? this.lensCore.RenderLoopMode.SetTimeout\n : this.lensCore.RenderLoopMode.RequestAnimationFrame,\n });\n\n // Each session gets its own DI Container – some Services provided by this Container may be shared with the\n // root CameraKit Container, but others may be scoped to the session by passing their token to `copy()`.\n const sessionContainer = this.container\n // Right now this is a no-op. If/when we add support for multiple concurrent sessions, we may end up\n // scoping LensCore to the session.\n .copy()\n\n .provides(sessionStateFactory)\n .provides(lensStateFactory)\n .provides(lensKeyboardFactory)\n .provides(cameraKitSessionFactory)\n\n .run(registerLensAssetsProvider)\n .run(registerLensClientInterfaceHandler)\n .run(setPreloadedConfiguration)\n\n // We'll run a PartialContainer containing reporters for session-scoped metrics. Running this container\n // allows each metric reporter to initialize itself (e.g. by adding event listeners to detect when certain\n // actions occur).\n .run(reportSessionScopedMetrics)\n\n // UriHandlers may have dependencies on session-scoped services (e.g. LensState, LensKeyboard), so they'll\n // be registered with LensCore here.\n .run(registerUriHandlers);\n\n const session = sessionContainer.get(cameraKitSessionFactory.token);\n this.sessions.push(session);\n return session;\n }\n\n /**\n * Destroys all sessions and frees all resources.\n */\n @log\n async destroy() {\n resetLogger();\n this.pageVisibility.destroy();\n await Promise.all(this.sessions.map((session) => session.destroy()));\n this.sessions = [];\n }\n}\n\n/** @internal */\nexport const cameraKitFactory = Injectable(\n \"CameraKit\",\n [\n lensRepositoryFactory.token,\n metricsEventTargetFactory.token,\n lensCoreFactory.token,\n pageVisibilityFactory.token,\n CONTAINER,\n ] as const,\n (\n lensRepository: LensRepository,\n metrics: MetricsEventTarget,\n lensCore: LensCore,\n pageVisibility: PageVisibility,\n container: Container<RootServices>\n ) => new CameraKit(lensRepository, lensCore, pageVisibility, container, metrics)\n);\n"]}
|
|
1
|
+
{"version":3,"file":"CameraKit.js","sourceRoot":"","sources":["../src/CameraKit.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,qBAAqB,EAAkB,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAa,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAG/D,OAAO,EAAoB,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAsB,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,E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AQ,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,CAAC,CACnF,CAAC","sourcesContent":["import { lensRepositoryFactory, LensRepository } from \"./lens/LensRepository\";\nimport { CONTAINER, Container } from \"./dependency-injection/Container\";\nimport { Injectable } from \"./dependency-injection/Injectable\";\nimport { LensCoreError } from \"./lens-core-module/lensCoreError\";\nimport { LensCore } from \"./lens-core-module/lensCore\";\nimport { CameraKitSession, cameraKitSessionFactory } from \"./session/CameraKitSession\";\nimport { registerLensAssetsProvider } from \"./lens/assets/LensAssetsProvider\";\nimport { lensCoreFactory } from \"./lens-core-module/loader/lensCoreFactory\";\nimport { configurationToken } from \"./configuration\";\nimport { RootServices } from \"./dependency-injection/RootServices\";\nimport { registerUriHandlers } from \"./extensions/uriHandlersRegister\";\nimport { MetricsEventTarget, metricsEventTargetFactory } from \"./metrics/metricsEventTarget\";\nimport { reportSessionScopedMetrics } from \"./metrics/reporters/reporters\";\nimport { lensStateFactory } from \"./session/lensState\";\nimport { lensKeyboardFactory } from \"./session/LensKeyboard\";\nimport { registerLensClientInterfaceHandler } from \"./lens-client-interface/lensClientInterface\";\nimport { sessionStateFactory } from \"./session/sessionState\";\nimport { lensExecutionError, lensAbortError } from \"./namedErrors\";\nimport { getLogger, resetLogger } from \"./logger/logger\";\nimport { errorLoggingDecorator } from \"./logger/errorLoggingDecorator\";\nimport { TypedEventTarget } from \"./events/TypedEventTarget\";\nimport { TypedCustomEvent } from \"./events/TypedCustomEvent\";\nimport { LensView } from \"./metrics/reporters/reportLensView\";\nimport { LensWait } from \"./metrics/reporters/reportLensWait\";\nimport { PageVisibility, pageVisibilityFactory } from \"./common/pageVisibility\";\nimport { setPreloadedConfiguration } from \"./remote-configuration/preloadConfiguration\";\n\nconst logger = getLogger(\"CameraKit\");\nconst log = errorLoggingDecorator(logger);\n\n/**\n * Metrics event names that are exposed to apps.\n */\nconst publicMetricsEventNames: Array<LensMetricsEvents[\"detail\"][\"name\"]> = [\"lensView\", \"lensWait\"];\n\n/**\n * Lens metrics events.\n *\n * These events are emitted by {@link CameraKit} to report lens usage, performance, apply latency, etc.\n *\n * @category Lenses\n * @category Metrics\n */\nexport type LensMetricsEvents =\n | TypedCustomEvent<LensView[\"name\"], LensView>\n | TypedCustomEvent<LensWait[\"name\"], LensWait>;\n\n/**\n * Options available when creating a {@link CameraKitSession}.\n *\n * @category Rendering\n */\nexport interface CreateSessionOptions {\n /**\n * Optionally provide an existing canvas element, on which the Live RenderTarget will be rendered.\n *\n * If this is not provided, CameraKit will create a new canvas element which can be added to the DOM.\n */\n liveRenderTarget?: HTMLCanvasElement;\n\n /**\n * Browsers optimize tabs when they are hidden - for example, by pausing the execution of requestAnimationFrame\n * callbacks.\n *\n * If you need the CameraKitSession to continue rendering even when the tab is in the background, set this to true.\n * There is a small performance penalty, and it's a good practice to only render in the background if absolutely\n * necessary.\n */\n renderWhileTabHidden?: boolean;\n}\n\n/**\n * The entry point to the CameraKit SDK's API. Most of CameraKit's features are accessed via this class.\n *\n * Applications obtain an instance of CameraKit by calling {@link bootstrapCameraKit}.\n *\n * @example\n * ```ts\n * const cameraKit = await bootstrapCameraKit(config)\n * ```\n *\n * Then this class can be used to:\n * - Create a {@link CameraKitSession} instance, which provides the API for setting up media inputs, applying Lenses,\n * and obtaining rendered `<canvas>` outputs.\n * - Query for lenses using {@link LensRepository}.\n * - Listen for lens usage metrics events using {@link MetricsEventTarget}.\n *\n * @category Rendering\n * @category Lenses\n */\nexport class CameraKit {\n /** @deprecated Use {@link lensRepository} */\n readonly lenses: { repository: LensRepository };\n\n /**\n * Business metrics (e.g. each time a lens is viewed) are emitted here.\n */\n readonly metrics: TypedEventTarget<LensMetricsEvents> = new TypedEventTarget();\n\n private sessions: CameraKitSession[] = [];\n\n /** @internal */\n constructor(\n /**\n * Used to query for lenses and lens groups.\n */\n readonly lensRepository: LensRepository,\n\n private readonly lensCore: LensCore,\n private readonly pageVisibility: PageVisibility,\n private readonly container: Container<RootServices>,\n allMetrics: MetricsEventTarget\n ) {\n this.lenses = { repository: this.lensRepository };\n // Proxy only a subset of all metrics events to the public-facing emitter -- applications don't need to\n // know about most events.\n publicMetricsEventNames.forEach((eventName) => {\n allMetrics.addEventListener(eventName, (e) => this.metrics.dispatchEvent(e));\n });\n }\n\n /**\n * Create a CameraKitSession.\n *\n * This initializes the rendering engine and returns a {@link CameraKitSession} instance, which provides access\n * to Lens rendering.\n *\n * @example\n * ```ts\n * const cameraKit = await bootstrapCameraKit(config)\n * const session = await cameraKit.createSession()\n *\n * const lens = await cameraKit.lensRepository.loadLens(lensId, groupId)\n * session.applyLens(lens)\n * ```\n *\n * @param options\n */\n @log\n async createSession({\n liveRenderTarget,\n renderWhileTabHidden,\n }: CreateSessionOptions = {}): Promise<CameraKitSession> {\n // Any error happened during lens rendering can be processed by subscribing to sessionErrors\n const exceptionHandler = (error: LensCoreError) => {\n if (error.name === \"LensCoreAbortError\") {\n logger.error(\n lensAbortError(\n \"Unrecoverable error occurred during lens execution. \" +\n \"The CameraKitSession will be destroyed.\",\n error\n )\n );\n } else {\n logger.error(\n lensExecutionError(\n \"Error occurred during lens execution. \" +\n \"The lens cannot be rendered and will be removed from the CameraKitSession.\",\n error\n )\n );\n }\n };\n\n /**\n * If/when we add support for multiple concurrent sessions, we'll need to create a copy of the LensCore WASM\n * module. If we move managing web workers into JS, spawning a new worker thread with its own copy of LensCore\n * probably becomes a lot more straightforward.\n *\n * Currently chromium has a bug preventing rendering while tab is hidden when LensCore is in worker mode.\n * In order to process tab while it is hidden, the current stopgap is to pass in renderWhileTabHidden as true,\n * which will initiate session in non worker mode, and set the RenderLoopMode to `SetTimeout`.\n */\n await this.lensCore.initialize({\n canvas: liveRenderTarget,\n shouldUseWorker: !renderWhileTabHidden && this.container.get(configurationToken).shouldUseWorker,\n exceptionHandler,\n });\n\n await this.lensCore.setRenderLoopMode({\n mode: renderWhileTabHidden\n ? this.lensCore.RenderLoopMode.SetTimeout\n : this.lensCore.RenderLoopMode.RequestAnimationFrame,\n });\n\n // Each session gets its own DI Container – some Services provided by this Container may be shared with the\n // root CameraKit Container, but others may be scoped to the session by passing their token to `copy()`.\n const sessionContainer = this.container\n // Right now this is a no-op. If/when we add support for multiple concurrent sessions, we may end up\n // scoping LensCore to the session.\n .copy()\n\n .provides(sessionStateFactory)\n .provides(lensStateFactory)\n .provides(lensKeyboardFactory)\n .provides(cameraKitSessionFactory)\n\n .run(registerLensAssetsProvider)\n .run(registerLensClientInterfaceHandler)\n .run(setPreloadedConfiguration)\n\n // We'll run a PartialContainer containing reporters for session-scoped metrics. Running this container\n // allows each metric reporter to initialize itself (e.g. by adding event listeners to detect when certain\n // actions occur).\n .run(reportSessionScopedMetrics)\n\n // UriHandlers may have dependencies on session-scoped services (e.g. LensState, LensKeyboard), so they'll\n // be registered with LensCore here.\n .run(registerUriHandlers);\n\n const session = sessionContainer.get(cameraKitSessionFactory.token);\n this.sessions.push(session);\n return session;\n }\n\n /**\n * Destroys all sessions and frees all resources.\n */\n @log\n async destroy() {\n resetLogger();\n this.pageVisibility.destroy();\n await Promise.all(this.sessions.map((session) => session.destroy()));\n this.sessions = [];\n }\n}\n\n/** @internal */\nexport const cameraKitFactory = Injectable(\n \"CameraKit\",\n [\n lensRepositoryFactory.token,\n metricsEventTargetFactory.token,\n lensCoreFactory.token,\n pageVisibilityFactory.token,\n CONTAINER,\n ] as const,\n (\n lensRepository: LensRepository,\n metrics: MetricsEventTarget,\n lensCore: LensCore,\n pageVisibility: PageVisibility,\n container: Container<RootServices>\n ) => new CameraKit(lensRepository, lensCore, pageVisibility, container, metrics)\n);\n"]}
|
|
@@ -60,8 +60,8 @@ export declare function bootstrapCameraKit(configuration: CameraKitBootstrapConf
|
|
|
60
60
|
* replacing the default implementation that loads remote lens assets with a custom implementation that returns
|
|
61
61
|
* different assets based on some business logic within the application.
|
|
62
62
|
*
|
|
63
|
-
* An extension is implemented as a
|
|
64
|
-
* dependencies, which each provide some "Service.
|
|
63
|
+
* An extension is implemented as a {@link PartialContainer} – a collection of factory functions, each with its own
|
|
64
|
+
* dependencies, which each provide some "Service". A Service can be of any type, and the CameraKit SDK defines its
|
|
65
65
|
* own Services, some of which can be overridden by providing a custom implementation of the type via an extension.
|
|
66
66
|
*
|
|
67
67
|
* Here's an example of how extensions might be used:
|
|
@@ -81,8 +81,8 @@ export declare function bootstrapCameraKit(configuration: CameraKitBootstrapConf
|
|
|
81
81
|
* },
|
|
82
82
|
* )
|
|
83
83
|
*
|
|
84
|
-
* const myExtension = createExtension().provides(
|
|
85
|
-
* const cameraKit = bootstrapCameraKit(config, container => container.provides(myExtension))
|
|
84
|
+
* const myExtension = createExtension().provides(myCustomRemoteAssetLoader);
|
|
85
|
+
* const cameraKit = bootstrapCameraKit(config, container => container.provides(myExtension));
|
|
86
86
|
* ```
|
|
87
87
|
*
|
|
88
88
|
* This also enables greater modularity – the person/team creating the extension can do so in their own package, which
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
|
-
import environment from "./environment
|
|
3
|
-
import lensCoreWasm from "./lensCoreWasmVersions
|
|
2
|
+
import environment from "./environment";
|
|
3
|
+
import lensCoreWasm from "./lensCoreWasmVersions";
|
|
4
4
|
import { lensRepositoryFactory } from "./lens/LensRepository";
|
|
5
5
|
import { Container } from "./dependency-injection/Container";
|
|
6
6
|
import { cameraKitFactory } from "./CameraKit";
|
|
@@ -13,8 +13,6 @@ import { defaultFetchHandlerFactory } from "./handlers/defaultFetchHandler";
|
|
|
13
13
|
import { cameraKitServiceFetchHandlerFactory } from "./handlers/cameraKitServiceFetchHandlerFactory";
|
|
14
14
|
import { createCameraKitConfigurationFactory } from "./configuration";
|
|
15
15
|
import { PartialContainer } from "./dependency-injection/PartialContainer";
|
|
16
|
-
import { metricsHandlerFactory } from "./metrics/metricsHandler";
|
|
17
|
-
import { operationalMetricReporterFactory } from "./metrics/operational/operationalMetricsReporter";
|
|
18
16
|
import { uriHandlersFactory } from "./extensions/UriHandlers";
|
|
19
17
|
import { assert } from "./common/assertions";
|
|
20
18
|
import { isSafeString } from "./common/typeguards";
|
|
@@ -37,9 +35,11 @@ import { pageVisibilityFactory } from "./common/pageVisibility";
|
|
|
37
35
|
import { cofHandlerFactory } from "./remote-configuration/cofHandler";
|
|
38
36
|
import { remoteApiServicesFactory } from "./extensions/RemoteApiServices";
|
|
39
37
|
import { lensesClientFactory } from "./clients/lensesClient";
|
|
40
|
-
import {
|
|
38
|
+
import { grpcHandlerFactory } from "./clients/grpcHandler";
|
|
41
39
|
import { lensSourcesFactory } from "./lens/LensSource";
|
|
42
40
|
import { cameraKitLensSourceFactory } from "./lens/cameraKitLensSource";
|
|
41
|
+
import { externalMetricsSubjectFactory, metricsClientFactory } from "./clients/metricsClient";
|
|
42
|
+
import { Timer } from "./metrics/operational/Timer";
|
|
43
43
|
const logger = getLogger("bootstrapCameraKit");
|
|
44
44
|
// The following errors are not wrapped with BootstrapError and bubble up as is.
|
|
45
45
|
const nonWrappableErrors = [
|
|
@@ -101,17 +101,17 @@ export function bootstrapCameraKit(configuration, provide) {
|
|
|
101
101
|
return __awaiter(this, void 0, void 0, function* () {
|
|
102
102
|
console.info(`Camera Kit SDK: ${environment.PACKAGE_VERSION} (${lensCoreWasm.version}/${lensCoreWasm.buildNumber})`);
|
|
103
103
|
try {
|
|
104
|
-
const
|
|
104
|
+
const bootstrapLatency = new Timer("bootstrap_time");
|
|
105
105
|
assert(isSafeString(configuration.apiToken), configurationError("Invalid or unsafe apiToken provided."));
|
|
106
106
|
const configurationFactory = createCameraKitConfigurationFactory(configuration);
|
|
107
107
|
// Public container holds services which applications can overwrite with their own implementations.
|
|
108
108
|
const defaultPublicContainer = Container.provides(configurationFactory)
|
|
109
|
-
.provides(pageVisibilityFactory)
|
|
110
109
|
.provides(defaultFetchHandlerFactory)
|
|
111
110
|
.provides(remoteMediaAssetLoaderFactory)
|
|
112
111
|
.provides(lensSourcesFactory)
|
|
113
112
|
.provides(remoteApiServicesFactory)
|
|
114
|
-
.provides(uriHandlersFactory)
|
|
113
|
+
.provides(uriHandlersFactory)
|
|
114
|
+
.provides(externalMetricsSubjectFactory);
|
|
115
115
|
const publicContainer = provide ? provide(defaultPublicContainer) : defaultPublicContainer;
|
|
116
116
|
// Now that the client's provide() function has completed and the configuration override is ready,
|
|
117
117
|
// we create another container to initialize the logger. This ensures that logging is available
|
|
@@ -120,15 +120,14 @@ export function bootstrapCameraKit(configuration, provide) {
|
|
|
120
120
|
// and we're not interested in errors thrown by their provide() function.
|
|
121
121
|
// Below is the minimum required container to report errors to Blizzard.
|
|
122
122
|
const telemetryContainer = Container.provides(publicContainer)
|
|
123
|
+
.provides(pageVisibilityFactory)
|
|
123
124
|
.provides(cameraKitServiceFetchHandlerFactory)
|
|
124
|
-
.provides(
|
|
125
|
+
.provides(grpcHandlerFactory)
|
|
126
|
+
.provides(metricsClientFactory)
|
|
125
127
|
.provides(logEntriesFactory)
|
|
126
128
|
.run(registerLogEntriesSubscriber)
|
|
127
|
-
.provides(lensesClientFactory)
|
|
128
129
|
.provides(requestStateEventTargetFactory)
|
|
129
130
|
.provides(metricsEventTargetFactory)
|
|
130
|
-
.provides(metricsHandlerFactory)
|
|
131
|
-
.provides(operationalMetricReporterFactory)
|
|
132
131
|
.provides(reportGlobalException)
|
|
133
132
|
.provides(cofHandlerFactory)
|
|
134
133
|
.provides(remoteConfigurationFactory)
|
|
@@ -153,6 +152,7 @@ export function bootstrapCameraKit(configuration, provide) {
|
|
|
153
152
|
const lensCore = yield telemetryContainer.provides(lensCoreFactory).get(lensCoreFactory.token);
|
|
154
153
|
const container = telemetryContainer
|
|
155
154
|
.provides(Injectable(lensCoreFactory.token, () => lensCore))
|
|
155
|
+
.provides(lensesClientFactory)
|
|
156
156
|
.provides(cameraKitLensSourceFactory)
|
|
157
157
|
.provides(lensPersistenceStoreFactory)
|
|
158
158
|
.provides(deviceDependentAssetLoaderFactory)
|
|
@@ -161,9 +161,8 @@ export function bootstrapCameraKit(configuration, provide) {
|
|
|
161
161
|
.provides(lensRepositoryFactory)
|
|
162
162
|
.provides(cameraKitFactory);
|
|
163
163
|
const cameraKit = container.get(cameraKitFactory.token);
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
reporter.timer("bootstrap_time", bootstrapTimeMs);
|
|
164
|
+
bootstrapLatency.measure();
|
|
165
|
+
container.get(metricsClientFactory.token).setOperationalMetrics(bootstrapLatency);
|
|
167
166
|
return cameraKit;
|
|
168
167
|
}
|
|
169
168
|
catch (error) {
|
|
@@ -182,8 +181,8 @@ export function bootstrapCameraKit(configuration, provide) {
|
|
|
182
181
|
* replacing the default implementation that loads remote lens assets with a custom implementation that returns
|
|
183
182
|
* different assets based on some business logic within the application.
|
|
184
183
|
*
|
|
185
|
-
* An extension is implemented as a
|
|
186
|
-
* dependencies, which each provide some "Service.
|
|
184
|
+
* An extension is implemented as a {@link PartialContainer} – a collection of factory functions, each with its own
|
|
185
|
+
* dependencies, which each provide some "Service". A Service can be of any type, and the CameraKit SDK defines its
|
|
187
186
|
* own Services, some of which can be overridden by providing a custom implementation of the type via an extension.
|
|
188
187
|
*
|
|
189
188
|
* Here's an example of how extensions might be used:
|
|
@@ -203,8 +202,8 @@ export function bootstrapCameraKit(configuration, provide) {
|
|
|
203
202
|
* },
|
|
204
203
|
* )
|
|
205
204
|
*
|
|
206
|
-
* const myExtension = createExtension().provides(
|
|
207
|
-
* const cameraKit = bootstrapCameraKit(config, container => container.provides(myExtension))
|
|
205
|
+
* const myExtension = createExtension().provides(myCustomRemoteAssetLoader);
|
|
206
|
+
* const cameraKit = bootstrapCameraKit(config, container => container.provides(myExtension));
|
|
208
207
|
* ```
|
|
209
208
|
*
|
|
210
209
|
* This also enables greater modularity – the person/team creating the extension can do so in their own package, which
|