Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 8332485

Browse files
committed
feat: support typescript in IDE
1 parent d8efe7a commit 8332485

File tree

8 files changed

+32
-47
lines changed

8 files changed

+32
-47
lines changed

dist/env.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/// <reference types="vite/client" />
22

33
declare module '*.vue' {
4-
import type { DefineComponent } from 'vue'
4+
import type { DefineComponent } from 'vue';
55
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
6-
const component: DefineComponent<{}, {}, any>
7-
export default component
6+
const component: DefineComponent<{}, {}, any>;
7+
export default component;
88
}

dist/index.d.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
/// <reference types="highlight.js" />
2+
import Diff from './Diff.vue';
13
import type { App } from 'vue';
4+
declare module '@vue/runtime-core' {
5+
interface GlobalComponents {
6+
Diff: typeof Diff;
7+
}
8+
}
29
declare const _default: {
310
install: (app: App, options?: {}) => void;
4-
hljs: any;
11+
hljs: import("highlight.js").HLJSApi;
512
};
613
export default _default;
14+
export { Diff };

dist/index.es.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5578,6 +5578,7 @@ const setHighlightCode = ({
55785578
const startEntity = MODIFIED_START_TAG.replace("<", "&lt;").replace(">", "&gt;");
55795579
const closeEntity = MODIFIED_CLOSE_TAG.replace("<", "&lt;").replace(">", "&gt;");
55805580
highlightCode.value = pureElement.innerHTML.replace(new RegExp(startEntity, "g"), '<span class="modified">').replace(new RegExp(closeEntity, "g"), "</span>");
5581+
console.log(highlightCode.value);
55815582
pureElement = null;
55825583
};
55835584
const useRender = (props, viewer, scrollOptions) => {
@@ -5973,4 +5974,4 @@ var index = {
59735974
},
59745975
hljs: HighlightJS
59755976
};
5976-
export { index as default };
5977+
export { Diff, index as default };

dist/index.umd.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/shims-vue.d.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/env.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/// <reference types="vite/client" />
22

33
declare module '*.vue' {
4-
import type { DefineComponent } from 'vue'
4+
import type { DefineComponent } from 'vue';
55
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
6-
const component: DefineComponent<{}, {}, any>
7-
export default component
6+
const component: DefineComponent<{}, {}, any>;
7+
export default component;
88
}

src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import './style.scss';
55
import type { App } from 'vue';
66
import type { PluginOptions } from './types';
77

8+
declare module '@vue/runtime-core' {
9+
export interface GlobalComponents {
10+
Diff: typeof Diff;
11+
}
12+
}
13+
814
export default {
915
install: (app: App, options = {}) => {
1016
const { componentName = 'Diff' } = options as PluginOptions;
@@ -13,3 +19,5 @@ export default {
1319
},
1420
hljs,
1521
};
22+
23+
export { Diff }

src/shims-vue.d.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)