@civet/core 2.1.2 → 3.0.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
- import { GenericDataProvider, InferItem, InferMetaType, InferOptions, InferQuery, Persistence, ResourceContextValue } from './DataProvider';
1
+ import { GenericDataProvider, InferGetResult, InferMetaType, InferOptions, InferQuery, Persistence, ResourceContextValue } from './DataProvider';
2
2
  /**
3
3
  * Provides data based on the given request details and DataProvider.
4
4
  *
@@ -6,7 +6,7 @@ import { GenericDataProvider, InferItem, InferMetaType, InferOptions, InferQuery
6
6
  *
7
7
  * The provided DataProvider must not be changed.
8
8
  */
9
- export default function useResource<DataProviderI extends GenericDataProvider, ItemI extends InferItem<DataProviderI> = InferItem<DataProviderI>, QueryI extends InferQuery<DataProviderI> = InferQuery<DataProviderI>, OptionsI extends InferOptions<DataProviderI> = InferOptions<DataProviderI>, MetaTypeI extends InferMetaType<DataProviderI> = InferMetaType<DataProviderI>>({ dataProvider: dataProviderProp, name: nextName, query: nextQuery, empty: nextEmpty, options: nextOptions, persistent: nextPersistent, ...rest }: {
9
+ export default function useResource<DataProviderI extends GenericDataProvider, GetResultI extends InferGetResult<DataProviderI> = InferGetResult<DataProviderI>, QueryI extends InferQuery<DataProviderI> = InferQuery<DataProviderI>, OptionsI extends InferOptions<DataProviderI> = InferOptions<DataProviderI>, MetaTypeI extends InferMetaType<DataProviderI> = InferMetaType<DataProviderI>>({ dataProvider: dataProviderProp, name: nextName, query: nextQuery, empty: nextEmpty, options: nextOptions, persistent: nextPersistent, ...rest }: {
10
10
  /** DataProvider to be used for requests - must not be changed */
11
11
  dataProvider?: DataProviderI;
12
12
  /** Resource name */
@@ -20,4 +20,4 @@ export default function useResource<DataProviderI extends GenericDataProvider, I
20
20
  /** Whether stale data should be retained during the next request - this only applies if name did not change, unless set to "very" */
21
21
  persistent?: Persistence;
22
22
  [rest: string]: unknown;
23
- }): ResourceContextValue<DataProviderI, ItemI, QueryI, OptionsI, MetaTypeI>;
23
+ }): ResourceContextValue<DataProviderI, GetResultI, QueryI, OptionsI, MetaTypeI>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@civet/core",
3
- "version": "2.1.2",
3
+ "version": "3.0.0",
4
4
  "description": "Civet",
5
5
  "author": {
6
6
  "name": "Aaron Burmeister"
@@ -28,7 +28,10 @@
28
28
  "types": "./dist/main.d.ts",
29
29
  "exports": {
30
30
  ".": {
31
- "import": "./dist/main.js"
31
+ "import": {
32
+ "types": "./dist/main.d.ts",
33
+ "default": "./dist/main.js"
34
+ }
32
35
  }
33
36
  },
34
37
  "scripts": {
@@ -45,34 +48,34 @@
45
48
  "@types/object-hash": "^3.0.6",
46
49
  "fast-deep-equal": "^3.1.3",
47
50
  "object-hash": "^3.0.0",
48
- "uuid": "^11.1.0"
51
+ "uuid": "^13.0.0"
49
52
  },
50
53
  "peerDependencies": {
51
54
  "react": ">=18.0",
52
55
  "react-dom": ">=18.0"
53
56
  },
54
57
  "devDependencies": {
55
- "@eslint/js": "^9.32.0",
58
+ "@eslint/js": "^9.35.0",
56
59
  "@types/react": "^19.1.12",
57
60
  "@types/react-dom": "^19.1.9",
58
61
  "@vitejs/plugin-react": "^5.0.2",
59
- "eslint": "^9.34.0",
62
+ "eslint": "^9.35.0",
60
63
  "eslint-config-prettier": "^10.1.8",
61
64
  "eslint-import-resolver-alias": "^1.1.2",
62
65
  "eslint-import-resolver-typescript": "^4.4.4",
63
66
  "eslint-plugin-import": "^2.32.0",
64
67
  "eslint-plugin-prettier": "^5.5.4",
65
- "eslint-plugin-react-hooks": "^5.2.0",
66
- "eslint-plugin-react-refresh": "^0.4.20",
68
+ "eslint-plugin-react-hooks": "^7.0.1",
69
+ "eslint-plugin-react-refresh": "^0.5.0",
67
70
  "eslint-plugin-unused-imports": "^4.2.0",
68
- "globals": "^16.3.0",
71
+ "globals": "^17.3.0",
69
72
  "prettier": "^3.6.2",
70
73
  "react": "^19.1.1",
71
74
  "react-dom": "^19.1.1",
72
75
  "typescript": "^5.9.2",
73
- "typescript-eslint": "^8.41.0",
74
- "vite": "^7.1.3",
76
+ "typescript-eslint": "^8.43.0",
77
+ "vite": "^7.1.5",
75
78
  "vite-plugin-dts": "^4.5.4",
76
- "vite-tsconfig-paths": "^5.1.4"
79
+ "vite-tsconfig-paths": "^6.1.1"
77
80
  }
78
81
  }