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.
@@ -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
- sdk.cardFS.write("my-journal.json", { text: "Hello" }, (update) => {
120
- console.debug("Upload status", update.status, update.progress);
121
- });
122
- ```
123
-
124
- - `write(name, fileData, onUpdate?)`
125
- - `writeById(iuid, fileData, onUpdate?)`
126
-
127
- `write` and `writeById` upload new data for a file and optionally report progress through `onUpdate`.
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dome-embedded-app-sdk",
3
- "version": "0.3.4",
3
+ "version": "0.3.5-experimental.2",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",