@angular-wave/angular.ts 0.0.44 → 0.0.45

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.
@@ -1661,14 +1661,6 @@ describe("jqLite", () => {
1661
1661
  },
1662
1662
  );
1663
1663
  });
1664
-
1665
- it("should throw an error if a selector is passed", () => {
1666
- const aElem = JQLite(a);
1667
- aElem.on("click", () => {});
1668
- expect(() => {
1669
- aElem.off("click", () => {}, ".test");
1670
- }).toThrow();
1671
- });
1672
1664
  });
1673
1665
 
1674
1666
  describe("replaceWith", () => {
@@ -511,8 +511,8 @@ export function extend(dst) {
511
511
  * @param {...Object} src Source object(s).
512
512
  * @returns {Object} Reference to `dst`.
513
513
  */
514
- export function merge(dst) {
515
- return baseExtend(dst, Array.prototype.slice.call(arguments, 1), true);
514
+ export function merge(dst, ...src) {
515
+ return baseExtend(dst, src, true);
516
516
  }
517
517
 
518
518
  export function toInt(str) {
@@ -1026,7 +1026,7 @@ export function parseKeyValue(keyValue) {
1026
1026
  }
1027
1027
  }
1028
1028
  });
1029
- return obj;
1029
+ return /** @type {Object.<string,boolean|Array>} */ (obj);
1030
1030
  }
1031
1031
 
1032
1032
  export function toKeyValue(obj) {
package/src/src.test.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { test, expect } from "@playwright/test";
2
2
 
3
- test("unitstate-directives tests contain no errors", async ({ page }) => {
3
+ test("src tests contain no errors", async ({ page }) => {
4
4
  await page.goto("src/src.html");
5
5
  await page.content();
6
6
  await page.waitForTimeout(6000);
package/src/types.js CHANGED
@@ -193,7 +193,7 @@
193
193
  /**
194
194
  * @callback CloneAttachFunction
195
195
  * @param {import('./shared/jqlite/jqlite').JQLite} [clonedElement]
196
- * @param {Scope} [scope] // Let's hint but not force cloneAttachFn's signature
196
+ * @param {import('./core/scope/scope').Scope} [scope] // Let's hint but not force cloneAttachFn's signature
197
197
  * @returns {any}
198
198
  */
199
199
 
@@ -213,7 +213,7 @@
213
213
  */
214
214
 
215
215
  /**
216
- * @typedef {function(CloneAttachFunction=, JQLite=, string=): import('./shared/jqlite/jqlite').JQLite} transcludeWithoutScope
216
+ * @typedef {function(CloneAttachFunction=, import('./shared/jqlite/jqlite').JQLite=, string=): import('./shared/jqlite/jqlite').JQLite} transcludeWithoutScope
217
217
  */
218
218
 
219
219
  /**
@@ -1,15 +1,3 @@
1
- /**
2
- * Converts kebab-case to camelCase.
3
- * @param {string} name Name to normalize
4
- * @returns {string}
5
- */
6
- export function kebabToCamel(name: string): string;
7
- /**
8
- * Converts sname to camelCase.
9
- * @param {string} name
10
- * @returns {string}
11
- */
12
- export function snakeToCamel(name: string): string;
13
1
  /**
14
2
  * JQLite both a function and an array-like data structure for manipulation of DOM, linking elements to expando cache,
15
3
  * and execution of chain functions.
@@ -61,10 +49,49 @@ export class JQLite {
61
49
  * @returns {JQLite} The JQLite collection for chaining.
62
50
  */
63
51
  on(type: string, fn: Function): JQLite;
52
+ /**
53
+ * Removes an event listener to each element in JQLite collection.
54
+ *
55
+ * @param {string} type - The event type(s) to remove listener from
56
+ * @param {Function} fn - The function to remove from event type.
57
+ * @returns {JQLite}
58
+ */
59
+ off(type: string, fn: Function): JQLite;
60
+ /**
61
+ * Remove data by name from cache associated with each element in JQLite collection.
62
+ * @param {string} name - The key of the data associated with element
63
+ * @returns {JQLite}
64
+ */
65
+ removeData(name: string): JQLite;
66
+ /**
67
+ * Gets or sets data on a parent element
68
+ * @param {string} name
69
+ * @param {any} value
70
+ * @returns {JQLite|any}
71
+ */
72
+ inheritedData(name: string, value: any): JQLite | any;
73
+ /**
74
+ * Gets or sets innerHTML on the first element in JQLite collection
75
+ * @param {string} value
76
+ * @returns {JQLite|any|undefined}
77
+ */
78
+ html(value: string): JQLite | any | undefined;
64
79
  toString(): string;
65
80
  eq(index: any): JQLite;
66
81
  length: number;
67
82
  }
83
+ /**
84
+ * Converts kebab-case to camelCase.
85
+ * @param {string} name Name to normalize
86
+ * @returns {string}
87
+ */
88
+ export function kebabToCamel(name: string): string;
89
+ /**
90
+ * Converts sname to camelCase.
91
+ * @param {string} name
92
+ * @returns {string}
93
+ */
94
+ export function snakeToCamel(name: string): string;
68
95
  /**
69
96
  * Removes expando data from this element. If key is provided, only
70
97
  * its field is removed. If data is empty, also removes `ExpandoStore`
@@ -105,13 +132,6 @@ export function getOrSetCacheData(element: Element, key: string | any, value?: a
105
132
  * @param {boolean} keepData
106
133
  */
107
134
  export function removeElement(element: Element, keepData?: boolean): void;
108
- export function getBooleanAttrName(element: any, name: any): any;
109
- /**
110
- * Takes an array of elements, calls any `$destroy` event handlers, removes any data in cache, and finally removes any
111
- * listeners.
112
- * @param {NodeListOf<Element>} nodes
113
- */
114
- export function cleanElementData(nodes: NodeListOf<Element>): void;
115
135
  /**
116
136
  * @param {string} elementStr
117
137
  * @returns {string} Returns the string representation of the element.
@@ -123,4 +143,11 @@ export function startingTag(elementStr: string): string;
123
143
  * @returns {JQLite} the inputted object or a JQLite collection containing the nodes
124
144
  */
125
145
  export function getBlockNodes(nodes: any[]): JQLite;
146
+ export function getBooleanAttrName(element: any, name: any): any;
147
+ /**
148
+ * Takes an array of elements, calls any `$destroy` event handlers, removes any data in cache, and finally removes any
149
+ * listeners.
150
+ * @param {NodeListOf<Element>} nodes
151
+ */
152
+ export function cleanElementData(nodes: NodeListOf<Element>): void;
126
153
  export const BOOLEAN_ATTR: {};
@@ -292,7 +292,7 @@ export function extend(dst: any, ...args: any[]): any;
292
292
  * @param {...Object} src Source object(s).
293
293
  * @returns {Object} Reference to `dst`.
294
294
  */
295
- export function merge(dst: any, ...args: any[]): any;
295
+ export function merge(dst: any, ...src: any[]): any;
296
296
  export function toInt(str: any): number;
297
297
  export function isNumberNaN(num: any): boolean;
298
298
  export function inherit(parent: any, extra: any): any;
package/types/types.d.ts CHANGED
@@ -23,7 +23,7 @@ export type DirectiveCompileFn = (templateElement: TElement, templateAttributes:
23
23
  * Link function for an AngularJS directive.
24
24
  */
25
25
  export type DirectiveLinkFn = (scope: TScope, instanceElement: TElement, instanceAttributes: TAttributes, controller?: TController, transclude?: TranscludeFunction) => void;
26
- export type CloneAttachFunction = (clonedElement?: import("./shared/jqlite/jqlite").JQLite, scope?: Scope) => any;
26
+ export type CloneAttachFunction = (clonedElement?: import("./shared/jqlite/jqlite").JQLite, scope?: import("./core/scope/scope").Scope) => any;
27
27
  /**
28
28
  * This corresponds to $transclude passed to controllers and to the transclude function passed to link functions.
29
29
  * https://docs.angularjs.org/api/ng/service/$compile#-controller-
@@ -38,7 +38,7 @@ export type TranscludeFunction = {
38
38
  isSlotFilled: (arg0: string) => boolean;
39
39
  };
40
40
  export type transcludeWithScope = (arg0: TScope, arg1: CloneAttachFunction, arg2: import("./shared/jqlite/jqlite").JQLite | undefined, arg3: string | undefined) => import("./shared/jqlite/jqlite").JQLite;
41
- export type transcludeWithoutScope = (arg0: CloneAttachFunction | undefined, arg1: JQLite | undefined, arg2: string | undefined) => import("./shared/jqlite/jqlite").JQLite;
41
+ export type transcludeWithoutScope = (arg0: CloneAttachFunction | undefined, arg1: import("./shared/jqlite/jqlite").JQLite | undefined, arg2: string | undefined) => import("./shared/jqlite/jqlite").JQLite;
42
42
  /**
43
43
  * Represents the pre and post linking functions of a directive.
44
44
  */