@dyrected/vue 2.5.61 → 2.5.62
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/composables/useDyrected.d.ts +15 -6
- package/dist/index.d.ts +1 -0
- package/package.json +4 -4
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { Ref, InjectionKey } from 'vue';
|
|
2
|
-
import { DyrectedClient,
|
|
2
|
+
import { DyrectedClient, SchemaShape, RegisteredSchema } from '@dyrected/sdk';
|
|
3
|
+
/** A collection slug from your registered schema (or any string until types are generated). */
|
|
4
|
+
type CollectionSlug = keyof RegisteredSchema['collections'] & string;
|
|
5
|
+
/** The document type for a given collection slug. */
|
|
6
|
+
type CollectionDoc<K extends CollectionSlug> = RegisteredSchema['collections'][K];
|
|
7
|
+
/** A global slug from your registered schema. */
|
|
8
|
+
type GlobalSlug = keyof RegisteredSchema['globals'] & string;
|
|
9
|
+
/** The data type for a given global slug. */
|
|
10
|
+
type GlobalData<K extends GlobalSlug> = RegisteredSchema['globals'][K];
|
|
3
11
|
export declare const DYRECTED_CLIENT_KEY: InjectionKey<DyrectedClient>;
|
|
4
12
|
/**
|
|
5
13
|
* useDyrectedClient — Returns the injected Dyrected client.
|
|
6
14
|
*/
|
|
7
|
-
export declare function useDyrectedClient<TSchema extends
|
|
15
|
+
export declare function useDyrectedClient<TSchema extends SchemaShape = RegisteredSchema>(): DyrectedClient<TSchema>;
|
|
8
16
|
/**
|
|
9
17
|
* provideDyrectedClient — Provides a Dyrected client to the Vue app.
|
|
10
18
|
*/
|
|
11
19
|
export declare function provideDyrectedClient(client: DyrectedClient): {
|
|
12
|
-
[x: number]: DyrectedClient<BaseSchema>;
|
|
20
|
+
[x: number]: DyrectedClient<import('@dyrected/sdk').BaseSchema>;
|
|
13
21
|
};
|
|
14
22
|
export interface UseDyrectedOptions {
|
|
15
23
|
depth?: number;
|
|
@@ -18,7 +26,7 @@ export interface UseDyrectedOptions {
|
|
|
18
26
|
/**
|
|
19
27
|
* useDyrected — Reactive composable for fetching a single document.
|
|
20
28
|
*/
|
|
21
|
-
export declare function useDyrected<T =
|
|
29
|
+
export declare function useDyrected<K extends CollectionSlug, T = CollectionDoc<K>>(collection: K, idOrSlug: string, options?: UseDyrectedOptions): {
|
|
22
30
|
doc: Ref<T | null, T | null>;
|
|
23
31
|
pending: Ref<boolean, boolean>;
|
|
24
32
|
error: Ref<any, any>;
|
|
@@ -27,7 +35,7 @@ export declare function useDyrected<T = any>(collection: string, idOrSlug: strin
|
|
|
27
35
|
/**
|
|
28
36
|
* useDyrectedCollection — Reactive composable for fetching a collection.
|
|
29
37
|
*/
|
|
30
|
-
export declare function useDyrectedCollection<T =
|
|
38
|
+
export declare function useDyrectedCollection<K extends CollectionSlug, T = CollectionDoc<K>>(collection: K, options?: UseDyrectedOptions): {
|
|
31
39
|
docs: Ref<T[], T[]>;
|
|
32
40
|
pending: Ref<boolean, boolean>;
|
|
33
41
|
error: Ref<any, any>;
|
|
@@ -36,9 +44,10 @@ export declare function useDyrectedCollection<T = any>(collection: string, optio
|
|
|
36
44
|
/**
|
|
37
45
|
* useDyrectedGlobal — Reactive composable for fetching a global.
|
|
38
46
|
*/
|
|
39
|
-
export declare function useDyrectedGlobal<T =
|
|
47
|
+
export declare function useDyrectedGlobal<K extends GlobalSlug, T = GlobalData<K>>(slug: K, options?: UseDyrectedOptions): {
|
|
40
48
|
data: Ref<T | null, T | null>;
|
|
41
49
|
pending: Ref<boolean, boolean>;
|
|
42
50
|
error: Ref<any, any>;
|
|
43
51
|
refresh: () => Promise<void>;
|
|
44
52
|
};
|
|
53
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -11,3 +11,4 @@ export * from './composables/useDyrectedAuth';
|
|
|
11
11
|
export * from './composables/useDyPath';
|
|
12
12
|
export * from './bridge/react-in-vue';
|
|
13
13
|
export { getPreviewToken, PREVIEW_TOKEN_PARAM } from '@dyrected/sdk';
|
|
14
|
+
export type { Register, RegisteredSchema, BaseSchema, InferSchema } from '@dyrected/sdk';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dyrected/vue",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.62",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"lucide-vue-next": "^1.0.0",
|
|
22
22
|
"react": "^18.0.0 || ^19.0.0",
|
|
23
23
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
24
|
-
"@dyrected/
|
|
25
|
-
"@dyrected/
|
|
26
|
-
"@dyrected/
|
|
24
|
+
"@dyrected/core": "2.5.62",
|
|
25
|
+
"@dyrected/sdk": "2.5.62",
|
|
26
|
+
"@dyrected/admin": "2.5.62"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"react": ">=18.0.0",
|