@shiftengineering/folio 0.1.2 → 0.1.3
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
CHANGED
|
@@ -242,40 +242,40 @@ Hook for adding a new project.
|
|
|
242
242
|
|
|
243
243
|
#### `useAddFolioFiles(projectId?: number)`
|
|
244
244
|
|
|
245
|
-
Hook for adding files to a project.
|
|
245
|
+
Hook for adding files to a project. Files are always created at the root level (parentId = null) and are not directories.
|
|
246
246
|
|
|
247
|
-
| Return Property | Type
|
|
248
|
-
| --------------- |
|
|
249
|
-
| `addFiles` | `(files:
|
|
250
|
-
| `addFilesAsync` | `(files:
|
|
251
|
-
| `isAdding` | `boolean`
|
|
252
|
-
| `isError` | `boolean`
|
|
253
|
-
| `error` | `Error \| null`
|
|
254
|
-
| `newFiles` | `FolioFile[] \| undefined`
|
|
247
|
+
| Return Property | Type | Description |
|
|
248
|
+
| --------------- | ---------------------------------------------------------------------- | ---------------------------------- |
|
|
249
|
+
| `addFiles` | `(files: { blobUrl: string; name: string }[]) => void` | Function to add files |
|
|
250
|
+
| `addFilesAsync` | `(files: { blobUrl: string; name: string }[]) => Promise<FolioFile[]>` | Async version returning a promise |
|
|
251
|
+
| `isAdding` | `boolean` | Whether files are being added |
|
|
252
|
+
| `isError` | `boolean` | Whether an error occurred |
|
|
253
|
+
| `error` | `Error \| null` | Error object if an error occurred |
|
|
254
|
+
| `newFiles` | `FolioFile[] \| undefined` | The newly added files if available |
|
|
255
255
|
|
|
256
256
|
#### `useAddFolioDirectoryWithFiles(projectId?: number)`
|
|
257
257
|
|
|
258
258
|
Hook for adding a directory with files to a project. Directory names must be unique at the root level (duplicates will be silently skipped with a console warning).
|
|
259
259
|
|
|
260
|
-
| Return Property | Type
|
|
261
|
-
| ---------------------------- |
|
|
262
|
-
| `addDirectoryWithFiles` | `(params: { directoryName: string; directoryMetadata: string; files:
|
|
263
|
-
| `addDirectoryWithFilesAsync` | `(params: { directoryName: string; directoryMetadata: string; files:
|
|
264
|
-
| `isAdding` | `boolean`
|
|
265
|
-
| `isError` | `boolean`
|
|
266
|
-
| `error` | `Error \| null`
|
|
267
|
-
| `result` | `{ directory: FolioFile \| null; files: FolioFile[] } \| undefined`
|
|
260
|
+
| Return Property | Type | Description |
|
|
261
|
+
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
262
|
+
| `addDirectoryWithFiles` | `(params: { directoryName: string; directoryMetadata: string; files: { blobUrl: string; name: string }[] }) => void` | Function to add a directory with files |
|
|
263
|
+
| `addDirectoryWithFilesAsync` | `(params: { directoryName: string; directoryMetadata: string; files: { blobUrl: string; name: string }[] }) => Promise<{ directory: FolioFile \| null; files: FolioFile[] }>` | Async version returning a promise |
|
|
264
|
+
| `isAdding` | `boolean` | Whether the directory and files are being added |
|
|
265
|
+
| `isError` | `boolean` | Whether an error occurred |
|
|
266
|
+
| `error` | `Error \| null` | Error object if an error occurred |
|
|
267
|
+
| `result` | `{ directory: FolioFile \| null; files: FolioFile[] } \| undefined` | The newly added directory and files. If directory is null, it means a directory with that name already existed |
|
|
268
268
|
|
|
269
269
|
## Types
|
|
270
270
|
|
|
271
271
|
The library exports these TypeScript types:
|
|
272
272
|
|
|
273
|
-
| Type | Description
|
|
274
|
-
| -------------------- |
|
|
275
|
-
| `FolioFile` | Represents a file in Folio
|
|
276
|
-
| `FolioProject` | Represents a project in Folio
|
|
277
|
-
| `FolioEmbedProps` | Props for the FolioEmbed component
|
|
278
|
-
| `FolioProviderProps` | Props for the FolioProvider component
|
|
273
|
+
| Type | Description |
|
|
274
|
+
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
275
|
+
| `FolioFile` | Represents a file in Folio. Contains properties: `id`, `name`, `blobUrl`, `parentId` (null for root items), and `isDirectory` (boolean) |
|
|
276
|
+
| `FolioProject` | Represents a project in Folio |
|
|
277
|
+
| `FolioEmbedProps` | Props for the FolioEmbed component |
|
|
278
|
+
| `FolioProviderProps` | Props for the FolioProvider component |
|
|
279
279
|
|
|
280
280
|
## License
|
|
281
281
|
|