v-code-diff 1.13.2 → 1.14.1

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.
package/types/index.d.ts CHANGED
@@ -1,18 +1,66 @@
1
1
  import type { HLJSApi } from 'highlight.js'
2
- import type { DefineComponent } from 'vue-demi'
2
+ import type { DefineComponent, VNode } from 'vue-demi'
3
3
 
4
- declare const _default: {
5
- install: (app: any) => void
6
- hljs: HLJSApi
4
+ export interface CodeDiffProps {
5
+ newString: string
6
+ oldString: string
7
+ language?: string
8
+ context?: number
9
+ diffStyle?: 'word' | 'char'
10
+ forceInlineComparison?: boolean
11
+ outputFormat?: 'line-by-line' | 'side-by-side'
12
+ trim?: boolean
13
+ noDiffLineFeed?: boolean
14
+ maxHeight?: string
15
+ filename?: string
16
+ newFilename?: string
17
+ hideHeader?: boolean
18
+ hideStat?: boolean
19
+ theme?: 'light' | 'dark'
20
+ ignoreMatchingLines?: string
21
+ }
22
+
23
+ export interface CodeReaderProps {
24
+ text: string
25
+ language?: string
26
+ }
27
+
28
+ export interface DiffStat {
29
+ additionsNum: number
30
+ deletionsNum: number
31
+ ignoreAdditionsNum: number
32
+ ignoreDeletionsNum: number
33
+ }
34
+
35
+ export interface DiffResult {
36
+ stat: {
37
+ isChanged: boolean
38
+ addNum: number
39
+ delNum: number
40
+ }
41
+ }
42
+
43
+ export interface CodeDiffSlots {
44
+ stat: (props: { stat: DiffStat }) => VNode[]
45
+ }
46
+
47
+ interface CodeDiffEmits {
48
+ diff: (diffResult: DiffResult) => void
49
+ }
50
+
51
+ type Empty = Record<string, never>
52
+ type CodeDiffComponent = DefineComponent<CodeDiffProps, Empty, Empty, Empty, Empty, Empty, Empty, CodeDiffEmits, 'diff'>
53
+
54
+ export declare const CodeDiff: CodeDiffComponent & {
55
+ new (): InstanceType<CodeDiffComponent> & { $slots: CodeDiffSlots }
7
56
  }
8
57
 
9
- // eslint-disable-next-line
10
- declare const CodeDiff: DefineComponent<{}, {}, any>
11
- // eslint-disable-next-line
12
- declare const CodeReader: DefineComponent<{}, {}, any>
13
- export {
14
- CodeDiff,
15
- CodeReader,
58
+ export declare const CodeReader: DefineComponent<CodeReaderProps>
59
+ export declare const hljs: HLJSApi
60
+
61
+ declare const plugin: {
62
+ install: (app: { component: (name: string, component: unknown) => unknown }) => void
63
+ hljs: HLJSApi
16
64
  }
17
65
 
18
- export default _default
66
+ export default plugin