From be338a85a4caf6507a51687069b37702ee07eeaa Mon Sep 17 00:00:00 2001 From: slackr <1099208+slackr@users.noreply.github.com> Date: Mon, 4 Nov 2024 04:48:00 -0500 Subject: [PATCH] Update MANUAL.md (#623) Add extra examples around CamelCase enums and and their prefix --- MANUAL.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/MANUAL.md b/MANUAL.md index b1681cc0..c235b0c2 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -590,19 +590,29 @@ following `.proto` enum Foo { FOO_BAR = 0; FOO_BAZ = 1; +} +enum MooFoo { + MOO_FOO_BAR = 0; + MOO_FOO_BAZ = 1; } ``` -The prefix "FOO_" is dropped in TypeScript (unless `keep_enum_prefix` option is provided to the plugin): +The prefix "FOO_" and "MOO_FOO" are dropped in TypeScript (unless `keep_enum_prefix` option is provided to the plugin): ```typescript enum Foo { BAR = 0, BAZ = 1 +} +enum MooFoo { + BAR = 0, + BAZ = 1 } ``` + + A quick reminder about TypeScript enums: - It is possible to lookup the name for an enum value: