static-injector 6.4.0 → 7.0.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/import/application/application_tokens.d.ts +58 -0
- package/import/application/stability_debug.d.ts +13 -0
- package/import/authoring/output/output_ref.d.ts +37 -0
- package/import/change_detection/scheduling/zoneless_scheduling.d.ts +0 -7
- package/import/core_reactivity_export_internal.d.ts +1 -1
- package/import/defer/idle_service.d.ts +42 -0
- package/import/di/create_injector.d.ts +2 -2
- package/import/di/forward_ref.d.ts +2 -2
- package/import/di/index.d.ts +4 -0
- package/import/di/inject_async.d.ts +91 -0
- package/import/di/injectable.d.ts +7 -1
- package/import/di/injection_token.d.ts +7 -0
- package/import/di/injector.d.ts +1 -1
- package/import/di/injector_compatibility.d.ts +0 -1
- package/import/di/interface/defs.d.ts +2 -2
- package/import/di/interface/provider.d.ts +0 -15
- package/import/document.d.ts +18 -0
- package/import/errors.d.ts +13 -9
- package/import/event_emitter.d.ts +101 -0
- package/import/hydration/cache.d.ts +14 -0
- package/import/index.d.ts +16 -0
- package/import/linker.d.ts +1 -0
- package/import/pending_tasks.d.ts +1 -24
- package/import/pending_tasks_internal.d.ts +31 -0
- package/import/render3/debug/injector_profiler.d.ts +10 -4
- package/import/render3/debug/special_providers.d.ts +17 -0
- package/import/render3/reactivity/api.d.ts +15 -0
- package/import/render3/reactivity/asserts.d.ts +1 -0
- package/import/render3/reactivity/effect.d.ts +3 -1
- package/import/render3/reactivity/root_effect_scheduler.d.ts +1 -1
- package/import/render3/reactivity/signal.d.ts +0 -4
- package/import/render3/util/stringify_utils.d.ts +1 -1
- package/import/resource/api.d.ts +101 -15
- package/import/resource/debounce.d.ts +21 -0
- package/import/resource/from_snapshots.d.ts +16 -0
- package/import/resource/index.d.ts +2 -0
- package/import/resource/resource.d.ts +32 -8
- package/import/transfer_state.d.ts +89 -0
- package/import/util/default_export.d.ts +24 -0
- package/import/util/promise_with_resolvers.d.ts +38 -0
- package/import/zone/ng_zone.d.ts +261 -0
- package/index.js +875 -196
- package/index.js.map +4 -4
- package/index.mjs +858 -190
- package/index.mjs.map +4 -4
- package/package.json +2 -2
- package/primitives/signals/index.d.ts +1 -1
- package/primitives/signals/src/formatter.d.ts +2 -1
- package/primitives/signals/src/graph.d.ts +8 -1
- package/primitives/signals/src/linked_signal.d.ts +1 -1
- package/readme.md +1 -1
- /package/import/{interface → change_detection}/lifecycle_hooks.d.ts +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { InjectionToken } from '../di/injection_token';
|
|
9
|
+
/**
|
|
10
|
+
* A DI token representing a string ID, used
|
|
11
|
+
* primarily for prefixing application attributes and CSS styles when
|
|
12
|
+
* {@link ViewEncapsulation#Emulated} is being used.
|
|
13
|
+
*
|
|
14
|
+
* The token is needed in cases when multiple applications are bootstrapped on a page
|
|
15
|
+
* (for example, using `bootstrapApplication` calls). In this case, ensure that those applications
|
|
16
|
+
* have different `APP_ID` value setup. For example:
|
|
17
|
+
*
|
|
18
|
+
* ```ts
|
|
19
|
+
* bootstrapApplication(ComponentA, {
|
|
20
|
+
* providers: [
|
|
21
|
+
* { provide: APP_ID, useValue: 'app-a' },
|
|
22
|
+
* // ... other providers ...
|
|
23
|
+
* ]
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* bootstrapApplication(ComponentB, {
|
|
27
|
+
* providers: [
|
|
28
|
+
* { provide: APP_ID, useValue: 'app-b' },
|
|
29
|
+
* // ... other providers ...
|
|
30
|
+
* ]
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* By default, when there is only one application bootstrapped, you don't need to provide the
|
|
35
|
+
* `APP_ID` token (the `ng` will be used as an app ID).
|
|
36
|
+
*
|
|
37
|
+
* @publicApi
|
|
38
|
+
*/
|
|
39
|
+
export declare const APP_ID: InjectionToken<string>;
|
|
40
|
+
/**
|
|
41
|
+
* A configuration object for the image-related options. Contains:
|
|
42
|
+
* - breakpoints: An array of integer breakpoints used to generate
|
|
43
|
+
* srcsets for responsive images.
|
|
44
|
+
* - disableImageSizeWarning: A boolean value. Setting this to true will
|
|
45
|
+
* disable console warnings about oversized images.
|
|
46
|
+
* - disableImageLazyLoadWarning: A boolean value. Setting this to true will
|
|
47
|
+
* disable console warnings about LCP images configured with `loading="lazy"`.
|
|
48
|
+
* Learn more about the responsive image configuration in [the NgOptimizedImage
|
|
49
|
+
* guide](guide/image-optimization).
|
|
50
|
+
* Learn more about image warning options in [the related error page](errors/NG0913).
|
|
51
|
+
* @publicApi
|
|
52
|
+
*/
|
|
53
|
+
export type ImageConfig = {
|
|
54
|
+
breakpoints?: number[];
|
|
55
|
+
placeholderResolution?: number;
|
|
56
|
+
disableImageSizeWarning?: boolean;
|
|
57
|
+
disableImageLazyLoadWarning?: boolean;
|
|
58
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { InjectionToken } from '../di/injection_token';
|
|
9
|
+
export declare const DEBUG_TASK_TRACKER: InjectionToken<DebugTaskTracker>;
|
|
10
|
+
export interface DebugTaskTracker {
|
|
11
|
+
add(taskId: number): void;
|
|
12
|
+
remove(taskId: number): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Function that can be used to manually clean up a
|
|
10
|
+
* programmatic {@link OutputRef#subscribe} subscription.
|
|
11
|
+
*
|
|
12
|
+
* Note: Angular will automatically clean up subscriptions
|
|
13
|
+
* when the directive/component of the output is destroyed.
|
|
14
|
+
*
|
|
15
|
+
* @see [Subscribing to outputs programmatically](guide/components/outputs#subscribing-to-outputs-programmatically)
|
|
16
|
+
*
|
|
17
|
+
* @publicAPI
|
|
18
|
+
*/
|
|
19
|
+
export interface OutputRefSubscription {
|
|
20
|
+
unsubscribe(): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A reference to an Angular output.
|
|
24
|
+
*
|
|
25
|
+
* @publicAPI
|
|
26
|
+
* @see [Subscribing to outputs programmatically](guide/components/outputs#subscribing-to-outputs-programmatically)
|
|
27
|
+
*/
|
|
28
|
+
export interface OutputRef<T> {
|
|
29
|
+
/**
|
|
30
|
+
* Registers a callback that is invoked whenever the output
|
|
31
|
+
* emits a new value of type `T`.
|
|
32
|
+
*
|
|
33
|
+
* Angular will automatically clean up the subscription when
|
|
34
|
+
* the directive/component of the output is destroyed.
|
|
35
|
+
*/
|
|
36
|
+
subscribe(callback: (value: T) => void): OutputRefSubscription;
|
|
37
|
+
}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
import { InjectionToken } from '../../di/injection_token';
|
|
9
8
|
export declare const enum NotificationSource {
|
|
10
9
|
MarkAncestorsForTraversal = 0,
|
|
11
10
|
SetInput = 1,
|
|
@@ -29,9 +28,3 @@ export declare abstract class ChangeDetectionScheduler {
|
|
|
29
28
|
abstract notify(source: NotificationSource): void;
|
|
30
29
|
abstract runningTick: boolean;
|
|
31
30
|
}
|
|
32
|
-
/** Token used to indicate if zoneless was enabled via provideZonelessChangeDetection(). */
|
|
33
|
-
export declare const ZONELESS_ENABLED: InjectionToken<boolean>;
|
|
34
|
-
/** Token used to indicate `provideZonelessChangeDetection` was used. */
|
|
35
|
-
export declare const PROVIDED_ZONELESS: InjectionToken<boolean>;
|
|
36
|
-
export declare const ZONELESS_SCHEDULER_DISABLED: InjectionToken<boolean>;
|
|
37
|
-
export declare const SCHEDULE_IN_ROOT_ZONE: InjectionToken<boolean>;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
export { SIGNAL as ɵSIGNAL } from '../primitives/signals';
|
|
9
|
-
export { isSignal, Signal, ValueEqualityFn } from './render3/reactivity/api';
|
|
9
|
+
export { isSignal, isWritableSignal, Signal, ValueEqualityFn } from './render3/reactivity/api';
|
|
10
10
|
export { computed, CreateComputedOptions } from './render3/reactivity/computed';
|
|
11
11
|
export { CreateSignalOptions, signal, WritableSignal, ɵunwrapWritableSignal } from './render3/reactivity/signal';
|
|
12
12
|
export { linkedSignal } from './render3/reactivity/linked_signal';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { AbstractType } from '../interface/type';
|
|
9
|
+
import { InjectionToken } from '../di/injection_token';
|
|
10
|
+
import type { EnvironmentProviders } from '../di/interface/provider';
|
|
11
|
+
/**
|
|
12
|
+
* Service which configures custom 'on idle' behavior for Angular features like `@defer`.
|
|
13
|
+
*
|
|
14
|
+
* @publicApi
|
|
15
|
+
*
|
|
16
|
+
* @see [Customizing `idle` behavior](guide/templates/defer#customizing-idle-behavior)
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export interface IdleService {
|
|
20
|
+
/**
|
|
21
|
+
* Schedule `callback` to be executed when the current application or browser is considered idle.
|
|
22
|
+
*
|
|
23
|
+
* @returns an id which allows the scheduled callback to be cancelled before it executes.
|
|
24
|
+
*/
|
|
25
|
+
requestOnIdle(callback: (deadline?: IdleDeadline) => void, options?: IdleRequestOptions): number;
|
|
26
|
+
/**
|
|
27
|
+
* Cancel a previously scheduled callback using the id associated with it.
|
|
28
|
+
*/
|
|
29
|
+
cancelOnIdle(id: number): void;
|
|
30
|
+
}
|
|
31
|
+
export declare const IDLE_SERVICE: InjectionToken<IdleService>;
|
|
32
|
+
/**
|
|
33
|
+
* Configures Angular to use the given DI token as its `IdleService`.
|
|
34
|
+
*
|
|
35
|
+
* The given token must be available for injection from the root injector, and the injected value
|
|
36
|
+
* must implement the `IdleService` interface.
|
|
37
|
+
*
|
|
38
|
+
* @publicApi
|
|
39
|
+
*
|
|
40
|
+
* @see [Customizing `idle` behavior](guide/templates/defer#customizing-idle-behavior)
|
|
41
|
+
*/
|
|
42
|
+
export declare function provideIdleServiceWith(useExisting: AbstractType<IdleService> | InjectionToken<IdleService>): EnvironmentProviders;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { Injector } from './injector';
|
|
9
|
-
import type { Provider, StaticProvider } from './interface/provider';
|
|
9
|
+
import type { EnvironmentProviders, Provider, StaticProvider } from './interface/provider';
|
|
10
10
|
import { R3Injector } from './r3_injector';
|
|
11
11
|
import { InjectorScope } from './scope';
|
|
12
12
|
/**
|
|
@@ -18,4 +18,4 @@ export declare function createInjector(defType: any, parent?: Injector | null, a
|
|
|
18
18
|
* where resolving the injector types immediately can lead to an infinite loop. The injector types
|
|
19
19
|
* should be resolved at a later point by calling `_resolveInjectorDefTypes`.
|
|
20
20
|
*/
|
|
21
|
-
export declare function createInjectorWithoutInjectorInstances(defType: any, parent?: Injector | null, additionalProviders?: Array<Provider |
|
|
21
|
+
export declare function createInjectorWithoutInjectorInstances(defType: any, parent?: Injector | null, additionalProviders?: Array<Provider | EnvironmentProviders> | null, name?: string, scopes?: Set<InjectorScope>): R3Injector;
|
|
@@ -36,7 +36,7 @@ export interface ForwardRefFn {
|
|
|
36
36
|
* @Component({
|
|
37
37
|
* imports: [ChildComponent],
|
|
38
38
|
* selector: 'app-parent',
|
|
39
|
-
* template: `<app-child [hideParent]="hideParent()"
|
|
39
|
+
* template: `<app-child [hideParent]="hideParent()"/>`,
|
|
40
40
|
* })
|
|
41
41
|
* export class ParentComponent {
|
|
42
42
|
* hideParent = input.required<boolean>();
|
|
@@ -47,7 +47,7 @@ export interface ForwardRefFn {
|
|
|
47
47
|
* imports: [forwardRef(() => ParentComponent)],
|
|
48
48
|
* selector: 'app-child',
|
|
49
49
|
* template: `
|
|
50
|
-
* @if(!hideParent() {
|
|
50
|
+
* @if(!hideParent()) {
|
|
51
51
|
* <app-parent/>
|
|
52
52
|
* }
|
|
53
53
|
* `,
|
package/import/di/index.d.ts
CHANGED
|
@@ -2,3 +2,7 @@ export { ProviderToken } from './provider_token';
|
|
|
2
2
|
export { assertInInjectionContext, runInInjectionContext } from './contextual';
|
|
3
3
|
export { EnvironmentInjector } from './r3_injector';
|
|
4
4
|
export { FactoryProvider } from './interface/provider';
|
|
5
|
+
export { inject } from './injector_compatibility';
|
|
6
|
+
export { InjectionToken } from './injection_token';
|
|
7
|
+
export { Injector } from './injector';
|
|
8
|
+
export { injectAsync, InjectAsyncOptions, PrefetchTrigger, onIdle } from './inject_async';
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { DefaultExport } from '../util/default_export';
|
|
9
|
+
import { ProviderToken } from './provider_token';
|
|
10
|
+
/**
|
|
11
|
+
* A helper function that allows to inject dependencies asynchronously,
|
|
12
|
+
* which can be useful in cases when the dependency is not needed immediately and can be loaded lazily.
|
|
13
|
+
*
|
|
14
|
+
* NOTE: To enable lazy loading, the injected service must be auto-provided. This means it should be decorated with either `@Injectable({providedIn: 'root'})` or `@Service()`.
|
|
15
|
+
*
|
|
16
|
+
* @param loader A function that returns a promise resolving to the injectable service
|
|
17
|
+
* @param options Configuration options for the async injection
|
|
18
|
+
*
|
|
19
|
+
* @returns A function that returns a promise resolving to the requested service instance.
|
|
20
|
+
*
|
|
21
|
+
* @usageNotes
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* class MyCmp {
|
|
25
|
+
* someSvc = injectAsync(() => import('..'));
|
|
26
|
+
*
|
|
27
|
+
* async onClick() {
|
|
28
|
+
* (await this.someSvc()).handleClick();
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* // we can also configure prefetching:
|
|
33
|
+
* injectAsync(.., {prefetch: onIdle})
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @see [Lazy loading services](guide/di/lazy-loading-services)
|
|
37
|
+
* @see [Injection context](guide/di/dependency-injection-context)
|
|
38
|
+
*
|
|
39
|
+
* @publicApi 22.0
|
|
40
|
+
*/
|
|
41
|
+
export declare function injectAsync<T>(loader: () => Promise<ProviderToken<T>>, options?: InjectAsyncOptions): () => Promise<T>;
|
|
42
|
+
export declare function injectAsync<T>(loader: () => Promise<DefaultExport<ProviderToken<T>>>, options?: InjectAsyncOptions): () => Promise<T>;
|
|
43
|
+
/**
|
|
44
|
+
* Interface for `options` argument used within `injectAsync` call.
|
|
45
|
+
*
|
|
46
|
+
* @see [Prefetching the dependency](guide/di/lazy-loading-services#prefetching-the-dependency)
|
|
47
|
+
*
|
|
48
|
+
* @publicApi 22.0
|
|
49
|
+
*/
|
|
50
|
+
export interface InjectAsyncOptions {
|
|
51
|
+
/**
|
|
52
|
+
* A trigger to eagerly prefetch the lazy-loaded dependency before it is requested.
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
prefetch?: PrefetchTrigger;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A function that returns a promise which, when resolved, will trigger the prefetching of
|
|
59
|
+
* the lazy-loaded dependency.
|
|
60
|
+
*
|
|
61
|
+
* @see {@link onIdle}
|
|
62
|
+
* @see [Prefetching the dependency](guide/di/lazy-loading-services#prefetching-the-dependency)
|
|
63
|
+
*
|
|
64
|
+
* @publicApi 22.0
|
|
65
|
+
*/
|
|
66
|
+
export type PrefetchTrigger = () => Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* A `PrefetchTrigger` helper function to provide the logic of triggering dependency loading
|
|
69
|
+
* when the browser becomes idle.
|
|
70
|
+
*
|
|
71
|
+
* Internally delegates to the configured {@link IdleService}, whose default implementation uses
|
|
72
|
+
* [`requestIdleCallback`](https://developer.mozilla.org/docs/Web/API/Window/requestIdleCallback)
|
|
73
|
+
* when available and falls back to `setTimeout` otherwise. The default behavior can be replaced
|
|
74
|
+
* with `provideIdleServiceWith`.
|
|
75
|
+
*
|
|
76
|
+
* @usageNotes
|
|
77
|
+
*
|
|
78
|
+
* ```ts
|
|
79
|
+
* injectAsync(import(...), {prefetch: onIdle})
|
|
80
|
+
*
|
|
81
|
+
* // or with custom idle options:
|
|
82
|
+
* injectAsync(import(...), {prefetch: () => onIdle({timeout: 100})})
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* @see [Prefetching the dependency](guide/di/lazy-loading-services#prefetching-the-dependency)
|
|
86
|
+
*
|
|
87
|
+
* @publicApi 22.0
|
|
88
|
+
*/
|
|
89
|
+
export declare function onIdle(options?: {
|
|
90
|
+
timeout?: number;
|
|
91
|
+
}): Promise<void>;
|
|
@@ -41,8 +41,14 @@ export interface InjectableDecorator {
|
|
|
41
41
|
*
|
|
42
42
|
*/
|
|
43
43
|
(): TypeDecorator;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated The `providedIn: NgModule` or `providedIn:'any'` options are deprecated. Please use the other signatures.
|
|
46
|
+
*/
|
|
44
47
|
(options?: {
|
|
45
|
-
providedIn: Type<any> | '
|
|
48
|
+
providedIn: Type<any> | 'any';
|
|
49
|
+
} & InjectableProvider): TypeDecorator;
|
|
50
|
+
(options?: {
|
|
51
|
+
providedIn: 'root' | 'platform' | null;
|
|
46
52
|
} & InjectableProvider): TypeDecorator;
|
|
47
53
|
new (): Injectable;
|
|
48
54
|
new (options?: {
|
|
@@ -60,6 +60,13 @@ import { Type } from '../interface/type';
|
|
|
60
60
|
export declare class InjectionToken<T> {
|
|
61
61
|
protected _desc: string;
|
|
62
62
|
readonly ɵprov: unknown;
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated The `providedIn: NgModule` or `providedIn:'any'` options are deprecated. Please use the other signature.
|
|
65
|
+
*/
|
|
66
|
+
constructor(_desc: string, options: {
|
|
67
|
+
providedIn: Type<any> | 'any';
|
|
68
|
+
factory: () => T;
|
|
69
|
+
});
|
|
63
70
|
/**
|
|
64
71
|
* @param _desc Description for the token,
|
|
65
72
|
* used only for debugging purposes,
|
package/import/di/injector.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ export declare abstract class Injector {
|
|
|
84
84
|
name?: string;
|
|
85
85
|
}): DestroyableInjector;
|
|
86
86
|
/** @nocollapse */
|
|
87
|
-
static ɵprov:
|
|
87
|
+
static ɵprov: import("./interface/defs").ɵɵInjectableDeclaration<Injector>;
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
90
|
* An Injector that the owner can destroy and trigger the DestroyRef.destroy hooks.
|
|
@@ -108,4 +108,3 @@ export declare function attachInjectFlag(decorator: any, flag: InternalInjectFla
|
|
|
108
108
|
* @param token Token that may contain monkey-patched DI flags property.
|
|
109
109
|
*/
|
|
110
110
|
export declare function getInjectFlag(token: any): number | undefined;
|
|
111
|
-
export declare function formatError(text: string, obj: any, injectorErrorName: string, source?: string | null): string;
|
|
@@ -123,8 +123,8 @@ export interface InjectorTypeWithProviders<T> {
|
|
|
123
123
|
export declare function ɵɵdefineInjectable<T>(opts: {
|
|
124
124
|
token: unknown;
|
|
125
125
|
providedIn?: Type<any> | 'root' | 'platform' | 'any' | 'environment' | null;
|
|
126
|
-
factory: () => T;
|
|
127
|
-
}):
|
|
126
|
+
factory: (parent?: Type<any>) => T;
|
|
127
|
+
}): ɵɵInjectableDeclaration<T>;
|
|
128
128
|
/**
|
|
129
129
|
* Construct an `InjectorDef` which configures an injector.
|
|
130
130
|
*
|
|
@@ -348,18 +348,3 @@ export interface ModuleWithProviders<T> {
|
|
|
348
348
|
ngModule: Type<T>;
|
|
349
349
|
providers?: Array<Provider | EnvironmentProviders>;
|
|
350
350
|
}
|
|
351
|
-
/**
|
|
352
|
-
* Providers that were imported from NgModules via the `importProvidersFrom` function.
|
|
353
|
-
*
|
|
354
|
-
* These providers are meant for use in an application injector (or other environment injectors) and
|
|
355
|
-
* should not be used in component injectors.
|
|
356
|
-
*
|
|
357
|
-
* This type cannot be directly implemented. It's returned from the `importProvidersFrom` function
|
|
358
|
-
* and serves to prevent the extracted NgModule providers from being used in the wrong contexts.
|
|
359
|
-
*
|
|
360
|
-
* @see {@link importProvidersFrom}
|
|
361
|
-
*
|
|
362
|
-
* @publicApi
|
|
363
|
-
* @deprecated replaced by `EnvironmentProviders`
|
|
364
|
-
*/
|
|
365
|
-
export type ImportedNgModuleProviders = EnvironmentProviders;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { InjectionToken } from './di';
|
|
9
|
+
/**
|
|
10
|
+
* A DI Token representing the main rendering context.
|
|
11
|
+
* In a browser and SSR this is the DOM Document.
|
|
12
|
+
* When using SSR, that document is created by [Domino](https://github.com/angular/domino).
|
|
13
|
+
*
|
|
14
|
+
* @see [Accessing Document via DI](guide/ssr#accessing-document-via-di)
|
|
15
|
+
*
|
|
16
|
+
* @publicApi
|
|
17
|
+
*/
|
|
18
|
+
export declare const DOCUMENT: InjectionToken<Document>;
|
package/import/errors.d.ts
CHANGED
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
* - animations: 3000-3999
|
|
23
23
|
* - router: 4000-4999
|
|
24
24
|
* - platform-browser: 5000-5500
|
|
25
|
+
* - service-worker: 5600-5699
|
|
26
|
+
* - platform-server: 5700-5800
|
|
25
27
|
*/
|
|
26
28
|
export declare const enum RuntimeErrorCode {
|
|
27
29
|
EXPRESSION_CHANGED_AFTER_CHECKED = -100,
|
|
@@ -31,12 +33,13 @@ export declare const enum RuntimeErrorCode {
|
|
|
31
33
|
PROVIDER_NOT_FOUND = -201,
|
|
32
34
|
INVALID_FACTORY_DEPENDENCY = 202,
|
|
33
35
|
MISSING_INJECTION_CONTEXT = -203,
|
|
34
|
-
INVALID_INJECTION_TOKEN = 204,
|
|
35
|
-
INJECTOR_ALREADY_DESTROYED = 205,
|
|
36
|
-
PROVIDER_IN_WRONG_CONTEXT = 207,
|
|
36
|
+
INVALID_INJECTION_TOKEN = -204,
|
|
37
|
+
INJECTOR_ALREADY_DESTROYED = -205,
|
|
38
|
+
PROVIDER_IN_WRONG_CONTEXT = -207,
|
|
37
39
|
MISSING_INJECTION_TOKEN = 208,
|
|
38
40
|
INVALID_MULTI_PROVIDER = -209,
|
|
39
41
|
MISSING_DOCUMENT = 210,
|
|
42
|
+
INVALID_APP_ID = 211,
|
|
40
43
|
MULTIPLE_COMPONENTS_MATCH = -300,
|
|
41
44
|
EXPORT_NOT_FOUND = -301,
|
|
42
45
|
PIPE_NOT_FOUND = -302,
|
|
@@ -93,18 +96,18 @@ export declare const enum RuntimeErrorCode {
|
|
|
93
96
|
MISSING_ZONEJS = 908,
|
|
94
97
|
UNEXPECTED_ZONE_STATE = 909,
|
|
95
98
|
UNSAFE_ATTRIBUTE_BINDING = -910,
|
|
96
|
-
/**
|
|
97
|
-
* @deprecated use `UNSAFE_ATTRIBUTE_BINDING` instead.
|
|
98
|
-
*/
|
|
99
|
-
UNSAFE_IFRAME_ATTRS = -910,
|
|
100
99
|
VIEW_ALREADY_DESTROYED = 911,
|
|
101
100
|
COMPONENT_ID_COLLISION = -912,
|
|
102
101
|
IMAGE_PERFORMANCE_WARNING = -913,
|
|
103
102
|
UNEXPECTED_ZONEJS_PRESENT_IN_ZONELESS_MODE = 914,
|
|
104
103
|
MISSING_NG_MODULE_DEFINITION = 915,
|
|
105
104
|
MISSING_DIRECTIVE_DEFINITION = 916,
|
|
106
|
-
NO_COMPONENT_FACTORY_FOUND = 917,
|
|
107
105
|
EXTERNAL_RESOURCE_LOADING_FAILED = 918,
|
|
106
|
+
DEF_TYPE_UNDEFINED = -919,
|
|
107
|
+
NG_MODULE_ID_NOT_FOUND = 920,
|
|
108
|
+
DUPLICATE_NG_MODULE_ID = 921,
|
|
109
|
+
VIEW_DESTROYED_INSERT_ERROR = 922,
|
|
110
|
+
VIEW_DESTROYED_MOVE_ERROR = 923,
|
|
108
111
|
REQUIRED_INPUT_NO_VALUE = -950,
|
|
109
112
|
REQUIRED_QUERY_NO_VALUE = -951,
|
|
110
113
|
REQUIRED_MODEL_NO_VALUE = 952,
|
|
@@ -114,7 +117,8 @@ export declare const enum RuntimeErrorCode {
|
|
|
114
117
|
RUNTIME_DEPS_INVALID_IMPORTED_TYPE = 980,
|
|
115
118
|
RUNTIME_DEPS_ORPHAN_COMPONENT = 981,
|
|
116
119
|
MUST_PROVIDE_STREAM_OPTION = 990,
|
|
117
|
-
RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE = 991
|
|
120
|
+
RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE = 991,
|
|
121
|
+
INVALID_RESOURCE_CREATION_IN_PARAMS = 992
|
|
118
122
|
}
|
|
119
123
|
/**
|
|
120
124
|
* Class that represents a runtime error.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { Subject, Subscription } from 'rxjs';
|
|
9
|
+
import { OutputRef } from './authoring/output/output_ref';
|
|
10
|
+
/**
|
|
11
|
+
* Use in components with the `@Output` directive to emit custom events
|
|
12
|
+
* synchronously or asynchronously, and register handlers for those events
|
|
13
|
+
* by subscribing to an instance.
|
|
14
|
+
*
|
|
15
|
+
* @usageNotes
|
|
16
|
+
*
|
|
17
|
+
* Extends
|
|
18
|
+
* [RxJS `Subject`](https://rxjs.dev/api/index/class/Subject)
|
|
19
|
+
* for Angular by adding the `emit()` method.
|
|
20
|
+
*
|
|
21
|
+
* In the following example, a component defines two output properties
|
|
22
|
+
* that create event emitters. When the title is clicked, the emitter
|
|
23
|
+
* emits an open or close event to toggle the current visibility state.
|
|
24
|
+
*
|
|
25
|
+
* ```angular-ts
|
|
26
|
+
* @Component({
|
|
27
|
+
* selector: 'zippy',
|
|
28
|
+
* template: `
|
|
29
|
+
* <div class="zippy">
|
|
30
|
+
* <div (click)="toggle()">Toggle</div>
|
|
31
|
+
* <div [hidden]="!visible">
|
|
32
|
+
* <ng-content></ng-content>
|
|
33
|
+
* </div>
|
|
34
|
+
* </div>`})
|
|
35
|
+
* export class Zippy {
|
|
36
|
+
* visible: boolean = true;
|
|
37
|
+
* @Output() open: EventEmitter<any> = new EventEmitter();
|
|
38
|
+
* @Output() close: EventEmitter<any> = new EventEmitter();
|
|
39
|
+
*
|
|
40
|
+
* toggle() {
|
|
41
|
+
* this.visible = !this.visible;
|
|
42
|
+
* if (this.visible) {
|
|
43
|
+
* this.open.emit(null);
|
|
44
|
+
* } else {
|
|
45
|
+
* this.close.emit(null);
|
|
46
|
+
* }
|
|
47
|
+
* }
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* Access the event object with the `$event` argument passed to the output event
|
|
52
|
+
* handler:
|
|
53
|
+
*
|
|
54
|
+
* ```html
|
|
55
|
+
* <zippy (open)="onOpen($event)" (close)="onClose($event)"></zippy>
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @see [Declaring outputs with the @Output decorator](guide/components/outputs#declaring-outputs-with-the-output-decorator)
|
|
59
|
+
*
|
|
60
|
+
* @publicApi
|
|
61
|
+
*/
|
|
62
|
+
export interface EventEmitter<T> extends Subject<T>, OutputRef<T> {
|
|
63
|
+
/**
|
|
64
|
+
* Creates an instance of this class that can
|
|
65
|
+
* deliver events synchronously or asynchronously.
|
|
66
|
+
*
|
|
67
|
+
* @param [isAsync=false] When true, deliver events asynchronously.
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
70
|
+
new (isAsync?: boolean): EventEmitter<T>;
|
|
71
|
+
/**
|
|
72
|
+
* Emits an event containing a given value.
|
|
73
|
+
* @param value The value to emit.
|
|
74
|
+
*/
|
|
75
|
+
emit(value?: T): void;
|
|
76
|
+
/**
|
|
77
|
+
* Registers handlers for events emitted by this instance.
|
|
78
|
+
* @param next When supplied, a custom handler for emitted events.
|
|
79
|
+
* @param error When supplied, a custom handler for an error notification from this emitter.
|
|
80
|
+
* @param complete When supplied, a custom handler for a completion notification from this
|
|
81
|
+
* emitter.
|
|
82
|
+
*/
|
|
83
|
+
subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Subscription;
|
|
84
|
+
/**
|
|
85
|
+
* Registers handlers for events emitted by this instance.
|
|
86
|
+
* @param observerOrNext When supplied, a custom handler for emitted events, or an observer
|
|
87
|
+
* object.
|
|
88
|
+
* @param error When supplied, a custom handler for an error notification from this emitter.
|
|
89
|
+
* @param complete When supplied, a custom handler for a completion notification from this
|
|
90
|
+
* emitter.
|
|
91
|
+
*/
|
|
92
|
+
subscribe(observerOrNext?: any, error?: any, complete?: any): Subscription;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* @publicApi
|
|
96
|
+
*/
|
|
97
|
+
export declare const EventEmitter: {
|
|
98
|
+
new (isAsync?: boolean): EventEmitter<any>;
|
|
99
|
+
new <T>(isAsync?: boolean): EventEmitter<T>;
|
|
100
|
+
readonly prototype: EventEmitter<any>;
|
|
101
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { InjectionToken } from '../di';
|
|
9
|
+
/**
|
|
10
|
+
* Token used to the determine if the transfer cache should be used, for example for resources.
|
|
11
|
+
*/
|
|
12
|
+
export declare const CACHE_ACTIVE: InjectionToken<{
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
}>;
|
package/import/index.d.ts
CHANGED
|
@@ -23,6 +23,22 @@ export * from './di/provider_token';
|
|
|
23
23
|
export * from './error_handler';
|
|
24
24
|
export * from './pending_tasks';
|
|
25
25
|
export * from './linker/destroy_ref';
|
|
26
|
+
export { StateKey, makeStateKey, TransferState } from './transfer_state';
|
|
27
|
+
export { EventEmitter } from './event_emitter';
|
|
28
|
+
export { Type, AbstractType } from './interface/type';
|
|
29
|
+
export { IdleService, provideIdleServiceWith } from './defer/idle_service';
|
|
30
|
+
export { OnDestroy } from './change_detection/lifecycle_hooks';
|
|
31
|
+
export { runInInjectionContext, assertInInjectionContext } from './di/contextual';
|
|
32
|
+
export { APP_ID } from './application/application_tokens';
|
|
33
|
+
export { ForwardRefFn, forwardRef, resolveForwardRef } from './di/forward_ref';
|
|
34
|
+
export { OutputRefSubscription, OutputRef } from './authoring/output/output_ref';
|
|
35
|
+
export { TypeDecorator } from './util/decorators';
|
|
36
|
+
export { injectAsync, InjectAsyncOptions, PrefetchTrigger, onIdle } from './di/inject_async';
|
|
37
|
+
export { Signal, isSignal, ValueEqualityFn, isWritableSignal } from './render3/reactivity/api';
|
|
38
|
+
export { assertNotInReactiveContext } from './render3/reactivity/asserts';
|
|
39
|
+
export { EffectRef, CreateEffectOptions, EffectCleanupFn, EffectCleanupRegisterFn, effect } from './render3/reactivity/effect';
|
|
40
|
+
export { linkedSignal } from './render3/reactivity/linked_signal';
|
|
41
|
+
export { WritableSignal, signal } from './render3/reactivity/signal';
|
|
26
42
|
export { StaticProvider } from './di/interface/provider';
|
|
27
43
|
export { EffectScheduler } from './render3/reactivity/root_effect_scheduler';
|
|
28
44
|
export declare function Injectable(args?: any): (constructor: Function) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DestroyRef } from './linker/destroy_ref';
|
|
@@ -5,29 +5,6 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
import { Observable } from 'rxjs';
|
|
9
|
-
import { OnDestroy } from './interface/lifecycle_hooks';
|
|
10
|
-
/**
|
|
11
|
-
* Internal implementation of the pending tasks service.
|
|
12
|
-
*/
|
|
13
|
-
export declare class PendingTasksInternal implements OnDestroy {
|
|
14
|
-
private taskId;
|
|
15
|
-
private pendingTasks;
|
|
16
|
-
private destroyed;
|
|
17
|
-
private pendingTask;
|
|
18
|
-
get hasPendingTasks(): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* In case the service is about to be destroyed, return a self-completing observable.
|
|
21
|
-
* Otherwise, return the observable that emits the current state of pending tasks.
|
|
22
|
-
*/
|
|
23
|
-
get hasPendingTasksObservable(): Observable<boolean>;
|
|
24
|
-
add(): number;
|
|
25
|
-
has(taskId: number): boolean;
|
|
26
|
-
remove(taskId: number): void;
|
|
27
|
-
ngOnDestroy(): void;
|
|
28
|
-
/** @nocollapse */
|
|
29
|
-
static ɵprov: unknown;
|
|
30
|
-
}
|
|
31
8
|
/**
|
|
32
9
|
* Service that keeps track of pending tasks contributing to the stableness of Angular
|
|
33
10
|
* application. While several existing Angular services (ex.: `HttpClient`) will internally manage
|
|
@@ -76,5 +53,5 @@ export declare class PendingTasks {
|
|
|
76
53
|
*/
|
|
77
54
|
run(fn: () => Promise<unknown>): void;
|
|
78
55
|
/** @nocollapse */
|
|
79
|
-
static ɵprov:
|
|
56
|
+
static ɵprov: import("./di/interface/defs").ɵɵInjectableDeclaration<PendingTasks>;
|
|
80
57
|
}
|