# Monaco Editor "System-wide" code-completition (enums)

**URL:** <https://discourse.nodered.org/t/monaco-editor-system-wide-code-completition-enums/50529>\
**Category:** General\
**Created:** [2 September 2021 07:31 UTC](https://discourse.nodered.org/t/monaco-editor-system-wide-code-completition-enums/50529 "2021-09-02T07:31:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomaspz](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@thomaspz](https://discourse.nodered.org/u/thomaspz)\
**Post date:** [2 September 2021 07:31 UTC](https://discourse.nodered.org/t/monaco-editor-system-wide-code-completition-enums/50529/1 "2021-09-02T07:31:58Z")

</div>

Creating the interface describe in this thread works fine:

Related to this thread : [Monaco Editor "System-wide" code-completition](https://discourse.nodered.org/t/monaco-editor-system-wide-code-completition/48868)

What would be the best approach to define global wide const or enums. I think the definition in the func.d.ts is used by the monaco-editor (only) and this works fine with enums, but at runtime node-red doesn't "know" them. (For me it's clear, the func.d.ts is for the monace-editor only).

One solution could be to define them twice (but code duplication is a bad "smell"), but is there a solution to define them in one place? To use by monaco and nodered?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [1 November 2021 07:32 UTC](https://discourse.nodered.org/t/monaco-editor-system-wide-code-completition-enums/50529/2 "2021-11-01T07:32:51Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
