@flyo/nitro-vue3 2.0.0 → 2.1.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.
- package/dist/index.d.ts +72 -0
- package/package.json +6 -2
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { App, Component, Ref } from 'vue'
|
|
2
|
+
import type {
|
|
3
|
+
Configuration,
|
|
4
|
+
ConfigApi,
|
|
5
|
+
EntitiesApi,
|
|
6
|
+
PagesApi,
|
|
7
|
+
SitemapApi
|
|
8
|
+
} from '@flyo/nitro-typescript'
|
|
9
|
+
|
|
10
|
+
export interface FlyoVuePluginOptions {
|
|
11
|
+
apiToken: string
|
|
12
|
+
apiBasePath?: string
|
|
13
|
+
defaultHeaders?: Record<string, string>
|
|
14
|
+
liveEdit?: boolean
|
|
15
|
+
liveEditOrigin?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface FlyoFetchResult<T> {
|
|
19
|
+
response: T | null
|
|
20
|
+
error: unknown | null
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type FlyoConfigResponse = Awaited<ReturnType<ConfigApi['config']>>
|
|
24
|
+
export type FlyoPageResponse = Awaited<ReturnType<PagesApi['page']>>
|
|
25
|
+
export type FlyoEntityResponse = Awaited<ReturnType<EntitiesApi['entityByUniqueid']>>
|
|
26
|
+
export type FlyoSitemapResponse = Awaited<ReturnType<SitemapApi['sitemap']>>
|
|
27
|
+
|
|
28
|
+
export interface UseFlyoConfigReturn {
|
|
29
|
+
isLoading: Ref<boolean | null>
|
|
30
|
+
response: Ref<FlyoConfigResponse | null>
|
|
31
|
+
error: Ref<unknown | null>
|
|
32
|
+
fetch: () => Promise<FlyoFetchResult<FlyoConfigResponse>>
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface UseFlyoPageReturn {
|
|
36
|
+
isLoading: Ref<boolean>
|
|
37
|
+
response: Ref<FlyoPageResponse | null>
|
|
38
|
+
error: Ref<unknown | null>
|
|
39
|
+
fetch: () => Promise<FlyoFetchResult<FlyoPageResponse>>
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface UseFlyoEntityReturn {
|
|
43
|
+
isLoading: Ref<boolean>
|
|
44
|
+
response: Ref<FlyoEntityResponse | null>
|
|
45
|
+
error: Ref<unknown | null>
|
|
46
|
+
fetch: () => Promise<FlyoFetchResult<FlyoEntityResponse>>
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface UseFlyoSitemapReturn {
|
|
50
|
+
isLoading: Ref<boolean>
|
|
51
|
+
response: Ref<FlyoSitemapResponse | null>
|
|
52
|
+
error: Ref<unknown | null>
|
|
53
|
+
fetch: () => Promise<FlyoFetchResult<FlyoSitemapResponse>>
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface FlyoVuePlugin {
|
|
57
|
+
install: (app: App, options: FlyoVuePluginOptions) => void
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
declare const FlyoVue: FlyoVuePlugin
|
|
61
|
+
declare const Block: Component
|
|
62
|
+
declare const Page: Component
|
|
63
|
+
|
|
64
|
+
export default FlyoVue
|
|
65
|
+
export { FlyoVue, Block, Page }
|
|
66
|
+
|
|
67
|
+
export function getFlyoConfig(): Configuration | null
|
|
68
|
+
|
|
69
|
+
export function useFlyoConfig(): UseFlyoConfigReturn
|
|
70
|
+
export function useFlyoPage(slug: string): UseFlyoPageReturn
|
|
71
|
+
export function useFlyoEntity(uniqueid: string): UseFlyoEntityReturn
|
|
72
|
+
export function useFlyoSitemap(): UseFlyoSitemapReturn
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flyo/nitro-vue3",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Vue3 Components for Flyo Nitro",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
9
11
|
"import": "./dist/index.mjs",
|
|
10
12
|
"require": "./dist/index.cjs"
|
|
11
13
|
}
|
|
@@ -18,7 +20,9 @@
|
|
|
18
20
|
"dist"
|
|
19
21
|
],
|
|
20
22
|
"scripts": {
|
|
21
|
-
"build": "vite build",
|
|
23
|
+
"build": "vite build && npm run build:types",
|
|
24
|
+
"build:types": "node scripts/build-types.mjs",
|
|
25
|
+
"prepublishOnly": "npm run build",
|
|
22
26
|
"test": "vitest run",
|
|
23
27
|
"test:watch": "vitest",
|
|
24
28
|
"release": "npm publish --access=public"
|