@snap/camera-kit 1.0.1 → 1.2.0
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 +1 -1
- package/dist/CameraKit.d.ts +17 -6
- package/dist/CameraKit.d.ts.map +1 -1
- package/dist/CameraKit.js +26 -4
- package/dist/CameraKit.js.map +1 -1
- package/dist/RootServices.d.ts +6 -2
- package/dist/RootServices.d.ts.map +1 -1
- package/dist/RootServices.js.map +1 -1
- package/dist/bootstrapCameraKit.d.ts.map +1 -1
- package/dist/bootstrapCameraKit.js +6 -2
- package/dist/bootstrapCameraKit.js.map +1 -1
- package/dist/clients/remoteApiSpecsClient.d.ts +10 -0
- package/dist/clients/remoteApiSpecsClient.d.ts.map +1 -0
- package/dist/clients/remoteApiSpecsClient.js +6 -0
- package/dist/clients/remoteApiSpecsClient.js.map +1 -0
- package/dist/common/typeguards.d.ts +3 -0
- package/dist/common/typeguards.d.ts.map +1 -1
- package/dist/common/typeguards.js +12 -0
- package/dist/common/typeguards.js.map +1 -1
- package/dist/configuration.d.ts +115 -0
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js +1 -0
- package/dist/configuration.js.map +1 -1
- package/dist/environment.js +1 -1
- package/dist/environment.js.map +1 -1
- package/dist/extensions/extensionRequestContext.d.ts +6 -0
- package/dist/extensions/extensionRequestContext.d.ts.map +1 -1
- package/dist/extensions/extensionRequestContext.js +3 -2
- package/dist/extensions/extensionRequestContext.js.map +1 -1
- package/dist/geo/geoDataProvider.d.ts +32 -0
- package/dist/geo/geoDataProvider.d.ts.map +1 -0
- package/dist/geo/geoDataProvider.js +25 -0
- package/dist/geo/geoDataProvider.js.map +1 -0
- package/dist/geo/registerGeoDataProvider.d.ts +11 -0
- package/dist/geo/registerGeoDataProvider.d.ts.map +1 -0
- package/dist/geo/registerGeoDataProvider.js +22 -0
- package/dist/geo/registerGeoDataProvider.js.map +1 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/lens-core-module/generated-types.d.ts +28 -0
- package/dist/lens-core-module/generated-types.d.ts.map +1 -1
- package/dist/lens-core-module/generated-types.js.map +1 -1
- package/dist/lens-core-module/lensCore.d.ts.map +1 -1
- package/dist/lens-core-module/lensCore.js +1 -0
- package/dist/lens-core-module/lensCore.js.map +1 -1
- package/dist/lensCoreWasmVersions.js +3 -3
- package/dist/lensCoreWasmVersions.js.map +1 -1
- package/dist/platform/platformInfo.d.ts.map +1 -1
- package/dist/platform/platformInfo.js +1 -1
- package/dist/platform/platformInfo.js.map +1 -1
- package/dist/remote-configuration/cofHandler.js.map +1 -1
- package/dist/remote-configuration/remoteConfiguration.d.ts +4 -0
- package/dist/remote-configuration/remoteConfiguration.d.ts.map +1 -1
- package/dist/remote-configuration/remoteConfiguration.js +10 -0
- package/dist/remote-configuration/remoteConfiguration.js.map +1 -1
- package/dist/session/CameraKitSession.d.ts +9 -9
- package/dist/session/CameraKitSession.d.ts.map +1 -1
- package/dist/session/CameraKitSession.js +4 -2
- package/dist/session/CameraKitSession.js.map +1 -1
- package/dist/session/LensKeyboard.d.ts +75 -31
- package/dist/session/LensKeyboard.d.ts.map +1 -1
- package/dist/session/LensKeyboard.js +60 -38
- package/dist/session/LensKeyboard.js.map +1 -1
- package/dist/uri-handlers/UriHandlers.d.ts.map +1 -0
- package/dist/uri-handlers/UriHandlers.js.map +1 -0
- package/dist/uri-handlers/internal-handlers/httpUriHandler.d.ts +42 -0
- package/dist/uri-handlers/internal-handlers/httpUriHandler.d.ts.map +1 -0
- package/dist/uri-handlers/internal-handlers/httpUriHandler.js +149 -0
- package/dist/uri-handlers/internal-handlers/httpUriHandler.js.map +1 -0
- package/dist/uri-handlers/internal-handlers/httpValidators.d.ts +9 -0
- package/dist/uri-handlers/internal-handlers/httpValidators.d.ts.map +1 -0
- package/dist/uri-handlers/internal-handlers/httpValidators.js +115 -0
- package/dist/uri-handlers/internal-handlers/httpValidators.js.map +1 -0
- package/dist/{extensions/RemoteApiServices.d.ts → uri-handlers/internal-handlers/remoteApiUriHandler.d.ts} +8 -8
- package/dist/uri-handlers/internal-handlers/remoteApiUriHandler.d.ts.map +1 -0
- package/dist/uri-handlers/internal-handlers/remoteApiUriHandler.js +121 -0
- package/dist/uri-handlers/internal-handlers/remoteApiUriHandler.js.map +1 -0
- package/dist/{extensions → uri-handlers}/uriHandlersRegister.d.ts +6 -4
- package/dist/uri-handlers/uriHandlersRegister.d.ts.map +1 -0
- package/dist/{extensions → uri-handlers}/uriHandlersRegister.js +13 -3
- package/dist/uri-handlers/uriHandlersRegister.js.map +1 -0
- package/dist/uri-handlers/uriRequestProcessor.d.ts +37 -0
- package/dist/uri-handlers/uriRequestProcessor.d.ts.map +1 -0
- package/dist/uri-handlers/uriRequestProcessor.js +69 -0
- package/dist/uri-handlers/uriRequestProcessor.js.map +1 -0
- package/docs/html/assets/hierarchy.js +1 -0
- package/docs/html/assets/highlight.css +9 -2
- package/docs/html/assets/icons.js +18 -0
- package/docs/html/assets/icons.svg +1 -0
- package/docs/html/assets/main.js +5 -4
- package/docs/html/assets/navigation.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/assets/style.css +1422 -1226
- package/docs/html/classes/CameraKit.html +18 -16
- package/docs/html/classes/CameraKitSession.html +79 -51
- package/docs/html/classes/CameraKitSource.html +18 -18
- package/docs/html/classes/LensPerformanceMeasurement.html +11 -11
- package/docs/html/classes/LensPerformanceMetrics.html +8 -7
- package/docs/html/classes/LensRepository.html +25 -23
- package/docs/html/classes/Transform2D.html +9 -9
- package/docs/html/classes/TypedCustomEvent.html +5 -4
- package/docs/html/classes/TypedEventTarget.html +6 -6
- package/docs/html/enums/Lens_CameraFacing.html +5 -5
- package/docs/html/functions/bootstrapCameraKit.html +11 -10
- package/docs/html/functions/createExtension.html +7 -6
- package/docs/html/functions/createImageSource.html +5 -5
- package/docs/html/functions/createMediaStreamSource.html +5 -5
- package/docs/html/functions/createVideoSource.html +5 -5
- package/docs/html/functions/estimateLensPerformance.html +2 -2
- package/docs/html/functions/filePickerFactory.html +2 -2
- package/docs/html/functions/getExtensionRequestContext.html +3 -0
- package/docs/html/functions/lensSourcesFactory.html +5 -4
- package/docs/html/functions/remoteApiServicesFactory.html +1 -1
- package/docs/html/hierarchy.html +1 -1
- package/docs/html/index.html +111 -88
- package/docs/html/interfaces/BitmojiUserInfo.html +3 -3
- package/docs/html/interfaces/CameraKitBootstrapConfiguration.html +40 -21
- package/docs/html/interfaces/CameraKitDeviceOptions.html +7 -7
- package/docs/html/interfaces/CameraKitSourceInfo.html +7 -7
- package/docs/html/interfaces/CameraKitSourceSubscriber.html +4 -4
- package/docs/html/interfaces/ComputedFrameMetrics.html +6 -6
- package/docs/html/interfaces/CreateSessionOptions.html +7 -7
- package/docs/html/interfaces/EstimatedLensPerformance.html +5 -5
- package/docs/html/interfaces/Font.html +6 -0
- package/docs/html/interfaces/FriendUserInfo.html +4 -4
- package/docs/html/interfaces/FunctionSourceOptions.html +4 -4
- package/docs/html/interfaces/Keyboard.html +29 -0
- package/docs/html/interfaces/KeyboardActiveEvent.html +12 -0
- package/docs/html/interfaces/Lens.html +21 -21
- package/docs/html/interfaces/LensCreator.html +3 -3
- package/docs/html/interfaces/LensHttpRequest.html +16 -0
- package/docs/html/interfaces/LensLaunchData.html +6 -6
- package/docs/html/interfaces/LensSource.html +5 -5
- package/docs/html/interfaces/LensUserData.html +10 -10
- package/docs/html/interfaces/LoadAssetRequest.html +10 -10
- package/docs/html/interfaces/MediaStreamSourceOptions.html +11 -11
- package/docs/html/interfaces/Preview.html +4 -4
- package/docs/html/interfaces/RemoteApiRequest.html +10 -10
- package/docs/html/interfaces/RemoteApiResponse.html +8 -8
- package/docs/html/interfaces/RemoteApiService.html +9 -9
- package/docs/html/interfaces/Snapcode.html +6 -6
- package/docs/html/interfaces/UriCancelRequest.html +3 -3
- package/docs/html/interfaces/UriRequest.html +7 -7
- package/docs/html/interfaces/UriResponse.html +6 -6
- package/docs/html/interfaces/VideoSourceOptions.html +9 -9
- package/docs/html/modules.html +1 -99
- package/docs/html/types/ArgumentValidationError.html +2 -2
- package/docs/html/types/AssetLoader.html +4 -4
- package/docs/html/types/AssetResponse.html +1 -1
- package/docs/html/types/AssetTiming.html +2 -2
- package/docs/html/types/BenchmarkError.html +1 -1
- package/docs/html/types/BootstrapError.html +2 -2
- package/docs/html/types/CacheKeyNotFoundError.html +1 -1
- package/docs/html/types/CameraKitSessionEventListener.html +2 -2
- package/docs/html/types/CameraKitSessionEvents.html +4 -3
- package/docs/html/types/CameraKitSourceError.html +1 -1
- package/docs/html/types/ConfigurationError.html +2 -2
- package/docs/html/types/FetchHandler.html +1 -1
- package/docs/html/types/FilePicker.html +5 -5
- package/docs/html/types/FilePickerOptions.html +2 -2
- package/docs/html/types/FilePickerResult.html +2 -2
- package/docs/html/types/KeyboardEventListener.html +2 -0
- package/docs/html/types/KeyboardEvents.html +2 -2
- package/docs/html/types/LegalError.html +1 -1
- package/docs/html/types/LensAbortError.html +6 -5
- package/docs/html/types/LensAssetError.html +2 -2
- package/docs/html/types/LensContentValidationError.html +1 -1
- package/docs/html/types/LensError.html +1 -1
- package/docs/html/types/LensExecutionError.html +6 -5
- package/docs/html/types/LensHttpHandler.html +9 -0
- package/docs/html/types/LensImagePickerError.html +2 -2
- package/docs/html/types/LensLaunchParams.html +2 -2
- package/docs/html/types/LensMetricsEvents.html +2 -2
- package/docs/html/types/LensPerformanceCluster.html +1 -1
- package/docs/html/types/LensView.html +3 -3
- package/docs/html/types/LensWait.html +2 -2
- package/docs/html/types/Matrix.html +2 -2
- package/docs/html/types/PersistentStoreError.html +2 -2
- package/docs/html/types/PlatformNotSupportedError.html +3 -3
- package/docs/html/types/PublicContainer.html +2 -2
- package/docs/html/types/PublicServices.html +2 -2
- package/docs/html/types/RemoteApiCancelRequestHandler.html +2 -2
- package/docs/html/types/RemoteApiRequestHandler.html +2 -2
- package/docs/html/types/RemoteApiServices.html +1 -1
- package/docs/html/types/RemoteApiStatus.html +2 -2
- package/docs/html/types/RenderTarget.html +3 -3
- package/docs/html/types/Uri.html +1 -1
- package/docs/html/types/WebGLError.html +1 -1
- package/docs/html/types/Zodiac.html +1 -1
- package/docs/html/variables/extensionRequestContext.html +3 -2
- package/docs/md/README.md +5 -3
- package/docs/md/classes/CameraKit.md +26 -37
- package/docs/md/classes/CameraKitSession.md +150 -108
- package/docs/md/classes/CameraKitSource.md +46 -37
- package/docs/md/classes/LensPerformanceMeasurement.md +18 -26
- package/docs/md/classes/LensPerformanceMetrics.md +8 -10
- package/docs/md/classes/LensRepository.md +66 -45
- package/docs/md/classes/Transform2D.md +19 -26
- package/docs/md/classes/TypedCustomEvent.md +24 -32
- package/docs/md/classes/TypedEventTarget.md +43 -54
- package/docs/md/enumerations/Lens_CameraFacing.md +31 -0
- package/docs/md/functions/bootstrapCameraKit.md +66 -0
- package/docs/md/functions/createExtension.md +50 -0
- package/docs/md/functions/createImageSource.md +30 -0
- package/docs/md/functions/createMediaStreamSource.md +30 -0
- package/docs/md/functions/createVideoSource.md +31 -0
- package/docs/md/functions/estimateLensPerformance.md +18 -0
- package/docs/md/functions/filePickerFactory.md +22 -0
- package/docs/md/functions/getExtensionRequestContext.md +21 -0
- package/docs/md/functions/lensSourcesFactory.md +37 -0
- package/docs/md/functions/remoteApiServicesFactory.md +19 -0
- package/docs/md/globals.md +124 -0
- package/docs/md/interfaces/BitmojiUserInfo.md +9 -12
- package/docs/md/interfaces/CameraKitBootstrapConfiguration.md +99 -40
- package/docs/md/interfaces/CameraKitDeviceOptions.md +11 -17
- package/docs/md/interfaces/CameraKitSourceInfo.md +14 -20
- package/docs/md/interfaces/CameraKitSourceSubscriber.md +23 -28
- package/docs/md/interfaces/ComputedFrameMetrics.md +13 -19
- package/docs/md/interfaces/CreateSessionOptions.md +10 -13
- package/docs/md/interfaces/EstimatedLensPerformance.md +10 -14
- package/docs/md/interfaces/Font.md +25 -0
- package/docs/md/interfaces/FriendUserInfo.md +12 -16
- package/docs/md/interfaces/FunctionSourceOptions.md +6 -8
- package/docs/md/interfaces/Keyboard.md +137 -0
- package/docs/md/interfaces/KeyboardActiveEvent.md +46 -0
- package/docs/md/interfaces/Lens.md +26 -37
- package/docs/md/interfaces/LensCreator.md +6 -8
- package/docs/md/interfaces/LensHttpRequest.md +60 -0
- package/docs/md/interfaces/LensLaunchData.md +13 -17
- package/docs/md/interfaces/LensSource.md +26 -27
- package/docs/md/interfaces/LensUserData.md +30 -40
- package/docs/md/interfaces/LoadAssetRequest.md +13 -18
- package/docs/md/interfaces/MediaStreamSourceOptions.md +15 -22
- package/docs/md/interfaces/Preview.md +6 -8
- package/docs/md/interfaces/RemoteApiRequest.md +12 -17
- package/docs/md/interfaces/RemoteApiResponse.md +10 -14
- package/docs/md/interfaces/RemoteApiService.md +20 -19
- package/docs/md/interfaces/Snapcode.md +8 -11
- package/docs/md/interfaces/UriCancelRequest.md +7 -10
- package/docs/md/interfaces/UriRequest.md +15 -22
- package/docs/md/interfaces/UriResponse.md +14 -20
- package/docs/md/interfaces/VideoSourceOptions.md +13 -19
- package/docs/md/type-aliases/ArgumentValidationError.md +11 -0
- package/docs/md/type-aliases/AssetLoader.md +26 -0
- package/docs/md/type-aliases/AssetResponse.md +9 -0
- package/docs/md/type-aliases/AssetTiming.md +18 -0
- package/docs/md/type-aliases/BenchmarkError.md +9 -0
- package/docs/md/type-aliases/BootstrapError.md +12 -0
- package/docs/md/type-aliases/CacheKeyNotFoundError.md +9 -0
- package/docs/md/type-aliases/CameraKitSessionEventListener.md +11 -0
- package/docs/md/type-aliases/CameraKitSessionEvents.md +17 -0
- package/docs/md/type-aliases/CameraKitSourceError.md +9 -0
- package/docs/md/type-aliases/ConfigurationError.md +11 -0
- package/docs/md/type-aliases/FetchHandler.md +27 -0
- package/docs/md/type-aliases/FilePicker.md +32 -0
- package/docs/md/type-aliases/FilePickerOptions.md +11 -0
- package/docs/md/type-aliases/FilePickerResult.md +11 -0
- package/docs/md/type-aliases/KeyboardEventListener.md +11 -0
- package/docs/md/type-aliases/KeyboardEvents.md +11 -0
- package/docs/md/type-aliases/LegalError.md +9 -0
- package/docs/md/type-aliases/LensAbortError.md +22 -0
- package/docs/md/type-aliases/LensAssetError.md +11 -0
- package/docs/md/type-aliases/LensContentValidationError.md +9 -0
- package/docs/md/type-aliases/LensError.md +9 -0
- package/docs/md/type-aliases/LensExecutionError.md +23 -0
- package/docs/md/type-aliases/LensHttpHandler.md +41 -0
- package/docs/md/type-aliases/LensImagePickerError.md +12 -0
- package/docs/md/type-aliases/LensLaunchParams.md +11 -0
- package/docs/md/type-aliases/LensMetricsEvents.md +13 -0
- package/docs/md/type-aliases/LensPerformanceCluster.md +9 -0
- package/docs/md/type-aliases/LensView.md +21 -0
- package/docs/md/type-aliases/LensWait.md +13 -0
- package/docs/md/type-aliases/Matrix.md +12 -0
- package/docs/md/type-aliases/PersistentStoreError.md +11 -0
- package/docs/md/type-aliases/PlatformNotSupportedError.md +13 -0
- package/docs/md/type-aliases/PublicContainer.md +12 -0
- package/docs/md/type-aliases/PublicServices.md +11 -0
- package/docs/md/type-aliases/RemoteApiCancelRequestHandler.md +15 -0
- package/docs/md/type-aliases/RemoteApiRequestHandler.md +24 -0
- package/docs/md/type-aliases/RemoteApiServices.md +9 -0
- package/docs/md/type-aliases/RemoteApiStatus.md +11 -0
- package/docs/md/type-aliases/RenderTarget.md +14 -0
- package/docs/md/type-aliases/Uri.md +9 -0
- package/docs/md/type-aliases/WebGLError.md +9 -0
- package/docs/md/type-aliases/Zodiac.md +9 -0
- package/docs/md/variables/extensionRequestContext.md +15 -0
- package/package.json +5 -5
- package/dist/extensions/RemoteApiServices.d.ts.map +0 -1
- package/dist/extensions/RemoteApiServices.js +0 -159
- package/dist/extensions/RemoteApiServices.js.map +0 -1
- package/dist/extensions/UriHandlers.d.ts.map +0 -1
- package/dist/extensions/UriHandlers.js.map +0 -1
- package/dist/extensions/uriHandlersRegister.d.ts.map +0 -1
- package/dist/extensions/uriHandlersRegister.js.map +0 -1
- package/docs/html/types/Keyboard.html +0 -26
- package/docs/md/.nojekyll +0 -1
- package/docs/md/enums/Lens_CameraFacing.md +0 -36
- package/docs/md/modules.md +0 -904
- /package/dist/{extensions → uri-handlers}/UriHandlers.d.ts +0 -0
- /package/dist/{extensions → uri-handlers}/UriHandlers.js +0 -0
|
@@ -1,36 +1,28 @@
|
|
|
1
|
-
[CameraKit Web SDK
|
|
1
|
+
[**CameraKit Web SDK v1.2.0**](../README.md)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Configuration which must be provided when calling [bootstrapCameraKit](../modules.md#bootstrapcamerakit). These values are used to create various
|
|
6
|
-
CameraKit components.
|
|
3
|
+
***
|
|
7
4
|
|
|
8
|
-
|
|
5
|
+
[CameraKit Web SDK](../globals.md) / CameraKitBootstrapConfiguration
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
# Interface: CameraKitBootstrapConfiguration
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- [logLevel](CameraKitBootstrapConfiguration.md#loglevel)
|
|
15
|
-
- [lensPerformance](CameraKitBootstrapConfiguration.md#lensperformance)
|
|
16
|
-
- [lensCoreOverrideUrls](CameraKitBootstrapConfiguration.md#lenscoreoverrideurls)
|
|
17
|
-
- [wasmEndpointOverride](CameraKitBootstrapConfiguration.md#wasmendpointoverride)
|
|
18
|
-
- [analyticsId](CameraKitBootstrapConfiguration.md#analyticsid)
|
|
9
|
+
Configuration which must be provided when calling [bootstrapCameraKit](../functions/bootstrapCameraKit.md). These values are used to create various
|
|
10
|
+
CameraKit components.
|
|
19
11
|
|
|
20
12
|
## Properties
|
|
21
13
|
|
|
22
14
|
### apiToken
|
|
23
15
|
|
|
24
|
-
|
|
16
|
+
> **apiToken**: `string`
|
|
25
17
|
|
|
26
18
|
Long-lived token granting your application access to CameraKit APIs. This is found in the SnapKit Dev Portal,
|
|
27
19
|
where it's called the API Token.
|
|
28
20
|
|
|
29
|
-
|
|
21
|
+
***
|
|
30
22
|
|
|
31
|
-
### logger
|
|
23
|
+
### logger?
|
|
32
24
|
|
|
33
|
-
|
|
25
|
+
> `optional` **logger**: `"noop"` \| `"console"`
|
|
34
26
|
|
|
35
27
|
Determine where to print CameraKit log messages. By default no logs will be printed.
|
|
36
28
|
|
|
@@ -40,31 +32,31 @@ options:
|
|
|
40
32
|
- `noop`: log messages are ignored.
|
|
41
33
|
- `console`: log messages are printed to console.
|
|
42
34
|
|
|
43
|
-
|
|
35
|
+
***
|
|
44
36
|
|
|
45
|
-
### logLevel
|
|
37
|
+
### logLevel?
|
|
46
38
|
|
|
47
|
-
|
|
39
|
+
> `optional` **logLevel**: `"error"` \| `"warn"` \| `"log"` \| `"info"` \| `"debug"`
|
|
48
40
|
|
|
49
41
|
Log only if a logged entry level is greater than or equal to this level. Here is the order of levels:
|
|
50
42
|
error > warn > log = info > debug. Default value is "info".
|
|
51
43
|
|
|
52
|
-
|
|
44
|
+
***
|
|
53
45
|
|
|
54
|
-
### lensPerformance
|
|
46
|
+
### lensPerformance?
|
|
55
47
|
|
|
56
|
-
|
|
48
|
+
> `optional` **lensPerformance**: [`EstimatedLensPerformance`](EstimatedLensPerformance.md) \| `Promise`\<[`EstimatedLensPerformance`](EstimatedLensPerformance.md)\>
|
|
57
49
|
|
|
58
50
|
Some lenses may decide to modify their behavior based on the performance of the current environment. If you are
|
|
59
51
|
using such lenses, providing an estimation of lens performance may lead to better user experience (especially on
|
|
60
52
|
low-performance devices).
|
|
61
53
|
|
|
62
|
-
Running the [estimateLensPerformance](../
|
|
54
|
+
Running the [estimateLensPerformance](../functions/estimateLensPerformance.md) function will run benchmarks and estimate an appropriate lens
|
|
63
55
|
performance cluster (i.e. a performance rating) based on the current environment.
|
|
64
56
|
|
|
65
57
|
Lower cluster = worse expected performance capability.
|
|
66
58
|
|
|
67
|
-
|
|
59
|
+
#### Example
|
|
68
60
|
|
|
69
61
|
```ts
|
|
70
62
|
import { bootstrapCameraKit, estimateLensPerformance } from '@snap/camera-kit`
|
|
@@ -75,11 +67,11 @@ const cameraKit = await bootstrapCameraKit({
|
|
|
75
67
|
})
|
|
76
68
|
```
|
|
77
69
|
|
|
78
|
-
|
|
70
|
+
***
|
|
79
71
|
|
|
80
|
-
### lensCoreOverrideUrls
|
|
72
|
+
### lensCoreOverrideUrls?
|
|
81
73
|
|
|
82
|
-
|
|
74
|
+
> `optional` **lensCoreOverrideUrls**: `object`
|
|
83
75
|
|
|
84
76
|
In recommended production deployments, the WebAssembly assets required by CameraKit will be downloaded from an
|
|
85
77
|
optimized CDN. But sometimes (e.g. during development or within a CI pipeline), it may be necessary to download
|
|
@@ -88,30 +80,97 @@ these assets from somewhere else.
|
|
|
88
80
|
This configuration option allows the application to specify URLs to be used for both the WebAssembly and JS glue
|
|
89
81
|
file that are used to run and interact with CameraKit's rendering engine.
|
|
90
82
|
|
|
91
|
-
####
|
|
83
|
+
#### wasm
|
|
84
|
+
|
|
85
|
+
> **wasm**: `string`
|
|
92
86
|
|
|
93
|
-
|
|
94
|
-
| :------ | :------ |
|
|
95
|
-
| `wasm` | `string` |
|
|
96
|
-
| `js` | `string` |
|
|
87
|
+
#### js
|
|
97
88
|
|
|
98
|
-
|
|
89
|
+
> **js**: `string`
|
|
99
90
|
|
|
100
|
-
|
|
91
|
+
***
|
|
101
92
|
|
|
102
|
-
|
|
93
|
+
### wasmEndpointOverride?
|
|
94
|
+
|
|
95
|
+
> `optional` **wasmEndpointOverride**: `string`
|
|
103
96
|
|
|
104
97
|
In recommended production deployments, the WebAssembly assets required by CameraKit will be downloaded from an
|
|
105
98
|
optimized CDN. But sometimes during development or within a CI pipeline, it may be necessary to download these
|
|
106
99
|
assets from somewhere else. With a provided `wasmEndpointOverride`, asset URLs will be automatically generated
|
|
107
100
|
based on this root endpoint.
|
|
108
101
|
|
|
109
|
-
|
|
102
|
+
***
|
|
110
103
|
|
|
111
|
-
### analyticsId
|
|
104
|
+
### analyticsId?
|
|
112
105
|
|
|
113
|
-
|
|
106
|
+
> `optional` **analyticsId**: `string`
|
|
114
107
|
|
|
115
108
|
Applications may optionally provide a unique identifier called analyticsId. This ID would enable Camera Kit to
|
|
116
109
|
improve data reporting and accuracy and to better support potential needs related to an application's lens and
|
|
117
110
|
user analytics.
|
|
111
|
+
|
|
112
|
+
***
|
|
113
|
+
|
|
114
|
+
### fonts?
|
|
115
|
+
|
|
116
|
+
> `optional` **fonts**: [`Font`](Font.md)[]
|
|
117
|
+
|
|
118
|
+
An array of fonts to be used by Camera Kit for text rendering.
|
|
119
|
+
|
|
120
|
+
Lenses usually have their own font assets, but emojis are often not embedded.
|
|
121
|
+
As a result, you may need to provide additional fonts (e.g., an emoji font) to ensure all glyphs render
|
|
122
|
+
correctly.
|
|
123
|
+
|
|
124
|
+
#### Example
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
fonts: [
|
|
128
|
+
{
|
|
129
|
+
name: 'EmojiFont',
|
|
130
|
+
data: emojiFontArrayBuffer, // Your emoji font data goes here
|
|
131
|
+
},
|
|
132
|
+
]
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
***
|
|
136
|
+
|
|
137
|
+
### lensHttpHandler?
|
|
138
|
+
|
|
139
|
+
> `optional` **lensHttpHandler**: [`LensHttpHandler`](../type-aliases/LensHttpHandler.md)
|
|
140
|
+
|
|
141
|
+
An optional custom HTTP handler for requests made by a Lens.
|
|
142
|
+
|
|
143
|
+
This handler allows you to intercept and customize the behavior of HTTP requests,
|
|
144
|
+
such as adding authentication headers, logging request details, or replacing the default
|
|
145
|
+
HTTP library used by the Lens system.
|
|
146
|
+
|
|
147
|
+
If not specified, the Lens system will use a default HTTP implementation.
|
|
148
|
+
|
|
149
|
+
#### Example
|
|
150
|
+
|
|
151
|
+
Here is an example of how to configure a custom `LensHttpHandler` to add an authentication token:
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
const customLensHttpHandler: LensHttpHandler = async (url, init, lensRequest) => {
|
|
155
|
+
// Add an authentication token to the headers
|
|
156
|
+
const sessionToken = await getAuthToken();
|
|
157
|
+
const updatedInit = {
|
|
158
|
+
...init,
|
|
159
|
+
headers: {
|
|
160
|
+
...init.headers,
|
|
161
|
+
'Authorization': `Bearer ${sessionToken}`,
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// Log the request details for debugging
|
|
166
|
+
console.log(`Requesting ${lensRequest.url} from lens: ${lensRequest.lens.name}`);
|
|
167
|
+
|
|
168
|
+
// Use fetch to perform the HTTP request
|
|
169
|
+
return fetch(url, updatedInit);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const cameraKit = bootstrapCameraKit({
|
|
173
|
+
apiToken,
|
|
174
|
+
lensHttpHandler: customLensHttpHandler,
|
|
175
|
+
});
|
|
176
|
+
```
|
|
@@ -1,40 +1,34 @@
|
|
|
1
|
-
[CameraKit Web SDK
|
|
1
|
+
[**CameraKit Web SDK v1.2.0**](../README.md)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Device options.
|
|
6
|
-
|
|
7
|
-
## Hierarchy
|
|
3
|
+
***
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
[CameraKit Web SDK](../globals.md) / CameraKitDeviceOptions
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
↳ [`VideoSourceOptions`](VideoSourceOptions.md)
|
|
7
|
+
# Interface: CameraKitDeviceOptions
|
|
14
8
|
|
|
15
|
-
|
|
9
|
+
Device options.
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
## Extended by
|
|
18
12
|
|
|
19
|
-
- [
|
|
20
|
-
- [
|
|
13
|
+
- [`MediaStreamSourceOptions`](MediaStreamSourceOptions.md)
|
|
14
|
+
- [`VideoSourceOptions`](VideoSourceOptions.md)
|
|
21
15
|
|
|
22
16
|
## Properties
|
|
23
17
|
|
|
24
18
|
### cameraType
|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
> **cameraType**: `"user"` \| `"environment"`
|
|
27
21
|
|
|
28
22
|
Specifies the camera type for which certain features are enabled or disabled.
|
|
29
23
|
For example, surface tracking features are only active when the camera is set to "environment" mode.
|
|
30
24
|
The default value is "user", which accommodates the majority of Lenses.
|
|
31
25
|
"user" refers to the front-facing camera, while "environment" refers to the rear-facing camera.
|
|
32
26
|
|
|
33
|
-
|
|
27
|
+
***
|
|
34
28
|
|
|
35
29
|
### fpsLimit
|
|
36
30
|
|
|
37
|
-
|
|
31
|
+
> **fpsLimit**: `number`
|
|
38
32
|
|
|
39
33
|
Limits the frames per second (FPS) to optimize performance by reducing compute resources
|
|
40
34
|
when high FPS is not critical. By default, no limit is set, allowing usage of the video's native FPS.
|
|
@@ -1,43 +1,37 @@
|
|
|
1
|
-
[CameraKit Web SDK
|
|
1
|
+
[**CameraKit Web SDK v1.2.0**](../README.md)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
3
|
+
***
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
[CameraKit Web SDK](../globals.md) / CameraKitSourceInfo
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
- [useManualFrameProcessing](CameraKitSourceInfo.md#usemanualframeprocessing)
|
|
11
|
-
- [replayTrackingData](CameraKitSourceInfo.md#replaytrackingdata)
|
|
7
|
+
# Interface: CameraKitSourceInfo
|
|
12
8
|
|
|
13
9
|
## Properties
|
|
14
10
|
|
|
15
|
-
### media
|
|
11
|
+
### media?
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
> `optional` **media**: `HTMLImageElement` \| `HTMLCanvasElement` \| `HTMLVideoElement` \| `MediaStream`
|
|
18
14
|
|
|
19
15
|
HTML element or MediaStream as an input source.
|
|
20
16
|
If useManualFrameProcessing is true, then this parameter is optional.
|
|
21
17
|
|
|
22
|
-
|
|
18
|
+
***
|
|
23
19
|
|
|
24
|
-
### useManualFrameProcessing
|
|
20
|
+
### useManualFrameProcessing?
|
|
25
21
|
|
|
26
|
-
|
|
22
|
+
> `optional` **useManualFrameProcessing**: `boolean`
|
|
27
23
|
|
|
28
24
|
Whether to provide frames manually.
|
|
29
25
|
|
|
30
|
-
|
|
26
|
+
***
|
|
31
27
|
|
|
32
|
-
### replayTrackingData
|
|
28
|
+
### replayTrackingData?
|
|
33
29
|
|
|
34
|
-
|
|
30
|
+
> `optional` **replayTrackingData**: `object`
|
|
35
31
|
|
|
36
32
|
If specified, the passed-in tracking data buffer will be used as tracking data for the current
|
|
37
33
|
media element instead of live tracking data.
|
|
38
34
|
|
|
39
|
-
####
|
|
35
|
+
#### buffer
|
|
40
36
|
|
|
41
|
-
|
|
42
|
-
| :------ | :------ |
|
|
43
|
-
| `buffer` | `ArrayBuffer` \| `Uint8Array` |
|
|
37
|
+
> **buffer**: `ArrayBuffer` \| `Uint8Array`
|
|
@@ -1,55 +1,50 @@
|
|
|
1
|
-
[CameraKit Web SDK
|
|
1
|
+
[**CameraKit Web SDK v1.2.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[CameraKit Web SDK](../globals.md) / CameraKitSourceSubscriber
|
|
2
6
|
|
|
3
7
|
# Interface: CameraKitSourceSubscriber
|
|
4
8
|
|
|
5
9
|
When creating a [CameraKitSource](../classes/CameraKitSource.md), passing a CameraKitSourceSubscriber allows logic to implemented which will
|
|
6
10
|
run whenever that source is attached/detached from a CameraKitSession.
|
|
7
11
|
|
|
8
|
-
##
|
|
12
|
+
## Properties
|
|
9
13
|
|
|
10
|
-
###
|
|
14
|
+
### onAttach()?
|
|
11
15
|
|
|
12
|
-
|
|
13
|
-
- [onDetach](CameraKitSourceSubscriber.md#ondetach)
|
|
16
|
+
> `readonly` `optional` **onAttach**: (`source`, `lensCore`, `reportError`) => `void` \| `Promise`\<`void`\>
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
#### Parameters
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
##### source
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
[`CameraKitSource`](../classes/CameraKitSource.md)
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
##### lensCore
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
`LensCore`
|
|
24
27
|
|
|
25
|
-
#####
|
|
28
|
+
##### reportError
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
| :------ | :------ |
|
|
29
|
-
| `source` | [`CameraKitSource`](../classes/CameraKitSource.md) |
|
|
30
|
-
| `lensCore` | `LensCore` |
|
|
31
|
-
| `reportError` | (`error`: `Error`) => `void` |
|
|
30
|
+
(`error`) => `void`
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
#### Returns
|
|
34
33
|
|
|
35
34
|
`void` \| `Promise`\<`void`\>
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
### onDetach
|
|
36
|
+
***
|
|
40
37
|
|
|
41
|
-
|
|
38
|
+
### onDetach()?
|
|
42
39
|
|
|
43
|
-
|
|
40
|
+
> `readonly` `optional` **onDetach**: (`reportError`) => `void` \| `Promise`\<`void`\>
|
|
44
41
|
|
|
45
|
-
|
|
42
|
+
#### Parameters
|
|
46
43
|
|
|
47
|
-
#####
|
|
44
|
+
##### reportError
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
| :------ | :------ |
|
|
51
|
-
| `reportError` | (`error`: `Error`) => `void` |
|
|
46
|
+
(`error`) => `void`
|
|
52
47
|
|
|
53
|
-
|
|
48
|
+
#### Returns
|
|
54
49
|
|
|
55
50
|
`void` \| `Promise`\<`void`\>
|
|
@@ -1,43 +1,37 @@
|
|
|
1
|
-
[CameraKit Web SDK
|
|
1
|
+
[**CameraKit Web SDK v1.2.0**](../README.md)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
3
|
+
***
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
[CameraKit Web SDK](../globals.md) / ComputedFrameMetrics
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
- [lensFrameProcessingTimeMsAvg](ComputedFrameMetrics.md#lensframeprocessingtimemsavg)
|
|
11
|
-
- [lensFrameProcessingTimeMsStd](ComputedFrameMetrics.md#lensframeprocessingtimemsstd)
|
|
12
|
-
- [lensFrameProcessingTimeMsMedian](ComputedFrameMetrics.md#lensframeprocessingtimemsmedian)
|
|
13
|
-
- [lensFrameProcessingN](ComputedFrameMetrics.md#lensframeprocessingn)
|
|
7
|
+
# Interface: ComputedFrameMetrics
|
|
14
8
|
|
|
15
9
|
## Properties
|
|
16
10
|
|
|
17
11
|
### avgFps
|
|
18
12
|
|
|
19
|
-
|
|
13
|
+
> **avgFps**: `number`
|
|
20
14
|
|
|
21
|
-
|
|
15
|
+
***
|
|
22
16
|
|
|
23
17
|
### lensFrameProcessingTimeMsAvg
|
|
24
18
|
|
|
25
|
-
|
|
19
|
+
> **lensFrameProcessingTimeMsAvg**: `number`
|
|
26
20
|
|
|
27
|
-
|
|
21
|
+
***
|
|
28
22
|
|
|
29
23
|
### lensFrameProcessingTimeMsStd
|
|
30
24
|
|
|
31
|
-
|
|
25
|
+
> **lensFrameProcessingTimeMsStd**: `number`
|
|
32
26
|
|
|
33
|
-
|
|
27
|
+
***
|
|
34
28
|
|
|
35
29
|
### lensFrameProcessingTimeMsMedian
|
|
36
30
|
|
|
37
|
-
|
|
31
|
+
> **lensFrameProcessingTimeMsMedian**: `number`
|
|
38
32
|
|
|
39
|
-
|
|
33
|
+
***
|
|
40
34
|
|
|
41
35
|
### lensFrameProcessingN
|
|
42
36
|
|
|
43
|
-
|
|
37
|
+
> **lensFrameProcessingN**: `number`
|
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
[CameraKit Web SDK
|
|
1
|
+
[**CameraKit Web SDK v1.2.0**](../README.md)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Options available when creating a [CameraKitSession](../classes/CameraKitSession.md).
|
|
3
|
+
***
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
[CameraKit Web SDK](../globals.md) / CreateSessionOptions
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
# Interface: CreateSessionOptions
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
- [renderWhileTabHidden](CreateSessionOptions.md#renderwhiletabhidden)
|
|
9
|
+
Options available when creating a [CameraKitSession](../classes/CameraKitSession.md).
|
|
13
10
|
|
|
14
11
|
## Properties
|
|
15
12
|
|
|
16
|
-
### liveRenderTarget
|
|
13
|
+
### liveRenderTarget?
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
> `optional` **liveRenderTarget**: `HTMLCanvasElement`
|
|
19
16
|
|
|
20
17
|
Optionally provide an existing canvas element, on which the Live RenderTarget will be rendered.
|
|
21
18
|
|
|
22
19
|
If this is not provided, CameraKit will create a new canvas element which can be added to the DOM.
|
|
23
20
|
|
|
24
|
-
|
|
21
|
+
***
|
|
25
22
|
|
|
26
|
-
### renderWhileTabHidden
|
|
23
|
+
### renderWhileTabHidden?
|
|
27
24
|
|
|
28
|
-
|
|
25
|
+
> `optional` **renderWhileTabHidden**: `boolean`
|
|
29
26
|
|
|
30
27
|
Browsers optimize tabs when they are hidden - for example, by pausing the execution of requestAnimationFrame
|
|
31
28
|
callbacks.
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
[CameraKit Web SDK
|
|
1
|
+
[**CameraKit Web SDK v1.2.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[CameraKit Web SDK](../globals.md) / EstimatedLensPerformance
|
|
2
6
|
|
|
3
7
|
# Interface: EstimatedLensPerformance
|
|
4
8
|
|
|
@@ -11,28 +15,20 @@ performing cluster and 1 the lowest.
|
|
|
11
15
|
|
|
12
16
|
All the raw benchmark results used to estimate the performance cluster are also included for reporting purposes.
|
|
13
17
|
|
|
14
|
-
## Table of contents
|
|
15
|
-
|
|
16
|
-
### Properties
|
|
17
|
-
|
|
18
|
-
- [cluster](EstimatedLensPerformance.md#cluster)
|
|
19
|
-
- [benchmarks](EstimatedLensPerformance.md#benchmarks)
|
|
20
|
-
- [webglRendererInfo](EstimatedLensPerformance.md#webglrendererinfo)
|
|
21
|
-
|
|
22
18
|
## Properties
|
|
23
19
|
|
|
24
20
|
### cluster
|
|
25
21
|
|
|
26
|
-
|
|
22
|
+
> **cluster**: [`LensPerformanceCluster`](../type-aliases/LensPerformanceCluster.md)
|
|
27
23
|
|
|
28
|
-
|
|
24
|
+
***
|
|
29
25
|
|
|
30
26
|
### benchmarks
|
|
31
27
|
|
|
32
|
-
|
|
28
|
+
> **benchmarks**: `BenchmarkResult`[]
|
|
33
29
|
|
|
34
|
-
|
|
30
|
+
***
|
|
35
31
|
|
|
36
32
|
### webglRendererInfo
|
|
37
33
|
|
|
38
|
-
|
|
34
|
+
> **webglRendererInfo**: `string`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**CameraKit Web SDK v1.2.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[CameraKit Web SDK](../globals.md) / Font
|
|
6
|
+
|
|
7
|
+
# Interface: Font
|
|
8
|
+
|
|
9
|
+
Represents a font to be used by Camera Kit for text rendering.
|
|
10
|
+
|
|
11
|
+
## Properties
|
|
12
|
+
|
|
13
|
+
### name
|
|
14
|
+
|
|
15
|
+
> **name**: `string`
|
|
16
|
+
|
|
17
|
+
A unique name for the font.
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### data
|
|
22
|
+
|
|
23
|
+
> **data**: `ArrayBuffer`
|
|
24
|
+
|
|
25
|
+
A buffer containing the font data (e.g., the contents of a `.ttf` file).
|
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
[CameraKit Web SDK
|
|
1
|
+
[**CameraKit Web SDK v1.2.0**](../README.md)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
3
|
+
***
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
[CameraKit Web SDK](../globals.md) / FriendUserInfo
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
- [lastInteraction](FriendUserInfo.md#lastinteraction)
|
|
11
|
-
- [streak](FriendUserInfo.md#streak)
|
|
7
|
+
# Interface: FriendUserInfo
|
|
12
8
|
|
|
13
9
|
## Properties
|
|
14
10
|
|
|
15
|
-
### friendshipStart
|
|
11
|
+
### friendshipStart?
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
> `optional` **friendshipStart**: `Date`
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
***
|
|
20
16
|
|
|
21
|
-
### lastInteraction
|
|
17
|
+
### lastInteraction?
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
> `optional` **lastInteraction**: `Date`
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
***
|
|
26
22
|
|
|
27
|
-
### streak
|
|
23
|
+
### streak?
|
|
28
24
|
|
|
29
|
-
|
|
25
|
+
> `optional` **streak**: `number`
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
[CameraKit Web SDK
|
|
1
|
+
[**CameraKit Web SDK v1.2.0**](../README.md)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Function source options.
|
|
3
|
+
***
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
[CameraKit Web SDK](../globals.md) / FunctionSourceOptions
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
# Interface: FunctionSourceOptions
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
Function source options.
|
|
12
10
|
|
|
13
11
|
## Properties
|
|
14
12
|
|
|
15
13
|
### cameraType
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
> **cameraType**: `"user"` \| `"environment"`
|
|
18
16
|
|
|
19
17
|
Specifies the camera type for which certain features are enabled or disabled.
|
|
20
18
|
For example, surface tracking features are only active when the camera is set to "environment" mode.
|