@stemy/ngx-utils 19.5.21 → 19.5.23

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.
@@ -1,5 +1,6 @@
1
1
  import { Type, ValueProvider, ɵComponentDef as ComponentDef } from "@angular/core";
2
2
  import { CssSelector, CssSelectorList } from "../common-types";
3
+ export declare function isBrowser(): boolean;
3
4
  export declare function switchClass(elem: HTMLElement, className: string, status?: boolean): void;
4
5
  export declare function getCssVariables(elem: HTMLElement): Record<string, string>;
5
6
  export declare function checkTransitions(el: HTMLElement, cb: () => any): void;
@@ -3,34 +3,21 @@ import { type Signal } from "@angular/core";
3
3
  * Returns a signal that emits the previous value of the given signal.
4
4
  * The first time the signal is emitted, the previous value will be the same as the current value.
5
5
  *
6
- * @example
7
- * ```ts
8
- * const value = signal(0);
9
- * const previous = computedPrevious(value);
10
- *
11
- * effect(() => {
12
- * console.log("Current value:", value());
13
- * console.log("Previous value:", previous());
14
- * });
15
- *
16
- * Logs:
17
- * // Current value: 0
18
- * // Previous value: 0
19
- *
20
- * value.set(1);
21
- *
22
- * Logs:
23
- * // Current value: 1
24
- * // Previous value: 0
25
- *
26
- * value.set(2);
27
- *
28
- * Logs:
29
- * // Current value: 2
30
- * // Previous value: 1
31
- *```
32
- *
33
6
  * @param s Signal to compute previous value for
34
7
  * @returns Signal that emits previous value of `s`
35
8
  */
36
9
  export declare function computedPrevious<T>(s: Signal<T>): Signal<T>;
10
+ /**
11
+ * Returns a signal that emits css styles form an element when it gets resized
12
+ *
13
+ * @param elem Element to compute styles for
14
+ * @returns Signal that emits the calculated styles
15
+ */
16
+ export declare function cssStyles<T>(elem: HTMLElement): Signal<CSSStyleDeclaration>;
17
+ /**
18
+ * Returns a signal that emits css variables form an element when it gets resized
19
+ *
20
+ * @param elem Element to compute variables for
21
+ * @returns Signal that emits the calculated properties
22
+ */
23
+ export declare function cssVariables<T>(elem: HTMLElement): Signal<Record<string, string>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stemy/ngx-utils",
3
- "version": "19.5.21",
3
+ "version": "19.5.23",
4
4
  "license": "MIT",
5
5
  "public": true,
6
6
  "repository": "https://github.com/stemyke/ngx-utils.git",
package/public_api.d.ts CHANGED
@@ -18,13 +18,13 @@ export { JSONfn } from "./ngx-utils/utils/jsonfn";
18
18
  export { ReflectUtils } from "./ngx-utils/utils/reflect.utils";
19
19
  export { LoaderUtils } from "./ngx-utils/utils/loader.utils";
20
20
  export { MathUtils } from "./ngx-utils/utils/math.utils";
21
- export { switchClass, getCssVariables, checkTransitions, getComponentDef, parseSelector, selectorMatchesList, provideEntryComponents } from "./ngx-utils/utils/misc";
21
+ export { isBrowser, switchClass, getCssVariables, checkTransitions, getComponentDef, parseSelector, selectorMatchesList, provideEntryComponents } from "./ngx-utils/utils/misc";
22
22
  export { ObjectUtils } from "./ngx-utils/utils/object.utils";
23
23
  export { ObservableUtils, ISubscriberInfo } from "./ngx-utils/utils/observable.utils";
24
24
  export { CancelablePromise, cancelablePromise, impatientPromise } from "./ngx-utils/utils/promise.utils";
25
25
  export { StringUtils, hashCode } from "./ngx-utils/utils/string.utils";
26
26
  export { SetUtils } from "./ngx-utils/utils/set.utils";
27
- export { computedPrevious } from "./ngx-utils/utils/signal-utils";
27
+ export { computedPrevious, cssStyles, cssVariables } from "./ngx-utils/utils/signal-utils";
28
28
  export { SocketFactory, SocketData, SocketDataValue, SocketDataObj, SocketClient } from "./ngx-utils/utils/socket-client";
29
29
  export { TimerUtils } from "./ngx-utils/utils/timer.utils";
30
30
  export { UniqueUtils } from "./ngx-utils/utils/unique.utils";