Socket
Socket
Sign inDemoInstall

shiki-twoslash

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shiki-twoslash - npm Package Compare versions

Comparing version 0.8.1 to 0.8.2

3

dist/dom.js

@@ -79,3 +79,3 @@ "use strict";

*/
exports.setupTwoslashHovers = function () {
var setupTwoslashHovers = function () {
var blocks = document.querySelectorAll(".shiki.lsp .code-container code");

@@ -93,1 +93,2 @@ blocks.forEach(function (code) {

};
exports.setupTwoslashHovers = setupTwoslashHovers;

@@ -215,3 +215,13 @@ 'use strict';

{
html += "<span class='query'>" + ("//" + "".padStart(query.offset - 2) + "^ = " + query.text) + "</span>";
var _, _$exec, _query$text;
var previousLine = ((_ = (lines[i - 1] || [])[0]) == null ? void 0 : _.content) || "";
var previousLineWhitespace = previousLine.slice(0, ((_$exec = /\S/.exec(previousLine)) == null ? void 0 : _$exec.index) || 0); // prettier-ignore
var linePrefix = previousLineWhitespace + "//" + "".padStart(query.offset - 2 - previousLineWhitespace.length); // prettier-ignore
var queryTextWithPrefix = (_query$text = query.text) == null ? void 0 : _query$text.split("\n").map(function (l, i) {
return i !== 0 ? linePrefix + l : l;
}).join("\n");
html += "<span class='query'>" + (linePrefix + "^ = " + queryTextWithPrefix) + "</span>";
break;

@@ -228,11 +238,12 @@ }

});
console.log("Prefix: ", query.completionsPrefix);
var lis = prefixed.sort(function (l, r) {
return l.name.localeCompare(r.name);
}).map(function (c) {
var _query$completionsPre;
var _query$completionsPre, _c$kindModifiers;
var after = c.name.substr(((_query$completionsPre = query.completionsPrefix) === null || _query$completionsPre === void 0 ? void 0 : _query$completionsPre.length) || 0);
var after = c.name.substr(((_query$completionsPre = query.completionsPrefix) == null ? void 0 : _query$completionsPre.length) || 0);
var name = "<span><span class='result-found'>" + (query.completionsPrefix || "") + "</span>" + after + "<span>";
return "<li>" + name + "</li>";
var isDeprecated = (_c$kindModifiers = c.kindModifiers) == null ? void 0 : _c$kindModifiers.split(",").includes("deprecated");
var liClass = isDeprecated ? "deprecated" : "";
return "<li class='" + liClass + "'>" + name + "</li>";
}).join("");

@@ -315,104 +326,108 @@ html += "".padStart(query.offset) + ("<span class='inline-completions'><ul class='dropdown'>" + lis + "</ul></span>");

compilerOptions: "The set of compiler options for your project",
allowJs: "Let TS include .JS files in imports",
allowSyntheticDefaultImports: "Allow 'import x from y' when a module doesn't have a default export",
allowUmdGlobalAccess: "Assume UMD imports are all globally available",
allowUnreachableCode: "Error when code will never be called",
allowUnusedLabels: "Error when accidentally creating a label",
alwaysStrict: "Ensure 'use strict' is always emitted",
assumeChangesOnlyAffectDirectDependencies: "A drastically faster, but occasionally inaccurate watch mode option.",
baseUrl: "Set a baseurl for relative module names",
charset: "Manually set the text encoding for reading files",
checkJs: "Run the type checker on .js files in your project",
composite: "Used to create multiple build projects",
declaration: "Emit d.ts files for referenced files in the project",
declarationDir: "Set the root directory for d.ts files to go",
declarationMap: "Create sourcemaps for d.ts files",
diagnostics: "Output additional information after a compile",
disableReferencedProjectLoad: "Reduces the number of projects loaded automatically by TypeScript",
disableSizeLimit: "Remove the memory cap on the TypeScript language server",
disableSolutionSearching: " Opt a project out of multi-project reference checking",
disableSourceOfProjectReferenceRedirect: "Use d.ts files as the source of truth for tooling between composite project boundries",
downlevelIteration: "Emit more compliant, but verbose JavaScript for iterating objects",
emitBOM: "Include a byte order mark to output files",
emitDeclarationOnly: "Only output d.ts files and not .js files",
emitDecoratorMetadata: "Adds additional type metadata to decorators in emitted code",
esModuleInterop: "Emit additional JS to ease support for importing commonjs modules",
exclude: "Files or patterns to be skipped from the include option",
experimentalDecorators: "Enable experimental support for TC39 stage 2 decorators",
extendedDiagnostics: "Include a lot of diagnostic information after a compile",
"extends": "Inherit options for a TSConfig",
fallbackPolling: "What the watcher should use if the system runs out of native file watchers",
files: "Include a set list of files, does not support globs",
forceConsistentCasingInFileNames: "Ensure that casing is correct in imports",
generateCpuProfile: "Emit a v8 CPU profile of the compiler run for debugging",
importHelpers: "Allow importing helper functions once per project, instead of including them per-file",
importsNotUsedAsValues: "Controls which syntax you use for importing types",
include: "Files or patterns to include in this project",
incremental: "Save .tsbuildinfo files to allow for incremental compilation of projects",
inlineSourceMap: "Include sourcemap files inside the emitted JavaScript",
inlineSources: "Include sourcemap files inside the emitted JavaScript",
isolatedModules: "Ensure that each file can be safely transpiled without relying on other imports",
jsx: "Control how JSX is emitted",
jsxFactory: "Control the function emitted by JSX",
jsxFragmentFactory: "Specifies what identifiers a JSX fragment should be transformed to",
keyofStringsOnly: "Make keyof only return strings instead of string or numbers",
lib: "Include type definitions you know are available in your JavaScript runtime",
listEmittedFiles: "Print the names of emitted files after a compile",
listFiles: "Print all of the files read during the compilation",
locale: "Set the language of the tsc output",
mapRoot: "Set an external root for sourcemaps",
maxNodeModuleJsDepth: "How deep should TypeScript run type checking in node_modules",
module: "Sets the expected module system for your runtime",
moduleResolution: "Allow TypeScript 1.6 module resolution strategies",
newLine: "Set the newline character",
noEmit: "Do not emit files from a compilation",
noEmitHelpers: "Assume helpers are available in the global runtime",
noEmitOnError: "Only emit files on a successful compile",
noErrorTruncation: "Do not truncate error messages",
noFallthroughCasesInSwitch: "Report errors for fallthrough cases in switch statements.",
noImplicitAny: "Avoid introducing anys inside your codebase when a type could be specified",
noImplicitReturns: "Ensure that all codepaths return in a function",
noImplicitThis: "Raise errors when 'this' would be any",
noImplicitUseStrict: "Disable 'use strict' in the JS emit",
noLib: "Ignore options from lib",
noResolve: "Skip ahead-of-time checking for import and <reference files",
noStrictGenericChecks: "Disable strict checking of generic signatures in functions.",
noUnusedLocals: "Error when a local variable isn't read",
noUnusedParameters: "Error when a parameter isn't used",
out: "Do not use this",
outDir: "Set an output folder for all emitted files",
outFile: "Output a single file of all JS files concatenated",
paths: "A set of locations to look for imports in",
plugins: "A list of language service plugins to include",
preserveConstEnums: "Do not erase `const enum` declarations in generated code",
preserveSymlinks: "Do not resolve symlink paths",
preserveWatchOutput: "Do not wipe the console in watch mode",
pretty: "Use color and formatting to make compiler errors easier to read",
reactNamespace: "Specify the object which 'createElement' is called on in JSX",
references: "Provide a structure for composite projects",
removeComments: "Remove comments in TypeScript from appearing in JavaScript",
resolveJsonModule: "Allow importing .json files",
rootDir: "Sets the root folder within your source files",
rootDirs: "Set multiple root directories",
skipDefaultLibCheck: "use SkipLibCheck instead",
skipLibCheck: "Skip type checking of declaration files",
sourceMap: "Creates source map files for emitted JavaScript files",
sourceRoot: "Sets the root path for debuggers to find the reference source code",
strict: "Enable TypeScript's most in-depth type checking rules",
strictBindCallApply: "Ensure that 'call', 'bind' and 'apply' have the right arguments",
strictFunctionTypes: "Ensure that function parameters are consistent",
strictNullChecks: "Ensure that nullability is respected in the type checker",
strictPropertyInitialization: "Ensure that all class properties match their types after the constructor has finished",
stripInternal: "Remove declarations which have '@internal' in their JSDoc comments",
suppressExcessPropertyErrors: "Allow additional properties being set during creation of types",
suppressImplicitAnyIndexErrors: "Remove the warning when using string indexes to access unknown properties",
target: "Set the supported JavaScript language runtime to transpile to",
traceResolution: "Log out paths when resolving all modules",
tsBuildInfoFile: "Set the folder for .tsbuildinfo files",
typeAcquisition: "Sets of options for Automatic Type Acquisition in JavaScript",
typeRoots: "locations where TypeScript should look for type definitions",
types: "Used to create an allowlist of types to be included in the compile",
useDefineForClassFields: "Use define characteristics for handling class fields",
watchDirectory: "Determine how directories are watched",
watchFile: "What technique should the watcher use"
allowJs: "Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.",
allowSyntheticDefaultImports: "Allow 'import x from y' when a module doesn't have a default export.",
allowUmdGlobalAccess: "Allow accessing UMD globals from modules.",
allowUnreachableCode: "Disable error reporting for unreachable code.",
allowUnusedLabels: "Disable error reporting for unused labels.",
alwaysStrict: "Ensure 'use strict' is always emitted.",
assumeChangesOnlyAffectDirectDependencies: "Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it.",
baseUrl: "Specify the base directory to resolve non-relative module names.",
charset: "No longer supported. In early versions, manually set the text encoding for reading files.",
checkJs: "Enable error reporting in type-checked JavaScript files.",
composite: "Enable constraints that allow a TypeScript project to be used with project references.",
declaration: "Generate .d.ts files from TypeScript and JavaScript files in your project.",
declarationDir: "Specify the output directory for generated declaration files.",
declarationMap: "Create sourcemaps for d.ts files.",
diagnostics: "Output compiler performance information after building.",
disableReferencedProjectLoad: "Reduce the number of projects loaded automatically by TypeScript.",
disableSizeLimit: "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.",
disableSolutionSearching: "Opt a project out of multi-project reference checking when editing.",
disableSourceOfProjectReferenceRedirect: "Disable preferring source files instead of declaration files when referencing composite projects",
downlevelIteration: "Emit more compliant, but verbose and less performant JavaScript for iteration.",
emitBOM: "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.",
emitDeclarationOnly: "Only output d.ts files and not JavaScript files.",
emitDecoratorMetadata: "Emit design-type metadata for decorated declarations in source files.",
esModuleInterop: "Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.",
exclude: "Filters results from the `include` option.",
experimentalDecorators: "Enable experimental support for TC39 stage 2 draft decorators.",
explainFiles: "Print files read during the compilation including why it was included.",
extendedDiagnostics: "Output more detailed compiler performance information after building.",
"extends": "Specify one or more path or node module references to base configuration files from which settings are inherited.",
fallbackPolling: "Specify what approach the watcher should use if the system runs out of native file watchers.",
files: "Include a list of files. This does not support glob patterns, as opposed to `include`.",
forceConsistentCasingInFileNames: "Ensure that casing is correct in imports.",
generateCpuProfile: "Emit a v8 CPU profile of the compiler run for debugging.",
importHelpers: "Allow importing helper functions from tslib once per project, instead of including them per-file.",
importsNotUsedAsValues: "Specify emit/checking behavior for imports that are only used for types.",
include: "Specify a list of glob patterns that match files to be included in compilation.",
incremental: "Save .tsbuildinfo files to allow for incremental compilation of projects.",
inlineSourceMap: "Include sourcemap files inside the emitted JavaScript.",
inlineSources: "Include source code in the sourcemaps inside the emitted JavaScript.",
isolatedModules: "Ensure that each file can be safely transpiled without relying on other imports.",
jsx: "Specify what JSX code is generated.",
jsxFactory: "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'",
jsxFragmentFactory: "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.",
jsxImportSource: "Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.`",
keyofStringsOnly: "Make keyof only return strings instead of string, numbers or symbols. Legacy option.",
lib: "Specify a set of bundled library declaration files that describe the target runtime environment.",
listEmittedFiles: "Print the names of emitted files after a compilation.",
listFiles: "Print all of the files read during the compilation.",
locale: "Set the language of the messaging from TypeScript. This does not affect emit.",
mapRoot: "Specify the location where debugger should locate map files instead of generated locations.",
maxNodeModuleJsDepth: "Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`.",
module: "Specify what module code is generated.",
moduleResolution: "Specify how TypeScript looks up a file from a given module specifier.",
newLine: "Set the newline character for emitting files.",
noEmit: "Disable emitting file from a compilation.",
noEmitHelpers: "Disable generating custom helper functions like `__extends` in compiled output.",
noEmitOnError: "Disable emitting files if any type checking errors are reported.",
noErrorTruncation: "Disable truncating types in error messages.",
noFallthroughCasesInSwitch: "Enable error reporting for fallthrough cases in switch statements.",
noImplicitAny: "Enable error reporting for expressions and declarations with an implied `any` type..",
noImplicitReturns: "Enable error reporting for codepaths that do not explicitly return in a function.",
noImplicitThis: "Enable error reporting when `this` is given the type `any`.",
noImplicitUseStrict: "Disable adding 'use strict' directives in emitted JavaScript files.",
noLib: "Disable including any library files, including the default lib.d.ts.",
noPropertyAccessFromIndexSignature: "Enforces using indexed accessors for keys declared using an indexed type",
noResolve: "Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project.",
noStrictGenericChecks: "Disable strict checking of generic signatures in function types.",
noUncheckedIndexedAccess: "Add `undefined` to a type when accessed using an index.",
noUnusedLocals: "Enable error reporting when a local variables aren't read.",
noUnusedParameters: "Raise an error when a function parameter isn't read",
out: "Deprecated setting. Use `outFile` instead.",
outDir: "Specify an output folder for all emitted files.",
outFile: "Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.",
paths: "Specify a set of entries that re-map imports to additional lookup locations.",
plugins: "Specify a list of language service plugins to include.",
preserveConstEnums: "Disable erasing `const enum` declarations in generated code.",
preserveSymlinks: "Disable resolving symlinks to their realpath. This correlates to the same flag in node.",
preserveWatchOutput: "Disable wiping the console in watch mode",
pretty: "Enable color and formatting in output to make compiler errors easier to read",
reactNamespace: "Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit.",
references: "Specify an array of objects that specify paths for projects. Used in project references.",
removeComments: "Disable emitting comments.",
resolveJsonModule: "Enable importing .json files",
rootDir: "Specify the root folder within your source files.",
rootDirs: "Allow multiple folders to be treated as one when resolving modules.",
skipDefaultLibCheck: "Skip type checking .d.ts files that are included with TypeScript.",
skipLibCheck: "Skip type checking all .d.ts files.",
sourceMap: "Create source map files for emitted JavaScript files.",
sourceRoot: "Specify the root path for debuggers to find the reference source code.",
strict: "Enable all strict type checking options.",
strictBindCallApply: "Check that the arguments for `bind`, `call`, and `apply` methods match the original function.",
strictFunctionTypes: "When assigning functions, check to ensure parameters and the return values are subtype-compatible.",
strictNullChecks: "When type checking, take into account `null` and `undefined`.",
strictPropertyInitialization: "Check for class properties that are declared but not set in the constructor.",
stripInternal: "Disable emitting declarations that have `@internal` in their JSDoc comments.",
suppressExcessPropertyErrors: "Disable reporting of excess property errors during the creation of object literals.",
suppressImplicitAnyIndexErrors: "Suppress `noImplicitAny` errors when indexing objects that lack index signatures.",
target: "Set the JavaScript language version for emitted JavaScript and include compatible library declarations.",
traceResolution: "Log paths used during the `moduleResolution` process.",
tsBuildInfoFile: "Specify the folder for .tsbuildinfo incremental compilation files.",
typeAcquisition: "Specify options for automatic acquisition of declaration files.",
typeRoots: "Specify multiple folders that act like `./node_modules/@types`.",
types: "Specify type package names to be included without being referenced in a source file.",
useDefineForClassFields: "Emit ECMAScript-standard-compliant class fields.",
watchDirectory: "Specify how directories are watched on systems that lack recursive file-watching functionality.",
watchFile: "Specify how the TypeScript watch mode works."
};

