返回 slidev
cli.ts
根目录 / packages / slidev / node / cli.ts
1 import type { ResolvedSlidevOptions, SlidevConfig, SlidevData } from '@slidev/types'
2 import type { LogLevel, ViteDevServer } from 'vite'
3 import type { Argv } from 'yargs'
4 import { execFile } from 'node:child_process'
5 import fs from 'node:fs/promises'
6 import os from 'node:os'
7 import process from 'node:process'
8 import * as readline from 'node:readline'
9 import { verifyConfig } from '@slidev/parser'
10 import { blue, bold, cyan, cyanBright, dim, gray, green, underline, yellow } from 'ansis'
11 import equal from 'fast-deep-equal'
12 import { getPort } from 'get-port-please'
13 import openBrowser from 'open'
14 import path from 'pathe'
15 import yargs from 'yargs'
16 import { version } from '../package.json'
17 import { createServer } from './commands/serve'
18 import { getThemeMeta, resolveTheme } from './integrations/themes'
19 import { resolveOptions } from './options'
20 import { parser } from './parser'
21 import { isInstalledGlobally, resolveEntry } from './resolver'
22 import setupPreparser from './setups/preparser'
23 import { updateFrontmatterPatch } from './utils'
24
25 const RE_NODE_MODULES_OR_GIT = /node_modules|\.git/
26
27 const CONFIG_RESTART_FIELDS: (keyof SlidevConfig)[] = [
28 'monaco',
29 'routerMode',
30 'fonts',
31 'css',
32 'mdc',
33 'editor',
34 'theme',
35 'seoMeta',
36 ]
37
38 const FILES_CHANGE_RESTART = [
39 'setup/shiki.ts',
40 'setup/katex.ts',
41 'setup/preparser.ts',
42 'setup/transformers.ts',
43 'setup/unocss.ts',
44 'setup/vite-plugins.ts',
45 'uno.config.ts',
46 'unocss.config.ts',
47 'vite.config.{js,ts,mjs,mts}',
48 ]
49
50 setupPreparser()
51
52 const cli = yargs(process.argv.slice(2))
53 .scriptName('slidev')
54 .usage('$0 [args]')
55 .version(version)
56 .strict()
57 .showHelpOnFail(false)
58 .alias('h', 'help')
59 .alias('v', 'version')
60
61 cli.command(
62 '* [entry]',
63 'Start a local server for Slidev',
64 args => commonOptions(args)
65 .option('port', {
66 alias: 'p',
67 type: 'number',
68 describe: 'port',
69 })
70 .option('open', {
71 alias: 'o',
72 default: false,
73 type: 'boolean',
74 describe: 'open in browser',
75 })
76 .option('remote', {
77 type: 'string',
78 describe: 'listen public host and enable remote control',
79 })
80 .option('tunnel', {
81 default: false,
82 type: 'boolean',
83 describe: 'open a Cloudflare Quick Tunnel to make Slidev available on the internet',
84 })
85 .option('log', {
86 default: 'warn',
87 type: 'string',
88 choices: ['error', 'warn', 'info', 'silent'],
89 describe: 'log level',
90 })
91 .option('inspect', {
92 default: false,
93 type: 'boolean',
94 describe: 'enable the inspect plugin for debugging',
95 })
96 .option('force', {
97 alias: 'f',
98 default: false,
99 type: 'boolean',
100 describe: 'force the optimizer to ignore the cache and re-bundle',
101 })
102 .option('bind', {
103 type: 'string',
104 default: '0.0.0.0',
105 describe: 'specify which IP addresses the server should listen on in remote mode',
106 })
107 .option('base', {
108 type: 'string',
109 describe: 'base URL. Example: /demo/',
110 default: '/',
111 })
112 .strict()
113 .help(),
114 async ({ entry, theme, port: userPort, open, log, remote, tunnel, force, inspect, bind, base }) => {
115 let server: ViteDevServer | undefined
116 let port = 3030
117
118 let lastRemoteUrl: string | undefined
119
120 let restartTimer: ReturnType<typeof setTimeout> | undefined
121 async function restartServer() {
122 await server?.close()
123 server = undefined
124 clearTimeout(restartTimer)
125 restartTimer = setTimeout(() => {
126 console.log(yellow('\n restarting...\n'))
127 initServer()
128 }, 500)
129 }
130
131 async function initServer() {
132 const options = await resolveOptions({ entry, remote, theme, inspect, base }, 'dev')
133 const host = remote !== undefined
134 ? bind
135 : 'localhost'
136 port = userPort || await getPort({
137 port: 3030,
138 random: false,
139 portRange: [3030, 4000],
140 host,
141 })
142 server = (await createServer(
143 options,
144 {
145 server: {
146 port,
147 strictPort: true,
148 host,
149 // @ts-expect-error Vite <= 4
150 force,
151 // Allow Cloudflare Quick Tunnel domains when tunneling is enabled
152 ...(tunnel && remote != null
153 ? {
154 allowedHosts: ['.trycloudflare.com'],
155 }
156 : {}),
157 },
158 optimizeDeps: {
159 // Vite 5
160 force,
161 },
162 logLevel: log as LogLevel,
163 base,
164 },
165 {
166 async loadData(loadedSource) {
167 const { data: oldData, entry } = options
168 const loaded = await parser.load(options, entry, loadedSource, 'dev')
169
170 const themeRaw = theme || loaded.headmatter.theme as string || 'default'
171 if (options.themeRaw !== themeRaw) {
172 console.log(yellow('\n restarting on theme change\n'))
173 restartServer()
174 return false
175 }
176 // Because themeRaw is not changed, we don't resolve it again
177 const themeMeta = options.themeRoots[0]
178 ? await getThemeMeta(themeRaw, options.themeRoots[0])
179 : undefined
180 const newData: SlidevData = {
181 ...loaded,
182 themeMeta,
183 config: parser.resolveConfig(loaded.headmatter, themeMeta, entry),
184 }
185
186 if (CONFIG_RESTART_FIELDS.some(i => !equal(newData.config[i], oldData.config[i]))) {
187 console.log(yellow('\n restarting on config change\n'))
188 restartServer()
189 return false
190 }
191
192 if ((newData.features.katex && !oldData.features.katex) || (newData.features.monaco && !oldData.features.monaco)) {
193 console.log(yellow('\n restarting on feature change\n'))
194 restartServer()
195 return false
196 }
197
198 return newData
199 },
200 },
201 ))
202
203 await server.listen()
204
205 let tunnelUrl = ''
206 if (tunnel) {
207 if (remote != null)
208 tunnelUrl = await openTunnel(port)
209 else
210 console.log(yellow('\n --remote is required for tunneling, Cloudflare Quick Tunnel is not enabled.\n'))
211 }
212
213 let publicIp: string | undefined
214 if (remote)
215 publicIp = await resolvePublicIp()
216
217 lastRemoteUrl = printInfo(options, port, base, remote, tunnelUrl, publicIp)
218 if (open)
219 await openSlidevInBrowser()
220
221 return options
222 }
223
224 async function openSlidevInBrowser() {
225 const url = `http://localhost:${port}${base}`
226 try {
227 await openBrowser(url)
228 }
229 catch {
230 console.log(yellow(`\n Could not open the browser automatically. Please open ${url} in your browser.\n`))
231 }
232 }
233
234 async function resolvePublicIp() {
235 try {
236 return await import('public-ip').then(r => r.publicIpv4())
237 }
238 catch {
239 console.log(yellow('\n Could not determine the public IP address.\n'))
240 }
241 }
242
243 async function openTunnel(port: number) {
244 const { startTunnel } = await import('untun')
245 const tunnel = await startTunnel({
246 port,
247 acceptCloudflareNotice: true,
248 })
249 return await tunnel?.getURL() ?? ''
250 }
251
252 const SHORTCUTS = [
253 {
254 name: 'r',
255 fullname: 'restart',
256 action() {
257 restartServer()
258 },
259 },
260 {
261 name: 'o',
262 fullname: 'open',
263 action() {
264 openSlidevInBrowser()
265 },
266 },
267 {
268 name: 'e',
269 fullname: 'edit',
270 action() {
271 const editor = process.env.EDITOR || 'code'
272 execFile(editor, [entry])
273 },
274 },
275 {
276 name: 'q',
277 fullname: 'quit',
278 action() {
279 try {
280 server?.close()
281 }
282 finally {
283 process.exit()
284 }
285 },
286 },
287 {
288 name: 'c',
289 fullname: 'qrcode',
290 async action() {
291 if (!lastRemoteUrl)
292 return
293 await import('uqr')
294 .then(async (r) => {
295 const code = r.renderUnicodeCompact(lastRemoteUrl!)
296 console.log(`\n${dim(' QR Code for remote control: ')}\n ${blue(lastRemoteUrl!)}\n`)
297 console.log(code.split('\n').map(i => ` ${i}`).join('\n'))
298 const publicIp = await import('public-ip').then(r => r.publicIpv4())
299 if (publicIp)
300 console.log(`\n${dim(' Public IP: ')} ${blue(publicIp)}\n`)
301 })
302 },
303 },
304 ]
305
306 function bindShortcut() {
307 if (!process.stdin.isTTY)
308 return
309 process.stdin.resume()
310 process.stdin.setEncoding('utf8')
311 readline.emitKeypressEvents(process.stdin)
312 if (process.stdin.isTTY)
313 process.stdin.setRawMode(true)
314
315 const onKeyPress = (str: string, key: { ctrl: boolean, name: string }) => {
316 if (key.ctrl && key.name === 'c') {
317 process.exit()
318 }
319 else {
320 const [sh] = SHORTCUTS.filter(item => item.name === str)
321 if (sh) {
322 try {
323 sh.action()
324 }
325 catch (err) {
326 console.error(`Failed to execute shortcut ${sh.fullname}`, err)
327 }
328 }
329 }
330 }
331
332 process.stdin.on('keypress', onKeyPress)
333 }
334
335 const { roots } = await initServer()
336 bindShortcut()
337
338 // Start watcher to restart server on file changes
339 const { watch } = await import('chokidar')
340 const watchGlobs = roots
341 .filter(i => !i.includes('node_modules'))
342 .flatMap(root => FILES_CHANGE_RESTART.map(i => path.join(root, i)))
343 const watcher = watch(watchGlobs, {
344 ignored: ['node_modules', '.git'],
345 ignoreInitial: true,
346 ignorePermissionErrors: true,
347 })
348 watcher.on('unlink', (file) => {
349 console.log(yellow(`\n file ${file} removed, restarting...\n`))
350 restartServer()
351 })
352 watcher.on('add', (file) => {
353 console.log(yellow(`\n file ${file} added, restarting...\n`))
354 restartServer()
355 })
356 watcher.on('change', (file) => {
357 console.log(yellow(`\n file ${file} changed, restarting...\n`))
358 restartServer()
359 })
360 },
361 )
362
363 cli.command(
364 'build [entry..]',
365 'Build hostable SPA',
366 args => exportOptions(commonOptions(args))
367 .option('out', {
368 alias: 'o',
369 type: 'string',
370 default: 'dist',
371 describe: 'output dir',
372 })
373 .option('base', {
374 type: 'string',
375 describe: 'output base. Example: /demo/',
376 })
377 .option('download', {
378 alias: 'd',
379 type: 'boolean',
380 describe: 'allow download as PDF',
381 })
382 .option('without-notes', {
383 type: 'boolean',
384 describe: 'exclude speaker notes from the built output',
385 })
386 .option('router-mode', {
387 type: 'string',
388 choices: ['hash', 'history', 'memory'],
389 describe: 'override routerMode in the built output (hash for subdirectory deploys like GitHub Pages; memory keeps the slide number out of the URL, for kiosk/follower decks)',
390 })
391 .option('inspect', {
392 default: false,
393 type: 'boolean',
394 describe: 'enable the inspect plugin for debugging',
395 })
396 .strict()
397 .help(),
398 async (args) => {
399 const { entry, theme, base, download, out, inspect, 'without-notes': withoutNotes, 'router-mode': routerMode } = args
400 const { build } = await import('./commands/build')
401
402 for (const entryFile of entry as unknown as string[]) {
403 const options = await resolveOptions({
404 entry: entryFile,
405 theme,
406 inspect,
407 download,
408 base,
409 withoutNotes,
410 routerMode: routerMode as 'hash' | 'history' | 'memory' | undefined,
411 }, 'build')
412
413 printInfo(options)
414 await build(
415 options,
416 {
417 base,
418 build: {
419 outDir: entry.length === 1
420 ? out
421 : path.join(out, path.basename(entryFile, '.md')),
422 },
423 },
424 { ...args, entry: entryFile },
425 )
426 }
427 },
428 )
429
430 cli.command(
431 'format [entry..]',
432 'Format the markdown file',
433 args => commonOptions(args)
434 .strict()
435 .help(),
436 async ({ entry }) => {
437 for (const entryFile of entry as unknown as string[]) {
438 const md = await parser.parse(await fs.readFile(entryFile, 'utf-8'), entryFile)
439 parser.prettify(md)
440 await parser.save(md)
441 }
442 },
443 )
444
445 cli.command(
446 'mcp [entry]',
447 'Start an MCP (Model Context Protocol) server over stdio for AI agents to inspect and edit the slides',
448 args => commonOptions(args)
449 .strict()
450 .help(),
451 async ({ entry }) => {
452 const { startMcpStdioServer } = await import('./mcp/stdio')
453 await startMcpStdioServer(await resolveEntry(entry))
454 },
455 )
456
457 cli.command(
458 'theme [subcommand]',
459 'Theme related operations',
460 (command) => {
461 return command
462 .command(
463 'eject',
464 'Eject current theme into local file system',
465 args => commonOptions(args)
466 .option('dir', {
467 type: 'string',
468 default: 'theme',
469 }),
470 async ({ entry: entryRaw, dir, theme: themeInput }) => {
471 const entry = await resolveEntry(entryRaw)
472 const options = await resolveOptions({ entry }, 'dev')
473 const data = await parser.load(options, entry)
474 let themeRaw = themeInput || data.headmatter.theme as string | null | undefined
475 themeRaw = themeRaw === null
476 ? 'none'
477 : (themeRaw || 'default')
478 if (themeRaw === 'none') {
479 console.error('Cannot eject theme "none"')
480 process.exit(1)
481 }
482 if ('/.'.includes(themeRaw[0]) || (themeRaw[0] !== '@' && themeRaw.includes('/'))) {
483 console.error('Theme is already ejected')
484 process.exit(1)
485 }
486 const [name, root] = (await resolveTheme(themeRaw, entry)) as [string, string]
487
488 await fs.mkdir(path.resolve(dir), { recursive: true })
489 await fs.cp(
490 root,
491 path.resolve(dir),
492 {
493 recursive: true,
494 filter: i => !RE_NODE_MODULES_OR_GIT.test(path.relative(root, i)),
495 },
496 )
497
498 const dirPath = `./${dir}`
499 const firstSlide = data.entry.slides[0]
500 updateFrontmatterPatch(firstSlide, { theme: dirPath })
501 parser.prettifySlide(firstSlide)
502 await parser.save(data.entry)
503
504 console.log(`Theme "${name}" ejected successfully to "${dirPath}"`)
505 },
506 )
507 },
508 () => {
509 cli.showHelp()
510 process.exit(1)
511 },
512 )
513
514 cli.command(
515 'export [entry..]',
516 'Export slides to PDF',
517 args => exportOptions(commonOptions(args))
518 .strict()
519 .help(),
520 async (args) => {
521 const { entry, theme } = args
522 const { exportSlides, getExportOptions } = await import('./commands/export')
523 const candidatePort = await getPort(12445)
524
525 let warned = false
526 for (const entryFile of entry as unknown as string) {
527 const options = await resolveOptions({ entry: entryFile, theme }, 'export')
528
529 if (options.data.config.browserExporter !== false && !warned) {
530 warned = true
531 console.log(cyanBright('[Slidev] Try the new browser exporter!'))
532 console.log(
533 cyanBright('You can use the browser exporter instead by starting the dev server as normal and visit'),
534 `${blue('localhost:')}${dim('<port>')}${blue('/export')}\n`,
535 )
536 }
537
538 let server: ViteDevServer | undefined
539 try {
540 server = await createServer(
541 options,
542 {
543 server: { port: candidatePort },
544 clearScreen: false,
545 },
546 )
547 await server.listen(candidatePort)
548 const port = getViteServerPort(server)
549 printInfo(options)
550 const result = await exportSlides({
551 port,
552 ...getExportOptions({ ...args, entry: entryFile }, options),
553 })
554 console.log(`${green(' ✓ ')}${dim('exported to ')}${result}\n`)
555 }
556 finally {
557 await server?.close()
558 }
559 }
560
561 process.exit(0)
562 },
563 )
564
565 cli.command(
566 'export-notes [entry..]',
567 'Export slide notes to PDF',
568 args => args
569 .positional('entry', {
570 default: 'slides.md',
571 type: 'string',
572 describe: 'path to the slides markdown entry',
573 })
574 .option('output', {
575 type: 'string',
576 describe: 'path to the output',
577 })
578 .option('timeout', {
579 default: 30000,
580 type: 'number',
581 describe: 'timeout for rendering the print page',
582 })
583 .option('wait', {
584 default: 0,
585 type: 'number',
586 describe: 'wait for the specified ms before exporting',
587 })
588 .strict()
589 .help(),
590 async ({
591 entry,
592 output,
593 timeout,
594 wait,
595 }) => {
596 const { exportNotes } = await import('./commands/export')
597 const candidatePort = await getPort(12445)
598
599 for (const entryFile of entry as unknown as string[]) {
600 const options = await resolveOptions({ entry: entryFile }, 'export')
601 let server: ViteDevServer | undefined
602 try {
603 server = await createServer(
604 options,
605 {
606 server: { port: candidatePort },
607 clearScreen: false,
608 },
609 )
610 await server.listen(candidatePort)
611 const port = getViteServerPort(server)
612
613 printInfo(options)
614
615 const result = await exportNotes({
616 port,
617 output: output || (options.data.config.exportFilename
618 ? `${options.data.config.exportFilename}-notes`
619 : `${path.basename(entryFile, '.md')}-export-notes`),
620 timeout,
621 wait,
622 })
623 console.log(`${green(' ✓ ')}${dim('exported to ')}${result}\n`)
624 }
625 finally {
626 await server?.close()
627 }
628 }
629
630 process.exit(0)
631 },
632 )
633
634 cli
635 .help()
636 .parse()
637
638 function getViteServerPort(server: ViteDevServer): number {
639 const address = server.httpServer?.address()
640 if (address && typeof address === 'object')
641 return address.port
642 throw new Error('Failed to get Vite server port')
643 }
644
645 function commonOptions(args: Argv<object>) {
646 return args
647 .positional('entry', {
648 default: 'slides.md',
649 type: 'string',
650 describe: 'path to the slides markdown entry',
651 })
652 .option('theme', {
653 alias: 't',
654 type: 'string',
655 describe: 'override theme',
656 })
657 }
658
659 function exportOptions<T>(args: Argv<T>) {
660 return args
661 .option('output', {
662 type: 'string',
663 describe: 'path to the output',
664 })
665 .option('format', {
666 type: 'string',
667 choices: [
668 'pdf',
669 'png',
670 'pptx',
671 'pptx-editable',
672 'md',
673 ],
674 describe: 'output format',
675 })
676 .option('timeout', {
677 type: 'number',
678 describe: 'timeout for rendering the print page',
679 })
680 .option('wait', {
681 type: 'number',
682 describe: 'wait for the specified ms before exporting',
683 })
684 .option('wait-until', {
685 type: 'string',
686 choices: [
687 'networkidle',
688 'load',
689 'domcontentloaded',
690 'none',
691 ],
692 describe: 'wait until the specified event before exporting each slide',
693 })
694 .option('range', {
695 type: 'string',
696 describe: 'page ranges to export, for example "1,4-5,6"',
697 })
698 .option('dark', {
699 type: 'boolean',
700 describe: 'export as dark theme',
701 })
702 .option('with-clicks', {
703 alias: 'c',
704 type: 'boolean',
705 describe: 'export pages for every clicks',
706 })
707 .option('executable-path', {
708 type: 'string',
709 describe: 'executable to override playwright bundled browser',
710 })
711 .option('with-toc', {
712 type: 'boolean',
713 describe: 'export pages with outline',
714 })
715 .option('per-slide', {
716 type: 'boolean',
717 describe: 'slide slides slide by slide. Works better with global components, but will break cross slide links and TOC in PDF',
718 })
719 .option('scale', {
720 type: 'number',
721 describe: 'scale factor for image export',
722 })
723 .option('omit-background', {
724 type: 'boolean',
725 describe: 'export png pages without the default browser background',
726 })
727 }
728
729 function printInfo(
730 options: ResolvedSlidevOptions,
731 port?: number,
732 base?: string,
733 remote?: string,
734 tunnelUrl?: string,
735 publicIp?: string,
736 ) {
737 if (base && (!base.startsWith('/') || !base.endsWith('/'))) {
738 console.error('Base URL must start and end with a slash "/"')
739 process.exit(1)
740 }
741
742 console.log()
743 console.log()
744 console.log(` ${cyan('●') + blue('■') + yellow('▲')}`)
745 console.log(`${bold(' Slidev')} ${blue(`v${version}`)} ${isInstalledGlobally.value
746 ? yellow('(global)')
747 : ''}`)
748 console.log()
749
750 verifyConfig(options.data.config, options.data.themeMeta, v => console.warn(yellow(` ! ${v}`)))
751
752 console.log(dim(' theme ') + (options.theme
753 ? green(options.theme)
754 : gray('none')))
755 console.log(dim(' css engine ') + blue('unocss'))
756 console.log(dim(' entry ') + dim(path.normalize(path.dirname(options.entry)) + path.sep) + path.basename(options.entry))
757
758 if (port) {
759 const baseText = base?.slice(0, -1) || ''
760 const portAndBase = port + baseText
761 const baseUrl = `http://localhost:${bold(portAndBase)}`
762 const query = remote
763 ? `?password=${remote}`
764 : ''
765 const presenterPath = `${options.data.config.routerMode === 'hash'
766 ? '/#/'
767 : '/'}presenter/${query}`
768 const entryPath = `${options.data.config.routerMode === 'hash'
769 ? '/#/'
770 : '/'}entry${query}/`
771 const overviewPath = `${options.data.config.routerMode === 'hash'
772 ? '/#/'
773 : '/'}overview${query}/`
774 console.log()
775 console.log(`${dim(' public slide show ')} > ${cyan(`${baseUrl}/`)}`)
776 if (query)
777 console.log(`${dim(' private slide show ')} > ${cyan(`${baseUrl}/${query}`)}`)
778 if (options.utils.define.__SLIDEV_FEATURE_PRESENTER__ === 'true')
779 console.log(`${dim(' presenter mode ')} > ${blue(`${baseUrl}${presenterPath}`)}`)
780 console.log(`${dim(' slides overview ')} > ${blue(`${baseUrl}${overviewPath}`)}`)
781 if (options.utils.define.__SLIDEV_FEATURE_BROWSER_EXPORTER__ === 'true')
782 console.log(`${dim(' export slides')} > ${blue(`${baseUrl}/export/`)}`)
783 if (options.mode === 'dev' && options.data.config.mcp !== false)
784 console.log(`${dim(' mcp server ')} > ${blue(`http://localhost:${bold(port)}/__mcp`)}`)
785 if (options.inspect)
786 console.log(`${dim(' vite inspector')} > ${yellow(`${baseUrl}/__inspect/`)}`)
787
788 let lastRemoteUrl = ''
789
790 if (remote !== undefined) {
791 Object.values(os.networkInterfaces())
792 .forEach(v => (v || [])
793 .filter(details => String(details.family).endsWith('4') && !details.address.includes('127.0.0.1'))
794 .forEach(({ address }) => {
795 lastRemoteUrl = `http://${address}:${portAndBase}${entryPath}`
796 console.log(`${dim(' remote control ')} > ${blue(lastRemoteUrl)}`)
797 }))
798
799 if (publicIp) {
800 lastRemoteUrl = `http://${publicIp}:${portAndBase}${entryPath}`
801 console.log(`${dim(' remote control ')} > ${blue(lastRemoteUrl)}`)
802 }
803
804 if (tunnelUrl) {
805 lastRemoteUrl = `${tunnelUrl}${baseText}${entryPath}`
806 console.log(`${dim(' remote via tunnel')} > ${yellow(lastRemoteUrl)}`)
807 }
808 }
809 else {
810 console.log(`${dim(' remote control ')} > ${dim('pass --remote to enable')}`)
811 }
812
813 console.log()
814 console.log(`${dim(' shortcuts ')} > ${underline('r')}${dim('estart | ')}${underline('o')}${dim('pen | ')}${underline('e')}${dim('dit | ')}${underline('q')}${dim('uit')}${lastRemoteUrl
815 ? ` | ${dim('qr')}${underline('c')}${dim('ode')}`
816 : ''}`)
817
818 return lastRemoteUrl
819 }
820 }
821
821 lines TYPESCRIPT