toshiki-notebook/assets/application_vitepress-plugin-shiki-twoslash_api_emit.md.a8cbce72.lean.js

8 lines
5.5 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as l,c as o,o as n,z as s,a,R as e}from"./chunks/framework.ade46834.js";const f=JSON.parse('{"title":"Emit","description":"You can replace the contents of your code examples with the results of running TypeScript over the project.","frontmatter":{"description":"You can replace the contents of your code examples with the results of running TypeScript over the project.","title":"Emit"},"headers":[],"relativePath":"application/vitepress-plugin-shiki-twoslash/api/emit.md","filePath":"application/vitepress-plugin-shiki-twoslash/api/emit.md","lastUpdated":1694660273000}'),t={name:"application/vitepress-plugin-shiki-twoslash/api/emit.md"},p=s("h1",{id:"emit",tabindex:"-1"},[a("Emit "),s("a",{class:"header-anchor",href:"#emit","aria-label":'Permalink to "Emit"'},"")],-1),c=s("p",null,"Running a Twoslash code example is a full TypeScript compiler run that will create files inside the virtual file system. You can replace the contents of your code examples with the results of running TypeScript over the project.",-1),r=s("h2",{id:"showemit",tabindex:"-1"},[s("code",null,"@showEmit"),a(),s("a",{class:"header-anchor",href:"#showemit","aria-label":'Permalink to "`@showEmit`"'},"")],-1),i=s("p",null,[s("code",null,"// @showEmit"),a(" is the main command to tell Shiki Twoslash that you want to replace the output of your code example with the equivalent "),s("code",null,".js"),a(" file.")],-1),d=s("div",{class:"vp-code-group vp-adaptive-theme"},[s("div",{class:"tabs"},[s("input",{type:"radio",name:"group-Fi-o7",id:"tab-TFp5kw_",checked:"checked"}),s("label",{for:"tab-TFp5kw_"},"output"),s("input",{type:"radio",name:"group-Fi-o7",id:"tab-Cx_nXvF"}),s("label",{for:"tab-Cx_nXvF"},"markdown")]),s("div",{class:"blocks"},[s("div",{class:"language-ts vp-adaptive-theme active line-numbers-mode"},[s("button",{title:"Copy Code",class:"copy"}),s("span",{class:"lang"},"ts"),s("pre",{class:"shiki solarized-dark twoslash lsp",style:{"background-color":"#002B36",color:"#839496"},active:"true"},[s("div",{class:"language-id"},"ts"),s("div",{class:"code-container"},[s("code",null,[s("div",{class:"line"},[s("span",{style:{color:"#2AA198"}},'"use strict"'),s("span",{style:{color:"#839496"}},";")]),s("div",{class:"line"},[s("span",{style:{color:"#93A1A1"}},"const"),s("span",{style:{color:"#839496"}}," "),s("span",{style:{color:"#268BD2"}},"level"),s("span",{style:{color:"#839496"}}," "),s("span",{style:{color:"#859900"}},"="),s("span",{style:{color:"#839496"}}," "),s("span",{style:{color:"#2AA198"}},"'Danger'"),s("span",{style:{color:"#839496"}},";")]),s("div",{class:"line"}," ")])])]),s("pre",{class:"shiki solarized-light twoslash lsp",style:{"background-color":"#FDF6E3",color:"#657B83"},active:"true"},[s("div",{class:"language-id"},"ts"),s("div",{class:"code-container"},[s("code",null,[s("div",{class:"line"},[s("span",{style:{color:"#2AA198"}},'"use strict"'),s("span",{style:{color:"#657B83"}},";")]),s("div",{class:"line"},[s("span",{style:{color:"#586E75"}},"const"),s("span",{style:{color:"#657B83"}}," "),s("span",{style:{color:"#268BD2"}},"level"),s("span",{style:{color:"#657B83"}}," "),s("span",{style:{color:"#859900"}},"="),s("span",{style:{color:"#657B83"}}," "),s("span",{style:{color:"#2AA198"}},"'Danger'"),s("span",{style:{color:"#657B83"}},";")]),s("div",{class:"line"}," ")])])]),s("div",{class:"line-numbers-wrapper","aria-hidden":"true"},[s("span",{class:"line-number"},"1"),s("br")])]),s("div",{class:"language-md vp-adaptive-theme line-numbers-mode"},[s("button",{title:"Copy Code",class:"copy"}),s("span",{class:"lang"},"md"),s("pre",{class:"shiki solarized-dark vp-code-dark"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#839496"}},"```ts twoslash")]),a(`
`),s("span",{class:"line"},[s("span",{style:{color:"#586E75","font-style":"italic"}},"// @showEmit")]),a(`
`),s("span",{class:"line"},[s("span",{style:{color:"#93A1A1","font-weight":"bold"}},"const"),s("span",{style:{color:"#839496"}}," "),s("span",{style:{color:"#268BD2"}},"level"),s("span",{style:{color:"#859900"}},":"),s("span",{style:{color:"#839496"}}," "),s("span",{style:{color:"#859900"}},"string"),s("span",{style:{color:"#839496"}}," "),s("span",{style:{color:"#859900"}},"="),s("span",{style:{color:"#839496"}}," "),s("span",{style:{color:"#2AA198"}},"'Danger'")]),a(`
`),s("span",{class:"line"},[s("span",{style:{color:"#839496"}},"```")])])]),s("pre",{class:"shiki solarized-light vp-code-light"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#657B83"}},"```ts twoslash")]),a(`
`),s("span",{class:"line"},[s("span",{style:{color:"#93A1A1","font-style":"italic"}},"// @showEmit")]),a(`
`),s("span",{class:"line"},[s("span",{style:{color:"#586E75","font-weight":"bold"}},"const"),s("span",{style:{color:"#657B83"}}," "),s("span",{style:{color:"#268BD2"}},"level"),s("span",{style:{color:"#859900"}},":"),s("span",{style:{color:"#657B83"}}," "),s("span",{style:{color:"#859900"}},"string"),s("span",{style:{color:"#657B83"}}," "),s("span",{style:{color:"#859900"}},"="),s("span",{style:{color:"#657B83"}}," "),s("span",{style:{color:"#2AA198"}},"'Danger'")]),a(`
`),s("span",{class:"line"},[s("span",{style:{color:"#657B83"}},"```")])])]),s("div",{class:"line-numbers-wrapper","aria-hidden":"true"},[s("span",{class:"line-number"},"1"),s("br"),s("span",{class:"line-number"},"2"),s("br"),s("span",{class:"line-number"},"3"),s("br"),s("span",{class:"line-number"},"4"),s("br")])])])],-1),y=e("",7),u=[p,c,r,i,d,y];function A(h,m,v,b,g,w){return n(),o("div",null,u)}const B=l(t,[["render",A]]);export{f as __pageData,B as default};