@snap/camera-kit
Version:
Camera Kit Web
20 lines • 988 B
TypeScript
/// <reference types="trusted-types" />
export interface TrustedTypesHandler {
policyName: string;
getTrustedUrls: () => string[];
trustUrl: (url: string) => string | TrustedScriptURL;
}
/**
* Returns a Trusted Types handler for the given policy name.
* If a handler for the given policy name already exists, it is returned.
* Otherwise, a new handler is created and cached.
*
* Trusted Types policies exist on the window realm and duplicate policy names are not allowed.
* When bootstrapCameraKit is called multiple times with the same trustedTypesPolicyName during
* a window lifecycle, we reuse the cached handler instead of attempting to create a duplicate policy.
*
* @param trustedTypesPolicyName - The name of the Trusted Types policy to use.
* @returns A Trusted Types handler for the given policy name.
*/
export declare function getTrustedTypesHandler(trustedTypesPolicyName: string): TrustedTypesHandler;
//# sourceMappingURL=trustedTypesHandler.d.ts.map