Skip to content

Commit ef5c415

Browse files
committed
types: fix global helpers dts generation
1 parent fddef8b commit ef5c415

File tree

2 files changed

+13
-19
lines changed

2 files changed

+13
-19
lines changed

packages/runtime-core/src/apiSetupHelpers.ts

-19
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,6 @@ import {
1111
} from './componentProps'
1212
import { warn } from './warning'
1313

14-
/**
15-
* The following helpers are compiler macros that are only usable inside
16-
* `<script setup>`. They are essentially part of the `<script setup>` API and
17-
* will be frequently used. Although they can be explicitly imported, they can
18-
* actually be used directly inside `<script setup>` blocks. Their types are
19-
* therefore also made globally available to ensure proper type inference.
20-
*/
21-
type _defineProps = typeof defineProps
22-
type _defineEmits = typeof defineEmits
23-
type _defineExpose = typeof defineExpose
24-
type _withDefaults = typeof withDefaults
25-
26-
declare global {
27-
const defineProps: _defineProps
28-
const defineEmits: _defineEmits
29-
const defineExpose: _defineExpose
30-
const withDefaults: _withDefaults
31-
}
32-
3314
// dev only
3415
const warnRuntimeUsage = (method: string) =>
3516
warn(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Note: this file is auto concatenated to the end of the bundled d.ts during
2+
// build.
3+
type _defineProps = typeof defineProps
4+
type _defineEmits = typeof defineEmits
5+
type _defineExpose = typeof defineExpose
6+
type _withDefaults = typeof withDefaults
7+
8+
declare global {
9+
const defineProps: _defineProps
10+
const defineEmits: _defineEmits
11+
const defineExpose: _defineExpose
12+
const withDefaults: _withDefaults
13+
}

0 commit comments

Comments
 (0)