get-browser-fingerprint icon indicating copy to clipboard operation
get-browser-fingerprint copied to clipboard

@types?

Open carterjfulcher opened this issue 1 year ago • 7 comments

Would be awesome to be able to use this natively with Typescript

carterjfulcher avatar Nov 13 '23 18:11 carterjfulcher

@damianobarbati I would like to work on it. You have prefer build framework? I see vitest already. So vite?
Can give you also a tsc-only solution :)

Sysix avatar Jan 05 '24 22:01 Sysix

@Sysix what's the simplest one? I'm assuming a post-build step with tsc. What you think?

damianobarbati avatar Jan 07 '24 15:01 damianobarbati

@damianobarbati I created a simple build step with tsc. Some other ToDo's needed to be done by you :)

Sysix avatar Jan 08 '24 21:01 Sysix

nice! thanks @Sysix @damianobarbati

carterjfulcher avatar Jan 09 '24 05:01 carterjfulcher

@damianobarbati u had any time to look into the PR? I could get more into it with backwards testing and co.

When sombody needs a definition before the next release, you can put this code in your global declarations:

declare global {
    interface Window {
        getBrowserFingerprint: ({ hardwareOnly, enableWebgl, enableScreen, debug, }?: {
            hardwareOnly?: boolean;
            enableWebgl?: boolean;
            enableScreen?: boolean;
            debug?: boolean;
        }) => number;
    }
}

Sysix avatar Jan 22 '24 21:01 Sysix

is there any work around for the @types ?

amirzezo201 avatar Feb 01 '24 13:02 amirzezo201

Have tried using it in React app, the build fails without @types.

--Edit-- Hm, I tried it again and it worked. But I still have typescript errors though. I can't reproduce the build error anymore. 🤔

alphonso06 avatar Jul 17 '24 04:07 alphonso06