@koolbase/js 12.19.0 → 12.20.0

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.
@@ -1,4 +1,4 @@
1
- export type { UseCollectionResult, UseFilesResult, UseRecordResult } from '@koolbase/core/react';
1
+ export type { UseCollectionResult, UseFileResult, UseFilesResult, UseRecordResult } from '@koolbase/core/react';
2
2
  /** A collection as React state: loading, loaded or error, with refresh and loadMore. Use it after Koolbase.initialize(). */
3
3
  export declare const useCollection: (collection: string, query?: import("@koolbase/core/dist/cjs").CollectionQuery) => import("@koolbase/core/react").UseCollectionResult;
4
4
  /** One record, by id, as React state: loading, loaded, notFound or error, with refresh. Use it after Koolbase.initialize(). */
@@ -7,3 +7,5 @@ export declare const useRecord: (collection: string, id: string | null | undefin
7
7
  }) => import("@koolbase/core/react").UseRecordResult;
8
8
  /** A bucket's files as React state, with refresh and loadMore; reloads after changes made through this SDK (storage S4). Use it after Koolbase.initialize(). */
9
9
  export declare const useFiles: (bucket: string, query?: import("@koolbase/core/dist/cjs").FilesQuery) => import("@koolbase/core/react").UseFilesResult;
10
+ /** One file's details as React state, with refresh; read again after changes made through this SDK, a deleted file notFound (storage S4). Use it after Koolbase.initialize(). */
11
+ export declare const useFile: (bucket: string, path: string | null | undefined) => import("@koolbase/core/react").UseFileResult;
package/dist/cjs/react.js CHANGED
@@ -4,7 +4,7 @@
4
4
  // React entry), bound to this package's Koolbase. A separate entry on purpose:
5
5
  // `import { Koolbase } from '@koolbase/js'` never loads React.
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.useFiles = exports.useRecord = exports.useCollection = void 0;
7
+ exports.useFile = exports.useFiles = exports.useRecord = exports.useCollection = void 0;
8
8
  const react_1 = require("@koolbase/core/react");
9
9
  const index_js_1 = require("./index.js");
10
10
  /** A collection as React state: loading, loaded or error, with refresh and loadMore. Use it after Koolbase.initialize(). */
@@ -13,3 +13,5 @@ exports.useCollection = (0, react_1.createUseCollection)(() => index_js_1.Koolba
13
13
  exports.useRecord = (0, react_1.createUseRecord)(() => index_js_1.Koolbase.db);
14
14
  /** A bucket's files as React state, with refresh and loadMore; reloads after changes made through this SDK (storage S4). Use it after Koolbase.initialize(). */
15
15
  exports.useFiles = (0, react_1.createUseFiles)(() => index_js_1.Koolbase.storage);
16
+ /** One file's details as React state, with refresh; read again after changes made through this SDK, a deleted file notFound (storage S4). Use it after Koolbase.initialize(). */
17
+ exports.useFile = (0, react_1.createUseFile)(() => index_js_1.Koolbase.storage);
@@ -1,4 +1,4 @@
1
- export type { UseCollectionResult, UseFilesResult, UseRecordResult } from '@koolbase/core/react';
1
+ export type { UseCollectionResult, UseFileResult, UseFilesResult, UseRecordResult } from '@koolbase/core/react';
2
2
  /** A collection as React state: loading, loaded or error, with refresh and loadMore. Use it after Koolbase.initialize(). */
3
3
  export declare const useCollection: (collection: string, query?: import("@koolbase/core").CollectionQuery) => import("@koolbase/core/react").UseCollectionResult;
4
4
  /** One record, by id, as React state: loading, loaded, notFound or error, with refresh. Use it after Koolbase.initialize(). */
@@ -7,3 +7,5 @@ export declare const useRecord: (collection: string, id: string | null | undefin
7
7
  }) => import("@koolbase/core/react").UseRecordResult;
8
8
  /** A bucket's files as React state, with refresh and loadMore; reloads after changes made through this SDK (storage S4). Use it after Koolbase.initialize(). */
9
9
  export declare const useFiles: (bucket: string, query?: import("@koolbase/core").FilesQuery) => import("@koolbase/core/react").UseFilesResult;
10
+ /** One file's details as React state, with refresh; read again after changes made through this SDK, a deleted file notFound (storage S4). Use it after Koolbase.initialize(). */
11
+ export declare const useFile: (bucket: string, path: string | null | undefined) => import("@koolbase/core/react").UseFileResult;
package/dist/esm/react.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // The same implementation @koolbase/react-native exports (@koolbase/core's
3
3
  // React entry), bound to this package's Koolbase. A separate entry on purpose:
4
4
  // `import { Koolbase } from '@koolbase/js'` never loads React.
5
- import { createUseCollection, createUseFiles, createUseRecord } from '@koolbase/core/react';
5
+ import { createUseCollection, createUseFile, createUseFiles, createUseRecord } from '@koolbase/core/react';
6
6
  import { Koolbase } from './index.js';
7
7
  /** A collection as React state: loading, loaded or error, with refresh and loadMore. Use it after Koolbase.initialize(). */
8
8
  export const useCollection = createUseCollection(() => Koolbase.db);
@@ -10,3 +10,5 @@ export const useCollection = createUseCollection(() => Koolbase.db);
10
10
  export const useRecord = createUseRecord(() => Koolbase.db);
11
11
  /** A bucket's files as React state, with refresh and loadMore; reloads after changes made through this SDK (storage S4). Use it after Koolbase.initialize(). */
12
12
  export const useFiles = createUseFiles(() => Koolbase.storage);
13
+ /** One file's details as React state, with refresh; read again after changes made through this SDK, a deleted file notFound (storage S4). Use it after Koolbase.initialize(). */
14
+ export const useFile = createUseFile(() => Koolbase.storage);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koolbase/js",
3
- "version": "12.19.0",
3
+ "version": "12.20.0",
4
4
  "description": "Koolbase SDK for the browser \u2014 auth, database, storage, realtime, functions, flags and offline sync in one package.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/esm/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "url": "https://github.com/koolbase/koolbase-react-native"
27
27
  },
28
28
  "dependencies": {
29
- "@koolbase/core": "12.19.0"
29
+ "@koolbase/core": "12.20.0"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"