@tarojs/runtime 3.5.0-canary.0 → 3.5.0-theta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/runtime.esm.d.ts +537 -0
  2. package/dist/runtime.esm.js +3130 -4360
  3. package/dist/runtime.esm.js.map +1 -1
  4. package/package.json +11 -17
  5. package/dist/bom/document.d.ts +0 -3
  6. package/dist/bom/getComputedStyle.d.ts +0 -3
  7. package/dist/bom/navigator.d.ts +0 -15
  8. package/dist/bom/raf.d.ts +0 -4
  9. package/dist/bom/window.d.ts +0 -1
  10. package/dist/constants/events.d.ts +0 -5
  11. package/dist/constants/identifiers.d.ts +0 -61
  12. package/dist/constants/index.d.ts +0 -47
  13. package/dist/container/default-hooks.d.ts +0 -4
  14. package/dist/container/index.d.ts +0 -3
  15. package/dist/container/plugin-hooks.d.ts +0 -2
  16. package/dist/container/store.d.ts +0 -15
  17. package/dist/current.d.ts +0 -17
  18. package/dist/dom/class-list.d.ts +0 -14
  19. package/dist/dom/document.d.ts +0 -17
  20. package/dist/dom/element.d.ts +0 -37
  21. package/dist/dom/event-source.d.ts +0 -2
  22. package/dist/dom/event-target.d.ts +0 -9
  23. package/dist/dom/event.d.ts +0 -26
  24. package/dist/dom/form.d.ts +0 -7
  25. package/dist/dom/node.d.ts +0 -41
  26. package/dist/dom/node_types.d.ts +0 -10
  27. package/dist/dom/root.d.ts +0 -15
  28. package/dist/dom/style.d.ts +0 -13
  29. package/dist/dom/style_properties.d.ts +0 -3
  30. package/dist/dom/svg.d.ts +0 -3
  31. package/dist/dom/text.d.ts +0 -13
  32. package/dist/dom/tree.d.ts +0 -4
  33. package/dist/dom-external/element-impl.d.ts +0 -4
  34. package/dist/dom-external/element.d.ts +0 -4
  35. package/dist/dom-external/inner-html/html.d.ts +0 -3
  36. package/dist/dom-external/inner-html/parser.d.ts +0 -25
  37. package/dist/dom-external/inner-html/scaner.d.ts +0 -30
  38. package/dist/dom-external/inner-html/style.d.ts +0 -27
  39. package/dist/dom-external/inner-html/tags.d.ts +0 -8
  40. package/dist/dom-external/inner-html/utils.d.ts +0 -1
  41. package/dist/dom-external/node-impl.d.ts +0 -8
  42. package/dist/dom-external/node.d.ts +0 -12
  43. package/dist/dsl/common.d.ts +0 -36
  44. package/dist/dsl/instance.d.ts +0 -80
  45. package/dist/emitter/emitter.d.ts +0 -29
  46. package/dist/env.d.ts +0 -2
  47. package/dist/hooks.d.ts +0 -32
  48. package/dist/hydrate.d.ts +0 -10
  49. package/dist/index.d.ts +0 -27
  50. package/dist/interface/container.d.ts +0 -12
  51. package/dist/interface/document.d.ts +0 -14
  52. package/dist/interface/element.d.ts +0 -4
  53. package/dist/interface/event-target.d.ts +0 -10
  54. package/dist/interface/event.d.ts +0 -15
  55. package/dist/interface/hooks.d.ts +0 -162
  56. package/dist/interface/hydrate.d.ts +0 -28
  57. package/dist/interface/index.d.ts +0 -10
  58. package/dist/interface/node.d.ts +0 -7
  59. package/dist/interface/options.d.ts +0 -16
  60. package/dist/interface/utils.d.ts +0 -2
  61. package/dist/next-tick.d.ts +0 -2
  62. package/dist/options.d.ts +0 -2
  63. package/dist/perf.d.ts +0 -7
  64. package/dist/utils/index.d.ts +0 -15
