@fangzhongya/vue-archive 0.0.76 → 0.0.78

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.
Files changed (33) hide show
  1. package/dist/node/index.cjs +145 -108
  2. package/dist/node/index.js +145 -108
  3. package/dist/packages/components/use/code.cjs +12 -12
  4. package/dist/packages/components/use/code.d.ts +25 -17
  5. package/dist/packages/components/use/code.js +92 -92
  6. package/dist/packages/components/use/edit.cjs +5 -5
  7. package/dist/packages/components/use/edit.js +63 -63
  8. package/dist/packages/components/use/retrie/any/index.vue.cjs +1 -1
  9. package/dist/packages/components/use/retrie/any/index.vue.js +27 -49
  10. package/dist/packages/components/use/retrie/choice/index.d.ts +33 -2
  11. package/dist/packages/components/use/retrie/choice/index.vue.cjs +1 -1
  12. package/dist/packages/components/use/retrie/choice/index.vue.js +24 -27
  13. package/dist/packages/components/use/retrie/index.vue.cjs +1 -1
  14. package/dist/packages/components/use/retrie/index.vue.js +12 -12
  15. package/dist/packages/components/use/retrie/input/codemirror/codemirror.d.ts +41 -0
  16. package/dist/packages/components/use/retrie/input/editor/editor.cjs +1 -1
  17. package/dist/packages/components/use/retrie/input/editor/editor.js +50 -29
  18. package/dist/packages/components/use/retrie/input/editor/getExtraLib.cjs +416 -0
  19. package/dist/packages/components/use/retrie/input/editor/getExtraLib.d.ts +2 -0
  20. package/dist/packages/components/use/retrie/input/editor/getExtraLib.js +427 -0
  21. package/dist/packages/components/use/retrie/other/index.d.ts +13 -12
  22. package/dist/packages/components/use/retrie/other/index.vue.cjs +1 -1
  23. package/dist/packages/components/use/retrie/other/index.vue.js +1 -1
  24. package/dist/packages/components/use/retrie/select/index.d.ts +33 -2
  25. package/dist/packages/components/use/retrie/select/index.vue.cjs +1 -1
  26. package/dist/packages/components/use/retrie/select/index.vue.js +26 -26
  27. package/dist/packages/components/use/set-props.d.ts +1 -1
  28. package/dist/packages/components/use/set-props.vue.cjs +1 -1
  29. package/dist/packages/components/use/set-props.vue.js +21 -24
  30. package/dist/packages/components/use/util.cjs +3 -3
  31. package/dist/packages/components/use/util.d.ts +23 -25
  32. package/dist/packages/components/use/util.js +161 -136
  33. package/package.json +2 -2
@@ -16,3 +16,44 @@ export declare function getHtml(parent: Element, obj: CreateStateOptions): Edito
16
16
  export declare function getJson(parent: Element, obj: CreateStateOptions): EditorView;
17
17
  export declare function getCss(parent: Element, obj: CreateStateOptions): EditorView;
18
18
  export {};