@@ -557,3 +572,3 @@

if (lang === "json" && info.includes("tsconfig")) {
if (lang.startsWith("json") && info.includes("tsconfig")) {
return tsconfigJSONRenderer(tokens, shikiOptions || {});

@@ -560,0 +575,0 @@ } // Otherwise just the normal shiki renderer

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("shiki"),t=require("shiki-languages"),n=require("@typescript/twoslash"),r=require("@typescript/vfs");function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var i=function(e,t,n,r){return e.slice(0,t)+r+e.slice(t+Math.abs(n))},s=function(e){return e.replace(/</g,"⇍").replace(/>/g,"⇏").replace(/'/g,"⇯")},a=function(e){return e.replace(/⇍/g,"<").replace(/⇏/g,">").replace(/⇯/g,"'")},l=function(e){return e.replace(/⇍/g,"&lt;").replace(/⇏/g,"&gt;").replace(/⇯/g,"&apos;")};function c(e){var t={"<":"lt",'"':"quot","'":"apos","&":"amp","\r":"#10","\n":"#13"};return e.toString().replace(/[<"'\r\n&]/g,(function(e){return"&"+t[e]+";"}))}function p(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function u(e,t,n){var r="";r+='<pre class="shiki twoslash lsp">',t.langId&&(r+='<div class="language-id">'+t.langId+"</div>"),r+="<div class='code-container'><code>";var o=d(n.errors,(function(e){return e.line}))||new Map,u=d(n.staticQuickInfos,(function(e){return e.line}))||new Map,f=d(n.queries,(function(e){return e.line-1}))||new Map,h=0;return e.forEach((function(e,t){var n=o.get(t)||[],l=u.get(t)||[],d=f.get(t)||[];if(0===e.length&&0===t)h+=1;else if(0===e.length)h+=1,r+="\n";else{var m=0;e.forEach((function(e){var t="",o=function(t){return function(n){return t<=n.character&&t+e.content.length>=n.character+n.length}},p=n.filter(o(m)),u=l.filter(o(m)),f=d.filter(o(m)),g=[].concat(p,u,f).sort((function(e,t){return(e.start||0)-(t.start||0)}));t+=g.length?function(e,t){var n=[],r=!1;e.forEach((function(e){"lsp"===e.classes?(n.push({text:"⇍/data-lsp⇏",index:e.end}),n.push({text:"⇍data-lsp lsp=⇯"+(e.lsp||"")+"⇯⇏",index:e.begin})):"err"===e.classes?r=!0:"query"===e.classes&&(n.push({text:"⇍/data-highlight⇏",index:e.end}),n.push({text:"⇍data-highlight'⇏",index:e.begin}))}));var o=(" "+t).slice(1);return n.sort((function(e,t){return t.index-e.index})).forEach((function(e){o=i(o,e.index,0,e.text)})),r&&(o="⇍data-err⇏"+o+"⇍/data-err⇏"),a(c(o))}(g.map((function(e){var t={begin:e.start-h,end:e.start+e.length-h};return"renderedMessage"in e&&(t.classes="err"),"kind"in e&&(t.classes=e.kind),"targetString"in e&&(t.classes="lsp",t.lsp=c(e.text)),t})),e.content):s(e.content),r+='<span style="color: '+e.color+'">'+t+"</span>",m+=e.content.length,h+=e.content.length})),r+="\n",h+=1}if(n.length){var g=n.map((function(e){return p(e.renderedMessage)})).join("</br>"),y=n.map((function(e){return e.code})).join("<br/>");r+='<span class="error"><span>'+g+'</span><span class="code">'+y+"</span></span>",r+='<span class="error-behind">'+g+"</span>"}d.length&&(d.forEach((function(e){switch(e.kind){case"query":r+="<span class='query'>//"+"".padStart(e.offset-2)+"^ = "+e.text+"</span>";break;case"completions":if(e.completions){var t=e.completions.filter((function(t){return t.name.startsWith(e.completionsPrefix||"____")}));console.log("Prefix: ",e.completionsPrefix);var n=t.sort((function(e,t){return e.name.localeCompare(t.name)})).map((function(t){var n,r=t.name.substr((null===(n=e.completionsPrefix)||void 0===n?void 0:n.length)||0);return"<li><span><span class='result-found'>"+(e.completionsPrefix||"")+"</span>"+r+"<span></li>"})).join("");r+="".padStart(e.offset)+"<span class='inline-completions'><ul class='dropdown'>"+n+"</ul></span>"}else r+="<span class='query'>//"+"".padStart(e.offset-2)+"^ - No completions found</span>"}})),r+="\n")})),r=l(r.replace(/\n*$/,"")),r+="</code><a href='"+n.playgroundURL+"'>Try</a></div></pre>"}function d(e,t){var n=new Map;return e.forEach((function(e){var r=t(e),o=n.get(r);o?o.push(e):n.set(r,[e])})),n}function f(e,t){var n="";return n+='<pre class="shiki">',t.langId&&(n+='<div class="language-id">'+t.langId+"</div>"),n+="<div class='code-container'><code>",(n=(n+=p(e)).replace(/\n*$/,""))+"</code></div></pre>"}function h(e,t){var n="";return n+='<pre class="shiki">',t.langId&&(n+='<div class="language-id">'+t.langId+"</div>"),n+="<div class='code-container'><code>",e.forEach((function(e){0===e.length?n+="\n":(e.forEach((function(e){n+='<span style="color: '+e.color+'">'+p(e.content)+"</span>"})),n+="\n")})),n=n.replace(/\n*$/,""),n+="</code></div></pre>"}var m={compilerOptions:"The set of compiler options for your project",allowJs:"Let TS include .JS files in imports",allowSyntheticDefaultImports:"Allow 'import x from y' when a module doesn't have a default export",allowUmdGlobalAccess:"Assume UMD imports are all globally available",allowUnreachableCode:"Error when code will never be called",allowUnusedLabels:"Error when accidentally creating a label",alwaysStrict:"Ensure 'use strict' is always emitted",assumeChangesOnlyAffectDirectDependencies:"A drastically faster, but occasionally inaccurate watch mode option.",baseUrl:"Set a baseurl for relative module names",charset:"Manually set the text encoding for reading files",checkJs:"Run the type checker on .js files in your project",composite:"Used to create multiple build projects",declaration:"Emit d.ts files for referenced files in the project",declarationDir:"Set the root directory for d.ts files to go",declarationMap:"Create sourcemaps for d.ts files",diagnostics:"Output additional information after a compile",disableReferencedProjectLoad:"Reduces the number of projects loaded automatically by TypeScript",disableSizeLimit:"Remove the memory cap on the TypeScript language server",disableSolutionSearching:" Opt a project out of multi-project reference checking",disableSourceOfProjectReferenceRedirect:"Use d.ts files as the source of truth for tooling between composite project boundries",downlevelIteration:"Emit more compliant, but verbose JavaScript for iterating objects",emitBOM:"Include a byte order mark to output files",emitDeclarationOnly:"Only output d.ts files and not .js files",emitDecoratorMetadata:"Adds additional type metadata to decorators in emitted code",esModuleInterop:"Emit additional JS to ease support for importing commonjs modules",exclude:"Files or patterns to be skipped from the include option",experimentalDecorators:"Enable experimental support for TC39 stage 2 decorators",extendedDiagnostics:"Include a lot of diagnostic information after a compile",extends:"Inherit options for a TSConfig",fallbackPolling:"What the watcher should use if the system runs out of native file watchers",files:"Include a set list of files, does not support globs",forceConsistentCasingInFileNames:"Ensure that casing is correct in imports",generateCpuProfile:"Emit a v8 CPU profile of the compiler run for debugging",importHelpers:"Allow importing helper functions once per project, instead of including them per-file",importsNotUsedAsValues:"Controls which syntax you use for importing types",include:"Files or patterns to include in this project",incremental:"Save .tsbuildinfo files to allow for incremental compilation of projects",inlineSourceMap:"Include sourcemap files inside the emitted JavaScript",inlineSources:"Include sourcemap files inside the emitted JavaScript",isolatedModules:"Ensure that each file can be safely transpiled without relying on other imports",jsx:"Control how JSX is emitted",jsxFactory:"Control the function emitted by JSX",jsxFragmentFactory:"Specifies what identifiers a JSX fragment should be transformed to",keyofStringsOnly:"Make keyof only return strings instead of string or numbers",lib:"Include type definitions you know are available in your JavaScript runtime",listEmittedFiles:"Print the names of emitted files after a compile",listFiles:"Print all of the files read during the compilation",locale:"Set the language of the tsc output",mapRoot:"Set an external root for sourcemaps",maxNodeModuleJsDepth:"How deep should TypeScript run type checking in node_modules",module:"Sets the expected module system for your runtime",moduleResolution:"Allow TypeScript 1.6 module resolution strategies",newLine:"Set the newline character",noEmit:"Do not emit files from a compilation",noEmitHelpers:"Assume helpers are available in the global runtime",noEmitOnError:"Only emit files on a successful compile",noErrorTruncation:"Do not truncate error messages",noFallthroughCasesInSwitch:"Report errors for fallthrough cases in switch statements.",noImplicitAny:"Avoid introducing anys inside your codebase when a type could be specified",noImplicitReturns:"Ensure that all codepaths return in a function",noImplicitThis:"Raise errors when 'this' would be any",noImplicitUseStrict:"Disable 'use strict' in the JS emit",noLib:"Ignore options from lib",noResolve:"Skip ahead-of-time checking for import and <reference files",noStrictGenericChecks:"Disable strict checking of generic signatures in functions.",noUnusedLocals:"Error when a local variable isn't read",noUnusedParameters:"Error when a parameter isn't used",out:"Do not use this",outDir:"Set an output folder for all emitted files",outFile:"Output a single file of all JS files concatenated",paths:"A set of locations to look for imports in",plugins:"A list of language service plugins to include",preserveConstEnums:"Do not erase `const enum` declarations in generated code",preserveSymlinks:"Do not resolve symlink paths",preserveWatchOutput:"Do not wipe the console in watch mode",pretty:"Use color and formatting to make compiler errors easier to read",reactNamespace:"Specify the object which 'createElement' is called on in JSX",references:"Provide a structure for composite projects",removeComments:"Remove comments in TypeScript from appearing in JavaScript",resolveJsonModule:"Allow importing .json files",rootDir:"Sets the root folder within your source files",rootDirs:"Set multiple root directories",skipDefaultLibCheck:"use SkipLibCheck instead",skipLibCheck:"Skip type checking of declaration files",sourceMap:"Creates source map files for emitted JavaScript files",sourceRoot:"Sets the root path for debuggers to find the reference source code",strict:"Enable TypeScript's most in-depth type checking rules",strictBindCallApply:"Ensure that 'call', 'bind' and 'apply' have the right arguments",strictFunctionTypes:"Ensure that function parameters are consistent",strictNullChecks:"Ensure that nullability is respected in the type checker",strictPropertyInitialization:"Ensure that all class properties match their types after the constructor has finished",stripInternal:"Remove declarations which have '@internal' in their JSDoc comments",suppressExcessPropertyErrors:"Allow additional properties being set during creation of types",suppressImplicitAnyIndexErrors:"Remove the warning when using string indexes to access unknown properties",target:"Set the supported JavaScript language runtime to transpile to",traceResolution:"Log out paths when resolving all modules",tsBuildInfoFile:"Set the folder for .tsbuildinfo files",typeAcquisition:"Sets of options for Automatic Type Acquisition in JavaScript",typeRoots:"locations where TypeScript should look for type definitions",types:"Used to create an allowlist of types to be included in the compile",useDefineForClassFields:"Use define characteristics for handling class fields",watchDirectory:"Determine how directories are watched",watchFile:"What technique should the watcher use"},g=function(e){return!!e.explanation&&e.explanation.find((function(e){return e.scopes.find((function(e){return e.scopeName.includes("support.type.property-name")}))}))},y=function(e){if('"'!==e.content)return e.content.slice(1,e.content.length-1)in m};function v(e,t){var n="";return n+='<pre class="shiki tsconfig lsp">',t.langId&&(n+='<div class="language-id">'+t.langId+"</div>"),n+="<div class='code-container'><code>",e.forEach((function(e){0===e.length?n+="\n":(e.forEach((function(e){if(g(e)&&y(e)){var t=e.content.slice(1,e.content.length-1);n+='<span style="color: '+e.color+'">"<a aria-hidden=true href=\'https://www.typescriptlang.org/tsconfig#'+t+"'><data-lsp lsp=\""+m[t]+'">'+p(t)+'</data-lsp></a>"</span>'}else n+='<span style="color: '+e.color+'">'+p(e.content)+"</span>"})),n+="\n")})),n=n.replace(/\n*$/,""),n+="</code></div></pre>"}var w=[].concat(t.commonLangIds,t.commonLangAliases,t.otherLangIds),b=function(e){return w.includes(e)},S=null,k=void 0,x={plainTextRenderer:f,defaultShikiRenderer:h,twoslashRenderer:u,tsconfigJSONRenderer:v};exports.canHighlightLang=b,exports.createShikiHighlighter=function(t){if(S)return Promise.resolve(S);var n,r=(t||{}).theme||"nord";try{n=e.getTheme(r)}catch(t){try{n=e.loadTheme(r)}catch(e){throw new Error("Unable to load theme: "+r+" - "+e.message)}}return e.getHighlighter({theme:n,langs:w}).then((function(e){return S=e}))},exports.renderCodeToHTML=function(e,t,n,r,o,i){if(!o&&!S)throw new Error("The highlighter object hasn't been initialised via `setupHighLighter` yet in render-shiki-twoslash");if(!b(t))return f(e,r||{});var s=(o||S).codeToThemedTokens(e,t);return n.includes("twoslash")&&i?u(s,r||{},i):"json"===t&&n.includes("tsconfig")?v(s,r||{}):h(s,{langId:t})},exports.renderers=x,exports.runTwoSlash=function(e,t,i,s){void 0===i&&(i={}),void 0===s&&(s={});var a=void 0,l={json5:"json"};return l[t]&&(t=l[t]),i.useNodeModules&&(k?a=new Map(k):(a=r.createDefaultMapFromNodeModules({target:6}),k=a),r.addAllFilesFromFolder(a,i.nodeModulesTypesPath||"node_modules/@types")),n.twoslasher(e,t,o({},s,{fsMap:a}))};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("shiki"),t=require("shiki-languages"),n=require("@typescript/twoslash"),r=require("@typescript/vfs");function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var o=function(e,t,n,r){return e.slice(0,t)+r+e.slice(t+Math.abs(n))},a=function(e){return e.replace(/</g,"⇍").replace(/>/g,"⇏").replace(/'/g,"⇯")},s=function(e){return e.replace(/⇍/g,"<").replace(/⇏/g,">").replace(/⇯/g,"'")},l=function(e){return e.replace(/⇍/g,"&lt;").replace(/⇏/g,"&gt;").replace(/⇯/g,"&apos;")};function c(e){var t={"<":"lt",'"':"quot","'":"apos","&":"amp","\r":"#10","\n":"#13"};return e.toString().replace(/[<"'\r\n&]/g,(function(e){return"&"+t[e]+";"}))}function p(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function d(e,t,n){var r="";r+='<pre class="shiki twoslash lsp">',t.langId&&(r+='<div class="language-id">'+t.langId+"</div>"),r+="<div class='code-container'><code>";var i=u(n.errors,(function(e){return e.line}))||new Map,d=u(n.staticQuickInfos,(function(e){return e.line}))||new Map,f=u(n.queries,(function(e){return e.line-1}))||new Map,h=0;return e.forEach((function(t,n){var l=i.get(n)||[],u=d.get(n)||[],g=f.get(n)||[];if(0===t.length&&0===n)h+=1;else if(0===t.length)h+=1,r+="\n";else{var m=0;t.forEach((function(e){var t="",n=function(t){return function(n){return t<=n.character&&t+e.content.length>=n.character+n.length}},i=l.filter(n(m)),p=u.filter(n(m)),d=g.filter(n(m)),f=[].concat(i,p,d).sort((function(e,t){return(e.start||0)-(t.start||0)}));t+=f.length?function(e,t){var n=[],r=!1;e.forEach((function(e){"lsp"===e.classes?(n.push({text:"⇍/data-lsp⇏",index:e.end}),n.push({text:"⇍data-lsp lsp=⇯"+(e.lsp||"")+"⇯⇏",index:e.begin})):"err"===e.classes?r=!0:"query"===e.classes&&(n.push({text:"⇍/data-highlight⇏",index:e.end}),n.push({text:"⇍data-highlight'⇏",index:e.begin}))}));var i=(" "+t).slice(1);return n.sort((function(e,t){return t.index-e.index})).forEach((function(e){i=o(i,e.index,0,e.text)})),r&&(i="⇍data-err⇏"+i+"⇍/data-err⇏"),s(c(i))}(f.map((function(e){var t={begin:e.start-h,end:e.start+e.length-h};return"renderedMessage"in e&&(t.classes="err"),"kind"in e&&(t.classes=e.kind),"targetString"in e&&(t.classes="lsp",t.lsp=c(e.text)),t})),e.content):a(e.content),r+='<span style="color: '+e.color+'">'+t+"</span>",m+=e.content.length,h+=e.content.length})),r+="\n",h+=1}if(l.length){var y=l.map((function(e){return p(e.renderedMessage)})).join("</br>"),b=l.map((function(e){return e.code})).join("<br/>");r+='<span class="error"><span>'+y+'</span><span class="code">'+b+"</span></span>",r+='<span class="error-behind">'+y+"</span>"}g.length&&(g.forEach((function(t){switch(t.kind){case"query":var i,o,a,s=(null==(i=(e[n-1]||[])[0])?void 0:i.content)||"",l=s.slice(0,(null==(o=/\S/.exec(s))?void 0:o.index)||0),c=l+"//"+"".padStart(t.offset-2-l.length),p=null==(a=t.text)?void 0:a.split("\n").map((function(e,t){return 0!==t?c+e:e})).join("\n");r+="<span class='query'>"+c+"^ = "+p+"</span>";break;case"completions":if(t.completions){var d=t.completions.filter((function(e){return e.name.startsWith(t.completionsPrefix||"____")})).sort((function(e,t){return e.name.localeCompare(t.name)})).map((function(e){var n,r,i=e.name.substr((null==(n=t.completionsPrefix)?void 0:n.length)||0),o="<span><span class='result-found'>"+(t.completionsPrefix||"")+"</span>"+i+"<span>";return"<li class='"+((null==(r=e.kindModifiers)?void 0:r.split(",").includes("deprecated"))?"deprecated":"")+"'>"+o+"</li>"})).join("");r+="".padStart(t.offset)+"<span class='inline-completions'><ul class='dropdown'>"+d+"</ul></span>"}else r+="<span class='query'>//"+"".padStart(t.offset-2)+"^ - No completions found</span>"}})),r+="\n")})),r=l(r.replace(/\n*$/,"")),r+="</code><a href='"+n.playgroundURL+"'>Try</a></div></pre>"}function u(e,t){var n=new Map;return e.forEach((function(e){var r=t(e),i=n.get(r);i?i.push(e):n.set(r,[e])})),n}function f(e,t){var n="";return n+='<pre class="shiki">',t.langId&&(n+='<div class="language-id">'+t.langId+"</div>"),n+="<div class='code-container'><code>",(n=(n+=p(e)).replace(/\n*$/,""))+"</code></div></pre>"}function h(e,t){var n="";return n+='<pre class="shiki">',t.langId&&(n+='<div class="language-id">'+t.langId+"</div>"),n+="<div class='code-container'><code>",e.forEach((function(e){0===e.length?n+="\n":(e.forEach((function(e){n+='<span style="color: '+e.color+'">'+p(e.content)+"</span>"})),n+="\n")})),n=n.replace(/\n*$/,""),n+="</code></div></pre>"}var g={compilerOptions:"The set of compiler options for your project",allowJs:"Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.",allowSyntheticDefaultImports:"Allow 'import x from y' when a module doesn't have a default export.",allowUmdGlobalAccess:"Allow accessing UMD globals from modules.",allowUnreachableCode:"Disable error reporting for unreachable code.",allowUnusedLabels:"Disable error reporting for unused labels.",alwaysStrict:"Ensure 'use strict' is always emitted.",assumeChangesOnlyAffectDirectDependencies:"Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it.",baseUrl:"Specify the base directory to resolve non-relative module names.",charset:"No longer supported. In early versions, manually set the text encoding for reading files.",checkJs:"Enable error reporting in type-checked JavaScript files.",composite:"Enable constraints that allow a TypeScript project to be used with project references.",declaration:"Generate .d.ts files from TypeScript and JavaScript files in your project.",declarationDir:"Specify the output directory for generated declaration files.",declarationMap:"Create sourcemaps for d.ts files.",diagnostics:"Output compiler performance information after building.",disableReferencedProjectLoad:"Reduce the number of projects loaded automatically by TypeScript.",disableSizeLimit:"Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.",disableSolutionSearching:"Opt a project out of multi-project reference checking when editing.",disableSourceOfProjectReferenceRedirect:"Disable preferring source files instead of declaration files when referencing composite projects",downlevelIteration:"Emit more compliant, but verbose and less performant JavaScript for iteration.",emitBOM:"Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.",emitDeclarationOnly:"Only output d.ts files and not JavaScript files.",emitDecoratorMetadata:"Emit design-type metadata for decorated declarations in source files.",esModuleInterop:"Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.",exclude:"Filters results from the `include` option.",experimentalDecorators:"Enable experimental support for TC39 stage 2 draft decorators.",explainFiles:"Print files read during the compilation including why it was included.",extendedDiagnostics:"Output more detailed compiler performance information after building.",extends:"Specify one or more path or node module references to base configuration files from which settings are inherited.",fallbackPolling:"Specify what approach the watcher should use if the system runs out of native file watchers.",files:"Include a list of files. This does not support glob patterns, as opposed to `include`.",forceConsistentCasingInFileNames:"Ensure that casing is correct in imports.",generateCpuProfile:"Emit a v8 CPU profile of the compiler run for debugging.",importHelpers:"Allow importing helper functions from tslib once per project, instead of including them per-file.",importsNotUsedAsValues:"Specify emit/checking behavior for imports that are only used for types.",include:"Specify a list of glob patterns that match files to be included in compilation.",incremental:"Save .tsbuildinfo files to allow for incremental compilation of projects.",inlineSourceMap:"Include sourcemap files inside the emitted JavaScript.",inlineSources:"Include source code in the sourcemaps inside the emitted JavaScript.",isolatedModules:"Ensure that each file can be safely transpiled without relying on other imports.",jsx:"Specify what JSX code is generated.",jsxFactory:"Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'",jsxFragmentFactory:"Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.",jsxImportSource:"Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.`",keyofStringsOnly:"Make keyof only return strings instead of string, numbers or symbols. Legacy option.",lib:"Specify a set of bundled library declaration files that describe the target runtime environment.",listEmittedFiles:"Print the names of emitted files after a compilation.",listFiles:"Print all of the files read during the compilation.",locale:"Set the language of the messaging from TypeScript. This does not affect emit.",mapRoot:"Specify the location where debugger should locate map files instead of generated locations.",maxNodeModuleJsDepth:"Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`.",module:"Specify what module code is generated.",moduleResolution:"Specify how TypeScript looks up a file from a given module specifier.",newLine:"Set the newline character for emitting files.",noEmit:"Disable emitting file from a compilation.",noEmitHelpers:"Disable generating custom helper functions like `__extends` in compiled output.",noEmitOnError:"Disable emitting files if any type checking errors are reported.",noErrorTruncation:"Disable truncating types in error messages.",noFallthroughCasesInSwitch:"Enable error reporting for fallthrough cases in switch statements.",noImplicitAny:"Enable error reporting for expressions and declarations with an implied `any` type..",noImplicitReturns:"Enable error reporting for codepaths that do not explicitly return in a function.",noImplicitThis:"Enable error reporting when `this` is given the type `any`.",noImplicitUseStrict:"Disable adding 'use strict' directives in emitted JavaScript files.",noLib:"Disable including any library files, including the default lib.d.ts.",noPropertyAccessFromIndexSignature:"Enforces using indexed accessors for keys declared using an indexed type",noResolve:"Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project.",noStrictGenericChecks:"Disable strict checking of generic signatures in function types.",noUncheckedIndexedAccess:"Add `undefined` to a type when accessed using an index.",noUnusedLocals:"Enable error reporting when a local variables aren't read.",noUnusedParameters:"Raise an error when a function parameter isn't read",out:"Deprecated setting. Use `outFile` instead.",outDir:"Specify an output folder for all emitted files.",outFile:"Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.",paths:"Specify a set of entries that re-map imports to additional lookup locations.",plugins:"Specify a list of language service plugins to include.",preserveConstEnums:"Disable erasing `const enum` declarations in generated code.",preserveSymlinks:"Disable resolving symlinks to their realpath. This correlates to the same flag in node.",preserveWatchOutput:"Disable wiping the console in watch mode",pretty:"Enable color and formatting in output to make compiler errors easier to read",reactNamespace:"Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit.",references:"Specify an array of objects that specify paths for projects. Used in project references.",removeComments:"Disable emitting comments.",resolveJsonModule:"Enable importing .json files",rootDir:"Specify the root folder within your source files.",rootDirs:"Allow multiple folders to be treated as one when resolving modules.",skipDefaultLibCheck:"Skip type checking .d.ts files that are included with TypeScript.",skipLibCheck:"Skip type checking all .d.ts files.",sourceMap:"Create source map files for emitted JavaScript files.",sourceRoot:"Specify the root path for debuggers to find the reference source code.",strict:"Enable all strict type checking options.",strictBindCallApply:"Check that the arguments for `bind`, `call`, and `apply` methods match the original function.",strictFunctionTypes:"When assigning functions, check to ensure parameters and the return values are subtype-compatible.",strictNullChecks:"When type checking, take into account `null` and `undefined`.",strictPropertyInitialization:"Check for class properties that are declared but not set in the constructor.",stripInternal:"Disable emitting declarations that have `@internal` in their JSDoc comments.",suppressExcessPropertyErrors:"Disable reporting of excess property errors during the creation of object literals.",suppressImplicitAnyIndexErrors:"Suppress `noImplicitAny` errors when indexing objects that lack index signatures.",target:"Set the JavaScript language version for emitted JavaScript and include compatible library declarations.",traceResolution:"Log paths used during the `moduleResolution` process.",tsBuildInfoFile:"Specify the folder for .tsbuildinfo incremental compilation files.",typeAcquisition:"Specify options for automatic acquisition of declaration files.",typeRoots:"Specify multiple folders that act like `./node_modules/@types`.",types:"Specify type package names to be included without being referenced in a source file.",useDefineForClassFields:"Emit ECMAScript-standard-compliant class fields.",watchDirectory:"Specify how directories are watched on systems that lack recursive file-watching functionality.",watchFile:"Specify how the TypeScript watch mode works."},m=function(e){return!!e.explanation&&e.explanation.find((function(e){return e.scopes.find((function(e){return e.scopeName.includes("support.type.property-name")}))}))},y=function(e){if('"'!==e.content)return e.content.slice(1,e.content.length-1)in g};function b(e,t){var n="";return n+='<pre class="shiki tsconfig lsp">',t.langId&&(n+='<div class="language-id">'+t.langId+"</div>"),n+="<div class='code-container'><code>",e.forEach((function(e){0===e.length?n+="\n":(e.forEach((function(e){if(m(e)&&y(e)){var t=e.content.slice(1,e.content.length-1);n+='<span style="color: '+e.color+'">"<a aria-hidden=true href=\'https://www.typescriptlang.org/tsconfig#'+t+"'><data-lsp lsp=\""+g[t]+'">'+p(t)+'</data-lsp></a>"</span>'}else n+='<span style="color: '+e.color+'">'+p(e.content)+"</span>"})),n+="\n")})),n=n.replace(/\n*$/,""),n+="</code></div></pre>"}var v=[].concat(t.commonLangIds,t.commonLangAliases,t.otherLangIds),S=function(e){return v.includes(e)},w=null,k=void 0,x={plainTextRenderer:f,defaultShikiRenderer:h,twoslashRenderer:d,tsconfigJSONRenderer:b};exports.canHighlightLang=S,exports.createShikiHighlighter=function(t){if(w)return Promise.resolve(w);var n,r=(t||{}).theme||"nord";try{n=e.getTheme(r)}catch(t){try{n=e.loadTheme(r)}catch(e){throw new Error("Unable to load theme: "+r+" - "+e.message)}}return e.getHighlighter({theme:n,langs:v}).then((function(e){return w=e}))},exports.renderCodeToHTML=function(e,t,n,r,i,o){if(!i&&!w)throw new Error("The highlighter object hasn't been initialised via `setupHighLighter` yet in render-shiki-twoslash");if(!S(t))return f(e,r||{});var a=(i||w).codeToThemedTokens(e,t);return n.includes("twoslash")&&o?d(a,r||{},o):t.startsWith("json")&&n.includes("tsconfig")?b(a,r||{}):h(a,{langId:t})},exports.renderers=x,exports.runTwoSlash=function(e,t,o,a){void 0===o&&(o={}),void 0===a&&(a={});var s=void 0,l={json5:"json"};return l[t]&&(t=l[t]),o.useNodeModules&&(k?s=new Map(k):(s=r.createDefaultMapFromNodeModules({target:6}),k=s),r.addAllFilesFromFolder(s,o.nodeModulesTypesPath||"node_modules/@types")),n.twoslasher(e,t,i({},a,{fsMap:s}))};
//# sourceMappingURL=shiki-twoslash.cjs.production.min.js.map

@@ -211,3 +211,13 @@ import { getTheme, loadTheme, getHighlighter } from 'shiki';

{
html += "<span class='query'>" + ("//" + "".padStart(query.offset - 2) + "^ = " + query.text) + "</span>";
var _, _$exec, _query$text;
var previousLine = ((_ = (lines[i - 1] || [])[0]) == null ? void 0 : _.content) || "";
var previousLineWhitespace = previousLine.slice(0, ((_$exec = /\S/.exec(previousLine)) == null ? void 0 : _$exec.index) || 0); // prettier-ignore
var linePrefix = previousLineWhitespace + "//" + "".padStart(query.offset - 2 - previousLineWhitespace.length); // prettier-ignore
var queryTextWithPrefix = (_query$text = query.text) == null ? void 0 : _query$text.split("\n").map(function (l, i) {
return i !== 0 ? linePrefix + l : l;
}).join("\n");
html += "<span class='query'>" + (linePrefix + "^ = " + queryTextWithPrefix) + "</span>";
break;

@@ -224,11 +234,12 @@ }

});
console.log("Prefix: ", query.completionsPrefix);
var lis = prefixed.sort(function (l, r) {
return l.name.localeCompare(r.name);
}).map(function (c) {
var _query$completionsPre;
var _query$completionsPre, _c$kindModifiers;
var after = c.name.substr(((_query$completionsPre = query.completionsPrefix) === null || _query$completionsPre === void 0 ? void 0 : _query$completionsPre.length) || 0);
var after = c.name.substr(((_query$completionsPre = query.completionsPrefix) == null ? void 0 : _query$completionsPre.length) || 0);
var name = "<span><span class='result-found'>" + (query.completionsPrefix || "") + "</span>" + after + "<span>";
return "<li>" + name + "</li>";
var isDeprecated = (_c$kindModifiers = c.kindModifiers) == null ? void 0 : _c$kindModifiers.split(",").includes("deprecated");
var liClass = isDeprecated ? "deprecated" : "";
return "<li class='" + liClass + "'>" + name + "</li>";
}).join("");

@@ -311,104 +322,108 @@ html += "".padStart(query.offset) + ("<span class='inline-completions'><ul class='dropdown'>" + lis + "</ul></span>");

compilerOptions: "The set of compiler options for your project",
allowJs: "Let TS include .JS files in imports",
allowSyntheticDefaultImports: "Allow 'import x from y' when a module doesn't have a default export",
allowUmdGlobalAccess: "Assume UMD imports are all globally available",
allowUnreachableCode: "Error when code will never be called",
allowUnusedLabels: "Error when accidentally creating a label",
alwaysStrict: "Ensure 'use strict' is always emitted",
assumeChangesOnlyAffectDirectDependencies: "A drastically faster, but occasionally inaccurate watch mode option.",
baseUrl: "Set a baseurl for relative module names",
charset: "Manually set the text encoding for reading files",
checkJs: "Run the type checker on .js files in your project",
composite: "Used to create multiple build projects",
declaration: "Emit d.ts files for referenced files in the project",
declarationDir: "Set the root directory for d.ts files to go",
declarationMap: "Create sourcemaps for d.ts files",
diagnostics: "Output additional information after a compile",
disableReferencedProjectLoad: "Reduces the number of projects loaded automatically by TypeScript",
disableSizeLimit: "Remove the memory cap on the TypeScript language server",
disableSolutionSearching: " Opt a project out of multi-project reference checking",
disableSourceOfProjectReferenceRedirect: "Use d.ts files as the source of truth for tooling between composite project boundries",
downlevelIteration: "Emit more compliant, but verbose JavaScript for iterating objects",
emitBOM: "Include a byte order mark to output files",
emitDeclarationOnly: "Only output d.ts files and not .js files",
emitDecoratorMetadata: "Adds additional type metadata to decorators in emitted code",
esModuleInterop: "Emit additional JS to ease support for importing commonjs modules",
exclude: "Files or patterns to be skipped from the include option",
experimentalDecorators: "Enable experimental support for TC39 stage 2 decorators",
extendedDiagnostics: "Include a lot of diagnostic information after a compile",
"extends": "Inherit options for a TSConfig",
fallbackPolling: "What the watcher should use if the system runs out of native file watchers",
files: "Include a set list of files, does not support globs",
forceConsistentCasingInFileNames: "Ensure that casing is correct in imports",
generateCpuProfile: "Emit a v8 CPU profile of the compiler run for debugging",
importHelpers: "Allow importing helper functions once per project, instead of including them per-file",
importsNotUsedAsValues: "Controls which syntax you use for importing types",
include: "Files or patterns to include in this project",
incremental: "Save .tsbuildinfo files to allow for incremental compilation of projects",
inlineSourceMap: "Include sourcemap files inside the emitted JavaScript",
inlineSources: "Include sourcemap files inside the emitted JavaScript",
isolatedModules: "Ensure that each file can be safely transpiled without relying on other imports",
jsx: "Control how JSX is emitted",
jsxFactory: "Control the function emitted by JSX",
jsxFragmentFactory: "Specifies what identifiers a JSX fragment should be transformed to",
keyofStringsOnly: "Make keyof only return strings instead of string or numbers",
lib: "Include type definitions you know are available in your JavaScript runtime",
listEmittedFiles: "Print the names of emitted files after a compile",
listFiles: "Print all of the files read during the compilation",
locale: "Set the language of the tsc output",
mapRoot: "Set an external root for sourcemaps",
maxNodeModuleJsDepth: "How deep should TypeScript run type checking in node_modules",
module: "Sets the expected module system for your runtime",
moduleResolution: "Allow TypeScript 1.6 module resolution strategies",
newLine: "Set the newline character",
noEmit: "Do not emit files from a compilation",
noEmitHelpers: "Assume helpers are available in the global runtime",
noEmitOnError: "Only emit files on a successful compile",
noErrorTruncation: "Do not truncate error messages",
noFallthroughCasesInSwitch: "Report errors for fallthrough cases in switch statements.",
noImplicitAny: "Avoid introducing anys inside your codebase when a type could be specified",
noImplicitReturns: "Ensure that all codepaths return in a function",
noImplicitThis: "Raise errors when 'this' would be any",
noImplicitUseStrict: "Disable 'use strict' in the JS emit",
noLib: "Ignore options from lib",
noResolve: "Skip ahead-of-time checking for import and <reference files",
noStrictGenericChecks: "Disable strict checking of generic signatures in functions.",
noUnusedLocals: "Error when a local variable isn't read",
noUnusedParameters: "Error when a parameter isn't used",
out: "Do not use this",
outDir: "Set an output folder for all emitted files",
outFile: "Output a single file of all JS files concatenated",
paths: "A set of locations to look for imports in",
plugins: "A list of language service plugins to include",
preserveConstEnums: "Do not erase `const enum` declarations in generated code",
preserveSymlinks: "Do not resolve symlink paths",
preserveWatchOutput: "Do not wipe the console in watch mode",
pretty: "Use color and formatting to make compiler errors easier to read",
reactNamespace: "Specify the object which 'createElement' is called on in JSX",
references: "Provide a structure for composite projects",
removeComments: "Remove comments in TypeScript from appearing in JavaScript",
resolveJsonModule: "Allow importing .json files",
rootDir: "Sets the root folder within your source files",
rootDirs: "Set multiple root directories",
skipDefaultLibCheck: "use SkipLibCheck instead",
skipLibCheck: "Skip type checking of declaration files",
sourceMap: "Creates source map files for emitted JavaScript files",
sourceRoot: "Sets the root path for debuggers to find the reference source code",
strict: "Enable TypeScript's most in-depth type checking rules",
strictBindCallApply: "Ensure that 'call', 'bind' and 'apply' have the right arguments",
strictFunctionTypes: "Ensure that function parameters are consistent",
strictNullChecks: "Ensure that nullability is respected in the type checker",
strictPropertyInitialization: "Ensure that all class properties match their types after the constructor has finished",
stripInternal: "Remove declarations which have '@internal' in their JSDoc comments",
suppressExcessPropertyErrors: "Allow additional properties being set during creation of types",
suppressImplicitAnyIndexErrors: "Remove the warning when using string indexes to access unknown properties",
target: "Set the supported JavaScript language runtime to transpile to",
traceResolution: "Log out paths when resolving all modules",
tsBuildInfoFile: "Set the folder for .tsbuildinfo files",
typeAcquisition: "Sets of options for Automatic Type Acquisition in JavaScript",
typeRoots: "locations where TypeScript should look for type definitions",
types: "Used to create an allowlist of types to be included in the compile",
useDefineForClassFields: "Use define characteristics for handling class fields",
watchDirectory: "Determine how directories are watched",
watchFile: "What technique should the watcher use"
allowJs: "Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.",
allowSyntheticDefaultImports: "Allow 'import x from y' when a module doesn't have a default export.",
allowUmdGlobalAccess: "Allow accessing UMD globals from modules.",
allowUnreachableCode: "Disable error reporting for unreachable code.",
allowUnusedLabels: "Disable error reporting for unused labels.",
alwaysStrict: "Ensure 'use strict' is always emitted.",
assumeChangesOnlyAffectDirectDependencies: "Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it.",
baseUrl: "Specify the base directory to resolve non-relative module names.",
charset: "No longer supported. In early versions, manually set the text encoding for reading files.",
checkJs: "Enable error reporting in type-checked JavaScript files.",
composite: "Enable constraints that allow a TypeScript project to be used with project references.",
declaration: "Generate .d.ts files from TypeScript and JavaScript files in your project.",
declarationDir: "Specify the output directory for generated declaration files.",
declarationMap: "Create sourcemaps for d.ts files.",
diagnostics: "Output compiler performance information after building.",
disableReferencedProjectLoad: "Reduce the number of projects loaded automatically by TypeScript.",
disableSizeLimit: "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.",
disableSolutionSearching: "Opt a project out of multi-project reference checking when editing.",
disableSourceOfProjectReferenceRedirect: "Disable preferring source files instead of declaration files when referencing composite projects",
downlevelIteration: "Emit more compliant, but verbose and less performant JavaScript for iteration.",
emitBOM: "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.",
emitDeclarationOnly: "Only output d.ts files and not JavaScript files.",
emitDecoratorMetadata: "Emit design-type metadata for decorated declarations in source files.",
esModuleInterop: "Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.",
exclude: "Filters results from the `include` option.",
experimentalDecorators: "Enable experimental support for TC39 stage 2 draft decorators.",
explainFiles: "Print files read during the compilation including why it was included.",
extendedDiagnostics: "Output more detailed compiler performance information after building.",
"extends": "Specify one or more path or node module references to base configuration files from which settings are inherited.",
fallbackPolling: "Specify what approach the watcher should use if the system runs out of native file watchers.",
files: "Include a list of files. This does not support glob patterns, as opposed to `include`.",
forceConsistentCasingInFileNames: "Ensure that casing is correct in imports.",
generateCpuProfile: "Emit a v8 CPU profile of the compiler run for debugging.",
importHelpers: "Allow importing helper functions from tslib once per project, instead of including them per-file.",
importsNotUsedAsValues: "Specify emit/checking behavior for imports that are only used for types.",
include: "Specify a list of glob patterns that match files to be included in compilation.",
incremental: "Save .tsbuildinfo files to allow for incremental compilation of projects.",
inlineSourceMap: "Include sourcemap files inside the emitted JavaScript.",
inlineSources: "Include source code in the sourcemaps inside the emitted JavaScript.",
isolatedModules: "Ensure that each file can be safely transpiled without relying on other imports.",
jsx: "Specify what JSX code is generated.",
jsxFactory: "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'",
jsxFragmentFactory: "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.",
jsxImportSource: "Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.`",
keyofStringsOnly: "Make keyof only return strings instead of string, numbers or symbols. Legacy option.",
lib: "Specify a set of bundled library declaration files that describe the target runtime environment.",
listEmittedFiles: "Print the names of emitted files after a compilation.",
listFiles: "Print all of the files read during the compilation.",
locale: "Set the language of the messaging from TypeScript. This does not affect emit.",
mapRoot: "Specify the location where debugger should locate map files instead of generated locations.",
maxNodeModuleJsDepth: "Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`.",
module: "Specify what module code is generated.",
moduleResolution: "Specify how TypeScript looks up a file from a given module specifier.",
newLine: "Set the newline character for emitting files.",
noEmit: "Disable emitting file from a compilation.",
noEmitHelpers: "Disable generating custom helper functions like `__extends` in compiled output.",
noEmitOnError: "Disable emitting files if any type checking errors are reported.",
noErrorTruncation: "Disable truncating types in error messages.",
noFallthroughCasesInSwitch: "Enable error reporting for fallthrough cases in switch statements.",
noImplicitAny: "Enable error reporting for expressions and declarations with an implied `any` type..",
noImplicitReturns: "Enable error reporting for codepaths that do not explicitly return in a function.",
noImplicitThis: "Enable error reporting when `this` is given the type `any`.",
noImplicitUseStrict: "Disable adding 'use strict' directives in emitted JavaScript files.",
noLib: "Disable including any library files, including the default lib.d.ts.",
noPropertyAccessFromIndexSignature: "Enforces using indexed accessors for keys declared using an indexed type",
noResolve: "Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project.",
noStrictGenericChecks: "Disable strict checking of generic signatures in function types.",
noUncheckedIndexedAccess: "Add `undefined` to a type when accessed using an index.",
noUnusedLocals: "Enable error reporting when a local variables aren't read.",
noUnusedParameters: "Raise an error when a function parameter isn't read",
out: "Deprecated setting. Use `outFile` instead.",
outDir: "Specify an output folder for all emitted files.",
outFile: "Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.",
paths: "Specify a set of entries that re-map imports to additional lookup locations.",
plugins: "Specify a list of language service plugins to include.",
preserveConstEnums: "Disable erasing `const enum` declarations in generated code.",
preserveSymlinks: "Disable resolving symlinks to their realpath. This correlates to the same flag in node.",
preserveWatchOutput: "Disable wiping the console in watch mode",
pretty: "Enable color and formatting in output to make compiler errors easier to read",
reactNamespace: "Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit.",
references: "Specify an array of objects that specify paths for projects. Used in project references.",
removeComments: "Disable emitting comments.",
resolveJsonModule: "Enable importing .json files",
rootDir: "Specify the root folder within your source files.",
rootDirs: "Allow multiple folders to be treated as one when resolving modules.",
skipDefaultLibCheck: "Skip type checking .d.ts files that are included with TypeScript.",
skipLibCheck: "Skip type checking all .d.ts files.",
sourceMap: "Create source map files for emitted JavaScript files.",
sourceRoot: "Specify the root path for debuggers to find the reference source code.",
strict: "Enable all strict type checking options.",
strictBindCallApply: "Check that the arguments for `bind`, `call`, and `apply` methods match the original function.",
strictFunctionTypes: "When assigning functions, check to ensure parameters and the return values are subtype-compatible.",
strictNullChecks: "When type checking, take into account `null` and `undefined`.",
strictPropertyInitialization: "Check for class properties that are declared but not set in the constructor.",
stripInternal: "Disable emitting declarations that have `@internal` in their JSDoc comments.",
suppressExcessPropertyErrors: "Disable reporting of excess property errors during the creation of object literals.",
suppressImplicitAnyIndexErrors: "Suppress `noImplicitAny` errors when indexing objects that lack index signatures.",
target: "Set the JavaScript language version for emitted JavaScript and include compatible library declarations.",
traceResolution: "Log paths used during the `moduleResolution` process.",
tsBuildInfoFile: "Specify the folder for .tsbuildinfo incremental compilation files.",
typeAcquisition: "Specify options for automatic acquisition of declaration files.",
typeRoots: "Specify multiple folders that act like `./node_modules/@types`.",
types: "Specify type package names to be included without being referenced in a source file.",
useDefineForClassFields: "Emit ECMAScript-standard-compliant class fields.",
watchDirectory: "Specify how directories are watched on systems that lack recursive file-watching functionality.",
watchFile: "Specify how the TypeScript watch mode works."
};

