From 292da46769b5f1ccdb65a43120f8e10b939b44ea Mon Sep 17 00:00:00 2001
From: Martin Berg Alstad <600878@stud.hvl.no>
Date: Sat, 8 Apr 2023 12:05:08 +0200
Subject: [PATCH] Added version to fetch props. Renamed interfaces to a
 declaration file

---
 src/components/button.tsx               |  2 +-
 src/components/card.tsx                 |  2 +-
 src/components/dialog.tsx               |  2 +-
 src/components/footer.tsx               |  2 +-
 src/components/header.tsx               |  2 +-
 src/components/input.tsx                |  2 +-
 src/components/layout.tsx               |  2 +-
 src/components/link.tsx                 |  2 +-
 src/components/menu.tsx                 |  2 +-
 src/components/output.tsx               |  2 +-
 src/components/row.tsx                  |  2 +-
 src/components/truth-table.tsx          |  4 ++--
 src/index.tsx                           |  2 +-
 src/truth-table.tsx                     |  2 +-
 env.d.ts => src/types/env.d.ts          |  0
 src/types/{interfaces.ts => types.d.ts} | 25 +++++++++++++------------
 16 files changed, 28 insertions(+), 27 deletions(-)
 rename env.d.ts => src/types/env.d.ts (100%)
 rename src/types/{interfaces.ts => types.d.ts} (65%)

diff --git a/src/components/button.tsx b/src/components/button.tsx
index 089a1ba..e52e413 100644
--- a/src/components/button.tsx
+++ b/src/components/button.tsx
@@ -1,6 +1,6 @@
 /* @refresh reload */
 import { type Component, createSignal } from "solid-js";
