@morghulis/core 0.0.2 → 0.0.4

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.
@@ -1,9 +1,13 @@
1
1
  import { App } from "vue";
2
2
  import 'nprogress/nprogress.css';
3
- import { useRequest } from "./use-request";
4
3
  import { IOptions } from "./types";
5
4
  import { createChannel, useChannel } from "./use-channel";
5
+ import { useRequest } from "./use-request";
6
+ import { useAuth } from "./use-auth";
7
+ import { useCookies } from "./use-cookie";
8
+ import { usePaster } from "./use-paster";
9
+ import { useXlsx } from "./use-xlsx";
6
10
  declare const createMorghulisCore: (options?: IOptions) => {
7
11
  install(app: App): void;
8
12
  };
9
- export { createMorghulisCore, useRequest, createChannel, useChannel, };
13
+ export { createMorghulisCore, useRequest, createChannel, useChannel, useAuth, useCookies, useXlsx, usePaster };
@@ -0,0 +1,13 @@
1
+ export declare function useAuth(): {
2
+ $client: string;
3
+ getUserInfo: () => any;
4
+ setUserInfo: (userKey: any) => void;
5
+ checkUserInfo: (userKey?: any) => boolean;
6
+ logout: () => void;
7
+ bearer: () => "Bearer 123" | null;
8
+ keys: {
9
+ client: string;
10
+ user: string;
11
+ bearer: string;
12
+ };
13
+ };
@@ -0,0 +1,6 @@
1
+ export declare function useCookies(): {
2
+ get: (path: string) => any;
3
+ set: (path: string, value?: any) => void;
4
+ remove: (path: string) => void;
5
+ load: (key: string, value?: any) => any;
6
+ };
@@ -0,0 +1,5 @@
1
+ export declare function usePaster(): {
2
+ openPaster: () => Promise<string>;
3
+ pending: import("vue").Ref<boolean, boolean>;
4
+ getClipboardData: () => Promise<string>;
5
+ };
@@ -1,5 +1,4 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import 'nprogress/nprogress.css';
3
2
  export declare function useRequest(): {
4
3
  getHttpRequest: (auth?: boolean) => AxiosInstance;
5
4
  download: (path: string) => void;
@@ -0,0 +1,5 @@
1
+ import { Aoa, AoaMap, Separator } from "./types";
2
+ export declare function useXlsx(separator?: Separator): {
3
+ fromText: (text: string) => Aoa;
4
+ fromFile: (file: File) => Promise<AoaMap>;
5
+ };
@@ -0,0 +1,8 @@
1
+ export type Separator = {
2
+ cell: string;
3
+ line: string;
4
+ };
5
+ export type Aoa = any[][];
6
+ export type AoaMap = {
7
+ [name: string]: Aoa;
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morghulis/core",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -27,12 +27,16 @@
27
27
  "vue": "^3.5.13"
28
28
  },
29
29
  "dependencies": {
30
- "@morghulis/utils": "^0.0.8",
31
30
  "@vueuse/core": "^13.1.0",
32
31
  "axios": "^1.8.1",
33
- "nprogress": "^0.2.0"
32
+ "nprogress": "^0.2.0",
33
+ "js-cookie": "^3.0.5",
34
+ "lodash": "^4.17.21",
35
+ "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
34
36
  },
35
37
  "devDependencies": {
38
+ "@types/js-cookie": "^3.0.6",
39
+ "@types/lodash": "^4.17.18",
36
40
  "@types/nprogress": "^0.2.3",
37
41
  "@types/node": "^22.14.0",
38
42
  "@vitejs/plugin-vue": "^5.2.3",