@ethlete/core 4.21.4 → 4.22.0

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,6 +1,7 @@
1
1
  import { EffectRef, ElementRef, Injector, QueryList, Signal, WritableSignal } from '@angular/core';
2
2
  import { AbstractControl, FormControl } from '@angular/forms';
3
3
  import { Observable } from 'rxjs';
4
+ import { RouterState } from '../services';
4
5
  import { Breakpoint } from '../types';
5
6
  type SignalElementBindingComplexType = HTMLElement | ElementRef<HTMLElement> | QueryList<ElementRef<HTMLElement> | HTMLElement> | Array<ElementRef<HTMLElement> | HTMLElement> | null | undefined;
6
7
  type SignalElementBindingType = HTMLElement | ElementRef<HTMLElement> | Observable<SignalElementBindingComplexType> | Signal<SignalElementBindingComplexType> | QueryList<ElementRef<HTMLElement> | HTMLElement> | ElementSignal;
@@ -162,24 +163,50 @@ export type InjectUtilTransformConfig<In, Out> = {
162
163
  */
163
164
  transform?: (value: In) => Out;
164
165
  };
165
- export declare const injectOrRunInContext: <T>(fn: () => T, config?: InjectUtilConfig) => T;
166
166
  export declare const transformOrReturn: <In, Out>(src: Signal<In>, config?: InjectUtilTransformConfig<In, Out>) => Signal<Out>;
167
+ /** Inject the current router event */
168
+ export declare const injectRouterEvent: () => Signal<import("@angular/router").Event | null>;
169
+ /**
170
+ * Inject the current url.
171
+ * The url includes query params as well as the fragment. Use `injectRoute` instead if you are not intrusted in those.
172
+ * @example "/my-page?query=1&param=true#fragment"
173
+ */
174
+ export declare const injectUrl: () => Signal<string>;
175
+ /**
176
+ * Inject the current route
177
+ * @example "/my-page"
178
+ */
179
+ export declare const injectRoute: () => Signal<string>;
180
+ /**
181
+ * Inject the complete router state. This includes the current route data, path params, query params, title and fragment.
182
+ */
183
+ export declare const injectRouterState: () => Signal<RouterState>;
167
184
  /** Inject a signal containing the current route fragment (the part after the # inside the url if present) */
168
185
  export declare const injectFragment: <T = string | null>(config?: InjectUtilConfig & InjectUtilTransformConfig<string | null, T>) => Signal<T>;
169
186
  /** Inject all currently available query parameters as a signal */
170
- export declare const injectQueryParams: (config?: InjectUtilConfig) => Signal<import("@angular/router").Params>;
187
+ export declare const injectQueryParams: () => Signal<import("@angular/router").Params>;
171
188
  /** Inject all currently available route data as a signal */
172
- export declare const injectRouteData: (config?: InjectUtilConfig) => Signal<import("@angular/router").Data>;
189
+ export declare const injectRouteData: () => Signal<import("@angular/router").Data>;
173
190
  /** Inject the current route title as a signal */
174
- export declare const injectRouteTitle: <T = string | null>(config?: InjectUtilConfig & InjectUtilTransformConfig<string | null, T>) => Signal<T>;
191
+ export declare const injectRouteTitle: <T = string | null>(config?: InjectUtilTransformConfig<string | null, T>) => Signal<T>;
175
192
  /** Inject all currently available path parameters as a signal */
176
- export declare const injectPathParams: (config?: InjectUtilConfig) => Signal<import("@angular/router").Params>;
193
+ export declare const injectPathParams: () => Signal<import("@angular/router").Params>;
177
194
  /** Inject a specific query parameter as a signal */
178
- export declare const injectQueryParam: <T = string | null>(key: string, config?: InjectUtilConfig & InjectUtilTransformConfig<string | null, T>) => Signal<T>;
195
+ export declare const injectQueryParam: <T = string | null>(key: string, config?: InjectUtilTransformConfig<string | null, T>) => Signal<T>;
179
196
  /** Inject a specific route data item as a signal */
180
- export declare const injectRouteDataItem: <T = unknown>(key: string, config?: InjectUtilConfig & InjectUtilTransformConfig<unknown, T>) => Signal<T>;
197
+ export declare const injectRouteDataItem: <T = unknown>(key: string, config?: InjectUtilTransformConfig<unknown, T>) => Signal<T>;
181
198
  /** Inject a specific path parameter as a signal */
182
- export declare const injectPathParam: <T = string | null>(key: string, config?: InjectUtilConfig & InjectUtilTransformConfig<string | null, T>) => Signal<T>;
199
+ export declare const injectPathParam: <T = string | null>(key: string, config?: InjectUtilTransformConfig<string | null, T>) => Signal<T>;
200
+ /**
201
+ * Inject query params that changed during navigation. Unchanged query params will be ignored.
202
+ * Removed query params will be represented by the symbol `ET_PROPERTY_REMOVED`.
203
+ */
204
+ export declare const injectQueryParamChanges: () => Signal<Record<string, unknown>>;
205
+ /**
206
+ * Inject path params that changed during navigation. Unchanged path params will be ignored.
207
+ * Removed path params will be represented by the symbol `ET_PROPERTY_REMOVED`.
208
+ */
209
+ export declare const injectPathParamChanges: () => Signal<Record<string, unknown>>;
183
210
  export declare const createIsRenderedSignal: () => {
184
211
  state: WritableSignal<boolean>;
185
212
  bind: () => EffectRef;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethlete/core",
3
- "version": "4.21.4",
3
+ "version": "4.22.0",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^18.1.0",
6
6
  "@angular/common": "^18.1.0",