Files
AFFiNE-Mirror/blocksuite/affine/blocks/image/src/image-proxy-service.ts
Saul-Mirone df6e17b82f feat(editor): frame and image extensions (#11849)
Closes: BS-3196
Closes: BS-3197
2025-04-21 10:29:30 +00:00

21 lines
600 B
TypeScript

import { DEFAULT_IMAGE_PROXY_ENDPOINT } from '@blocksuite/affine-shared/consts';
import { StoreExtension } from '@blocksuite/store';
import { setImageProxyMiddlewareURL } from './adapters/middleware';
// TODO(@mirone): this should be configured when setup instead of runtime
export class ImageProxyService extends StoreExtension {
static override key = 'image-proxy';
private _imageProxyURL = DEFAULT_IMAGE_PROXY_ENDPOINT;
setImageProxyURL(url: string) {
this._imageProxyURL = url;
setImageProxyMiddlewareURL(url);
}
get imageProxyURL() {
return this._imageProxyURL;
}
}