k-qr-scanner 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/README.md +38 -10
  3. package/dist/chunks/chunk-PUUIGXID.js +149 -0
  4. package/dist/chunks/engine-EJ4OC3LZ.js +1 -0
  5. package/dist/cli.js +22 -9
  6. package/dist/element.d.ts +11 -1
  7. package/dist/emv.d.ts +89 -0
  8. package/dist/engine.d.ts +5 -0
  9. package/dist/index.cjs +24 -10
  10. package/dist/index.d.ts +2 -0
  11. package/dist/index.js +1 -2
  12. package/dist/kqrcode.engine.js +1 -1
  13. package/dist/kqrcode.global.js +24 -10
  14. package/dist/kqrcode.jsqr.js +0 -1
  15. package/dist/react-native.d.ts +4 -0
  16. package/dist/react.cjs +1 -2
  17. package/dist/react.d.ts +2 -0
  18. package/dist/react.js +1 -2
  19. package/dist/rn/index.js +5 -6
  20. package/dist/rn/runtime.js +1 -1
  21. package/dist/scan-qr.d.ts +2 -0
  22. package/dist/sr.cjs +0 -1
  23. package/dist/sr.js +1 -2
  24. package/dist/svelte.cjs +1 -2
  25. package/dist/svelte.d.ts +2 -0
  26. package/dist/svelte.js +1 -2
  27. package/dist/vue.cjs +1 -2
  28. package/dist/vue.d.ts +2 -0
  29. package/dist/vue.js +1 -2
  30. package/llms.txt +15 -8
  31. package/package.json +2 -3
  32. package/dist/chunks/chunk-E66QYIQI.js +0 -135
  33. package/dist/chunks/chunk-E66QYIQI.js.map +0 -6
  34. package/dist/chunks/chunk-HCGRA6GM.js +0 -2
  35. package/dist/chunks/chunk-HCGRA6GM.js.map +0 -6
  36. package/dist/chunks/decoder-jsqr-54X2IQSI.js +0 -2
  37. package/dist/chunks/decoder-jsqr-54X2IQSI.js.map +0 -6
  38. package/dist/chunks/engine-QWSAAVKN.js +0 -2
  39. package/dist/chunks/engine-QWSAAVKN.js.map +0 -6
  40. package/dist/chunks/worker-source.generated-24WX42PC.js +0 -2
  41. package/dist/chunks/worker-source.generated-24WX42PC.js.map +0 -6
  42. package/dist/cli.d.ts +0 -17
  43. package/dist/decoder-jsqr.d.ts +0 -3
  44. package/dist/decoder-zxing.d.ts +0 -3
  45. package/dist/engine-host.d.ts +0 -48
  46. package/dist/engine.cjs +0 -1
  47. package/dist/index.cjs.map +0 -6
  48. package/dist/index.js.map +0 -6
  49. package/dist/jsqr.cjs +0 -2
  50. package/dist/jsqr.cjs.map +0 -6
  51. package/dist/kqrcode.global.js.map +0 -6
  52. package/dist/kqrcode.jsqr.js.map +0 -6
  53. package/dist/react.cjs.map +0 -6
  54. package/dist/react.js.map +0 -6
  55. package/dist/rn/index.js.map +0 -6
  56. package/dist/rn-bridge.d.ts +0 -103
  57. package/dist/rn-runtime.generated.d.ts +0 -2
  58. package/dist/sr-model.generated.d.ts +0 -4
  59. package/dist/sr.cjs.map +0 -6
  60. package/dist/sr.js.map +0 -6
  61. package/dist/svelte.cjs.map +0 -6
  62. package/dist/svelte.js.map +0 -6
  63. package/dist/vue.cjs.map +0 -6
  64. package/dist/vue.js.map +0 -6
  65. package/dist/worker-source.generated.d.ts +0 -2
  66. package/dist/worker.d.ts +0 -1
  67. package/docs/API.md +0 -292
  68. package/docs/BENCHMARK.md +0 -101
  69. package/docs/CUSTOMIZE.md +0 -150
  70. package/docs/FRAMEWORKS.md +0 -241
  71. package/docs/REACT_NATIVE.md +0 -181
  72. package/docs/TESTING.md +0 -90
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/worker-source.generated.ts"],
4
- "mappings": "4BAEA,IAAMA,EAAiB,6gqoBAChBC,EAAQD",
5
- "names": ["source", "worker_source_generated_default"]
6
- }
package/dist/cli.d.ts DELETED
@@ -1,17 +0,0 @@
1
- type Framework = 'next' | 'nuxt' | 'sveltekit' | 'svelte' | 'angular' | 'vue' | 'react-native' | 'react' | 'vanilla';
2
- type PM = 'npm' | 'pnpm' | 'yarn' | 'bun';
3
- export declare function detectFramework(pkg: Record<string, any> | null): Framework;
4
- export declare function detectPM(cwd: string): PM;
5
- interface Template {
6
- file: string;
7
- code: string;
8
- usage: string;
9
- }
10
- export declare function template(fw: Framework, opts: {
11
- ts: boolean;
12
- theme: string;
13
- locale: string;
14
- srcDir: boolean;
15
- }): Template;
16
- export declare function main(argv?: string[]): number;
17
- export {};
@@ -1,3 +0,0 @@
1
- import type { Decoder } from './engine';
2
- /** Pure-JS fallback decoder (used when WASM / workers are unavailable). Reads QR Code only, not Micro QR / rMQR. */
3
- export declare const jsqrDecoder: Decoder;
@@ -1,3 +0,0 @@
1
- import type { Decoder } from './engine';
2
- /** ZXing-C++ compiled to WASM: handles blur, low contrast, perspective, damage. ~8 ms @1080p. */
3
- export declare function createZXingDecoder(): Promise<Decoder>;
@@ -1,48 +0,0 @@
1
- /**
2
- * One decoding worker shared by every scanner on the page.
3
- *
4
- * Creating a worker means decompressing and compiling ~1 MB of WebAssembly, so instead of doing
5
- * that on every start() the worker is kept warm: it stays alive while any scanner uses it and for
6
- * `idleTimeout` ms afterwards (default 30 s). QRScanner.preload() creates it ahead of time.
7
- */
8
- import type { AnalyzeOptions, AnalyzeResult } from './engine';
9
- export type Frame = {
10
- bitmap: ImageBitmap;
11
- } | {
12
- pixels: ArrayBuffer;
13
- width: number;
14
- height: number;
15
- };
16
- export interface EngineConfig {
17
- sr: 'js' | 'webgpu' | 'off';
18
- ortUrl: string;
19
- }
20
- export declare const loadEngineSource: () => Promise<string>;
21
- declare class EngineHost {
22
- idleTimeout: number;
23
- srBackend: string;
24
- /** WASM or blob workers are unavailable (strict CSP) – callers use the main-thread fallback. */
25
- unavailable: boolean;
26
- private worker;
27
- private starting;
28
- private ready;
29
- private refs;
30
- private idleTimer;
31
- private pending;
32
- private nextId;
33
- /** Create the worker (if needed) and resolve once WASM is compiled. */
34
- warm(): Promise<void>;
35
- acquire(cfg: EngineConfig): Promise<boolean>;
36
- release(): void;
37
- analyze(frame: Frame, opts: AnalyzeOptions): Promise<AnalyzeResult | null>;
38
- get alive(): boolean;
39
- /** Terminate immediately (tests, or apps that want to free memory right away). */
40
- dispose(): void;
41
- private ensure;
42
- private spawn;
43
- private fail;
44
- private scheduleIdle;
45
- private clearIdle;
46
- }
47
- export declare const engineHost: EngineHost;
48
- export {};