useParent.d.ts 552 B

123456789101112131415
  1. import { InjectionKey, ComponentPublicInstance, ComponentInternalInstance } from 'vue';
  2. declare type ParentProvide<T> = T & {
  3. link(child: ComponentInternalInstance): void;
  4. unlink(child: ComponentInternalInstance): void;
  5. children: ComponentPublicInstance[];
  6. internalChildren: ComponentInternalInstance[];
  7. };
  8. export declare function useParent<T>(key: InjectionKey<ParentProvide<T>>): {
  9. parent: ParentProvide<T>;
  10. index: import("vue").ComputedRef<number>;
  11. } | {
  12. parent: null;
  13. index: import("vue").Ref<number>;
  14. };
  15. export {};