Skip to content

Commit

Permalink
refactor(types): reuse IsAny from shared module
Browse files Browse the repository at this point in the history
  • Loading branch information
jh-leong committed Aug 4, 2024
1 parent 2b0ef54 commit c9a37bb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/dts-test/component.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
ref,
toRefs,
} from 'vue'
import { type IsAny, describe, expectAssignable, expectType } from './utils'
import type { IsAny } from '@vue/shared'

Check failure on line 14 in packages/dts-test/component.test-d.ts

View workflow job for this annotation

GitHub Actions / lint-and-test-dts

Cannot find module '@vue/shared' or its corresponding type declarations.
import { describe, expectAssignable, expectType } from './utils'

declare function extractComponentOptions<
Props,
Expand Down
3 changes: 2 additions & 1 deletion packages/dts-test/ref.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import {
toValue,
unref,
} from 'vue'
import { type IsAny, type IsUnion, describe, expectType } from './utils'
import type { IsAny } from '@vue/shared'

Check failure on line 21 in packages/dts-test/ref.test-d.ts

View workflow job for this annotation

GitHub Actions / lint-and-test-dts

Cannot find module '@vue/shared' or its corresponding type declarations.
import { type IsUnion, describe, expectType } from './utils'

function plainType(arg: number | Ref<number>) {
// ref coercing
Expand Down
2 changes: 0 additions & 2 deletions packages/dts-test/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@ export type IsUnion<T, U extends T = T> = (
? false
: true

export type IsAny<T> = 0 extends 1 & T ? true : false

export type Prettify<T> = { [K in keyof T]: T[K] } & {}

0 comments on commit c9a37bb

Please sign in to comment.