antonfisher / electron-aspect-ratio-browser-window

Drop-in replacement for Electron's BrowserWindow with working aspect ratio on Windows
MIT License
7 stars 0 forks source link

Typescript definition #1

Closed jzecca closed 3 years ago

jzecca commented 3 years ago

Just found your lib and it's working great 👍

I just had an issue since I'm using TypeScript and this package does not contain definitions. I'm no TS expert (first time I ever write a definition), but I got it working using the following:

declare module 'electron-aspect-ratio-browser-window' {
    import { BrowserWindow } from 'electron';

    export default class AspectRatioBrowserWindow extends BrowserWindow {};
}

Hope it helps!

antonfisher commented 3 years ago

Thanks @jzecca, just published new version with typings: https://www.npmjs.com/package/electron-aspect-ratio-browser-window/v/1.0.2