@lwc/engine-core 2.7.0 → 2.7.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lwc/engine-core",
3
- "version": "2.7.0",
3
+ "version": "2.7.4",
4
4
  "description": "Core LWC engine APIs.",
5
5
  "homepage": "https://lwc.dev/",
6
6
  "repository": {
@@ -24,8 +24,8 @@
24
24
  "types/"
25
25
  ],
26
26
  "dependencies": {
27
- "@lwc/features": "2.7.0",
28
- "@lwc/shared": "2.7.0"
27
+ "@lwc/features": "2.7.4",
28
+ "@lwc/shared": "2.7.4"
29
29
  },
30
30
  "devDependencies": {
31
31
  "observable-membrane": "2.0.0"
@@ -33,5 +33,5 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "656663a9f95f90bd648c6fc2200201afc0156393"
36
+ "gitHead": "df4eda8be794fa5f7a01148c137eea4e546a0844"
37
37
  }
@@ -1,6 +1,6 @@
1
1
  import { SlotSet } from './vm';
2
- import { VNode, VNodes, VElement, VText, VCustomElement, VComment, VElementData } from '../3rdparty/snabbdom/types';
3
2
  import { LightningElementConstructor } from './base-lightning-element';
3
+ import { VNode, VNodes, VElement, VText, VCustomElement, VComment, VElementData } from './vnodes';
4
4
  declare function h(sel: string, data: VElementData, children: VNodes): VElement;
5
5
  declare function ti(value: any): number;
6
6
  declare function s(slotName: string, data: VElementData, children: VNodes, slotset: SlotSet | undefined): VElement | VNodes;
@@ -1,8 +1,8 @@
1
1
  import { VM } from './vm';
2
- import { VNodes } from '../3rdparty/snabbdom/types';
3
2
  import { ReactiveObserver } from '../libs/mutation-tracker';
4
3
  import { LightningElementConstructor } from './base-lightning-element';
5
4
  import { Template } from './template';
5
+ import { VNodes } from './vnodes';
6
6
  /**
7
7
  * INTERNAL: This function can only be invoked by compiled code. The compiler
8
8
  * will prevent this function from being imported by userland code.
@@ -34,6 +34,7 @@ export interface ComponentDef {
34
34
  */
35
35
  export declare function isComponentConstructor(ctor: unknown): ctor is LightningElementConstructor;
36
36
  export declare function getComponentInternalDef(Ctor: unknown): ComponentDef;
37
+ export declare function getComponentHtmlPrototype(Ctor: unknown): HTMLElementConstructor;
37
38
  declare const enum PropDefType {
38
39
  any = "any"
39
40
  }
@@ -0,0 +1,2 @@
1
+ export declare const HTMLElementConstructor: typeof HTMLElement;
2
+ export declare const HTMLElementPrototype: HTMLElement;
@@ -0,0 +1,3 @@
1
+ import { VM } from './vm';
2
+ import { VNodes } from './vnodes';
3
+ export declare function hydrateChildren(elmChildren: NodeListOf<ChildNode>, children: VNodes, vm: VM): void;
@@ -1,6 +1,6 @@
1
1
  import { VM } from './vm';
2
2
  import { LightningElement, LightningElementConstructor } from './base-lightning-element';
3
- import { VNodes } from '../3rdparty/snabbdom/types';
3
+ import { VNodes } from './vnodes';
4
4
  export declare let isInvokingRender: boolean;
5
5
  export declare let vmBeingConstructed: VM | null;
6
6
  export declare function isBeingConstructed(vm: VM): boolean;
@@ -6,7 +6,7 @@ export { default as track } from './decorators/track';
6
6
  export { default as wire } from './decorators/wire';
7
7
  export { readonly } from './readonly';
8
8
  export { setFeatureFlag, setFeatureFlagForTest } from '@lwc/features';
9
- export { getComponentInternalDef } from './def';
9
+ export { getComponentHtmlPrototype } from './def';
10
10
  export { createVM, connectRootElement, disconnectRootElement, getAssociatedVMIfPresent, hydrateRootElement, } from './vm';
11
11
  export { registerComponent } from './component';
12
12
  export { registerTemplate } from './secure-template';
@@ -18,5 +18,5 @@ export { profilerControl as __unstable__ProfilerControl } from './profiler';
18
18
  export { getUpgradableConstructor } from './upgradable-element';
