Home / Type/ InferPropType Type — vue Architecture

InferPropType Type — vue Architecture

Architecture documentation for the InferPropType type/interface in v3-component-props.d.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  f7c9794c_91d2_105d_c4c5_0040a83a121b["InferPropType"]
  ce598365_8d1a_ab83_ff4c_5904996e2026["v3-component-props.d.ts"]
  f7c9794c_91d2_105d_c4c5_0040a83a121b -->|defined in| ce598365_8d1a_ab83_ff4c_5904996e2026
  style f7c9794c_91d2_105d_c4c5_0040a83a121b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

types/v3-component-props.d.ts lines 51–69

type InferPropType<T> = [T] extends [null]
  ? any // null & true would fail to infer
  : [T] extends [{ type: null | true }]
  ? any // As TS issue https://github.com/Microsoft/TypeScript/issues/14829 // somehow `ObjectConstructor` when inferred from { (): T } becomes `any` // `BooleanConstructor` when inferred from PropConstructor(with PropMethod) becomes `Boolean`
  : [T] extends [ObjectConstructor | { type: ObjectConstructor }]
  ? Record<string, any>
  : [T] extends [BooleanConstructor | { type: BooleanConstructor }]
  ? boolean
  : [T] extends [DateConstructor | { type: DateConstructor }]
  ? Date
  : [T] extends [(infer U)[] | { type: (infer U)[] }]
  ? U extends DateConstructor
    ? Date | InferPropType<U>
    : InferPropType<U>
  : [T] extends [Prop<infer V, infer D>]
  ? unknown extends V
    ? IfAny<V, V, D>
    : V
  : T

Frequently Asked Questions

What is the InferPropType type?
InferPropType is a type/interface in the vue codebase, defined in types/v3-component-props.d.ts.
Where is InferPropType defined?
InferPropType is defined in types/v3-component-props.d.ts at line 51.

Analyze Your Own Codebase

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

Try Supermodel Free