index.d.ts 1.2 KB

1234567891011121314151617181920212223242526272829
  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. setView: (value: Record<string, any>, callback?: () => void) => void;
  8. }
  9. export type VantComponentOptions<Data extends WechatMiniprogram.Component.DataOption, Props extends WechatMiniprogram.Component.PropertyOption, Methods extends WechatMiniprogram.Component.MethodOption> = {
  10. data?: Data;
  11. field?: boolean;
  12. classes?: string[];
  13. mixins?: string[];
  14. props?: Props;
  15. relation?: {
  16. relations: Record<string, WechatMiniprogram.Component.RelationOption>;
  17. mixin: string;
  18. };
  19. watch?: Record<string, (...args: any[]) => any>;
  20. methods?: Methods;
  21. beforeCreate?: () => void;
  22. created?: () => void;
  23. mounted?: () => void;
  24. destroyed?: () => void;
  25. } & ThisType<VantComponentInstance & WechatMiniprogram.Component.Instance<Data & {
  26. name: string;
  27. value: any;
  28. } & Record<string, any>, Props, Methods> & Record<string, any>>;
  29. export {};