blob: d93c0448d107264fc2c6436ba19904715c065109 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { MediaProxy } from '@@/js/media-proxy.js';
import { webUrl } from '@@/js/config.js';
import { instance } from '@/instance.js';
let _mediaProxy: MediaProxy | null = null;
export function getProxiedImageUrl(...args: Parameters<MediaProxy['getProxiedImageUrl']>): string {
if (_mediaProxy == null) {
_mediaProxy = new MediaProxy(instance, webUrl);
}
return _mediaProxy.getProxiedImageUrl(...args);
}
export function getProxiedImageUrlNullable(...args: Parameters<MediaProxy['getProxiedImageUrlNullable']>): string | null {
if (_mediaProxy == null) {
_mediaProxy = new MediaProxy(instance, webUrl);
}
return _mediaProxy.getProxiedImageUrlNullable(...args);
}
export function getStaticImageUrl(...args: Parameters<MediaProxy['getStaticImageUrl']>): string {
if (_mediaProxy == null) {
_mediaProxy = new MediaProxy(instance, webUrl);
}
return _mediaProxy.getStaticImageUrl(...args);
}
|