type InjectionKey,
type Ref,
createApp,
+ defineComponent,
inject,
provide,
ref,
const app = createApp({})
// @ts-expect-error
app.provide(injectionKeyRef, ref({}))
+
+defineComponent({
+ provide: {
+ [injectionKeyRef]: { size: 'foo' },
+ },
+})
import { currentApp } from './apiCreateApp'
import { warn } from './warning'
-export interface InjectionKey<T> extends Symbol {}
+interface InjectionConstraint<T> {}
+
+export type InjectionKey<T> = symbol & InjectionConstraint<T>
export function provide<T, K = InjectionKey<T> | string | number>(
key: K,