19
+ >): Promise<T[]>;
20
+ fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
21
+ readonly [Symbol.species]: ArrayConstructor;
22
+ };
23
+ };
24
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
25
+ "update:modelValue": (...args: any[]) => void;
26
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
27
+ modelValue: {
28
+ type: StringConstructor;
29
+ default: string;
30
+ };
31
+ format: {
32
+ type: StringConstructor;
33
+ };
34
+ options: {
35
+ type: {
36
+ (arrayLength: number): string[];
37
+ (...items: string[]): string[];
38
+ new (arrayLength: number): string[];
39
+ new (...items: string[]): string[];
40
+ isArray(arg: any): arg is any[];
41
+ readonly prototype: any[];
42
+ from<T>(arrayLike: ArrayLike<T>): T[];
43
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
44
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
45
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
46
+ of<T>(...items: T[]): T[];
47
+ fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
48
+ fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
49
+ readonly [Symbol.species]: ArrayConstructor;
50
+ };
51
+ };
52
+ }>> & Readonly<{
53
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
54
+ }>, {
55
+ modelValue: string;
56
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {
57
+ refText: HTMLDivElement;
58
+ }, HTMLDivElement>;
59
+ export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("monaco-editor"),i=require("monaco-editor/esm/vs/editor/editor.api"),u=require("vue");function l(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const n=l(c),g=l(u),a={theme:"vs",value:""},m=(e=[])=>({provideCompletionItems:(r,t)=>({suggestions:e.map(o=>({label:o,kind:n.languages.CompletionItemKind.Text,insertText:"<"+o+">${1:}</"+o+">",insertTextRules:n.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:o+"组件",range:new n.Range(t.lineNumber,t.column-1,t.lineNumber,t.column)}))}),triggerCharacters:["<","$"]});function p(e){return["props","ctx"].includes(e)?e+".${1:}":e+"(${1:})"}const d=(e=[])=>(e&&e.length>0&&(e=["props","ctx",...Object.keys(g)]),{provideCompletionItems:(r,t)=>({suggestions:e.map(o=>({label:o,kind:n.languages.CompletionItemKind.Text,insertText:p(o),insertTextRules:n.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:o+"方法",range:new n.Range(t.lineNumber,t.column-1,t.lineNumber,t.column)}))}),triggerCharacters:["$"]});function f(e,r,t){i.languages.typescript.typescriptDefaults.setEagerModelSync(!0);const s=d(t);return i.languages.registerCompletionItemProvider("typescript",s),n.editor.create(e,{...a,value:r,language:"typescript"})}function b(e,r,t){const s=m(t);return i.languages.registerCompletionItemProvider("html",s),n.editor.create(e,{...a,value:r,language:"html"})}function v(e,r,t){return n.editor.create(e,{...a,value:r,language:"json"})}function I(e,r,t){return n.editor.create(e,{...a,value:r,language:"css"})}exports.getCss=I;exports.getHtml=b;exports.getJs=f;exports.getJson=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("monaco-editor"),o=require("monaco-editor/esm/vs/editor/editor.api"),g=require("vue"),l=require("./getExtraLib.cjs");function c(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const n=c(u),m=c(g),i={theme:"vs",value:""},p=(e=[])=>({provideCompletionItems:(r,t)=>({suggestions:e.map(s=>({label:s,kind:n.languages.CompletionItemKind.Text,insertText:"<"+s+">${1:}</"+s+">",insertTextRules:n.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:s+"组件",range:new n.Range(t.lineNumber,t.column-1,t.lineNumber,t.column)}))}),triggerCharacters:["<","$"]});function d(e){return["props","ctx"].includes(e)?e+".${1:}":e+"(${1:})"}const f=(e=[])=>(e&&e.length>0&&(e=["props","ctx",...Object.keys(m)]),{provideCompletionItems:(r,t)=>({suggestions:e.map(s=>({label:s,kind:n.languages.CompletionItemKind.Text,insertText:d(s),insertTextRules:n.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:s+"方法",range:new n.Range(t.lineNumber,t.column-1,t.lineNumber,t.column)}))}),triggerCharacters:["$"]});function b(e,r,t="typescript"){const a=n.Uri.parse(`file:///editor-${Date.now()}.ts`),s=n.editor.createModel(r,t,a);return n.editor.create(e,{...i,value:r,model:s,language:t,minimap:{enabled:!1},theme:"vs",fontSize:14,lineNumbers:"on",roundedSelection:!1,scrollBeyondLastLine:!1,automaticLayout:!0})}function y(e,r,t){if(o.languages.typescript.typescriptDefaults.setEagerModelSync(!0),t&&t?.length>0){const a=f(t);o.languages.registerCompletionItemProvider("typescript",a),o.languages.typescript.typescriptDefaults.setExtraLibs([]),o.languages.typescript.typescriptDefaults.addExtraLib(l.getGlobals(),"globals.d.ts"),o.languages.typescript.typescriptDefaults.addExtraLib(l.getVue(),"vue.d.ts")}return b(e,r,"typescript")}function v(e,r,t){const a=p(t);return o.languages.registerCompletionItemProvider("html",a),n.editor.create(e,{...i,value:r,language:"html"})}function x(e,r,t){return n.editor.create(e,{...i,value:r,language:"json"})}function I(e,r,t){return n.editor.create(e,{...i,value:r,language:"css"})}exports.getCss=I;exports.getHtml=v;exports.getJs=y;exports.getJson=x;
@@ -1,19 +1,20 @@
1
1
  import * as n from "monaco-editor";
2
- import { languages as l } from "monaco-editor/esm/vs/editor/editor.api";
2
+ import { languages as o } from "monaco-editor/esm/vs/editor/editor.api";
3
3
  import * as a from "vue";
4
- const i = {
4
+ import { getGlobals as c, getVue as m } from "./getExtraLib.js";
5
+ const l = {
5
6
  theme: "vs",
6
7
  value: ""
7
- }, m = (e = []) => ({
8
- provideCompletionItems: (r, t) => ({ suggestions: e.map((o) => ({
9
- label: o,
8
+ }, u = (e = []) => ({
9
+ provideCompletionItems: (r, t) => ({ suggestions: e.map((s) => ({
10
+ label: s,
10
11
  // 显示名称
11
12
  kind: n.languages.CompletionItemKind.Text,
12
13
  // 图标类型
13
- insertText: "<" + o + ">${1:}</" + o + ">",
14
+ insertText: "<" + s + ">${1:}</" + s + ">",
14
15
  //`<${s}>$</${s}>`, // 插入的文本(支持代码片段)
15
16
  insertTextRules: n.languages.CompletionItemInsertTextRule.InsertAsSnippet,
16
- detail: o + "组件",
17
+ detail: s + "组件",
17
18
  // 描述
18
19
  range: new n.Range(
19
20
  // 定义替换范围(可选)
@@ -25,18 +26,18 @@ const i = {
25
26
  })) }),
26
27
  triggerCharacters: ["<", "$"]
27
28
  });
28
- function u(e) {
29
+ function p(e) {
29
30
  return ["props", "ctx"].includes(e) ? e + ".${1:}" : e + "(${1:})";
30
31
  }
31
- const c = (e = []) => (e && e.length > 0 && (e = ["props", "ctx", ...Object.keys(a)]), {
32
- provideCompletionItems: (r, t) => ({ suggestions: e.map((o) => ({
33
- label: o,
32
+ const d = (e = []) => (e && e.length > 0 && (e = ["props", "ctx", ...Object.keys(a)]), {
33
+ provideCompletionItems: (r, t) => ({ suggestions: e.map((s) => ({
34
+ label: s,
34
35
  // 显示名称
35
36
  kind: n.languages.CompletionItemKind.Text,
36
37
  // 图标类型
37
- insertText: u(o),
38
+ insertText: p(s),
38
39
  insertTextRules: n.languages.CompletionItemInsertTextRule.InsertAsSnippet,
39
- detail: o + "方法",
40
+ detail: s + "方法",
40
41
  // 描述
41
42
  range: new n.Range(
42
43
  // 定义替换范围(可选)
@@ -48,40 +49,60 @@ const c = (e = []) => (e && e.length > 0 && (e = ["props", "ctx", ...Object.keys
48
49
  })) }),
49
50
  triggerCharacters: ["$"]
50
51
  });
51
- function p(e, r, t) {
52
- l.typescript.typescriptDefaults.setEagerModelSync(!0);
53
- const s = c(t);
54
- return l.registerCompletionItemProvider("typescript", s), n.editor.create(e, {
55
- ...i,
52
+ function g(e, r, t = "typescript") {
53
+ const i = n.Uri.parse(`file:///editor-${Date.now()}.ts`), s = n.editor.createModel(r, t, i);
54
+ return n.editor.create(e, {
55
+ ...l,
56
56
  value: r,
57
- language: "typescript"
57
+ model: s,
58
+ language: t,
59
+ minimap: { enabled: !1 },
60
+ theme: "vs",
61
+ fontSize: 14,
62
+ lineNumbers: "on",
63
+ roundedSelection: !1,
64
+ scrollBeyondLastLine: !1,
65
+ automaticLayout: !0
58
66
  });
59
67
  }
60
- function d(e, r, t) {
61
- const s = m(t);
62
- return l.registerCompletionItemProvider("html", s), n.editor.create(e, {
63
- ...i,
68
+ function y(e, r, t) {
69
+ if (o.typescript.typescriptDefaults.setEagerModelSync(!0), t && t?.length > 0) {
70
+ const i = d(t);
71
+ o.registerCompletionItemProvider("typescript", i), o.typescript.typescriptDefaults.setExtraLibs([]), o.typescript.typescriptDefaults.addExtraLib(
72
+ c(),
73
+ "globals.d.ts"
74
+ ), o.typescript.typescriptDefaults.addExtraLib(
75
+ m(),
76
+ "vue.d.ts"
77
+ );
78
+ }
79
+ return g(e, r, "typescript");
80
+ }
81
+ function b(e, r, t) {
82
+ const i = u(t);
83
+ return o.registerCompletionItemProvider("html", i), n.editor.create(e, {
84
+ ...l,
64
85
  value: r,
65
86
  language: "html"
66
87
  });
67
88
  }
68
89
  function I(e, r, t) {
69
90
  return n.editor.create(e, {
70
- ...i,
91
+ ...l,
71
92
  value: r,
72
93
  language: "json"
73
94
  });
74
95
  }
75
- function f(e, r, t) {
96
+ function v(e, r, t) {
76
97
  return n.editor.create(e, {
77
- ...i,
98
+ ...l,
78
99
  value: r,
79
100
  language: "css"
80
101
  });
81
102
  }
82
103
  export {
83
- f as getCss,
84
- d as getHtml,
85
- p as getJs,
104
+ v as getCss,
105
+ b as getHtml,
106
+ y as getJs,
86
107
  I as getJson
87
108
  };
@@ -0,0 +1,416 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=`
2
+ // ====================== 核心响应式 API ======================
3
+ export interface Ref<T> {
4
+ value: T;
5
+ }
6
+
7
+ export interface ComputedRef<T> extends Readonly<Ref<T>> {}
8
+
9
+ export interface WritableComputedRef<T> extends Ref<T> {}
10
+
11
+ export function ref<T>(value: T): Ref<T>;
12
+ export function ref<T>(): Ref<T | undefined>;
13
+
14
+ export function reactive<T extends object>(target: T): T;
15
+
16
+ export function computed<T>(
17
+ getter: () => T,
18
+ debuggerOptions?: DebuggerOptions
19
+ ): ComputedRef<T>;
20
+
21
+ export function computed<T>(
22
+ options: {
23
+ get: () => T;
24
+ set: (value: T) => void;
25
+ },
26
+ debuggerOptions?: DebuggerOptions
27
+ ): WritableComputedRef<T>;
28
+
29
+ // ====================== 生命周期钩子 ======================
30
+ export function onBeforeMount(callback: () => void): void;
31
+ export function onMounted(callback: () => void): void;
32
+ export function onBeforeUpdate(callback: () => void): void;
33
+ export function onUpdated(callback: () => void): void;
34
+ export function onBeforeUnmount(callback: () => void): void;
35
+ export function onUnmounted(callback: () => void): void;
36
+ export function onErrorCaptured(callback: (err: unknown) => boolean | void): void;
37
+ export function onRenderTracked(callback: (e: DebuggerEvent) => void): void;
38
+ export function onRenderTriggered(callback: (e: DebuggerEvent) => void): void;
39
+ export function onActivated(callback: () => void): void;
40
+ export function onDeactivated(callback: () => void): void;
41
+ export function onServerPrefetch(callback: () => Promise<void>): void;
42
+
43
+ // ====================== 依赖注入 API ======================
44
+ export type InjectionKey<T> = Symbol | string;
45
+
46
+ export function provide<T>(key: InjectionKey<T> | string, value: T): void;
47
+
48
+ export function inject<T>(key: InjectionKey<T> | string): T | undefined;
49
+ export function inject<T>(key: InjectionKey<T> | string, defaultValue: T): T;
50
+ export function inject<T>(key: InjectionKey<T> | string, defaultValue: () => T, treatDefaultAsFactory: true): T;
51
+
52
+ // ====================== 响应式工具函数 ======================
53
+ export function isRef<T>(r: Ref<T> | unknown): r is Ref<T>;
54
+
55
+ export function unref<T>(ref: T | Ref<T>): T;
56
+
57
+ export function toRef<T extends object, K extends keyof T>(
58
+ object: T,
59
+ key: K
60
+ ): Ref<T[K]>;
61
+
62
+ export function toRefs<T extends object>(
63
+ object: T
64
+ ): { [K in keyof T]: Ref<T[K]> };
65
+
66
+ export function isProxy(value: unknown): boolean;
67
+
68
+ export function isReactive(value: unknown): boolean;
69
+
70
+ export function isReadonly(value: unknown): boolean;
71
+
72
+ export function markRaw<T extends object>(value: T): T;
73
+
74
+ export function shallowRef<T>(value: T): Ref<T>;
75
+
76
+ export function triggerRef(ref: Ref<any>): void;
77
+
78
+ export function customRef<T>(factory: CustomRefFactory<T>): Ref<T>;
79
+
80
+ export function shallowReactive<T extends object>(target: T): T;
81
+
82
+ export function shallowReadonly<T extends object>(target: T): Readonly<T>;
83
+
84
+ // ====================== Watch API ======================
85
+ export type WatchSource<T = any> = Ref<T> | (() => T);
86
+
87
+ export type WatchCallback<V = any, OV = any> = (
88
+ value: V,
89
+ oldValue: OV,
90
+ onInvalidate: InvalidateCbRegistrator
91
+ ) => any;
92
+
93
+ export interface WatchOptions {
94
+ immediate?: boolean;
95
+ deep?: boolean;
96
+ flush?: 'pre' | 'post' | 'sync';
97
+ onTrack?: (event: DebuggerEvent) => void;
98
+ onTrigger?: (event: DebuggerEvent) => void;
99
+ }
100
+
101
+ export interface WatchEffectOptions {
102
+ flush?: 'pre' | 'post' | 'sync';
103
+ onTrack?: (event: DebuggerEvent) => void;
104
+ onTrigger?: (event: DebuggerEvent) => void;
105
+ }
106
+
107
+ export function watch<T>(
108
+ source: WatchSource<T>,
109
+ callback: WatchCallback<T>,
110
+ options?: WatchOptions
111
+ ): StopHandle;
112
+
113
+ export function watch<T>(
114
+ sources: WatchSource<T>[],
115
+ callback: WatchCallback<T[], T[]>,
116
+ options?: WatchOptions
117
+ ): StopHandle;
118
+
119
+ export function watchEffect(
120
+ effect: (onInvalidate: InvalidateCbRegistrator) => void,
121
+ options?: WatchEffectOptions
122
+ ): StopHandle;
123
+
124
+ export function watchPostEffect(
125
+ effect: (onInvalidate: InvalidateCbRegistrator) => void,
126
+ options?: Omit<WatchEffectOptions, 'flush'>
127
+ ): StopHandle;
128
+
129
+ export function watchSyncEffect(
130
+ effect: (onInvalidate: InvalidateCbRegistrator) => void,
131
+ options?: Omit<WatchEffectOptions, 'flush'>
132
+ ): StopHandle;
133
+
134
+ // ====================== 组件 API ======================
135
+ export function defineComponent<Props, RawBindings = object>(
136
+ setup: (
137
+ props: Readonly<Props>,
138
+ ctx: SetupContext
139
+ ) => RawBindings | (() => JSX.Element | null)
140
+ ): {
141
+ new (): {
142
+ $props: Props;
143
+ };
144
+ };
145
+
146
+ export interface SetupContext {
147
+ attrs: Record<string, any>;
148
+ slots: Record<string, Function | undefined>;
149
+ emit: (event: string, ...args: any[]) => void;
150
+ expose: (exposed: Record<string, any>) => void;
151
+ }
152
+
153
+ // ====================== 模板引用 API ======================
154
+ export function templateRef<T extends HTMLElement = HTMLElement>(
155
+ key: string
156
+ ): Ref<T | null>;
157
+
158
+ // ====================== 类型定义 ======================
159
+ export interface DebuggerOptions {
160
+ onTrack?: (event: DebuggerEvent) => void;
161
+ onTrigger?: (event: DebuggerEvent) => void;
162
+ }
163
+
164
+ export interface DebuggerEvent {
165
+ effect: ReactiveEffect;
166
+ target: any;
167
+ type: OperationTypes;
168
+ key: string | symbol | undefined;
169
+ }
170
+
171
+ export type StopHandle = () => void;
172
+
173
+ export type InvalidateCbRegistrator = (cb: () => void) => void;
174
+
175
+ export type CustomRefFactory<T> = (
176
+ track: () => void,
177
+ trigger: () => void
178
+ ) => {
179
+ get: () => T;
180
+ set: (value: T) => void;
181
+ };
182
+
183
+ export interface ReactiveEffect<T = any> {
184
+ (): T;
185
+ id: number;
186
+ active: boolean;
187
+ raw: () => T;
188
+ deps: Array<Dep>;
189
+ options: ReactiveEffectOptions;
190
+ allowRecurse: boolean;
191
+ }
192
+
193
+ export interface ReactiveEffectOptions {
194
+ lazy?: boolean;
195
+ scheduler?: (job: ReactiveEffect) => void;
196
+ onTrack?: (event: DebuggerEvent) => void;
197
+ onTrigger?: (event: DebuggerEvent) => void;
198
+ onStop?: () => void;
199
+ allowRecurse?: boolean;
200
+ }
201
+
202
+ export type Dep = Set<ReactiveEffect>;
203
+
204
+ export const enum OperationTypes {
205
+ GET = 'get',
206
+ SET = 'set',
207
+ HAS = 'has',
208
+ ADD = 'add',
209
+ DELETE = 'delete',
210
+ CLEAR = 'clear',
211
+ ITERATE = 'iterate'
212
+ }
213
+
214
+ // ====================== 其他实用 API ======================
215
+ export function nextTick(callback?: () => void): Promise<void>;
216
+
217
+ export function set<T>(object: object, key: string | number, value: T): T;
218
+
219
+ export function del<T>(object: object, key: string | number): void;
220
+
221
+ export function useCssModule(name?: string): Record<string, string>;
222
+
223
+ // ====================== Suspense API ======================
224
+ export function onSuspenseEvent(callback: () => void): void;
225
+
226
+ // ====================== 服务端渲染 API ======================
227
+ export function useSSRContext<T = Record<string, any>>(): T | void;
228
+
229
+ // ====================== 组合函数工具 ======================
230
+ export function useAttrs(): Record<string, string>;
231
+
232
+ export function useSlots(): Record<string, Function | undefined>;
233
+
234
+ // ====================== 路由相关 (Vue Router) ======================
235
+ export function useRoute(): RouteLocationNormalizedLoaded;
236
+
237
+ export function useRouter(): Router;
238
+
239
+ export interface RouteLocationNormalizedLoaded {
240
+ path: string;
241
+ name: string | null | undefined;
242
+ params: Record<string, string | string[]>;
243
+ query: Record<string, string | string[]>;
244
+ hash: string;
245
+ fullPath: string;
246
+ matched: RouteRecordNormalized[];
247
+ meta: Record<string | number | symbol, any>;
248
+ redirectedFrom: RouteLocationNormalizedLoaded | undefined;
249
+ }
250
+
251
+ export interface Router {
252
+ push(to: RouteLocationRaw): Promise<NavigationFailure | void | undefined>;
253
+ replace(to: RouteLocationRaw): Promise<NavigationFailure | void | undefined>;
254
+ go(delta: number): void;
255
+ back(): void;
256
+ forward(): void;
257
+ addRoute(route: RouteRecordRaw): () => void;
258
+ removeRoute(name: string): void;
259
+ hasRoute(name: string): boolean;
260
+ getRoutes(): RouteRecordNormalized[];
261
+ resolve(to: RouteLocationRaw): RouteLocation & {
262
+ href: string;
263
+ };
264
+ beforeEach(guard: NavigationGuard): () => void;
265
+ beforeResolve(guard: NavigationGuard): () => void;
266
+ afterEach(guard: NavigationHookAfter): () => void;
267
+ onError(handler: (error: any) => any): () => void;
268
+ isReady(): Promise<void>;
269
+ install(app: App): void;
270
+ }
271
+
272
+ // ====================== 状态管理 (Pinia) ======================
273
+ export function defineStore<Id extends string, S, G, A>(
274
+ id: Id,
275
+ options: Omit<DefineStoreOptions<Id, S, G, A>, 'id'>
276
+ ): StoreDefinition<Id, S, G, A>;
277
+
278
+ export interface StoreDefinition<Id extends string, S, G, A> {
279
+ (): Store<Id, S, G, A>;
280
+ $id: Id;
281
+ }
282
+
283
+ export interface Store<Id extends string, S, G, A> {
284
+ $id: Id;
285
+ $state: S;
286
+ $patch(partialState: Partial<S>): void;
287
+ $patch(fn: (state: S) => void): void;
288
+ $reset(): void;
289
+ $subscribe(callback: (mutation: SubscriptionCallback<S>, state: S) => void, options?: { detached?: boolean }): () => void;
290
+ $onAction(callback: (context: ActionContext<S, G, A>) => void, options?: { detached?: boolean }): () => void;
291
+ $dispose(): void;
292
+ }
293
+
294
+ export interface DefineStoreOptions<Id extends string, S, G, A> {
295
+ id: Id;
296
+ state?: () => S;
297
+ getters?: G & ThisType<Store<Id, S, G, A>> & Record<string, (state: S) => any>;
298
+ actions?: A & ThisType<Store<Id, S, G, A>>;
299
+ hydrate?(storeState: S, initialState: S): void;
300
+ }
301
+
302
+ // ====================== 类型工具 ======================
303
+ export type MaybeRef<T> = T | Ref<T>;
304
+ export type MaybeRefOrGetter<T> = MaybeRef<T> | (() => T);
305
+
306
+ // ====================== 组合式函数 ======================
307
+ export function useMouse(): {
308
+ x: Ref<number>;
309
+ y: Ref<number>;
310
+ };
311
+
312
+ export function useFetch<T>(url: MaybeRefOrGetter<string>, options?: any): {
313
+ data: Ref<T | null>;
314
+ error: Ref<any | null>;
315
+ isFetching: Ref<boolean>;
316
+ execute: () => Promise<void>;
317
+ };
318
+
319
+ export function useDebounceFn<T extends Function>(fn: T, delay?: number): T;
320
+
321
+ export function useThrottleFn<T extends Function>(fn: T, delay?: number): T;
322
+
323
+ export function useLocalStorage<T>(key: string, initialValue: T): Ref<T>;
324
+
325
+ export function useSessionStorage<T>(key: string, initialValue: T): Ref<T>;
326
+
327
+ export function useElementBounding(ref: Ref<HTMLElement | null>): {
328
+ width: Ref<number>;
329
+ height: Ref<number>;
330
+ top: Ref<number>;
331
+ right: Ref<number>;
332
+ bottom: Ref<number>;
333
+ left: Ref<number>;
334
+ x: Ref<number>;
335
+ y: Ref<number>;
336
+ };
337
+
338
+ // ====================== 全局配置 ======================
339
+ export interface GlobalConfig {
340
+ silent: boolean;
341
+ devtools: boolean;
342
+ performance: boolean;
343
+ errorHandler?: (err: unknown, vm: ComponentPublicInstance | null, info: string) => void;
344
+ warnHandler?: (msg: string, vm: ComponentPublicInstance | null, trace: string) => void;
345
+ globalProperties: Record<string, any>;
346
+ }
347
+
348
+ export function useConfig(): GlobalConfig;
349
+ `;function t(){return e}const o=`
350
+ export {}
351
+ declare global {
352
+ const computed: typeof import('vue')['computed']
353
+ const createApp: typeof import('vue')['createApp']
354
+ const customRef: typeof import('vue')['customRef']
355
+ const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
356
+ const defineComponent: typeof import('vue')['defineComponent']
357
+ const effectScope: typeof import('vue')['effectScope']
358
+ const getCurrentInstance: typeof import('vue')['getCurrentInstance']
359
+ const getCurrentScope: typeof import('vue')['getCurrentScope']
360
+ const getCurrentWatcher: typeof import('vue')['getCurrentWatcher']
361
+ const h: typeof import('vue')['h']
362
+ const inject: typeof import('vue')['inject']
363
+ const isProxy: typeof import('vue')['isProxy']
364
+ const isReactive: typeof import('vue')['isReactive']
365
+ const isReadonly: typeof import('vue')['isReadonly']
366
+ const isRef: typeof import('vue')['isRef']
367
+ const isShallow: typeof import('vue')['isShallow']
368
+ const markRaw: typeof import('vue')['markRaw']
369
+ const nextTick: typeof import('vue')['nextTick']
370
+ const onActivated: typeof import('vue')['onActivated']
371
+ const onBeforeMount: typeof import('vue')['onBeforeMount']
372
+ const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
373
+ const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
374
+ const onDeactivated: typeof import('vue')['onDeactivated']
375
+ const onErrorCaptured: typeof import('vue')['onErrorCaptured']
376
+ const onMounted: typeof import('vue')['onMounted']
377
+ const onRenderTracked: typeof import('vue')['onRenderTracked']
378
+ const onRenderTriggered: typeof import('vue')['onRenderTriggered']
379
+ const onScopeDispose: typeof import('vue')['onScopeDispose']
380
+ const onServerPrefetch: typeof import('vue')['onServerPrefetch']
381
+ const onUnmounted: typeof import('vue')['onUnmounted']
382
+ const onUpdated: typeof import('vue')['onUpdated']
383
+ const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
384
+ const provide: typeof import('vue')['provide']
385
+ const reactive: typeof import('vue')['reactive']
386
+ const readonly: typeof import('vue')['readonly']
387
+ const ref: typeof import('vue')['ref']
388
+ const resolveComponent: typeof import('vue')['resolveComponent']
389
+ const shallowReactive: typeof import('vue')['shallowReactive']
390
+ const shallowReadonly: typeof import('vue')['shallowReadonly']
391
+ const shallowRef: typeof import('vue')['shallowRef']
392
+ const toRaw: typeof import('vue')['toRaw']
393
+ const toRef: typeof import('vue')['toRef']
394
+ const toRefs: typeof import('vue')['toRefs']
395
+ const toValue: typeof import('vue')['toValue']
396
+ const triggerRef: typeof import('vue')['triggerRef']
397
+ const unref: typeof import('vue')['unref']
398
+ const useAttrs: typeof import('vue')['useAttrs']
399
+ const useCssModule: typeof import('vue')['useCssModule']
400
+ const useCssVars: typeof import('vue')['useCssVars']
401
+ const useId: typeof import('vue')['useId']
402
+ const useModel: typeof import('vue')['useModel']
403
+ const useSlots: typeof import('vue')['useSlots']
404
+ const useTemplateRef: typeof import('vue')['useTemplateRef']
405
+ const watch: typeof import('vue')['watch']
406
+ const watchEffect: typeof import('vue')['watchEffect']
407
+ const watchPostEffect: typeof import('vue')['watchPostEffect']
408
+ const watchSyncEffect: typeof import('vue')['watchSyncEffect']
409
+ }
410
+ // for type re-export
411
+ declare global {
412
+ // @ts-ignore
413
+ export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, ShallowRef, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
414
+ import('vue')
415
+ }
416
+ `;function n(){return o}exports.getGlobals=n;exports.getVue=t;
@@ -0,0 +1,2 @@
1
+ export declare function getVue(): string;
2
+ export declare function getGlobals(): string;