UNPKG

@snap/camera-kit

Version:
58 lines 2.03 kB
import type { XrCapabilities } from "../lens-core-module/generated-types"; /** @internal */ export type SupportedCapability<T> = T & { supported: true; }; /** @internal */ export type UnsupportedCapability = { supported: false; error: Error; }; /** @internal */ export type Capability<T = void> = SupportedCapability<T> | UnsupportedCapability; type WebGlCapability = Capability<{ maxTextureSize: number; }>; type WasmCapability = Capability<{ wasmFeatures: number; }>; /** * Because there may be a large number of WASM-related capabilities, and because these may correspond to various builds * of LensCore, we encode the various WASM capabilities into a single number by bitwise OR-ing together the numbers * corresponding to each capability. * * Since each combindation of capabilities is represented by a single number, we can easily map between that number and * the corresponding LensCore build name that makes use of those capabilities. * * @internal */ export declare enum WasmFeatures { Default = 0, SIMD = 1, ExceptionHandling = 2 } type WebXrCapability = Capability<XrCapabilities>; /** * @returns A Promise containing an object with fields describing the support of various WebXR features. This object's * type is defined by LensCore, as they consume these capabilities and adjust behavior accordingly. * * @internal */ export declare function getWebXrCapabilities(): Promise<WebXrCapability>; /** @internal */ export interface PlatformCapabilities { webgl: WebGlCapability; wasm: WasmCapability; webxr: WebXrCapability; } /** * Get information about the current platform capabilities, including: * - WebGL support and various WebGL parameters. * - WASM support and support for various WASM features. * - WebXR support and support for various WebXR features. * * @internal */ export declare const getPlatformCapabilities: import("../common/memoize").Memoized<() => Promise<PlatformCapabilities>>; export {}; //# sourceMappingURL=platformCapabilities.d.ts.map