mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
This commit adds explicit type annotations to the reactive node prototype objects, such that the prototypes are type-checked against the interface they are supposed to (partially) implement. This also allows IDEs to better track usages of reactive node properties, improving code navigation. PR Close #51722 PR Close #51772
This commit is contained in:
@@ -57,7 +57,7 @@ export function commitLViewConsumerIfHasProducers(
|
||||
currentConsumer = createLViewConsumer();
|
||||
}
|
||||
|
||||
const REACTIVE_LVIEW_CONSUMER_NODE = {
|
||||
const REACTIVE_LVIEW_CONSUMER_NODE: ReactiveLViewConsumer = {
|
||||
...REACTIVE_NODE,
|
||||
consumerIsAlwaysLive: true,
|
||||
consumerMarkedDirty: (node: ReactiveLViewConsumer) => {
|
||||
|
||||
@@ -26,7 +26,7 @@ export function setActiveConsumer(consumer: ReactiveNode|null): ReactiveNode|nul
|
||||
return prev;
|
||||
}
|
||||
|
||||
export const REACTIVE_NODE = {
|
||||
export const REACTIVE_NODE: ReactiveNode = {
|
||||
version: 0 as Version,
|
||||
dirty: false,
|
||||
producerNode: undefined,
|
||||
|
||||
@@ -83,7 +83,7 @@ interface WatchNode extends ReactiveNode {
|
||||
ref: Watch;
|
||||
}
|
||||
|
||||
const WATCH_NODE = {
|
||||
const WATCH_NODE: Partial<WatchNode> = {
|
||||
...REACTIVE_NODE,
|
||||
consumerIsAlwaysLive: true,
|
||||
consumerAllowSignalWrites: false,
|
||||
|
||||
Reference in New Issue
Block a user