summaryrefslogtreecommitdiffstats
path: root/typescript/src/entrypoint.ts
diff options
context:
space:
mode:
authorname <email@example.com>2023-09-27 13:34:23 +0200
committername <email@example.com>2023-09-27 13:34:23 +0200
commit72d8b4e6bee0ffac79e96dd649a9da2adb86b507 (patch)
tree8d1f37e5d88a598675b1a65128c35323c99825f5 /typescript/src/entrypoint.ts
parentMerge pull request 'Please consider adding my instance' (#2) from superprivacy/wolfree-dockerfile:main into main (diff)
downloadwolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar.gz
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar.bz2
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar.lz
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar.xz
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar.zst
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.zip
Diffstat (limited to 'typescript/src/entrypoint.ts')
-rw-r--r--typescript/src/entrypoint.ts33
1 files changed, 33 insertions, 0 deletions
diff --git a/typescript/src/entrypoint.ts b/typescript/src/entrypoint.ts
new file mode 100644
index 0000000..e939d92
--- /dev/null
+++ b/typescript/src/entrypoint.ts
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: AGPL-3.0-or-later */
+
+import type EntrypointParameter from "./EntrypointParameter.js";
+import getAjaxResponse from "./getAjaxResponse.js";
+import getAjaxSettings from "./getAjaxSettings.js";
+import getNewHTML from "./getNewHTML.js";
+import listenToChangeEvent from "./listenToChangeEvent.js";
+import placeholder from "./placeholder.js";
+import reRenderComponent from "./reRenderComponent.js";
+import setContentEditable from "./setContentEditable.js";
+import typescriptExhaustive from "./typescriptExhaustive.js";
+
+export default async (
+ EntrypointParameter: EntrypointParameter
+): Promise<void> => {
+ try {
+ Object.freeze(EntrypointParameter);
+ typescriptExhaustive(EntrypointParameter);
+
+ window.scroll(0, 0);
+ reRenderComponent(placeholder);
+
+ const AjaxSettings = getAjaxSettings(EntrypointParameter);
+ const AjaxResponse = await getAjaxResponse(AjaxSettings);
+ const newHTML = getNewHTML(AjaxSettings, AjaxResponse);
+ reRenderComponent(newHTML);
+
+ listenToChangeEvent(EntrypointParameter);
+ setContentEditable();
+ } catch (error) {
+ console.warn({ error });
+ }
+};