@angular-wave/angular.ts 0.14.3 → 0.15.1

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 (100) hide show
  1. package/@types/angular.d.ts +27 -25
  2. package/@types/animations/animate-cache.d.ts +46 -2
  3. package/@types/animations/animate-children-directive.d.ts +4 -4
  4. package/@types/animations/animate-js.d.ts +1 -10
  5. package/@types/animations/animate.d.ts +6 -1
  6. package/@types/animations/interface.d.ts +15 -0
  7. package/@types/animations/runner/animate-runner.d.ts +73 -52
  8. package/@types/animations/shared.d.ts +0 -16
  9. package/@types/core/compile/attributes.d.ts +40 -10
  10. package/@types/core/compile/compile.d.ts +1 -1
  11. package/@types/core/compile/inteface.d.ts +5 -1
  12. package/@types/core/controller/controller.d.ts +1 -1
  13. package/@types/core/di/inteface.d.ts +11 -0
  14. package/@types/core/interpolate/interface.d.ts +1 -0
  15. package/@types/core/parse/ast/ast-node.d.ts +2 -0
  16. package/@types/core/parse/interface.d.ts +1 -1
  17. package/@types/core/parse/interpreter.d.ts +5 -3
  18. package/@types/core/parse/parse.d.ts +4 -1
  19. package/@types/core/scope/interface.d.ts +26 -0
  20. package/@types/core/scope/scope.d.ts +13 -13
  21. package/@types/directive/attrs/attrs.d.ts +2 -5
  22. package/@types/directive/bind/bind.d.ts +5 -7
  23. package/@types/directive/class/class.d.ts +3 -3
  24. package/@types/directive/controller/controller.d.ts +2 -2
  25. package/@types/directive/form/form.d.ts +16 -13
  26. package/@types/directive/include/include.d.ts +4 -4
  27. package/@types/directive/init/init.d.ts +2 -2
  28. package/@types/directive/input/input.d.ts +16 -0
  29. package/@types/directive/listener/listener.d.ts +4 -0
  30. package/@types/directive/messages/messages.d.ts +9 -8
  31. package/@types/directive/model/interface.d.ts +18 -0
  32. package/@types/directive/model/model.d.ts +25 -23
  33. package/@types/directive/non-bindable/non-bindable.d.ts +2 -2
  34. package/@types/directive/ref/ref.d.ts +5 -8
  35. package/@types/directive/repeat/repeat.d.ts +2 -4
  36. package/@types/directive/script/script.d.ts +2 -2
  37. package/@types/directive/select/select.d.ts +9 -10
  38. package/@types/directive/setter/setter.d.ts +2 -2
  39. package/@types/directive/show-hide/show-hide.d.ts +2 -4
  40. package/@types/directive/switch/switch.d.ts +4 -4
  41. package/@types/directive/validators/validators.d.ts +2 -2
  42. package/@types/injection-tokens.d.ts +3 -2
  43. package/@types/interface.d.ts +72 -23
  44. package/@types/namespace.d.ts +50 -6
  45. package/@types/router/directives/state-directives.d.ts +26 -24
  46. package/@types/router/directives/view-directive.d.ts +27 -131
  47. package/@types/router/glob/glob.d.ts +2 -6
  48. package/@types/router/router.d.ts +6 -4
  49. package/@types/router/scroll/interface.d.ts +3 -0
  50. package/@types/router/scroll/view-scroll.d.ts +8 -0
  51. package/@types/router/state/interface.d.ts +30 -126
  52. package/@types/router/state/state-builder.d.ts +14 -7
  53. package/@types/router/state/state-matcher.d.ts +11 -3
  54. package/@types/router/state/state-object.d.ts +5 -7
  55. package/@types/router/state/state-queue-manager.d.ts +14 -8
  56. package/@types/router/state/state-registry.d.ts +26 -12
  57. package/@types/router/state/state-service.d.ts +24 -12
  58. package/@types/router/template-factory.d.ts +2 -2
  59. package/@types/router/transition/hook-registry.d.ts +15 -5
  60. package/@types/router/transition/interface.d.ts +9 -9
  61. package/@types/router/transition/transition-hook.d.ts +11 -0
  62. package/@types/router/transition/transition-service.d.ts +12 -5
  63. package/@types/router/transition/transition.d.ts +20 -14
  64. package/@types/router/url/url-rule.d.ts +12 -9
  65. package/@types/router/url/url-rules.d.ts +3 -84
  66. package/@types/router/url/url-service.d.ts +23 -18
  67. package/@types/router/view/view.d.ts +4 -4
  68. package/@types/services/anchor-scroll/anchor-scroll.d.ts +2 -17
  69. package/@types/services/anchor-scroll/interface.d.ts +15 -0
  70. package/@types/services/cookie/cookie.d.ts +7 -13
  71. package/@types/services/exception/interface.d.ts +3 -3
  72. package/@types/services/http/http.d.ts +6 -31
  73. package/@types/services/http/interface.d.ts +22 -0
  74. package/@types/services/location/location.d.ts +14 -13
  75. package/@types/services/log/log.d.ts +7 -3
  76. package/@types/services/pubsub/pubsub.d.ts +18 -13
  77. package/@types/services/rest/rest.d.ts +7 -5
  78. package/@types/services/sce/interface.d.ts +25 -0
  79. package/@types/services/sce/sce.d.ts +9 -1
  80. package/@types/services/sse/interface.d.ts +8 -1
  81. package/@types/services/sse/sse.d.ts +10 -18
  82. package/@types/services/storage/storage.d.ts +6 -6
  83. package/@types/services/stream/interface.d.ts +1 -1
  84. package/@types/services/stream/stream.d.ts +98 -0
  85. package/@types/shared/common.d.ts +2 -2
  86. package/@types/shared/dom.d.ts +21 -42
  87. package/@types/shared/hof.d.ts +27 -37
  88. package/@types/shared/noderef.d.ts +3 -3
  89. package/@types/shared/strings.d.ts +31 -10
  90. package/@types/shared/utils.d.ts +207 -101
  91. package/@types/shared/validate.d.ts +20 -0
  92. package/dist/angular-ts.esm.js +2461 -2298
  93. package/dist/angular-ts.umd.js +2461 -2298
  94. package/dist/angular-ts.umd.min.js +1 -1
  95. package/dist/angular-ts.umd.min.js.gz +0 -0
  96. package/dist/angular-ts.umd.min.js.map +1 -1
  97. package/package.json +1 -1
  98. package/@types/router/state-filters.d.ts +0 -39
  99. package/@types/router/view-scroll.d.ts +0 -12
  100. package/@types/shared/cache.d.ts +0 -7
