@viewfly/core 0.0.1-alpha.13 → 0.0.1-alpha.14
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/bundles/_utils/make-error.d.ts +1 -0
- package/bundles/foundation/_api.d.ts +2 -0
- package/bundles/foundation/_utils.d.ts +9 -0
- package/bundles/foundation/injection-tokens.d.ts +17 -0
- package/bundles/foundation/renderer.d.ts +33 -0
- package/bundles/index.esm.js +1215 -0
- package/bundles/index.js +1244 -0
- package/bundles/model/_api.d.ts +3 -0
- package/bundles/model/component.d.ts +218 -0
- package/bundles/model/jsx-element.d.ts +31 -0
- package/bundles/model/root.component.d.ts +11 -0
- package/bundles/public-api.d.ts +6 -0
- package/bundles/viewfly.d.ts +37 -0
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function makeError(name: string): (message: string) => Error;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ObjectChanges {
|
|
2
|
+
remove: [string, any][];
|
|
3
|
+
add: [string, any][];
|
|
4
|
+
replace: [string, any, any][];
|
|
5
|
+
}
|
|
6
|
+
export declare const refKey = "ref";
|
|
7
|
+
export declare function getObjectChanges(newProps: Record<string, any>, oldProps: Record<string, any>): ObjectChanges;
|
|
8
|
+
export declare function classToString(config: unknown): any;
|
|
9
|
+
export declare function styleToObject(style: string | Record<string, any>): Record<string, any>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type NativeNode = Record<string, any>;
|
|
2
|
+
export declare abstract class NativeRenderer<ElementNode = NativeNode, TextNode = NativeNode> {
|
|
3
|
+
abstract createElement(name: string): ElementNode;
|
|
4
|
+
abstract createTextNode(textContent: string): TextNode;
|
|
5
|
+
abstract setProperty(node: ElementNode, key: string, value: any): void;
|
|
6
|
+
abstract appendChild(parent: ElementNode, newChild: ElementNode | TextNode): void;
|
|
7
|
+
abstract prependChild(parent: ElementNode, newChild: ElementNode | TextNode): void;
|
|
8
|
+
abstract removeProperty(node: ElementNode, key: string): void;
|
|
9
|
+
abstract setStyle(target: ElementNode, key: string, value: any): void;
|
|
10
|
+
abstract removeStyle(target: ElementNode, key: string): void;
|
|
11
|
+
abstract setClass(target: ElementNode, value: string): void;
|
|
12
|
+
abstract listen<T = any>(node: ElementNode, type: string, callback: (ev: T) => any): void;
|
|
13
|
+
abstract unListen(node: ElementNode, type: string, callback: (ev: any) => any): void;
|
|
14
|
+
abstract remove(node: ElementNode | TextNode): void;
|
|
15
|
+
abstract syncTextContent(target: TextNode, content: string): void;
|
|
16
|
+
abstract insertAfter(newNode: ElementNode | TextNode, ref: ElementNode | TextNode): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { RootComponent } from '../model/_api';
|
|
2
|
+
import { NativeNode, NativeRenderer } from './injection-tokens';
|
|
3
|
+
export declare abstract class RootComponentRef {
|
|
4
|
+
abstract component: RootComponent;
|
|
5
|
+
abstract host: NativeNode;
|
|
6
|
+
}
|
|
7
|
+
export declare class Renderer {
|
|
8
|
+
private nativeRenderer;
|
|
9
|
+
private rootComponentRef;
|
|
10
|
+
private componentAtomCaches;
|
|
11
|
+
constructor(nativeRenderer: NativeRenderer, rootComponentRef: RootComponentRef);
|
|
12
|
+
render(): void;
|
|
13
|
+
refresh(): void;
|
|
14
|
+
private reconcile;
|
|
15
|
+
private getPrevSibling;
|
|
16
|
+
private reconcileElement;
|
|
17
|
+
private applyChanges;
|
|
18
|
+
private diff;
|
|
19
|
+
private createChanges;
|
|
20
|
+
private cleanView;
|
|
21
|
+
private buildView;
|
|
22
|
+
private componentRender;
|
|
23
|
+
private createChainByComponentFactory;
|
|
24
|
+
private createChainByJSXElement;
|
|
25
|
+
private createChainByJSXText;
|
|
26
|
+
private createChainByChildren;
|
|
27
|
+
private linkTemplate;
|
|
28
|
+
private link;
|
|
29
|
+
private createElement;
|
|
30
|
+
private createTextNode;
|
|
31
|
+
private updateNativeNodeProperties;
|
|
32
|
+
private applyRefs;
|
|
33
|
+
}
|