index.d.ts 972 B

12345678910111213141516171819202122232425262728
  1. /// <reference types="miniprogram-api-typings" />
  2. import { Weapp } from './weapp';
  3. declare type RecordToAny<T> = {
  4. [K in keyof T]: any;
  5. };
  6. export declare type CombinedComponentInstance<Data, Props, Methods> = Methods & WechatMiniprogram.Component.TrivialInstance & Weapp.FormField & {
  7. data: Data & RecordToAny<Props>;
  8. };
  9. export interface VantComponentOptions<Data, Props, Methods, Instance> {
  10. data?: Data;
  11. field?: boolean;
  12. classes?: string[];
  13. mixins?: string[];
  14. props?: Props & Weapp.PropertyOption;
  15. watch?: Weapp.WatchOption<Instance>;
  16. relation?: Weapp.RelationOption<Instance> & {
  17. name: string;
  18. };
  19. relations?: {
  20. [componentName: string]: Weapp.RelationOption<Instance>;
  21. };
  22. methods?: Methods & Weapp.MethodOption<Instance>;
  23. beforeCreate?: (this: Instance) => void;
  24. created?: (this: Instance) => void;
  25. mounted?: (this: Instance) => void;
  26. destroyed?: (this: Instance) => void;
  27. }
  28. export {};