Skip to content

Commit

Permalink
Add support for viewing types output in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sasial-dev committed Feb 20, 2025
1 parent e271595 commit 3a5bed8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/.vitepress/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const beforeMount = (monaco: Monaco) => {
const Calls = ["SingleSync", "SingleAsync", "ManySync", "ManyAsync", "Polling"] as const;
const Options = ["write_checks", "typescript", "typescript_max_tuple_length", "manual_event_loop", "remote_scope", "remote_folder", "server_output", "client_output", "casing", "yield_type", "async_lib", "tooling", "tooling_output", "tooling_show_internal_data", "disable_fire_all"] as const;
const Options = ["write_checks", "typescript", "typescript_max_tuple_length", "manual_event_loop", "remote_scope", "remote_folder", "server_output", "client_output", "casing", "yield_type", "async_lib", "tooling", "tooling_output", "tooling_show_internal_data", "disable_fire_all", "types_output", "call_default"] as const;
const Casing = ["PascalCase", "camelCase", "snake_case"].map((value) => `"${value}"`);
const YieldType = ["yield", "future", "promise"].map((value) => `"${value}"`);
Expand Down Expand Up @@ -176,7 +176,7 @@ const beforeMount = (monaco: Monaco) => {
async_lib: [],
disable_fire_all: Operators,
call_default: Calls
call_default: Calls.map((value) => `"${value}"`)
} as const;
monaco.languages.registerTokensProviderFactory("zapConfig", {
Expand Down
14 changes: 14 additions & 0 deletions docs/playground.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@
:isCodeBlock="false"
/>
</PluginTabsTab>
<PluginTabsTab label="Types" v-if="compiledResult.code && compiledResult.code.types">
<CodeBlock
:code="compiledResult.code.types.code"
lang="lua"
:isCodeBlock="false"
/>
</PluginTabsTab>
<PluginTabsTab label="Types (TS)" v-if="isTypeScript && compiledResult.code && compiledResult.code.types">
<CodeBlock
:code="compiledResult.code.types.defs"
lang="typescript"
:isCodeBlock="false"
/>
</PluginTabsTab>
</PluginTabs>

</ClientOnly>
Expand Down

0 comments on commit 3a5bed8

Please sign in to comment.