File tree 1 file changed +19
-0
lines changed
packages/runtime-core/src
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,25 @@ import {
11
11
} from './componentProps'
12
12
import { warn } from './warning'
13
13
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
+
14
33
// dev only
15
34
const warnRuntimeUsage = ( method : string ) =>
16
35
warn (
You can’t perform that action at this time.
0 commit comments