You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2.7.0 (and 2.8.0) added enum value exports. However, the generated code is incorrect and does not compile. For example, in the example-usage/generated/index.d.ts it will result in the following error:
error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.
The reason it currently compiles in example-usage, is that example-usage skips type checking the declaration files (tsconfig.json contains "skipLibCheck": true).
The correct code would be to use a declaration instead of an initializer:
// Variant 1exportdeclareconstenumCacheControlScope: {PUBLIC: 'PUBLIC',PRIVATE: 'PRIVATE',}// Variant 2 - the values are not really readonly, but should be handled as suchexportdeclareconstenumCacheControlScope: {readonlyPUBLIC: 'PUBLIC',readonlyPRIVATE: 'PRIVATE',}
The text was updated successfully, but these errors were encountered:
2.7.0 (and 2.8.0) added enum value exports. However, the generated code is incorrect and does not compile. For example, in the
example-usage/generated/index.d.ts
it will result in the following error:error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.
The reason it currently compiles in example-usage, is that example-usage skips type checking the declaration files (
tsconfig.json
contains"skipLibCheck": true
).The generated code is:
The correct code would be to use a declaration instead of an initializer:
The text was updated successfully, but these errors were encountered: