index.d.ts 957 B

12345678910111213141516171819202122232425262728293031
  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 &
  7. WechatMiniprogram.Component.TrivialInstance &
  8. Weapp.FormField & {
  9. data: Data & RecordToAny<Props>;
  10. };
  11. export interface VantComponentOptions<Data, Props, Methods, Instance> {
  12. data?: Data;
  13. field?: boolean;
  14. classes?: string[];
  15. mixins?: string[];
  16. props?: Props & Weapp.PropertyOption;
  17. relation?: Weapp.RelationOption<Instance> & {
  18. type: 'ancestor' | 'descendant';
  19. name: string;
  20. current: string;
  21. };
  22. relations?: {
  23. [componentName: string]: Weapp.RelationOption<Instance>;
  24. };
  25. methods?: Methods & Weapp.MethodOption<Instance>;
  26. beforeCreate?: (this: Instance) => void;
  27. created?: (this: Instance) => void;
  28. mounted?: (this: Instance) => void;
  29. destroyed?: (this: Instance) => void;
  30. }
  31. export {};