@shikijs/twoslash 3.23.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,21 +1,19 @@
1
- import { ShikiTransformer } from '@shikijs/types';
2
- import { CreateTwoslashOptions } from 'twoslash';
3
- import { TransformerTwoslashOptions, RendererRichOptions } from './core.mjs';
4
- export { CompletionItem, HastExtension, ShikiTwoslashError, TwoslashRenderer, TwoslashShikiFunction, TwoslashShikiReturn, TwoslashTypesCache, createTransformerFactory, defaultCompletionIcons, defaultCustomTagIcons, defaultHoverInfoProcessor, defaultTwoslashOptions, rendererClassic, rendererRich } from './core.mjs';
5
- import 'hast';
1
+ import { CompletionItem, HastExtension, RendererRichOptions, ShikiTwoslashError, TransformerTwoslashOptions, TwoslashRenderer, TwoslashShikiFunction, TwoslashShikiReturn, TwoslashTypesCache, createTransformerFactory, defaultCompletionIcons, defaultCustomTagIcons, defaultHoverInfoProcessor, defaultTwoslashOptions, rendererClassic, rendererRich } from "./core.mjs";
2
+ import { CreateTwoslashOptions } from "twoslash";
3
+ import { ShikiTransformer } from "@shikijs/types";
6
4
 
5
+ //#region src/index.d.ts
7
6
  interface TransformerTwoslashIndexOptions extends TransformerTwoslashOptions, Pick<CreateTwoslashOptions, 'cache'> {
8
- /**
9
- * Options for the default rich renderer.
10
- *
11
- * Available when no custom renderer is provided.
12
- */
13
- rendererRich?: RendererRichOptions;
7
+ /**
8
+ * Options for the default rich renderer.
9
+ *
10
+ * Available when no custom renderer is provided.
11
+ */
12
+ rendererRich?: RendererRichOptions;
14
13
  }
15
14
  /**
16
15
  * Factory function to create a Shiki transformer for twoslash integrations.
17
16
  */
18
17
  declare function transformerTwoslash(options?: TransformerTwoslashIndexOptions): ShikiTransformer;
19
-
20
- export { RendererRichOptions, TransformerTwoslashOptions, transformerTwoslash };
21
- export type { TransformerTwoslashIndexOptions };
18
+ //#endregion
19
+ export { CompletionItem, HastExtension, RendererRichOptions, ShikiTwoslashError, TransformerTwoslashIndexOptions, TransformerTwoslashOptions, TwoslashRenderer, TwoslashShikiFunction, TwoslashShikiReturn, TwoslashTypesCache, createTransformerFactory, defaultCompletionIcons, defaultCustomTagIcons, defaultHoverInfoProcessor, defaultTwoslashOptions, rendererClassic, rendererRich, transformerTwoslash };
package/dist/index.mjs CHANGED
@@ -1,18 +1,17 @@
1
- import { createTwoslasher } from 'twoslash';
2
- import { createTransformerFactory, rendererRich } from './core.mjs';
3
- export { ShikiTwoslashError, defaultCompletionIcons, defaultCustomTagIcons, defaultHoverInfoProcessor, defaultTwoslashOptions, rendererClassic } from './core.mjs';
4
- import '@shikijs/core';
1
+ import { a as defaultCustomTagIcons, c as ShikiTwoslashError, i as defaultCompletionIcons, n as rendererRich, r as rendererClassic, t as defaultHoverInfoProcessor } from "./renderer-rich-DEkszi0Z.mjs";
2
+ import { createTransformerFactory, defaultTwoslashOptions } from "./core.mjs";
3
+ import { createTwoslasher } from "twoslash";
5
4
 
5
+ //#region src/index.ts
6
+ /**
7
+ * Factory function to create a Shiki transformer for twoslash integrations.
8
+ */
6
9
  function transformerTwoslash(options = {}) {
7
- return createTransformerFactory(
8
- createTwoslasher({
9
- cache: options?.cache,
10
- compilerOptions: {
11
- moduleResolution: 100
12
- }
13
- }),
14
- rendererRich(options.rendererRich)
15
- )(options);
10
+ return createTransformerFactory(createTwoslasher({
11
+ cache: options?.cache,
12
+ compilerOptions: { moduleResolution: 100 }
13
+ }), rendererRich(options.rendererRich))(options);
16
14
  }
17
15
 
18
- export { createTransformerFactory, rendererRich, transformerTwoslash };
16
+ //#endregion
17
+ export { ShikiTwoslashError, createTransformerFactory, defaultCompletionIcons, defaultCustomTagIcons, defaultHoverInfoProcessor, defaultTwoslashOptions, rendererClassic, rendererRich, transformerTwoslash };