@snap/camera-kit 1.3.0 → 1.4.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/environment.js +1 -1
- package/dist/environment.js.map +1 -1
- package/dist/lensCoreWasmVersions.js +3 -3
- package/dist/lensCoreWasmVersions.js.map +1 -1
- package/dist/uri-handlers/internal-handlers/httpValidators.d.ts +1 -1
- package/dist/uri-handlers/internal-handlers/httpValidators.d.ts.map +1 -1
- package/dist/uri-handlers/internal-handlers/httpValidators.js +16 -19
- package/dist/uri-handlers/internal-handlers/httpValidators.js.map +1 -1
- package/docs/html/classes/CameraKit.html +2 -2
- package/docs/html/classes/CameraKitSession.html +2 -2
- package/docs/html/classes/CameraKitSource.html +2 -2
- package/docs/html/classes/LensPerformanceMeasurement.html +2 -2
- package/docs/html/classes/LensPerformanceMetrics.html +2 -2
- package/docs/html/classes/LensRepository.html +2 -2
- package/docs/html/classes/Transform2D.html +2 -2
- package/docs/html/classes/TypedCustomEvent.html +2 -2
- package/docs/html/classes/TypedEventTarget.html +2 -2
- package/docs/html/enums/Lens_CameraFacing.html +2 -2
- package/docs/html/functions/bootstrapCameraKit.html +2 -2
- package/docs/html/functions/createExtension.html +2 -2
- package/docs/html/functions/createImageSource.html +2 -2
- package/docs/html/functions/createMediaStreamSource.html +2 -2
- package/docs/html/functions/createVideoSource.html +2 -2
- package/docs/html/functions/estimateLensPerformance.html +2 -2
- package/docs/html/functions/filePickerFactory.html +2 -2
- package/docs/html/functions/getExtensionRequestContext.html +2 -2
- package/docs/html/functions/lensSourcesFactory.html +2 -2
- package/docs/html/functions/remoteApiServicesFactory.html +1 -1
- package/docs/html/hierarchy.html +1 -1
- package/docs/html/index.html +3 -3
- package/docs/html/interfaces/BitmojiUserInfo.html +2 -2
- package/docs/html/interfaces/CameraKitBootstrapConfiguration.html +2 -2
- package/docs/html/interfaces/CameraKitDeviceOptions.html +2 -2
- package/docs/html/interfaces/CameraKitSourceInfo.html +2 -2
- package/docs/html/interfaces/CameraKitSourceSubscriber.html +2 -2
- package/docs/html/interfaces/ComputedFrameMetrics.html +2 -2
- package/docs/html/interfaces/CreateSessionOptions.html +2 -2
- package/docs/html/interfaces/EstimatedLensPerformance.html +2 -2
- package/docs/html/interfaces/Font.html +2 -2
- package/docs/html/interfaces/FriendUserInfo.html +2 -2
- package/docs/html/interfaces/FunctionSourceOptions.html +2 -2
- package/docs/html/interfaces/Keyboard.html +2 -2
- package/docs/html/interfaces/KeyboardActiveEvent.html +2 -2
- package/docs/html/interfaces/Lens.html +2 -2
- package/docs/html/interfaces/LensCreator.html +2 -2
- package/docs/html/interfaces/LensHttpRequest.html +2 -2
- package/docs/html/interfaces/LensLaunchData.html +2 -2
- package/docs/html/interfaces/LensSource.html +2 -2
- package/docs/html/interfaces/LensUserData.html +2 -2
- package/docs/html/interfaces/LoadAssetRequest.html +2 -2
- package/docs/html/interfaces/MediaStreamSourceOptions.html +2 -2
- package/docs/html/interfaces/Preview.html +2 -2
- package/docs/html/interfaces/RemoteApiRequest.html +2 -2
- package/docs/html/interfaces/RemoteApiResponse.html +2 -2
- package/docs/html/interfaces/RemoteApiService.html +2 -2
- package/docs/html/interfaces/Snapcode.html +2 -2
- package/docs/html/interfaces/UriCancelRequest.html +2 -2
- package/docs/html/interfaces/UriRequest.html +2 -2
- package/docs/html/interfaces/UriResponse.html +2 -2
- package/docs/html/interfaces/VideoSourceOptions.html +2 -2
- package/docs/html/modules.html +1 -1
- package/docs/html/types/ArgumentValidationError.html +2 -2
- package/docs/html/types/AssetLoader.html +2 -2
- 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 +2 -2
- 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 +2 -2
- package/docs/html/types/FilePickerOptions.html +2 -2
- package/docs/html/types/FilePickerResult.html +2 -2
- package/docs/html/types/KeyboardEventListener.html +2 -2
- package/docs/html/types/KeyboardEvents.html +2 -2
- package/docs/html/types/LegalError.html +1 -1
- package/docs/html/types/LensAbortError.html +2 -2
- 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 +2 -2
- package/docs/html/types/LensHttpHandler.html +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/docs/md/README.md +2 -2
- package/docs/md/classes/CameraKit.md +1 -1
- package/docs/md/classes/CameraKitSession.md +1 -1
- package/docs/md/classes/CameraKitSource.md +1 -1
- package/docs/md/classes/LensPerformanceMeasurement.md +1 -1
- package/docs/md/classes/LensPerformanceMetrics.md +1 -1
- package/docs/md/classes/LensRepository.md +1 -1
- package/docs/md/classes/Transform2D.md +1 -1
- package/docs/md/classes/TypedCustomEvent.md +1 -1
- package/docs/md/classes/TypedEventTarget.md +1 -1
- package/docs/md/enumerations/Lens_CameraFacing.md +1 -1
- package/docs/md/functions/bootstrapCameraKit.md +1 -1
- package/docs/md/functions/createExtension.md +1 -1
- package/docs/md/functions/createImageSource.md +1 -1
- package/docs/md/functions/createMediaStreamSource.md +1 -1
- package/docs/md/functions/createVideoSource.md +1 -1
- package/docs/md/functions/estimateLensPerformance.md +1 -1
- package/docs/md/functions/filePickerFactory.md +1 -1
- package/docs/md/functions/getExtensionRequestContext.md +1 -1
- package/docs/md/functions/lensSourcesFactory.md +1 -1
- package/docs/md/functions/remoteApiServicesFactory.md +1 -1
- package/docs/md/globals.md +2 -2
- package/docs/md/interfaces/BitmojiUserInfo.md +1 -1
- package/docs/md/interfaces/CameraKitBootstrapConfiguration.md +1 -1
- package/docs/md/interfaces/CameraKitDeviceOptions.md +1 -1
- package/docs/md/interfaces/CameraKitSourceInfo.md +1 -1
- package/docs/md/interfaces/CameraKitSourceSubscriber.md +1 -1
- 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/Font.md +1 -1
- package/docs/md/interfaces/FriendUserInfo.md +1 -1
- package/docs/md/interfaces/FunctionSourceOptions.md +1 -1
- package/docs/md/interfaces/Keyboard.md +1 -1
- package/docs/md/interfaces/KeyboardActiveEvent.md +1 -1
- package/docs/md/interfaces/Lens.md +1 -1
- package/docs/md/interfaces/LensCreator.md +1 -1
- package/docs/md/interfaces/LensHttpRequest.md +1 -1
- package/docs/md/interfaces/LensLaunchData.md +1 -1
- package/docs/md/interfaces/LensSource.md +1 -1
- package/docs/md/interfaces/LensUserData.md +1 -1
- package/docs/md/interfaces/LoadAssetRequest.md +1 -1
- package/docs/md/interfaces/MediaStreamSourceOptions.md +1 -1
- package/docs/md/interfaces/Preview.md +1 -1
- package/docs/md/interfaces/RemoteApiRequest.md +1 -1
- package/docs/md/interfaces/RemoteApiResponse.md +1 -1
- package/docs/md/interfaces/RemoteApiService.md +1 -1
- package/docs/md/interfaces/Snapcode.md +1 -1
- package/docs/md/interfaces/UriCancelRequest.md +1 -1
- package/docs/md/interfaces/UriRequest.md +1 -1
- package/docs/md/interfaces/UriResponse.md +1 -1
- package/docs/md/interfaces/VideoSourceOptions.md +1 -1
- package/docs/md/type-aliases/ArgumentValidationError.md +1 -1
- package/docs/md/type-aliases/AssetLoader.md +1 -1
- package/docs/md/type-aliases/AssetResponse.md +1 -1
- package/docs/md/type-aliases/AssetTiming.md +1 -1
- package/docs/md/type-aliases/BenchmarkError.md +1 -1
- package/docs/md/type-aliases/BootstrapError.md +1 -1
- package/docs/md/type-aliases/CacheKeyNotFoundError.md +1 -1
- package/docs/md/type-aliases/CameraKitSessionEventListener.md +1 -1
- package/docs/md/type-aliases/CameraKitSessionEvents.md +1 -1
- package/docs/md/type-aliases/CameraKitSourceError.md +1 -1
- package/docs/md/type-aliases/ConfigurationError.md +1 -1
- package/docs/md/type-aliases/FetchHandler.md +1 -1
- package/docs/md/type-aliases/FilePicker.md +1 -1
- package/docs/md/type-aliases/FilePickerOptions.md +1 -1
- package/docs/md/type-aliases/FilePickerResult.md +1 -1
- package/docs/md/type-aliases/KeyboardEventListener.md +1 -1
- package/docs/md/type-aliases/KeyboardEvents.md +1 -1
- package/docs/md/type-aliases/LegalError.md +1 -1
- package/docs/md/type-aliases/LensAbortError.md +1 -1
- package/docs/md/type-aliases/LensAssetError.md +1 -1
- package/docs/md/type-aliases/LensContentValidationError.md +1 -1
- package/docs/md/type-aliases/LensError.md +1 -1
- package/docs/md/type-aliases/LensExecutionError.md +1 -1
- package/docs/md/type-aliases/LensHttpHandler.md +1 -1
- package/docs/md/type-aliases/LensImagePickerError.md +1 -1
- package/docs/md/type-aliases/LensLaunchParams.md +1 -1
- package/docs/md/type-aliases/LensMetricsEvents.md +1 -1
- package/docs/md/type-aliases/LensPerformanceCluster.md +1 -1
- package/docs/md/type-aliases/LensView.md +1 -1
- package/docs/md/type-aliases/LensWait.md +1 -1
- package/docs/md/type-aliases/Matrix.md +1 -1
- package/docs/md/type-aliases/PersistentStoreError.md +1 -1
- package/docs/md/type-aliases/PlatformNotSupportedError.md +1 -1
- package/docs/md/type-aliases/PublicContainer.md +1 -1
- package/docs/md/type-aliases/PublicServices.md +1 -1
- package/docs/md/type-aliases/RemoteApiCancelRequestHandler.md +1 -1
- package/docs/md/type-aliases/RemoteApiRequestHandler.md +1 -1
- package/docs/md/type-aliases/RemoteApiServices.md +1 -1
- package/docs/md/type-aliases/RemoteApiStatus.md +1 -1
- package/docs/md/type-aliases/RenderTarget.md +1 -1
- package/docs/md/type-aliases/Uri.md +1 -1
- package/docs/md/type-aliases/WebGLError.md +1 -1
- package/docs/md/type-aliases/Zodiac.md +1 -1
- package/docs/md/variables/extensionRequestContext.md +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -181,7 +181,7 @@ session.pause('capture');
|
|
|
181
181
|
|
|
182
182
|
## Error Handling
|
|
183
183
|
|
|
184
|
-
Camera Kit Web SDK methods may throw errors, or return rejected Promises -- these are documented in the [API docs](https://kit.snapchat.com/reference/CameraKit/web/1.
|
|
184
|
+
Camera Kit Web SDK methods may throw errors, or return rejected Promises -- these are documented in the [API docs](https://kit.snapchat.com/reference/CameraKit/web/1.4.0/index.html). It is good practice to handle such cases, to provide a good experience to your users.
|
|
185
185
|
|
|
186
186
|
Errors may also occur during Lens rendering. For example, Lenses contain their own scripting, which could throw an error. A rendering error could also occur if a Lens attempts to use a feature that is not supported by Camera Kit Web SDK.
|
|
187
187
|
|
package/dist/environment.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default { PACKAGE_VERSION: "1.
|
|
1
|
+
export default { PACKAGE_VERSION: "1.4.0" };
|
|
2
2
|
//# sourceMappingURL=environment.js.map
|
package/dist/environment.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,eAAe,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC","sourcesContent":["export default { PACKAGE_VERSION: \"1.
|
|
1
|
+
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,eAAe,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC","sourcesContent":["export default { PACKAGE_VERSION: \"1.4.0\" };\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
version: "
|
|
3
|
-
buildNumber: "
|
|
4
|
-
baseUrl: "https://cf-st.sc-cdn.net/d/
|
|
2
|
+
version: "305",
|
|
3
|
+
buildNumber: "574",
|
|
4
|
+
baseUrl: "https://cf-st.sc-cdn.net/d/mJaVaSIsblEzSy0An5Tei?go=IgsKCTIBBEgBUFxgAQ%3D%3D&uc=92",
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=lensCoreWasmVersions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lensCoreWasmVersions.js","sourceRoot":"","sources":["../src/lensCoreWasmVersions.ts"],"names":[],"mappings":"AAAA,eAAe;IACX,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,oFAAoF;CAChG,CAAC","sourcesContent":["export default {\n version: \"
|
|
1
|
+
{"version":3,"file":"lensCoreWasmVersions.js","sourceRoot":"","sources":["../src/lensCoreWasmVersions.ts"],"names":[],"mappings":"AAAA,eAAe;IACX,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,oFAAoF;CAChG,CAAC","sourcesContent":["export default {\n version: \"305\",\n buildNumber: \"574\",\n baseUrl: \"https://cf-st.sc-cdn.net/d/mJaVaSIsblEzSy0An5Tei?go=IgsKCTIBBEgBUFxgAQ%3D%3D&uc=92\",\n};\n"]}
|
|
@@ -5,5 +5,5 @@ export declare const requestValidationError: (message: string, cause?: unknown)
|
|
|
5
5
|
export declare function validateRequest(request: UriRequest, specs: RemoteApiSpec[]): void;
|
|
6
6
|
export declare function validatePath(path: string, parameters: RemoteParameter[]): void;
|
|
7
7
|
export declare function validateHeaders(headers: Record<string, string>, parameters: RemoteParameter[]): void;
|
|
8
|
-
export declare function validateQuery(
|
|
8
|
+
export declare function validateQuery(queryParams: URLSearchParams, parameters: RemoteParameter[]): void;
|
|
9
9
|
//# sourceMappingURL=httpValidators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpValidators.d.ts","sourceRoot":"","sources":["../../../src/uri-handlers/internal-handlers/httpValidators.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,+DAA+D,CAAC;AAIpH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,eAAO,MAAM,0BAA0B,2BAA2B,CAAC;AACnE,eAAO,MAAM,sBAAsB,6CAAyC,CAAC;AAE7E,wBAAgB,eAAe,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"httpValidators.d.ts","sourceRoot":"","sources":["../../../src/uri-handlers/internal-handlers/httpValidators.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,+DAA+D,CAAC;AAIpH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,eAAO,MAAM,0BAA0B,2BAA2B,CAAC;AACnE,eAAO,MAAM,sBAAsB,6CAAyC,CAAC;AAE7E,wBAAgB,eAAe,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,QA8B1E;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,QAqDvE;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,QAuB7F;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,eAAe,EAAE,QAwBxF"}
|
|
@@ -5,22 +5,23 @@ import { namedError } from "../../namedErrors";
|
|
|
5
5
|
export const requestValidationErrorName = "RequestValidationError";
|
|
6
6
|
export const requestValidationError = namedError(requestValidationErrorName);
|
|
7
7
|
export function validateRequest(request, specs) {
|
|
8
|
-
var _a
|
|
8
|
+
var _a;
|
|
9
|
+
const url = new URL(request.uri);
|
|
9
10
|
for (const spec of specs) {
|
|
10
|
-
|
|
11
|
-
if (!request.uri.startsWith(url))
|
|
11
|
+
if (url.host !== spec.host || url.protocol !== (spec.tlsRequired ? "https:" : "http:")) {
|
|
12
12
|
continue;
|
|
13
|
-
|
|
13
|
+
}
|
|
14
|
+
const path = url.pathname.replace(/^\/|\/$/g, "");
|
|
14
15
|
for (const endpoint of spec.endpoints) {
|
|
15
|
-
const endpointPath = endpoint.path.replace(
|
|
16
|
+
const endpointPath = endpoint.path.replace(/^\/|\/$/g, "");
|
|
16
17
|
if (!path.startsWith(endpointPath))
|
|
17
18
|
continue;
|
|
18
|
-
const method = (
|
|
19
|
+
const method = (_a = RemoteEndpoint_HttpRequestMethod[request.method]) !== null && _a !== void 0 ? _a : RemoteEndpoint_HttpRequestMethod.UNRECOGNIZED;
|
|
19
20
|
if (!endpoint.methods.includes(method))
|
|
20
21
|
continue;
|
|
21
|
-
validatePath(
|
|
22
|
+
validatePath(path.split(endpointPath)[1], endpoint.parameters);
|
|
22
23
|
validateHeaders(request.metadata, endpoint.parameters);
|
|
23
|
-
validateQuery(
|
|
24
|
+
validateQuery(url.searchParams, endpoint.parameters);
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
@@ -45,7 +46,12 @@ export function validatePath(path, parameters) {
|
|
|
45
46
|
}
|
|
46
47
|
else if (param.optional) {
|
|
47
48
|
if (paramNameComponent === param.name) {
|
|
48
|
-
|
|
49
|
+
if (paramValueComponent !== undefined) {
|
|
50
|
+
paramIndex += 2;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
paramIndex += 1;
|
|
54
|
+
}
|
|
49
55
|
}
|
|
50
56
|
}
|
|
51
57
|
else {
|
|
@@ -75,9 +81,6 @@ export function validateHeaders(headers, parameters) {
|
|
|
75
81
|
}
|
|
76
82
|
}
|
|
77
83
|
else if (param.optional) {
|
|
78
|
-
if (headerValue != undefined && isEmptyString(headerValue)) {
|
|
79
|
-
throw requestValidationError(`Header '${param.name}' is present but empty. If provided, it should not be empty.`);
|
|
80
|
-
}
|
|
81
84
|
}
|
|
82
85
|
else {
|
|
83
86
|
if (headerValue == undefined || isEmptyString(headerValue)) {
|
|
@@ -86,9 +89,7 @@ export function validateHeaders(headers, parameters) {
|
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
91
|
}
|
|
89
|
-
export function validateQuery(
|
|
90
|
-
const url = new URL(uri);
|
|
91
|
-
const queryParams = new URLSearchParams(url.search);
|
|
92
|
+
export function validateQuery(queryParams, parameters) {
|
|
92
93
|
for (const param of parameters) {
|
|
93
94
|
if (param.location !== RemoteParameter_ParameterLocation.QUERY)
|
|
94
95
|
continue;
|
|
@@ -100,10 +101,6 @@ export function validateQuery(uri, parameters) {
|
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
103
|
else if (param.optional) {
|
|
103
|
-
if (paramValue != undefined && isEmptyString(paramValue)) {
|
|
104
|
-
throw requestValidationError(`Optional query parameter '${param.name}' is present but empty. ` +
|
|
105
|
-
`If provided, it should not be empty.`);
|
|
106
|
-
}
|
|
107
104
|
}
|
|
108
105
|
else {
|
|
109
106
|
if (paramValue == undefined || isEmptyString(paramValue)) {
|
|
@@ -1 +1 @@
|
|
|
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sB,CAAC,6BAA6B,KAAK,CAAC,IAAI,wBAAwB,CAAC,CAAC;aACjG;SACJ;KACJ;AAEL,CAAC","sourcesContent":["import { isEmptyString } from \"../../common/typeguards\";\nimport type { RemoteApiSpec, RemoteParameter } from \"../../generated-proto/pb_schema/camera_kit/v3/remote_api_spec\";\nimport { RemoteEndpoint_HttpRequestMethod } from \"../../generated-proto/pb_schema/camera_kit/v3/remote_api_spec\";\nimport { RemoteParameter_ParameterLocation } from \"../../generated-proto/pb_schema/camera_kit/v3/remote_api_spec\";\nimport { namedError } from \"../../namedErrors\";\nimport type { UriRequest } from \"../UriHandlers\";\n\nexport const requestValidationErrorName = \"RequestValidationError\";\nexport const requestValidationError = namedError(requestValidationErrorName);\n\nexport function validateRequest(request: UriRequest, specs: RemoteApiSpec[]) {\n // 1. Given url, method and headers and spec:\n for (const spec of specs) {\n const url = `${spec.tlsRequired ? \"https://\" : \"http://\"}${spec.host}`;\n // 2. Check url starts with schema + the host. If yes trim that part and split by /\n if (!request.uri.startsWith(url)) continue;\n\n // 3. Split the rest by / and go for each part together with the path parameters.\n const path = (request.uri.split(url)[1] ?? \"\").replace(/^\\//, \"\").replace(/\\/$/, \"\");\n for (const endpoint of spec.endpoints) {\n const endpointPath = endpoint.path.replace(/^\\//, \"\").replace(/\\/$/, \"\");\n if (!path.startsWith(endpointPath)) continue;\n\n const method =\n RemoteEndpoint_HttpRequestMethod[request.method] ?? RemoteEndpoint_HttpRequestMethod.UNRECOGNIZED;\n if (!endpoint.methods.includes(method)) continue;\n\n validatePath(path.split(endpointPath)[1] ?? \"\", endpoint.parameters);\n validateHeaders(request.metadata, endpoint.parameters);\n validateQuery(request.uri, endpoint.parameters);\n // The request matches the current endpoint\n return;\n }\n }\n\n // The request does not match any of the endpoints\n throw requestValidationError(\"The request does not match any of the Remote API specifications.\");\n}\n\nexport function validatePath(path: string, parameters: RemoteParameter[]) {\n const pathComponents = path.split(\"/\").filter(Boolean);\n\n let paramIndex = 0;\n\n for (const param of parameters) {\n if (param.location !== RemoteParameter_ParameterLocation.PATH) continue;\n\n const paramNameComponent = pathComponents[paramIndex];\n const paramValueComponent = pathComponents[paramIndex + 1];\n\n if (param.constant) {\n // For constant parameters, the value must match the defaultValue\n if (paramNameComponent === param.name && paramValueComponent === param.defaultValue) {\n paramIndex += 2; // Move to the next parameter pair\n } else {\n throw requestValidationError(\n `Expected constant parameter '${param.name}' with value '${param.defaultValue}' ` +\n `at position ${paramIndex}, but found '${paramNameComponent}' and '${paramValueComponent}'.`\n );\n }\n } else if (param.optional) {\n if (paramNameComponent === param.name) {\n paramIndex += 2; // Move to the next parameter pair if optional parameter exists\n }\n // If optional and not present, continue without incrementing paramIndex\n } else {\n // For regular parameters, we just need to ensure a name/value pair exists\n if (paramNameComponent === param.name && paramValueComponent !== undefined) {\n paramIndex += 2; // Move to the next parameter pair\n } else {\n throw requestValidationError(\n `Expected parameter '${param.name}' with a value at position ${paramIndex}, ` +\n `but found '${paramNameComponent}' and '${paramValueComponent}'.`\n );\n }\n }\n }\n\n // After processing all parameters, there should be no extra path components\n if (paramIndex !== pathComponents.length) {\n const invalidPath = pathComponents.slice(paramIndex).join(\"/\");\n throw requestValidationError(\n `Unexpected extra path components starting at position ${paramIndex}: '${invalidPath}'.`\n );\n }\n}\n\nexport function validateHeaders(headers: Record<string, string>, parameters: RemoteParameter[]) {\n for (const param of parameters) {\n if (param.location !== RemoteParameter_ParameterLocation.HEADER) continue;\n\n const headerValue = headers[param.name];\n\n if (param.constant) {\n // For constant parameters, the header must exist and match defaultValue\n if (headerValue !== param.defaultValue) {\n throw requestValidationError(\n `Expected constant header '${param.name}' with value '${param.defaultValue}', ` +\n `but found '${headerValue ?? \"undefined\"}'.`\n );\n }\n } else if (param.optional) {\n // If optional, we only validate if the header exists\n if (headerValue != undefined && isEmptyString(headerValue)) {\n throw requestValidationError(\n `Header '${param.name}' is present but empty. If provided, it should not be empty.`\n );\n }\n } else {\n // For regular parameters, the header must exist and have a non-empty value\n if (headerValue == undefined || isEmptyString(headerValue)) {\n throw requestValidationError(`Required header '${param.name}' is missing or empty.`);\n }\n }\n }\n}\n\nexport function validateQuery(uri: string, parameters: RemoteParameter[]) {\n const url = new URL(uri);\n const queryParams = new URLSearchParams(url.search);\n for (const param of parameters) {\n if (param.location !== RemoteParameter_ParameterLocation.QUERY) continue;\n\n const paramValue = queryParams.get(param.name);\n\n if (param.constant) {\n // For constant parameters, the query parameter must exist and match defaultValue\n if (paramValue !== param.defaultValue) {\n throw requestValidationError(\n `Expected constant query parameter '${param.name}' with value '${param.defaultValue}', ` +\n `but found '${paramValue ?? \"undefined\"}'.`\n );\n }\n } else if (param.optional) {\n // If optional, validate only if the query parameter exists\n if (paramValue != undefined && isEmptyString(paramValue)) {\n throw requestValidationError(\n `Optional query parameter '${param.name}' is present but empty. ` +\n `If provided, it should not be empty.`\n );\n }\n } else {\n // For regular parameters, the query parameter must exist and have a non-empty value\n if (paramValue == undefined || isEmptyString(paramValue)) {\n throw requestValidationError(`Required query parameter '${param.name}' is missing or empty.`);\n }\n }\n }\n // All query parameters are valid\n}\n"]}
|
|
1
|
+
{"version":3,"file":"httpValidators.js","sourceRoot":"","sources":["../../../src/uri-handlers/internal-handlers/httpValidators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,gCAAgC,EAAE,MAAM,+DAA+D,CAAC;AACjH,OAAO,EAAE,iCAAiC,EAAE,MAAM,+DAA+D,CAAC;AAClH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,MAAM,CAAC,MAAM,0BAA0B,GAAG,wBAAwB,CAAC;AACnE,MAAM,CAAC,MAAM,sBAAsB,GAAG,UAAU,CAAC,0BAA0B,CAAC,CAAC;AAE7E,MAAM,UAAU,eAAe,CAAC,OAAmB,EAAE,KAAsB;;IACvE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;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c,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,WAAW,IAAI,CAClD,CAAC;aACL;SACJ;aAAM,IAAI,KAAK,CAAC,QAAQ,EAAE;SAE1B;aAAM;YAEH,IAAI,UAAU,IAAI,SAAS,IAAI,aAAa,CAAC,UAAU,CAAC,EAAE;gBACtD,MAAM,sBAAsB,CAAC,6BAA6B,KAAK,CAAC,IAAI,wBAAwB,CAAC,CAAC;aACjG;SACJ;KACJ;AAEL,CAAC","sourcesContent":["import { isEmptyString } from \"../../common/typeguards\";\nimport type { RemoteApiSpec, RemoteParameter } from \"../../generated-proto/pb_schema/camera_kit/v3/remote_api_spec\";\nimport { RemoteEndpoint_HttpRequestMethod } from \"../../generated-proto/pb_schema/camera_kit/v3/remote_api_spec\";\nimport { RemoteParameter_ParameterLocation } from \"../../generated-proto/pb_schema/camera_kit/v3/remote_api_spec\";\nimport { namedError } from \"../../namedErrors\";\nimport type { UriRequest } from \"../UriHandlers\";\n\nexport const requestValidationErrorName = \"RequestValidationError\";\nexport const requestValidationError = namedError(requestValidationErrorName);\n\nexport function validateRequest(request: UriRequest, specs: RemoteApiSpec[]) {\n const url = new URL(request.uri);\n\n // 1. Given url, method and headers and spec:\n for (const spec of specs) {\n // 2. Check protocol and host.\n if (url.host !== spec.host || url.protocol !== (spec.tlsRequired ? \"https:\" : \"http:\")) {\n continue;\n }\n\n // 3. Go for each part together with the path parameters.\n const path = url.pathname.replace(/^\\/|\\/$/g, \"\");\n for (const endpoint of spec.endpoints) {\n const endpointPath = endpoint.path.replace(/^\\/|\\/$/g, \"\");\n if (!path.startsWith(endpointPath)) continue;\n\n const method =\n RemoteEndpoint_HttpRequestMethod[request.method] ?? RemoteEndpoint_HttpRequestMethod.UNRECOGNIZED;\n if (!endpoint.methods.includes(method)) continue;\n\n validatePath(path.split(endpointPath)[1], endpoint.parameters);\n validateHeaders(request.metadata, endpoint.parameters);\n validateQuery(url.searchParams, endpoint.parameters);\n // The request matches the current endpoint\n return;\n }\n }\n\n // The request does not match any of the endpoints\n throw requestValidationError(\"The request does not match any of the Remote API specifications.\");\n}\n\nexport function validatePath(path: string, parameters: RemoteParameter[]) {\n const pathComponents = path.split(\"/\").filter(Boolean);\n\n let paramIndex = 0;\n\n for (const param of parameters) {\n if (param.location !== RemoteParameter_ParameterLocation.PATH) continue;\n\n const paramNameComponent = pathComponents[paramIndex];\n const paramValueComponent = pathComponents[paramIndex + 1];\n\n if (param.constant) {\n // For constant parameters, the value must match the defaultValue\n if (paramNameComponent === param.name && paramValueComponent === param.defaultValue) {\n paramIndex += 2; // Move to the next parameter pair\n } else {\n throw requestValidationError(\n `Expected constant parameter '${param.name}' with value '${param.defaultValue}' ` +\n `at position ${paramIndex}, but found '${paramNameComponent}' and '${paramValueComponent}'.`\n );\n }\n } else if (param.optional) {\n if (paramNameComponent === param.name) {\n // Check if there's another component for its value\n if (paramValueComponent !== undefined) {\n // Optional param with a value\n paramIndex += 2;\n } else {\n // Optional param without a value\n paramIndex += 1;\n }\n }\n // If optional and not present, continue without incrementing paramIndex\n } else {\n // For regular parameters, we just need to ensure a name/value pair exists\n if (paramNameComponent === param.name && paramValueComponent !== undefined) {\n paramIndex += 2; // Move to the next parameter pair\n } else {\n throw requestValidationError(\n `Expected parameter '${param.name}' with a value at position ${paramIndex}, ` +\n `but found '${paramNameComponent}' and '${paramValueComponent}'.`\n );\n }\n }\n }\n\n // After processing all parameters, there should be no extra path components\n if (paramIndex !== pathComponents.length) {\n const invalidPath = pathComponents.slice(paramIndex).join(\"/\");\n throw requestValidationError(\n `Unexpected extra path components starting at position ${paramIndex}: '${invalidPath}'.`\n );\n }\n}\n\nexport function validateHeaders(headers: Record<string, string>, parameters: RemoteParameter[]) {\n for (const param of parameters) {\n if (param.location !== RemoteParameter_ParameterLocation.HEADER) continue;\n\n const headerValue = headers[param.name];\n\n if (param.constant) {\n // For constant parameters, the header must exist and match defaultValue\n if (headerValue !== param.defaultValue) {\n throw requestValidationError(\n `Expected constant header '${param.name}' with value '${param.defaultValue}', ` +\n `but found '${headerValue ?? \"undefined\"}'.`\n );\n }\n } else if (param.optional) {\n // If optional, missing or present value is OK\n } else {\n // For required parameters, the header must exist and have a non-empty value\n if (headerValue == undefined || isEmptyString(headerValue)) {\n throw requestValidationError(`Required header '${param.name}' is missing or empty.`);\n }\n }\n }\n}\n\nexport function validateQuery(queryParams: URLSearchParams, parameters: RemoteParameter[]) {\n for (const param of parameters) {\n if (param.location !== RemoteParameter_ParameterLocation.QUERY) continue;\n\n const paramValue = queryParams.get(param.name);\n\n if (param.constant) {\n // For constant parameters, the query parameter must exist and match defaultValue\n if (paramValue !== param.defaultValue) {\n throw requestValidationError(\n `Expected constant query parameter '${param.name}' with value '${param.defaultValue}', ` +\n `but found '${paramValue ?? \"undefined\"}'.`\n );\n }\n } else if (param.optional) {\n // If optional, missing or present value is OK\n } else {\n // For required parameters, the query parameter must exist and have a non-empty value\n if (paramValue == undefined || isEmptyString(paramValue)) {\n throw requestValidationError(`Required query parameter '${param.name}' is missing or empty.`);\n }\n }\n }\n // All query parameters are valid\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>CameraKit | CameraKit Web SDK - v1.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>CameraKit | CameraKit Web SDK - v1.4.0</title><meta name="description" content="Documentation for CameraKit Web SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">CameraKit Web SDK - v1.4.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">CameraKit Web SDK</a></li><li><a href="CameraKit.html">CameraKit</a></li></ul><h1>Class CameraKit</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>The entry point to the CameraKit SDK's API. Most of CameraKit's features are accessed via this class.</p>
|
|
2
2
|
<p>Applications obtain an instance of CameraKit by calling <a href="../functions/bootstrapCameraKit.html" class="tsd-kind-function">bootstrapCameraKit</a>.</p>
|
|
3
3
|
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-6">cameraKit</span><span class="hl-1"> = </span><span class="hl-2">await</span><span class="hl-1"> </span><span class="hl-5">bootstrapCameraKit</span><span class="hl-1">(</span><span class="hl-0">config</span><span class="hl-1">)</span>
|
|
4
4
|
</code><button type="button">Copy</button></pre>
|
|
@@ -25,4 +25,4 @@ to Lens rendering.</p>
|
|
|
25
25
|
</code><button type="button">Copy</button></pre>
|
|
26
26
|
|
|
27
27
|
</div></div></li></ul></section><section class="tsd-panel tsd-member"><a id="destroy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>destroy</span><a href="#destroy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="destroy-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">destroy</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#destroy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Destroys all sessions and frees all resources.</p>
|
|
28
|
-
</div><h4 class="tsd-returns-title">Returns <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#lenses" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>lenses</span></a><a href="#metrics" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>metrics</span></a><a href="#lensrepository" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>lens<wbr/>Repository</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#createsession" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Session</span></a><a href="#destroy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>destroy</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">CameraKit Web SDK - v1.
|
|
28
|
+
</div><h4 class="tsd-returns-title">Returns <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#lenses" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>lenses</span></a><a href="#metrics" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>metrics</span></a><a href="#lensrepository" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>lens<wbr/>Repository</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#createsession" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Session</span></a><a href="#destroy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>destroy</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">CameraKit Web SDK - v1.4.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>CameraKitSession | CameraKit Web SDK - v1.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>CameraKitSession | CameraKit Web SDK - v1.4.0</title><meta name="description" content="Documentation for CameraKit Web SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">CameraKit Web SDK - v1.4.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">CameraKit Web SDK</a></li><li><a href="CameraKitSession.html">CameraKitSession</a></li></ul><h1>Class CameraKitSession</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>A CameraKitSession represents a single rendering pipeline connecting an input media source to output <code><canvas></code>
|
|
2
2
|
elements. When a Lens is applied to the session, CameraKit uses the Lens to transform the input media into rendered
|
|
3
3
|
output.</p>
|
|
4
4
|
<p>CameraKitSession is the primary object that applications interact with when integrating the CameraKit SDK.</p>
|
|
@@ -149,4 +149,4 @@ alternatives.</p>
|
|
|
149
149
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise is resolved when the limit is successfully set.</p>
|
|
150
150
|
<div class="tsd-comment tsd-typography"></div></li></ul></section><section class="tsd-panel tsd-member"><a id="destroy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>destroy</span><a href="#destroy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="destroy-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">destroy</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#destroy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Destroy the session.</p>
|
|
151
151
|
<p>The session will become inoperable. Frame processing stops, and any session-scoped graphical resources are freed.</p>
|
|
152
|
-
</div><h4 class="tsd-returns-title">Returns <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#output" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>output</span></a><a href="#playing" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>playing</span></a><a href="#events" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>events</span></a><a href="#metrics" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>metrics</span></a><a href="#keyboard" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>keyboard</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#applylens" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>apply<wbr/>Lens</span></a><a href="#removelens" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Lens</span></a><a href="#play" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>play</span></a><a href="#pause" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>pause</span></a><a href="#mute" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>mute</span></a><a href="#unmute" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>unmute</span></a><a href="#setsource" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Source</span></a><a href="#setfpslimit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>setFPSLimit</span></a><a href="#destroy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>destroy</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">CameraKit Web SDK - v1.
|
|
152
|
+
</div><h4 class="tsd-returns-title">Returns <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#output" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>output</span></a><a href="#playing" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>playing</span></a><a href="#events" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>events</span></a><a href="#metrics" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>metrics</span></a><a href="#keyboard" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>keyboard</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#applylens" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>apply<wbr/>Lens</span></a><a href="#removelens" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Lens</span></a><a href="#play" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>play</span></a><a href="#pause" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>pause</span></a><a href="#mute" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>mute</span></a><a href="#unmute" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>unmute</span></a><a href="#setsource" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Source</span></a><a href="#setfpslimit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>setFPSLimit</span></a><a href="#destroy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>destroy</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">CameraKit Web SDK - v1.4.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>CameraKitSource | CameraKit Web SDK - v1.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>CameraKitSource | CameraKit Web SDK - v1.4.0</title><meta name="description" content="Documentation for CameraKit Web SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">CameraKit Web SDK - v1.4.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">CameraKit Web SDK</a></li><li><a href="CameraKitSource.html">CameraKitSource</a></li></ul><h1>Class CameraKitSource</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>This general-purpose class represents a source of media for a <a href="CameraKitSession.html" class="tsd-kind-class">CameraKitSession</a>.</p>
|
|
2
2
|
<p>When an instance is passed to <a href="CameraKitSession.html#setsource" class="tsd-kind-method">CameraKitSession.setSource</a>, it will be "attached"
|
|
3
3
|
to the session. Later it may be "detached" from the session.</p>
|
|
4
4
|
<p>Passing a <a href="../interfaces/CameraKitSourceSubscriber.html" class="tsd-kind-interface">CameraKitSourceSubscriber</a> to the constructor allows callers to specify behavior
|
|
@@ -33,4 +33,4 @@ of as free.</p>
|
|
|
33
33
|
constraint should be removed, so callers don't have to understand the underlying LensCore state machine.</p>
|
|
34
34
|
</div></div></li></ul></section><section class="tsd-panel tsd-member"><a id="settransform" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>Transform</span><a href="#settransform" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="settransform-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">setTransform</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">transform</span><span class="tsd-signature-symbol">:</span> <a href="Transform2D.html" class="tsd-signature-type tsd-kind-class">Transform2D</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#settransform-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Apply a 2D transformation to the source (e.g. translation, rotation, scale).</p>
|
|
35
35
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">transform</span>: <a href="Transform2D.html" class="tsd-signature-type tsd-kind-class">Transform2D</a></span><div class="tsd-comment tsd-typography"><p>Specifies the 3x3 matrix describing the transformation.</p>
|
|
36
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#copy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>copy</span></a><a href="#setrendersize" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Render<wbr/>Size</span></a><a href="#settransform" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Transform</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">CameraKit Web SDK - v1.
|
|
36
|
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise" class="tsd-signature-type external" target="_blank">Promise</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><div class="tsd-comment tsd-typography"></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#copy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>copy</span></a><a href="#setrendersize" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Render<wbr/>Size</span></a><a href="#settransform" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Transform</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">CameraKit Web SDK - v1.4.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LensPerformanceMeasurement | CameraKit Web SDK - v1.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LensPerformanceMeasurement | CameraKit Web SDK - v1.4.0</title><meta name="description" content="Documentation for CameraKit Web SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">CameraKit Web SDK - v1.4.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">CameraKit Web SDK</a></li><li><a href="LensPerformanceMeasurement.html">LensPerformanceMeasurement</a></li></ul><h1>Class LensPerformanceMeasurement</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Represents an ongoing measurement of rendering metrics.</p>
|
|
2
2
|
<p>An instance of this class is obtained by calling <a href="LensPerformanceMetrics.html#beginmeasurement" class="tsd-kind-method">LensPerformanceMetrics.beginMeasurement</a>. Then it may be
|
|
3
3
|
used to record rendering performance metrics, reset measurement, or end the measurement.</p>
|
|
4
4
|
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="LensPerformanceMeasurement.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
|
@@ -15,4 +15,4 @@ more convenient.</p>
|
|
|
15
15
|
<p>This instance will not be garbage collected until this method is called. Therefore it is important to call this
|
|
16
16
|
method at the appropriate time to avoid leaking memory -- particularly if your application creates many
|
|
17
17
|
LensPerformanceMeasurement instances.</p>
|
|
18
|
-
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#measure" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>measure</span></a><a href="#reset" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>reset</span></a><a href="#end" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>end</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">CameraKit Web SDK - v1.
|
|
18
|
+
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#measure" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>measure</span></a><a href="#reset" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>reset</span></a><a href="#end" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>end</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">CameraKit Web SDK - v1.4.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LensPerformanceMetrics | CameraKit Web SDK - v1.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LensPerformanceMetrics | CameraKit Web SDK - v1.4.0</title><meta name="description" content="Documentation for CameraKit Web SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">CameraKit Web SDK - v1.4.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">CameraKit Web SDK</a></li><li><a href="LensPerformanceMetrics.html">LensPerformanceMetrics</a></li></ul><h1>Class LensPerformanceMetrics</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Use to measure lens rendering performance.</p>
|
|
2
2
|
<p>The <a href="LensPerformanceMetrics.html#beginmeasurement" class="tsd-kind-method">LensPerformanceMetrics.beginMeasurement</a> method is used to start measuring rendering performance. After
|
|
3
3
|
a measurement has begun, performance metrics can be read using <a href="LensPerformanceMeasurement.html" class="tsd-kind-class">LensPerformanceMeasurement</a>.</p>
|
|
4
4
|
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link"><a id="example" class="tsd-anchor"></a>Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-6">measurement</span><span class="hl-1"> = </span><span class="hl-0">cameraKitSession</span><span class="hl-1">.</span><span class="hl-0">metrics</span><span class="hl-1">.</span><span class="hl-5">beginMeasurement</span><span class="hl-1">()</span><br/><span class="hl-7">// some time later</span><br/><span class="hl-0">console</span><span class="hl-1">.</span><span class="hl-5">log</span><span class="hl-1">(</span><span class="hl-0">measurement</span><span class="hl-1">.</span><span class="hl-5">measure</span><span class="hl-1">())</span>
|
|
@@ -8,4 +8,4 @@ a measurement has begun, performance metrics can be read using <a href="LensPerf
|
|
|
8
8
|
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="beginmeasurement" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>begin<wbr/>Measurement</span><a href="#beginmeasurement" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="beginmeasurement-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">beginMeasurement</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="LensPerformanceMeasurement.html" class="tsd-signature-type tsd-kind-class">LensPerformanceMeasurement</a><a href="#beginmeasurement-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Begin a measurement window, during which time rendering metrics will be gathered.</p>
|
|
9
9
|
</div><h4 class="tsd-returns-title">Returns <a href="LensPerformanceMeasurement.html" class="tsd-signature-type tsd-kind-class">LensPerformanceMeasurement</a></h4><p>A <a href="LensPerformanceMeasurement.html" class="tsd-kind-class">LensPerformanceMeasurement</a> representing an ongoing measurement of aggregated rendering
|
|
10
10
|
metrics, from which specific metrics can be obtained.</p>
|
|
11
|
-
<div class="tsd-comment tsd-typography"></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#beginmeasurement" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>begin<wbr/>Measurement</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">CameraKit Web SDK - v1.
|
|
11
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#beginmeasurement" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>begin<wbr/>Measurement</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">CameraKit Web SDK - v1.4.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|