Skip to content

Commit f5c605b

Browse files
JiaLiPassionAndrewKushnir
authored andcommitted
fix(zone.js): should expose some other internal intefaces (#31866)
PR Close #31866
1 parent 14dba72 commit f5c605b

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

packages/zone.js/lib/zone.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,15 @@ interface ZoneType {
321321
__symbol__(name: string): string;
322322
}
323323

324-
/** @internal */
324+
/**
325+
* Patch Function to allow user define their own monkey patch module.
326+
*/
325327
type _PatchFn = (global: Window, Zone: ZoneType, api: _ZonePrivate) => void;
326328

327-
/** @internal */
329+
/**
330+
* _ZonePrivate interface to provide helper method to help user implement
331+
* their own monkey patch module.
332+
*/
328333
interface _ZonePrivate {
329334
currentZoneFrame: () => _ZoneFrame;
330335
symbol: (name: string) => string;
@@ -366,7 +371,9 @@ interface _ZonePrivate {
366371
} | undefined;
367372
}
368373

369-
/** @internal */
374+
/**
375+
* _ZoneFrame represents zone stack frame information
376+
*/
370377
interface _ZoneFrame {
371378
parent: _ZoneFrame|null;
372379
zone: Zone;
@@ -703,6 +710,7 @@ const Zone: ZoneType = (function(global: any) {
703710
}
704711

705712
class Zone implements AmbientZone {
713+
// tslint:disable-next-line:require-internal-with-underscore
706714
static __symbol__: (name: string) => string = __symbol__;
707715

708716
static assertZonePatched() {
@@ -728,6 +736,7 @@ const Zone: ZoneType = (function(global: any) {
728736

729737
static get currentTask(): Task|null { return _currentTask; }
730738

739+
// tslint:disable-next-line:require-internal-with-underscore
731740
static __load_patch(name: string, fn: _PatchFn): void {
732741
if (patches.hasOwnProperty(name)) {
733742
if (checkDuplicate) {
@@ -1184,6 +1193,7 @@ const Zone: ZoneType = (function(global: any) {
11841193
}
11851194
}
11861195

1196+
// tslint:disable-next-line:require-internal-with-underscore
11871197
_updateTaskCount(type: TaskType, count: number) {
11881198
const counts = this._taskCounts;
11891199
const prev = counts[type];
@@ -1211,9 +1221,12 @@ const Zone: ZoneType = (function(global: any) {
12111221
public data: TaskData|undefined;
12121222
public scheduleFn: ((task: Task) => void)|undefined;
12131223
public cancelFn: ((task: Task) => void)|undefined;
1224+
// tslint:disable-next-line:require-internal-with-underscore
12141225
_zone: Zone|null = null;
12151226
public runCount: number = 0;
1227+
// tslint:disable-next-line:require-internal-with-underscore
12161228
_zoneDelegates: ZoneDelegate[]|null = null;
1229+
// tslint:disable-next-line:require-internal-with-underscore
12171230
_state: TaskState = 'notScheduled';
12181231

12191232
constructor(
@@ -1261,6 +1274,7 @@ const Zone: ZoneType = (function(global: any) {
12611274

12621275
public cancelScheduleRequest() { this._transitionTo(notScheduled, scheduling); }
12631276

1277+
// tslint:disable-next-line:require-internal-with-underscore
12641278
_transitionTo(toState: TaskState, fromState1: TaskState, fromState2?: TaskState) {
12651279
if (this._state === fromState1 || this._state === fromState2) {
12661280
this._state = toState;

0 commit comments

Comments
 (0)