qcobjects 2.5.124-beta → 2.5.133-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.
Files changed (105) hide show
  1. package/Dockerfile +3 -3
  2. package/VERSION +1 -1
  3. package/build/ArrayCollection.js +2 -2
  4. package/build/Base64.js +14 -12
  5. package/build/ComponentFactory.js +2 -2
  6. package/build/DataStringify.js +1 -1
  7. package/build/DefaultTemplateHandler.js +5 -5
  8. package/build/ObjectName.js +1 -1
  9. package/build/QCObjects.js +0 -1
  10. package/build/Ready.js +3 -3
  11. package/build/WidgetsFactory.js +2 -2
  12. package/build/asyncLoad.js +3 -3
  13. package/build/basePath.js +6 -11
  14. package/build/index.js +1 -1
  15. package/build/introspection.js +1 -1
  16. package/build/is_a.js +1 -1
  17. package/build/is_forbidden_name.js +1 -1
  18. package/build/is_raw_class.js +1 -1
  19. package/build/loadSDK.js +2 -2
  20. package/build/make_global.js +1 -1
  21. package/build/range.js +1 -1
  22. package/build/routings.js +2 -2
  23. package/build/shortCode.js +1 -1
  24. package/build/waitUntil.js +2 -2
  25. package/build-esbuild.js +5 -6
  26. package/eslint.config.mjs +1 -1
  27. package/package.json +17 -9
  28. package/public/browser/QCObjects.js +127 -136
  29. package/public/browser/QCObjects.js.map +4 -4
  30. package/public/cjs/{QCObjects.cjs → index.cjs} +141 -242
  31. package/public/cjs/index.cjs.map +7 -0
  32. package/public/esm/{QCObjects.mjs → index.mjs} +229 -231
  33. package/public/esm/index.mjs.map +7 -0
  34. package/public/types/index.d.ts +99 -108
  35. package/public/types/index.d.ts.map +1 -0
  36. package/spec/helpers/mock-sdk.helper.ts +0 -3
  37. package/spec/testsClassFactorySpec.ts +1 -1
  38. package/spec/testsConfigSpec.ts +1 -1
  39. package/src/ArrayCollection.ts +7 -7
  40. package/src/BackendMicroservice.ts +14 -13
  41. package/src/Base64.ts +87 -87
  42. package/src/CONFIG.ts +3 -3
  43. package/src/Class.ts +1 -1
  44. package/src/ClassFactory.ts +1 -1
  45. package/src/ComplexStorageCache.ts +5 -5
  46. package/src/Component.ts +19 -19
  47. package/src/ComponentFactory.ts +4 -4
  48. package/src/Controller.ts +7 -7
  49. package/src/Crypt.ts +16 -16
  50. package/src/DDO.ts +2 -2
  51. package/src/DOMCreateElement.ts +9 -9
  52. package/src/DataStringify.ts +14 -14
  53. package/src/DefaultTemplateHandler.ts +45 -45
  54. package/src/Effect.ts +7 -7
  55. package/src/Export.ts +6 -6
  56. package/src/IncrementInstanceID.ts +1 -1
  57. package/src/InheritClass.ts +26 -26
  58. package/src/Logger.ts +4 -4
  59. package/src/MainProcess.ts +1 -1
  60. package/src/ObjectName.ts +1 -1
  61. package/src/PrimaryCollections.ts +2 -2
  62. package/src/Processor.ts +20 -20
  63. package/src/QCObjects.ts +1 -2
  64. package/src/Ready.ts +4 -4
  65. package/src/Service.ts +8 -8
  66. package/src/SourceCSS.ts +42 -42
  67. package/src/SourceJS.ts +8 -8
  68. package/src/Tag.ts +4 -4
  69. package/src/Timer.ts +2 -2
  70. package/src/Toggle.ts +2 -2
  71. package/src/TransitionEffect.ts +3 -4
  72. package/src/View.ts +2 -1
  73. package/src/WidgetsFactory.ts +3 -3
  74. package/src/assign.ts +1 -0
  75. package/src/asyncLoad.ts +5 -5
  76. package/src/basePath.ts +7 -14
  77. package/src/captureFalseTouch.ts +1 -1
  78. package/src/componentLoader.ts +1 -1
  79. package/src/defaultProcessors.ts +3 -3
  80. package/src/globalSettings.ts +24 -24
  81. package/src/index.cts +1 -1
  82. package/src/index.mts +1 -1
  83. package/src/index.ts +1 -1
  84. package/src/introspection.ts +78 -78
  85. package/src/is_a.ts +12 -12
  86. package/src/is_forbidden_name.ts +11 -12
  87. package/src/is_raw_class.ts +3 -3
  88. package/src/loadSDK.ts +2 -2
  89. package/src/make_global.ts +1 -1
  90. package/src/range.ts +12 -12
  91. package/src/routings.ts +3 -3
  92. package/src/secretKey.ts +1 -1
  93. package/src/serviceLoader.ts +1 -1
  94. package/src/shortCode.ts +9 -9
  95. package/src/top.ts +4 -4
  96. package/src/types/global/index.d.ts +4 -5
  97. package/src/uniqueID.ts +1 -1
  98. package/src/waitUntil.ts +2 -2
  99. package/tsconfig.d.json +30 -4
  100. package/tsconfig.jasmine.json +30 -5
  101. package/tsconfig.json +18 -2
  102. package/build/index.cjs +0 -7
  103. package/build/index.mjs +0 -2
  104. package/public/cjs/QCObjects.cjs.map +0 -7
  105. package/public/esm/QCObjects.mjs.map +0 -7
