Skip to content

Commit cc200c4

Browse files
authored
feat: export component prop types
See: #462 #460
1 parent 442446a commit cc200c4

File tree

10 files changed

+220
-58
lines changed

10 files changed

+220
-58
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
VITEPRESS_BASE: /vue-qrcode-reader/
2626
run: |
2727
pnpm install
28+
pnpm run type-check
2829
pnpm run build
2930
pnpm run docs:build
3031
- name: Deploy Docs

docs/api/QrcodeStream.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ When you unpause the camera is restarted so the `camera-on` event is emitted aga
223223

224224
### `track`
225225

226-
- **Input Type:** `Function`
226+
- **Input Type:** `(codes: DetectedBarcode[], ctx: CanvasRenderingContext2D) => void`
227227
- **Default:** `undefined`
228228

229229
You can visually highlight detected QR codes in real-time.
@@ -232,12 +232,13 @@ When a QR code is detected, its location is painted to the canvas.
232232

233233
To enable this feature, pass a function to `track` that defines how this should look like.
234234
This function is called to produce each frame.
235-
It receives the location object as the first argument and a `CanvasRenderingContext2D` instance as the second argument.
235+
It receives an array of detected barcodes as the first argument and a `CanvasRenderingContext2D` instance as the second argument.
236236

237237
For example check out [this demo](../demos/FullDemo.md).
238238

239-
Note that this scanning frequency has to be increased.
240-
So if you want to go easy on your target device you might not want to enable tracking.
239+
Note that the scanning frequency is increased when you provide a track function,
240+
which might hurt performance perceptibly.
241+
So if you want to go easy on your target device you might want to keep tracking disabled.
241242

242243
::: danger
243244
Avoid access to reactive properties in this function (like stuff in `data`, `computed` or your Vuex store). The function is called several times a second and might cause memory leaks. To be safe don't access `this` at all.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"vite-plugin-dts": "3.6.4",
5959
"vitepress": "1.0.0-rc.32",
6060
"vue": "3.3.13",
61-
"vue-tsc": "1.8.25",
61+
"vue-tsc": "2.1.10",
6262
"workbox-window": "7.0.0"
6363
},
6464
"bugs": "https://github.com/gruhn/vue-qrcode-reader/issues",

0 commit comments

Comments
 (0)