qcobjects 2.5.102-beta → 2.5.105-beta

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/src/Class.ts CHANGED
@@ -232,7 +232,7 @@ export const Class: TClass = (name?: string, _type?: unknown, _definition?: unkn
232
232
 
233
233
  hierarchy(): any {
234
234
  const __instance__ = this;
235
- return this.getClass().hierarchy(__instance__);
235
+ return this.getClass()?.hierarchy(__instance__);
236
236
  }
237
237
 
238
238
 
@@ -157,7 +157,7 @@ export class InheritClass implements IInheritClass {
157
157
 
158
158
  hierarchy(): any {
159
159
  const __instance__ = this;
160
- return this.getClass().hierarchy(__instance__);
160
+ return (this.constructor as typeof InheritClass).hierarchy(__instance__);
161
161
  }
162
162
 
163
163
 
@@ -1,7 +1,7 @@
1
1
  import { IQCObjectsElement, IQCObjectsShadowedElement } from "types";
2
2
  import { _fireAsyncLoad, asyncLoad } from "./asyncLoad";
3
3
  import { captureFalseTouch } from "./captureFalseTouch";
4
- import { _Cast, _CastProps } from "./Cast";
4
+ import { _Cast } from "./Cast";
5
5
  import { Class } from "./Class";
6
6
  import { ClassFactory } from "./ClassFactory";
7
7
  import { Component } from "./Component";
@@ -425,7 +425,7 @@ import loadSDK from "./loadSDK";
425
425
  Export(_methods_);
426
426
  Export(GlobalSettings);
427
427
 
428
- resetTop(_CastProps(New(GlobalSettings), _top));
428
+ resetTop();
429
429
 
430
430
  (function (_top) {
431
431
 
package/src/QCObjects.ts CHANGED
@@ -97,4 +97,5 @@ export { IQCObjectsElement, IQCObjectsShadowedElement } from "types";
97
97
  export { __to_number } from "./mathFunctions";
98
98
  export {_top as global} from "./top";
99
99
  export {__make_global__} from "./make_global";
100
+ export {get, set} from "./top";
100
101
  export * as QCObjects from "./MainProcess";
package/src/top.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { IComplexStorageCache, IComponent, IConfigService, IQCObjectsElement } from "types";
2
2
  import { buildComponents } from "./ComponentFactory";
3
+ import { _CastProps } from "./Cast";
4
+ import { GlobalSettings } from "./globalSettings";
3
5
 
4
6
  type QCObjects = {
5
7
  lastCache?:IComplexStorageCache,
@@ -89,16 +91,19 @@ type QCObjects = {
89
91
  } & typeof self & typeof global ;
90
92
 
91
93
  export var _top: QCObjects = (
92
- (typeof self !== "undefined" && self) ||
93
- (typeof window !== "undefined" && window) ||
94
- (typeof global !== "undefined" && global) ||
95
- this
96
- ) as QCObjects;
94
+ (typeof module !== "undefined" && typeof module.exports !== "undefined" && module.exports) ||
95
+ (typeof global !== "undefined" && global) ||
96
+ (typeof globalThis !== "undefined" && globalThis) ||
97
+ (typeof window !== "undefined" && window) ||
98
+ (typeof self !== "undefined" && self) ||
99
+ this
100
+ ) as QCObjects;
97
101
  (_top as any).lastCache = undefined;
98
102
  export let componentsStack:IComponent[] = [];
99
103
 
100
- export const resetTop = (_top_: QCObjects) => {
101
- _top = _top_;
104
+ export const resetTop = () => {
105
+ const globalSettings = new GlobalSettings();
106
+ _top = _CastProps(globalSettings, _top);
102
107
  };
103
108
 
104
109
  export const buildComponentsStack = () => {
@@ -108,4 +113,12 @@ export let configService:IConfigService;
108
113
  export const setConfigService = (_configService:IConfigService) => {
109
114
  _top.global.configService = _configService;
110
115
  configService = _configService;
116
+ };
117
+
118
+ export const set = (name:string, value:any):void => {
119
+ _top.set(name, value);
120
+ };
121
+
122
+ export const get = (name:string, _defaultValue?:any):any => {
123
+ return _top.get(name, _defaultValue);
111
124
  };