@e-xi/xion 0.0.25 → 0.0.26

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.
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-P4CX6I4J.js";
7
7
 
8
8
  // package.json
9
- var version = "0.0.25";
9
+ var version = "0.0.26";
10
10
 
11
11
  // src/main/banner/banner-abstract.ts
12
12
  var BannerAbstract = class {
@@ -44,7 +44,7 @@ import "../../chunk-files/chunk-J34MOWJP.js";
44
44
  import "../../chunk-files/chunk-RSUM4GBD.js";
45
45
  import {
46
46
  BannerManager
47
- } from "../../chunk-files/chunk-5UTMFRI6.js";
47
+ } from "../../chunk-files/chunk-KBVHM5ZU.js";
48
48
  import "../../chunk-files/chunk-YLZRRUY7.js";
49
49
  import {
50
50
  defineAppConfig,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  BannerAbstract,
3
3
  BannerManager
4
- } from "../../chunk-files/chunk-5UTMFRI6.js";
4
+ } from "../../chunk-files/chunk-KBVHM5ZU.js";
5
5
  import "../../chunk-files/chunk-YLZRRUY7.js";
6
6
  import "../../chunk-files/chunk-P4CX6I4J.js";
7
7
  export {
@@ -1,3 +1,4 @@
1
+ import { type Pinia } from 'pinia';
1
2
  import { type ComputedRef, type Ref } from 'vue';
2
3
  /**
3
4
  * JWT 认证 Store 的 setup 返回类型
@@ -31,5 +32,22 @@ interface AuthStoreSetup {
31
32
  /**
32
33
  * JWT 认证 Store
33
34
  */
34
- export declare const useXoAuthStore: import("pinia").StoreDefinition<"useXoAuthStore", Pick<AuthStoreSetup, "error" | "status" | "user">, Pick<AuthStoreSetup, "isInitializing" | "isAuthenticating" | "isRefreshing" | "isAuthenticated" | "isUnauthenticated" | "isError">, Pick<AuthStoreSetup, "login" | "logout" | "initialize">>;
35
+ declare const useXoAuthStoreDefinition: import("pinia").StoreDefinition<"useXoAuthStore", Pick<AuthStoreSetup, "error" | "status" | "user">, Pick<AuthStoreSetup, "isInitializing" | "isAuthenticating" | "isRefreshing" | "isAuthenticated" | "isUnauthenticated" | "isError">, Pick<AuthStoreSetup, "login" | "logout" | "initialize">>;
36
+ /**
37
+ * 认证 Store 实例类型
38
+ * @template TUser 业务端指定的登录用户类型
39
+ */
40
+ export type XoAuthStore<TUser = XoAuth.User> = Omit<ReturnType<typeof useXoAuthStoreDefinition>, 'user'> & {
41
+ /** 当前登录用户 */
42
+ user: TUser | undefined;
43
+ };
44
+ /**
45
+ * 获取认证 Store 实例
46
+ * @template TUser 业务端指定的登录用户类型
47
+ * @param {Pinia | null | undefined} pinia Pinia 实例
48
+ * @returns {XoAuthStore<TUser>} 认证 Store 实例
49
+ * @example
50
+ * const authStore = useXoAuthStore<User>()
51
+ */
52
+ export declare function useXoAuthStore<TUser = XoAuth.User>(pinia?: Pinia | null): XoAuthStore<TUser>;
35
53
  export {};
@@ -69,7 +69,7 @@ var useXoAppStore = defineStore("useXoAppStore", () => {
69
69
  // src/renderer/store/auth/auth-store.ts
70
70
  import { defineStore as defineStore2 } from "pinia";
71
71
  import { computed as computed2, ref as ref2, shallowRef } from "vue";
72
- var useXoAuthStore = defineStore2("useXoAuthStore", () => {
72
+ var useXoAuthStoreDefinition = defineStore2("useXoAuthStore", () => {
73
73
  const initializePromise = shallowRef();
74
74
  const offState = shallowRef();
75
75
  const status = ref2("initializing");
@@ -135,6 +135,9 @@ var useXoAuthStore = defineStore2("useXoAuthStore", () => {
135
135
  logout
136
136
  };
137
137
  });
138
+ function useXoAuthStore(pinia) {
139
+ return useXoAuthStoreDefinition(pinia);
140
+ }
138
141
 
139
142
  // src/shared/remote-service/const/remote-service.ts
140
143
  var RemoteServiceStatusOptions = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-xi/xion",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "type": "module",
5
5
  "description": "Electron Vite Vue3 TypeScript framework.",
6
6
  "exports": {