diff --git a/packages/runtime-core/src/helpers/useOptions.ts b/packages/runtime-core/src/helpers/useOptions.ts index 172b2aaad..055f28078 100644 --- a/packages/runtime-core/src/helpers/useOptions.ts +++ b/packages/runtime-core/src/helpers/useOptions.ts @@ -1,22 +1,88 @@ +import { EmitFn, EmitsOptions } from '../componentEmits' +import { + ComponentObjectPropsOptions, + ExtractPropTypes +} from '../componentProps' import { Slots } from '../componentSlots' +import { Directive } from '../directives' import { warn } from '../warning' interface DefaultContext { - props: Record + props: {} attrs: Record emit: (...args: any[]) => void slots: Slots } +interface InferredContext { + props: Readonly

+ attrs: Record + emit: EmitFn + slots: Slots +} + +type InferContext, P, E> = { + [K in keyof DefaultContext]: T[K] extends {} ? T[K] : InferredContext[K] +} + +/** + * This is a subset of full options that are still useful in the context of + *