-import { type InjectionKey, type Ref, inject, provide, ref } from 'vue'
+import {
+ type InjectionKey,
+ type Ref,
+ createApp,
+ inject,
+ provide,
+ ref,
+} from 'vue'
import { expectType } from './utils'
// non-symbol keys
provide<Cube>('cube', { size: 'foo' })
// @ts-expect-error
provide<Cube>(123, { size: 'foo' })
+
+// #10602
+const app = createApp({})
+// @ts-expect-error
+app.provide(injectionKeyRef, ref({}))
namespace?: boolean | ElementNamespace,
): ComponentPublicInstance
unmount(): void
- provide<T>(key: InjectionKey<T> | string, value: T): this
+ provide<T, K = InjectionKey<T> | string | number>(
+ key: K,
+ value: K extends InjectionKey<infer V> ? V : T,
+ ): this
/**
* Runs a function with the app as active instance. This allows using of `inject()` within the function to get access