Home / Function/ extractRuntimeProps() — vue Function Reference

extractRuntimeProps() — vue Function Reference

Architecture documentation for the extractRuntimeProps() function in compileScript.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  507a306d_b939_d165_c13a_79d12a2665d9["extractRuntimeProps()"]
  16b5f9ed_1e09_eff8_5797_7cb90fc86d37["compileScript()"]
  16b5f9ed_1e09_eff8_5797_7cb90fc86d37 -->|calls| 507a306d_b939_d165_c13a_79d12a2665d9
  9315090e_2c5c_e529_e01a_651ebe7c77f0["inferRuntimeType()"]
  507a306d_b939_d165_c13a_79d12a2665d9 -->|calls| 9315090e_2c5c_e529_e01a_651ebe7c77f0
  style 507a306d_b939_d165_c13a_79d12a2665d9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/compiler-sfc/src/compileScript.ts lines 1442–1467

function extractRuntimeProps(
  node: TSTypeLiteral | TSInterfaceBody,
  props: Record<string, PropTypeData>,
  declaredTypes: Record<string, string[]>,
  isProd: boolean
) {
  const members = node.type === 'TSTypeLiteral' ? node.members : node.body
  for (const m of members) {
    if (
      (m.type === 'TSPropertySignature' || m.type === 'TSMethodSignature') &&
      m.key.type === 'Identifier'
    ) {
      let type
      if (m.type === 'TSMethodSignature') {
        type = ['Function']
      } else if (m.typeAnnotation) {
        type = inferRuntimeType(m.typeAnnotation.typeAnnotation, declaredTypes)
      }
      props[m.key.name] = {
        key: m.key.name,
        required: !m.optional,
        type: type || [`null`]
      }
    }
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does extractRuntimeProps() do?
extractRuntimeProps() is a function in the vue codebase.
What does extractRuntimeProps() call?
extractRuntimeProps() calls 1 function(s): inferRuntimeType.
What calls extractRuntimeProps()?
extractRuntimeProps() is called by 1 function(s): compileScript.

Analyze Your Own Codebase

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

Try Supermodel Free