Skip to content

Commit 4693e67

Browse files
committed
refactor: remove outdated namespace syntax usage
The `namespace` TypeScript usage within the CLI has been removed. This syntax is not recommended outside of type definition files.
1 parent 8216b11 commit 4693e67

File tree

10 files changed

+355
-337
lines changed

10 files changed

+355
-337
lines changed

goldens/public-api/angular_devkit/architect/index.md

+21-9
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ class JobOutputSchemaValidationError extends schema.SchemaValidationException {
358358

359359
declare namespace jobs {
360360
export {
361+
strategy,
361362
isJobHandler,
362363
JobName,
363364
JobHandler,
@@ -403,8 +404,7 @@ declare namespace jobs {
403404
JobArgumentSchemaValidationError,
404405
JobInboundMessageSchemaValidationError,
405406
JobOutputSchemaValidationError,
406-
SimpleScheduler,
407-
strategy
407+
SimpleScheduler
408408
}
409409
}
410410
export { jobs }
@@ -418,6 +418,12 @@ enum JobState {
418418
Started = "started"
419419
}
420420

421+
// @public (undocumented)
422+
type JobStrategy<A extends JsonValue = JsonValue, I extends JsonValue = JsonValue, O extends JsonValue = JsonValue> = (handler: JobHandler<A, I, O>, options?: Partial<Readonly<JobDescription>>) => JobHandler<A, I, O>;
423+
424+
// @public
425+
function memoize<A extends JsonValue = JsonValue, I extends JsonValue = JsonValue, O extends JsonValue = JsonValue>(replayMessages?: boolean): JobStrategy<A, I, O>;
426+
421427
// @public
422428
interface RegisterJobOptions extends Partial<JobDescription> {
423429
}
@@ -427,6 +433,9 @@ interface Registry<MinimumArgumentValueT extends JsonValue = JsonValue, MinimumI
427433
get<A extends MinimumArgumentValueT, I extends MinimumInputValueT, O extends MinimumOutputValueT>(name: JobName): Observable<JobHandler<A, I, O> | null>;
428434
}
429435

436+
// @public
437+
function reuse<A extends JsonValue = JsonValue, I extends JsonValue = JsonValue, O extends JsonValue = JsonValue>(replayMessages?: boolean): JobStrategy<A, I, O>;
438+
430439
// @public
431440
interface ScheduleJobOptions {
432441
dependencies?: Job | Job[];
@@ -449,6 +458,9 @@ interface Scheduler<MinimumArgumentValueT extends JsonValue = JsonValue, Minimum
449458
// @public
450459
export function scheduleTargetAndForget(context: BuilderContext, target: Target, overrides?: json.JsonObject, scheduleOptions?: ScheduleOptions_2): Observable<BuilderOutput>;
451460

461+
// @public
462+
function serialize<A extends JsonValue = JsonValue, I extends JsonValue = JsonValue, O extends JsonValue = JsonValue>(): JobStrategy<A, I, O>;
463+
452464
// @public
453465
interface SimpleJobHandlerContext<A extends JsonValue, I extends JsonValue, O extends JsonValue> extends JobHandlerContext<A, I, O> {
454466
// (undocumented)
@@ -490,13 +502,13 @@ class SimpleScheduler<MinimumArgumentT extends JsonValue = JsonValue, MinimumInp
490502
protected _schemaRegistry: schema.SchemaRegistry;
491503
}
492504

493-
// @public (undocumented)
494-
namespace strategy {
495-
// (undocumented)
496-
type JobStrategy<A extends JsonValue = JsonValue, I extends JsonValue = JsonValue, O extends JsonValue = JsonValue> = (handler: JobHandler<A, I, O>, options?: Partial<Readonly<JobDescription>>) => JobHandler<A, I, O>;
497-
function memoize<A extends JsonValue = JsonValue, I extends JsonValue = JsonValue, O extends JsonValue = JsonValue>(replayMessages?: boolean): JobStrategy<A, I, O>;
498-
function reuse<A extends JsonValue = JsonValue, I extends JsonValue = JsonValue, O extends JsonValue = JsonValue>(replayMessages?: boolean): JobStrategy<A, I, O>;
499-
function serialize<A extends JsonValue = JsonValue, I extends JsonValue = JsonValue, O extends JsonValue = JsonValue>(): JobStrategy<A, I, O>;
505+
declare namespace strategy {
506+
export {
507+
serialize,
508+
reuse,
509+
memoize,
510+
JobStrategy
511+
}
500512
}
501513

502514
// @public (undocumented)

goldens/public-api/angular_devkit/core/index.md

+68-63
Original file line numberDiff line numberDiff line change
@@ -1223,71 +1223,76 @@ interface TemplateTag<R = string> {
12231223
(template: TemplateStringsArray, ...substitutions: any[]): R;
12241224
}
12251225

1226-
// @public (undocumented)
1227-
namespace test {
1228-
// (undocumented)
1229-
class TestHost extends SimpleMemoryHost {
1230-
// (undocumented)
1231-
$exists(path: string): boolean;
1232-
// (undocumented)
1233-
$isDirectory(path: string): boolean;
1234-
// (undocumented)
1235-
$isFile(path: string): boolean;
1236-
// (undocumented)
1237-
$list(path: string): PathFragment[];
1238-
// (undocumented)
1239-
$read(path: string): string;
1240-
// (undocumented)
1241-
$write(path: string, content: string): void;
1242-
constructor(map?: {
1243-
[path: string]: string;
1244-
});
1245-
// (undocumented)
1246-
clearRecords(): void;
1247-
// (undocumented)
1248-
clone(): TestHost;
1249-
// (undocumented)
1250-
protected _delete(path: Path): void;
1251-
// (undocumented)
1252-
protected _exists(path: Path): boolean;
1253-
// (undocumented)
1254-
get files(): Path[];
1255-
// (undocumented)
1256-
protected _isDirectory(path: Path): boolean;
1257-
// (undocumented)
1258-
protected _isFile(path: Path): boolean;
1259-
// (undocumented)
1260-
protected _list(path: Path): PathFragment[];
1261-
// (undocumented)
1262-
protected _read(path: Path): ArrayBuffer;
1263-
// (undocumented)
1264-
get records(): TestLogRecord[];
1265-
// (undocumented)
1266-
protected _records: TestLogRecord[];
1267-
// (undocumented)
1268-
protected _rename(from: Path, to: Path): void;
1269-
// (undocumented)
1270-
protected _stat(path: Path): Stats<SimpleMemoryHostStats> | null;
1271-
// (undocumented)
1272-
get sync(): SyncDelegateHost<{}>;
1273-
// (undocumented)
1274-
protected _sync: SyncDelegateHost<{}> | null;
1275-
// (undocumented)
1276-
protected _watch(path: Path, options?: HostWatchOptions): Observable<HostWatchEvent>;
1277-
// (undocumented)
1278-
protected _write(path: Path, content: FileBuffer): void;
1226+
declare namespace test {
1227+
export {
1228+
TestLogRecord,
1229+
TestHost
12791230
}
1231+
}
1232+
1233+
// @public (undocumented)
1234+
class TestHost extends SimpleMemoryHost {
12801235
// (undocumented)
1281-
type TestLogRecord = {
1282-
kind: 'write' | 'read' | 'delete' | 'list' | 'exists' | 'isDirectory' | 'isFile' | 'stat' | 'watch';
1283-
path: Path;
1284-
} | {
1285-
kind: 'rename';
1286-
from: Path;
1287-
to: Path;
1288-
};
1236+
$exists(path: string): boolean;
1237+
// (undocumented)
1238+
$isDirectory(path: string): boolean;
1239+
// (undocumented)
1240+
$isFile(path: string): boolean;
1241+
// (undocumented)
1242+
$list(path: string): PathFragment[];
1243+
// (undocumented)
1244+
$read(path: string): string;
1245+
// (undocumented)
1246+
$write(path: string, content: string): void;
1247+
constructor(map?: {
1248+
[path: string]: string;
1249+
});
1250+
// (undocumented)
1251+
clearRecords(): void;
1252+
// (undocumented)
1253+
clone(): TestHost;
1254+
// (undocumented)
1255+
protected _delete(path: Path): void;
1256+
// (undocumented)
1257+
protected _exists(path: Path): boolean;
1258+
// (undocumented)
1259+
get files(): Path[];
1260+
// (undocumented)
1261+
protected _isDirectory(path: Path): boolean;
1262+
// (undocumented)
1263+
protected _isFile(path: Path): boolean;
1264+
// (undocumented)
1265+
protected _list(path: Path): PathFragment[];
1266+
// (undocumented)
1267+
protected _read(path: Path): ArrayBuffer;
1268+
// (undocumented)
1269+
get records(): TestLogRecord[];
1270+
// (undocumented)
1271+
protected _records: TestLogRecord[];
1272+
// (undocumented)
1273+
protected _rename(from: Path, to: Path): void;
1274+
// (undocumented)
1275+
protected _stat(path: Path): Stats<SimpleMemoryHostStats> | null;
1276+
// (undocumented)
1277+
get sync(): SyncDelegateHost<{}>;
1278+
// (undocumented)
1279+
protected _sync: SyncDelegateHost<{}> | null;
1280+
// (undocumented)
1281+
protected _watch(path: Path, options?: HostWatchOptions): Observable<HostWatchEvent>;
1282+
// (undocumented)
1283+
protected _write(path: Path, content: FileBuffer): void;
12891284
}
12901285

1286+
// @public (undocumented)
1287+
type TestLogRecord = {
1288+
kind: 'write' | 'read' | 'delete' | 'list' | 'exists' | 'isDirectory' | 'isFile' | 'stat' | 'watch';
1289+
path: Path;
1290+
} | {
1291+
kind: 'rename';
1292+
from: Path;
1293+
to: Path;
1294+
};
1295+
12911296
// @public (undocumented)
12921297
class TransformLogger extends Logger {
12931298
constructor(name: string, transform: (stream: Observable<LogEntry>) => Observable<LogEntry>, parent?: Logger | null);
@@ -1315,6 +1320,7 @@ type UriHandler = (uri: string) => Observable<JsonObject> | Promise<JsonObject>
13151320

13161321
declare namespace virtualFs {
13171322
export {
1323+
test,
13181324
AliasHost,
13191325
stringToFileBuffer,
13201326
fileBufferToString,
@@ -1345,8 +1351,7 @@ declare namespace virtualFs {
13451351
ScopedHost,
13461352
SynchronousDelegateExpectedException,
13471353
SyncDelegateHost,
1348-
ResolverHost,
1349-
test
1354+
ResolverHost
13501355
}
13511356
}
13521357
export { virtualFs }

packages/angular_devkit/architect/src/jobs/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
import * as strategy from './strategy';
10+
911
export * from './api';
1012
export * from './create-job-handler';
1113
export * from './exception';
1214
export * from './dispatcher';
1315
export * from './fallback-registry';
1416
export * from './simple-registry';
1517
export * from './simple-scheduler';
16-
export * from './strategy';
18+
export { strategy };

0 commit comments

Comments
 (0)