@renaissancerentals/renaissance-component 13.0.14 → 13.0.15
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/lib/asset/service/AssetService.d.ts +25 -2
- package/lib/asset/service/ImageWidth.d.ts +6 -0
- package/lib/index.cjs.js +35 -35
- package/lib/index.d.ts +1 -1
- package/lib/index.es.js +7374 -7325
- package/lib/index.umd.js +36 -36
- package/package.json +1 -1
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import { Asset } from "../data/Asset";
|
|
2
2
|
export declare const propertyFragment: (propertyId?: string) => string;
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Images are served by Google's image CDN straight from Drive, so the bytes never pass through our servers and
|
|
5
|
+
* Google resizes them. Google throttles bursts (HTTP 429), so this is deliberately cautious:
|
|
6
|
+
* - at most CDN_BUDGET images per CDN_WINDOW_MS use the CDN, the overflow goes straight to our own endpoint;
|
|
7
|
+
* - after CDN_ERRORS_TO_TRIP failures the CDN is switched off for CDN_COOLDOWN_MS (remembered for the tab);
|
|
8
|
+
* - a failed CDN image falls back to our own download endpoint (see installImageFallback);
|
|
9
|
+
* - the choice for an image is made once, so re-rendering never flips an image between sources.
|
|
10
|
+
* Callers that pass no width get the original through our endpoint, as before.
|
|
11
|
+
*/
|
|
12
|
+
export { IMAGE_WIDTH } from "./ImageWidth";
|
|
13
|
+
/** Starts a fresh state, picking up a cooldown that an earlier page of this tab recorded. */
|
|
14
|
+
export declare const resetImageCdn: () => void;
|
|
15
|
+
/** Switch the Google CDN off or on (off: every image comes through our own download endpoint). */
|
|
16
|
+
export declare const setImageCdnEnabled: (enabled: boolean) => void;
|
|
17
|
+
export declare const googleImageUrl: (id: string, width: number) => string;
|
|
18
|
+
export declare const serverAssetUrl: (id: string, assetGatewayId?: string) => string;
|
|
19
|
+
export declare const getAssetUrl: (imageUrl: string, assetGatewayId?: string, width?: number) => string;
|
|
20
|
+
export declare const assetUrlFrom: (id: string, assetGatewayId: string, width?: number) => string;
|
|
21
|
+
/**
|
|
22
|
+
* When an image from Google's CDN fails to load, load it from our own endpoint instead, and count the failure
|
|
23
|
+
* towards the circuit breaker. One listener covers every <img> in the library, so no component needs its own
|
|
24
|
+
* onError. A failure of the fallback itself is not retried.
|
|
25
|
+
*/
|
|
26
|
+
export declare const handleImageError: (event: Event) => void;
|
|
27
|
+
export declare const installImageFallback: () => void;
|
|
5
28
|
export declare const getAssetsFrom: (folderId: string) => Promise<Asset[]>;
|
|
6
29
|
export declare const assetDomains: string[];
|
|
7
30
|
export declare const propertyIdToDomain: (propertyId?: string) => string;
|