utils.d.ts 1.0 KB

12345678910111213141516171819202122
  1. /// <reference types="miniprogram-api-typings" />
  2. export declare function isDef(value: any): boolean
  3. export declare function isObj(x: any): boolean
  4. export declare function range(num: number, min: number, max: number): number
  5. export declare function nextTick(fn: Function): void
  6. export declare function getSystemInfoSync(): WechatMiniprogram.GetSystemInfoSyncResult
  7. export declare function addUnit(value?: string | number): string | undefined
  8. export declare function requestAnimationFrame(
  9. cb: Function
  10. ): void | WechatMiniprogram.NodesRef
  11. export declare function pickExclude(obj: unknown, keys: string[]): {}
  12. export declare function getRect(
  13. this: WechatMiniprogram.Component.TrivialInstance,
  14. selector: string
  15. ): Promise<WechatMiniprogram.BoundingClientRectCallbackResult>
  16. export declare function getAllRect(
  17. this: WechatMiniprogram.Component.TrivialInstance,
  18. selector: string
  19. ): Promise<WechatMiniprogram.BoundingClientRectCallbackResult[]>
  20. export declare function toPromise(
  21. promiseLike: Promise<unknown> | unknown
  22. ): Promise<unknown>