@simplysm/capacitor-plugin-usb-storage 13.0.0-beta.21 → 13.0.0-beta.23
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/README.md +32 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -41,6 +41,10 @@ npx cap sync
|
|
|
41
41
|
|
|
42
42
|
The main entry point of the plugin. All methods are static and operate asynchronously.
|
|
43
43
|
|
|
44
|
+
```typescript
|
|
45
|
+
import { UsbStorage } from "@simplysm/capacitor-plugin-usb-storage";
|
|
46
|
+
```
|
|
47
|
+
|
|
44
48
|
| Method | Return Type | Description |
|
|
45
49
|
|--------|-----------|------|
|
|
46
50
|
| `getDevices()` | `Promise<IUsbDeviceInfo[]>` | Retrieve list of connected USB devices |
|
|
@@ -49,8 +53,29 @@ The main entry point of the plugin. All methods are static and operate asynchron
|
|
|
49
53
|
| `readdir(filter, dirPath)` | `Promise<IUsbFileInfo[]>` | Read list of files/folders in directory |
|
|
50
54
|
| `read(filter, filePath)` | `Promise<Bytes \| undefined>` | Read file contents as binary |
|
|
51
55
|
|
|
56
|
+
### IUsbStoragePlugin (Raw Plugin Interface)
|
|
57
|
+
|
|
58
|
+
The low-level Capacitor plugin interface. Most users should use the `UsbStorage` static class instead.
|
|
59
|
+
This interface is useful for advanced scenarios such as creating custom plugin implementations.
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
import type { IUsbStoragePlugin } from "@simplysm/capacitor-plugin-usb-storage";
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
| Method | Return Type | Description |
|
|
66
|
+
|--------|-----------|------|
|
|
67
|
+
| `getDevices()` | `Promise<{ devices: IUsbDeviceInfo[] }>` | Get connected USB devices (raw) |
|
|
68
|
+
| `requestPermission(options)` | `Promise<{ granted: boolean }>` | Request USB permission (raw) |
|
|
69
|
+
| `hasPermission(options)` | `Promise<{ granted: boolean }>` | Check USB permission (raw) |
|
|
70
|
+
| `readdir(options)` | `Promise<{ files: IUsbFileInfo[] }>` | List directory contents (raw) |
|
|
71
|
+
| `read(options)` | `Promise<{ data: string \| null }>` | Read file as Base64 string (raw) |
|
|
72
|
+
|
|
52
73
|
### Interfaces
|
|
53
74
|
|
|
75
|
+
```typescript
|
|
76
|
+
import type { IUsbDeviceInfo, IUsbDeviceFilter, IUsbFileInfo } from "@simplysm/capacitor-plugin-usb-storage";
|
|
77
|
+
```
|
|
78
|
+
|
|
54
79
|
#### IUsbDeviceInfo
|
|
55
80
|
|
|
56
81
|
Represents USB device information.
|
|
@@ -187,6 +212,13 @@ In web environments, the `UsbStorageWeb` class is automatically used, providing
|
|
|
187
212
|
|
|
188
213
|
`UsbStorageWeb` provides methods for adding virtual devices and files for development and testing purposes.
|
|
189
214
|
|
|
215
|
+
> **Note**: `UsbStorageWeb` is not re-exported from the main package entry point.
|
|
216
|
+
> Import it via a deep path as shown below.
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
import { UsbStorageWeb } from "@simplysm/capacitor-plugin-usb-storage/dist/web/UsbStorageWeb";
|
|
220
|
+
```
|
|
221
|
+
|
|
190
222
|
| Method | Description |
|
|
191
223
|
|--------|------|
|
|
192
224
|
| `addVirtualDevice(device)` | Register a virtual USB device |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysm/capacitor-plugin-usb-storage",
|
|
3
|
-
"version": "13.0.0-beta.
|
|
3
|
+
"version": "13.0.0-beta.23",
|
|
4
4
|
"description": "심플리즘 패키지 - Capacitor USB Storage Plugin",
|
|
5
5
|
"author": "김석래",
|
|
6
6
|
"repository": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@simplysm/core-common": "13.0.0-beta.
|
|
25
|
+
"@simplysm/core-common": "13.0.0-beta.23"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@capacitor/core": "^7.4.4"
|