File tree Expand file tree Collapse file tree 5 files changed +49
-17
lines changed
goldens/public-api/angular_devkit/schematics
packages/angular_devkit/schematics/src/tree Expand file tree Collapse file tree 5 files changed +49
-17
lines changed Original file line number Diff line number Diff line change @@ -202,10 +202,14 @@ export interface CreateFileAction extends ActionBase {
202202 readonly kind: ' c' ;
203203}
204204
205+ // @public (undocumented)
206+ export interface DelegateTree {
207+ }
208+
205209// @public (undocumented)
206210export class DelegateTree implements Tree_2 {
207211 // (undocumented)
208- [TreeSymbol ]: () => this ;
212+ [TreeSymbol ]: () => DelegateTree ;
209213 constructor (_other : Tree_2 );
210214 // (undocumented)
211215 get actions(): Action [];
@@ -516,10 +520,14 @@ export class HostSink extends SimpleSinkBase {
516520 protected _validateFileExists(p : Path ): Observable <boolean >;
517521}
518522
523+ // @public (undocumented)
524+ export interface HostTree {
525+ }
526+
519527// @public (undocumented)
520528export class HostTree implements Tree_2 {
521529 // (undocumented)
522- [TreeSymbol ]: () => this ;
530+ [TreeSymbol ]: () => HostTree ;
523531 constructor (_backend ? : virtualFs .ReadonlyHost <{}>);
524532 // (undocumented)
525533 get actions(): Action [];
Original file line number Diff line number Diff line change @@ -18,8 +18,18 @@ import {
1818 UpdateRecorder ,
1919} from './interface' ;
2020
21+ // Workaround for "error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations."
22+ // When this is fixed within TypeScript, the method can be added back directly to the class.
23+ // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
24+ export interface DelegateTree {
25+ [ TreeSymbol ] ( ) : DelegateTree ;
26+ }
27+
28+ // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
2129export class DelegateTree implements Tree {
22- constructor ( protected _other : Tree ) { }
30+ constructor ( protected _other : Tree ) {
31+ this [ TreeSymbol ] = ( ) => this ;
32+ }
2333
2434 branch ( ) : Tree {
2535 return this . _other . branch ( ) ;
@@ -83,8 +93,4 @@ export class DelegateTree implements Tree {
8393 get actions ( ) : Action [ ] {
8494 return this . _other . actions ;
8595 }
86-
87- [ TreeSymbol ] ( ) {
88- return this ;
89- }
9096}
Original file line number Diff line number Diff line change @@ -98,6 +98,14 @@ export class HostDirEntry implements DirEntry {
9898 }
9999}
100100
101+ // Workaround for "error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations."
102+ // When this is fixed within TypeScript, the method can be added back directly to the class.
103+ // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
104+ export interface HostTree {
105+ [ TreeSymbol ] ( ) : HostTree ;
106+ }
107+
108+ // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
101109export class HostTree implements Tree {
102110 private readonly _id = -- _uniqueId ;
103111 private _record : virtualFs . CordHost ;
@@ -106,10 +114,6 @@ export class HostTree implements Tree {
106114
107115 private _dirCache = new Map < Path , HostDirEntry > ( ) ;
108116
109- [ TreeSymbol ] ( ) : this {
110- return this ;
111- }
112-
113117 static isHostTree ( tree : Tree ) : tree is HostTree {
114118 if ( tree instanceof HostTree ) {
115119 return true ;
@@ -123,6 +127,7 @@ export class HostTree implements Tree {
123127 }
124128
125129 constructor ( protected _backend : virtualFs . ReadonlyHost < { } > = new virtualFs . Empty ( ) ) {
130+ this [ TreeSymbol ] = ( ) => this ;
126131 this . _record = new virtualFs . CordHost ( new virtualFs . SafeReadonlyHost ( _backend ) ) ;
127132 this . _recordSync = new virtualFs . SyncDelegateHost ( this . _record ) ;
128133 }
Original file line number Diff line number Diff line change @@ -46,9 +46,17 @@ export class NullTreeDirEntry implements DirEntry {
4646 visit ( ) : void { }
4747}
4848
49+ // Workaround for "error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations."
50+ // When this is fixed within TypeScript, the method can be added back directly to the class.
51+ // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
52+ export interface NullTree {
53+ [ TreeSymbol ] ( ) : NullTree ;
54+ }
55+
56+ // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
4957export class NullTree implements Tree {
50- [ TreeSymbol ] ( ) : this {
51- return this ;
58+ constructor ( ) {
59+ this [ TreeSymbol ] = ( ) => this ;
5260 }
5361
5462 branch ( ) : Tree {
Original file line number Diff line number Diff line change @@ -89,13 +89,22 @@ class ScopedDirEntry implements DirEntry {
8989 }
9090}
9191
92+ // Workaround for "error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations."
93+ // When this is fixed within TypeScript, the method can be added back directly to the class.
94+ // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
95+ export interface ScopedTree {
96+ [ TreeSymbol ] ( ) : ScopedTree ;
97+ }
98+
99+ // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
92100export class ScopedTree implements Tree {
93101 readonly _root : ScopedDirEntry ;
94102
95103 constructor (
96104 private _base : Tree ,
97105 scope : string ,
98106 ) {
107+ this [ TreeSymbol ] = ( ) => this ;
99108 const normalizedScope = normalize ( '/' + scope ) ;
100109 this . _root = new ScopedDirEntry ( this . _base . getDir ( normalizedScope ) , normalizedScope ) ;
101110 }
@@ -197,10 +206,6 @@ export class ScopedTree implements Tree {
197206 return scopedActions ;
198207 }
199208
200- [ TreeSymbol ] ( ) : this {
201- return this ;
202- }
203-
204209 private _fullPath ( path : string ) : Path {
205210 return join ( this . _root . scope , normalize ( '/' + path ) ) ;
206211 }
You can’t perform that action at this time.
0 commit comments