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
  5145fb3b_7ea1_81ad_26ca_c809d08454e7["InferPropType"]
  84ebb44e_683d_35e3_5197_20a18b6e9957["v3-component-props.d.ts"]
  5145fb3b_7ea1_81ad_26ca_c809d08454e7 -->|defined in| 84ebb44e_683d_35e3_5197_20a18b6e9957
  style 5145fb3b_7ea1_81ad_26ca_c809d08454e7 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