utils.d.ts 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /// <reference types="miniprogram-api-typings" />
  2. /// <reference types="miniprogram-api-typings" />
  3. /// <reference types="miniprogram-api-typings" />
  4. export declare const systemInfo: WechatMiniprogram.WindowInfo | WechatMiniprogram.SystemInfo;
  5. export declare const appBaseInfo: WechatMiniprogram.AppBaseInfo | WechatMiniprogram.SystemInfo;
  6. export declare const deviceInfo: WechatMiniprogram.DeviceInfo | WechatMiniprogram.SystemInfo;
  7. declare type Context = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
  8. export declare const debounce: (func: any, wait?: number) => (...rest: any[]) => void;
  9. export declare const throttle: (func: any, wait?: number, options?: any) => (...args: any[]) => void;
  10. export declare const classNames: (...args: any[]) => string;
  11. export declare const styles: (styleObj: any) => string;
  12. export declare const getAnimationFrame: (context: any, cb: Function) => any;
  13. export declare const getRect: (context: any, selector: string, needAll?: boolean) => Promise<any>;
  14. interface TreeNode {
  15. children?: TreeNode[];
  16. [key: string]: any;
  17. }
  18. export declare const getTreeDepth: (tree: TreeNode[], key?: string) => any;
  19. export declare const isIOS: () => boolean;
  20. export declare const addUnit: (value?: string | number) => string | undefined;
  21. export declare const getCharacterLength: (type: string, char: string | number, max?: number) => {
  22. length: number;
  23. characters: string;
  24. };
  25. export declare const chunk: (arr: any[], size: number) => any[][];
  26. export declare const getInstance: (context?: Context, selector?: string) => WechatMiniprogram.Component.TrivialInstance;
  27. export declare const unitConvert: (value: number | string | null | undefined) => number;
  28. export declare const setIcon: (iconName: any, icon: any, defaultIcon: any) => {
  29. [x: string]: any;
  30. };
  31. export declare const toCamel: (str: any) => any;
  32. export declare const getCurrentPage: <T>() => T & WechatMiniprogram.OptionalInterface<WechatMiniprogram.Page.ILifetime> & WechatMiniprogram.Page.InstanceProperties & WechatMiniprogram.Page.InstanceMethods<WechatMiniprogram.IAnyObject> & WechatMiniprogram.Page.Data<WechatMiniprogram.IAnyObject> & WechatMiniprogram.IAnyObject;
  33. export declare const uniqueFactory: (compName: any) => () => string;
  34. export declare const calcIcon: (icon: string | Record<string, any>, defaultIcon?: string) => Record<string, any>;
  35. export declare const isOverSize: (size: any, sizeLimit: any) => boolean;
  36. export declare const rpx2px: (rpx: any) => number;
  37. export declare const nextTick: () => Promise<void>;
  38. export {};