Skip to content

Commit 7af6444

Browse files
authoredApr 11, 2023
fix: publish utils and snapshot .d.ts files for typescript (#3172)
1 parent 000bca9 commit 7af6444

File tree

6 files changed

+11
-15
lines changed

6 files changed

+11
-15
lines changed
 

‎packages/snapshot/environment.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './dist/environment.js'

‎packages/snapshot/manager.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './dist/manager.js'

‎packages/utils/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"module": "./dist/index.js",
3030
"types": "./dist/index.d.ts",
3131
"files": [
32-
"dist"
32+
"dist",
33+
"*.d.ts"
3334
],
3435
"scripts": {
3536
"build": "rimraf dist && rollup -c",

‎packages/utils/src/descriptors.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
import concordance, { type DisplayOptions } from 'concordance'
1+
import concordance from 'concordance'
22
import { getColors } from './colors'
33

4+
interface DisplayOptions {
5+
theme?: any
6+
maxDepth?: number
7+
}
8+
49
export function getConcordanceTheme() {
510
const c = getColors()
611

@@ -87,7 +92,3 @@ export function getConcordanceTheme() {
8792
export function diffDescriptors(actual: unknown, expected: unknown, options: DisplayOptions) {
8893
return concordance.diff(expected, actual, options)
8994
}
90-
91-
export function formatDescriptor(value: unknown, options: DisplayOptions) {
92-
return concordance.formatDescriptor(value, options)
93-
}

‎packages/utils/src/diff.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { getColors } from './colors'
22
import { diffDescriptors, getConcordanceTheme } from './descriptors'
33

4-
export * from './descriptors'
5-
64
export interface DiffOptions {
75
showLegend?: boolean
86
}

‎packages/utils/src/external.d.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
declare module 'concordance' {
2-
interface DisplayOptions {
3-
theme?: any
4-
maxDepth?: number
5-
}
6-
7-
export function diff(expected: unknown, actual: unknown, options?: DisplayOptions): string
8-
export function formatDescriptor(descriptor: unknown, options?: DisplayOptions): string
2+
export function diff(expected: unknown, actual: unknown, options?: any): string
93
}

0 commit comments

Comments
 (0)
Please sign in to comment.