@mml-io/observable-dom-common 0.0.42
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/build/index.d.ts +1 -0
- package/build/index.js +18 -0
- package/build/index.js.map +7 -0
- package/package.json +21 -0
- package/src/index.ts +48 -0
package/build/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../src/index";
|
package/build/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/index.ts
|
|
16
|
+
var src_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(src_exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { RemoteEvent } from \"@mml-io/networked-dom-protocol\";\n\nexport type { RemoteEvent } from \"@mml-io/networked-dom-protocol\";\n\nexport type StaticVirtualDomElement = {\n nodeId: number;\n tag: string;\n textContent?: string;\n attributes: { [key: string]: string };\n childNodes: Array<StaticVirtualDomElement>;\n};\n\nexport type StaticVirtualDomMutationIdsRecord = {\n type: \"attributes\" | \"characterData\" | \"childList\";\n targetId: number;\n addedNodes: Array<StaticVirtualDomElement>;\n removedNodeIds: Array<number>;\n previousSiblingId: number | null;\n attribute: { attributeName: string; value: string | null } | null;\n};\n\nexport type ObservableDomInterface = {\n addConnectedUserId(connectionId: number): void;\n removeConnectedUserId(connectionId: number): void;\n dispose(): void;\n dispatchRemoteEventFromConnectionId(connectionId: number, remoteEvent: RemoteEvent): void;\n addIPCWebsocket(webSocket: WebSocket): void;\n};\n\nexport type LogMessage = {\n level: \"system\" | \"error\" | \"warn\" | \"log\" | \"info\";\n content: any[];\n};\n\nexport type ObservableDomMessage = {\n snapshot?: StaticVirtualDomElement;\n mutation?: StaticVirtualDomMutationIdsRecord;\n logMessage?: LogMessage;\n documentTime: number;\n};\n\nexport type ObservableDOMParameters = {\n htmlPath: string;\n htmlContents: string;\n params: object;\n ignoreTextNodes: boolean;\n pingIntervalMilliseconds?: number;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mml-io/observable-dom-common",
|
|
3
|
+
"version": "0.0.42",
|
|
4
|
+
"main": "./build/index.js",
|
|
5
|
+
"types": "./build/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"/build",
|
|
8
|
+
"/src"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"type-check": "tsc --noEmit",
|
|
12
|
+
"build": "node ./build.js --build",
|
|
13
|
+
"iterate": "node ./build.js --watch",
|
|
14
|
+
"npm-publish": "npm run build && publish-if-not-exists --access=public",
|
|
15
|
+
"lint": "eslint \"./src/**/*.{js,jsx,ts,tsx}\" --max-warnings 0",
|
|
16
|
+
"lint-fix": "eslint \"./src/**/*.{js,jsx,ts,tsx}\" --fix"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@mml-io/networked-dom-protocol": "^0.0.42"
|
|
20
|
+
}
|
|
21
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { RemoteEvent } from "@mml-io/networked-dom-protocol";
|
|
2
|
+
|
|
3
|
+
export type { RemoteEvent } from "@mml-io/networked-dom-protocol";
|
|
4
|
+
|
|
5
|
+
export type StaticVirtualDomElement = {
|
|
6
|
+
nodeId: number;
|
|
7
|
+
tag: string;
|
|
8
|
+
textContent?: string;
|
|
9
|
+
attributes: { [key: string]: string };
|
|
10
|
+
childNodes: Array<StaticVirtualDomElement>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type StaticVirtualDomMutationIdsRecord = {
|
|
14
|
+
type: "attributes" | "characterData" | "childList";
|
|
15
|
+
targetId: number;
|
|
16
|
+
addedNodes: Array<StaticVirtualDomElement>;
|
|
17
|
+
removedNodeIds: Array<number>;
|
|
18
|
+
previousSiblingId: number | null;
|
|
19
|
+
attribute: { attributeName: string; value: string | null } | null;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type ObservableDomInterface = {
|
|
23
|
+
addConnectedUserId(connectionId: number): void;
|
|
24
|
+
removeConnectedUserId(connectionId: number): void;
|
|
25
|
+
dispose(): void;
|
|
26
|
+
dispatchRemoteEventFromConnectionId(connectionId: number, remoteEvent: RemoteEvent): void;
|
|
27
|
+
addIPCWebsocket(webSocket: WebSocket): void;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type LogMessage = {
|
|
31
|
+
level: "system" | "error" | "warn" | "log" | "info";
|
|
32
|
+
content: any[];
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type ObservableDomMessage = {
|
|
36
|
+
snapshot?: StaticVirtualDomElement;
|
|
37
|
+
mutation?: StaticVirtualDomMutationIdsRecord;
|
|
38
|
+
logMessage?: LogMessage;
|
|
39
|
+
documentTime: number;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type ObservableDOMParameters = {
|
|
43
|
+
htmlPath: string;
|
|
44
|
+
htmlContents: string;
|
|
45
|
+
params: object;
|
|
46
|
+
ignoreTextNodes: boolean;
|
|
47
|
+
pingIntervalMilliseconds?: number;
|
|
48
|
+
};
|