@tachybase/globals 1.3.52 → 1.3.54-alpha.0

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/lib/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Settings } from './settings';
1
2
  declare class TachybaseGlobal {
2
3
  #private;
3
4
  private static instance;
@@ -10,5 +11,8 @@ declare class TachybaseGlobal {
10
11
  delete(key: string): boolean;
11
12
  clear(): void;
12
13
  toJSON(): Record<string, any>;
14
+ static set settings(settings: Settings);
15
+ static get settings(): Settings;
13
16
  }
14
17
  export default TachybaseGlobal;
18
+ export type { Settings };
package/lib/index.js CHANGED
@@ -69,6 +69,12 @@ const _TachybaseGlobal = class _TachybaseGlobal {
69
69
  toJSON() {
70
70
  return { ...Object.fromEntries([...this.dataMap.entries()].filter(([key]) => key !== "PRESETS")), id: __privateGet(this, _id) };
71
71
  }
72
+ static set settings(settings) {
73
+ _TachybaseGlobal.getInstance().set("settings", settings);
74
+ }
75
+ static get settings() {
76
+ return _TachybaseGlobal.getInstance().get("settings");
77
+ }
72
78
  };
73
79
  _id = new WeakMap();
74
80
  __name(_TachybaseGlobal, "TachybaseGlobal");
@@ -0,0 +1,23 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var settings_d_exports = {};
19
+ __export(settings_d_exports, {
20
+ default: () => settings_d_default
21
+ });
22
+ module.exports = __toCommonJS(settings_d_exports);
23
+ var settings_d_default = config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachybase/globals",
3
- "version": "1.3.52",
3
+ "version": "1.3.54-alpha.0",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./lib/index.js",