svelte-highlight 7.8.3 → 7.8.4

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.
Files changed (3) hide show
  1. package/README.md +16 -0
  2. package/index.d.ts +1 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -334,6 +334,22 @@ Refer to the highlight.js [language definition guide](https://highlightjs.readth
334
334
  <Highlight {language} code="..." />
335
335
  ```
336
336
 
337
+ If you're using TypeScript, use the `LanguageType` interface to type the language.
338
+
339
+ ```ts
340
+ import type { LanguageType } from "svelte-highlight";
341
+
342
+ const language: LanguageType<"custom-language"> = {
343
+ name: "custom-language",
344
+ register: (hljs) => {
345
+ return {
346
+ /** custom language rules */
347
+ contains: [],
348
+ };
349
+ },
350
+ };
351
+ ```
352
+
337
353
  ## Custom Plugin
338
354
 
339
355
  Additional plugin languages can be installed and used separately.
package/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export { default as Highlight, default as default } from "./Highlight.svelte";
2
2
  export { default as HighlightAuto } from "./HighlightAuto.svelte";
3
3
  export { default as HighlightSvelte } from "./HighlightSvelte.svelte";
4
4
  export { default as LineNumbers } from "./LineNumbers.svelte";
5
+ export type { LanguageType } from "./languages";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-highlight",
3
- "version": "7.8.3",
3
+ "version": "7.8.4",
4
4
  "license": "MIT",
5
5
  "description": "Svelte component library for highlighting code using highlight.js",
6
6
  "author": "Eric Liu (https://github.com/metonym)",