@angular/core 20.0.0-next.2 → 20.0.0-next.4

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.
Files changed (56) hide show
  1. package/event_dispatcher.d-pVP0-wST.d.ts +345 -0
  2. package/fesm2022/core.mjs +614 -428
  3. package/fesm2022/core.mjs.map +1 -1
  4. package/fesm2022/injector-BlLwZ2sr.mjs +24 -0
  5. package/fesm2022/injector-BlLwZ2sr.mjs.map +1 -0
  6. package/fesm2022/primitives/di.mjs +5 -18
  7. package/fesm2022/primitives/di.mjs.map +1 -1
  8. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  9. package/fesm2022/primitives/signals.mjs +4 -589
  10. package/fesm2022/primitives/signals.mjs.map +1 -1
  11. package/fesm2022/rxjs-interop.mjs +1 -8
  12. package/fesm2022/rxjs-interop.mjs.map +1 -1
  13. package/fesm2022/testing.mjs +2 -10
  14. package/fesm2022/testing.mjs.map +1 -1
  15. package/fesm2022/untracked-DkcXpNb_.mjs +620 -0
  16. package/fesm2022/untracked-DkcXpNb_.mjs.map +1 -0
  17. package/index.d.ts +7589 -7510
  18. package/{navigation_types.d-u4EOrrdZ.d.ts → navigation_types.d-DgDrF5rp.d.ts} +2 -2
  19. package/package.json +2 -2
  20. package/primitives/di/index.d.ts +25 -10
  21. package/primitives/event-dispatch/index.d.ts +5 -340
  22. package/primitives/signals/index.d.ts +5 -208
  23. package/rxjs-interop/index.d.ts +1 -10
  24. package/schematics/bundles/{apply_import_manager-CyRT0UvU.js → apply_import_manager-CeNv8GIG.js} +6 -6
  25. package/schematics/bundles/{checker-DF8ZaFW5.js → checker-k591b6WQ.js} +856 -180
  26. package/schematics/bundles/cleanup-unused-imports.js +42 -69
  27. package/schematics/bundles/{compiler_host-Da636uJ8.js → compiler_host-DwM3ugW3.js} +2 -2
  28. package/schematics/bundles/control-flow-migration.js +34 -13
  29. package/schematics/bundles/imports-CIX-JgAN.js +1 -1
  30. package/schematics/bundles/{program-BZk27Ndu.js → index-B4OAlHh8.js} +2234 -2097
  31. package/schematics/bundles/{index-DnkWgagp.js → index-BhELUmYx.js} +11 -11
  32. package/schematics/bundles/inject-flags.js +18 -52
  33. package/schematics/bundles/inject-migration.js +3 -3
  34. package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
  35. package/schematics/bundles/{migrate_ts_type_references-DtkOnnv0.js → migrate_ts_type_references-Be0TNYen.js} +20 -20
  36. package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
  37. package/schematics/bundles/nodes-B16H9JUd.js +1 -1
  38. package/schematics/bundles/output-migration.js +62 -90
  39. package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.js +1 -1
  40. package/schematics/bundles/property_name-BBwFuqMe.js +1 -1
  41. package/schematics/bundles/route-lazy-loading.js +3 -3
  42. package/schematics/bundles/{project_paths-Jtbi76Bs.js → run_in_devkit-CkvEksWP.js} +262 -197
  43. package/schematics/bundles/self-closing-tags-migration.js +41 -71
  44. package/schematics/bundles/signal-input-migration.js +69 -97
  45. package/schematics/bundles/signal-queries-migration.js +80 -108
  46. package/schematics/bundles/signals.js +11 -11
  47. package/schematics/bundles/standalone-migration.js +8 -22
  48. package/schematics/bundles/symbol-VPWguRxr.js +25 -0
  49. package/schematics/bundles/test-bed-get.js +98 -0
  50. package/schematics/migrations.json +5 -0
  51. package/testing/index.d.ts +2 -4
  52. package/weak_ref.d-BZ7gyRag.d.ts +216 -0
  53. package/fesm2022/weak_ref-DrMdAIDh.mjs +0 -12
  54. package/fesm2022/weak_ref-DrMdAIDh.mjs.map +0 -1
  55. package/schematics/bundles/index-vGJcp5M7.js +0 -30
  56. package/weak_ref.d-ttyj86RV.d.ts +0 -9
