setup-helpers-test.ts — vue Source File
Architecture documentation for setup-helpers-test.ts, a typescript file in the vue codebase. 6 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 7db1d065_9f4e_91b8_a37a_93635347a3e2["setup-helpers-test.ts"] 09422b63_6947_479f_f3b8_a48790187388["./index"] 7db1d065_9f4e_91b8_a37a_93635347a3e2 --> 09422b63_6947_479f_f3b8_a48790187388 640c5630_c924_297a_b265_64ad36b365b4["utils.ts"] 7db1d065_9f4e_91b8_a37a_93635347a3e2 --> 640c5630_c924_297a_b265_64ad36b365b4 7d65dad0_e48b_e612_5731_1be8ed27e572["describe"] 7db1d065_9f4e_91b8_a37a_93635347a3e2 --> 7d65dad0_e48b_e612_5731_1be8ed27e572 5f4a7580_a803_7560_b218_8b0cb5a709d8["describe"] 7db1d065_9f4e_91b8_a37a_93635347a3e2 --> 5f4a7580_a803_7560_b218_8b0cb5a709d8 526bbcde_5613_9f1a_1c80_ab1e7061c667["expectType"] 7db1d065_9f4e_91b8_a37a_93635347a3e2 --> 526bbcde_5613_9f1a_1c80_ab1e7061c667 ae6eb6a4_c3be_68e2_81f6_f67b97a4ccd3["expectType"] 7db1d065_9f4e_91b8_a37a_93635347a3e2 --> ae6eb6a4_c3be_68e2_81f6_f67b97a4ccd3 style 7db1d065_9f4e_91b8_a37a_93635347a3e2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { useAttrs, useSlots, SetupContext } from '../index'
import { describe, expectType } from './utils'
describe('defineProps w/ type declaration', () => {
// type declaration
const props = defineProps<{
foo: string
}>()
// explicitly declared type should be refined
expectType<string>(props.foo)
// @ts-expect-error
props.bar
})
describe('defineProps w/ type declaration + withDefaults', () => {
const res = withDefaults(
defineProps<{
number?: number
arr?: string[]
obj?: { x: number }
fn?: (e: string) => void
genStr?: string
x?: string
y?: string
z?: string
}>(),
{
number: 123,
arr: () => [],
obj: () => ({ x: 123 }),
fn: () => {},
genStr: () => '',
y: undefined,
z: 'string'
}
)
res.number + 1
res.arr.push('hi')
res.obj.x
res.fn('hi')
res.genStr.slice()
// @ts-expect-error
res.x.slice()
// @ts-expect-error
res.y.slice()
expectType<string | undefined>(res.x)
expectType<string | undefined>(res.y)
expectType<string>(res.z)
})
describe('defineProps w/ union type declaration + withDefaults', () => {
withDefaults(
defineProps<{
union1?: number | number[] | { x: number }
union2?: number | number[] | { x: number }
union3?: number | number[] | { x: number }
union4?: number | number[] | { x: number }
}>(),
// ... (85 more lines)
Domain
Types
Dependencies
Source
Frequently Asked Questions
What does setup-helpers-test.ts do?
setup-helpers-test.ts is a source file in the vue codebase, written in typescript. It belongs to the CompilerSFC domain.
What does setup-helpers-test.ts depend on?
setup-helpers-test.ts imports 6 module(s): ./index, describe, describe, expectType, expectType, utils.ts.
Where is setup-helpers-test.ts in the architecture?
setup-helpers-test.ts is located at types/test/setup-helpers-test.ts (domain: CompilerSFC, directory: types/test).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free