beaf60de0a
* initial commit, mac implementation * add documentation * convert createThumbnailFromPath to async function * windows impl protoype * add tests * added test * fix * fix test * clean up * update docs * cleaning up code * fix test * retrigger CI * retrigger CI * refactor from app to native_image * windows build * lint * lint * add smart pointers, fix test * change tests and update docs * fix test, remove nolint * add renderer-main process routing to fix tests * lint * thanks sam * thanks sam
10 lines
476 B
TypeScript
10 lines
476 B
TypeScript
import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal';
|
|
import { deserialize } from '@electron/internal/common/type-utils';
|
|
|
|
const { nativeImage } = process._linkedBinding('electron_common_native_image');
|
|
|
|
nativeImage.createThumbnailFromPath = async (path: string, size: Electron.Size) => {
|
|
return deserialize(await ipcRendererInternal.invoke('ELECTRON_NATIVE_IMAGE_CREATE_THUMBNAIL_FROM_PATH', path, size));
|
|
};
|
|
|
|
export default nativeImage;
|