@@ -553,3 +568,3 @@

if (lang === "json" && info.includes("tsconfig")) {
if (lang.startsWith("json") && info.includes("tsconfig")) {
return tsconfigJSONRenderer(tokens, shikiOptions || {});

@@ -556,0 +571,0 @@ } // Otherwise just the normal shiki renderer

@@ -29,2 +29,3 @@ export declare const tsconfig: {

experimentalDecorators: string;
explainFiles: string;
extendedDiagnostics: string;

@@ -46,2 +47,3 @@ extends: string;

jsxFragmentFactory: string;
jsxImportSource: string;
keyofStringsOnly: string;

@@ -67,4 +69,6 @@ lib: string;

noLib: string;
noPropertyAccessFromIndexSignature: string;
noResolve: string;
noStrictGenericChecks: string;
noUncheckedIndexedAccess: string;
noUnusedLocals: string;

@@ -71,0 +75,0 @@ noUnusedParameters: string;

{
"name": "shiki-twoslash",
"version": "0.8.1",
"version": "0.8.2",
"license": "MIT",
"homepage": "https://github.com/microsoft/TypeScript-Website/",
"homepage": "https://github.com/microsoft/TypeScript-Website",
"repository": {
"url": "https://github.com/microsoft/TypeScript-Website.git",
"directory": "packages/create-typescript-playground-plugin",
"type": "git"
},
"bugs": {
"url": "https://github.com/microsoft/TypeScript-Website/issues"
},
"description": "API primitives to mix Shiki with Twoslash",

@@ -17,3 +25,3 @@ "author": "Orta Therox",

"prepublishOnly": "yarn build",
"bootstrap": "node scripts/generateTSConfigOneliners.js",
"bootstrap": "node scripts/generateTSConfigOneliners.js && yarn build",
"build": "tsdx build && yarn tsc src/dom.ts --outDir dist",

@@ -24,4 +32,4 @@ "test": "tsdx test",

"dependencies": {
"@typescript/twoslash": "1.1.1",
"@typescript/vfs": "1.3.0",
"@typescript/twoslash": "1.1.4",
"@typescript/vfs": "1.3.2",
"shiki": "^0.1.6",

@@ -33,5 +41,5 @@ "shiki-languages": "^0.1.6",

"@types/jest": "^25.1.3",
"gatsby-remark-shiki-twoslash": "0.7.0",
"gatsby-remark-shiki-twoslash": "0.7.1",
"rehype-stringify": "^6.0.1",
"tsdx": "^0.12.3",
"tsdx": "^0.14.1",
"tslib": "^1.10.0",

@@ -38,0 +46,0 @@ "typescript": "*",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc