Home / File/ v3-setup-helpers.d.ts — vue Source File

v3-setup-helpers.d.ts — vue Source File

Architecture documentation for v3-setup-helpers.d.ts, a typescript file in the vue codebase. 2 imports, 0 dependents.

File typescript VueCore GlobalAPI 2 imports 1 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  54deaa07_9586_9158_a126_0a474a813a50["v3-setup-helpers.d.ts"]
  653962b7_947f_5751_c3dd_3df808295fbf["./v3-setup-context"]
  54deaa07_9586_9158_a126_0a474a813a50 --> 653962b7_947f_5751_c3dd_3df808295fbf
  324f926f_5346_c2f9_5e54_481699b9d5c0["./v3-component-props"]
  54deaa07_9586_9158_a126_0a474a813a50 --> 324f926f_5346_c2f9_5e54_481699b9d5c0
  style 54deaa07_9586_9158_a126_0a474a813a50 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { EmitFn, EmitsOptions } from './v3-setup-context'
import {
  ComponentObjectPropsOptions,
  ExtractPropTypes
} from './v3-component-props'

/**
 * Vue `<script setup>` compiler macro for declaring component props. The
 * expected argument is the same as the component `props` option.
 *
 * Example runtime declaration:
 * ```js
 * // using Array syntax
 * const props = defineProps(['foo', 'bar'])
 * // using Object syntax
 * const props = defineProps({
 *   foo: String,
 *   bar: {
 *     type: Number,
 *     required: true
 *   }
 * })
 * ```
 *
 * Equivalent type-based declaration:
 * ```ts
 * // will be compiled into equivalent runtime declarations
 * const props = defineProps<{
 *   foo?: string
 *   bar: number
 * }>()
 * ```
 *
 * This is only usable inside `<script setup>`, is compiled away in the
 * output and should **not** be actually called at runtime.
 */
// overload 1: runtime props w/ array
export function defineProps<PropNames extends string = string>(
  props: PropNames[]
): Readonly<{ [key in PropNames]?: any }>
// overload 2: runtime props w/ object
export function defineProps<
  PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions
>(props: PP): Readonly<ExtractPropTypes<PP>>
// overload 3: typed-based declaration
export function defineProps<TypeProps>(): Readonly<TypeProps>

/**
 * Vue `<script setup>` compiler macro for declaring a component's emitted
 * events. The expected argument is the same as the component `emits` option.
 *
 * Example runtime declaration:
 * ```js
 * const emit = defineEmits(['change', 'update'])
 * ```
 *
 * Example type-based declaration:
 * ```ts
 * const emit = defineEmits<{
 *   (event: 'change'): void
// ... (95 more lines)

Domain

Subdomains

Functions

Classes

Dependencies

  • ./v3-component-props
  • ./v3-setup-context

Frequently Asked Questions

What does v3-setup-helpers.d.ts do?
v3-setup-helpers.d.ts is a source file in the vue codebase, written in typescript. It belongs to the VueCore domain, GlobalAPI subdomain.
What functions are defined in v3-setup-helpers.d.ts?
v3-setup-helpers.d.ts defines 1 function(s): T.
What does v3-setup-helpers.d.ts depend on?
v3-setup-helpers.d.ts imports 2 module(s): ./v3-component-props, ./v3-setup-context.
Where is v3-setup-helpers.d.ts in the architecture?
v3-setup-helpers.d.ts is located at types/v3-setup-helpers.d.ts (domain: VueCore, subdomain: GlobalAPI, directory: types).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free