19
19
  export { swapTemplate, swapComponent, swapStyle } from './hot-swaps';
20
20
  export { setHooks } from './overridable-hooks';
21
- export type { Renderer } from './renderer';
22
21
  export type { ConfigValue as WireConfigValue, ContextValue as WireContextValue, DataCallback, WireAdapter, WireAdapterConstructor, WireAdapterSchemaValue, } from './wiring';
22
+ export { setAssertInstanceOfHTMLElement, setAttachShadow, setCreateComment, setCreateElement, setCreateText, setDefineCustomElement, setDispatchEvent, setGetAttribute, setGetBoundingClientRect, setGetChildNodes, setGetChildren, setGetClassList, setGetCustomElement, setGetElementsByClassName, setGetElementsByTagName, setGetFirstChild, setGetFirstElementChild, setGetLastChild, setGetLastElementChild, setGetProperty, setHTMLElement, setInsert, setInsertGlobalStylesheet, setInsertStylesheet, setIsConnected, setIsHydrating, setIsNativeShadowDefined, setIsSyntheticShadowDefined, setNextSibling, setQuerySelector, setQuerySelectorAll, setRemove, setRemoveAttribute, setRemoveEventListener, setSetAttribute, setSetCSSStyleProperty, setSetProperty, setSetText, setSsr, setAddEventListener, } from '../renderer';
@@ -1,7 +1,2 @@
1
- import { VElement } from '../../3rdparty/snabbdom/types';
2
- declare function updateAttrs(oldVnode: VElement, vnode: VElement): void;
3
- declare const _default: {
4
- create: (vnode: VElement) => void;
5
- update: typeof updateAttrs;
6
- };
7
- export default _default;
1
+ import { VBaseElement } from '../vnodes';
2
+ export declare function patchAttributes(oldVnode: VBaseElement | null, vnode: VBaseElement): void;
@@ -1,7 +1,2 @@
1
- import { VElement } from '../../3rdparty/snabbdom/types';
2
- declare function updateClassAttribute(oldVnode: VElement, vnode: VElement): void;
3
- declare const _default: {
4
- create: (vnode: VElement) => void;
5
- update: typeof updateClassAttribute;
6
- };
7
- export default _default;
1
+ import { VBaseElement } from '../vnodes';
2
+ export declare function patchClassAttribute(oldVnode: VBaseElement | null, vnode: VBaseElement): void;
@@ -1,7 +1,2 @@
1
- import { VNode } from '../../3rdparty/snabbdom/types';
2
- declare function updateStyleAttribute(oldVnode: VNode, vnode: VNode): void;
3
- declare const _default: {
4
- create: (vnode: VNode) => void;
5
- update: typeof updateStyleAttribute;
6
- };
7
- export default _default;
1
+ import { VBaseElement } from '../vnodes';
2
+ export declare function patchStyleAttribute(oldVnode: VBaseElement | null, vnode: VBaseElement): void;
@@ -1,14 +1,2 @@
1
- import { VNode } from '../../3rdparty/snabbdom/types';
2
- interface VNodeEventListener extends EventListener {
3
- vnode?: VNode;
4
- }
5
- interface InteractiveVNode extends VNode {
6
- listener: VNodeEventListener | undefined;
7
- }
8
- declare function updateAllEventListeners(oldVnode: InteractiveVNode, vnode: InteractiveVNode): void;
9
- declare function createAllEventListeners(vnode: VNode): void;
10
- declare const _default: {
11
- update: typeof updateAllEventListeners;
12
- create: typeof createAllEventListeners;
13
- };
14
- export default _default;
1
+ import { VBaseElement } from '../vnodes';
2
+ export declare function applyEventListeners(vnode: VBaseElement): void;
@@ -1,7 +1,2 @@
1
- import { VElement } from '../../3rdparty/snabbdom/types';
2
- declare function update(oldVnode: VElement, vnode: VElement): void;
3
- declare const _default: {
4
- create: (vnode: VElement) => void;
5
- update: typeof update;
6
- };
7
- export default _default;
1
+ import { VBaseElement } from '../vnodes';
2
+ export declare function patchProps(oldVnode: VBaseElement | null, vnode: VBaseElement): void;
@@ -1,6 +1,2 @@
1
- import { VNode } from '../../3rdparty/snabbdom/types';
2
- declare function createClassAttribute(vnode: VNode): void;
3
- declare const _default: {
4
- create: typeof createClassAttribute;
5
- };
6
- export default _default;
1
+ import { VBaseElement } from '../vnodes';
2
+ export declare function applyStaticClassAttribute(vnode: VBaseElement): void;
@@ -1,6 +1,2 @@
1
- import { VNode } from '../../3rdparty/snabbdom/types';
2
- declare function createStyleAttribute(vnode: VNode): void;
3
- declare const _default: {
4
- create: typeof createStyleAttribute;
5
- };
6
- export default _default;
1
+ import { VBaseElement } from '../vnodes';
2
+ export declare function applyStaticStyleAttribute(vnode: VBaseElement): void;
@@ -0,0 +1,9 @@
1
+ import { VM } from './vm';
2
+ import { VNodes, VCustomElement, VElement, VText, VComment, Hooks } from './vnodes';
3
+ export declare const TextHook: Hooks<VText>;
4
+ export declare const CommentHook: Hooks<VComment>;
5
+ export declare const ElementHook: Hooks<VElement>;
6
+ export declare const CustomElementHook: Hooks<VCustomElement>;
7
+ export declare function patchChildren(parent: ParentNode, oldCh: VNodes, newCh: VNodes): void;
8
+ export declare function allocateChildren(vnode: VCustomElement, vm: VM): void;
9
+ export declare function markAsDynamicChildren(children: VNodes): void;
@@ -1,6 +1,6 @@
1
- import { VNodeData } from '../3rdparty/snabbdom/types';
2
1
  import { ComponentDef } from './def';
