Skip to content

Commit f423611

Browse files
fix build
1 parent 6e9ac7f commit f423611

File tree

8 files changed

+44
-44
lines changed

8 files changed

+44
-44
lines changed

packages/core/index.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,13 @@ export declare class DiffParser {
287287
parse(text: string): IRawDiff;
288288
}
289289
export declare const parseInstance: DiffParser;
290+
declare class Cache$1<K, V> extends Map<K, V> {
291+
292+
name: string;
293+
setMaxLength(length: number): void;
294+
set(key: K, value: V): this;
295+
_checkLength(): void;
296+
}
290297
// Generated by dts-bundle-generator v9.5.1
291298
export type SyntaxNode = {
292299
type: string;
@@ -343,13 +350,6 @@ export type DiffHighlighter = {
343350
getHighlighterEngine: () => typeof lowlight;
344351
};
345352
export declare const highlighter: DiffHighlighter;
346-
declare class Cache$1<K, V> extends Map<K, V> {
347-
348-
name: string;
349-
setMaxLength(length: number): void;
350-
set(key: K, value: V): this;
351-
_checkLength(): void;
352-
}
353353
declare class File$1 {
354354

355355
readonly raw: string;
@@ -367,7 +367,7 @@ declare class File$1 {
367367
static createInstance(data: File$1): File$1;
368368
constructor(raw: string, lang: string, fileName?: string);
369369
doSyntax({ registerHighlighter }: {
370-
registerHighlighter?: typeof highlighter;
370+
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
371371
}): void;
372372
doRaw(): void;
373373
}
@@ -454,7 +454,7 @@ export declare class DiffFile {
454454
clearId(): void;
455455
initRaw(): void;
456456
initSyntax({ registerHighlighter }?: {
457-
registerHighlighter?: typeof highlighter;
457+
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
458458
}): void;
459459
init(): void;
460460
buildSplitDiffLines(): void;

packages/core/src/diff-file.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getFile, File } from "./file";
44
import { DiffLine, DiffLineType, parseInstance, getDiffRange, getLang } from "./parse";
55

66
import type { IRawDiff } from "./parse";
7-
import type { highlighter } from "@git-diff-view/lowlight";
7+
import type { DiffHighlighter } from "@git-diff-view/lowlight";
88

99
export const composeLen = 40;
1010

@@ -434,7 +434,7 @@ export class DiffFile {
434434
});
435435
}
436436

437-
#composeSyntax({ registerHighlighter }: { registerHighlighter?: typeof highlighter }) {
437+
#composeSyntax({ registerHighlighter }: { registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine"> }) {
438438
this.#oldFileResult?.doSyntax({ registerHighlighter });
439439

440440
this.#oldFileSyntaxLines = this.#oldFileResult?.syntaxFile;
@@ -492,7 +492,7 @@ export class DiffFile {
492492
this.#hasInitRaw = true;
493493
}
494494

