Added version to fetch props. Renamed interfaces to a declaration file
This commit is contained in:
parent
3245769977
commit
292da46769
@ -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,
|
||||
|
@ -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 }) => {
|
||||
|
@ -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";
|
||||
|
@ -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 }) => {
|
||||
|
@ -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";
|
||||
|
@ -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 {
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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> = (
|
||||
{
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
0
env.d.ts → src/types/env.d.ts
vendored
0
env.d.ts → src/types/env.d.ts
vendored
25
src/types/interfaces.ts → src/types/types.d.ts
vendored
25
src/types/interfaces.ts → src/types/types.d.ts
vendored
@ -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,
|
Loading…
x
Reference in New Issue
Block a user