@@ -1,23 +1,15 @@
1
- /**
2
- * SSE Provider
3
- *
4
- * Usage:
5
- * const source = $sse('/events', {
6
- * onMessage: (data) => console.log(data),
7
- * onError: (err) => console.error(err),
8
- * retryDelay: 2000,
9
- * heartbeatTimeout: 10000,
10
- * });
11
- *
12
- * source.close();
13
- */
14
1
  export class SseProvider {
15
- /**
16
- * Optional provider-level defaults
17
- * @type {ng.SseConfig}
18
- */
2
+ /** @type {ng.SseConfig} */
19
3
  defaults: ng.SseConfig;
20
- $get: (string | ((log: ng.LogService) => ng.SseService))[];
4
+ $get: (
5
+ | string
6
+ | ((
7
+ log: ng.LogService,
8
+ ) => (
9
+ url: string,
10
+ config?: import("./interface.ts").SseConfig,
11
+ ) => import("./interface.ts").SseConnection)
12
+ )[];
21
13
  _$log: import("../log/interface.ts").LogService;
22
14
  #private;
23
15
  }
@@ -2,18 +2,18 @@
2
2
  * Creates a proxy that automatically persists an object's state
3
3
  * into a storage backend whenever a property is set.
4
4
  *
5
- * @param {object} target - The object to wrap
5
+ * @param {Record<PropertyKey, any>} target - The object to wrap
6
6
  * @param {string} key - The storage key
7
- * @param {object} storage - Any storage-like object with getItem/setItem/removeItem
7
+ * @param {import("../../core/di/inteface").StorageLike & import("../../core/di/inteface").PersistentStoreConfig} storage - Any storage-like object with getItem/setItem/removeItem
8
8
  * @param {{serialize?: function, deserialize?: function}} [options] - Optional custom (de)serialization
9
- * @returns {Proxy}
9
+ * @returns {Record<PropertyKey, any>}
10
10
  */