package/src/Ready.ts CHANGED
@@ -6,7 +6,7 @@ import { _top } from "./top";
6
6
  /**
7
7
  * Defines a Custom Ready listener
8
8
  */
9
- export const Ready = function Ready(e:any) {
9
+ export const Ready = (e:any):void => {
10
10
  if (isBrowser) {
11
11
  _QC_READY_LISTENERS.push(e.bind(window) as never);
12
12
  } else if (typeof global !== "undefined") {
@@ -14,7 +14,7 @@ export const Ready = function Ready(e:any) {
14
14
  }
15
15
  };
16
16
 
17
- export const ready = Ready; // case insensitive ready option
17
+ export const ready:Function = Ready; // case insensitive ready option
18
18
 
19
19
  /**
20
20
  * Default Ready event function for window. Executes all micro ready events of Import calls
@@ -22,8 +22,8 @@ export const ready = Ready; // case insensitive ready option
22
22
  * @param {Object} e
23
23
  */
24
24
  // eslint-disable-next-line no-unused-vars
25
- export const _Ready = function (e:any) {
26
- const _execReady = function () {
25
+ export const _Ready = (e:any):void => {
26
+ const _execReady = ():void => {
27
27
  // eslint-disable-next-line array-callback-return
28
28
  _QC_READY_LISTENERS.map(function (_ready_listener_, _r):any {
29
29
  if (typeof _ready_listener_ === "function") {
package/src/Service.ts CHANGED
@@ -6,7 +6,7 @@ import { logger } from "./Logger";
6
6
  import { Package } from "./Package";
7
7
  import { _secretKey } from "./secretKey";
8
8
  import { CONFIG } from "./CONFIG";
9
- import { IJSONService, IService, TServiceDoneResponse, TServiceStandardResponse } from "./types/global";
9
+ import { IJSONService, IService, TServiceDoneResponse, TServiceStandardResponse } from "types";
10
10
 
11
11
  export class Service extends InheritClass implements IService{
12
12
  options!: object;
@@ -24,8 +24,8 @@ export class Service extends InheritClass implements IService{
24
24
  }
25
25
  kind = "rest";
26
26
  /* it can be rest, mockup, local */
27
- domain = _domain_;
28
- basePath = _basePath_;
27
+ domain:string = _domain_;
28
+ basePath:string = _basePath_;
29
29
  url = "";
30
30
  method = "GET";
31
31
  data = {};
@@ -44,11 +44,11 @@ export class Service extends InheritClass implements IService{
44
44
  throw new Error("Method not implemented.");
45
45
  }
46
46
 
47
- set(name:string, value:never) {
47
+ set(name:string, value:never):void {
48
48
  this[name] = value;
49
49
  }
50
50
 
51
- get(name:string, _default?:never) {
51
+ get(name:string, _default?:never):any {
52
52
  return this[name] as never || _default;
53
53
  }
54
54
 
@@ -63,7 +63,7 @@ export class JSONService extends Service implements IJSONService{
63
63
  };
64
64
 
65
65
  JSONresponse?:JSON = undefined;
66
- done(result:TServiceDoneResponse) {
66
+ done(result:TServiceDoneResponse):void {
67
67
  logger.debug("***** RECEIVED RESPONSE:");
68
68
  logger.debug(result.service.template as string);
69
69
  this.JSONresponse = JSON.parse(result.service.template as string);
@@ -87,7 +87,7 @@ export class ConfigService extends JSONService {
87
87
  }
88
88
 
89
89
  JSONresponse?:JSON = undefined;
90
- done(result:TServiceDoneResponse) {
90
+ done(result:TServiceDoneResponse):void {
91
91
  logger.debug("***** CONFIG LOADED:");
92
92
  logger.debug(result.service.template as string);
93
93
  this.JSONresponse = JSON.parse(result.service.template as string);
@@ -103,7 +103,7 @@ export class ConfigService extends JSONService {
103
103
  this.configLoaded().catch((e:any)=>{throw new Error (`An error ocurred: ${e}`);});
104
104
  }
105
105
 
106
- fail() {
106
+ fail():void {
107
107
  this.configLoaded().catch((e:any)=>{throw new Error (`An error ocurred: ${e}`);});
108
108
  }
109
109
 
package/src/SourceCSS.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ISourceCSS, TBody } from "./types/global";
1
+ import { ISourceCSS, TBody } from "types";
2
2
  import { _basePath_ } from "./basePath";
3
3
  import { _Cast } from "./Cast";
4
4
  import { _domain_ } from "./domain";
@@ -7,53 +7,53 @@ import { InheritClass } from "./InheritClass";
7
7
  import { isBrowser } from "./platform";
8
8
  import { Package } from "./Package";
9
9
 
10
- export class SourceCSS extends InheritClass implements ISourceCSS {
11
- domain= _domain_;
12
- basePath= _basePath_;
13
- url= "";
14
- data= {};
15
- async= false;
16
- external= false;
10
+ export class SourceCSS extends InheritClass implements ISourceCSS {
11
+ domain: string = _domain_;
12
+ basePath: string = _basePath_;
13
+ url = "";
14
+ data = {};
15
+ async = false;
16
+ external = false;
17
17
 
18
- constructor(o:any){
19
- super(o);
20
- this.body = _DOMCreateElement("link") as TBody;
21
- }
18
+ constructor(o: any) {
19
+ super(o);
20
+ this.body = _DOMCreateElement("link") as TBody;
21
+ }
22
22
  fail(): void {
23
23
  throw new Error("Method not implemented.");
24
24
  }
25
- Cast(o: any):any {
25
+ Cast(o: any): any {
26
26
  return _Cast(this, o);
27
27
  }
28
- set(name:string, value:any) {
29
- this[name] = value;
30
- }
31
- get(name:string, _default?:any):any {
32
- return this[name] || _default;
33
- }
34
- done() { }
35
- rebuild() {
36
- const context = this;
37
- if (isBrowser) {
38
- window.document.getElementsByTagName("head")[0].appendChild(
39
- (function (s:any, url:string, context:any):any {
40
- s.type = "text/css";
41
- s.rel = "stylesheet";
42
- s.href = url;
43
- s.crossOrigin = "anonymous";
44
- s.onreadystatechange = function () {
45
- if (this.readyState === "complete") {
46
- context.done.call(context);
47
- }
48
- };
49
- s.onload = context.done;
50
- context.body = s;
51
- return s;
52
- }).call(this,
53
- _DOMCreateElement("link"),
54
- (this.external) ? (this.url) : (this.basePath + this.url), context));
55
- }
28
+ set(name: string, value: any): void {
29
+ this[name] = value;
30
+ }
31
+ get(name: string, _default?: any): any {
32
+ return this[name] || _default;
33
+ }
34
+ done(): void { }
35
+ rebuild(): void {
36
+ const context = this;
37
+ if (isBrowser) {
38
+ window.document.getElementsByTagName("head")[0].appendChild(
39
+ (function (s: any, url: string, context: any): any {
40
+ s.type = "text/css";
41
+ s.rel = "stylesheet";
42
+ s.href = url;
43
+ s.crossOrigin = "anonymous";
44
+ s.onreadystatechange = function () {
45
+ if (this.readyState === "complete") {
46
+ context.done.call(context);
47
+ }
48
+ };
49
+ s.onload = context.done;
50
+ context.body = s;
51
+ return s;
52
+ }).call(this,
53
+ _DOMCreateElement("link"),
54
+ (this.external) ? (this.url) : (this.basePath + this.url), context));
56
55
  }
57
56
  }
57
+ }
58
58
 
59
- Package("com.qcobjects", [SourceCSS]);
59
+ Package("com.qcobjects", [SourceCSS]);
package/src/SourceJS.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ISourceJS } from "./types/global";
1
+ import { ISourceJS } from "types";
2
2
  import { _basePath_ } from "./basePath";
3
3
  import { _Cast } from "./Cast";
4
4
  import { _domain_ } from "./domain";
@@ -8,8 +8,8 @@ import { Package } from "./Package";
8
8
  import { logger } from "./Logger";
9
9
 
10
10
  export class SourceJS extends InheritClass implements ISourceJS {
11
- domain= _domain_;
12
- basePath= _basePath_;
11
+ domain:string= _domain_;
12
+ basePath:string= _basePath_;
13
13
  type= "text/javascript";
14
14
  containerTag= "body";
15
15
  url= "";
@@ -22,16 +22,16 @@ export class SourceJS extends InheritClass implements ISourceJS {
22
22
  this.body= _DOMCreateElement("script");
23
23
 
24
24
  }
25
- set(name:string, value:any) {
25
+ set(name:string, value:any):void {
26
26
  this[name] = value;
27
27
  }
28
28
  get(name:string, _default?:any):any {
29
29
  return this[name] || _default;
30
30
  }
31
31
  status= false;
32
- done() { }
33
- fail() { }
34
- rebuild() {
32
+ done():void { }
33
+ fail():void { }
34
+ rebuild():void {
35
35
  const context = this;
36
36
  try {
37
37
  document.getElementsByTagName(context.containerTag)[0].appendChild(
@@ -67,7 +67,7 @@ export class SourceJS extends InheritClass implements ISourceJS {
67
67
  Cast(o:any):any {
68
68
  return _Cast(this, o);
69
69
  }
70
- _new_(properties:any) {
70
+ _new_(properties:any):void {
71
71
  this.__new__(properties);
72
72
  this.rebuild();
73
73
  }
package/src/Tag.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IQCObjectsElement, ITagElements } from "./types/global";
1
+ import { IQCObjectsElement, ITagElements } from "types";
2
2
  import { ClassFactory } from "./ClassFactory";
3
3
  import { New } from "./New";
4
4
  import { Package } from "./Package";
@@ -7,17 +7,17 @@ import { Effect } from "./Effect";
7
7
  import { ArrayList } from "./ArrayCollection";
8
8
 
9
9
  export class TagElements extends ArrayList implements ITagElements {
10
- show() {
10
+ show():void {
11
11
  this.map(function (element:any) {
12
12
  return element.style.opacity = 1;
13
13
  });
14
14
  }
15
- hide() {
15
+ hide():void {
16
16
  this.map(function (element:any) {
17
17
  return element.style.opacity = 0;
18
18
  });
19
19
  }
20
- effect<T>(...args:T[]) {
20
+ effect<T>(...args:T[]):void {
21
21
  const effectArguments = [...args].slice(1);
22
22
  const effectClassName = args[0] as string;
23
23
  let effectClass = undefined;
package/src/Timer.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ITimer, TTimerParams } from "./types/global";
1
+ import { ITimer, TTimerParams } from "types";
2
2
  import { InheritClass } from "./InheritClass";
3
3
  import { Package } from "./Package";
4
4
 
@@ -11,7 +11,7 @@ export class Timer extends InheritClass implements ITimer {
11
11
  timing,
12
12
  intervalInterceptor,
13
13
  duration
14
- }:TTimerParams) {
14
+ }:TTimerParams):void {
15
15
  const timer = this;
16
16
 
17
17
  const start = performance.now();
package/src/Toggle.ts CHANGED
@@ -14,7 +14,7 @@ export class Toggle extends InheritClass {
14
14
  this._new_({positive, negative, args});
15
15
  }
16
16
 
17
- changeToggle() {
17
+ changeToggle():void {
18
18
  this._toggle = !(this._toggle);
19
19
  }
20
20
 
@@ -22,7 +22,7 @@ export class Toggle extends InheritClass {
22
22
  positive,
23
23
  negative,
24
24
  args
25
- }:{positive: Function, negative: Function, args: Array<any>}) {
25
+ }:{positive: Function, negative: Function, args: Array<any>}):void {
26
26
  this._positive = positive;
27
27
  this._negative = negative;
28
28
  this._args = args;
@@ -2,8 +2,7 @@ import { Effect } from "./Effect";
2
2
  import { logger } from "./Logger";
3
3
  import { Package } from "./Package";
4
4
  import { ClassFactory } from "./ClassFactory";
5
- import { IQCObjectsElement, IQCObjectsShadowedElement } from "./types/global";
6
- import { ITransitionEffect, IComponent, TTransitionEffectParams } from "./types/global";
5
+ import { ITransitionEffect, IComponent, TTransitionEffectParams } from "types";
7
6
 
8
7
  export class TransitionEffect extends Effect implements ITransitionEffect{
9
8
  duration = 385;
@@ -33,10 +32,10 @@ export class TransitionEffect extends Effect implements ITransitionEffect{
33
32
  radiusTo,
34
33
  scaleFrom,
35
34
  scaleTo
36
- }: TTransitionEffectParams) {
35
+ }: TTransitionEffectParams):void {
37
36
  const _transition_ = this;
38
37
  logger.info("EXECUTING TransitionEffect ");
39
- const componentRoot =_transition_.component.componentRoot as IQCObjectsElement | IQCObjectsShadowedElement | HTMLElement | ShadowRoot;
38
+ const componentRoot =_transition_.component.componentRoot;
40
39
 
41
40
  if (typeof componentRoot !== "undefined" && componentRoot !== null){
42
41
  if (_transition_.fitToHeight) {
package/src/View.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import { __getType__ } from "./getType";
2
2
  import { InheritClass } from "./InheritClass";
3
3
  import { Package } from "./Package";
4
+ import { TViewParams } from "types";
4
5
 
5
6
  export class View extends InheritClass {
6
- constructor({ component = undefined, dependencies = [] }) {
7
+ constructor({ component = undefined, dependencies = [] }:TViewParams) {
7
8
  super({component, dependencies});
8
9
  if (typeof this.component === "undefined" || this.component === "null") {
9
10
  throw Error(`${__getType__(this)} must be called with a component`);
@@ -4,7 +4,7 @@ import { _DOMCreateElement } from "./DOMCreateElement";
4
4
  import { Export } from "./Export";
5
5
  import { _protected_code_ } from "./introspection";
6
6
  import { isBrowser } from "./platform";
7
- import { I_ComponentWidget_ } from "./types/global";
7
+ import { I_ComponentWidget_ } from "types";
8
8
 
9
9
  class QCObjectsWidgetNode implements I_ComponentWidget_ {
10
10
  writingSuggestions!: string;
@@ -526,14 +526,14 @@ if (isBrowser) {
526
526
  };
527
527
  }
528
528
  Export(_ComponentWidget_);
529
- export const RegisterWidget = function (widgetName: string) {
529
+ export const RegisterWidget = (widgetName: string):void => {
530
530
  if (isBrowser){
531
531
  customElements.define(widgetName, class extends _ComponentWidget_ { });
532
532
  } else {
533
533
  throw new Error ("RegisterWidget is not implemented for non browser ecosystems yet.");
534
534
  }
535
535
  };
536
- export const RegisterWidgets = function (...args: string[]) {
536
+ export const RegisterWidgets = (...args: string[]):void =>{
537
537
  const widgetList = [...args];
538
538
  widgetList.filter(function (widgetName) {
539
539
  return typeof widgetName === "string";
package/src/assign.ts CHANGED
@@ -31,3 +31,4 @@
31
31
  configurable: true
32
32
  });
33
33
  }
34
+ export {};
package/src/asyncLoad.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { TAsyncLoadCallback } from "./types/global";
1
+ import { TAsyncLoadCallback } from "types";
2
2
  import { Export } from "./Export";
3
3
  import { isBrowser } from "./platform";
4
4
  import { _top } from "./top";
5
5
 
6
- export const _asyncLoad = [];
6
+ export const _asyncLoad:any[] = [];
7
7
  export function asyncLoad(callback: TAsyncLoadCallback, args?: any[]): any {
8
8
 
9
9
  class AsyncCallback {
@@ -21,20 +21,20 @@ export function asyncLoad(callback: TAsyncLoadCallback, args?: any[]): any {
21
21
  return AsyncCallback;
22
22
  }
23
23
 
24
- export const _fireAsyncLoad = function () {
24
+ export const _fireAsyncLoad = ():void => {
25
25
  if (isBrowser){
26
26
  document.addEventListener("readystatechange", () => {
27
27
  if (document.readyState === "complete") {
28
28
  // eslint-disable-next-line array-callback-return
29
29
  _asyncLoad.map(function (fc) {
30
- (fc as any).dispatch.call(fc);
30
+ (fc).dispatch.call(fc);
31
31
  });
32
32
  }
33
33
  });
34
34
  } else if (typeof _top.global !== "undefined") {
35
35
  // eslint-disable-next-line array-callback-return
36
36
  _asyncLoad.map(function (fc) {
37
- (fc as any).dispatch.call(fc);
37
+ (fc).dispatch.call(fc);
38
38
  });
39
39
  }
40
40
  };
package/src/basePath.ts CHANGED
@@ -1,21 +1,14 @@
1
- import { logger } from "./Logger";
2
- import { _require_, isBrowser } from "./platform";
1
+ import { isBrowser } from "./platform";
2
+ import process from "node:process";
3
3
 
4
- export var _basePath_ = (
5
- function () {
6
- let _basePath = "";
4
+ export var _basePath_:string = (
5
+ function ():string {
6
+ let _basePath:string = "";
7
7
  if (isBrowser) {
8
- const baseURI = document.baseURI.split("?")[0].split("/");
8
+ const baseURI:string[] = document.baseURI.split("?")[0].split("/");
9
9
  baseURI.pop();
10
10
  _basePath = baseURI.join("/") + "/";
11
11
  } else {
12
- let process;
13
- try {
14
- process = _require_("process");
15
- } catch (e:any) {
16
- logger.debug(`An error ocurred: ${e}.`);
17
- // not a process module
18
- }
19
12
  if (typeof process !== "undefined") {
20
13
  _basePath = `${(process).cwd()}/`;
21
14
  } else {
@@ -26,4 +19,4 @@ export var _basePath_ = (
26
19
  }
27
20
  )();
28
21
 
29
- export const setBasePath = (value:string) => { _basePath_ = value;};
22
+ export const setBasePath = (value:string):void => { _basePath_ = value;};
@@ -2,7 +2,7 @@ import { logger } from "./Logger";
2
2
  import { isBrowser } from "./platform";
3
3
 
4
4
  export let supportsPassive = false;
5
- export const captureFalseTouch = () => {
5
+ export const captureFalseTouch = ():boolean | { passive: boolean; } => {
6
6
  return (supportsPassive) ? ({
7
7
  passive: true
8
8
  }) : (false);
@@ -1,4 +1,4 @@
1
- import { IComponent, TCacheController } from "./types/global";
1
+ import { IComponent, TCacheController } from "types";
2
2
  import { asyncLoad } from "./asyncLoad";
3
3
  import { ComplexStorageCache } from "./ComplexStorageCache";
4
4
  import { _DataStringify } from "./DataStringify";
@@ -2,11 +2,11 @@ import { logger } from "./Logger";
2
2
  import { GlobalProcessor as Processor } from "./Processor";
3
3
  import { _top } from "./top";
4
4
  import { range } from "./range";
5
- import { IComponent } from "./types/global";
5
+ import { IComponent } from "types";
6
6
 
7
7
  // Set Processors
8
- export const setDefaultProcessors = () => {
9
- (function (_top) {
8
+ export const setDefaultProcessors = ():void => {
9
+ (function (_top):void {
10
10
 
11
11
  const mapper = (componentInstance:IComponent, componentName:string, valueName:string):string => {
12
12
  /*
@@ -1,4 +1,4 @@
1
- import { IGlobalSettings } from "./types/global";
1
+ import { IGlobalSettings } from "types";
2
2
  import { CONFIG } from "./CONFIG";
3
3
  import { InheritClass } from "./InheritClass";
4
4
  import { Logger, logger } from "./Logger";
@@ -8,36 +8,36 @@ import { serviceLoader } from "./serviceLoader";
8
8
  import { _top, buildComponentsStack, configService, setConfigService } from "./top";
9
9
  import { ConfigService } from "./Service";
10
10
 
11
- export class GlobalSettings extends InheritClass implements IGlobalSettings{
12
- static __start__() {
11
+ export class GlobalSettings extends InheritClass implements IGlobalSettings {
12
+ static __start__(): Promise<any> {
13
13
  return GlobalSettings.instance.__start__();
14
14
  }
15
15
  [key: string]: any;
16
16
 
17
- _GLOBAL:any = {};
18
- private static _instance:GlobalSettings;
19
- static get instance ():GlobalSettings{
20
- if (typeof GlobalSettings._instance === "undefined"){
17
+ _GLOBAL: any = {};
18
+ private static _instance: GlobalSettings;
19
+ static get instance(): GlobalSettings {
20
+ if (typeof GlobalSettings._instance === "undefined") {
21
21
  GlobalSettings._instance = new GlobalSettings();
22
22
  }
23
23
  return GlobalSettings._instance;
24
24
  }
25
25
 
26
- protected _logger:Logger = new Logger();
27
- get logger ():Logger {
26
+ protected _logger: Logger = new Logger();
27
+ get logger(): Logger {
28
28
  return this._logger;
29
29
  }
30
30
 
31
- set logger (value:Logger) {
31
+ set logger(value: Logger) {
32
32
  this._logger = value;
33
33
  }
34
34
 
35
- set(name: string, value: any) {
35
+ set(name: string, value: any): void {
36
36
  this._GLOBAL[name] = value;
37
37
  }
38
38
 
39
- get(name: string, _default?: any):any {
40
- let _value:any;
39
+ get(name: string, _default?: any): any {
40
+ let _value: any;
41
41
  if (typeof this._GLOBAL[name] !== "undefined") {
42
42
  _value = this._GLOBAL[name];
43
43
  } else if (typeof _default !== "undefined") {
@@ -46,7 +46,7 @@ export class GlobalSettings extends InheritClass implements IGlobalSettings{
46
46
  return _value;
47
47
  }
48
48
 
49
- __start__():Promise<any> {
49
+ __start__(): Promise<any> {
50
50
  const __load__serviceWorker = function () {
51
51
  let _promise: Promise<ServiceWorkerRegistration> | Promise<unknown>;
52
52
  if (isBrowser) {
@@ -97,26 +97,26 @@ export class GlobalSettings extends InheritClass implements IGlobalSettings{
97
97
  });
98
98
  };
99
99
 
100
- return new Promise<any> ((resolve) => {
100
+ return new Promise<any>((resolve) => {
101
101
  logger.debug("Starting to load the config settings...");
102
102
  if (CONFIG.get("useConfigService", false)) {
103
103
  logger.debug("Loading settings using local configuration file...");
104
104
  setConfigService(new ConfigService());
105
105
  configService.configLoaded = _buildComponents;
106
106
  serviceLoader(configService)
107
- ?.then((standardResponse:any)=> {
108
- resolve(standardResponse);
109
- })
110
- ?.catch ((e:any) => {throw new Error (`An error ocurred while trying to load ${configService.url}: ${e}`);});
107
+ ?.then((standardResponse: any) => {
108
+ resolve(standardResponse);
109
+ })
110
+ ?.catch((e: any) => { throw new Error(`An error ocurred while trying to load ${configService.url}: ${e}`); });
111
111
  } else {
112
112
  logger.debug("Starting to load the components...");
113
113
  _buildComponents.call(this)
114
- .then(()=> {
115
- resolve({});
116
- })
117
- .catch((e:any) => {throw new Error (`An error ocurred while trying to build the components stack. ${e}`);});
114
+ .then(() => {
115
+ resolve({});
116
+ })
117
+ .catch((e: any) => { throw new Error(`An error ocurred while trying to build the components stack. ${e}`); });
118
118
  }
119
-
119
+
120
120
  });
121
121
  }
122
122
 
package/src/index.cts CHANGED
@@ -1,2 +1,2 @@
1
- import QCObjects from "./qcobjects.js";
1
+ import * as QCObjects from "./QCObjects";
2
2
  module.exports = QCObjects;
package/src/index.mts CHANGED
@@ -1,2 +1,2 @@
1
- import QCObjects from "./qcobjects.js";
1
+ import * as QCObjects from "./QCObjects";
2
2
  export default QCObjects;
package/src/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- import * as QCObjects from "./qcobjects";
1
+ import * as QCObjects from "./QCObjects";
2
2
  export default QCObjects;