Skip to content

Commit b1cfd3a

Browse files
committed
js: change constants from enum to namespace to fix type issues
1 parent 96375d0 commit b1cfd3a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

deltachat-jsonrpc/typescript/scripts/generate-constants.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,25 @@ const constants = data
5050
);
5151
})
5252
.map((row) => {
53-
return ` ${row.key} = ${row.value}`;
53+
return ` export const ${row.key} = ${row.value};`;
5454
})
55-
.join(",\n");
55+
.join("\n");
5656

5757
writeFileSync(
5858
resolve(__dirname, "../generated/constants.ts"),
5959
`// Generated!
6060
61-
export enum C {
62-
${constants},
61+
export namespace C {
62+
${constants}
6363
/** @deprecated 10-8-2025 compare string directly with \`== "Group"\` */
64-
DC_CHAT_TYPE_GROUP = "Group",
64+
export const DC_CHAT_TYPE_GROUP = "Group";
6565
/** @deprecated 10-8-2025 compare string directly with \`== "InBroadcast"\`*/
66-
DC_CHAT_TYPE_IN_BROADCAST = "InBroadcast",
66+
export const DC_CHAT_TYPE_IN_BROADCAST = "InBroadcast";
6767
/** @deprecated 10-8-2025 compare string directly with \`== "Mailinglist"\` */
68-
DC_CHAT_TYPE_MAILINGLIST = "Mailinglist",
68+
export const DC_CHAT_TYPE_MAILINGLIST = "Mailinglist";
6969
/** @deprecated 10-8-2025 compare string directly with \`== "OutBroadcast"\` */
70-
DC_CHAT_TYPE_OUT_BROADCAST = "OutBroadcast",
70+
export const DC_CHAT_TYPE_OUT_BROADCAST = "OutBroadcast";
7171
/** @deprecated 10-8-2025 compare string directly with \`== "Single"\` */
72-
DC_CHAT_TYPE_SINGLE = "Single",
72+
export const DC_CHAT_TYPE_SINGLE = "Single";
7373
}\n`,
7474
);

0 commit comments

Comments
 (0)