Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 26 15:39
    ben-girardet synchronize #232
  • Jan 26 13:48
    ben-girardet synchronize #232
  • Jan 26 06:44
    ghiscoding closed #43
  • Jan 26 06:44
    ghiscoding commented #43
  • Jan 25 22:12
    EisenbergEffect commented #43
  • Jan 25 22:10
    ghiscoding commented #43
  • Jan 25 22:05
    EisenbergEffect commented #43
  • Jan 25 22:04
    EisenbergEffect commented #43
  • Jan 25 21:58
    ghiscoding commented #43
  • Jan 25 21:40
    EisenbergEffect commented #43
  • Jan 25 21:37
    ghiscoding commented #43
  • Jan 25 21:28
    EisenbergEffect commented #43
  • Jan 25 21:28
    ghiscoding edited #43
  • Jan 25 21:22
    ghiscoding opened #43
  • Jan 25 16:52
    vvnsk closed #6
  • Jan 25 16:52
    vvnsk commented #6
  • Jan 25 01:35

    EisenbergEffect on master

    fix(LoaderPlugin): not redeclar… Merge pull request #7 from vvns… (compare)

  • Jan 25 01:35
    EisenbergEffect closed #7
  • Jan 25 00:39
    vvnsk commented #7
  • Jan 24 15:28
    prakash12 commented #636
Peter Wone
@PeterWone
and the d.ts appears to be rather incomplete
bigopon
@bigopon
@PeterWone hmm it shouldn't be that difficult, note the path
it seems you are directly importing it
maybe we shouldn't?
Peter Wone
@PeterWone
I got it to work by copying both quagga.min.js and quagga.d.ts into the same folder and importing from there.
Peter Wone
@PeterWone
@bigopon how would you import it indirectly? like this? import { autoinject } from "aurelia-framework";
I tried import { * } from "quagga";
also import * from "quagga"; and import "quagga";
and import * as Quagga from "quagga";
It isn't found until I import directly
bigopon
@bigopon
From their doc, it seems you should use default import https://www.npmjs.com/package/quagga
image.png
Peter Wone
@PeterWone
It finds it but there's a squiggly on "quagga" and the message says Could not find a declaration file for module 'quagga'. 'k:/stock/node_modules/quagga/lib/quagga.js' implicitly has an 'any' type. Trynpm install @types/quaggaif it exists or add a new declaration (.d.ts) file containingdeclare module 'quagga';ts(7016)
There's a node_modules/quagga/quagga.d.ts so I don't understand why the message occurs
bigopon
@bigopon
did you try npm i @types/quagga?
Peter Wone
@PeterWone
hours ago, I'll repeat to get the outcome
bigopon
@bigopon
if you installed it
then you should be able to just do
import Quagga from 'quagga';
can you try that?
Peter Wone
@PeterWone
at run time I get TS7016: Could not find a declaration file for module 'quagga'. 'K:/stock/node_modules/quagga/lib/quagga.js' implicitly has an 'any' type. Trynpm install @types/quaggaif it exists or add a new declaration (.d.ts) file containingdeclare module 'quagga';` which is more or less what the squiggly warned.
bigopon
@bigopon
oh i see
sorry for that
it's because it's not available
so we need to declare the typing ourself
actually they seem to ship a type definition by default https://github.com/serratus/quaggaJS/blob/master/package.json#L8
Peter Wone
@PeterWone
They supply quagga.d.ts but I think the package is not correctly organised. When I put the d.ts in the same folder as the implementation and then reference it explicitly, it works
bigopon
@bigopon
why woudn't this work
are you on their latest version?
Peter Wone
@PeterWone
repo is abandoned years ago, enthusiasts are doing a new version but even their demo is broken whereas I can get the original to work in its demo
bigopon
@bigopon
hmm
its difficult to tell, but things look correct and should work
maybe you can do
Peter Wone
@PeterWone
as I said, if I put quagga.min.js and quagga.d.ts in the same folder then reference the folder, it all works
bigopon
@bigopon
I was trying to think of some fix, but maybe that should be ok
Peter Wone
@PeterWone
I mean, the d.ts. is incomplete, I had to add a lot more typing to get things to compile, but at least it loaded
bigopon
@bigopon
yeah, it may be annoying but at least it can be fixed
Peter Wone
@PeterWone
I don't understand the loader well enough to troubleshoot it
bigopon
@bigopon
it's not an issue with the loader, it's an issue with TypeScript
Peter Wone
@PeterWone
ok
I'll just use my ugly little hack, it's not as though he's going to update it :)
bigopon
@bigopon
:smile:
Peter Wone
@PeterWone
To be honest Google is running an experimental feature that will make the whole lib irrelevant. Did you know the camera chip in most mobile devices can scan barcodes? Google is looking at surfacing the capability to HTML5
obviously it will be a lot faster in hardware than in js :)
Anyhow thanks for helping me troubleshoot. I'm being called now, talk to you later.
bigopon
@bigopon
@PeterWone did not know that
It will be pretty nice then
Glad i could help, and thanks for the chat
Philip Thongkhamchanh
@PhilipTKC
Anyone know why this is returning KeyboardEvent is undefined in jest?
        const element: HTMLElement = component.viewModel["searchBox"];
        element.dispatchEvent(new KeyboardEvent("keyup", {key: "Enter"}));
Oo, window.KeyboardEvent works.