qcobjects 2.4.104-ts → 2.4.107-ts

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/index.d.ts CHANGED
@@ -1,11 +1,8 @@
1
- // Type definitions for QCObjects 2.4
2
- // Project: https://qcobjects.dev
3
- // Definitions by: Jean Machuca <https://github.com/jeanmachuca>
4
- // Definitions: https://qcobjects.dev
5
-
6
- /**
7
- */
8
-
9
- import QCObjects from "qcobjects";
10
-
11
- export = QCObjects;
1
+ declare module "QCObjects" {
2
+ const _exports: any;
3
+ export = _exports;
4
+ }
5
+ declare module "index" {
6
+ import QCObjects from "QCObjects";
7
+ export default QCObjects;
8
+ }
package/tsconfig.d.json CHANGED
@@ -8,11 +8,11 @@
8
8
  "strictPropertyInitialization": true,
9
9
  "noImplicitThis": true,
10
10
  "alwaysStrict": true,
11
- "outFile": "src/types.d.ts",
11
+ "outFile": "src/index.d.ts",
12
12
  "typeRoots": ["types", "node_modules/@types", "@typescript-eslint"],
13
13
  "allowSyntheticDefaultImports":true,
14
14
  "esModuleInterop": true
15
15
  },
16
- "include": ["src/**/*.ts", "src/static/js/packages/components/*.d.ts"],
16
+ "include": ["src/**/*.ts", "src/static/js/packages/components/*.d.ts", "types/*.d.ts"],
17
17
  "exclude": ["src/**/*.spec.js", "src/*.js", "src/*.d.ts", "src/**/*.d.ts"]
18
18
  }
