@rdlabo/ionic-angular-kit 22.0.0-beta.pr99.sha950c83950d41 → 22.0.1-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rdlabo/ionic-angular-kit",
3
- "version": "22.0.0-beta.pr99.sha950c83950d41",
3
+ "version": "22.0.1-0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/rdlabo-dev/ionic-angular-library.git"
@@ -1,32 +1,53 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { EnvironmentProviders } from '@angular/core';
3
3
 
4
- /** Configuration for Angular service-worker application updates. */
4
+ /** Asks whether a downloaded service-worker update should be applied now. `undefined` requests a later retry. */
5
+ type KitAppUpdatePrompt = () => Promise<boolean | undefined>;
6
+ /** Existing configuration for startup-blocking or background service-worker updates. */
5
7
  interface KitAppUpdateOptions {
6
- /** `blocking` preserves startup safety; `background` never delays bootstrap and reloads only before interaction. */
7
8
  strategy?: 'blocking' | 'background';
8
9
  }
9
- /** Checks for a complete Angular service-worker update before users can interact with the application. */
10
+ /** Uses a non-blocking update check and asks the user before reloading. */
11
+ interface KitConfirmAppUpdateOptions {
12
+ strategy: 'confirm';
13
+ /**
14
+ * Runs after the first render when a complete update is ready.
15
+ *
16
+ * Resolve `true` to reload, `false` when the user explicitly defers, or `undefined` when UI could not be presented and
17
+ * should be retried. The provider supplies an Angular injection context only for the callback's synchronous execution,
18
+ * so resolve injected dependencies before crossing an async boundary.
19
+ */
20
+ promptForUpdate: KitAppUpdatePrompt;
21
+ }
22
+ /** Configuration accepted by {@link provideKitAppUpdate}. */
23
+ type KitAppUpdateProviderOptions = (KitAppUpdateOptions & {
24
+ promptForUpdate?: never;
25
+ }) | KitConfirmAppUpdateOptions;
26
+ /** Coordinates complete Angular service-worker updates using blocking, background, or user-confirmed application. */
10
27
  declare class KitAppUpdateService {
11
28
  #private;
12
29
  /** Runs one startup update check and reloads directly into a downloaded version when one is available. */
13
30
  initialize(): Promise<void>;
14
31
  /** Starts an update check that never blocks bootstrap or reloads after the application becomes interactive. */
15
32
  startBackground(): void;
33
+ /** Starts a non-blocking update check and asks after the first render before applying a ready update. */
34
+ startConfirm(promptForUpdate: KitAppUpdatePrompt): void;
16
35
  /** Marks the first rendered application as interactive. Used by the provider's render hook. */
17
36
  markInteractive(): void;
18
37
  static ɵfac: i0.ɵɵFactoryDeclaration<KitAppUpdateService, never>;
19
38
  static ɵprov: i0.ɵɵInjectableDeclaration<KitAppUpdateService>;
20
39
  }
21
40
  /**
22
- * Provides a startup check that reloads into the latest complete web application version.
41
+ * Provides blocking, background, or user-confirmed adoption of complete Angular service-worker updates.
23
42
  *
24
43
  * @remarks
25
- * The check finishes before application bootstrap so a delayed update cannot discard user input. It times out rather
26
- * than preventing offline startup. API deployments must remain backward compatible while a newly adopted updater is
27
- * rolling out because code already running in older application versions cannot gain this behavior retroactively.
44
+ * The default `blocking` strategy checks before bootstrap and times out rather than preventing offline startup. The
45
+ * existing `background` strategy never delays bootstrap and reloads only before the first render. The opt-in `confirm`
46
+ * strategy also checks in the background, but waits until after the first render and reloads only with user approval.
47
+ * API deployments must remain backward compatible while an updater is rolling out because already-running older code
48
+ * cannot gain this behavior retroactively.
28
49
  */
29
- declare function provideKitAppUpdate(options?: KitAppUpdateOptions): EnvironmentProviders;
50
+ declare function provideKitAppUpdate(options?: KitAppUpdateProviderOptions): EnvironmentProviders;
30
51
 
31
52
  export { KitAppUpdateService, provideKitAppUpdate };
32
- export type { KitAppUpdateOptions };
53
+ export type { KitAppUpdateOptions, KitAppUpdatePrompt, KitAppUpdateProviderOptions, KitConfirmAppUpdateOptions };
@@ -1,3 +1,13 @@
1
+ /**
2
+ * @rdlabo/ionic-angular-kit/offline is experimental.
3
+ *
4
+ * This entry point is not covered by the package's SemVer compatibility guarantee. Its public
5
+ * APIs, persistence schema, and synchronization behavior may change incompatibly in a minor or
6
+ * patch release before stabilization.
7
+ *
8
+ * @packageDocumentation
9
+ * @experimental
10
+ */
1
11
  import * as i0 from '@angular/core';
2
12
  import { InjectionToken, Type, Provider, EnvironmentProviders } from '@angular/core';
3
13
  import { RouterStateSnapshot } from '@angular/router';
