refactor: circular deps part 14

This commit is contained in:
Nathan Walker
2025-07-10 15:47:29 -07:00
parent cebc78406b
commit e7ab426ee2
87 changed files with 2667 additions and 3403 deletions

View File

@@ -7,3 +7,15 @@ export interface ImageSourceLike {
toBase64String(format: string, quality?: number): string;
// ... add other shared methods/properties as needed
}
// Circular dependency resolution handling (http <--> image-source)
let _getImage: (arg: any) => Promise<ImageSourceLike>;
export function getImageRequest(arg: any): Promise<ImageSourceLike> {
if (_getImage) {
return _getImage(arg);
}
return Promise.reject(new Error('No getImage request handler set.'));
}
export function setGetImageRequest(fn: (arg: any) => Promise<ImageSourceLike>) {
_getImage = fn;
}