@kdesigner/core 0.0.0-alpha.1 → 0.0.0-alpha.3
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 +468 -2
- package/dist/index.d.ts.map +1 -1
- package/package.json +7 -13
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,474 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { App, Component, ComputedRef, DebuggerEvent, Ref, UnwrapRef, WatchOptions, WritableComputedRef } from "vue";
|
|
2
2
|
import { Router } from "vue-router";
|
|
3
3
|
import { AxiosRequestConfig } from "axios";
|
|
4
4
|
import { Options } from "lru-cache";
|
|
5
|
-
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region ../../node_modules/.pnpm/pinia@3.0.4_typescript@5.9.2_vue@3.5.40_typescript@5.9.2_/node_modules/pinia/dist/pinia.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Type of an object of Actions. For internal usage only.
|
|
9
|
+
* For internal use **only**
|
|
10
|
+
*/
|
|
11
|
+
declare type _ActionsTree = Record<string, _Method>;
|
|
12
|
+
/**
|
|
13
|
+
* Recursive `Partial<T>`. Used by {@link Store['$patch']}.
|
|
14
|
+
*
|
|
15
|
+
* For internal use **only**
|
|
16
|
+
*/
|
|
17
|
+
declare type _DeepPartial<T> = { [K in keyof T]?: _DeepPartial<T[K]>; };
|
|
18
|
+
/**
|
|
19
|
+
* Options parameter of `defineStore()` for option stores. Can be extended to
|
|
20
|
+
* augment stores with the plugin API. @see {@link DefineStoreOptionsBase}.
|
|
21
|
+
*/
|
|
22
|
+
declare interface DefineStoreOptions<Id extends string, S extends StateTree, G, A> extends DefineStoreOptionsBase<S, Store<Id, S, G, A>> {
|
|
23
|
+
/**
|
|
24
|
+
* Unique string key to identify the store across the application.
|
|
25
|
+
*/
|
|
26
|
+
id: Id;
|
|
27
|
+
/**
|
|
28
|
+
* Function to create a fresh state. **Must be an arrow function** to ensure
|
|
29
|
+
* correct typings!
|
|
30
|
+
*/
|
|
31
|
+
state?: () => S;
|
|
32
|
+
/**
|
|
33
|
+
* Optional object of getters.
|
|
34
|
+
*/
|
|
35
|
+
getters?: G & ThisType<UnwrapRef<S> & _StoreWithGetters<G> & PiniaCustomProperties> & _GettersTree<S>;
|
|
36
|
+
/**
|
|
37
|
+
* Optional object of actions.
|
|
38
|
+
*/
|
|
39
|
+
actions?: A & ThisType<A & UnwrapRef<S> & _StoreWithState<Id, S, G, A> & _StoreWithGetters<G> & PiniaCustomProperties>;
|
|
40
|
+
/**
|
|
41
|
+
* Allows hydrating the store during SSR when complex state (like client side only refs) are used in the store
|
|
42
|
+
* definition and copying the value from `pinia.state` isn't enough.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* If in your `state`, you use any `customRef`s, any `computed`s, or any `ref`s that have a different value on
|
|
46
|
+
* Server and Client, you need to manually hydrate them. e.g., a custom ref that is stored in the local
|
|
47
|
+
* storage:
|
|
48
|
+
*
|
|
49
|
+
* ```ts
|
|
50
|
+
* const useStore = defineStore('main', {
|
|
51
|
+
* state: () => ({
|
|
52
|
+
* n: useLocalStorage('key', 0)
|
|
53
|
+
* }),
|
|
54
|
+
* hydrate(storeState, initialState) {
|
|
55
|
+
* // @ts-expect-error: https://github.com/microsoft/TypeScript/issues/43826
|
|
56
|
+
* storeState.n = useLocalStorage('key', 0)
|
|
57
|
+
* }
|
|
58
|
+
* })
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @param storeState - the current state in the store
|
|
62
|
+
* @param initialState - initialState
|
|
63
|
+
*/
|
|
64
|
+
hydrate?(storeState: UnwrapRef<S>, initialState: UnwrapRef<S>): void;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Options passed to `defineStore()` that are common between option and setup
|
|
68
|
+
* stores. Extend this interface if you want to add custom options to both kinds
|
|
69
|
+
* of stores.
|
|
70
|
+
*/
|
|
71
|
+
declare interface DefineStoreOptionsBase<S extends StateTree, Store> {}
|
|
72
|
+
/**
|
|
73
|
+
* Available `options` when creating a pinia plugin.
|
|
74
|
+
*/
|
|
75
|
+
declare interface DefineStoreOptionsInPlugin<Id extends string, S extends StateTree, G, A> extends Omit<DefineStoreOptions<Id, S, G, A>, 'id' | 'actions'> {
|
|
76
|
+
/**
|
|
77
|
+
* Extracted object of actions. Added by useStore() when the store is built
|
|
78
|
+
* using the setup API, otherwise uses the one passed to `defineStore()`.
|
|
79
|
+
* Defaults to an empty object if no actions are defined.
|
|
80
|
+
*/
|
|
81
|
+
actions: A;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Type of an object of Getters that infers the argument. For internal usage only.
|
|
85
|
+
* For internal use **only**
|
|
86
|
+
*/
|
|
87
|
+
declare type _GettersTree<S extends StateTree> = Record<string, ((state: UnwrapRef<S> & UnwrapRef<PiniaCustomStateProperties<S>>) => any) | (() => any)>;
|
|
88
|
+
/**
|
|
89
|
+
* Generic type for a function that can infer arguments and return type
|
|
90
|
+
*
|
|
91
|
+
* For internal use **only**
|
|
92
|
+
*/
|
|
93
|
+
declare type _Method = (...args: any[]) => any;
|
|
94
|
+
/**
|
|
95
|
+
* Possible types for SubscriptionCallback
|
|
96
|
+
*/
|
|
97
|
+
declare enum MutationType {
|
|
98
|
+
/**
|
|
99
|
+
* Direct mutation of the state:
|
|
100
|
+
*
|
|
101
|
+
* - `store.name = 'new name'`
|
|
102
|
+
* - `store.$state.name = 'new name'`
|
|
103
|
+
* - `store.list.push('new item')`
|
|
104
|
+
*/
|
|
105
|
+
direct = "direct",
|
|
106
|
+
/**
|
|
107
|
+
* Mutated the state with `$patch` and an object
|
|
108
|
+
*
|
|
109
|
+
* - `store.$patch({ name: 'newName' })`
|
|
110
|
+
*/
|
|
111
|
+
patchObject = "patch object",
|
|
112
|
+
/**
|
|
113
|
+
* Mutated the state with `$patch` and a function
|
|
114
|
+
*
|
|
115
|
+
* - `store.$patch(state => state.name = 'newName')`
|
|
116
|
+
*/
|
|
117
|
+
patchFunction = "patch function"
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Every application must own its own pinia to be able to create stores
|
|
121
|
+
*/
|
|
122
|
+
declare interface Pinia {
|
|
123
|
+
install: (app: App) => void;
|
|
124
|
+
/**
|
|
125
|
+
* root state
|
|
126
|
+
*/
|
|
127
|
+
state: Ref<Record<string, StateTree>>;
|
|
128
|
+
/**
|
|
129
|
+
* Adds a store plugin to extend every store
|
|
130
|
+
*
|
|
131
|
+
* @param plugin - store plugin to add
|
|
132
|
+
*/
|
|
133
|
+
use(plugin: PiniaPlugin): Pinia;
|
|
134
|
+
/* Excluded from this release type: _p */
|
|
135
|
+
/* Excluded from this release type: _a */
|
|
136
|
+
/* Excluded from this release type: _e */
|
|
137
|
+
/* Excluded from this release type: _s */
|
|
138
|
+
/* Excluded from this release type: _testing */
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Interface to be extended by the user when they add properties through plugins.
|
|
142
|
+
*/
|
|
143
|
+
declare interface PiniaCustomProperties<Id extends string = string, S extends StateTree = StateTree, G = _GettersTree<S>, A = _ActionsTree> {}
|
|
144
|
+
/**
|
|
145
|
+
* Properties that are added to every `store.$state` by `pinia.use()`.
|
|
146
|
+
*/
|
|
147
|
+
declare interface PiniaCustomStateProperties<S extends StateTree = StateTree> {}
|
|
148
|
+
/**
|
|
149
|
+
* Plugin to extend every store.
|
|
150
|
+
*/
|
|
151
|
+
declare interface PiniaPlugin {
|
|
152
|
+
/**
|
|
153
|
+
* Plugin to extend every store. Returns an object to extend the store or
|
|
154
|
+
* nothing.
|
|
155
|
+
*
|
|
156
|
+
* @param context - Context
|
|
157
|
+
*/
|
|
158
|
+
(context: PiniaPluginContext): Partial<PiniaCustomProperties & PiniaCustomStateProperties> | void;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Context argument passed to Pinia plugins.
|
|
162
|
+
*/
|
|
163
|
+
declare interface PiniaPluginContext<Id extends string = string, S extends StateTree = StateTree, G = _GettersTree<S>, A = _ActionsTree> {
|
|
164
|
+
/**
|
|
165
|
+
* pinia instance.
|
|
166
|
+
*/
|
|
167
|
+
pinia: Pinia;
|
|
168
|
+
/**
|
|
169
|
+
* Current app created with `Vue.createApp()`.
|
|
170
|
+
*/
|
|
171
|
+
app: App;
|
|
172
|
+
/**
|
|
173
|
+
* Current store being extended.
|
|
174
|
+
*/
|
|
175
|
+
store: Store<Id, S, G, A>;
|
|
176
|
+
/**
|
|
177
|
+
* Initial options defining the store when calling `defineStore()`.
|
|
178
|
+
*/
|
|
179
|
+
options: DefineStoreOptionsInPlugin<Id, S, G, A>;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Generic state of a Store
|
|
183
|
+
*/
|
|
184
|
+
declare type StateTree = Record<PropertyKey, any>;
|
|
185
|
+
/**
|
|
186
|
+
* Store type to build a store.
|
|
187
|
+
*/
|
|
188
|
+
declare type Store<Id extends string = string, S extends StateTree = {}, G = {}, A = {}> = _StoreWithState<Id, S, G, A> & UnwrapRef<S> & _StoreWithGetters<G> & (_ActionsTree extends A ? {} : A) & PiniaCustomProperties<Id, S, G, A> & PiniaCustomStateProperties<S>;
|
|
189
|
+
/**
|
|
190
|
+
* Generic and type-unsafe version of Store. Doesn't fail on access with
|
|
191
|
+
* strings, making it much easier to write generic functions that do not care
|
|
192
|
+
* about the kind of store that is passed.
|
|
193
|
+
*/
|
|
194
|
+
declare type StoreGeneric = Store<string, StateTree, _GettersTree<StateTree>, _ActionsTree>;
|
|
195
|
+
/**
|
|
196
|
+
* Argument of `store.$onAction()`
|
|
197
|
+
*/
|
|
198
|
+
declare type StoreOnActionListener<Id extends string, S extends StateTree, G, A> = (context: StoreOnActionListenerContext<Id, S, G, {} extends A ? _ActionsTree : A>) => void;
|
|
199
|
+
/**
|
|
200
|
+
* Context object passed to callbacks of `store.$onAction(context => {})`
|
|
201
|
+
* TODO: should have only the Id, the Store and Actions to generate the proper object
|
|
202
|
+
*/
|
|
203
|
+
declare type StoreOnActionListenerContext<Id extends string, S extends StateTree, G, A> = _ActionsTree extends A ? _StoreOnActionListenerContext<StoreGeneric, string, _ActionsTree> : { [Name in keyof A]: Name extends string ? _StoreOnActionListenerContext<Store<Id, S, G, A>, Name, A> : never; }[keyof A];
|
|
204
|
+
/**
|
|
205
|
+
* Actual type for {@link StoreOnActionListenerContext}. Exists for refactoring
|
|
206
|
+
* purposes. For internal use only.
|
|
207
|
+
* For internal use **only**
|
|
208
|
+
*/
|
|
209
|
+
declare interface _StoreOnActionListenerContext<Store, ActionName extends string, A> {
|
|
210
|
+
/**
|
|
211
|
+
* Name of the action
|
|
212
|
+
*/
|
|
213
|
+
name: ActionName;
|
|
214
|
+
/**
|
|
215
|
+
* Store that is invoking the action
|
|
216
|
+
*/
|
|
217
|
+
store: Store;
|
|
218
|
+
/**
|
|
219
|
+
* Parameters passed to the action
|
|
220
|
+
*/
|
|
221
|
+
args: A extends Record<ActionName, _Method> ? Parameters<A[ActionName]> : unknown[];
|
|
222
|
+
/**
|
|
223
|
+
* Sets up a hook once the action is finished. It receives the return value
|
|
224
|
+
* of the action, if it's a Promise, it will be unwrapped.
|
|
225
|
+
*/
|
|
226
|
+
after: (callback: A extends Record<ActionName, _Method> ? (resolvedReturn: Awaited<ReturnType<A[ActionName]>>) => void : () => void) => void;
|
|
227
|
+
/**
|
|
228
|
+
* Sets up a hook if the action fails. Return `false` to catch the error and
|
|
229
|
+
* stop it from propagating.
|
|
230
|
+
*/
|
|
231
|
+
onError: (callback: (error: unknown) => void) => void;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Properties of a store.
|
|
235
|
+
*/
|
|
236
|
+
declare interface StoreProperties<Id extends string> {
|
|
237
|
+
/**
|
|
238
|
+
* Unique identifier of the store
|
|
239
|
+
*/
|
|
240
|
+
$id: Id;
|
|
241
|
+
/* Excluded from this release type: _p */
|
|
242
|
+
/* Excluded from this release type: _getters */
|
|
243
|
+
/* Excluded from this release type: _isOptionsAPI */
|
|
244
|
+
/**
|
|
245
|
+
* Used by devtools plugin to retrieve properties added with plugins. Removed
|
|
246
|
+
* in production. Can be used by the user to add property keys of the store
|
|
247
|
+
* that should be displayed in devtools.
|
|
248
|
+
*/
|
|
249
|
+
_customProperties: Set<string>;
|
|
250
|
+
/* Excluded from this release type: _hotUpdate */
|
|
251
|
+
/* Excluded from this release type: _hotUpdating */
|
|
252
|
+
/* Excluded from this release type: _hmrPayload */
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Store augmented with getters. For internal usage only.
|
|
256
|
+
* For internal use **only**
|
|
257
|
+
*/
|
|
258
|
+
declare type _StoreWithGetters<G> = _StoreWithGetters_Readonly<G> & _StoreWithGetters_Writable<G>;
|
|
259
|
+
/**
|
|
260
|
+
* Store augmented with readonly getters. For internal usage **only**.
|
|
261
|
+
*/
|
|
262
|
+
declare type _StoreWithGetters_Readonly<G> = { readonly [K in keyof G as G[K] extends ((...args: any[]) => any) ? K : ComputedRef extends G[K] ? K : never]: G[K] extends ((...args: any[]) => infer R) ? R : UnwrapRef<G[K]>; };
|
|
263
|
+
/**
|
|
264
|
+
* Store augmented with writable getters. For internal usage **only**.
|
|
265
|
+
*/
|
|
266
|
+
declare type _StoreWithGetters_Writable<G> = { [K in keyof G as G[K] extends WritableComputedRef<any> ? K : never]: G[K] extends Readonly<WritableComputedRef<infer R>> ? R : never; };
|
|
267
|
+
/**
|
|
268
|
+
* Base store with state and functions. Should not be used directly.
|
|
269
|
+
*/
|
|
270
|
+
declare interface _StoreWithState<Id extends string, S extends StateTree, G, A> extends StoreProperties<Id> {
|
|
271
|
+
/**
|
|
272
|
+
* State of the Store. Setting it will internally call `$patch()` to update the state.
|
|
273
|
+
*/
|
|
274
|
+
$state: UnwrapRef<S> & PiniaCustomStateProperties<S>;
|
|
275
|
+
/**
|
|
276
|
+
* Applies a state patch to current state. Allows passing nested values
|
|
277
|
+
*
|
|
278
|
+
* @param partialState - patch to apply to the state
|
|
279
|
+
*/
|
|
280
|
+
$patch(partialState: _DeepPartial<UnwrapRef<S>>): void;
|
|
281
|
+
/**
|
|
282
|
+
* Group multiple changes into one function. Useful when mutating objects like
|
|
283
|
+
* Sets or arrays and applying an object patch isn't practical, e.g. appending
|
|
284
|
+
* to an array. The function passed to `$patch()` **must be synchronous**.
|
|
285
|
+
*
|
|
286
|
+
* @param stateMutator - function that mutates `state`, cannot be asynchronous
|
|
287
|
+
*/
|
|
288
|
+
$patch<F extends (state: UnwrapRef<S>) => any>(stateMutator: ReturnType<F> extends Promise<any> ? never : F): void;
|
|
289
|
+
/**
|
|
290
|
+
* Resets the store to its initial state by building a new state object.
|
|
291
|
+
*/
|
|
292
|
+
$reset(): void;
|
|
293
|
+
/**
|
|
294
|
+
* Setups a callback to be called whenever the state changes. It also returns a function to remove the callback. Note
|
|
295
|
+
* that when calling `store.$subscribe()` inside of a component, it will be automatically cleaned up when the
|
|
296
|
+
* component gets unmounted unless `detached` is set to true.
|
|
297
|
+
*
|
|
298
|
+
* @param callback - callback passed to the watcher
|
|
299
|
+
* @param options - `watch` options + `detached` to detach the subscription from the context (usually a component)
|
|
300
|
+
* this is called from. Note that the `flush` option does not affect calls to `store.$patch()`.
|
|
301
|
+
* @returns function that removes the watcher
|
|
302
|
+
*/
|
|
303
|
+
$subscribe(callback: SubscriptionCallback<S>, options?: {
|
|
304
|
+
detached?: boolean;
|
|
305
|
+
} & WatchOptions): () => void;
|
|
306
|
+
/**
|
|
307
|
+
* Setups a callback to be called every time an action is about to get
|
|
308
|
+
* invoked. The callback receives an object with all the relevant information
|
|
309
|
+
* of the invoked action:
|
|
310
|
+
* - `store`: the store it is invoked on
|
|
311
|
+
* - `name`: The name of the action
|
|
312
|
+
* - `args`: The parameters passed to the action
|
|
313
|
+
*
|
|
314
|
+
* On top of these, it receives two functions that allow setting up a callback
|
|
315
|
+
* once the action finishes or when it fails.
|
|
316
|
+
*
|
|
317
|
+
* It also returns a function to remove the callback. Note than when calling
|
|
318
|
+
* `store.$onAction()` inside of a component, it will be automatically cleaned
|
|
319
|
+
* up when the component gets unmounted unless `detached` is set to true.
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
*
|
|
323
|
+
*```js
|
|
324
|
+
*store.$onAction(({ after, onError }) => {
|
|
325
|
+
* // Here you could share variables between all of the hooks as well as
|
|
326
|
+
* // setting up watchers and clean them up
|
|
327
|
+
* after((resolvedValue) => {
|
|
328
|
+
* // can be used to cleanup side effects
|
|
329
|
+
* . // `resolvedValue` is the value returned by the action, if it's a
|
|
330
|
+
* . // Promise, it will be the resolved value instead of the Promise
|
|
331
|
+
* })
|
|
332
|
+
* onError((error) => {
|
|
333
|
+
* // can be used to pass up errors
|
|
334
|
+
* })
|
|
335
|
+
*})
|
|
336
|
+
*```
|
|
337
|
+
*
|
|
338
|
+
* @param callback - callback called before every action
|
|
339
|
+
* @param detached - detach the subscription from the context this is called from
|
|
340
|
+
* @returns function that removes the watcher
|
|
341
|
+
*/
|
|
342
|
+
$onAction(callback: StoreOnActionListener<Id, S, G, A>, detached?: boolean): () => void;
|
|
343
|
+
/**
|
|
344
|
+
* Stops the associated effect scope of the store and remove it from the store
|
|
345
|
+
* registry. Plugins can override this method to cleanup any added effects.
|
|
346
|
+
* e.g. devtools plugin stops displaying disposed stores from devtools.
|
|
347
|
+
* Note this doesn't delete the state of the store, you have to do it manually with
|
|
348
|
+
* `delete pinia.state.value[store.$id]` if you want to. If you don't and the
|
|
349
|
+
* store is used again, it will reuse the previous state.
|
|
350
|
+
*/
|
|
351
|
+
$dispose(): void;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Callback of a subscription
|
|
355
|
+
*/
|
|
356
|
+
declare type SubscriptionCallback<S> = (
|
|
357
|
+
/**
|
|
358
|
+
* Object with information relative to the store mutation that triggered the
|
|
359
|
+
* subscription.
|
|
360
|
+
*/
|
|
361
|
+
mutation: SubscriptionCallbackMutation<S>,
|
|
362
|
+
/**
|
|
363
|
+
* State of the store when the subscription is triggered. Same as
|
|
364
|
+
* `store.$state`.
|
|
365
|
+
*/
|
|
366
|
+
state: UnwrapRef<S>) => void;
|
|
367
|
+
/**
|
|
368
|
+
* Context object passed to a subscription callback.
|
|
369
|
+
*/
|
|
370
|
+
declare type SubscriptionCallbackMutation<S> = SubscriptionCallbackMutationDirect | SubscriptionCallbackMutationPatchObject<S> | SubscriptionCallbackMutationPatchFunction;
|
|
371
|
+
/**
|
|
372
|
+
* Base type for the context passed to a subscription callback. Internal type.
|
|
373
|
+
*/
|
|
374
|
+
declare interface _SubscriptionCallbackMutationBase {
|
|
375
|
+
/**
|
|
376
|
+
* Type of the mutation.
|
|
377
|
+
*/
|
|
378
|
+
type: MutationType;
|
|
379
|
+
/**
|
|
380
|
+
* `id` of the store doing the mutation.
|
|
381
|
+
*/
|
|
382
|
+
storeId: string;
|
|
383
|
+
/**
|
|
384
|
+
* 🔴 DEV ONLY, DO NOT use for production code. Different mutation calls. Comes from
|
|
385
|
+
* https://vuejs.org/guide/extras/reactivity-in-depth.html#reactivity-debugging and allows to track mutations in
|
|
386
|
+
* devtools and plugins **during development only**.
|
|
387
|
+
*/
|
|
388
|
+
events?: DebuggerEvent[] | DebuggerEvent;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Context passed to a subscription callback when directly mutating the state of
|
|
392
|
+
* a store with `store.someState = newValue` or `store.$state.someState =
|
|
393
|
+
* newValue`.
|
|
394
|
+
*/
|
|
395
|
+
declare interface SubscriptionCallbackMutationDirect extends _SubscriptionCallbackMutationBase {
|
|
396
|
+
type: MutationType.direct;
|
|
397
|
+
events: DebuggerEvent;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Context passed to a subscription callback when `store.$patch()` is called
|
|
401
|
+
* with a function.
|
|
402
|
+
*/
|
|
403
|
+
declare interface SubscriptionCallbackMutationPatchFunction extends _SubscriptionCallbackMutationBase {
|
|
404
|
+
type: MutationType.patchFunction;
|
|
405
|
+
events: DebuggerEvent[];
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Context passed to a subscription callback when `store.$patch()` is called
|
|
409
|
+
* with an object.
|
|
410
|
+
*/
|
|
411
|
+
declare interface SubscriptionCallbackMutationPatchObject<S> extends _SubscriptionCallbackMutationBase {
|
|
412
|
+
type: MutationType.patchObject;
|
|
413
|
+
events: DebuggerEvent[];
|
|
414
|
+
/**
|
|
415
|
+
* Object passed to `store.$patch()`.
|
|
416
|
+
*/
|
|
417
|
+
payload: _DeepPartial<UnwrapRef<S>>;
|
|
418
|
+
}
|
|
419
|
+
// Extensions of Vue types to be appended manually
|
|
420
|
+
// https://github.com/microsoft/rushstack/issues/2090
|
|
421
|
+
// https://github.com/microsoft/rushstack/issues/1709
|
|
422
|
+
// @ts-ignore: works on Vue 2, fails in Vue 3
|
|
423
|
+
declare module 'vue/types/vue' {
|
|
424
|
+
interface Vue {
|
|
425
|
+
/**
|
|
426
|
+
* Currently installed pinia instance.
|
|
427
|
+
*/
|
|
428
|
+
$pinia: Pinia;
|
|
429
|
+
/**
|
|
430
|
+
* Cache of stores instantiated by the current instance. Used by map
|
|
431
|
+
* helpers. Used internally by Pinia.
|
|
432
|
+
*
|
|
433
|
+
* @internal
|
|
434
|
+
*/
|
|
435
|
+
_pStores?: Record<string, Store>;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
// @ts-ignore: works on Vue 2, fails in Vue 3
|
|
439
|
+
declare module 'vue/types/options' {
|
|
440
|
+
interface ComponentOptions<V> {
|
|
441
|
+
/**
|
|
442
|
+
* Pinia instance to install in your application. Should be passed to the
|
|
443
|
+
* root Vue.
|
|
444
|
+
*/
|
|
445
|
+
pinia?: Pinia;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* NOTE: Used to be `@vue/runtime-core` but it break types from time to time. Then, in Vue docs, we started recommending
|
|
450
|
+
* to use `vue` instead of `@vue/runtime-core` but that broke others' types so we reverted it. Now, local types do not
|
|
451
|
+
* work if we use `@vue/runtime-core` so we are using `vue` again.
|
|
452
|
+
*/
|
|
453
|
+
// @ts-ignore: works on Vue 3, fails in Vue 2
|
|
454
|
+
declare module 'vue' {
|
|
455
|
+
// This seems to be needed to not break auto import types based on the order
|
|
456
|
+
// https://github.com/vuejs/pinia/pull/2730
|
|
457
|
+
interface GlobalComponents {}
|
|
458
|
+
interface ComponentCustomProperties {
|
|
459
|
+
/**
|
|
460
|
+
* Access to the application's Pinia
|
|
461
|
+
*/
|
|
462
|
+
$pinia: Pinia;
|
|
463
|
+
/**
|
|
464
|
+
* Cache of stores instantiated by the current instance. Used by devtools to
|
|
465
|
+
* list currently used stores. Used internally by Pinia.
|
|
466
|
+
*
|
|
467
|
+
* @internal
|
|
468
|
+
*/
|
|
469
|
+
_pStores?: Record<string, StoreGeneric>;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
6
472
|
//#endregion
|
|
7
473
|
//#region src/types/index.d.ts
|
|
8
474
|
interface TreeBean {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types/index.ts","../src/adapter/link.ts","../src/adapter/index.ts","../src/api/cache.ts","../src/api/page-api.ts","../src/api/user-api.ts","../src/page/action.ts","../src/page/processor.ts","../src/page/registry.ts","../src/page/transform.ts","../src/page/page.ts","../src/ajax/ajax.ts","../src/graphql/gql.ts","../src/loader/module.ts","../src/debug/debug.ts","../src/shared/constants.ts","../src/shared/utils.ts","../src/shared/cache.ts","../src/shared/index.ts","../src/scope.ts","../src/schema-type.ts","../src/renderer/types.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../node_modules/.pnpm/pinia@3.0.4_typescript@5.9.2_vue@3.5.40_typescript@5.9.2_/node_modules/pinia/dist/pinia.d.ts","../src/types/index.ts","../src/adapter/link.ts","../src/adapter/index.ts","../src/api/cache.ts","../src/api/page-api.ts","../src/api/user-api.ts","../src/page/action.ts","../src/page/processor.ts","../src/page/registry.ts","../src/page/transform.ts","../src/page/page.ts","../src/ajax/ajax.ts","../src/graphql/gql.ts","../src/loader/module.ts","../src/debug/debug.ts","../src/shared/constants.ts","../src/shared/utils.ts","../src/shared/cache.ts","../src/shared/index.ts","../src/scope.ts","../src/schema-type.ts","../src/renderer/types.ts"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;aA+BoB,eAAe,eAAe;;;;;;;;;;aAY9B,aAAa,QAC5B,WAAW,KAAK,aAAa,EAAE;;;;;;;;kBAqCX,mBAAmB,mBAAmB,UAAU,WAAW,GAAG,WAAW,uBAAuB,GAAG,MAAM,IAAI,GAAG,GAAG;;;;;;EAIxI,IAAI;;;;;;;;EAKJ,cAAc;;;;;;EAId,UAAU,IAAI,SAAS,UAAU,KAAK,kBAAkB,KAAK,yBAAyB,aAAa;;;;;;EAInG,UAAU,IAAI,SAAS,IAAI,UAAU,KAAK,gBAAgB,IAAI,GAAG,GAAG,KAAK,kBAAkB,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBhG,SAAS,YAAY,UAAU,IAAI,cAAc,UAAU;;;;;;;;;;;kBAQtC,uBAAuB,UAAU,WAAW;;;;;;kBAM5C,2BAA2B,mBAAmB,UAAU,WAAW,GAAG,WAAW,KAAK,mBAAmB,IAAI,GAAG,GAAG;;;;;;;;;;EAMxI,SAAS;;;;;;;;;aA4DO,aAAa,UAAU,aAAa,iBAAiB,OAAO,UAAU,KAAK,UAAU,2BAA2B;;;;;;;;;;aAiQhH,cAAc;;;;;;aAKd;;;;;;;;;;;;;;EAQhB;;;;;;;;;;EAMA;;;;;;;;;;EAMA;;;;;;;kBAMqB;EACrB,UAAU,KAAK;;;;;;EAIf,OAAO,IAAI,eAAe;;;;;;;;;;EAM1B,IAAI,QAAQ,cAAc;;;;;;;;;;;;kBAWL,sBAAsB,4BAA4B,UAAU,YAAY,WAAW,IAAI,aAAa,IAAI,IAAI;;;;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CnC;iBAIA,SAAS;;;;;iBAQF;;;sBAAA;mBAAA;;;;;cClBH;cAEA;cAEA;cAEA;cAEA;;;iBCUG,aAAa,cAAc;KAWtC,mBAAmB;iBAER,OACd,aACA,0BACA,uBACA,UAAU;;;;;iBAoCI,gBAAgB;;;;;;;;;;;;;;;;iBAkBhB,gBAAgB;;;;;;;;;;;UAiBf,YAAY;EAC3B,UAAU;EACV,OAAO;EACP,IAAI,OAAO;;iBAGG,UAAU,MAAM,YAAY;;;KC5GhC,iBAAiB,MAAM,gBAAgB,QAAQ;UAE1C,WAAW;EAC1B,IAAI,aAAa,QAAQ,iBAAiB,KAAK,QAAQ;EACvD,OAAO;EACP;;KAGU,kBAAkB,KAAK,gBAAgB;iBAEnC,iBAAiB,GAAG,SAAS,yBAAyB,WAAW;;;iBCRjE,eAAe;;;iBCFf,WAAO;iBAIP,YAAY,MAAM;iBAMlB;iBAIA,cAAc;iBAMd;iBAIA,mBAAmB;iBAInB;;;UC9BC;EACf,eAAe;EACf,qBAAqB;EACrB,mBAAmB;EACnB,oBAAoB;;iBAKN,4BACd,kBACA,qBAAqB;iBAKP,uBAAuB,mBAAgB;;;UChBtC;GACd;;UAGc;EACf;GACC;;KAGS,uBAAuB,aAAa;KAEpC;KAEA,eAAe,eAAe,WAAW;UAEpC;GACd,iBAAiB;;KAGR;UAEK;;;;EAIf,SAAS,cAAc,QAAQ,YAAY,OAAO,aAAa,aAAa;;;;EAK5E,WAAW,KAAK,WAAW,WAAW,aAAa,QAAQ;;;;EAK3D,UAAU;;;;;;EAOV,gBAAgB,gBAAgB,SAAS,gBAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kdesigner/core",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.3",
|
|
4
4
|
"description": "KDesigner 网络请求工具库 - 基于 axios 的 HTTP 客户端封装",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ajax",
|
|
@@ -33,19 +33,19 @@
|
|
|
33
33
|
"registry": "https://registry.npmjs.org"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"
|
|
36
|
+
"axios": "1.7",
|
|
37
|
+
"lodash-es": "^4.17.21",
|
|
38
|
+
"lru-cache": "^7.14.0",
|
|
39
|
+
"path-to-regexp": "^8.3.0",
|
|
40
|
+
"qs": "^6.9.7",
|
|
41
|
+
"@kdesigner/shared": "0.0.0-alpha.8"
|
|
37
42
|
},
|
|
38
43
|
"devDependencies": {
|
|
39
44
|
"@types/lodash-es": "^4.17.6",
|
|
40
45
|
"@types/node": "22.10.2",
|
|
41
46
|
"@types/qs": "^6.9.7",
|
|
42
47
|
"@vitest/coverage-v8": "3.2.4",
|
|
43
|
-
"axios": "1.7",
|
|
44
|
-
"lodash-es": "^4.17.21",
|
|
45
|
-
"lru-cache": "^7.14.0",
|
|
46
|
-
"path-to-regexp": "^8.3.0",
|
|
47
48
|
"pinia": "^3.0.3",
|
|
48
|
-
"qs": "^6.9.7",
|
|
49
49
|
"systemjs": "^6.13.0",
|
|
50
50
|
"typescript": "5.9.2",
|
|
51
51
|
"vite": "5.4.19",
|
|
@@ -55,12 +55,6 @@
|
|
|
55
55
|
"vue-router": "^4.5.1"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"axios": ">=1.0.0",
|
|
59
|
-
"lodash-es": ">=4.0.0",
|
|
60
|
-
"lru-cache": ">=11.0.0",
|
|
61
|
-
"path-to-regexp": ">=8.0.0",
|
|
62
|
-
"pinia": ">=3.0.0",
|
|
63
|
-
"qs": ">=6.0.0",
|
|
64
58
|
"vue": ">=3.0.0",
|
|
65
59
|
"vue-router": ">=4.0.0"
|
|
66
60
|
},
|