@snap/camera-kit
Version:
Camera Kit Web
117 lines • 3.92 kB
TypeScript
import type { Content, Lens as LensProto } from "../generated-proto/pb_schema/camera_kit/v3/lens";
import { Lens_CameraFacing } from "../generated-proto/pb_schema/camera_kit/v3/lens";
import type { GetGroupResponse } from "../generated-proto/pb_schema/camera_kit/v3/service";
import type { Any } from "../generated-proto/pb_schema/google/protobuf/any";
/**
* Camera facing.
*/
export { Lens_CameraFacing };
/**
* Lens creator.
*/
export interface LensCreator {
displayName: string;
}
export interface LensProtoWithGroupId extends LensProto {
groupId: string;
}
/**
* @category Lenses
*/
export interface Lens {
/**
* Non-empty identifier of a unique lens available to be applied in current session.
*
* NOTE: This value may contain unsafe characters
* and therefore may require additional processing depending on usages.
*/
id: string;
/**
* The unique identifier for the group that this lens is a part of,
* correlating to a collection of lenses grouped for organizational or functional purposes.
*/
groupId: string;
/**
* Human readable name of this lens.
*
* NOTE: This value may contain unsafe characters
* and therefore may require additional processing depending on usages.
*/
name: string;
/**
* Icon resource URI that represents this lens if available.
*/
iconUrl: string | undefined;
/**
* Vendor specific metadata associated with this lens, empty by default.
*
* NOTE: Metadata values may contain unsafe characters
* and therefore may require additional processing depending on usages.
*/
vendorData: {
[key: string]: string;
};
/**
* Specifies a {@link Lens_CameraFacing} that this lens is designed for.
*/
cameraFacingPreference: Lens_CameraFacing;
/**
* Preview representing this lens, if available.
*/
preview: Preview | undefined;
/**
* Information about the lens creator.
*/
lensCreator: LensCreator | undefined;
/**
* A [snapcode](https://scan.snapchat.com/snapcodes) that represents the lens if available.
*
* The snapcode points to the lens in the Snapchat app, when used on mobile, or a dedicated web page.
*/
snapcode: Snapcode | undefined;
/**
* Metadata pertaining to a specific set of lens features
*/
featureMetadata: Any[];
}
/**
* Lens preview.
*/
export interface Preview {
/**
* Link to a lens preview image.
*/
imageUrl: string;
}
/**
* [Snapcode](https://scan.snapchat.com/snapcodes) representing a lens.
*/
export interface Snapcode {
/**
* Snapcode image URL scannable with Snapchat app.
*/
imageUrl: string;
/**
* Deeplink URL that directs to a lens web page.
*/
deepLink: string;
}
export declare function isLensArray(value: unknown): value is Lens[];
export declare function isLens(value: unknown): value is Lens;
export declare function isLensProto(value: unknown): value is LensProto;
export declare function isPreview(value: unknown): value is Preview;
export declare function isLensCreator(value: unknown): value is LensCreator;
export declare function isSnapcode(value: unknown): value is Snapcode;
export declare function isLensContent(value: unknown): value is Omit<Content, "lnsUrl" | "iconUrl">;
export declare function isGetGroupResponse(value: unknown): value is GetGroupResponse;
export declare function isAny(value: unknown): value is Any;
export declare function isAnyArray(value: unknown): value is Any[];
/**
* Converts lens proto to a public lens object.
* @param lens Lens proto
* @returns Public lens object.
*
* @internal
*/
export declare function toPublicLens({ id, groupId, name, content, vendorData, cameraFacingPreference, lensCreator, scannable, featureMetadata, }: LensProtoWithGroupId): Lens;
//# sourceMappingURL=Lens.d.ts.map