@simplysm/capacitor-plugin-file-system 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 +15 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -66,6 +66,10 @@ import { FileSystem } from "@simplysm/capacitor-plugin-file-system";
|
|
|
66
66
|
|
|
67
67
|
### Type Definitions
|
|
68
68
|
|
|
69
|
+
```typescript
|
|
70
|
+
import type { TStorage, IFileInfo } from "@simplysm/capacitor-plugin-file-system";
|
|
71
|
+
```
|
|
72
|
+
|
|
69
73
|
#### `TStorage`
|
|
70
74
|
|
|
71
75
|
A string literal type representing storage types.
|
|
@@ -89,6 +93,14 @@ interface IFileInfo {
|
|
|
89
93
|
}
|
|
90
94
|
```
|
|
91
95
|
|
|
96
|
+
#### `IFileSystemPlugin`
|
|
97
|
+
|
|
98
|
+
The low-level Capacitor plugin interface. Not intended for direct use -- use the `FileSystem` static class instead.
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
import type { IFileSystemPlugin } from "@simplysm/capacitor-plugin-file-system";
|
|
102
|
+
```
|
|
103
|
+
|
|
92
104
|
## Usage Examples
|
|
93
105
|
|
|
94
106
|
### Check and Request Permission
|
|
@@ -132,6 +144,7 @@ async function textFileExample(): Promise<void> {
|
|
|
132
144
|
|
|
133
145
|
```typescript
|
|
134
146
|
import { FileSystem } from "@simplysm/capacitor-plugin-file-system";
|
|
147
|
+
import type { Bytes } from "@simplysm/core-common";
|
|
135
148
|
|
|
136
149
|
async function binaryFileExample(): Promise<void> {
|
|
137
150
|
const storagePath = await FileSystem.getStoragePath("appFiles");
|
|
@@ -141,8 +154,8 @@ async function binaryFileExample(): Promise<void> {
|
|
|
141
154
|
const bytes = new Uint8Array([0x48, 0x65, 0x6c, 0x6c, 0x6f]);
|
|
142
155
|
await FileSystem.writeFile(filePath, bytes);
|
|
143
156
|
|
|
144
|
-
// Read as
|
|
145
|
-
const readBytes = await FileSystem.readFileBytes(filePath);
|
|
157
|
+
// Read as Bytes (Uint8Array alias from @simplysm/core-common)
|
|
158
|
+
const readBytes: Bytes = await FileSystem.readFileBytes(filePath);
|
|
146
159
|
console.log(readBytes.length); // 5
|
|
147
160
|
}
|
|
148
161
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysm/capacitor-plugin-file-system",
|
|
3
|
-
"version": "13.0.0-beta.
|
|
3
|
+
"version": "13.0.0-beta.23",
|
|
4
4
|
"description": "심플리즘 패키지 - Capacitor File System 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"
|