@@ -497,11 +507,13 @@ interface OfflineRepository {
497
507
  getCommands(scope: OfflineScope): Promise<OfflineCommand[]>;
498
508
  getCommandsForUser?(userId: OfflinePrincipalId): Promise<OfflineCommand[]>;
499
509
  putCommand(command: OfflineCommand): Promise<void>;
510
+ /** @deprecated Use {@link transactReplica} with `putCommands`. */
500
511
  replaceCommand(command: OfflineCommand): Promise<void>;
512
+ /** @deprecated Use {@link transactReplica} with `removeCommandIds`. */
501
513
  removeCommand(commandId: string): Promise<void>;
502
- /** Upserts a durable fatal-pull attention for user+scope. */
514
+ /** @deprecated Use {@link transactReplica} with `putPullAttentions`. */
503
515
  putPullAttention?(attention: OfflinePullAttention): Promise<void>;
504
- /** Removes a durable fatal-pull attention for user+scope when present. */
516
+ /** @deprecated Use {@link transactReplica} with `removePullAttentions`. */
505
517
  removePullAttention?(scope: OfflineScope): Promise<void>;
506
518
  clearUser(userId: OfflinePrincipalId): Promise<void>;
507
519
  clearScope(scope: OfflineScope): Promise<void>;
@@ -545,9 +557,13 @@ declare class IonicOfflineRepository implements OfflineRepository {
545
557
  getCommandsForUser(userId: OfflinePrincipalId): Promise<OfflineCommand[]>;
546
558
  runReadSnapshot<T>(read: (reader: OfflineRepositoryReader) => Promise<T>): Promise<T>;
547
559
  putCommand(command: OfflineCommand): Promise<void>;
560
+ /** @deprecated Use {@link transactReplica} with `putCommands`. */
548
561
  replaceCommand(command: OfflineCommand): Promise<void>;
562
+ /** @deprecated Use {@link transactReplica} with `removeCommandIds`. */
549
563
  removeCommand(commandId: string): Promise<void>;
564
+ /** @deprecated Use {@link transactReplica} with `putPullAttentions`. */
550
565
  putPullAttention(attention: OfflinePullAttention): Promise<void>;
566
+ /** @deprecated Use {@link transactReplica} with `removePullAttentions`. */
551
567
  removePullAttention(scope: OfflineScope): Promise<void>;
552
568
  clearUser(userId: OfflinePrincipalId): Promise<void>;
553
569
  clearScope(scope: OfflineScope): Promise<void>;
@@ -1612,9 +1628,13 @@ declare class SqliteOfflineRepository implements OfflineRepository {
1612
1628
  runReadSnapshot<T>(read: (reader: OfflineRepositoryReader) => Promise<T>): Promise<T>;
1613
1629
  [OFFLINE_REPOSITORY_ATOMIC_MUTATION]<T>(operation: (repository: OfflineRepository) => Promise<T>): Promise<T>;
1614
1630
  putCommand(command: OfflineCommand): Promise<void>;
1631
+ /** @deprecated Use {@link transactReplica} with `putCommands`. */
1615
1632
  replaceCommand(command: OfflineCommand): Promise<void>;
1633
+ /** @deprecated Use {@link transactReplica} with `removeCommandIds`. */
1616
1634
  removeCommand(commandId: string): Promise<void>;
1635
+ /** @deprecated Use {@link transactReplica} with `putPullAttentions`. */
1617
1636
  putPullAttention(attention: OfflinePullAttention): Promise<void>;
1637
+ /** @deprecated Use {@link transactReplica} with `removePullAttentions`. */
1618
1638
  removePullAttention(scope: OfflineScope): Promise<void>;
1619
1639
  clearUser(userId: OfflinePrincipalId): Promise<void>;
1620
1640
  clearScope(scope: OfflineScope): Promise<void>;
@@ -1663,6 +1683,7 @@ type ProvideReadCacheOfflineOptions = ProvideOfflineOptionsBase & OfflineKitEncr
1663
1683
  commandExecutor?: never;
1664
1684
  replicaPuller?: never;
1665
1685
  };
1686
+ /** Configuration accepted by the experimental offline runtime providers. */
1666
1687
  type ProvideOfflineOptions = ProvideSynchronizedOfflineOptions | ProvideReadCacheOfflineOptions;
1667
1688
  /** Starts one route-scoped offline runtime after product-owned local recovery has completed. */
1668
1689
  declare class OfflineRouteInitializerService {
@@ -468,6 +468,13 @@ declare class KitOverlayController {
468
468
  * {@link alertConfirm} stacking guard).
469
469
  */
470
470
  alertConfirm(options: KitAlertConfirmOptions): Promise<boolean>;
471
+ /**
472
+ * Try to present a confirmation alert without stacking it over another alert.
473
+ *
474
+ * @returns `true` for confirmation, `false` for explicit cancellation or backdrop dismissal, and `undefined` when
475
+ * another alert prevented this one from being presented.
476
+ */
477
+ tryAlertConfirm(options: KitAlertConfirmOptions): Promise<boolean | undefined>;
471
478
  static ɵfac: i0.ɵɵFactoryDeclaration<KitOverlayController, never>;
472
479
  static ɵprov: i0.ɵɵInjectableDeclaration<KitOverlayController>;
473
480
  }