uni-app.d.ts 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /// <reference types="@dcloudio/types" />
  2. import { capitalize } from '@vue/shared';
  3. import type { ComponentInternalInstance } from '@vue/runtime-core';
  4. import { extend } from '@vue/shared';
  5. import { hasOwn } from '@vue/shared';
  6. import { isPlainObject } from '@vue/shared';
  7. import { ref } from 'vue';
  8. import { shallowRef } from 'vue';
  9. import type { Slots } from 'vue';
  10. export { capitalize }
  11. export { extend }
  12. export declare function formatAppLog(type: 'log' | 'info' | 'debug' | 'warn' | 'error', filename: string, ...args: unknown[]): void;
  13. export declare function formatH5Log(type: keyof Console, filename: string, ...args: unknown[]): void;
  14. /**
  15. * uni 对象是跨实例的,而此处列的 API 均是需要跟当前实例关联的,比如 requireNativePlugin 获取 dom 时,依赖当前 weex 实例
  16. */
  17. /// <reference types="@dcloudio/types" />
  18. export declare function getCurrentSubNVue(): UniApp.SubNVue;
  19. export declare function getSsrGlobalData(): any;
  20. export { hasOwn }
  21. export { isPlainObject }
  22. declare interface NavigationBarSearchInputFocusChanged {
  23. focus: boolean;
  24. }
  25. export declare const onAddToFavorites: (hook: (options: Page.AddToFavoritesOption) => Page.CustomFavoritesContent, target?: ComponentInternalInstance | null) => void;
  26. export declare const onBackPress: (hook: (options: Page.BackPressOption) => any, target?: ComponentInternalInstance | null) => void;
  27. export declare const onError: (hook: (error: string) => void, target?: ComponentInternalInstance | null) => void;
  28. export declare const onExit: (hook: () => void, target?: ComponentInternalInstance | null) => void;
  29. export declare const onHide: (hook: () => any, target?: ComponentInternalInstance | null) => void;
  30. export declare const onInit: (hook: (query?: AnyObject | undefined) => void, target?: ComponentInternalInstance | null) => void;
  31. export declare const onLaunch: (hook: (options?: App.LaunchShowOption | undefined) => void, target?: ComponentInternalInstance | null) => void;
  32. export declare const onLoad: (hook: (query?: AnyObject | undefined) => void, target?: ComponentInternalInstance | null) => void;
  33. export declare const onNavigationBarButtonTap: (hook: (options: Page.NavigationBarButtonTapOption) => void, target?: ComponentInternalInstance | null) => void;
  34. export declare const onNavigationBarSearchInputChanged: (hook: (event: Page.NavigationBarSearchInputEvent) => void, target?: ComponentInternalInstance | null) => void;
  35. export declare const onNavigationBarSearchInputClicked: (hook: () => any, target?: ComponentInternalInstance | null) => void;
  36. export declare const onNavigationBarSearchInputConfirmed: (hook: (event: Page.NavigationBarSearchInputEvent) => void, target?: ComponentInternalInstance | null) => void;
  37. export declare const onNavigationBarSearchInputFocusChanged: (hook: onNavigationBarSearchInputFocusChangedHook, target?: ComponentInternalInstance | null) => void;
  38. declare type onNavigationBarSearchInputFocusChangedHook = (options: NavigationBarSearchInputFocusChanged) => void;
  39. export declare const onPageHide: (hook: () => any, target?: ComponentInternalInstance | null) => void;
  40. export declare const onPageNotFound: (hook: (options: App.PageNotFoundOption) => void, target?: ComponentInternalInstance | null) => void;
  41. export declare const onPageScroll: (hook: (options: Page.PageScrollOption) => void, target?: ComponentInternalInstance | null) => void;
  42. export declare const onPageShow: (hook: ((options?: App.LaunchShowOption | undefined) => void) | (() => void), target?: ComponentInternalInstance | null) => void;
  43. export declare const onPullDownRefresh: (hook: () => any, target?: ComponentInternalInstance | null) => void;
  44. export declare const onReachBottom: (hook: () => any, target?: ComponentInternalInstance | null) => void;
  45. export declare const onReady: (hook: () => any, target?: ComponentInternalInstance | null) => void;
  46. export declare const onResize: (hook: (options: Page.ResizeOption) => void, target?: ComponentInternalInstance | null) => void;
  47. export declare const onSaveExitState: (hook: onSaveExitStateHook, target?: ComponentInternalInstance | null) => void;
  48. declare type onSaveExitStateHook = () => SaveExitState;
  49. export declare const onShareAppMessage: (hook: (options: Page.ShareAppMessageOption) => Page.CustomShareContent | Promise<Omit<Page.CustomShareContent, "promise">>, target?: ComponentInternalInstance | null) => void;
  50. export declare const onShareTimeline: (hook: () => Page.ShareTimelineContent, target?: ComponentInternalInstance | null) => void;
  51. export declare const onShow: (hook: ((options?: App.LaunchShowOption | undefined) => void) | (() => void), target?: ComponentInternalInstance | null) => void;
  52. export declare const onTabItemTap: (hook: (options: Page.TabItemTapOption) => void, target?: ComponentInternalInstance | null) => void;
  53. export declare const onThemeChange: (hook: (options: UniApp.OnThemeChangeCallbackResult) => void, target?: ComponentInternalInstance | null) => void;
  54. export declare const onUnhandledRejection: (hook: (options: UniApp.OnUnhandledRejectionCallbackResult) => void, target?: ComponentInternalInstance | null) => void;
  55. export declare const onUnload: (hook: () => any, target?: ComponentInternalInstance | null) => void;
  56. export declare function renderComponentSlot(slots: Slots, name: string, props?: any | null): any | null;
  57. export declare function requireNativePlugin(name: string): any;
  58. export declare function resolveEasycom(component: unknown, easycom: unknown): unknown;
  59. declare interface SaveExitState {
  60. data: any;
  61. expireTimeStamp: number;
  62. }
  63. export declare const shallowSsrRef: SSRRef;
  64. declare type SSRRef = (value: unknown, key?: string, shallow?: boolean) => ReturnType<typeof ref> | ReturnType<typeof shallowRef>;
  65. export declare const ssrRef: SSRRef;
  66. export { }