@@ -0,0 +1,345 @@
1
+ /**
2
+ * @license Angular v20.0.0-next.4
3
+ * (c) 2010-2025 Google LLC. https://angular.io/
4
+ * License: MIT
5
+ */
6
+
7
+ /**
8
+ * Records information about the action that should handle a given `Event`.
9
+ */
10
+ interface ActionInfo {
11
+ name: string;
12
+ element: Element;
13
+ }
14
+ type ActionInfoInternal = [name: string, element: Element];
15
+ /**
16
+ * Records information for later handling of events. This type is
17
+ * shared, and instances of it are passed, between the eventcontract
18
+ * and the dispatcher jsbinary. Therefore, the fields of this type are
19
+ * referenced by string literals rather than property literals
20
+ * throughout the code.
21
+ *
22
+ * 'targetElement' is the element the action occurred on, 'actionElement'
23
+ * is the element that has the jsaction handler.
24
+ *
25
+ * A null 'actionElement' identifies an EventInfo instance that didn't match a
26
+ * jsaction attribute. This allows us to execute global event handlers with the
27
+ * appropriate event type (including a11y clicks and custom events).
28
+ * The declare portion of this interface creates a set of externs that make sure
29
+ * renaming doesn't happen for EventInfo. This is important since EventInfo
30
+ * is shared across multiple binaries.
31
+ */
32
+ declare interface EventInfo {
33
+ eventType: string;
34
+ event: Event;
35
+ targetElement: Element;
36
+ /** The element that is the container for this Event. */
37
+ eic: Element;
38
+ timeStamp: number;
39
+ /**
40
+ * The action parsed from the JSAction element.
41
+ */
42
+ eia?: ActionInfoInternal;
43
+ /**
44
+ * Whether this `Event` is a replay event, meaning no dispatcher was
45
+ * installed when this `Event` was originally dispatched.
46
+ */
47
+ eirp?: boolean;
48
+ /**
49
+ * Whether this `Event` represents a `keydown` event that should be processed
50
+ * as a `click`. Only used when a11y click events is on.
51
+ */
52
+ eiack?: boolean;
53
+ /** Whether action resolution has already run on this `EventInfo`. */
54
+ eir?: boolean;
55
+ }
56
+ /**
57
+ * Utility class around an `EventInfo`.
58
+ *
59
+ * This should be used in compilation units that are less sensitive to code
60
+ * size.
61
+ */
62
+ declare class EventInfoWrapper {
63
+ readonly eventInfo: EventInfo;
64
+ constructor(eventInfo: EventInfo);
65
+ getEventType(): string;
66
+ setEventType(eventType: string): void;
67
+ getEvent(): Event;
68
+ setEvent(event: Event): void;
69
+ getTargetElement(): Element;
70
+ setTargetElement(targetElement: Element): void;
71
+ getContainer(): Element;
72
+ setContainer(container: Element): void;
73
+ getTimestamp(): number;
74
+ setTimestamp(timestamp: number): void;
75
+ getAction(): {
76
+ name: string;
77
+ element: Element;
78
+ } | undefined;
79
+ setAction(action: ActionInfo | undefined): void;
80
+ getIsReplay(): boolean | undefined;
81
+ setIsReplay(replay: boolean): void;
82
+ getResolved(): boolean | undefined;
83
+ setResolved(resolved: boolean): void;
84
+ clone(): EventInfoWrapper;
85
+ }
86
+
87
+ declare interface EarlyJsactionDataContainer {
88
+ _ejsa?: EarlyJsactionData;
89
+ _ejsas?: {
90
+ [appId: string]: EarlyJsactionData | undefined;
91
+ };
92
+ }
93
+ declare global {
94
+ interface Window {
95
+ _ejsa?: EarlyJsactionData;
96
+ _ejsas?: {
97
+ [appId: string]: EarlyJsactionData | undefined;
98
+ };
99
+ }
100
+ }
101
+ /**
102
+ * Defines the early jsaction data types.
103
+ */
104
+ declare interface EarlyJsactionData {
105
+ /** List used to keep track of the early JSAction event types. */
106
+ et: string[];
107
+ /** List used to keep track of the early JSAction capture event types. */
108
+ etc: string[];
109
+ /** Early JSAction handler for all events. */
110
+ h: (event: Event) => void;
111
+ /** Dispatcher handler. Initializes to populating `q`. */
112
+ d: (eventInfo: EventInfo) => void;
113
+ /** List used to push `EventInfo` objects if the dispatcher is not registered. */
114
+ q: EventInfo[];
115
+ /** Container for listening to events. */
116
+ c: HTMLElement;
117
+ }
118
+
119
+ /**
120
+ * An `EventContractContainerManager` provides the common interface for managing
121
+ * containers.
122
+ */
123
+ interface EventContractContainerManager {
124
+ addEventListener(eventType: string, getHandler: (element: Element) => (event: Event) => void, passive?: boolean): void;
125
+ cleanUp(): void;
126
+ }
127
+ /**
128
+ * A class representing a container node and all the event handlers
129
+ * installed on it. Used so that handlers can be cleaned up if the
130
+ * container is removed from the contract.
131
+ */
132
+ declare class EventContractContainer implements EventContractContainerManager {
133
+ readonly element: Element;
134
+ /**
135
+ * Array of event handlers and their corresponding event types that are
136
+ * installed on this container.
137
+ *
138
+ */
139
+ private handlerInfos;
140
+ /**
141
+ * @param element The container Element.
142
+ */
143
+ constructor(element: Element);
144
+ /**
145
+ * Installs the provided installer on the element owned by this container,
146
+ * and maintains a reference to resulting handler in order to remove it
147
+ * later if desired.
148
+ */
149
+ addEventListener(eventType: string, getHandler: (element: Element) => (event: Event) => void, passive?: boolean): void;
150
+ /**
151
+ * Removes all the handlers installed on this container.
152
+ */
153
+ cleanUp(): void;
154
+ }
155
+
156
+ /**
157
+ * @fileoverview An enum to control who can call certain jsaction APIs.
158
+ */
159
+ declare enum Restriction {
160
+ I_AM_THE_JSACTION_FRAMEWORK = 0
161
+ }
162
+
163
+ /**
164
+ * @fileoverview Implements the local event handling contract. This
165
+ * allows DOM objects in a container that enters into this contract to
166
+ * define event handlers which are executed in a local context.
167
+ *
168
+ * One EventContract instance can manage the contract for multiple
169
+ * containers, which are added using the addContainer() method.
170
+ *
171
+ * Events can be registered using the addEvent() method.
172
+ *
173
+ * A Dispatcher is added using the registerDispatcher() method. Until there is
174
+ * a dispatcher, events are queued. The idea is that the EventContract
175
+ * class is inlined in the HTML of the top level page and instantiated
176
+ * right after the start of <body>. The Dispatcher class is contained
177
+ * in the external deferred js, and instantiated and registered with
178
+ * EventContract when the external javascript in the page loads. The
179
+ * external javascript will also register the jsaction handlers, which
180
+ * then pick up the queued events at the time of registration.
181
+ *
182
+ * Since this class is meant to be inlined in the main page HTML, the
183
+ * size of the binary compiled from this file MUST be kept as small as
184
+ * possible and thus its dependencies to a minimum.
185
+ */
186
+
187
+ /**
188
+ * The API of an EventContract that is safe to call from any compilation unit.
189
+ */
190
+ declare interface UnrenamedEventContract {
191
+ ecrd(dispatcher: Dispatcher, restriction: Restriction): void;
192
+ }
193
+ /** A function that is called to handle events captured by the EventContract. */
194
+ type Dispatcher = (eventInfo: EventInfo, globalDispatch?: boolean) => void;
195
+ /**
196
+ * A function that handles an event dispatched from the browser.
197
+ *
198
+ * eventType: May differ from `event.type` if JSAction uses a
199
+ * short-hand name or is patching over an non-bubbling event with a bubbling
200
+ * variant.
201
+ * event: The native browser event.
202
+ * container: The container for this dispatch.
203
+ */
204
+ type EventHandler = (eventType: string, event: Event, container: Element) => void;
205
+ /**
206
+ * EventContract intercepts events in the bubbling phase at the
207
+ * boundary of a container element, and maps them to generic actions
208
+ * which are specified using the custom jsaction attribute in
209
+ * HTML. Behavior of the application is then specified in terms of
210
+ * handler for such actions, cf. jsaction.Dispatcher in dispatcher.js.
211
+ *
212
+ * This has several benefits: (1) No DOM event handlers need to be
213
+ * registered on the specific elements in the UI. (2) The set of
214
+ * events that the application has to handle can be specified in terms
215
+ * of the semantics of the application, rather than in terms of DOM
216
+ * events. (3) Invocation of handlers can be delayed and handlers can
217
+ * be delay loaded in a generic way.
218
+ */
219
+ declare class EventContract implements UnrenamedEventContract {
220
+ static MOUSE_SPECIAL_SUPPORT: boolean;
221
+ private containerManager;
222
+ /**
223
+ * The DOM events which this contract covers. Used to prevent double
224
+ * registration of event types. The value of the map is the
225
+ * internally created DOM event handler function that handles the
226
+ * DOM events. See addEvent().
227
+ *
228
+ */
229
+ private eventHandlers;
230
+ private browserEventTypeToExtraEventTypes;
231
+ /**
232
+ * The dispatcher function. Events are passed to this function for
233
+ * handling once it was set using the registerDispatcher() method. This is
234
+ * done because the function is passed from another jsbinary, so passing the
235
+ * instance and invoking the method here would require to leave the method
236
+ * unobfuscated.
237
+ */
238
+ private dispatcher;
239
+ /**
240
+ * The list of suspended `EventInfo` that will be dispatched
241
+ * as soon as the `Dispatcher` is registered.
242
+ */
243
+ private queuedEventInfos;
244
+ constructor(containerManager: EventContractContainerManager);
245
+ private handleEvent;
246
+ /**
247
+ * Handle an `EventInfo`.
248
+ */
249
+ private handleEventInfo;
250
+ /**
251
+ * Enables jsaction handlers to be called for the event type given by
252
+ * name.
253
+ *
254
+ * If the event is already registered, this does nothing.
255
+ *
256
+ * @param prefixedEventType If supplied, this event is used in
257
+ * the actual browser event registration instead of the name that is
258
+ * exposed to jsaction. Use this if you e.g. want users to be able
259
+ * to subscribe to jsaction="transitionEnd:foo" while the underlying
260
+ * event is webkitTransitionEnd in one browser and mozTransitionEnd
261
+ * in another.
262
+ *
263
+ * @param passive A boolean value that, if `true`, indicates that the event
264
+ * handler will never call `preventDefault()`.
265
+ */
266
+ addEvent(eventType: string, prefixedEventType?: string, passive?: boolean): void;
267
+ /**
268
+ * Gets the queued early events and replay them using the appropriate handler
269
+ * in the provided event contract. Once all the events are replayed, it cleans
270
+ * up the early contract.
271
+ */
272
+ replayEarlyEvents(earlyJsactionData?: EarlyJsactionData | undefined): void;
273
+ /**
274
+ * Replays all the early `EventInfo` objects, dispatching them through the normal
275
+ * `EventContract` flow.
276
+ */
277
+ replayEarlyEventInfos(earlyEventInfos: EventInfo[]): void;
278
+ /**
279
+ * Returns all JSAction event types that have been registered for a given
280
+ * browser event type.
281
+ */
282
+ private getEventTypesForBrowserEventType;
283
+ /**
284
+ * Returns the event handler function for a given event type.
285
+ */
286
+ handler(eventType: string): EventHandler | undefined;
287
+ /**
288
+ * Cleans up the event contract. This resets all of the `EventContract`'s
289
+ * internal state. Users are responsible for not using this `EventContract`
290
+ * after it has been cleaned up.
291
+ */
292
+ cleanUp(): void;
293
+ /**
294
+ * Register a dispatcher function. Event info of each event mapped to
295
+ * a jsaction is passed for handling to this callback. The queued
296
+ * events are passed as well to the dispatcher for later replaying
297
+ * once the dispatcher is registered. Clears the event queue to null.
298
+ *
299
+ * @param dispatcher The dispatcher function.
300
+ * @param restriction
301
+ */
302
+ registerDispatcher(dispatcher: Dispatcher, restriction: Restriction): void;
303
+ /**
304
+ * Unrenamed alias for registerDispatcher. Necessary for any codebases that
305
+ * split the `EventContract` and `Dispatcher` code into different compilation
306
+ * units.
307
+ */
308
+ ecrd(dispatcher: Dispatcher, restriction: Restriction): void;
309
+ }
310
+
311
+ /** An internal symbol used to indicate whether propagation should be stopped or not. */
312
+ declare const PROPAGATION_STOPPED_SYMBOL: unique symbol;
313
+ /** Extra event phases beyond what the browser provides. */
314
+ declare const EventPhase: {
315
+ REPLAY: number;
316
+ };
317
+ declare global {
318
+ interface Event {
319
+ [PROPAGATION_STOPPED_SYMBOL]?: boolean;
320
+ }
321
+ }
322
+ /**
323
+ * A dispatcher that uses browser-based `Event` semantics, for example bubbling, `stopPropagation`,
324
+ * `currentTarget`, etc.
325
+ */
326
+ declare class EventDispatcher {
327
+ private readonly dispatchDelegate;
328
+ private readonly clickModSupport;
329
+ private readonly actionResolver;
330
+ private readonly dispatcher;
331
+ constructor(dispatchDelegate: (event: Event, actionName: string) => void, clickModSupport?: boolean);
332
+ /**
333
+ * The entrypoint for the `EventContract` dispatch.
334
+ */
335
+ dispatch(eventInfo: EventInfo): void;
336
+ /** Internal method that does basic disaptching. */
337
+ private dispatchToDelegate;
338
+ }
339
+ /**
340
+ * Registers deferred functionality for an EventContract and a Jsaction
341
+ * Dispatcher.
342
+ */
343
+ declare function registerDispatcher(eventContract: UnrenamedEventContract, dispatcher: EventDispatcher): void;
344
+
345
+ export { type EarlyJsactionDataContainer as E, Restriction as R, type EventInfo as a, EventContractContainer as b, EventDispatcher as c, EventPhase as d, EventInfoWrapper as e, EventContract as f, registerDispatcher as r };