mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-18 09:35:20 +02:00
17 lines
567 B
TypeScript
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;
|