Skip to content

Commit ebbc7a2

Browse files
frigus02dylhunn
authored andcommitted
refactor: change public const enums to enums (angular#51670)
Angular recently gained a local compilation mode (see commit 345dd6d). This is intended to be used with the TypeScript compiler option isolatedModules, which bans imports of const enums. This changes all const enums tagged with @publicapi to regular enums. Fixes angular#46240 PR Close angular#51670
1 parent 9692aeb commit ebbc7a2

File tree

14 files changed

+37
-22
lines changed

14 files changed

+37
-22
lines changed

goldens/public-api/animations/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export interface AnimationMetadata {
8989
}
9090

9191
// @public
92-
export const enum AnimationMetadataType {
92+
export enum AnimationMetadataType {
9393
Animate = 4,
9494
AnimateChild = 9,
9595
AnimateRef = 10,

goldens/public-api/common/http/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2198,7 +2198,7 @@ export interface HttpSentEvent {
21982198
}
21992199

22002200
// @public
2201-
export const enum HttpStatusCode {
2201+
export enum HttpStatusCode {
22022202
// (undocumented)
22032203
Accepted = 202,
22042204
// (undocumented)

goldens/public-api/platform-browser/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export interface HydrationFeature<FeatureKind extends HydrationFeatureKind> {
153153
}
154154

155155
// @public
156-
export const enum HydrationFeatureKind {
156+
export enum HydrationFeatureKind {
157157
// (undocumented)
158158
HttpTransferCacheOptions = 1,
159159
// (undocumented)

goldens/public-api/router/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ type Event_2 = NavigationStart | NavigationEnd | NavigationCancel | NavigationEr
255255
export { Event_2 as Event }
256256

257257
// @public
258-
export const enum EventType {
258+
export enum EventType {
259259
// (undocumented)
260260
ActivationEnd = 14,
261261
// (undocumented)
@@ -433,7 +433,7 @@ export class NavigationCancel extends RouterEvent {
433433
}
434434

435435
// @public
436-
export const enum NavigationCancellationCode {
436+
export enum NavigationCancellationCode {
437437
GuardRejected = 3,
438438
NoDataFromResolver = 2,
439439
Redirect = 0,
@@ -491,7 +491,7 @@ export class NavigationSkipped extends RouterEvent {
491491
}
492492

493493
// @public
494-
export const enum NavigationSkippedCode {
494+
export enum NavigationSkippedCode {
495495
IgnoredByUrlHandlingStrategy = 1,
496496
IgnoredSameUrlNavigation = 0
497497
}

goldens/size-tracking/aio-payloads.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"aio": {
33
"uncompressed": {
44
"runtime": 4252,
5-
"main": 506861,
5+
"main": 507632,
66
"polyfills": 33862,
77
"styles": 60209,
88
"light-theme": 34317,
@@ -12,7 +12,7 @@
1212
"aio-local": {
1313
"uncompressed": {
1414
"runtime": 4252,
15-
"main": 501754,
15+
"main": 507632,
1616
"polyfills": 33862,
1717
"styles": 60209,
1818
"light-theme": 34317,

goldens/size-tracking/integration-payloads.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"main": 221187,
4343
"polyfills": 33782,
4444
"node_modules_angular_animations_fesm2022_browser_mjs": 63981,
45-
"default-node_modules_angular_animations_fesm2022_animations_mjs": 3828,
45+
"default-node_modules_angular_animations_fesm2022_animations_mjs": 4264,
4646
"src_app_open-close_component_ts": 1321
4747
}
4848
},
@@ -56,7 +56,7 @@
5656
"platform-server/ngmodule/browser": {
5757
"uncompressed": {
5858
"runtime": 2688,
59-
"main": 249925,
59+
"main": 256333,
6060
"polyfills": 33778
6161
}
6262
},

packages/animations/src/animation_metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export declare interface AnimateChildOptions extends AnimationOptions {
100100
*
101101
* @publicApi
102102
*/
103-
export const enum AnimationMetadataType {
103+
export enum AnimationMetadataType {
104104
/**
105105
* Associates a named animation state with a set of CSS styles.
106106
* See [`state()`](api/animations/state)

packages/common/http/src/response.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ export class HttpErrorResponse extends HttpResponseBase implements Error {
358358
* As per https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
359359
* @publicApi
360360
*/
361-
export const enum HttpStatusCode {
361+
export enum HttpStatusCode {
362362
Continue = 100,
363363
SwitchingProtocols = 101,
364364
Processing = 102,

packages/core/test/bundling/animations-standalone/bundle.golden_symbols.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
{
3333
"name": "AnimationGroupPlayer"
3434
},
35+
{
36+
"name": "AnimationMetadataType"
37+
},
3538
{
3639
"name": "AnimationRenderer"
3740
},
@@ -1295,9 +1298,6 @@
12951298
{
12961299
"name": "parseTimelineCommand"
12971300
},
1298-
{
1299-
"name": "parseTransitionExpr"
1300-
},
13011301
{
13021302
"name": "processInjectorTypesWithProviders"
13031303
},

packages/core/test/bundling/animations/bundle.golden_symbols.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
{
3636
"name": "AnimationGroupPlayer"
3737
},
38+
{
39+
"name": "AnimationMetadataType"
40+
},
3841
{
3942
"name": "AnimationRenderer"
4043
},
@@ -1367,9 +1370,6 @@
13671370
{
13681371
"name": "parseTimelineCommand"
13691372
},
1370-
{
1371-
"name": "parseTransitionExpr"
1372-
},
13731373
{
13741374
"name": "platformBrowser"
13751375
},

0 commit comments

Comments
 (0)