Skip to content

Commit dc3a9c5

Browse files
update
1 parent 7d534e7 commit dc3a9c5

File tree

19 files changed

+78
-136
lines changed

19 files changed

+78
-136
lines changed

packages/core/index.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Generated by dts-bundle-generator v9.5.1
22

3+
import { Root } from 'hast';
4+
35
declare class Cache$1<K, V> extends Map<K, V> {
46

57
name: string;
@@ -700,7 +702,7 @@ export interface UnifiedLineItem {
700702
isHidden?: boolean;
701703
_isHidden?: boolean;
702704
}
703-
export type DiffAST = ReturnType<typeof lowlight.highlight>;
705+
export type DiffAST = Root;
704706
export type DiffHighlighter = {
705707
name: string;
706708
type: "class" | "style" | string;
@@ -798,7 +800,6 @@ export type SyntaxLine = {
798800
export type SyntaxLineWithTemplate = SyntaxLine & {
799801
template?: string;
800802
};
801-
// Generated by dts-bundle-generator v9.5.1
802803
export type SyntaxNode = {
803804
type: string;
804805
value: string;

packages/file/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Generated by dts-bundle-generator v9.5.1
22

33
import { PatchOptions } from 'diff';
4+
import { Root } from 'hast';
45

56
declare class Cache$1<K, V> extends Map<K, V> {
67
name: string;
@@ -699,7 +700,7 @@ export interface UnifiedLineItem {
699700
isHidden?: boolean;
700701
_isHidden?: boolean;
701702
}
702-
export type DiffAST = ReturnType<typeof lowlight.highlight>;
703+
export type DiffAST = Root;
703704
export type DiffHighlighter = {
704705
name: string;
705706
type: "class" | "style" | string;
@@ -797,7 +798,6 @@ export type SyntaxLine = {
797798
export type SyntaxLineWithTemplate = SyntaxLine & {
798799
template?: string;
799800
};
800-
// Generated by dts-bundle-generator v9.5.1
801801
export type SyntaxNode = {
802802
type: string;
803803
value: string;

packages/lowlight/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// Generated by dts-bundle-generator v9.5.1
22

3+
import { Root } from 'hast';
4+
5+
export type DiffAST = Root;
36
export type SyntaxNode = {
47
type: string;
58
value: string;
@@ -42,7 +45,6 @@ declare const lowlight: {
4245
};
4346
registered: (aliasOrName: string) => boolean;
4447
};
45-
export type DiffAST = ReturnType<typeof lowlight.highlight>;
4648
export type DiffHighlighter = {
4749
name: string;
4850
type: "class" | "style" | string;

packages/lowlight/src/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { processAST } from "@git-diff-view/utils";
12
import { createLowlight, all } from "lowlight";
23

3-
import { processAST, type SyntaxLine } from "./processAST";
4-
54
import type { _getAST } from "./lang";
5+
import type { DiffAST, SyntaxLine } from "@git-diff-view/utils";
66

77
const lowlight = createLowlight(all);
88

@@ -54,8 +54,6 @@ lowlight.register("vue", function hljsDefineVue(hljs) {
5454
};
5555
});
5656

57-
export type DiffAST = ReturnType<typeof lowlight.highlight>;
58-
5957
export type DiffHighlighter = {
6058
name: string;
6159
type: "class" | "style" | string;
@@ -147,7 +145,7 @@ Object.defineProperty(instance, "getHighlighterEngine", {
147145

148146
Object.defineProperty(instance, "type", { value: "class" });
149147

150-
export { processAST } from "./processAST";
148+
export { processAST } from "@git-diff-view/utils";
151149

152150
export const versions = __VERSION__;
153151

packages/lowlight/src/lang.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { DiffAST } from ".";
1+
import type { DiffAST } from "@git-diff-view/utils";
22

33
export type DiffHighlighterLang =
44
| "arduino"

packages/react/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Generated by dts-bundle-generator v9.5.1
22

3+
import { Root } from 'hast';
34
import { CSSProperties, ForwardedRef, ReactNode, RefObject } from 'react';
45

56
declare class Cache$1<K, V> extends Map<K, V> {
@@ -699,7 +700,7 @@ export interface UnifiedLineItem {
699700
isHidden?: boolean;
700701
_isHidden?: boolean;
701702
}
702-
export type DiffAST = ReturnType<typeof lowlight.highlight>;
703+
export type DiffAST = Root;
703704
export type DiffHighlighter = {
704705
name: string;
705706
type: "class" | "style" | string;
@@ -797,7 +798,6 @@ export type SyntaxLine = {
797798
export type SyntaxLineWithTemplate = SyntaxLine & {
798799
template?: string;
799800
};
800-
// Generated by dts-bundle-generator v9.5.1
801801
export type SyntaxNode = {
802802
type: string;
803803
value: string;

packages/shiki/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// Generated by dts-bundle-generator v9.5.1
22

3-
import { BundledLanguage, codeToHast, createHighlighter } from 'shiki';
3+
import { Root } from 'hast';
4+
import { BundledLanguage, createHighlighter } from 'shiki';
45

6+
export type DiffAST = Root;
57
export type SyntaxNode = {
68
type: string;
79
value: string;
@@ -31,7 +33,6 @@ export type DiffHighlighterLang = "cpp" | "java" | "javascript" | "css" | "c#" |
3133
declare function _getAST(raw: string, fileName?: string, lang?: DiffHighlighterLang, theme?: "light" | "dark"): DiffAST;
3234
declare function _getAST(raw: string, fileName?: string, lang?: string, theme?: "light" | "dark"): DiffAST;
3335
export type DePromise<T> = T extends Promise<infer U> ? DePromise<U> : T;
34-
export type DiffAST = DePromise<ReturnType<typeof codeToHast>>;
3536
export type DiffHighlighter = {
3637
name: string;
3738
type: "class" | "style" | string;
@@ -80,7 +81,6 @@ export * from "shiki";
8081

8182
export {
8283
BundledLanguage,
83-
codeToHast,
8484
createHighlighter,
8585
};
8686

packages/shiki/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"virtual dom highlight"
4747
],
4848
"dependencies": {
49+
"@types/hast": "^3.0.0",
4950
"shiki": "^3.9.2"
5051
}
5152
}

packages/shiki/src/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1+
import { processAST } from "@git-diff-view/utils";
12
import { createHighlighter } from "shiki";
23
import { createJavaScriptRegexEngine } from "shiki/engine/javascript";
34

4-
import { processAST, type SyntaxLine } from "./processAST";
5-
65
import type { _getAST } from "./lang";
7-
import type { BundledLanguage, codeToHast } from "shiki";
6+
import type { DiffAST, SyntaxLine } from "@git-diff-view/utils";
7+
import type { BundledLanguage } from "shiki";
88

99
type DePromise<T> = T extends Promise<infer U> ? DePromise<U> : T;
1010

11-
export type DiffAST = DePromise<ReturnType<typeof codeToHast>>;
12-
1311
export type DiffHighlighter = {
1412
name: string;
1513
type: "class" | "style" | string;
@@ -265,7 +263,7 @@ export const getDiffViewHighlighter = async (langs?: BundledLanguage[]) => {
265263
}
266264
};
267265

268-
export { processAST } from "./processAST";
266+
export { processAST } from "@git-diff-view/utils";
269267

270268
export const versions = __VERSION__;
271269

packages/shiki/src/lang.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { DiffAST } from ".";
1+
import type { DiffAST } from "@git-diff-view/utils";
22

33
export type DiffHighlighterLang =
44
| "cpp"

0 commit comments

Comments
 (0)