utils.d.ts 1.4KB

1234567891011121314
  1. /// <reference types="miniprogram-api-typings" />
  2. export { isDef } from './validator';
  3. export declare function range(num: number, min: number, max: number): number;
  4. export declare function nextTick(cb: (...args: any[]) => void): void;
  5. export declare function getSystemInfoSync(): WechatMiniprogram.SystemInfo;
  6. export declare function addUnit(value?: string | number): string | undefined;
  7. export declare function requestAnimationFrame(cb: () => void): number | WechatMiniprogram.NodesRef;
  8. export declare function pickExclude(obj: unknown, keys: string[]): {};
  9. export declare function getRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise<WechatMiniprogram.BoundingClientRectCallbackResult>;
  10. export declare function getAllRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise<WechatMiniprogram.BoundingClientRectCallbackResult[]>;
  11. export declare function groupSetData(context: WechatMiniprogram.Component.TrivialInstance, cb: () => void): void;
  12. export declare function toPromise(promiseLike: Promise<unknown> | unknown): Promise<unknown>;
  13. 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;