beer-network 1.2.10 → 1.3.2

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/api.d.ts CHANGED
@@ -36,7 +36,13 @@ export default class Fetch {
36
36
  * 请求地址.
37
37
  */
38
38
  private readonly pathPrefix;
39
+ /**
40
+ * 是否是NodeJS 环境.
41
+ */
39
42
  private readonly isNode;
43
+ /**
44
+ * 是否支持 NextJs 框架.
45
+ */
40
46
  private isNextJS;
41
47
  constructor(pathPrefix?: string);
42
48
  private sendBody;
package/api.js CHANGED
@@ -1,8 +1,19 @@
1
- import { Session } from './session';
2
- import { getNodeHeaders } from './NextHeadersLazy';
1
+ import Session from './session';
2
+ import { getNodeHeaders } from './next-headers';
3
3
  export default class Fetch {
4
+ /**
5
+ * 请求地址.
6
+ */
7
+ pathPrefix;
8
+ /**
9
+ * 是否是NodeJS 环境.
10
+ */
11
+ isNode;
12
+ /**
13
+ * 是否支持 NextJs 框架.
14
+ */
15
+ isNextJS = undefined;
4
16
  constructor(pathPrefix) {
5
- this.isNextJS = undefined;
6
17
  this.pathPrefix = pathPrefix || '';
7
18
  this.isNode = typeof process !== 'undefined' && !!process.versions?.node;
8
19
  }
@@ -22,10 +22,11 @@ export default class ElementUtils {
22
22
  */
23
23
  static async selectDirectory() {
24
24
  if (!window.showDirectoryPicker) {
25
+ // eslint-disable-next-line no-alert
25
26
  alert('您的浏览器不支持文件夹选择功能');
26
27
  return undefined;
27
28
  }
28
- return await window.showDirectoryPicker();
29
+ return window.showDirectoryPicker();
29
30
  }
30
31
  /**
31
32
  * 下载文件.
package/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export { default as Utils } from './utils';
2
+ export { default as ElementUtils } from './element-utils';
3
+ export { default as Fetch, JsonResponse, RequestData, Option } from './api';
4
+ export { default as Session } from './session';
package/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export { default as Utils } from './utils';
2
+ export { default as ElementUtils } from './element-utils';
3
+ export { default as Fetch } from './api';
4
+ export { default as Session } from './session';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "beer-network",
3
3
  "private": false,
4
- "version": "1.2.10",
4
+ "version": "1.3.2",
5
5
  "scripts": {
6
6
  "pub-w": "tsc && copy package.json .\\dist\\package.json && npm publish ./dist",
7
7
  "pub-m": "tsc && cp package.json ./dist/package.json && npm publish ./dist"
package/session.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare class Session {
1
+ export default class Session {
2
2
  /**
3
3
  * 获取令牌.
4
4
  * <li>window.sessionKey 设置读取缓存用户信息的Key, 默认 login_user.</li>
package/session.js CHANGED
@@ -1,4 +1,4 @@
1
- export class Session {
1
+ export default class Session {
2
2
  /**
3
3
  * 获取令牌.
4
4
  * <li>window.sessionKey 设置读取缓存用户信息的Key, 默认 login_user.</li>
File without changes
File without changes
File without changes