Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
16 lines
440 B
TypeScript
16 lines
440 B
TypeScript
import {
|
|
type ImageViewerEditorData,
|
|
type ImageViewerEditorSource,
|
|
provideImageViewerEditor,
|
|
} from '@modrinth/ui'
|
|
import { readFile } from '@tauri-apps/plugin-fs'
|
|
|
|
export function setupImageViewerEditorProvider() {
|
|
provideImageViewerEditor({
|
|
async loadEditorData(source: ImageViewerEditorSource): Promise<ImageViewerEditorData> {
|
|
return {
|
|
source: new Blob([await readFile(source.path)], { type: 'image/png' }),
|
|
}
|
|
},
|
|
})
|
|
} |