Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
MrWangJustToDo committed May 8, 2024
1 parent 6e9ac7f commit f423611
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 44 deletions.
18 changes: 9 additions & 9 deletions packages/core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,13 @@ export declare class DiffParser {
parse(text: string): IRawDiff;
}
export declare const parseInstance: DiffParser;
declare class Cache$1<K, V> extends Map<K, V> {

name: string;
setMaxLength(length: number): void;
set(key: K, value: V): this;
_checkLength(): void;
}
// Generated by dts-bundle-generator v9.5.1
export type SyntaxNode = {
type: string;
Expand Down Expand Up @@ -343,13 +350,6 @@ export type DiffHighlighter = {
getHighlighterEngine: () => typeof lowlight;
};
export declare const highlighter: DiffHighlighter;
declare class Cache$1<K, V> extends Map<K, V> {

name: string;
setMaxLength(length: number): void;
set(key: K, value: V): this;
_checkLength(): void;
}
declare class File$1 {

readonly raw: string;
Expand All @@ -367,7 +367,7 @@ declare class File$1 {
static createInstance(data: File$1): File$1;
constructor(raw: string, lang: string, fileName?: string);
doSyntax({ registerHighlighter }: {
registerHighlighter?: typeof highlighter;
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
}): void;
doRaw(): void;
}
Expand Down Expand Up @@ -454,7 +454,7 @@ export declare class DiffFile {
clearId(): void;
initRaw(): void;
initSyntax({ registerHighlighter }?: {
registerHighlighter?: typeof highlighter;
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
}): void;
init(): void;
buildSplitDiffLines(): void;
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/diff-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getFile, File } from "./file";
import { DiffLine, DiffLineType, parseInstance, getDiffRange, getLang } from "./parse";

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

export const composeLen = 40;

Expand Down Expand Up @@ -434,7 +434,7 @@ export class DiffFile {
});
}

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

this.#oldFileSyntaxLines = this.#oldFileResult?.syntaxFile;
Expand Down Expand Up @@ -492,7 +492,7 @@ export class DiffFile {
this.#hasInitRaw = true;
}

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

