index.d.ts 997 B

1234567891011121314151617181920212223242526272829
  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. relation?: Weapp.RelationOption<Instance> & {
  16. type: 'ancestor' | 'descendant';
  17. name: string;
  18. current: string;
  19. };
  20. relations?: {
  21. [componentName: string]: Weapp.RelationOption<Instance>;
  22. };
  23. methods?: Methods & Weapp.MethodOption<Instance>;
  24. beforeCreate?: (this: Instance) => void;
  25. created?: (this: Instance) => void;
  26. mounted?: (this: Instance) => void;
  27. destroyed?: (this: Instance) => void;
  28. }
  29. export {};