package/tsconfig.json CHANGED
@@ -1,12 +1,17 @@
1
1
  {
2
2
  "extends": ["qcobjects-tsconfig/tsconfig.json"],
3
3
  "compilerOptions": {
4
+ "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
5
+ "lib": ["ESNext", "DOM"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
6
+ "module": "NodeNext", /* Specify what module code is generated. */
4
7
  "rootDir": "src", /* Specify the root folder within your source files. */
5
8
  "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
6
9
  "outDir": "build", /* Specify an output folder for all emitted files. */
7
10
  "allowSyntheticDefaultImports":true,
8
- "esModuleInterop": true
11
+ "esModuleInterop": true,
12
+ "baseUrl": ".",
13
+ "typeRoots": ["types", "node_modules/@types", "@typescript-eslint"]
9
14
  },
10
15
  "include": ["src/**/*.ts", "src/**/*.mts", "src/**/*.cts"],
11
- "exclude": ["src/**/*.spec.js", "src/*.js"]
16
+ "exclude": ["src/**/*.spec.js", "src/*.js","src/*.d.ts", "src/**/*.d.ts"]
12
17
  }
@@ -0,0 +1,472 @@
1
+ // Type definitions for QCObjects 2.4
2
+ // Project: https://qcobjects.dev
3
+ // Definitions by: Jean Machuca <https://github.com/jeanmachuca>
4
+ // Definitions: https://qcobjects.dev
5
+
6
+ import { ClientRequest } from "http";
7
+ import { Http2SecureServer, Http2Server, Http2ServerRequest, Http2Stream } from "http2";
8
+ import { Stream } from "stream";
9
+
10
+ declare namespace QCObjects {
11
+ type Microservice = {
12
+ domain: string;
13
+ basePath: string;
14
+ body: any;
15
+ stream?: Http2Stream | Stream;
16
+ request?: Http2ServerRequest | ClientRequest;
17
+ }
18
+
19
+ class Route {
20
+ name: string;
21
+ description?: string;
22
+ path: string;
23
+ microservice: string;
24
+ redirect_to?: string;
25
+ headers?: any;
26
+ responseHeaders?: any;
27
+ cors?: any;
28
+ }
29
+
30
+ class BackendMicroservice extends InheritClass {
31
+ domain: string;
32
+ body: QCObjectsElement | QCObjectsShadowedElement | HTMLElement | string | undefined;
33
+ basePath: string;
34
+ route: Route;
35
+ projectPath?: string;
36
+ stream?: Http2Stream | Stream;
37
+ request?: Http2ServerRequest | ClientRequest;
38
+ routeParams?: any;
39
+ server: Http2SecureServer | Http2Server;
40
+
41
+ constructor(microservice: Microservice);
42
+
43
+ cors(): void;
44
+ head(formData?: object | string): void;
45
+ get(formData?: object | string): void;
46
+ post(formData?: object | string): void;
47
+ put(formData?: object | string): void;
48
+ delete(formData?: object | string): void;
49
+ connect(formData?: object | string): void;
50
+ options(formData?: object | string): void;
51
+ trace(formData?: object | string): void;
52
+ patch(formData?: object | string): void;
53
+ finishWithBody(stream?: Http2Stream | Stream): void;
54
+ done(): void;
55
+
56
+ }
57
+
58
+
59
+ class QCObjectsElement extends HTMLElement {
60
+ subelements(query: string): Array<HTMLElement | QCObjectsElement>;
61
+ }
62
+ class QCObjectsShadowedElement extends ShadowRoot {
63
+ style: any;
64
+ subelements(query: string): Array<ShadowRoot | HTMLElement | QCObjectsShadowedElement | QCObjectsElement>;
65
+ }
66
+
67
+ class Logger {
68
+ debugEnabled: boolean;
69
+ infoEnabled: boolean;
70
+ warnEnabled: boolean;
71
+ debug(message: any): string;
72
+ warn(message: any): string;
73
+ info(message: any): string;
74
+
75
+ }
76
+ function Class(className: string, extendsFrom: any, definition: any): any;
77
+ class _Crypt {
78
+ last_string: string;
79
+ last_key: string;
80
+ construct: boolean;
81
+ _new_(o: any): void;
82
+ _encrypt(): string;
83
+ _decrypt(): string;
84
+ static encrypt(_string_: string, key: string): string;
85
+ static decrypt(_string_: string, key: string): string;
86
+
87
+ }
88
+ class TagElements extends Array {
89
+ show(): void;
90
+ hide(): void;
91
+ effect(): void;
92
+ findElements(elementName: string): TagElements;
93
+ }
94
+ class DefaultTemplateHandler {
95
+ template: string;
96
+ __definition: any;
97
+ constructor({ component, template });
98
+ assign(data: any): any;
99
+ }
100
+ class SourceJS {
101
+ domain: string;
102
+ basePath: string;
103
+ body: QCObjectsElement | HTMLElement;
104
+ type: string;
105
+ containerTag: string;
106
+ url: string;
107
+ data: any;
108
+ async: boolean;
109
+ external: boolean;
110
+ set(name: string, value: any): void;
111
+ get(name: string): any;
112
+ status: boolean;
113
+ done(): void;
114
+ fail(): void;
115
+ rebuild(): void;
116
+ Cast(o: any): any;
117
+ _new_(properties: any): void;
118
+
119
+ }
120
+ class SourceCSS {
121
+ domain: string;
122
+ basePath: string;
123
+ body: QCObjectsElement | HTMLElement;
124
+ url: string;
125
+ data: any;
126
+ async: boolean;
127
+ external: boolean;
128
+ set(name: string, value: any): void;
129
+ get(name: string): any;
130
+ done(): void;
131
+ fail(): void;
132
+ rebuild(): void;
133
+ Cast(o: any): any;
134
+ _new_(properties: any): void;
135
+
136
+ }
137
+ class ArrayList extends Array { }
138
+ class ArrayCollection {
139
+ source: ArrayList;
140
+ changed(prop: string, value: any): any;
141
+ push(value: any): void;
142
+ pop(value: any): void;
143
+ _new_(source: ArrayList): void;
144
+ }
145
+ class GlobalSettings {
146
+ _GLOBAL: any;
147
+ set(name: string, value: any): void;
148
+ get(name: string, _default: any): any;
149
+ static __start__(): Promise<any>;
150
+ }
151
+ class GLOBAL extends GlobalSettings { }
152
+ class DDO {
153
+ constructor({
154
+ instance,
155
+ name: string,
156
+ fget,
157
+ fset,
158
+ value: any
159
+ });
160
+ }
161
+ type CacheController = {
162
+ cache:ComplexStorageCache;
163
+ cachedObjectID:string;
164
+ cachedResponse?:any;
165
+ }
166
+ type ComplexCacheParams = {
167
+ index:string;
168
+ load (cacheController?:CacheController):any;
169
+ alternate(cacheController?:CacheController):any;
170
+ }
171
+ class ComplexStorageCache {
172
+ object: any;
173
+ index: string;
174
+ load(cacheController: ComplexStorageCache): void;
175
+ alternate(cacheController: ComplexStorageCache): void;
176
+ clear(): void;
177
+ getCached(object: any): any;
178
+ getID(object: any): any;
179
+ getItem(cachedObjectID: string): JSON | null;
180
+ setItem(cachedObjectID: string, value: any): void;
181
+ isEmpty(object: any): boolean;
182
+ save(object: any, cachedNewResponse: string): void;
183
+
184
+ constructor(cache:ComplexCacheParams);
185
+
186
+ }
187
+ class _ComponentWidget_ extends HTMLElement { }
188
+
189
+ function asyncLoad(callback: Function, args: Array<any>): any;
190
+ function RegisterClass(_class_: any, namespace: string): void;
191
+ function ComponentURI({ COMPONENTS_BASE_PATH, COMPONENT_NAME, TPLEXTENSION, TPL_SOURCE }): string;
192
+ function waitUntil(func: Function, exp: Function): void;
193
+ function _super_(className: string, classMethodName: string, params?: Array<any>): any;
194
+ function _DOMCreateElement(elementName: string): QCObjectsElement | HTMLElement;
195
+ function shortCode(): string;
196
+ function __getType__(_class_: any): string;
197
+ function is_a(obj: any, typeName: string): boolean;
198
+ function _DataStringify(data: any): string;
199
+ function serviceLoader(service: Service, _async: boolean): Promise<any>;
200
+ function componentLoader(component: Component, _async: boolean): Promise<any>;
201
+ function ObjectName(o: any): string;
202
+ function isQCObjects_Class(_: any): boolean;
203
+ function isQCObjects_Object(_: any): boolean;
204
+ function NamespaceRef(namespace: string): any;
205
+ function RegisterWidget(widgetName: string): void;
206
+ function RegisterWidgets(...widgetList: Array<string>): void;
207
+ function range(start: number, stop: number, step: number): Array<any>;
208
+ function getDocumentLayout(): string;
209
+ function Export(fn: Function): Function;
210
+ function New(__class__: any, args: any): any;
211
+ function Tag(tagName: string, innerHTML?: string): TagElements;
212
+ function Ready(e: Function): void;
213
+ function _methods_(_: any): Array<any>;
214
+ function set(_: any, _value_: any): any;
215
+ function get(_: any, _defaultValue_: any): any;
216
+ function __start__(): void;
217
+
218
+
219
+
220
+ class InheritClass {
221
+ __instanceID: number;
222
+ __classType?: string;
223
+ __definition?: any;
224
+ __new__?(): void;
225
+ __namespace?: string;
226
+ body?: QCObjectsElement | QCObjectsShadowedElement | HTMLElement | string | null | undefined;
227
+ constructor(o?:any);
228
+ }
229
+
230
+ class Processor extends InheritClass {
231
+ component: Component;
232
+ processors: Array<any>;
233
+ process(template: string, component: Component): any;
234
+ processObject(obj: any, component: Component): any;
235
+ setProcessor(proc: Function): any;
236
+ constructor(...args: Array<any>);
237
+
238
+ }
239
+
240
+ type ComponentParams = {
241
+ name: string;
242
+ template?: string;
243
+ templateURI?: string;
244
+ tplsource?: string;
245
+ tplextension?: string;
246
+ url?: string;
247
+ method?: string;
248
+ data?: any;
249
+ reload?: boolean;
250
+ shadowed?: boolean;
251
+ cached?: boolean;
252
+ _body?: QCObjectsElement;
253
+ __promise__?: Promise<any>;
254
+ __shadowRoot?: QCObjectsShadowedElement;
255
+ body?: QCObjectsElement;
256
+ shadowRoot?: QCObjectsShadowedElement;
257
+ splashScreenComponent?: Component;
258
+ controller?: Controller;
259
+ view?: View;
260
+ };
261
+
262
+ type ComponentDoneResponse = {
263
+ request?: XMLHttpRequest;
264
+ component?: Component;
265
+ };
266
+
267
+ class Component extends InheritClass {
268
+ name: string;
269
+ _body: QCObjectsElement | HTMLElement;
270
+ body: QCObjectsElement | HTMLElement;
271
+ templateURI: string;
272
+ tplsource: string;
273
+ tplextension: string;
274
+ template: string;
275
+ validRoutingWays: Array<string>;
276
+ basePath: string;
277
+ domain: string;
278
+ templateHandler: string;
279
+ processorHandler: Processor;
280
+ routingWay: string;
281
+ routingNodes: Array<QCObjectsElement | HTMLElement>;
282
+ routings: Array<any>;
283
+ routingPath: string;
284
+ routingPaths: Array<string>;
285
+ _componentHelpers: Array<any>;
286
+ subcomponents: Array<Component>;
287
+ splashScreenComponent?: Component;
288
+ controller: Controller | null;
289
+ view: View | null;
290
+ effect: Effect;
291
+ effectClass: string;
292
+ method: string;
293
+ static cached: boolean;
294
+ __promise__?: Promise<any>;
295
+ data: any;
296
+ shadowed?: boolean;
297
+ shadowRoot?: QCObjectsShadowedElement;
298
+ cacheIndex: string;
299
+ parsedAssignmentText: string;
300
+ routingSelected: Array<any>;
301
+ routingParams: {};
302
+ subtags: Array<HTMLElement | QCObjectsElement | QCObjectsShadowedElement>;
303
+ bodyAttributes: any;
304
+ dataAttributes: any;
305
+ serviceData?:any;
306
+ constructor(component: ComponentParams);
307
+ static route(): Promise<Component[]>;
308
+ __done__(): Promise<void>;
309
+ _bindroute(): void;
310
+ __buildSubComponents__(rebuildObjects: boolean): Array<Component>;
311
+ _generateRoutingPaths(componentBody: QCObjectsElement | HTMLElement): Promise<void>;
312
+ _reroute_(): Promise<Component>;
313
+ createServiceInstance(): Promise<JSON | string | null>;
314
+ createControllerInstance(): Promise<{ component: Component, controller: Controller }>;
315
+ createEffectInstance(): Promise<{ component: Component, effect: Effect }>;
316
+ createViewInstance(): Promise<{ component: Component, view: View }>;
317
+ done(standardResponse: ComponentDoneResponse): Promise<ComponentDoneResponse>;
318
+ fail({ error: any, component: Component });
319
+ hostElements(tagFilter: string): Array<HTMLElement | QCObjectsElement | QCObjectsShadowedElement>;
320
+ set(name: string, value: any): void;
321
+ get(name: string): any;
322
+ feedComponent(): void;
323
+ rebuild(): Promise<{ request: XMLHttpRequest, component: Component }>;
324
+ Cast(oClass: any): any;
325
+ fullscreen(): void;
326
+ closefullscreen(): void;
327
+ parseTemplate(template: string): string;
328
+ lazyLoadImages(): any | null;
329
+ applyTransitionEffect(effectClassName: string): void;
330
+ applyObserveTransitionEffect(effectClassName: string): void | null;
331
+ scrollIntoHash(): void;
332
+ i18n_translate(): void;
333
+ addComponentHelper(componentHelper: Function): void;
334
+ runComponentHelpers(): void;
335
+
336
+ }
337
+
338
+ class CONFIG extends InheritClass {
339
+ _CONFIG_ENC: string;
340
+ _CONFIG: any;
341
+ static set(_: any, _value_: any): any;
342
+ static get(_: any, _defaultValue_: any): any;
343
+ __definition: any;
344
+ }
345
+
346
+ type ControllerParams = {
347
+ component: Component;
348
+ dependencies: Array<any>;
349
+ };
350
+
351
+ class Controller {
352
+ __classType: string;
353
+ __definition: any;
354
+ __new__(): any;
355
+ __namespace: string;
356
+ body?: QCObjectsElement | HTMLElement;
357
+ component: Component;
358
+ dependencies?: Array<any>;
359
+ constructor(controller: ControllerParams);
360
+ routingSelectedAttr(attrName: string): any;
361
+ isTouchable(): boolean;
362
+ onpress(subelementSelector: string, handler: EventListener): void;
363
+ createRoutingController(): void;
364
+
365
+
366
+ done(...args: Array<any>);
367
+ fail(...args: Array<any>);
368
+ }
369
+
370
+ type ViewParams = {
371
+ component: Component;
372
+ dependencies: Array<any>;
373
+ };
374
+
375
+ class View {
376
+ __classType: string;
377
+ __definition: any;
378
+ __new__(): any;
379
+ __namespace: string;
380
+ body: QCObjectsElement | HTMLElement;
381
+ component: Component;
382
+ constructor(view: ViewParams);
383
+ done(...args: Array<any>);
384
+ fail(...args: Array<any>);
385
+ }
386
+
387
+ class Service extends InheritClass {
388
+ kind: string;
389
+ domain: string;
390
+ basePath: string;
391
+ url: string;
392
+ method: string;
393
+ data: any;
394
+ reload: boolean;
395
+ cached: boolean;
396
+ headers: any;
397
+ template: any;
398
+ set(name: string, value: any): void;
399
+ get(name: string): any;
400
+ done({ request: XMLHttpRequest, service: Service });
401
+ fail(...args: Array<any>);
402
+ }
403
+ class JSONService extends Service {
404
+ JSONresponse: JSON;
405
+ }
406
+ class ConfigService extends JSONService {
407
+ configFileName: string;
408
+ }
409
+ class VO { }
410
+ type EffectParams = {
411
+ duration:number;
412
+ timing(timeFraction:number):number;
413
+ draw(progress:number);
414
+ };
415
+
416
+ class Effect extends InheritClass {
417
+ duration: number;
418
+ apply(...args: Array<any>): any;
419
+ animate (effect:EffectParams);
420
+ }
421
+ class TransitionEffect extends Effect {
422
+ component: Component;
423
+ defaultParams: {
424
+ alphaFrom?: number,
425
+ alphaTo?: number,
426
+ angleFrom?: number,
427
+ angleTo?: number,
428
+ radiusFrom?: number,
429
+ radiusTo?: number,
430
+ scaleFrom?: number,
431
+ scaleTo?: number
432
+ };
433
+ duration: number;
434
+ fitToHeight: boolean;
435
+ fitToWidth: boolean;
436
+ effects: Array<string>;
437
+
438
+ }
439
+ type TimerParams = {
440
+ duration:number;
441
+ timing(timeFraction:number):number;
442
+ intervalInterceptor(progress:number);
443
+ };
444
+
445
+ class Timer extends InheritClass {
446
+ duration: number;
447
+ alive: boolean;
448
+ thread(timer:TimerParams):void;
449
+ }
450
+ class Toggle {
451
+ _toggle: boolean;
452
+ _inverse: boolean;
453
+ _positive: Function;
454
+ _negative: Function;
455
+ _dispatched?: boolean;
456
+ _args: Array<any>;
457
+
458
+ constructor(positive: Function, negative: Function, args: Array<any>);
459
+
460
+ }
461
+
462
+ let logger: Logger;
463
+ let _sdk_: Promise<any>;
464
+ let global: GLOBAL;
465
+
466
+ function ClassFactory(className: string): any;
467
+ function Package(packageName: string, classesList?: Array<any> | undefined): Array<any> | undefined;
468
+ function Import(packageName: string, ready?: Function, external?: boolean): any;
469
+
470
+ }
471
+
472
+ export = QCObjects;
package/src/types.d.ts DELETED
@@ -1,20 +0,0 @@
1
- declare module "QCObjects" {
2
- export function __qcobjects__(_top: any): void;
3
- const _top: any;
4
- let _default: {
5
- __qcobjects__: (_top: any) => void;
6
- global: any;
7
- } | {
8
- default: {
9
- __qcobjects__: (_top: any) => void;
10
- global: any;
11
- };
12
- __qcobjects__: (_top: any) => void;
13
- global: any;
14
- };
15
- export { _default as default, _top as global };
16
- }
17
- declare module "index" {
18
- import QCObjects from "QCObjects";
19
- export default QCObjects;
20
- }