index.d.ts 994 B

1234567891011121314151617181920212223
  1. /// <reference types="@dcloudio/types" />
  2. /**
  3. * 查询 fields 信息
  4. * @param selector
  5. * @param componentThis
  6. * @param options
  7. * @returns
  8. */
  9. export declare const queryFields: (selector: string, componentThis?: any, options?: UniApp.NodeField | undefined) => Promise<UniApp.NodeInfo>;
  10. declare type UniPlatforms = 'app-plus' | 'app-plus-nvue' | 'h5' | 'mp-weixin' | 'mp-alipay' | 'mp-baidu' | 'mp-toutiao' | 'mp-qq' | 'mp-360' | 'mp' | 'quickapp-webview' | 'quickapp-webview-union' | 'quickapp-webview-huawei' | undefined;
  11. /**
  12. * 当前环境信息
  13. */
  14. export declare const UNI_PLATFORM: UniPlatforms;
  15. declare type UniApiKey = keyof UniApp.Uni;
  16. declare type UniApiValue = UniApp.Uni[UniApiKey];
  17. declare type GetSuccessReult<T extends UniApiValue> = Parameters<Parameters<T>[0]['success']>[0];
  18. /**
  19. * 将 Uni | wx 转换为异步 Api
  20. * @param api api
  21. */
  22. export declare const promisify: <V extends UniApiValue>(api: V) => (...args: Parameters<V>) => Promise<GetSuccessReult<V>>;
  23. export {};