uni-shared.d.ts 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900
  1. import type { App } from 'vue';
  2. import type { ComponentInternalInstance } from '@vue/runtime-core';
  3. import { ComponentOptionsBase } from '@vue/runtime-core';
  4. import { ComponentOptionsBase as ComponentOptionsBase_2 } from 'vue';
  5. import type { ComponentPublicInstance } from '@vue/runtime-core';
  6. import { ComponentPublicInstance as ComponentPublicInstance_2 } from 'vue';
  7. import { createApp } from 'vue';
  8. import type { NormalizedStyle } from '@vue/shared';
  9. import type { RendererNode } from '@vue/runtime-core';
  10. export declare const ACTION_TYPE_ADD_EVENT = 8;
  11. export declare const ACTION_TYPE_ADD_WXS_EVENT = 12;
  12. export declare const ACTION_TYPE_CREATE = 3;
  13. export declare const ACTION_TYPE_EVENT = 20;
  14. export declare const ACTION_TYPE_INSERT = 4;
  15. export declare const ACTION_TYPE_PAGE_CREATE = 1;
  16. export declare const ACTION_TYPE_PAGE_CREATED = 2;
  17. export declare const ACTION_TYPE_PAGE_SCROLL = 15;
  18. export declare const ACTION_TYPE_REMOVE = 5;
  19. export declare const ACTION_TYPE_REMOVE_ATTRIBUTE = 7;
  20. export declare const ACTION_TYPE_REMOVE_EVENT = 9;
  21. export declare const ACTION_TYPE_SET_ATTRIBUTE = 6;
  22. export declare const ACTION_TYPE_SET_TEXT = 10;
  23. /**
  24. * nodeId
  25. * event
  26. * flag
  27. */
  28. export declare type AddEventAction = [
  29. typeof ACTION_TYPE_ADD_EVENT,
  30. number,
  31. string | number,
  32. number
  33. ];
  34. export declare function addFont(family: string, source: string, desc?: FontFaceDescriptors): Promise<void>;
  35. export declare function addLeadingSlash(str: string): string;
  36. /**
  37. * nodeId
  38. * event
  39. * wxsEvent
  40. * flag
  41. */
  42. export declare type AddWxsEventAction = [
  43. typeof ACTION_TYPE_ADD_WXS_EVENT,
  44. number,
  45. string | number,
  46. string | number,
  47. number
  48. ];
  49. export declare const ATTR_CHANGE_PREFIX = "change:";
  50. export declare const ATTR_CLASS = "class";
  51. export declare const ATTR_INNER_HTML = "innerHTML";
  52. export declare const ATTR_STYLE = "style";
  53. export declare const ATTR_TEXT_CONTENT = "textContent";
  54. export declare const ATTR_V_OWNER_ID = ".vOwnerId";
  55. export declare const ATTR_V_RENDERJS = ".vRenderjs";
  56. export declare const ATTR_V_SHOW = ".vShow";
  57. export declare const BACKGROUND_COLOR = "#f7f7f7";
  58. export declare const borderStyles: {
  59. black: string;
  60. white: string;
  61. };
  62. export declare const BUILT_IN_TAG_NAMES: string[];
  63. export declare const BUILT_IN_TAGS: string[];
  64. export declare function cache<T>(fn: (str: string) => T): (str: string) => T;
  65. export declare function cacheStringFunction(fn: (string: string) => string): (str: string) => string;
  66. export declare function callOptions(options: Options, errMsg: string): void;
  67. export declare function callOptions(options: Options, data: {
  68. [key: string]: any;
  69. errMsg: string;
  70. }): void;
  71. export declare const COMPONENT_NAME_PREFIX = "VUni";
  72. export declare const COMPONENT_PREFIX: string;
  73. export declare const COMPONENT_SELECTOR_PREFIX = "uni-";
  74. /**
  75. * nodeId
  76. * tag
  77. * parentNodeId
  78. * refNodeId
  79. * nodeJson
  80. */
  81. export declare type CreateAction = [
  82. typeof ACTION_TYPE_CREATE,
  83. number,
  84. string | number,
  85. number,
  86. number,
  87. Partial<UniNodeJSON | UniNodeJSONMinify>?
  88. ];
  89. export declare function createIsCustomElement(tags?: string[]): (tag: string) => boolean;
  90. export declare function createRpx2Unit(unit: string, unitRatio: number, unitPrecision: number): (val: string) => string;
  91. export declare function createUniEvent(evt: Record<string, any>): UniEvent;
  92. declare type CreateVueAppHook = (app: App) => void;
  93. export declare function customizeEvent(str: string): string;
  94. export declare const DATA_RE: RegExp;
  95. /**
  96. * 需要手动传入 timer,主要是解决 App 平台的定制 timer
  97. */
  98. export declare function debounce(fn: Function, delay: number, { clearTimeout, setTimeout }: Timer): {
  99. (this: any): void;
  100. cancel(): void;
  101. };
  102. /**
  103. * Decode text using `decodeURIComponent`. Returns the original text if it
  104. * fails.
  105. *
  106. * @param text - string to decode
  107. * @returns decoded string
  108. */
  109. export declare function decode(text: string | number): string;
  110. export declare function decodedQuery(query?: Record<string, any>): Record<string, string>;
  111. export declare const defaultMiniProgramRpx2Unit: {
  112. unit: string;
  113. unitRatio: number;
  114. unitPrecision: number;
  115. };
  116. export declare const defaultNVueRpx2Unit: {
  117. unit: string;
  118. unitRatio: number;
  119. unitPrecision: number;
  120. };
  121. export declare const defaultRpx2Unit: {
  122. unit: string;
  123. unitRatio: number;
  124. unitPrecision: number;
  125. };
  126. declare type DictArray = [number, number][];
  127. export declare function dynamicSlotName(name: string): string;
  128. export declare interface Emitter {
  129. e: Record<string, unknown>;
  130. on: (name: EventName, callback: EventCallback, ctx?: any) => this;
  131. once: (name: EventName, callback: EventCallback, ctx?: any) => this;
  132. emit: (name: EventName, ...args: any[]) => this;
  133. off: (name: EventName, callback?: EventCallback) => this;
  134. }
  135. export declare const Emitter: new () => Emitter;
  136. declare type EventCallback = Function;
  137. export declare class EventChannel {
  138. id?: number;
  139. private listener;
  140. private emitCache;
  141. constructor(id?: number, events?: NavigateToOptionEvents);
  142. emit(eventName: string, ...args: any[]): number | undefined;
  143. on(eventName: string, fn: EventChannelListener['fn']): void;
  144. once(eventName: string, fn: EventChannelListener['fn']): void;
  145. off(eventName: string, fn: EventChannelListener['fn']): void;
  146. _clearCache(eventName?: string): void;
  147. _addListener(eventName: string, type: EventChannelListener['type'], fn: EventChannelListener['fn']): void;
  148. }
  149. declare interface EventChannelListener {
  150. type: 'on' | 'once';
  151. fn: (...args: any[]) => void;
  152. }
  153. export declare const EventModifierFlags: {
  154. stop: number;
  155. prevent: number;
  156. self: number;
  157. };
  158. declare type EventName = string;
  159. export declare const forcePatchProp: (el: {
  160. nodeName: string;
  161. }, key: string) => boolean;
  162. export declare function formatDateTime({ date, mode }: {
  163. date?: Date | undefined;
  164. mode?: string | undefined;
  165. }): string;
  166. export declare function formatLog(module: string, ...args: any[]): string;
  167. export declare function getCustomDataset(el: HTMLElement | HTMLElementWithDataset): DOMStringMap & Record<string, any>;
  168. export declare function getEnvLocale(): string;
  169. export declare function getLen(str?: string): number;
  170. export declare function getValueByDataPath(obj: any, path: string): unknown;
  171. declare interface HTMLElementWithDataset extends HTMLElement {
  172. __uniDataset?: Record<string, any>;
  173. }
  174. export declare const I18N_JSON_DELIMITERS: [string, string];
  175. export declare const initCustomDatasetOnce: () => void;
  176. /**
  177. * nodeId
  178. * parentNodeId
  179. * refNodeId
  180. * nodeJson
  181. */
  182. export declare type InsertAction = [
  183. typeof ACTION_TYPE_INSERT,
  184. number,
  185. number,
  186. number,
  187. Partial<UniNodeJSON | UniNodeJSONMinify>?
  188. ];
  189. export declare const invokeArrayFns: (fns: Function[], arg?: any) => any;
  190. export declare const invokeCreateErrorHandler: (app: App, createErrorHandler: (app: App) => App['config']['errorHandler']) => ((err: unknown, instance: ComponentPublicInstance_2< {}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase_2<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null, info: string) => void) | undefined;
  191. export declare function invokeCreateVueAppHook(app: App): void;
  192. export declare function isAppNativeTag(tag: string): boolean;
  193. export declare function isAppNVueNativeTag(tag: string): boolean;
  194. export declare function isAppUVueNativeTag(tag: string): boolean;
  195. export declare function isBuiltInComponent(tag: string): boolean;
  196. export declare function isComponentInternalInstance(vm: unknown): vm is ComponentInternalInstance;
  197. export declare function isComponentTag(tag: string): boolean;
  198. export declare function isH5CustomElement(tag: string, isX?: boolean): boolean;
  199. export declare function isH5NativeTag(tag: string): boolean;
  200. export declare function isMiniProgramNativeTag(tag: string): boolean;
  201. export declare function isRootHook(name: string): boolean;
  202. export declare function isRootImmediateHook(name: string): boolean;
  203. export declare function isUniLifecycleHook(name: string, value: unknown, checkType?: boolean): boolean;
  204. export declare function isUniXElement(name: string): boolean;
  205. export declare interface IUniPageNode {
  206. pageId: number;
  207. pageNode: IUniPageNode | null;
  208. isUnmounted: boolean;
  209. genId: () => number;
  210. push: (...args: any[]) => void;
  211. onCreate: (thisNode: UniNode, nodeName: string | number) => UniNode;
  212. onInsertBefore: (thisNode: UniNode, newChild: UniNode, refChild: UniNode | null) => UniNode;
  213. onRemoveChild: (oldChild: UniNode) => UniNode;
  214. onAddEvent: (thisNode: UniNode, name: string, flag: number) => void;
  215. onAddWxsEvent: (thisNode: UniNode, name: string, wxsEvent: string, flag: number) => void;
  216. onRemoveEvent: (thisNode: UniNode, name: string) => void;
  217. onSetAttribute: (thisNode: UniNode, qualifiedName: string, value: unknown) => void;
  218. onRemoveAttribute: (thisNode: UniNode, qualifiedName: string) => void;
  219. onTextContent: (thisNode: UniNode, text: string) => void;
  220. onNodeValue: (thisNode: UniNode, val: string | null) => void;
  221. }
  222. export declare const JSON_PROTOCOL = "json://";
  223. export declare const LINEFEED = "\n";
  224. export declare const MINI_PROGRAM_PAGE_RUNTIME_HOOKS: {
  225. readonly onPageScroll: 1;
  226. readonly onShareAppMessage: number;
  227. readonly onShareTimeline: number;
  228. };
  229. export declare const NAVBAR_HEIGHT = 44;
  230. declare type NavigateToOptionEvents = Record<string, (...args: any[]) => void>;
  231. export declare const NODE_TYPE_COMMENT = 8;
  232. export declare const NODE_TYPE_ELEMENT = 1;
  233. export declare const NODE_TYPE_PAGE = 0;
  234. export declare const NODE_TYPE_TEXT = 3;
  235. export declare function normalizeClass(value: unknown): string;
  236. export declare function normalizeDataset(el: Element): any;
  237. export declare function normalizeEventType(type: string, options?: AddEventListenerOptions): string;
  238. export declare function normalizeProps(props: Record<string, any> | null): Record<string, any> | null;
  239. export declare function normalizeStyle(value: unknown): NormalizedStyle | string | undefined;
  240. export declare function normalizeStyles<T extends Object>(pageStyle: T, themeConfig?: UniApp.ThemeJson, mode?: UniApp.ThemeMode): T;
  241. export declare function normalizeTabBarStyles(borderStyle?: string): string | undefined;
  242. export declare function normalizeTarget(el: HTMLElement): {
  243. id: string;
  244. dataset: DOMStringMap & Record<string, any>;
  245. offsetTop: number;
  246. offsetLeft: number;
  247. };
  248. export declare function normalizeTitleColor(titleColor: string): "#000000" | "#ffffff";
  249. export declare interface NVue {
  250. config: NVueConfigAPI;
  251. document: NVueDocument;
  252. requireModule: (name: string) => Record<string, unknown> | void;
  253. supports: (condition: string) => boolean | void;
  254. isRegisteredModule: (name: string, method?: string) => boolean;
  255. isRegisteredComponent: (name: string) => boolean;
  256. }
  257. export declare const NVUE_BUILT_IN_TAGS: string[];
  258. export declare const NVUE_U_BUILT_IN_TAGS: string[];
  259. export declare interface NVueConfigAPI {
  260. bundleUrl: string;
  261. bundleType: string;
  262. env: NVueEnvironment;
  263. }
  264. export declare interface NVueDocument {
  265. id: string;
  266. URL: string;
  267. taskCenter: NVueTaskCenter;
  268. open: () => void;
  269. close: () => void;
  270. createElement: (tagName: string, props?: Record<string, unknown>) => NVueElement;
  271. createText: (text: string) => Record<string, unknown>;
  272. createComment: (text: string) => Record<string, unknown>;
  273. fireEvent: (type: string) => void;
  274. destroy: () => void;
  275. }
  276. export declare interface NVueElement {
  277. nodeType: number;
  278. nodeId: string;
  279. type: string;
  280. ref: string;
  281. text?: string;
  282. attr: Record<string, unknown>;
  283. styleSheet: Record<string, Record<string, Record<string, unknown>>>;
  284. classList: string[];
  285. parentNode: NVueElement | null;
  286. children: Array<NVueElement>;
  287. previousSibling: NVueElement | null;
  288. nextSibling: NVueElement | null;
  289. appendChild: (node: NVueElement) => void;
  290. removeChild: (node: NVueElement, preserved?: boolean) => void;
  291. insertBefore: (node: NVueElement, before: NVueElement) => void;
  292. insertAfter: (node: NVueElement, after: NVueElement) => void;
  293. setAttr: (key: string, value: any, silent?: boolean) => void;
  294. setAttrs: (attrs: Record<string, unknown>, silent?: boolean) => void;
  295. setClassList: (classList: string[]) => void;
  296. setStyle: (key: string, value: any, silent?: boolean) => void;
  297. setStyles: (attrs: Record<string, unknown>, silent?: boolean) => void;
  298. setStyleSheet: (styleSheet: Record<string, Record<string, Record<string, unknown>>>) => void;
  299. addEvent: (type: string, handler: Function, args?: Array<any>) => void;
  300. removeEvent: (type: string) => void;
  301. fireEvent: (type: string) => void;
  302. destroy: () => void;
  303. }
  304. export declare interface NVueEnvironment {
  305. platform: string;
  306. osName: string;
  307. osVersion: string;
  308. appName: string;
  309. appVersion: string;
  310. deviceModel: string;
  311. deviceWidth: number;
  312. deviceHeight: number;
  313. scale: number;
  314. userAgent?: string;
  315. dpr?: number;
  316. rem?: number;
  317. }
  318. export declare interface NVueInstanceContext {
  319. Vue: Vue_2;
  320. }
  321. export declare interface NVueInstanceOption {
  322. instanceId: string;
  323. config: NVueConfigAPI;
  324. document?: NVueDocument;
  325. Vue?: Vue_2;
  326. app?: ComponentPublicInstance_2;
  327. data?: Record<string, unknown>;
  328. }
  329. export declare interface NVueRuntimeContext {
  330. nvue: NVue;
  331. service: Record<string, unknown>;
  332. BroadcastChannel?: Function;
  333. SharedObject: Record<string, unknown>;
  334. }
  335. export declare interface NVueTaskCenter {
  336. instanceId: string;
  337. callbackManager: unknown;
  338. send: (type: string, params: Record<string, unknown>, args: any[], options?: Record<string, unknown>) => void;
  339. registerHook: (componentId: string, type: string, hook: string, fn: Function) => void;
  340. updateData: (componentId: string, data: Record<string, unknown> | void, callback?: Function) => void;
  341. }
  342. export declare const OFF_THEME_CHANGE = "offThemeChange";
  343. export declare const ON_ADD_TO_FAVORITES = "onAddToFavorites";
  344. export declare const ON_APP_ENTER_BACKGROUND = "onAppEnterBackground";
  345. export declare const ON_APP_ENTER_FOREGROUND = "onAppEnterForeground";
  346. export declare const ON_BACK_PRESS = "onBackPress";
  347. export declare const ON_ERROR = "onError";
  348. export declare const ON_EXIT = "onExit";
  349. export declare const ON_HIDE = "onHide";
  350. export declare const ON_INIT = "onInit";
  351. export declare const ON_KEYBOARD_HEIGHT_CHANGE = "onKeyboardHeightChange";
  352. export declare const ON_LAUNCH = "onLaunch";
  353. export declare const ON_LOAD = "onLoad";
  354. export declare const ON_NAVIGATION_BAR_BUTTON_TAP = "onNavigationBarButtonTap";
  355. export declare const ON_NAVIGATION_BAR_CHANGE = "onNavigationBarChange";
  356. export declare const ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED = "onNavigationBarSearchInputChanged";
  357. export declare const ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED = "onNavigationBarSearchInputClicked";
  358. export declare const ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED = "onNavigationBarSearchInputConfirmed";
  359. export declare const ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED = "onNavigationBarSearchInputFocusChanged";
  360. export declare const ON_PAGE_NOT_FOUND = "onPageNotFound";
  361. export declare const ON_PAGE_SCROLL = "onPageScroll";
  362. export declare const ON_PULL_DOWN_REFRESH = "onPullDownRefresh";
  363. export declare const ON_REACH_BOTTOM = "onReachBottom";
  364. export declare const ON_REACH_BOTTOM_DISTANCE = 50;
  365. export declare const ON_READY = "onReady";
  366. export declare const ON_RESIZE = "onResize";
  367. export declare const ON_SAVE_EXIT_STATE = "onSaveExitState";
  368. export declare const ON_SHARE_APP_MESSAGE = "onShareAppMessage";
  369. export declare const ON_SHARE_TIMELINE = "onShareTimeline";
  370. export declare const ON_SHOW = "onShow";
  371. export declare const ON_TAB_ITEM_TAP = "onTabItemTap";
  372. export declare const ON_THEME_CHANGE = "onThemeChange";
  373. export declare const ON_UNHANDLE_REJECTION = "onUnhandledRejection";
  374. export declare const ON_UNLOAD = "onUnload";
  375. export declare const ON_WEB_INVOKE_APP_SERVICE = "onWebInvokeAppService";
  376. export declare const ON_WXS_INVOKE_CALL_METHOD = "onWxsInvokeCallMethod";
  377. export declare function once<T extends (...args: any[]) => any>(fn: T, ctx?: unknown): T;
  378. /**
  379. * 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
  380. */
  381. export declare function onCreateVueApp(hook: CreateVueAppHook): void;
  382. declare interface Options {
  383. success?: (res: any) => void;
  384. fail?: (res: any) => void;
  385. complete?: (res: any) => void;
  386. }
  387. export declare type PageAction = PageCreateAction | PageCreatedAction | PageUpdateAction | PageScrollAction;
  388. export declare type PageCreateAction = [typeof ACTION_TYPE_PAGE_CREATE, PageCreateData];
  389. export declare type PageCreatedAction = [typeof ACTION_TYPE_PAGE_CREATED];
  390. export declare interface PageCreateData extends PageNodeOptions {
  391. }
  392. export declare interface PageNodeOptions {
  393. css: boolean;
  394. route: string;
  395. version: number;
  396. locale: string;
  397. platform: string;
  398. pixelRatio: number;
  399. windowWidth: number;
  400. disableScroll: boolean;
  401. onPageScroll: boolean;
  402. onPageReachBottom: boolean;
  403. onReachBottomDistance: number;
  404. statusbarHeight: number;
  405. windowTop: number;
  406. windowBottom: number;
  407. }
  408. /**
  409. * onReachBottomDistance
  410. */
  411. export declare type PageScrollAction = [typeof ACTION_TYPE_PAGE_SCROLL, number];
  412. export declare type PageUpdateAction = CreateAction | InsertAction | RemoveAction | AddEventAction | AddWxsEventAction | RemoveEventAction | SetAttributeAction | RemoveAttributeAction | SetTextAction;
  413. export declare function parseEventName(name: string): [string, EventListenerOptions | undefined];
  414. export declare function parseNVueDataset(attr?: Record<string, unknown>): Record<string, unknown>;
  415. /**
  416. * https://github.com/vuejs/vue-router-next/blob/master/src/query.ts
  417. * @internal
  418. *
  419. * @param search - search string to parse
  420. * @returns a query object
  421. */
  422. export declare function parseQuery(search: string): Record<string, any>;
  423. export declare function parseUrl(url: string): {
  424. path: string;
  425. query: Record<string, any>;
  426. };
  427. export declare function passive(passive: boolean): {
  428. passive: boolean;
  429. };
  430. export declare const PLUS_RE: RegExp;
  431. export declare function plusReady(callback: () => void): void;
  432. export declare const PRIMARY_COLOR = "#007aff";
  433. /**
  434. * nodeId
  435. */
  436. export declare type RemoveAction = [typeof ACTION_TYPE_REMOVE, number];
  437. /**
  438. * nodeId
  439. * name
  440. */
  441. export declare type RemoveAttributeAction = [
  442. typeof ACTION_TYPE_REMOVE_ATTRIBUTE,
  443. number,
  444. string | number
  445. ];
  446. /**
  447. * nodeId
  448. * event
  449. */
  450. export declare type RemoveEventAction = [
  451. typeof ACTION_TYPE_REMOVE_EVENT,
  452. number,
  453. string | number
  454. ];
  455. export declare function removeLeadingSlash(str: string): string;
  456. export declare const RENDERJS_MODULES = "renderjsModules";
  457. export declare function resolveComponentInstance(instance?: ComponentInternalInstance | ComponentPublicInstance): ComponentPublicInstance | undefined;
  458. export declare function resolveOwnerEl(instance: ComponentInternalInstance, multi: true): RendererNode[];
  459. export declare function resolveOwnerEl(instance: ComponentInternalInstance): RendererNode | null;
  460. export declare function resolveOwnerVm(vm: ComponentInternalInstance): ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | undefined;
  461. export declare const RESPONSIVE_MIN_WIDTH = 768;
  462. export declare type Rpx2UnitOptions = typeof defaultRpx2Unit;
  463. export declare const sanitise: (val: unknown) => any;
  464. export declare const SCHEME_RE: RegExp;
  465. declare function scrollTo_2(scrollTop: number | string, duration: number, isH5?: boolean): void;
  466. export { scrollTo_2 as scrollTo }
  467. export declare const SELECTED_COLOR = "#0062cc";
  468. /**
  469. * nodeId
  470. * name
  471. * value
  472. */
  473. export declare type SetAttributeAction = [
  474. typeof ACTION_TYPE_SET_ATTRIBUTE,
  475. number,
  476. string | number,
  477. unknown | number
  478. ];
  479. /**
  480. * nodeId
  481. * text
  482. */
  483. export declare type SetTextAction = [
  484. typeof ACTION_TYPE_SET_TEXT,
  485. number,
  486. string | number
  487. ];
  488. export declare const SLOT_DEFAULT_NAME = "d";
  489. export declare function sortObject<T extends Object>(obj: T): T;
  490. export declare function stringifyQuery(obj?: Record<string, any>, encodeStr?: typeof encodeURIComponent): string;
  491. export declare const TABBAR_HEIGHT = 50;
  492. export declare const TAGS: string[];
  493. declare interface Timer {
  494. setTimeout: Function;
  495. clearTimeout: Function;
  496. }
  497. export declare const UNI_SSR = "__uniSSR";
  498. export declare const UNI_SSR_DATA = "data";
  499. export declare const UNI_SSR_GLOBAL_DATA = "globalData";
  500. export declare const UNI_SSR_STORE = "store";
  501. export declare const UNI_SSR_TITLE = "title";
  502. export declare const UNI_STORAGE_LOCALE = "UNI_LOCALE";
  503. export declare const UNI_UI_CONFLICT_TAGS: string[];
  504. export declare class UniBaseNode extends UniNode {
  505. attributes: Record<string, unknown>;
  506. style: null | string | Record<string, string | string[]>;
  507. vShow: null | boolean;
  508. protected _html: string | null;
  509. constructor(nodeType: UniNodeType, nodeName: string, container: UniElement | IUniPageNode);
  510. get className(): string;
  511. set className(val: string);
  512. get innerHTML(): string;
  513. set innerHTML(html: string);
  514. addEventListener(type: string, listener: UniEventListener, options?: AddEventListenerOptions): void;
  515. removeEventListener(type: string, callback: UniEventListener, options?: EventListenerOptions): void;
  516. getAttribute(qualifiedName: string): unknown;
  517. removeAttribute(qualifiedName: string): void;
  518. setAttribute(qualifiedName: string, value: unknown): void;
  519. toJSON({ attr, normalize, }?: {
  520. attr?: boolean;
  521. children?: boolean;
  522. normalize?: (val: any, includeValue?: boolean) => any | number;
  523. }): Partial<UniNodeJSON>;
  524. }
  525. export declare class UniCommentNode extends UniNode {
  526. constructor(text: string, container: UniElement | IUniPageNode);
  527. toJSON(opts?: {
  528. attr?: boolean;
  529. }): {
  530. i?: undefined;
  531. } | {
  532. i: number;
  533. };
  534. }
  535. declare type UniCSSStyleDeclarationJSON = string | null | Record<string, string | string[]> | [string, Record<string, string | string[]>];
  536. export declare class UniElement extends UniBaseNode {
  537. tagName: string;
  538. constructor(nodeName: string, container: UniElement | IUniPageNode);
  539. }
  540. export declare class UniEvent {
  541. type: string;
  542. bubbles: boolean;
  543. cancelable: boolean;
  544. defaultPrevented: boolean;
  545. detail?: Record<string, any>;
  546. timeStamp: number;
  547. _stop: boolean;
  548. _end: boolean;
  549. constructor(type: string, opts: UniEventOptions);
  550. preventDefault(): void;
  551. stopImmediatePropagation(): void;
  552. stopPropagation(): void;
  553. }
  554. export declare interface UniEventListener {
  555. (evt: UniEvent): void;
  556. modifiers?: string[];
  557. wxsEvent?: string;
  558. }
  559. declare interface UniEventOptions {
  560. bubbles: boolean;
  561. cancelable: boolean;
  562. }
  563. declare class UniEventTarget {
  564. listeners: Record<string, UniEventListener[]>;
  565. dispatchEvent(evt: UniEvent): boolean;
  566. addEventListener(type: string, listener: UniEventListener, options?: AddEventListenerOptions): void;
  567. removeEventListener(type: string, callback: UniEventListener, options?: AddEventListenerOptions): void;
  568. }
  569. export declare class UniInputElement extends UniElement {
  570. get value(): string | number;
  571. set value(val: string | number);
  572. }
  573. export declare const UniLifecycleHooks: readonly ["onShow", "onHide", "onLaunch", "onError", "onThemeChange", "onPageNotFound", "onUnhandledRejection", "onExit", "onInit", "onLoad", "onReady", "onUnload", "onResize", "onBackPress", "onPageScroll", "onTabItemTap", "onReachBottom", "onPullDownRefresh", "onShareTimeline", "onAddToFavorites", "onShareAppMessage", "onSaveExitState", "onNavigationBarButtonTap", "onNavigationBarSearchInputClicked", "onNavigationBarSearchInputChanged", "onNavigationBarSearchInputConfirmed", "onNavigationBarSearchInputFocusChanged"];
  574. export declare class UniNode extends UniEventTarget {
  575. nodeId?: number;
  576. nodeType: UniNodeType;
  577. nodeName: string;
  578. childNodes: UniNode[];
  579. pageNode: IUniPageNode | null;
  580. parentNode: UniNode | null;
  581. __vueParentComponent?: ComponentInternalInstance;
  582. protected _text: string | null;
  583. constructor(nodeType: UniNodeType, nodeName: string, container: UniElement | IUniPageNode);
  584. get firstChild(): UniNode | null;
  585. get lastChild(): UniNode | null;
  586. get nextSibling(): UniNode | null;
  587. get nodeValue(): string | null;
  588. set nodeValue(_val: string | null);
  589. get textContent(): string;
  590. set textContent(text: string);
  591. get parentElement(): UniElement | null;
  592. get previousSibling(): UniNode | null;
  593. appendChild(newChild: UniNode): UniNode;
  594. cloneNode(deep?: boolean): UniNode;
  595. insertBefore(newChild: UniNode, refChild: UniNode | null): UniNode;
  596. removeChild(oldChild: UniNode): UniNode;
  597. }
  598. export declare interface UniNodeJSON {
  599. /**
  600. * nodeId
  601. */
  602. i: number;
  603. /**
  604. * nodeName
  605. */
  606. n: string | number;
  607. /**
  608. * attributes
  609. */
  610. a: Record<string, unknown>;
  611. /**
  612. * listeners
  613. */
  614. e: Record<string, number>;
  615. /**
  616. * wxs listeners
  617. */
  618. w: Record<string, [string, number]>;
  619. /**
  620. * style
  621. */
  622. s?: UniCSSStyleDeclarationJSON;
  623. /**
  624. * text
  625. */
  626. t?: string;
  627. }
  628. declare interface UniNodeJSONMinify {
  629. /**
  630. * nodeId
  631. */
  632. i: number;
  633. /**
  634. * nodeName
  635. */
  636. n: string | number;
  637. /**
  638. * attributes
  639. */
  640. a: DictArray;
  641. /**
  642. * listeners
  643. */
  644. e: DictArray;
  645. /**
  646. * wxs listeners
  647. */
  648. w: [number, [number, number]][];
  649. /**
  650. * style
  651. */
  652. s?: DictArray;
  653. /**
  654. * text
  655. */
  656. t?: number;
  657. }
  658. declare type UniNodeType = typeof NODE_TYPE_PAGE | typeof NODE_TYPE_ELEMENT | typeof NODE_TYPE_TEXT | typeof NODE_TYPE_COMMENT;
  659. export declare class UniTextAreaElement extends UniInputElement {
  660. }
  661. export declare class UniTextNode extends UniBaseNode {
  662. constructor(text: string, container: UniElement | IUniPageNode);
  663. get nodeValue(): string;
  664. set nodeValue(text: string);
  665. }
  666. export declare function updateElementStyle(element: HTMLElement, styles: Partial<CSSStyleDeclaration>): void;
  667. export declare const UVUE_BUILT_IN_TAGS: string[];
  668. export declare const UVUE_IOS_BUILT_IN_TAGS: string[];
  669. export declare const UVUE_WEB_BUILT_IN_TAGS: string[];
  670. declare interface Vue_2 {
  671. createApp: typeof createApp;
  672. }
  673. export { Vue_2 as Vue }
  674. export declare const WEB_INVOKE_APPSERVICE = "WEB_INVOKE_APPSERVICE";
  675. export declare const WXS_MODULES = "wxsModules";
  676. export declare const WXS_PROTOCOL = "wxs://";
  677. export { }