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

17 lines
567 B
TypeScript
Raw Normal View History

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;