dome-embedded-app-sdk 0.3.4 → 0.3.5-experimental.2
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/dist/card-sdk.d.ts +15 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types/card-sdk.types.d.ts +5 -0
- package/docs/card-sdk.md +14 -10
- package/package.json +1 -1
|
@@ -131,6 +131,11 @@ export type CardRefreshRequestPayload = Record<string, any>;
|
|
|
131
131
|
* Callback signature for cardFS updates.
|
|
132
132
|
*/
|
|
133
133
|
export type CardFsCallback<T = any> = (payload: T) => void;
|
|
134
|
+
export declare enum CardFsFileType {
|
|
135
|
+
TEXT = "text",
|
|
136
|
+
JSON = "json",
|
|
137
|
+
BINARY = "binary"
|
|
138
|
+
}
|
|
134
139
|
/**
|
|
135
140
|
* CardFS error codes.
|
|
136
141
|
*/
|
package/docs/card-sdk.md
CHANGED
|
@@ -115,16 +115,20 @@ sdk.cardFS.read("my-journal.json", {
|
|
|
115
115
|
|
|
116
116
|
### Write
|
|
117
117
|
|
|
118
|
-
```JavaScript
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
118
|
+
```JavaScript
|
|
119
|
+
import { CardFsFileType } from "dome-embedded-app-sdk";
|
|
120
|
+
|
|
121
|
+
sdk.cardFS.write("my-journal.json", { text: "Hello" }, CardFsFileType.JSON, (update) => {
|
|
122
|
+
console.debug("Upload status", update.status, update.progress);
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
- `write(name, fileData, fileType, onUpdate?)`
|
|
127
|
+
- `writeById(iuid, fileData, fileType, onUpdate?)`
|
|
128
|
+
|
|
129
|
+
`write` and `writeById` upload new data for a file and optionally report progress through `onUpdate`.
|
|
130
|
+
|
|
131
|
+
`fileType` can be `CardFsFileType.JSON`, `CardFsFileType.TEXT`, or `CardFsFileType.BINARY`.
|
|
128
132
|
|
|
129
133
|
`onUpdate` receives `{ status, progress, uploaded_bytes }` when available.
|
|
130
134
|
|