mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-12-13 14:18:26 +09:00
837a8e15d8
* refactor(frontend): shouldCollapsedを共通化 * refactor(frontend): config.js, worker-multi-dispatch.js, intl-const.jsを共通化 * fix(frontend-shared): fix type error * refactor(frontend): is-link.jsと、同一の振る舞いをする記述を共通化 * fix * fix lint * lint fixes
35 lines
1001 B
TypeScript
35 lines
1001 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import { MediaProxy } from '@@/js/media-proxy.js';
|
|
import { url } 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, url);
|
|
}
|
|
|
|
return _mediaProxy.getProxiedImageUrl(...args);
|
|
}
|
|
|
|
export function getProxiedImageUrlNullable(...args: Parameters<MediaProxy['getProxiedImageUrlNullable']>): string | null {
|
|
if (_mediaProxy == null) {
|
|
_mediaProxy = new MediaProxy(instance, url);
|
|
}
|
|
|
|
return _mediaProxy.getProxiedImageUrlNullable(...args);
|
|
}
|
|
|
|
export function getStaticImageUrl(...args: Parameters<MediaProxy['getStaticImageUrl']>): string {
|
|
if (_mediaProxy == null) {
|
|
_mediaProxy = new MediaProxy(instance, url);
|
|
}
|
|
|
|
return _mediaProxy.getStaticImageUrl(...args);
|
|
}
|