index.d.ts 1.1 KB

12345678910111213141516171819202122232425262728
  1. /// <reference types="miniprogram-api-typings" />
  2. interface VantComponentInstance {
  3. parent: WechatMiniprogram.Component.TrivialInstance;
  4. children: WechatMiniprogram.Component.TrivialInstance[];
  5. index: number;
  6. $emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void;
  7. }
  8. export type VantComponentOptions<Data extends WechatMiniprogram.Component.DataOption, Props extends WechatMiniprogram.Component.PropertyOption, Methods extends WechatMiniprogram.Component.MethodOption> = {
  9. data?: Data;
  10. field?: boolean;
  11. classes?: string[];
  12. mixins?: string[];
  13. props?: Props;
  14. relation?: {
  15. relations: Record<string, WechatMiniprogram.Component.RelationOption>;
  16. mixin: string;
  17. };
  18. watch?: Record<string, (...args: any[]) => any>;
  19. methods?: Methods;
  20. beforeCreate?: () => void;
  21. created?: () => void;
  22. mounted?: () => void;
  23. destroyed?: () => void;
  24. } & ThisType<VantComponentInstance & WechatMiniprogram.Component.Instance<Data & {
  25. name: string;
  26. value: any;
  27. } & Record<string, any>, Props, Methods> & Record<string, any>>;
  28. export {};