@chipmobilesdk/rn-camera 0.1.0 → 0.1.1
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.
- package/package.json +10 -9
- package/skills/sdk-rn-camera/SKILL.md +71 -0
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chipmobilesdk/rn-camera",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"private": false,
|
|
5
|
-
"license": "UNLICENSED",
|
|
6
|
-
"main": "src/index.ts",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
7
|
"types": "src/index.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"src/react",
|
|
24
24
|
"src/storage",
|
|
25
25
|
"src/testing",
|
|
26
|
+
"skills",
|
|
26
27
|
"README.md",
|
|
27
28
|
"CHANGELOG.md"
|
|
28
29
|
],
|
|
@@ -39,8 +40,8 @@
|
|
|
39
40
|
"engines": {
|
|
40
41
|
"node": ">=22.11.0"
|
|
41
42
|
},
|
|
42
|
-
"publishConfig": {
|
|
43
|
-
"access": "public",
|
|
44
|
-
"registry": "https://registry.npmjs.org/"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public",
|
|
45
|
+
"registry": "https://registry.npmjs.org/"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sdk-rn-camera
|
|
3
|
+
description: "Camera capture via @chipmobilesdk/rn-camera: controller, VisionCamera engine, permissions, artifact storage, hardware-free testing. Use when adding capture/preview, handling camera permissions, storing captures, or writing camera tests."
|
|
4
|
+
metadata:
|
|
5
|
+
package: "@chipmobilesdk/rn-camera"
|
|
6
|
+
packageVersion: "0.1.0"
|
|
7
|
+
user-invocable: true
|
|
8
|
+
disable-model-invocation: false
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# @chipmobilesdk/rn-camera
|
|
12
|
+
|
|
13
|
+
Camera capture built on VisionCamera, with an injectable engine, a permission port,
|
|
14
|
+
artifact storage for captures, and a test double that needs no hardware.
|
|
15
|
+
|
|
16
|
+
## Use this when
|
|
17
|
+
|
|
18
|
+
- Adding a capture or preview screen
|
|
19
|
+
- Requesting/handling camera permissions
|
|
20
|
+
- Persisting captured images and managing their lifetime
|
|
21
|
+
- Writing tests for a camera flow
|
|
22
|
+
- Answering a privacy/data-safety question about captures
|
|
23
|
+
|
|
24
|
+
## Release the camera on unmount
|
|
25
|
+
|
|
26
|
+
The camera is a hardware resource. It MUST be released when the screen loses focus or
|
|
27
|
+
unmounts — a retained camera drains battery and blocks other screens from acquiring it.
|
|
28
|
+
Verify teardown explicitly; this is the most common defect in camera code.
|
|
29
|
+
|
|
30
|
+
## Captures expire
|
|
31
|
+
|
|
32
|
+
`DEFAULT_TEMPORARY_TTL_MS` exists because cache-stored captures are temporary. If a
|
|
33
|
+
capture must survive, move it out of the cache store deliberately — do not assume
|
|
34
|
+
persistence. See `## Data behaviour` for what this means for App Privacy disclosures.
|
|
35
|
+
|
|
36
|
+
## Test without hardware
|
|
37
|
+
|
|
38
|
+
`createTestCamera`, `createMemoryFileSystem` and `DEFAULT_TEST_CAPABILITIES` let camera
|
|
39
|
+
flows be unit-tested with no device. Use these rather than mocking VisionCamera by hand —
|
|
40
|
+
see `## Testing without hardware`.
|
|
41
|
+
|
|
42
|
+
## Public API (v0.1.0)
|
|
43
|
+
|
|
44
|
+
Runtime:
|
|
45
|
+
|
|
46
|
+
- `createCameraController(...)`, `useCameraController`, `useCameraState`
|
|
47
|
+
- `createVisionCameraEngine(...)` — the default `CameraEngine`; injectable
|
|
48
|
+
- `createVisionCameraPermissions(...)` — implements `PermissionPort`
|
|
49
|
+
- `createArtifactStore(...)`, `createCacheArtifactStore(...)`
|
|
50
|
+
- `CameraPreview` (+ `CameraPreviewProps`)
|
|
51
|
+
- `CameraError`, `isCameraError`, `redact` — `redact` strips sensitive paths before logging
|
|
52
|
+
- Testing: `createTestCamera`, `createMemoryFileSystem`, `DEFAULT_TEST_CAPABILITIES`
|
|
53
|
+
|
|
54
|
+
Types: `CameraEngine`, `EngineOptions`, `PermissionPort`, `ArtifactStore`,
|
|
55
|
+
`FileSystemBridge`, `StoreOptions`, `CameraErrorCode`, `CameraLogEvent`,
|
|
56
|
+
`CameraLogEventType`, `CameraLogger`
|
|
57
|
+
|
|
58
|
+
Always pass camera log payloads through `redact` before logging.
|
|
59
|
+
|
|
60
|
+
## Where the detail lives
|
|
61
|
+
|
|
62
|
+
Read one section of `node_modules/@chipmobilesdk/rn-camera/README.md` (~340 lines):
|
|
63
|
+
|
|
64
|
+
| Need | Section |
|
|
65
|
+
|---|---|
|
|
66
|
+
| First integration | `## Install (consuming app)`, `## Quick start` |
|
|
67
|
+
| Engine / port / store model | `## Core concepts` |
|
|
68
|
+
| Tests | `## Testing without hardware` |
|
|
69
|
+
| Failure handling | `## Errors`, `## Diagnostics` |
|
|
70
|
+
| Privacy disclosures | `## Data behaviour (for App Privacy and Data Safety)` |
|
|
71
|
+
| Native config | `## Native capability`, `## Compatibility` |
|