utils.d.ts 1.2 KB

12345678910111213141516171819
  1. /// <reference types="miniprogram-api-typings" />
  2. /// <reference types="miniprogram-api-typings" />
  3. declare type Context = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
  4. export declare const debounce: (func: any, wait?: number) => (...rest: any[]) => void;
  5. export declare const classNames: (...args: any[]) => string;
  6. export declare const styles: (styleObj: any) => string;
  7. export declare const getAnimationFrame: (cb: Function) => WechatMiniprogram.NodesRef;
  8. export declare const getRect: (context: any, selector: string) => Promise<WechatMiniprogram.BoundingClientRectCallbackResult>;
  9. export declare const isNumber: (value: any) => boolean;
  10. export declare const addUnit: (value?: string | number) => string | undefined;
  11. export declare const getCharacterLength: (type: string, str: string, max?: number) => {
  12. length: number;
  13. characters: string;
  14. };
  15. export declare const chunk: (arr: any[], size: number) => any[][];
  16. export declare const equal: (v1: any, v2: any) => any;
  17. export declare const clone: (val: any) => any;
  18. export declare const getInstance: (context?: Context, selector?: string) => WechatMiniprogram.Component.TrivialInstance;
  19. export {};