3
2
  import { VM, Context } from './vm';
3
+ import { VNodeData } from './vnodes';
4
4
  declare type ServiceCallback = (component: object, data: VNodeData, def: ComponentDef, context: Context) => void;
5
5
  interface ServiceDef {
6
6
  connected?: ServiceCallback;
@@ -1,6 +1,6 @@
1
- import { VNode } from '../3rdparty/snabbdom/types';
2
1
  import { VM } from './vm';
3
2
  import { Template } from './template';
3
+ import { VNode } from './vnodes';
4
4
  /**
5
5
  * Function producing style based on a host and a shadow selector. This function is invoked by
6
6
  * the engine with different values depending on the mode that the component is running on.
@@ -1,7 +1,7 @@
1
- import { VNode, VNodes } from '../3rdparty/snabbdom/types';
2
1
  import { RenderAPI } from './api';
3
2
  import { SlotSet, TemplateCache, VM } from './vm';
4
3
  import { TemplateStylesheetFactories } from './stylesheet';
4
+ import { VNode, VNodes } from './vnodes';
5
5
  export interface Template {
6
6
  (api: RenderAPI, cmp: object, slotSet: SlotSet, cache: TemplateCache): VNodes;
7
7
  /** The list of slot names used in the template. */
@@ -1,7 +1,6 @@
1
- import { Renderer } from './renderer';
2
1
  declare type UpgradeCallback = (elm: HTMLElement) => void;
3
2
  interface UpgradableCustomElementConstructor extends CustomElementConstructor {
4
3
  new (upgradeCallback?: UpgradeCallback): HTMLElement;
5
4
  }
6
- export declare function getUpgradableConstructor(tagName: string, renderer: Renderer): CustomElementConstructor | UpgradableCustomElementConstructor;
5
+ export declare function getUpgradableConstructor(tagName: string): CustomElementConstructor | UpgradableCustomElementConstructor;
7
6
  export {};
@@ -1,10 +1,10 @@
1
+ import type { HostNode, HostElement } from '../renderer';
1
2
  import { Template } from './template';
2
3
  import { ComponentDef } from './def';
3
- import { LightningElement } from './base-lightning-element';
4
+ import { LightningElement, LightningElementConstructor } from './base-lightning-element';
4
5
  import { ReactiveObserver } from './mutation-tracker';
5
6
  import { AccessorReactiveObserver } from './decorators/api';
6
- import { Renderer, HostNode, HostElement } from './renderer';
7
- import { VNodes, VCustomElement, VNode } from '../3rdparty/snabbdom/types';
7
+ import { VNodes, VCustomElement, VNode } from './vnodes';
8
8
  declare type ShadowRootMode = 'open' | 'closed';
9
9
  export interface TemplateCache {
10
10
  [key: string]: any;
@@ -29,6 +29,9 @@ export declare const enum ShadowSupportMode {
29
29
  Any = "any",
30
30
  Default = "reset"
31
31
  }
32
+ export declare const enum LwcDomMode {
33
+ Manual = "manual"
34
+ }
32
35
  export interface Context {
33
36
  /** The string used for synthetic shadow DOM and light DOM style scoping. */
34
37
  stylesheetToken: string | undefined;
@@ -60,7 +63,6 @@ export interface VM<N = HostNode, E = HostElement> {
60
63
  /** The owner VM or null for root elements. */
61
64
  readonly owner: VM<N, E> | null;
62
65
  /** Rendering operations associated with the VM */
63
- readonly renderer: Renderer<N, E>;
64
66
  renderMode: RenderMode;
65
67
  shadowMode: ShadowMode;
66
68
  /** The component creation index. */
@@ -97,7 +99,10 @@ export interface VM<N = HostNode, E = HostElement> {
97
99
  /** The component instance. */
98
100
  component: LightningElement;
99
101
  /** The custom element shadow root. */
100
- cmpRoot: ShadowRoot | null;
102
+ shadowRoot: ShadowRoot | null;
103
+ /** The component render root. If the component is a shadow DOM component, it is its shadow
104
+ * root. If the component is a light DOM component it the element itself. */
105
+ renderRoot: ShadowRoot | HostElement;
101
106
  /** The template reactive observer. */
102
107
  tro: ReactiveObserver;
103
108
  /** The accessor reactive observers. Is only used when the ENABLE_REACTIVE_SETTER feature flag
@@ -123,11 +128,10 @@ export declare function disconnectRootElement(elm: any): void;
123
128
  export declare function appendVM(vm: VM): void;
124
129
  export declare function hydrateVM(vm: VM): void;
125
130
  export declare function removeVM(vm: VM): void;
126
- export declare function createVM<HostNode, HostElement>(elm: HostElement, def: ComponentDef, options: {
131
+ export declare function createVM<HostNode, HostElement>(elm: HostElement, ctor: LightningElementConstructor, options: {
127
132
  mode: ShadowRootMode;
128
133
  owner: VM<HostNode, HostElement> | null;
129
134
  tagName: string;
130
- renderer: Renderer;
131
135
  }): VM;
132
136
  export declare function associateVM(obj: VMAssociable, vm: VM): void;
133
137
  export declare function getAssociatedVM(obj: VMAssociable): VM;
@@ -135,8 +139,6 @@ export declare function getAssociatedVMIfPresent(obj: VMAssociable): VM | undefi
135
139
  export declare function runConnectedCallback(vm: VM): void;
136
140
  export declare function resetComponentRoot(vm: VM): void;
137
141
  export declare function scheduleRehydration(vm: VM): void;
138
- export declare function allocateInSlot(vm: VM, children: VNodes): void;
139
142
  export declare function runWithBoundaryProtection(vm: VM, owner: VM | null, pre: () => void, job: () => void, post: () => void): void;
140
143
  export declare function forceRehydration(vm: VM): void;
141
- export declare function getRenderRoot(vm: VM): ShadowRoot | HostElement;
142
144
  export {};
@@ -1,51 +1,50 @@
1
- /**
2
- @license
3
- Copyright (c) 2015 Simon Friis Vindum.
4
- This code may only be used under the MIT License found at
5
- https://github.com/snabbdom/snabbdom/blob/master/LICENSE
6
- Code distributed by Snabbdom as part of the Snabbdom project at
7
- https://github.com/snabbdom/snabbdom/
8
- */
9
- import { VM } from '../../framework/vm';
1
+ import { VM } from './vm';
10
2
  export declare type Key = string | number;
3
+ export declare const enum VNodeType {
4
+ Text = 0,
5
+ Comment = 1,
6
+ Element = 2,
7
+ CustomElement = 3
8
+ }
9
+ export declare type VNode = VText | VComment | VElement | VCustomElement;
10
+ export declare type VParentElement = VElement | VCustomElement;
11
11
  export declare type VNodes = Array<VNode | null>;
12
- export interface VNode {
13
- sel: string | undefined;
14
- data: VNodeData;
15
- children: VNodes | undefined;
12
+ export interface BaseVNode {
13
+ type: VNodeType;
16
14
  elm: Node | undefined;
17
- parentElm?: Element;
18
- text: string | undefined;
15
+ sel: string | undefined;
19
16
  key: Key | undefined;
20
17
  hook: Hooks<any>;
21
18
  owner: VM;
22
19
  }
23
- export interface VElement extends VNode {
20
+ export interface VText extends BaseVNode {
21
+ type: VNodeType.Text;
22
+ sel: undefined;
23
+ text: string;
24
+ key: undefined;
25
+ }
26
+ export interface VComment extends BaseVNode {
27
+ type: VNodeType.Comment;
28
+ sel: undefined;
29
+ text: string;
30
+ key: undefined;
31
+ }
32
+ export interface VBaseElement extends BaseVNode {
24
33
  sel: string;
25
34
  data: VElementData;
26
35
  children: VNodes;
27
36
  elm: Element | undefined;
28
- text: undefined;
29
37
  key: Key;
30
38
  }
31
- export interface VCustomElement extends VElement {
39
+ export interface VElement extends VBaseElement {
40
+ type: VNodeType.Element;
41
+ }
42
+ export interface VCustomElement extends VBaseElement {
43
+ type: VNodeType.CustomElement;
32
44
  mode: 'closed' | 'open';
33
45
  ctor: any;
34
46
  aChildren?: VNodes;
35
47
  }
36
- export interface VText extends VNode {
37
- sel: undefined;
38
- children: undefined;
39
- elm: Node | undefined;
40
- text: string;
41
- key: undefined;
42
- }
43
- export interface VComment extends VNode {
44
- sel: undefined;
45
- children: undefined;
46
- text: string;
47
- key: undefined;
48
- }
49
48
  export interface VNodeData {
50
49
  props?: Record<string, any>;
51
50
  attrs?: Record<string, string | number | boolean>;
@@ -54,7 +53,7 @@ export interface VNodeData {
54
53
  classMap?: Record<string, boolean>;
55
54
  styleDecls?: Array<[string, string, boolean]>;
56
55
  context?: Record<string, Record<string, any>>;
57
- on?: Record<string, Function>;
56
+ on?: Record<string, (event: Event) => any>;
58
57
  svg?: boolean;
59
58
  }
60
59
  export interface VElementData extends VNodeData {
@@ -66,5 +65,6 @@ export interface Hooks<N extends VNode> {
66
65
  move: (vNode: N, parentNode: Node, referenceNode: Node | null) => void;
67
66
  update: (oldVNode: N, vNode: N) => void;
68
67
  remove: (vNode: N, parentNode: Node) => void;
69
- hydrate: (vNode: N, node: Node) => void;
70
68
  }
69
+ export declare function isVBaseElement(vnode: VNode): vnode is VElement | VCustomElement;
70
+ export declare function isSameVnode(vnode1: VNode, vnode2: VNode): boolean;
@@ -0,0 +1,122 @@
1
+ export declare type HostNode = any;
2
+ export declare type HostElement = any;
3
+ declare type N = HostNode;
4
+ declare type E = HostElement;
5
+ export declare let ssr: boolean;
6
+ export declare function setSsr(ssrImpl: boolean): void;
7
+ export declare let isNativeShadowDefined: boolean;
8
+ export declare function setIsNativeShadowDefined(isNativeShadowDefinedImpl: boolean): void;
9
+ export declare let isSyntheticShadowDefined: boolean;
10
+ export declare function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl: boolean): void;
11
+ declare type HTMLElementType = typeof HTMLElement;
12
+ declare let HTMLElementExported: HTMLElementType;
13
+ export { HTMLElementExported as HTMLElement };
14
+ export declare function setHTMLElement(HTMLElementImpl: HTMLElementType): void;
15
+ declare type isHydratingFunc = () => boolean;
16
+ export declare let isHydrating: isHydratingFunc;
17
+ export declare function setIsHydrating(isHydratingImpl: isHydratingFunc): void;
18
+ declare type insertFunc = (node: N, parent: E, anchor: N | null) => void;
19
+ export declare let insert: insertFunc;
20
+ export declare function setInsert(insertImpl: insertFunc): void;
21
+ declare type removeFunc = (node: N, parent: E) => void;
22
+ export declare let remove: removeFunc;
23
+ export declare function setRemove(removeImpl: removeFunc): void;
24
+ declare type createElementFunc = (tagName: string, namespace?: string) => E;
25
+ export declare let createElement: createElementFunc;
26
+ export declare function setCreateElement(createElementImpl: createElementFunc): void;
27
+ declare type createTextFunc = (content: string) => N;
28
+ export declare let createText: createTextFunc;
29
+ export declare function setCreateText(createTextImpl: createTextFunc): void;
30
+ declare type createCommentFunc = (content: string) => N;
31
+ export declare let createComment: createCommentFunc;
32
+ export declare function setCreateComment(createCommentImpl: createCommentFunc): void;
33
+ declare type nextSiblingFunc = (node: N) => N | null;
34
+ export declare let nextSibling: nextSiblingFunc;
35
+ export declare function setNextSibling(nextSiblingImpl: nextSiblingFunc): void;
36
+ declare type attachShadowFunc = (element: E, options: ShadowRootInit) => N;
37
+ export declare let attachShadow: attachShadowFunc;
38
+ export declare function setAttachShadow(attachShadowImpl: attachShadowFunc): void;
39
+ declare type getPropertyFunc = (node: N, key: string) => any;
40
+ export declare let getProperty: getPropertyFunc;
41
+ export declare function setGetProperty(getPropertyImpl: getPropertyFunc): void;
42
+ declare type setPropertyFunc = (node: N, key: string, value: any) => void;
43
+ export declare let setProperty: setPropertyFunc;
44
+ export declare function setSetProperty(setPropertyImpl: setPropertyFunc): void;
45
+ declare type setTextFunc = (node: N, content: string) => void;
46
+ export declare let setText: setTextFunc;
47
+ export declare function setSetText(setTextImpl: setTextFunc): void;
48
+ declare type getAttributeFunc = (element: E, name: string, namespace?: string | null) => string | null;
49
+ export declare let getAttribute: getAttributeFunc;
50
+ export declare function setGetAttribute(getAttributeImpl: getAttributeFunc): void;
51
+ declare type setAttributeFunc = (element: E, name: string, value: string, namespace?: string | null) => void;
52
+ export declare let setAttribute: setAttributeFunc;
53
+ export declare function setSetAttribute(setAttributeImpl: setAttributeFunc): void;
54
+ declare type removeAttributeFunc = (element: E, name: string, namespace?: string | null) => void;
55
+ export declare let removeAttribute: removeAttributeFunc;
56
+ export declare function setRemoveAttribute(removeAttributeImpl: removeAttributeFunc): void;
57
+ declare type addEventListenerFunc = (target: N, type: string, callback: (event: Event) => any, options?: AddEventListenerOptions | boolean) => void;
58
+ export declare let addEventListener: addEventListenerFunc;
59
+ export declare function setAddEventListener(addEventListenerImpl: addEventListenerFunc): void;
60
+ declare type removeEventListenerFunc = (target: N, type: string, callback: (event: Event) => any, options?: EventListenerOptions | boolean) => void;
61
+ export declare let removeEventListener: removeEventListenerFunc;
62
+ export declare function setRemoveEventListener(removeEventListenerImpl: removeEventListenerFunc): void;
63
+ declare type dispatchEventFunc = (target: N, event: Event) => boolean;
64
+ export declare let dispatchEvent: dispatchEventFunc;
65
+ export declare function setDispatchEvent(dispatchEventImpl: dispatchEventFunc): void;
66
+ declare type getClassListFunc = (element: E) => DOMTokenList;
67
+ export declare let getClassList: getClassListFunc;
68
+ export declare function setGetClassList(getClassListImpl: getClassListFunc): void;
69
+ declare type setCSSStylePropertyFunc = (element: E, name: string, value: string, important: boolean) => void;
70
+ export declare let setCSSStyleProperty: setCSSStylePropertyFunc;
71
+ export declare function setSetCSSStyleProperty(setCSSStylePropertyImpl: setCSSStylePropertyFunc): void;
72
+ declare type getBoundingClientRectFunc = (element: E) => ClientRect;
73
+ export declare let getBoundingClientRect: getBoundingClientRectFunc;
74
+ export declare function setGetBoundingClientRect(getBoundingClientRectImpl: getBoundingClientRectFunc): void;
75
+ declare type querySelectorFunc = (element: E, selectors: string) => E | null;
76
+ export declare let querySelector: querySelectorFunc;
77
+ export declare function setQuerySelector(querySelectorImpl: querySelectorFunc): void;
78
+ declare type querySelectorAllFunc = (element: E, selectors: string) => NodeList;
79
+ export declare let querySelectorAll: querySelectorAllFunc;
80
+ export declare function setQuerySelectorAll(querySelectorAllImpl: querySelectorAllFunc): void;
81
+ declare type getElementsByTagNameFunc = (element: E, tagNameOrWildCard: string) => HTMLCollection;
82
+ export declare let getElementsByTagName: getElementsByTagNameFunc;
83
+ export declare function setGetElementsByTagName(getElementsByTagNameImpl: getElementsByTagNameFunc): void;
84
+ declare type getElementsByClassNameFunc = (element: E, names: string) => HTMLCollection;
85
+ export declare let getElementsByClassName: getElementsByClassNameFunc;
86
+ export declare function setGetElementsByClassName(getElementsByClassNameImpl: getElementsByClassNameFunc): void;
87
+ declare type getChildrenFunc = (element: E) => HTMLCollection;
88
+ export declare let getChildren: getChildrenFunc;
89
+ export declare function setGetChildren(getChildrenImpl: getChildrenFunc): void;
90
+ declare type getChildNodesFunc = (element: E) => NodeList;
91
+ export declare let getChildNodes: getChildNodesFunc;
92
+ export declare function setGetChildNodes(getChildNodesImpl: getChildNodesFunc): void;
93
+ declare type getFirstChildFunc = (element: E) => N | null;
94
+ export declare let getFirstChild: getFirstChildFunc;
95
+ export declare function setGetFirstChild(getFirstChildImpl: getFirstChildFunc): void;
96
+ declare type getFirstElementChildFunc = (element: E) => E | null;
97
+ export declare let getFirstElementChild: getFirstElementChildFunc;
98
+ export declare function setGetFirstElementChild(getFirstElementChildImpl: getFirstElementChildFunc): void;
99
+ declare type getLastChildFunc = (element: E) => N | null;
100
+ export declare let getLastChild: getLastChildFunc;
101
+ export declare function setGetLastChild(getLastChildImpl: getLastChildFunc): void;
102
+ declare type getLastElementChildFunc = (element: E) => E | null;
103
+ export declare let getLastElementChild: getLastElementChildFunc;
104
+ export declare function setGetLastElementChild(getLastElementChildImpl: getLastElementChildFunc): void;
105
+ declare type isConnectedFunc = (node: N) => boolean;
106
+ export declare let isConnected: isConnectedFunc;
107
+ export declare function setIsConnected(isConnectedImpl: isConnectedFunc): void;
108
+ declare type insertGlobalStylesheetFunc = (content: string) => void;
109
+ export declare let insertGlobalStylesheet: insertGlobalStylesheetFunc;
110
+ export declare function setInsertGlobalStylesheet(insertGlobalStylesheetImpl: insertGlobalStylesheetFunc): void;
111
+ declare type insertStylesheetFunc = (content: string, target: N) => void;
112
+ export declare let insertStylesheet: insertStylesheetFunc;
113
+ export declare function setInsertStylesheet(insertStylesheetImpl: insertStylesheetFunc): void;
114
+ declare type assertInstanceOfHTMLElementFunc = (elm: any, msg: string) => void;
115
+ export declare let assertInstanceOfHTMLElement: assertInstanceOfHTMLElementFunc;
116
+ export declare function setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElementImpl: assertInstanceOfHTMLElementFunc): void;
117
+ declare type defineCustomElementFunc = (name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions) => void;
118
+ export declare let defineCustomElement: defineCustomElementFunc;
119
+ export declare function setDefineCustomElement(defineCustomElementImpl: defineCustomElementFunc): void;
120
+ declare type getCustomElementFunc = (name: string) => CustomElementConstructor | undefined;
121
+ export declare let getCustomElement: getCustomElementFunc;
122
+ export declare function setGetCustomElement(getCustomElementImpl: getCustomElementFunc): void;
@@ -1,11 +0,0 @@
1
- /**
2
- @license
3
- Copyright (c) 2015 Simon Friis Vindum.
4
- This code may only be used under the MIT License found at
5
- https://github.com/snabbdom/snabbdom/blob/master/LICENSE
6
- Code distributed by Snabbdom as part of the Snabbdom project at
7
- https://github.com/snabbdom/snabbdom/
8
- */
9
- import { VNodes } from './types';
10
- export declare function updateDynamicChildren(parentElm: Node, oldCh: VNodes, newCh: VNodes): void;
11
- export declare function updateStaticChildren(parentElm: Node, oldCh: VNodes, newCh: VNodes): void;
@@ -1,22 +0,0 @@
1
- import { VM } from './vm';
2
- import { VNode, VCustomElement, VElement, VNodes } from '../3rdparty/snabbdom/types';
3
- export declare function updateNodeHook(oldVnode: VNode, vnode: VNode): void;
4
- export declare function insertNodeHook(vnode: VNode, parentNode: Node, referenceNode: Node | null): void;
5
- export declare function removeNodeHook(vnode: VNode, parentNode: Node): void;
6
- export declare function createElmHook(vnode: VElement): void;
7
- export declare const enum LWCDOMMode {
8
- manual = "manual"
9
- }
10
- export declare function hydrateElmHook(vnode: VElement): void;
11
- export declare function fallbackElmHook(elm: Element, vnode: VElement): void;
12
- export declare function updateElmHook(oldVnode: VElement, vnode: VElement): void;
13
- export declare function updateChildrenHook(oldVnode: VElement, vnode: VElement): void;
14
- export declare function allocateChildrenHook(vnode: VCustomElement, vm: VM): void;
15
- export declare function createViewModelHook(elm: HTMLElement, vnode: VCustomElement): void;
16
- export declare function createCustomElmHook(vnode: VCustomElement): void;
17
- export declare function createChildrenHook(vnode: VElement): void;
18
- export declare function hydrateChildrenHook(elmChildren: NodeListOf<ChildNode>, children: VNodes, vm?: VM): void;
19
- export declare function updateCustomElmHook(oldVnode: VCustomElement, vnode: VCustomElement): void;
20
- export declare function removeElmHook(vnode: VElement): void;
21
- export declare function markAsDynamicChildren(children: VNodes): void;
22
- export declare function hasDynamicChildren(children: VNodes): boolean;
@@ -1,46 +0,0 @@
1
- export declare type HostNode = any;
2
- export declare type HostElement = any;
3
- export interface Renderer<N = HostNode, E = HostElement> {
4
- ssr: boolean;
5
- isHydrating(): boolean;
6
- isNativeShadowDefined: boolean;
7
- isSyntheticShadowDefined: boolean;
8
- insert(node: N, parent: E, anchor: N | null): void;
9
- remove(node: N, parent: E): void;
10
- createElement(tagName: string, namespace?: string): E;
11
- createText(content: string): N;
12
- createComment(content: string): N;
13
- nextSibling(node: N): N | null;
14
- attachShadow(element: E, options: ShadowRootInit): N;
15
- getProperty(node: N, key: string): any;
16
- setProperty(node: N, key: string, value: any): void;
17
- setText(node: N, content: string): void;
18
- getAttribute(element: E, name: string, namespace?: string | null): string | null;
19
- setAttribute(element: E, name: string, value: string, namespace?: string | null): void;
20
- removeAttribute(element: E, name: string, namespace?: string | null): void;
21
- addEventListener(target: E, type: string, callback: (event: Event) => any, options?: AddEventListenerOptions | boolean): void;
22
- removeEventListener(target: E, type: string, callback: (event: Event) => any, options?: EventListenerOptions | boolean): void;
23
- dispatchEvent(target: N, event: Event): boolean;
24
- getClassList(element: E): DOMTokenList;
25
- setCSSStyleProperty(element: E, name: string, value: string, important: boolean): void;
26
- getBoundingClientRect(element: E): ClientRect;
27
- querySelector(element: E, selectors: string): E | null;
28
- querySelectorAll(element: E, selectors: string): NodeList;
29
- getElementsByTagName(element: E, tagNameOrWildCard: string): HTMLCollection;
30
- getElementsByClassName(element: E, names: string): HTMLCollection;
31
- getChildren(element: E): HTMLCollection;
32
- getChildNodes(element: E): NodeList;
33
- getFirstChild(element: E): N | null;
34
- getFirstElementChild(element: E): E | null;
35
- getLastChild(element: E): N | null;
36
- getLastElementChild(element: E): E | null;
37
- isConnected(node: N): boolean;
38
- insertGlobalStylesheet(content: string): void;
39
- insertStylesheet(content: string, target: N): void;
40
- assertInstanceOfHTMLElement?(elm: any, msg: string): void;
41
- defineCustomElement(name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions): void;
42
- getCustomElement(name: string): CustomElementConstructor | undefined;
43
- HTMLElement: typeof HTMLElement;
44
- }
45
- export declare const HTMLElementConstructor: typeof HTMLElement;
46
- export declare const HTMLElementPrototype: HTMLElement;