@rdlabo/ionic-angular-kit 22.0.0-beta.pr101.shae60a7d066900 → 22.0.0-beta.pr102.sha1c53fd4f57fa
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/README.md +26 -20
- package/docs/offline-realtime.md +116 -1
- package/docs/optional-features.md +23 -4
- package/docs/storage-overlays.md +21 -10
- package/fesm2022/rdlabo-ionic-angular-kit-app-update.mjs +108 -16
- package/fesm2022/rdlabo-ionic-angular-kit-app-update.mjs.map +1 -1
- package/fesm2022/rdlabo-ionic-angular-kit-offline.mjs +42 -7
- package/fesm2022/rdlabo-ionic-angular-kit-offline.mjs.map +1 -1
- package/fesm2022/rdlabo-ionic-angular-kit.mjs +19 -0
- package/fesm2022/rdlabo-ionic-angular-kit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/rdlabo-ionic-angular-kit-app-update.d.ts +30 -9
- package/types/rdlabo-ionic-angular-kit-offline.d.ts +11 -0
- package/types/rdlabo-ionic-angular-kit.d.ts +7 -0
package/package.json
CHANGED
|
@@ -1,32 +1,53 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { EnvironmentProviders } from '@angular/core';
|
|
3
3
|
|
|
4
|
-
/**
|
|
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
|
-
/**
|
|
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
|
|
41
|
+
* Provides blocking, background, or user-confirmed adoption of complete Angular service-worker updates.
|
|
23
42
|
*
|
|
24
43
|
* @remarks
|
|
25
|
-
* The
|
|
26
|
-
*
|
|
27
|
-
*
|
|
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?:
|
|
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';
|
|
@@ -1673,6 +1683,7 @@ type ProvideReadCacheOfflineOptions = ProvideOfflineOptionsBase & OfflineKitEncr
|
|
|
1673
1683
|
commandExecutor?: never;
|
|
1674
1684
|
replicaPuller?: never;
|
|
1675
1685
|
};
|
|
1686
|
+
/** Configuration accepted by the experimental offline runtime providers. */
|
|
1676
1687
|
type ProvideOfflineOptions = ProvideSynchronizedOfflineOptions | ProvideReadCacheOfflineOptions;
|
|
1677
1688
|
/** Starts one route-scoped offline runtime after product-owned local recovery has completed. */
|
|
1678
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
|
}
|