mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
* cherry-picking * add documentation * convert createThumbnailFromPath to async function * windows impl protoype * add tests * clean up * fix * fix test * update docs * cleaning up code * fix test * 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 * cherry-pick * lint * remove getApplicationInfoForProtocol code * chore: fix filenames conflict Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
11 lines
476 B
TypeScript
11 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;
|