11
11
  export function createPersistentProxy(
12
- target: object,
12
+ target: Record<PropertyKey, any>,
13
13
  key: string,
14
- storage: object,
14
+ storage: any & any,
15
15
  options?: {
16
16
  serialize?: Function;
17
17
  deserialize?: Function;
18
18
  },
19
- ): ProxyConstructor;
19
+ ): Record<PropertyKey, any>;
@@ -2,7 +2,7 @@ export interface StreamConnectionConfig {
2
2
  /** Called when the connection opens */
3
3
  onOpen?: (event: Event) => void;
4
4
  /** Called when a message is received */
5
- onMessage?: (data: any, event: Event) => void;
5
+ onMessage?: (data: any, event: Event | MessageEvent) => void;
6
6
  /** Called when an error occurs */
7
7
  onError?: (err: any) => void;
8
8
  /** Called when a reconnect attempt happens */
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Shared Stream Connection Manager
3
+ * Handles reconnect, heartbeat, and event callbacks for SSE or WebSocket
4
+ */
5
+ export class StreamConnection {
6
+ /**
7
+ * @param {() => EventSource | WebSocket} createFn - Function that creates a new EventSource or WebSocket.
8
+ * @param {ng.StreamConnectionConfig} config - Configuration object with callbacks, retries, heartbeat, transformMessage.
9
+ * @param {ng.LogService} log - Optional logger (default: console).
10
+ */
11
+ constructor(
12
+ createFn: () => EventSource | WebSocket,
13
+ config?: ng.StreamConnectionConfig,
14
+ log?: ng.LogService,
15
+ );
16
+ /** @private @type {() => EventSource | WebSocket} */
17
+ private _createFn;
18
+ _config: {
19
+ onOpen?: (event: Event) => void;
20
+ onMessage?: (data: any, event: Event | MessageEvent) => void;
21
+ onError?: (err: any) => void;
22
+ onReconnect?: (attempt: number) => void;
23
+ retryDelay: number;
24
+ maxRetries: number;
25
+ heartbeatTimeout: number;
26
+ transformMessage: (data: string) => any;
27
+ };
28
+ _log: import("../log/interface.ts").LogService;
29
+ _retryCount: number;
30
+ _closed: boolean;
31
+ _heartbeatTimer: number;
32
+ /** @type {EventSource | WebSocket | null} */
33
+ _connection: EventSource | WebSocket | null;
34
+ /**
35
+ * Establishes a new connection using the provided createFn.
36
+ * Closes any existing connection before creating a new one.
37
+ */
38
+ connect(): void;
39
+ /**
40
+ * Sends data over a WebSocket connection.
41
+ * Logs a warning if called on a non-WebSocket connection.
42
+ * @param {any} data - Data to send.
43
+ */
44
+ send(data: any): void;
45
+ /**
46
+ * Closes the connection manually and clears the heartbeat timer.
47
+ */
48
+ close(): void;
49
+ /**
50
+ * @private
51
+ * Binds event handlers to the underlying connection (EventSource or WebSocket)
52
+ * for open, message, error, and close events.
53
+ */
54
+ private _bindEvents;
55
+ /**
56
+ * @private
57
+ * Handles the open event from the connection.
58
+ * @param {Event} event - The open event.
59
+ */
60
+ private _handleOpen;
61
+ /**
62
+ * @private
63
+ * Handles incoming messages, applies the transformMessage function,
64
+ * and calls the onMessage callback.
65
+ * @param {any} data - Raw message data.
66
+ * @param {Event} event - The message event.
67
+ */
68
+ private _handleMessage;
69
+ /**
70
+ * @private
71
+ * Handles errors emitted from the connection.
72
+ * Calls onError callback and schedules a reconnect.
73
+ * @param {any} err - Error object or message.
74
+ */
75
+ private _handleError;
76
+ /**
77
+ * @private
78
+ * Handles close events for WebSocket connections.
79
+ * Triggers reconnect logic.
80
+ */
81
+ private _handleClose;
82
+ /**
83
+ * @private
84
+ * Schedules a reconnect attempt based on retryCount and config.maxRetries.
85
+ * Calls onReconnect callback if reconnecting.
86
+ */
87
+ private _scheduleReconnect;
88
+ /**
89
+ * @private
90
+ * Resets the heartbeat timer. If the timer expires, the connection is closed
91
+ * and a reconnect is attempted.
92
+ */
93
+ private _resetHeartbeat;
94
+ /**
95
+ * @private
96
+ */
97
+ private _closeInternal;
98
+ }
@@ -113,10 +113,10 @@ export function applyPairs(memo: any, keyValTuple: any): any;
113
113
  /**
114
114
  * Returns the last element of an array, or undefined if the array is empty.
115
115
  * @template T
116
- * @param {T[]} arr - The input array.
116
+ * @param {any[]|string} arr - The input array.
117
117
  * @returns {T | undefined} The last element or undefined.
118
118
  */
119
- export function tail<T>(arr: T[]): T | undefined;
119
+ export function tail<T>(arr: any[] | string): T | undefined;
120
120
  /**
121
121
  * shallow copy from src to dest
122
122
  */
@@ -37,16 +37,6 @@ export function getExpando(
37
37
  * @returns {boolean} True if the string is plain text, false if it contains HTML tags or entities.
38
38
  */
39
39
  export function isTextNode(html: string): boolean;
40
- /**
41
- * @param {string} html
42
- * @returns {DocumentFragment}
43
- */
44
- export function buildFragment(html: string): DocumentFragment;
45
- /**
46
- * @param {string} html
47
- * @returns {NodeListOf<ChildNode> | HTMLElement[]}
48
- */
49
- export function parseHtml(html: string): NodeListOf<ChildNode> | HTMLElement[];
50
40
  /**
51
41
  * @param {Element} element
52
42
  * @param {boolean} [onlyDescendants]
@@ -144,18 +134,6 @@ export function getController(
144
134
  * @returns
145
135
  */
146
136
  export function getInheritedData(element: Node, name: string): any;
147
- /**
148
- *
149
- * @param {Node} element
150
- * @param {string|string[]} name
151
- * @param {any} [value]
152
- * @returns {any|undefined}
153
- */
154
- export function setInheritedData(
155
- element: Node,
156
- name: string | string[],
157
- value?: any,
158
- ): any | undefined;
159
137
  /**
160
138
  *
161
139
  * @param {Element} element
@@ -172,9 +150,9 @@ export function startingTag(elementOrStr: string | Element | Node): string;
172
150
  /**
173
151
  * Return the DOM siblings between the first and last node in the given array.
174
152
  * @param {Array<Node>} nodes An array-like object
175
- * @returns {Element} the inputted object or a JQLite collection containing the nodes
153
+ * @returns {*[]|Array<Node>} the inputted object or a JQLite collection containing the nodes
176
154
  */
177
- export function getBlockNodes(nodes: Array<Node>): Element;
155
+ export function getBlockNodes(nodes: Array<Node>): any[] | Array<Node>;
178
156
  /**
179
157
  * Gets the name of a boolean attribute if it exists on a given element.
180
158
  *
@@ -210,26 +188,11 @@ export function createElementFromHTML(htmlString: string): Element;
210
188
  * @returns {NodeList} - The parsed DOM element.
211
189
  */
212
190
  export function createNodelistFromHTML(htmlString: string): NodeList;
213
- /**
214
- * Appends nodes or an HTML string to a given DOM element.
215
- * @param {Element} element - The element to append nodes to.
216
- * @param {Node | Node[] | string} nodes - Nodes or HTML string to append.
217
- */
218
- export function appendNodesToElement(
219
- element: Element,
220
- nodes: Node | Node[] | string,
221
- ): void;
222
191
  /**
223
192
  * Remove element from the DOM and clear Cache data, associated with the node.
224
193
  * @param {Element} element
225
194
  */
226
195
  export function emptyElement(element: Element): void;
227
- /**
228
- * Checks if the element is root
229
- * @param {Element} element
230
- * @returns {boolean}
231
- */
232
- export function isRoot(element: Element): boolean;
233
196
  /**
234
197
  * Inserts a DOM element before or at the beginning of a parent element.
235
198
  *
@@ -239,7 +202,7 @@ export function isRoot(element: Element): boolean;
239
202
  * @param {HTMLElement | Element} parentElement
240
203
  * The parent element that will receive the inserted element.
241
204
  *
242
- * @param {HTMLElement | Element | null} [afterElement]
205
+ * @param {ChildNode | Element | null} [afterElement]
243
206
  * An optional sibling element — if present and valid, `element`
244
207
  * will be inserted after it. If omitted or invalid, `element`
245
208
  * is prepended to `parentElement`.
@@ -249,15 +212,31 @@ export function isRoot(element: Element): boolean;
249
212
  export function domInsert(
250
213
  element: HTMLElement | Element,
251
214
  parentElement: HTMLElement | Element,
252
- afterElement?: HTMLElement | Element | null,
215
+ afterElement?: ChildNode | Element | null,
216
+ ): void;
217
+ /**
218
+ * @param {HTMLElement} element
219
+ * @param {HTMLElement} parent
220
+ * @param {ChildNode | null | undefined} after
221
+ */
222
+ export function animatedomInsert(
223
+ element: HTMLElement,
224
+ parent: HTMLElement,
225
+ after: ChildNode | null | undefined,
253
226
  ): void;
254
- export function animatedomInsert(element: any, parent: any, after: any): void;
255
227
  /**
256
228
  * Returns the base href of the document.
257
229
  *
258
230
  * @returns {string} The base href.
259
231
  */
260
232
  export function getBaseHref(): string;
233
+ /**
234
+ * Expando cache for adding properties to DOM nodes with JavaScript.
235
+ * This used to be an Object in JQLite decorator, but swapped out for a Map
236
+ *
237
+ * @type {Map<number, import('../interface.ts').ExpandoStore>}
238
+ */
239
+ export const Cache: Map<number, import("../interface.ts").ExpandoStore>;
261
240
  /**
262
241
  * A list of boolean attributes in HTML.
263
242
  * @type {string[]}
@@ -36,17 +36,10 @@
36
36
  *
37
37
  * ```
38
38
  *
39
- * @param fn
39
+ * @param {Function} fn
40
40
  * @returns {*|function(): (*|any)}
41
41
  */
42
- export function curry(fn: any): any | (() => any | any);
43
- /**
44
- * Given a varargs list of functions, returns a function that composes the argument functions, right-to-left
45
- * given: f(x), g(x), h(x)
46
- * let composed = compose(f,g,h)
47
- * then, composed is: f(g(h(x)))
48
- */
49
- export function compose(...fns: any[]): (...args: any[]) => any;
42
+ export function curry(fn: Function): any | (() => any | any);
50
43
  /**
51
44
  * Given a class constructor, returns a predicate function that checks
52
45
  * whether a given object is an instance of that class.
@@ -69,33 +62,30 @@ export function is(ctor: new (...args: any[]) => any): (obj: any) => boolean;
69
62
  * of size 2: [ predicate, mapFn ]
70
63
  *
71
64
  * These 2-tuples should be put in an outer array.
72
- *
73
- * @example
74
- * ```
75
- *
76
- * // Here's a 2-tuple where the first element is the isString predicate
77
- * // and the second element is a function that returns a description of the input
78
- * let firstTuple = [ angular.isString, (input) => `Heres your string ${input}` ];
79
- *
80
- * // Second tuple: predicate "isNumber", mapfn returns a description
81
- * let secondTuple = [ angular.isNumber, (input) => `(${input}) That's a number!` ];
82
- *
83
- * let third = [ (input) => input === null, (input) => `Oh, null...` ];
84
- *
85
- * let fourth = [ (input) => input === undefined, (input) => `notdefined` ];
86
- *
87
- * let descriptionOf = pattern([ firstTuple, secondTuple, third, fourth ]);
88
- *
89
- * console.log(descriptionOf(undefined)); // 'notdefined'
90
- * console.log(descriptionOf(55)); // '(55) That's a number!'
91
- * console.log(descriptionOf("foo")); // 'Here's your string foo'
92
- * ```
93
- *
94
- * @param struct A 2D array. Each element of the array should be an array, a 2-tuple,
95
- * with a Predicate and a mapping/output function
96
- * @returns {function(any): *}
65
+ * @example ```
66
+
67
+ // Here's a 2-tuple where the first element is the isString predicate
68
+ // and the second element is a function that returns a description of the input
69
+ let firstTuple = [ angular.isString, (input) => `Heres your string ${input}` ];
70
+
71
+ // Second tuple: predicate "isNumber", mapfn returns a description
72
+ let secondTuple = [ angular.isNumber, (input) => `(${input}) That's a number!` ];
73
+
74
+ let third = [ (input) => input === null, (input) => `Oh, null...` ];
75
+
76
+ let fourth = [ (input) => input === undefined, (input) => `notdefined` ];
77
+
78
+ let descriptionOf = pattern([ firstTuple, secondTuple, third, fourth ]);
79
+
80
+ console.log(descriptionOf(undefined)); // 'notdefined'
81
+ console.log(descriptionOf(55)); // '(55) That's a number!'
82
+ console.log(descriptionOf("foo")); // 'Here's your string foo'
83
+ ```
84
+ * @param {string | any[]} struct A 2D array. Each element of the array should be an array, a 2-tuple,
85
+ with a Predicate and a mapping/output function
86
+ * @returns {function(any):*}
97
87
  */
98
- export function pattern(struct: any): (arg0: any) => any;
88
+ export function pattern(struct: string | any[]): (arg0: any) => any;
99
89
  /**
100
90
  * Given a property name and a value, returns a function that returns a boolean based on whether
101
91
  * the passed object has a property that matches the value
@@ -104,5 +94,5 @@ export function pattern(struct: any): (arg0: any) => any;
104
94
  * getName(obj) === true
105
95
  */
106
96
  export const propEq: any;
107
- export function parse(path: any): (obj: any) => any;
108
- export function val(value: any): () => any;
97
+ export function parse(path: string): (/** @type {any} */ obj: any) => any;
98
+ export function val<T>(value: T): () => T;
@@ -9,10 +9,10 @@ export class NodeRef {
9
9
  * @throws {Error} If the argument is invalid or cannot be wrapped properly.
10
10
  */
11
11
  constructor(element: Node | Element | string | NodeList | Node[]);
12
- /** @private @type {Node | ChildNode | null} */
12
+ /** @private @type {Node | ChildNode | undefined} */
13
13
  private _node;
14
- /** @private @type {Element | undefined} */
15
- private _element;
14
+ /** @type {Element | undefined} */
15
+ _element: Element | undefined;
16
16
  /** @private @type {Array<Node>} a stable list on nodes */
17
17
  private _nodes;
18
18
  /** @type {boolean} */
@@ -15,14 +15,30 @@ export function maxLength(max: number, str: string): string;
15
15
  * If the string is already longer than the desired length, return the string.
16
16
  * Else returns the string, with extra spaces on the end, such that it reaches `length` characters.
17
17
  *
18
- * @param length the desired length of the string to return
19
- * @param str the input string
18
+ * @param {number} length the desired length of the string to return
19
+ * @param {string} str the input string
20
+ */
21
+ export function padString(length: number, str: string): string;
22
+ /**
23
+ * @param {string} camelCase
24
+ * @returns {string}
25
+ */
26
+ export function kebobString(camelCase: string): string;
27
+ /**
28
+ * @param {Function} fn
29
+ * @returns {string}
30
+ */
31
+ export function functionToString(fn: Function): string;
32
+ /**
33
+ * @param {[]|Function} fn
34
+ * @returns {string}
35
+ */
36
+ export function fnToString(fn: [] | Function): string;
37
+ /**
38
+ * @param {any} value
39
+ * @returns {string|*|string}
20
40
  */
21
- export function padString(length: any, str: any): any;
22
- export function kebobString(camelCase: any): any;
23
- export function functionToString(fn: any): any;
24
- export function fnToString(fn: any): any;
25
- export function stringify(value: any): any;
41
+ export function stringify(value: any): string | any | string;
26
42
  /**
27
43
  * Splits on a delimiter, but returns the delimiters in the array
28
44
  *
@@ -32,8 +48,11 @@ export function stringify(value: any): any;
32
48
  * splitOnSlashes("/foo"); // ["/", "foo"]
33
49
  * splitOnSlashes("/foo/"); // ["/", "foo", "/"]
34
50
  * ```
51
+ * @param {string} delim
35
52
  */
36
- export function splitOnDelim(delim: any): (str: any) => any;
53
+ export function splitOnDelim(
54
+ delim: string,
55
+ ): (/** @type {string} */ str: string) => string[];
37
56
  /**
38
57
  * Reduce fn that joins neighboring strings
39
58
  *
@@ -45,6 +64,8 @@ export function splitOnDelim(delim: any): (str: any) => any;
45
64
  * let arr = ["foo", "bar", 1, "baz", "", "qux" ];
46
65
  * arr.reduce(joinNeighborsR, []) // ["foobar", 1, "bazqux" ]
47
66
  * ```
67
+ * @param {string | any[]} acc
68
+ * @param {unknown} str
48
69
  */
49
- export function joinNeighborsR(acc: any, str: any): any;
50
- export function stripLastPathElement(str: any): any;
70
+ export function joinNeighborsR(acc: string | any[], str: unknown): any;
71
+ export function stripLastPathElement(str: string): string;