utils.d.ts 848 B

12345678910111213141516
  1. export declare const debounce: (func: any, wait?: number) => (...rest: any[]) => void;
  2. export declare const classNames: (...args: any[]) => string;
  3. export declare const styles: (styleObj: any) => string;
  4. export declare const requestAnimationFrame: (cb: Function) => WechatMiniprogram.NodesRef;
  5. export declare const isNumber: (value: any) => boolean;
  6. export declare const addUnit: (value?: string | number) => string | undefined;
  7. /**
  8. * 计算字符串字符的长度并可以截取字符串。
  9. * @param str 传入字符串
  10. * @param maxCharacter 规定最大字符串长度
  11. * @returns 当没有传入maxCharacter时返回字符串字符长度,当传入maxCharacter时返回截取之后的字符串和长度。
  12. */
  13. export declare const getCharacterLength: (str: string, maxCharacter?: number) => {
  14. length: number;
  15. characters: string;
  16. };