utils.d.ts 1.7 KB

123456789101112131415161718192021
  1. /// <reference types="node" />
  2. /// <reference types="miniprogram-api-typings" />
  3. /// <reference types="miniprogram-api-typings" />
  4. /// <reference types="miniprogram-api-typings" />
  5. /// <reference types="miniprogram-api-typings" />
  6. export { isDef } from './validator';
  7. export { getSystemInfoSync } from './version';
  8. export declare function range(num: number, min: number, max: number): number;
  9. export declare function nextTick(cb: (...args: any[]) => void): void;
  10. export declare function addUnit(value?: string | number): string | undefined;
  11. export declare function requestAnimationFrame(cb: () => void): NodeJS.Timeout;
  12. export declare function pickExclude(obj: unknown, keys: string[]): {};
  13. export declare function getRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise<WechatMiniprogram.BoundingClientRectCallbackResult>;
  14. export declare function getAllRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise<WechatMiniprogram.BoundingClientRectCallbackResult[]>;
  15. export declare function groupSetData(context: WechatMiniprogram.Component.TrivialInstance, cb: () => void): void;
  16. export declare function toPromise(promiseLike: Promise<unknown> | unknown): Promise<unknown>;
  17. export declare function addNumber(num1: any, num2: any): number;
  18. export declare const clamp: (num: any, min: any, max: any) => number;
  19. export declare function getCurrentPage<T>(): T & WechatMiniprogram.OptionalInterface<WechatMiniprogram.Page.ILifetime> & WechatMiniprogram.Page.InstanceProperties & WechatMiniprogram.Page.InstanceMethods<WechatMiniprogram.IAnyObject> & WechatMiniprogram.Page.Data<WechatMiniprogram.IAnyObject> & WechatMiniprogram.IAnyObject;
  20. export declare const isPC: boolean;
  21. export declare const isWxWork: boolean;