package/package.json CHANGED
@@ -1,19 +1,13 @@
1
1
  {
2
2
  "name": "@tarojs/runtime",
3
- "version": "3.5.0-canary.0",
3
+ "version": "3.5.0-theta.1",
4
4
  "description": "taro runtime for mini apps.",
5
5
  "main": "dist/runtime.esm.js",
6
6
  "module": "dist/runtime.esm.js",
7
- "types": "./dist/index.d.ts",
7
+ "types": "./dist/runtime.esm.d.ts",
8
8
  "files": [
9
9
  "dist"
10
10
  ],
11
- "scripts": {
12
- "test": "jest",
13
- "test:ci": "jest -i --coverage false",
14
- "build": "rollup -c",
15
- "dev": "rollup -c -w"
16
- },
17
11
  "repository": {
18
12
  "type": "git",
19
13
  "url": "https://github.com/NervJS/taro/tree/master/packages/taro-runtime"
@@ -24,13 +18,13 @@
24
18
  "access": "public"
25
19
  },
26
20
  "dependencies": {
27
- "@tarojs/shared": "3.5.0-canary.0",
28
- "inversify": "5.1.1",
29
- "lodash-es": "4.17.15",
30
- "reflect-metadata": "^0.1.13"
21
+ "@tarojs/shared": "3.5.0-theta.1",
22
+ "lodash-es": "4.17.21"
31
23
  },
32
- "devDependencies": {
33
- "@tarojs/taro": "3.5.0-canary.0"
34
- },
35
- "gitHead": "a0222bc41bc05b0e34413d6db3de963d777a5015"
36
- }
24
+ "scripts": {
25
+ "test": "jest",
26
+ "test:ci": "jest -i --coverage false",
27
+ "build": "rollup -c",
28
+ "dev": "rollup -c -w"
29
+ }
30
+ }
@@ -1,3 +0,0 @@
1
- import type { TaroDocumentInstance } from '../interface';
2
- export declare function createDocument(): TaroDocumentInstance;
3
- export declare const document: TaroDocumentInstance;
@@ -1,3 +0,0 @@
1
- import type { TaroElement } from '../dom/element';
2
- import type { Style } from '../dom/style';
3
- export declare function getComputedStyle(element: TaroElement): Style;
@@ -1,15 +0,0 @@
1
- export declare const navigator: Navigator | {
2
- appCodeName: string;
3
- appName: string;
4
- appVersion: string;
5
- cookieEnabled: boolean;
6
- mimeTypes: never[];
7
- onLine: boolean;
8
- platform: string;
9
- plugins: never[];
10
- product: string;
11
- productSub: string;
12
- userAgent: string;
13
- vendor: string;
14
- vendorSub: string;
15
- };
package/dist/bom/raf.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export declare let now: any;
2
- declare const raf: typeof requestAnimationFrame;
3
- declare const caf: typeof cancelAnimationFrame;
4
- export { raf, caf };
@@ -1 +0,0 @@
1
- export declare const window: any;
@@ -1,5 +0,0 @@
1
- /**
2
- * 支持冒泡的事件, 除 支付宝小程序外,其余的可冒泡事件都和微信保持一致
3
- * 详见 见 https://developers.weixin.qq.com/miniprogram/dev/framework/view/wxml/event.html
4
- */
5
- export declare const BUBBLE_EVENTS: Set<string>;
@@ -1,61 +0,0 @@
1
- export declare const SID_TARO_ELEMENT = "0";
2
- export declare const SID_TARO_ELEMENT_FACTORY = "1";
3
- export declare const SID_TARO_TEXT = "2";
4
- export declare const SID_TARO_TEXT_FACTORY = "3";
5
- export declare const SID_TARO_NODE_IMPL = "4";
6
- export declare const SID_TARO_ELEMENT_IMPL = "5";
7
- export declare const SID_HOOKS = "6";
8
- export declare const SID_ON_REMOVE_ATTRIBUTE = "7";
9
- export declare const SID_GET_MINI_LIFECYCLE = "8";
10
- export declare const SID_GET_LIFECYCLE = "9";
11
- export declare const SID_GET_PATH_INDEX = "10";
12
- export declare const SID_GET_EVENT_CENTER = "11";
13
- export declare const SID_IS_BUBBLE_EVENTS = "12";
14
- export declare const SID_GET_SPECIAL_NODES = "13";
15
- export declare const SID_EVENT_CENTER = "14";
16
- export declare const SID_MODIFY_MP_EVENT = "15";
17
- export declare const SID_MODIFY_TARO_EVENT = "16";
18
- export declare const SID_MODIFY_DISPATCH_EVENT = "17";
19
- export declare const SID_BATCHED_EVENT_UPDATES = "18";
20
- export declare const SID_MERGE_PAGE_INSTANCE = "19";
21
- export declare const SID_CREATE_PULLDOWN_COMPONENT = "20";
22
- export declare const SID_GET_DOM_NODE = "21";
23
- export declare const SID_INIT_NATIVE_API = "22";
24
- export declare const SID_MODIFY_HYDRATE_DATA = "23";
25
- export declare const SID_MODIFY_SET_ATTR_PAYLOAD = "24";
26
- export declare const SID_MODIFY_RM_ATTR_PAYLOAD = "25";
27
- export declare const SID_ON_ADD_EVENT = "26";
28
- export declare const SID_PATCH_ELEMENT = "27";
29
- export declare const SID_MODIFY_PAGE_OBJECT = "28";
30
- declare const SERVICE_IDENTIFIER: {
31
- TaroElement: string;
32
- TaroElementFactory: string;
33
- TaroText: string;
34
- TaroTextFactory: string;
35
- TaroNodeImpl: string;
36
- TaroElementImpl: string;
37
- Hooks: string;
38
- onRemoveAttribute: string;
39
- getMiniLifecycle: string;
40
- getLifecycle: string;
41
- getPathIndex: string;
42
- getEventCenter: string;
43
- isBubbleEvents: string;
44
- getSpecialNodes: string;
45
- eventCenter: string;
46
- modifyMpEvent: string;
47
- modifyTaroEvent: string;
48
- modifyDispatchEvent: string;
49
- batchedEventUpdates: string;
50
- mergePageInstance: string;
51
- createPullDownComponent: string;
52
- getDOMNode: string;
53
- initNativeApi: string;
54
- modifyHydrateData: string;
55
- modifySetAttrPayload: string;
56
- modifyRmAttrPayload: string;
57
- onAddEvent: string;
58
- patchElement: string;
59
- modifyPageObject: string;
60
- };
61
- export default SERVICE_IDENTIFIER;
@@ -1,47 +0,0 @@
1
- export declare const PROPERTY_THRESHOLD = 2046;
2
- export declare const TARO_RUNTIME = "Taro runtime";
3
- export declare const HOOKS_APP_ID = "taro-app";
4
- export declare const SET_DATA = "\u5C0F\u7A0B\u5E8F setData";
5
- export declare const PAGE_INIT = "\u9875\u9762\u521D\u59CB\u5316";
6
- export declare const ROOT_STR = "root";
7
- export declare const HTML = "html";
8
- export declare const HEAD = "head";
9
- export declare const BODY = "body";
10
- export declare const APP = "app";
11
- export declare const CONTAINER = "container";
12
- export declare const DOCUMENT_ELEMENT_NAME = "#document";
13
- export declare const DOCUMENT_FRAGMENT = "document-fragment";
14
- export declare const ID = "id";
15
- export declare const UID = "uid";
16
- export declare const CLASS = "class";
17
- export declare const STYLE = "style";
18
- export declare const FOCUS = "focus";
19
- export declare const VIEW = "view";
20
- export declare const STATIC_VIEW = "static-view";
21
- export declare const PURE_VIEW = "pure-view";
22
- export declare const PROPS = "props";
23
- export declare const DATASET = "dataset";
24
- export declare const OBJECT = "object";
25
- export declare const VALUE = "value";
26
- export declare const INPUT = "input";
27
- export declare const CHANGE = "change";
28
- export declare const CUSTOM_WRAPPER = "custom-wrapper";
29
- export declare const TARGET = "target";
30
- export declare const CURRENT_TARGET = "currentTarget";
31
- export declare const TYPE = "type";
32
- export declare const CONFIRM = "confirm";
33
- export declare const TIME_STAMP = "timeStamp";
34
- export declare const KEY_CODE = "keyCode";
35
- export declare const TOUCHMOVE = "touchmove";
36
- export declare const DATE = "Date";
37
- export declare const SET_TIMEOUT = "setTimeout";
38
- export declare const CATCHMOVE = "catchMove";
39
- export declare const CATCH_VIEW = "catch-view";
40
- export declare const COMMENT = "comment";
41
- export declare const ON_LOAD = "onLoad";
42
- export declare const ON_READY = "onReady";
43
- export declare const ON_SHOW = "onShow";
44
- export declare const ON_HIDE = "onHide";
45
- export declare const OPTIONS = "options";
46
- export declare const EXTERNAL_CLASSES = "externalClasses";
47
- export declare const BEHAVIORS = "behaviors";
@@ -1,4 +0,0 @@
1
- import { ContainerModule } from 'inversify';
2
- import type { MiniLifecycle } from '../interface';
3
- export declare const defaultMiniLifecycle: MiniLifecycle;
4
- export declare const DefaultHooksContainer: ContainerModule;
@@ -1,3 +0,0 @@
1
- import { Container } from 'inversify';
2
- declare const container: Container;
3
- export default container;
@@ -1,2 +0,0 @@
1
- import type { Container } from 'inversify';
2
- export default function processPluginHooks(container: Container): void;
@@ -1,15 +0,0 @@
1
- import { TaroDocumentInstance } from '../interface';
2
- import type { Container } from 'inversify';
3
- import type { IHooks, InstanceNamedFactory } from '../interface';
4
- import type { TaroNodeImpl } from '../dom-external/node-impl';
5
- import type { TaroElementImpl } from '../dom-external/element-impl';
6
- interface IStore {
7
- container: Container | null;
8
- }
9
- export declare const store: IStore;
10
- export declare function getHooks(): IHooks;
11
- export declare function getElementFactory(): InstanceNamedFactory;
12
- export declare function getNodeImpl(): TaroNodeImpl;
13
- export declare function getElementImpl(): TaroElementImpl;
14
- export declare function getDocument(): TaroDocumentInstance;
15
- export {};
package/dist/current.d.ts DELETED
@@ -1,17 +0,0 @@
1
- import { AppInstance, PageInstance } from './dsl/instance';
2
- export interface Router {
3
- params: Record<string, unknown>;
4
- path: string;
5
- onReady: string;
6
- onHide: string;
7
- onShow: string;
8
- }
9
- interface Current {
10
- app: AppInstance | null;
11
- router: Router | null;
12
- page: PageInstance | null;
13
- preloadData?: any;
14
- }
15
- export declare const Current: Current;
16
- export declare const getCurrentInstance: () => Current;
17
- export {};
@@ -1,14 +0,0 @@
1
- import type { TaroElement } from './element';
2
- export declare class ClassList extends Set<string> {
3
- private el;
4
- constructor(className: string, el: TaroElement);
5
- get value(): string;
6
- add(s: string): this;
7
- get length(): number;
8
- remove(s: string): void;
9
- toggle(s: string): void;
10
- replace(s1: string, s2: string): void;
11
- contains(s: string): boolean;
12
- toString(): string;
13
- private _update;
14
- }
@@ -1,17 +0,0 @@
1
- import { TaroElement } from '../dom/element';
2
- import { InstanceFactory } from '../interface';
3
- import type { FormElement } from '../dom/form';
4
- import type { TaroRootElement } from '../dom/root';
5
- import type { TaroText } from '../dom/text';
6
- export declare class TaroDocument extends TaroElement {
7
- private _getText;
8
- constructor(// eslint-disable-next-line @typescript-eslint/indent
9
- getText: InstanceFactory<TaroText>);
10
- createElement(type: string): TaroElement | TaroRootElement | FormElement;
11
- createElementNS(_svgNS: string, type: string): TaroElement | TaroRootElement | FormElement;
12
- createTextNode(text: string): TaroText;
13
- getElementById<T extends TaroElement>(id: string | undefined | null): T | null;
14
- querySelector<T extends TaroElement>(query: string): T | null;
15
- querySelectorAll(): never[];
16
- createComment(): TaroText;
17
- }
@@ -1,37 +0,0 @@
1
- import { TaroNode } from './node';
2
- import { Style } from './style';
3
- import { ClassList } from './class-list';
4
- import type { TaroEvent } from './event';
5
- import type { Attributes } from '../interface';
6
- export declare class TaroElement extends TaroNode {
7
- tagName: string;
8
- props: Record<string, any>;
9
- style: Style;
10
- dataset: Record<string, unknown>;
11
- innerHTML: string;
12
- constructor();
13
- private _stopPropagation;
14
- get id(): string;
15
- set id(val: string);
16
- get className(): string;
17
- set className(val: string);
18
- get cssText(): string;
19
- get classList(): ClassList;
20
- get children(): TaroElement[];
21
- get attributes(): Attributes[];
22
- get textContent(): string;
23
- set textContent(text: string);
24
- hasAttribute(qualifiedName: string): boolean;
25
- hasAttributes(): boolean;
26
- get focus(): () => void;
27
- set focus(value: () => void);
28
- blur(): void;
29
- setAttribute(qualifiedName: string, value: any): void;
30
- removeAttribute(qualifiedName: string): void;
31
- getAttribute(qualifiedName: string): string;
32
- getElementsByTagName(tagName: string): TaroElement[];
33
- getElementsByClassName(className: string): TaroElement[];
34
- dispatchEvent(event: TaroEvent): boolean;
35
- addEventListener(type: any, handler: any, options: any): void;
36
- removeEventListener(type: any, handler: any): void;
37
- }
@@ -1,2 +0,0 @@
1
- import type { TaroNode } from './node';
2
- export declare const eventSource: Map<string | null | undefined, TaroNode>;
@@ -1,9 +0,0 @@
1
- import type { EventHandler, AddEventListenerOptions, IHooks } from '../interface';
2
- export declare class TaroEventTarget {
3
- __handlers: Record<string, EventHandler[]>;
4
- hooks: IHooks;
5
- constructor();
6
- addEventListener(type: string, handler: EventHandler, options?: boolean | AddEventListenerOptions): void;
7
- removeEventListener(type: string, handler: EventHandler): void;
8
- isAnyEventBinded(): boolean;
9
- }
@@ -1,26 +0,0 @@
1
- import type { TaroElement } from './element';
2
- import type { EventOptions, MpEvent } from '../interface';
3
- export declare class TaroEvent {
4
- type: string;
5
- bubbles: boolean;
6
- cancelable: boolean;
7
- _stop: boolean;
8
- _end: boolean;
9
- defaultPrevented: boolean;
10
- timeStamp: number;
11
- mpEvent: MpEvent | undefined;
12
- constructor(type: string, opts: EventOptions, event?: MpEvent);
13
- stopPropagation(): void;
14
- stopImmediatePropagation(): void;
15
- preventDefault(): void;
16
- get target(): {
17
- dataset: any;
18
- id?: string | undefined;
19
- };
20
- get currentTarget(): {
21
- dataset: any;
22
- id?: string | undefined;
23
- };
24
- }
25
- export declare function createEvent(event: MpEvent | string, node?: TaroElement): TaroEvent;
26
- export declare function eventHandler(event: MpEvent): void;
@@ -1,7 +0,0 @@
1
- import { TaroElement } from './element';
2
- import type { TaroEvent } from './event';
3
- export declare class FormElement extends TaroElement {
4
- get value(): string | boolean | number | any[];
5
- set value(val: string | boolean | number | any[]);
6
- dispatchEvent(event: TaroEvent): boolean;
7
- }
@@ -1,41 +0,0 @@
1
- import { NodeType } from './node_types';
2
- import { TaroEventTarget } from './event-target';
3
- import type { UpdatePayload } from '../interface';
4
- import type { TaroDocument } from './document';
5
- import type { TaroRootElement } from './root';
6
- import type { TaroElement } from './element';
7
- export declare class TaroNode extends TaroEventTarget {
8
- uid: string;
9
- nodeType: NodeType;
10
- nodeName: string;
11
- parentNode: TaroNode | null;
12
- childNodes: TaroNode[];
13
- protected _getElement: import("../interface").InstanceNamedFactory;
14
- constructor();
15
- private hydrate;
16
- /**
17
- * like jQuery's $.empty()
18
- */
19
- private _empty;
20
- protected get _root(): TaroRootElement | null;
21
- protected findIndex(refChild: TaroNode): number;
22
- get _path(): string;
23
- get nextSibling(): TaroNode | null;
24
- get previousSibling(): TaroNode | null;
25
- get parentElement(): TaroElement | null;
26
- get firstChild(): TaroNode | null;
27
- get lastChild(): TaroNode | null;
28
- /**
29
- * @textContent 目前只能置空子元素
30
- * @TODO 等待完整 innerHTML 实现
31
- */
32
- set textContent(text: string);
33
- insertBefore<T extends TaroNode>(newChild: T, refChild?: TaroNode | null, isReplace?: boolean): T;
34
- appendChild(child: TaroNode): void;
35
- replaceChild(newChild: TaroNode, oldChild: TaroNode): TaroNode | undefined;
36
- removeChild<T extends TaroNode>(child: T, isReplace?: boolean): T;
37
- remove(isReplace?: boolean): void;
38
- hasChildNodes(): boolean;
39
- enqueueUpdate(payload: UpdatePayload): void;
40
- get ownerDocument(): TaroDocument;
41
- }
@@ -1,10 +0,0 @@
1
- export declare const enum NodeType {
2
- ELEMENT_NODE = 1,
3
- ATTRIBUTE_NODE = 2,
4
- TEXT_NODE = 3,
5
- CDATA_SECTION_NODE = 4,
6
- ENTITY_REFERENCE_NODE = 5,
7
- COMMENT_NODE = 6,
8
- PROCESSING_INSTRUCTION_NODE = 7,
9
- DOCUMENT_NODE = 9
10
- }
@@ -1,15 +0,0 @@
1
- import { TaroElement } from './element';
2
- import type { Func, UpdatePayload, MpInstance } from '../interface';
3
- export declare class TaroRootElement extends TaroElement {
4
- private updatePayloads;
5
- private updateCallbacks;
6
- pendingUpdate: boolean;
7
- ctx: null | MpInstance;
8
- constructor();
9
- get _path(): string;
10
- protected get _root(): TaroRootElement;
11
- enqueueUpdate(payload: UpdatePayload): void;
12
- performUpdate(initRender?: boolean, prerender?: Func): void;
13
- enqueueUpdateCallback(cb: Func, ctx?: Record<string, any>): void;
14
- flushUpdateCallback(): void;
15
- }
@@ -1,13 +0,0 @@
1
- import { TaroElement } from './element';
2
- export declare class Style {
3
- _usedStyleProp: Set<string>;
4
- _value: Partial<CSSStyleDeclaration>;
5
- _element: TaroElement;
6
- constructor(element: TaroElement);
7
- private setCssVariables;
8
- get cssText(): string;
9
- set cssText(str: string);
10
- setProperty(propertyName: string, value?: string | null): void;
11
- removeProperty(propertyName: string): string;
12
- getPropertyValue(propertyName: string): any;
13
- }
@@ -1,3 +0,0 @@
1
- declare const styleProperties: string[];
2
- /** 非常用 style */
3
- export { styleProperties };
package/dist/dom/svg.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { TaroElement } from './element';
2
- export declare class SVGElement extends TaroElement {
3
- }
@@ -1,13 +0,0 @@
1
- import { TaroNode } from './node';
2
- import { NodeType } from './node_types';
3
- export declare class TaroText extends TaroNode {
4
- _value: string;
5
- nodeType: NodeType;
6
- nodeName: string;
7
- set textContent(text: string);
8
- get textContent(): string;
9
- set nodeValue(text: string);
10
- get nodeValue(): string;
11
- set data(text: string);
12
- get data(): string;
13
- }
@@ -1,4 +0,0 @@
1
- import type { TaroElement } from './element';
2
- declare type Filter = (element: TaroElement) => boolean;
3
- export declare function treeToArray(root: TaroElement, predict?: Filter): TaroElement[];
4
- export {};
@@ -1,4 +0,0 @@
1
- import type { Ctx } from '../interface';
2
- export declare class TaroElementImpl {
3
- bind(ctx: Ctx): void;
4
- }
@@ -1,4 +0,0 @@
1
- import type { Ctx } from '../interface';
2
- import type { TaroElement } from 'src/dom/element';
3
- export declare function getBoundingClientRectImpl(this: TaroElement): Promise<null>;
4
- export declare function getTemplateContent(ctx: Ctx): string | undefined;
@@ -1,3 +0,0 @@
1
- import type { TaroNode } from '../../dom/node';
2
- import type { TaroDocument } from '../../dom/document';
3
- export declare function setInnerHTML(element: TaroNode, html: string, getDoc: () => TaroDocument): void;
@@ -1,25 +0,0 @@
1
- import type { TaroElement } from '../../dom/element';
2
- import type { TaroDocument } from '../../dom/document';
3
- interface Node {
4
- type: string;
5
- }
6
- interface Comment extends Node {
7
- type: 'comment';
8
- content: string;
9
- }
10
- export interface Text extends Node {
11
- type: 'text';
12
- content: string;
13
- }
14
- export interface Element extends Node {
15
- type: 'element';
16
- tagName: string;
17
- children: ChildNode[];
18
- attributes: string[];
19
- }
20
- export interface ParsedTaroElement extends TaroElement {
21
- h5tagName?: string;
22
- }
23
- declare type ChildNode = Comment | Text | Element;
24
- export declare function parser(html: string, document: TaroDocument): (TaroElement | import("../..").TaroText)[];
25
- export {};
@@ -1,30 +0,0 @@
1
- interface Position {
2
- index: number;
3
- column: number;
4
- line: number;
5
- }
6
- export interface Token {
7
- type: string;
8
- content?: string;
9
- position?: {
10
- start?: Position;
11
- end?: Position;
12
- };
13
- close?: boolean;
14
- }
15
- export declare class Scaner {
16
- private tokens;
17
- private position;
18
- private html;
19
- constructor(html: string);
20
- scan(): Token[];
21
- private scanText;
22
- private scanComment;
23
- private scanTag;
24
- private scanTagStart;
25
- private scanTagEnd;
26
- private scanTagName;
27
- private scanAttrs;
28
- private scanSkipTag;
29
- }
30
- export {};
@@ -1,27 +0,0 @@
1
- import type { ParsedTaroElement } from './parser';
2
- interface ISelector {
3
- isChild: boolean;
4
- isGeneralSibling: boolean;
5
- isAdjacentSibling: boolean;
6
- tag: string | null;
7
- id: string | null;
8
- class: string[];
9
- attrs: {
10
- all: boolean;
11
- key: string;
12
- value?: string | null;
13
- }[];
14
- }
15
- interface IStyle {
16
- content: string;
17
- selectorList: ISelector[];
18
- }
19
- export default class StyleTagParser {
20
- styles: IStyle[];
21
- extractStyle(src: string): string;
22
- stringToSelector(style: string): void;
23
- parseSelector(src: string): ISelector[];
24
- matchStyle(tagName: string, el: ParsedTaroElement, list: number[]): string;
25
- matchCurrent(tagName: string, el: ParsedTaroElement, selector: ISelector): boolean;
26
- }
27
- export {};
@@ -1,8 +0,0 @@
1
- export declare function makeMap(str: string, expectsLowerCase?: boolean): (key: string) => boolean;
2
- export declare const specialMiniElements: {
3
- img: string;
4
- iframe: string;
5
- };
6
- export declare const isMiniElements: (key: string) => boolean;
7
- export declare const isInlineElements: (key: string) => boolean;
8
- export declare const isBlockElements: (key: string) => boolean;
@@ -1 +0,0 @@
1
- export declare function unquote(str: string): string;
@@ -1,8 +0,0 @@
1
- import { InstanceNamedFactory } from '../interface';
2
- import type { Ctx, GetDoc } from '../interface';
3
- export declare class TaroNodeImpl {
4
- getDoc: GetDoc;
5
- constructor(// eslint-disable-next-line @typescript-eslint/indent
6
- getElement: InstanceNamedFactory);
7
- bind(ctx: Ctx): void;
8
- }
@@ -1,12 +0,0 @@
1
- import { GetDoc } from '../interface';
2
- import type { TaroNode } from 'src/dom/node';
3
- export declare type IPosition = 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend';
4
- /**
5
- * An implementation of `Element.insertAdjacentHTML()`
6
- * to support Vue 3 with a version of or greater than `vue@3.1.2`
7
- */
8
- export declare function insertAdjacentHTMLImpl(this: TaroNode, getDoc: GetDoc, position: IPosition, html: string): void;
9
- export declare function cloneNode(this: TaroNode, getDoc: any, isDeep?: boolean): any;
10
- export declare function contains(this: TaroNode, node: TaroNode & {
11
- id?: string;
12
- }): boolean;