1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00
joplin/packages/app-mobile/components/NoteBodyViewer/bundledJs/utils/makeResourceModel.ts

17 lines
567 B
TypeScript

import { isResourceUrl, isSupportedImageMimeType, resourceFilename, resourceFullPath, resourceUrlToId } from '@joplin/lib/models/utils/resourceUtils';
import { OptionsResourceModel } from '@joplin/renderer/types';
const makeResourceModel = (resourceDirPath: string): OptionsResourceModel => {
return {
isResourceUrl,
urlToId: resourceUrlToId,
filename: resourceFilename,
isSupportedImageMimeType,
fullPath: (resource, encryptedBlob) => {
return resourceFullPath(resource, resourceDirPath, encryptedBlob);
},
};
};
export default makeResourceModel;