if (this.#composeByMerge && !this.#composeByFullMerge) {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { highlighter } from "@git-diff-view/lowlight";

import { Cache } from "./cache";

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

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

Expand Down Expand Up @@ -77,7 +77,7 @@ export class File {
Object.defineProperty(this, "__v_skip", { value: true });
}

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

const _highlighter = registerHighlighter || highlighter;
Expand Down
16 changes: 8 additions & 8 deletions packages/file/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ export declare class DiffParser {
parse(text: string): IRawDiff;
}
export declare const parseInstance: DiffParser;
declare class Cache$1<K, V> extends Map<K, V> {
name: string;
setMaxLength(length: number): void;
set(key: K, value: V): this;
_checkLength(): void;
}
// Generated by dts-bundle-generator v9.5.1
export type SyntaxNode = {
type: string;
Expand Down Expand Up @@ -346,12 +352,6 @@ export type DiffHighlighter = {
getHighlighterEngine: () => typeof lowlight;
};
export declare const highlighter: DiffHighlighter;
declare class Cache$1<K, V> extends Map<K, V> {
name: string;
setMaxLength(length: number): void;
set(key: K, value: V): this;
_checkLength(): void;
}
declare class File$1 {
readonly raw: string;
readonly lang: string;
Expand All @@ -368,7 +368,7 @@ declare class File$1 {
static createInstance(data: File$1): File$1;
constructor(raw: string, lang: string, fileName?: string);
doSyntax({ registerHighlighter }: {
registerHighlighter?: typeof highlighter;
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
}): void;
doRaw(): void;
}
Expand Down Expand Up @@ -454,7 +454,7 @@ export declare class DiffFile {
clearId(): void;
initRaw(): void;
initSyntax({ registerHighlighter }?: {
registerHighlighter?: typeof highlighter;
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
}): void;
init(): void;
buildSplitDiffLines(): void;
Expand Down
18 changes: 9 additions & 9 deletions packages/react/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ export declare class DiffParser {
parse(text: string): IRawDiff;
}
export declare const parseInstance: DiffParser;
declare class Cache$1<K, V> extends Map<K, V> {
name: string;
setMaxLength(length: number): void;
set(key: K, value: V): this;
_checkLength(): void;
}
// Generated by dts-bundle-generator v9.5.1
export type SyntaxNode = {
type: string;
Expand Down Expand Up @@ -347,12 +353,6 @@ export type DiffHighlighter = {
getHighlighterEngine: () => typeof lowlight;
};
export declare const highlighter: DiffHighlighter;
declare class Cache$1<K, V> extends Map<K, V> {
name: string;
setMaxLength(length: number): void;
set(key: K, value: V): this;
_checkLength(): void;
}
declare class File$1 {
readonly raw: string;
readonly lang: string;
Expand All @@ -369,7 +369,7 @@ declare class File$1 {
static createInstance(data: File$1): File$1;
constructor(raw: string, lang: string, fileName?: string);
doSyntax({ registerHighlighter }: {
registerHighlighter?: typeof highlighter;
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
}): void;
doRaw(): void;
}
Expand Down Expand Up @@ -455,7 +455,7 @@ export declare class DiffFile {
clearId(): void;
initRaw(): void;
initSyntax({ registerHighlighter }?: {
registerHighlighter?: typeof highlighter;
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
}): void;
init(): void;
buildSplitDiffLines(): void;
Expand Down Expand Up @@ -689,7 +689,7 @@ export type DiffViewProps<T> = {
* provide a custom highlighter
* eg: lowlight, refractor, starry-night, shiki
*/
registerHighlighter?: typeof highlighter;
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
diffViewMode?: DiffModeEnum;
diffViewWrap?: boolean;
diffViewFontSize?: number;
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/DiffView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { DiffSplitView } from "./DiffSplitView";
import { DiffUnifiedView } from "./DiffUnifiedView";
import { DiffModeEnum, DiffViewContext } from "./DiffViewContext";

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

export const diffFontSizeName = "--diff-font-size--";
Expand All @@ -37,7 +37,7 @@ export type DiffViewProps<T> = {
* provide a custom highlighter
* eg: lowlight, refractor, starry-night, shiki
*/
registerHighlighter?: typeof highlighter;
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
diffViewMode?: DiffModeEnum;
diffViewWrap?: boolean;
diffViewFontSize?: number;
Expand Down
18 changes: 9 additions & 9 deletions packages/vue/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ export declare class DiffParser {
parse(text: string): IRawDiff;
}
export declare const parseInstance: DiffParser;
declare class Cache$1<K, V> extends Map<K, V> {
name: string;
setMaxLength(length: number): void;
set(key: K, value: V): this;
_checkLength(): void;
}
// Generated by dts-bundle-generator v9.5.1
export type SyntaxNode = {
type: string;
Expand Down Expand Up @@ -346,12 +352,6 @@ export type DiffHighlighter = {
getHighlighterEngine: () => typeof lowlight;
};
export declare const highlighter: DiffHighlighter;
declare class Cache$1<K, V> extends Map<K, V> {
name: string;
setMaxLength(length: number): void;
set(key: K, value: V): this;
_checkLength(): void;
}
declare class File$1 {
readonly raw: string;
readonly lang: string;
Expand All @@ -368,7 +368,7 @@ declare class File$1 {
static createInstance(data: File$1): File$1;
constructor(raw: string, lang: string, fileName?: string);
doSyntax({ registerHighlighter }: {
registerHighlighter?: typeof highlighter;
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
}): void;
doRaw(): void;
}
Expand Down Expand Up @@ -454,7 +454,7 @@ export declare class DiffFile {
clearId(): void;
initRaw(): void;
initSyntax({ registerHighlighter }?: {
registerHighlighter?: typeof highlighter;
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
}): void;
init(): void;
buildSplitDiffLines(): void;
Expand Down Expand Up @@ -651,7 +651,7 @@ export type DiffViewProps<T> = {
diffFile?: DiffFile;
class?: string;
style?: CSSProperties;
registerHighlighter?: typeof highlighter;
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
diffViewMode?: DiffModeEnum;
diffViewWrap?: boolean;
diffViewFontSize?: number;
Expand Down
4 changes: 2 additions & 2 deletions packages/vue/src/components/DiffView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useProvide } from "../hooks/useProvide";
import { DiffSplitView } from "./DiffSplitView";
import { DiffUnifiedView } from "./DiffUnifiedView";

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

export enum DiffModeEnum {
Expand All @@ -47,7 +47,7 @@ export type DiffViewProps<T> = {
diffFile?: DiffFile;
class?: string;
style?: CSSProperties;
registerHighlighter?: typeof highlighter;
registerHighlighter?: Omit<DiffHighlighter, "getHighlighterEngine">;
diffViewMode?: DiffModeEnum;
diffViewWrap?: boolean;
diffViewFontSize?: number;
Expand Down

0 comments on commit f423611

Please sign in to comment.