2020-08-24 16:36:13 +00:00
|
|
|
import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal';
|
|
|
|
import { deserialize } from '@electron/internal/common/type-utils';
|
2020-10-13 21:11:06 +00:00
|
|
|
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
|
2020-08-24 16:36:13 +00:00
|
|
|
|
|
|
|
const { nativeImage } = process._linkedBinding('electron_common_native_image');
|
|
|
|
|
|
|
|
nativeImage.createThumbnailFromPath = async (path: string, size: Electron.Size) => {
|
2020-10-13 21:11:06 +00:00
|
|
|
return deserialize(await ipcRendererInternal.invoke(IPC_MESSAGES.NATIVE_IMAGE_CREATE_THUMBNAIL_FROM_PATH, path, size));
|
2020-08-24 16:36:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default nativeImage;
|