export declare const isBrowser: boolean; export declare function createSVGElement(type: string): SVGElement; export declare function getScale($el: HTMLCanvasElement): { scaleX: number; scaleY: number; bbox: DOMRect; }; /** * Safely parses a URL string without throwing exceptions on invalid input. * Returns a URL object for valid URLs or undefined for invalid ones. * * @param url - The URL string to parse * @param baseUrl - Optional base URL to resolve relative URLs against * @returns A URL object if parsing succeeds, undefined if it fails * * @example * ```ts * // Valid absolute URL * const url1 = safeParseUrl('https://example.com') * if (url1) { * console.log(`Valid URL: ${url1.href}`) // "Valid URL: https://example.com/" * } * * // Invalid URL * const url2 = safeParseUrl('not-a-url') * console.log(url2) // undefined * * // Relative URL with base * const url3 = safeParseUrl('/path', 'https://example.com') * if (url3) { * console.log(url3.href) // "https://example.com/path" * } * * // Error handling * function handleUserUrl(input: string) { * const url = safeParseUrl(input) * if (url) { * return url * } else { * console.log('Invalid URL provided') * return null * } * } * ``` * * @public */ export declare const safeParseUrl: (url: string, baseUrl?: string | URL) => URL; export declare const getSandboxPermissions: (permissions: TLEmbedShapePermissions) => string; type TLEmbedShapePermissions = { [K in keyof typeof embedShapePermissionDefaults]?: boolean; }; /** * Permissions with note inline from * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox * * @see https://github.com/tldraw/tldraw/blob/main/packages/tldraw/src/lib/defaultEmbedDefinitions.ts#L606 */ export declare const embedShapePermissionDefaults: { readonly 'allow-downloads-without-user-activation': false; readonly 'allow-downloads': false; readonly 'allow-modals': false; readonly 'allow-orientation-lock': false; readonly 'allow-pointer-lock': false; readonly 'allow-popups': true; readonly 'allow-popups-to-escape-sandbox': false; readonly 'allow-presentation': false; readonly 'allow-storage-access-by-user-activation': false; readonly 'allow-top-navigation': false; readonly 'allow-top-navigation-by-user-activation': false; readonly 'allow-scripts': true; readonly 'allow-same-origin': true; readonly 'allow-forms': true; }; export {};