495-
initSyntax({ registerHighlighter }: { registerHighlighter?: typeof highlighter } = {}) {
495+
initSyntax({ registerHighlighter }: { registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine"> } = {}) {
496496
if (this.#hasInitSyntax) return;
497497

498498
if (this.#composeByMerge && !this.#composeByFullMerge) {

packages/core/src/file.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { highlighter } from "@git-diff-view/lowlight";
22

33
import { Cache } from "./cache";
44

5-
import type { DiffAST, SyntaxLine } from "@git-diff-view/lowlight";
5+
import type { DiffAST, DiffHighlighter, SyntaxLine } from "@git-diff-view/lowlight";
66

77
const map = new Cache<string, File>();
88

@@ -77,7 +77,7 @@ export class File {
7777
Object.defineProperty(this, "__v_skip", { value: true });
7878
}
7979

80-
doSyntax({ registerHighlighter }: { registerHighlighter?: typeof highlighter }) {
80+
doSyntax({ registerHighlighter }: { registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine"> }) {
8181
if (!this.raw || this.hasDoSyntax) return;
8282

8383
const _highlighter = registerHighlighter || highlighter;

packages/file/index.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,12 @@ export declare class DiffParser {
290290
parse(text: string): IRawDiff;
291291
}
292292
export declare const parseInstance: DiffParser;
293+
declare class Cache$1<K, V> extends Map<K, V> {
294+
name: string;
295+
setMaxLength(length: number): void;
296+
set(key: K, value: V): this;
297+
_checkLength(): void;
298+
}
293299
// Generated by dts-bundle-generator v9.5.1
294300
export type SyntaxNode = {
295301
type: string;
@@ -346,12 +352,6 @@ export type DiffHighlighter = {
346352
getHighlighterEngine: () => typeof lowlight;
347353
};
348354
export declare const highlighter: DiffHighlighter;
349-
declare class Cache$1<K, V> extends Map<K, V> {
350-
name: string;
351-
setMaxLength(length: number): void;
352-
set(key: K, value: V): this;
353-
_checkLength(): void;
354-
}
355355
declare class File$1 {
356356
readonly raw: string;
357357
readonly lang: string;
@@ -368,7 +368,7 @@ declare class File$1 {
368368
static createInstance(data: File$1): File$1;
369369
constructor(raw: string, lang: string, fileName?: string);
370370
doSyntax({ registerHighlighter }: {
371-
registerHighlighter?: typeof highlighter;
371+
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
372372
}): void;
373373
doRaw(): void;
374374
}
@@ -454,7 +454,7 @@ export declare class DiffFile {
454454
clearId(): void;
455455
initRaw(): void;
456456
initSyntax({ registerHighlighter }?: {
457-
registerHighlighter?: typeof highlighter;
457+
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
458458
}): void;
459459
init(): void;
460460
buildSplitDiffLines(): void;

packages/react/index.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@ export declare class DiffParser {
291291
parse(text: string): IRawDiff;
292292
}
293293
export declare const parseInstance: DiffParser;
294+
declare class Cache$1<K, V> extends Map<K, V> {
295+
name: string;
296+
setMaxLength(length: number): void;
297+
set(key: K, value: V): this;
298+
_checkLength(): void;
299+
}
294300
// Generated by dts-bundle-generator v9.5.1
295301
export type SyntaxNode = {
296302
type: string;
@@ -347,12 +353,6 @@ export type DiffHighlighter = {
347353
getHighlighterEngine: () => typeof lowlight;
348354
};
349355
export declare const highlighter: DiffHighlighter;
350-
declare class Cache$1<K, V> extends Map<K, V> {
351-
name: string;
352-
setMaxLength(length: number): void;
353-
set(key: K, value: V): this;
354-
_checkLength(): void;
355-
}
356356
declare class File$1 {
357357
readonly raw: string;
358358
readonly lang: string;
@@ -369,7 +369,7 @@ declare class File$1 {
369369
static createInstance(data: File$1): File$1;
370370
constructor(raw: string, lang: string, fileName?: string);
371371
doSyntax({ registerHighlighter }: {
372-
registerHighlighter?: typeof highlighter;
372+
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
373373
}): void;
374374
doRaw(): void;
375375
}
@@ -455,7 +455,7 @@ export declare class DiffFile {
455455
clearId(): void;
456456
initRaw(): void;
457457
initSyntax({ registerHighlighter }?: {
458-
registerHighlighter?: typeof highlighter;
458+
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
459459
}): void;
460460
init(): void;
461461
buildSplitDiffLines(): void;
@@ -689,7 +689,7 @@ export type DiffViewProps<T> = {
689689
* provide a custom highlighter
690690
* eg: lowlight, refractor, starry-night, shiki
691691
*/
692-
registerHighlighter?: typeof highlighter;
692+
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
693693
diffViewMode?: DiffModeEnum;
694694
diffViewWrap?: boolean;
695695
diffViewFontSize?: number;

packages/react/src/components/DiffView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { DiffSplitView } from "./DiffSplitView";
1111
import { DiffUnifiedView } from "./DiffUnifiedView";
1212
import { DiffModeEnum, DiffViewContext } from "./DiffViewContext";
1313

14-
import type { highlighter } from "@git-diff-view/core";
14+
import type { DiffHighlighter } from "@git-diff-view/core";
1515
import type { CSSProperties, ForwardedRef, ReactNode } from "react";
1616

1717
export const diffFontSizeName = "--diff-font-size--";
@@ -37,7 +37,7 @@ export type DiffViewProps<T> = {
3737
* provide a custom highlighter
3838
* eg: lowlight, refractor, starry-night, shiki
3939
*/
40-
registerHighlighter?: typeof highlighter;
40+
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
4141
diffViewMode?: DiffModeEnum;
4242
diffViewWrap?: boolean;
4343
diffViewFontSize?: number;

packages/vue/index.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,12 @@ export declare class DiffParser {
290290
parse(text: string): IRawDiff;
291291
}
292292
export declare const parseInstance: DiffParser;
293+
declare class Cache$1<K, V> extends Map<K, V> {
294+
name: string;
295+
setMaxLength(length: number): void;
296+
set(key: K, value: V): this;
297+
_checkLength(): void;
298+
}
293299
// Generated by dts-bundle-generator v9.5.1
294300
export type SyntaxNode = {
295301
type: string;
@@ -346,12 +352,6 @@ export type DiffHighlighter = {
346352
getHighlighterEngine: () => typeof lowlight;
347353
};
348354
export declare const highlighter: DiffHighlighter;
349-
declare class Cache$1<K, V> extends Map<K, V> {
350-
name: string;
351-
setMaxLength(length: number): void;
352-
set(key: K, value: V): this;
353-
_checkLength(): void;
354-
}
355355
declare class File$1 {
356356
readonly raw: string;
357357
readonly lang: string;
@@ -368,7 +368,7 @@ declare class File$1 {
368368
static createInstance(data: File$1): File$1;
369369
constructor(raw: string, lang: string, fileName?: string);
370370
doSyntax({ registerHighlighter }: {
371-
registerHighlighter?: typeof highlighter;
371+
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
372372
}): void;
373373
doRaw(): void;
374374
}
@@ -454,7 +454,7 @@ export declare class DiffFile {
454454
clearId(): void;
455455
initRaw(): void;
456456
initSyntax({ registerHighlighter }?: {
457-
registerHighlighter?: typeof highlighter;
457+
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
458458
}): void;
459459
init(): void;
460460
buildSplitDiffLines(): void;
@@ -651,7 +651,7 @@ export type DiffViewProps<T> = {
651651
diffFile?: DiffFile;
652652
class?: string;
653653
style?: CSSProperties;
654-
registerHighlighter?: typeof highlighter;
654+
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
655655
diffViewMode?: DiffModeEnum;
656656
diffViewWrap?: boolean;
657657
diffViewFontSize?: number;

packages/vue/src/components/DiffView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { useProvide } from "../hooks/useProvide";
2020
import { DiffSplitView } from "./DiffSplitView";
2121
import { DiffUnifiedView } from "./DiffUnifiedView";
2222

23-
import type { highlighter } from "@git-diff-view/core";
23+
import type { DiffHighlighter } from "@git-diff-view/core";
2424
import type { CSSProperties, SlotsType } from "vue";
2525

2626
export enum DiffModeEnum {
@@ -47,7 +47,7 @@ export type DiffViewProps<T> = {
4747
diffFile?: DiffFile;
4848
class?: string;
4949
style?: CSSProperties;
50-
registerHighlighter?: typeof highlighter;
50+
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
5151
diffViewMode?: DiffModeEnum;
5252
diffViewWrap?: boolean;
5353
diffViewFontSize?: number;

0 commit comments

Comments
 (0)