utils.d.ts 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. export declare const isNumber: (value: any) => boolean;
  15. export declare const isNull: (value: any) => boolean;
  16. export declare const isUndefined: (value: any) => boolean;
  17. export declare const isDef: (value: any) => boolean;
  18. export declare const isIOS: () => boolean;
  19. export declare const addUnit: (value?: string | number) => string | undefined;
  20. export declare const getCharacterLength: (type: string, char: string | number, max?: number) => {
  21. length: number;
  22. characters: string;
  23. };
  24. export declare const chunk: (arr: any[], size: number) => any[][];
  25. export declare const getInstance: (context?: Context, selector?: string) => WechatMiniprogram.Component.TrivialInstance;
  26. export declare const unitConvert: (value: number | string | null | undefined) => number;
  27. export declare const setIcon: (iconName: any, icon: any, defaultIcon: any) => {
  28. [x: string]: any;
  29. };
  30. export declare const isBool: (val: any) => boolean;
  31. export declare const isObject: (val: any) => boolean;
  32. export declare const isString: (val: any) => boolean;
  33. export declare const toCamel: (str: any) => any;
  34. 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;
  35. export declare const uniqueFactory: (compName: any) => () => string;
  36. export declare const calcIcon: (icon: string | Record<string, any>, defaultIcon?: string) => string | Record<string, any>;
  37. export declare const isOverSize: (size: any, sizeLimit: any) => boolean;
  38. export declare const rpx2px: (rpx: any) => number;
  39. export declare const nextTick: () => Promise<void>;
  40. export {};