-import type { ButtonProps, TitleProps } from "../types/interfaces";
+import type { ButtonProps, TitleProps } from "../types/types";
 
 interface SwitchProps extends TitleProps {
     defaultValue?: boolean,
diff --git a/src/components/card.tsx b/src/components/card.tsx
index 672ca99..6b5f1af 100644
--- a/src/components/card.tsx
+++ b/src/components/card.tsx
@@ -1,6 +1,6 @@
 /* @refresh reload */
 import { type Component } from "solid-js";
-import type { CardProps } from "../types/interfaces";
+import type { CardProps } from "../types/types";
 import { Link } from "./link";
 
 const Card: Component<CardProps> = ({ children, className, title, to, newTab = false }) => {
diff --git a/src/components/dialog.tsx b/src/components/dialog.tsx
index 305938b..b987a66 100644
--- a/src/components/dialog.tsx
+++ b/src/components/dialog.tsx
@@ -1,6 +1,6 @@
 /* @refresh reload */
 import { Dialog, DialogDescription, DialogPanel, DialogTitle } from "solid-headless";
-import type { TitleProps } from "../types/interfaces";
+import type { TitleProps } from "../types/types";
 import { createEffect, createSignal, JSX } from "solid-js";
 import { Button } from "./button";
 import { Portal } from "solid-js/web";
diff --git a/src/components/footer.tsx b/src/components/footer.tsx
index 2609df0..159c66b 100644
--- a/src/components/footer.tsx
+++ b/src/components/footer.tsx
@@ -1,6 +1,6 @@
 /* @refresh reload */
 import { type Component } from "solid-js";
-import type { SimpleProps } from "../types/interfaces";
+import type { SimpleProps } from "../types/types";
 import { Link } from "./link";
 
 const Footer: Component<SimpleProps> = ({ className }) => {
diff --git a/src/components/header.tsx b/src/components/header.tsx
index 70cd4c1..181fbc0 100644
--- a/src/components/header.tsx
+++ b/src/components/header.tsx
@@ -1,6 +1,6 @@
 /* @refresh reload */
 import { type Component, Show } from "solid-js";
-import type { TitleProps } from "../types/interfaces";
+import type { TitleProps } from "../types/types";
 import { Icon } from "solid-heroicons";
 import { chevronLeft } from "solid-heroicons/solid";
 import { Link } from "./link";
diff --git a/src/components/input.tsx b/src/components/input.tsx
index 930b165..2d14f03 100644
--- a/src/components/input.tsx
+++ b/src/components/input.tsx
@@ -1,6 +1,6 @@
 /* @refresh reload */
 import { type Component, createSignal, JSX, Setter } from "solid-js";
-import type { InputProps } from "../types/interfaces";
+import type { InputProps } from "../types/types";
 import Row from "./row";
 
 function setupEventListener(id: string, setIsHover: Setter<boolean>): () => void {
diff --git a/src/components/layout.tsx b/src/components/layout.tsx
index ec791f6..2c68d59 100644
--- a/src/components/layout.tsx
+++ b/src/components/layout.tsx
@@ -1,6 +1,6 @@
 /* @refresh reload */
 import { type Component } from "solid-js";
-import type { TitleProps } from "../types/interfaces";
+import type { TitleProps } from "../types/types";
 import Header from "./header";
 import Footer from "./footer";
 
diff --git a/src/components/link.tsx b/src/components/link.tsx
index 06b431c..e6e51b9 100644
--- a/src/components/link.tsx
+++ b/src/components/link.tsx
@@ -1,6 +1,6 @@
 /* @refresh reload */
 import { type Component } from "solid-js";
-import type { LinkProps } from "../types/interfaces";
+import type { LinkProps } from "../types/types";
 
 export const Link: Component<LinkProps> = (
     {
diff --git a/src/components/menu.tsx b/src/components/menu.tsx
index 5b9abe2..27f0351 100644
--- a/src/components/menu.tsx
+++ b/src/components/menu.tsx
@@ -1,5 +1,5 @@
 /* @refresh reload */
-import type { TitleProps } from "../types/interfaces";
+import type { TitleProps } from "../types/types";
 import { type Component, createEffect, createSignal, JSX, Show } from "solid-js";
 import { Button } from "./button";
 
diff --git a/src/components/output.tsx b/src/components/output.tsx
index 1d77adb..b6f4f03 100644
--- a/src/components/output.tsx
+++ b/src/components/output.tsx
@@ -1,6 +1,6 @@
 import { Disclosure, DisclosureButton, DisclosurePanel, Transition } from "solid-headless";
 import { Icon } from "solid-heroicons";
-import type { ChildProps, TitleProps } from "../types/interfaces";
+import type { ChildProps, TitleProps } from "../types/types";
 import { Component, JSX } from "solid-js";
 import { chevronUp } from "solid-heroicons/solid";
 
diff --git a/src/components/row.tsx b/src/components/row.tsx
index d997c0b..f79d9af 100644
--- a/src/components/row.tsx
+++ b/src/components/row.tsx
@@ -1,6 +1,6 @@
 /* @refresh reload */
 import { type Component } from "solid-js";
-import type { ChildProps } from "../types/interfaces";
+import type { ChildProps } from "../types/types";
 
 const Row: Component<ChildProps> = ({ children, className }) => {
     return <div class={ `flex-row-center ${ className }` }>{ children }</div>
diff --git a/src/components/truth-table.tsx b/src/components/truth-table.tsx
index 0298a6c..b0893e1 100644
--- a/src/components/truth-table.tsx
+++ b/src/components/truth-table.tsx
@@ -1,6 +1,6 @@
 /* @refresh reload */
-import type { SimpleProps } from "../types/interfaces";
-import type { Table } from "../types/interfaces";
+import type { SimpleProps } from "../types/types";
+import type { Table } from "../types/types";
 import { For } from "solid-js/web";
 import { type Component } from "solid-js";
 
diff --git a/src/index.tsx b/src/index.tsx
index 26d9c4b..a10a875 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -5,7 +5,7 @@ import "./index.css";
 import { type Component } from "solid-js";
 import Layout from "./components/layout";
 import Card from "./components/card";
-import type { CardProps } from "./types/interfaces";
+import type { CardProps } from "./types/types";
 import { Link } from "./components/link";
 
 const apiRoot = "https://api.martials.no";
diff --git a/src/truth-table.tsx b/src/truth-table.tsx
index 0852b6c..afa8463 100644
--- a/src/truth-table.tsx
+++ b/src/truth-table.tsx
@@ -6,7 +6,7 @@ import TruthTable from "./components/truth-table";
 import { InfoBox, MyDisclosure, MyDisclosureContainer } from "./components/output";
 import { diffChars } from "diff";
 import MyMenu from "./components/menu";
-import type { FetchResult } from "./types/interfaces";
+import type { FetchResult } from "./types/types";
 import { type Accessor, type Component, createSignal, JSX, onMount, Show } from "solid-js";
 import { For, render } from "solid-js/web";
 import Row from "./components/row";
diff --git a/env.d.ts b/src/types/env.d.ts
similarity index 100%
rename from env.d.ts
rename to src/types/env.d.ts
diff --git a/src/types/interfaces.ts b/src/types/types.d.ts
similarity index 65%
rename from src/types/interfaces.ts
rename to src/types/types.d.ts
index 90a9eae..84bfe3c 100644
--- a/src/types/interfaces.ts
+++ b/src/types/types.d.ts
@@ -1,6 +1,6 @@
 import { JSX } from "solid-js";
 
-export interface SimpleProps {
+interface SimpleProps {
     name?: string;
     className?: string,
     style?: JSX.CSSProperties,
@@ -8,37 +8,37 @@ export interface SimpleProps {
     title?: string,
 }
 
-export interface ChildProps extends SimpleProps {
+interface ChildProps extends SimpleProps {
     children?: JSX.Element,
 }
 
-export interface LinkProps extends ChildProps {
+interface LinkProps extends ChildProps {
     to?: string,
     rel?: string,
     newTab?: boolean,
 }
 
-export interface TitleProps extends ChildProps {
+interface TitleProps extends ChildProps {
     title?: string,
 }
 
-export interface ButtonProps extends TitleProps {
+interface ButtonProps extends TitleProps {
     onClick?: JSX.EventHandlerUnion<HTMLButtonElement, MouseEvent>,
     type?: "button" | "submit" | "reset",
 }
 
-export interface InputProps<T> extends TitleProps {
+interface InputProps<T> extends TitleProps {
     onInput?: JSX.EventHandlerUnion<T, Event>,
     placeholder?: string | null,
     required?: boolean,
     type?: string,
 }
 
-export interface CardProps extends LinkProps {
+interface CardProps extends LinkProps {
     title?: string;
 }
 
-export type Expression = {
+type Expression = {
     leading: string,
     left: Expression | null,
     operator: Operator | null,
@@ -47,18 +47,19 @@ export type Expression = {
     atomic: string | null,
 };
 
-export type Operator = "AND" | "OR" | "NOT" | "IMPLICATION";
+type Operator = "AND" | "OR" | "NOT" | "IMPLICATION";
 
-export type Table = boolean[][];
+type Table = boolean[][];
 
-export type OrderOfOperations = {
+type OrderOfOperations = {
     before: string,
     after: string,
     law: string,
 }[];
 
-export type FetchResult = {
+type FetchResult = {
     status: string,
+    version: string | null,
     before: string,
     after: string,
     orderOperations: OrderOfOperations | null,