-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(define-props-refs): import withDefault manually
- Loading branch information
Showing
23 changed files
with
205 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'@vue-macros/define-props-refs': minor | ||
'@vue-macros/common': minor | ||
'unplugin-vue-macros': minor | ||
'@vue-macros/volar': minor | ||
--- | ||
|
||
should import withDefault manually when using `definePropsRefs` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
declare const definePropsRefs: typeof import('./macros').definePropsRefs | ||
// @ts-ignore | ||
declare const withDefaults: typeof import('./macros').withDefaults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
<script setup lang="ts"> | ||
import { expectTypeOf } from 'expect-type' | ||
import { ComputedRef } from 'vue' | ||
import { withDefaults } from '../../macros' assert { type: 'macro' } | ||
const { foo, bar } = withDefaults( | ||
definePropsRefs<{ | ||
foo: string | ||
bar: number[] | ||
foo?: string | ||
bar?: number[] | ||
}>(), | ||
{ | ||
foo: 'foo', | ||
bar: () => [1, 2, 3], | ||
} | ||
) | ||
expectTypeOf(foo).toEqualTypeOf<ComputedRef<string>>() | ||
expectTypeOf(bar).toEqualTypeOf<ComputedRef<readonly number[]>>() | ||
expectTypeOf(bar).toEqualTypeOf<ComputedRef<readonly number[] | undefined>>() | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
declare const definePropsRefs: typeof import('./vue2-macros').definePropsRefs | ||
// @ts-ignore | ||
declare const withDefaults: typeof import('./vue2-macros').withDefaults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,27 @@ | ||
import { | ||
definePropsRefs, | ||
type withDefaults as withDefaultsDefinePropsRefs, | ||
} from '@vue-macros/define-props-refs/macros' | ||
import { | ||
type RecordToUnion, | ||
type UnionToIntersection, | ||
} from '@vue-macros/common' | ||
|
||
export * from '@vue-macros/define-emit/macros' | ||
export * from '@vue-macros/define-models/macros' | ||
export * from 'unplugin-vue-define-options/macros' | ||
export * from '@vue-macros/define-prop/macros' | ||
export * from '@vue-macros/define-props/macros' | ||
export * from '@vue-macros/define-props-refs/macros' | ||
export * from '@vue-macros/define-render/macros' | ||
export * from '@vue-macros/define-slots/macros' | ||
export * from '@vue-macros/reactivity-transform/macros' | ||
export * from '@vue-macros/setup-component/macros' | ||
export * from '@vue-macros/short-emits/macros' | ||
export { definePropsRefs } | ||
|
||
interface WithDefaultsMap { | ||
definePropsRefs: typeof withDefaultsDefinePropsRefs | ||
} | ||
|
||
type WithDefaults = UnionToIntersection<RecordToUnion<WithDefaultsMap>> | ||
export declare const withDefaults: WithDefaults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,26 @@ | ||
import { | ||
definePropsRefs, | ||
type withDefaults as withDefaultsDefinePropsRefs, | ||
} from '@vue-macros/define-props-refs/vue2-macros' | ||
import { | ||
type RecordToUnion, | ||
type UnionToIntersection, | ||
} from '@vue-macros/common' | ||
|
||
export * from '@vue-macros/define-emit/macros' | ||
export * from '@vue-macros/define-models/macros' | ||
export * from 'unplugin-vue-define-options/macros' | ||
export * from '@vue-macros/define-prop/macros' | ||
export * from '@vue-macros/define-props/vue2-macros' | ||
export * from '@vue-macros/define-props-refs/vue2-macros' | ||
export * from '@vue-macros/define-render/vue2-macros' | ||
export * from '@vue-macros/define-slots/macros' | ||
export * from '@vue-macros/reactivity-transform/vue2-macros' | ||
export * from '@vue-macros/short-emits/macros' | ||
export { definePropsRefs } | ||
|
||
interface WithDefaultsMap { | ||
definePropsRefs: typeof withDefaultsDefinePropsRefs | ||
} | ||
|
||
type WithDefaults = UnionToIntersection<RecordToUnion<WithDefaultsMap>> | ||
export declare const withDefaults: WithDefaults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.