component formatting and types

This commit is contained in:
Julian Krauser 2025-02-14 13:57:55 +01:00
parent c2a7d15eeb
commit ce745c06e5
60 changed files with 464 additions and 301 deletions

View file

@ -1,4 +1,3 @@
import type BaseFile from "../component/baseFile";
import type BaseCollection from "./baseCollection";
export default interface Article extends BaseCollection {}

View file

@ -12,7 +12,7 @@ export default interface BaseCollection {
title: string;
description: string;
date: string | undefined;
date: string;
content: ContentField | undefined;
image: BaseFile | undefined;
attachment: Array<BaseFile>;

View file

@ -1,6 +1,3 @@
import type BaseCollection from "./baseCollection";
export default interface Event extends BaseCollection {
image: undefined;
content: undefined;
}
export default interface Event extends BaseCollection {}

View file

@ -1,13 +1,15 @@
export default interface Lookup {
id: number;
documentId: string;
collection: string;
image_item: boolean;
date_list: boolean;
numbered_item: boolean;
inverse_count: boolean;
reference: string;
createdAt: string;
updatedAt: string;
publishedAt: string;
reference: string;
collection: "events" | "vehicles" | "articles" | "operations";
show_image: boolean;
show_date: boolean;
list_with_date: "none" | "by-year" | "by-month";
items_with_number: "none" | "numbered" | "inverted";
enable_detail: boolean;
}

View file

@ -1,5 +1,3 @@
import type BaseCollection from "./baseCollection";
export default interface Operation extends BaseCollection {
image: undefined;
}
export default interface Operation extends BaseCollection {}

View file

@ -1,5 +1,5 @@
import type { ComponentTypes } from "../component/baseComponent";
import type SharedHero from "../component/sharedHero";
import type ItemsHero from "../component/items/hero";
export default interface Page {
id: number;
@ -10,7 +10,7 @@ export default interface Page {
publishedAt: string;
locale: string;
slug: string;
hero: SharedHero;
hero: ItemsHero;
content: Array<ComponentTypes>;
localizations: any[];
}

View file

@ -1,6 +1,3 @@
import type BaseFile from "../component/baseFile";
import type BaseCollection from "./baseCollection";
export default interface Vehicle extends BaseCollection {
date: undefined;
}
export default interface Vehicle extends BaseCollection {}

View file

@ -1,12 +1,14 @@
import type DynamicZoneColumnImageText from "./dynamicZoneColumnImageText";
import type DynamicZoneDualColumnText from "./dynamicZoneDualColumnText";
import type DynamicZoneEmphasiseArticle from "./dynamicZoneEmphasiseArticle";
import type DynamicZoneFullImage from "./dynamicZoneFullImage";
import type DynamicZoneFullText from "./dynamicZoneFullText";
import type DynamicZoneGallery from "./dynamicZoneGallery";
import type DynamicZoneFileDownload from "./dynamicZoneFileDownload";
import type SharedList from "./sharedList";
import type DynamicZoneEmbedding from "./dynamicZoneEmbedding";
import type SharedEmphasiseArticle from "./shared/emphasiseArticle";
import type SharedList from "./shared/list";
import type DynamicZoneColumnImageText from "./dynamic-zone/columnImageText";
import type DynamicZoneDualColumnText from "./dynamic-zone/dualColumnText";
import type DynamicZoneFullImage from "./dynamic-zone/fullImage";
import type DynamicZoneFullText from "./dynamic-zone/fullText";
import type DynamicZoneGallery from "./dynamic-zone/gallery";
import type DynamicZoneFileDownload from "./dynamic-zone/fileDownload";
import type DynamicZoneEmbedding from "./dynamic-zone/embedding";
import type DynamicZoneSection from "./dynamic-zone/section";
import type DynamicZoneSpacer from "./dynamic-zone/spacer";
export default interface BaseComponent {
__component: ComponentNames;
@ -15,10 +17,12 @@ export default interface BaseComponent {
export type ComponentNames =
| "shared.list"
| "shared.emphasise-article"
| "dynamic-zone.section"
| "dynamic-zone.spacer"
| "dynamic-zone.gallery"
| "dynamic-zone.full-text"
| "dynamic-zone.full-image"
| "dynamic-zone.emphasise-article"
| "dynamic-zone.dual-column-text"
| "dynamic-zone.column-image-text"
| "dynamic-zone.file-download"
@ -26,10 +30,12 @@ export type ComponentNames =
export type ComponentTypes =
| SharedList
| SharedEmphasiseArticle
| DynamicZoneSection
| DynamicZoneSpacer
| DynamicZoneGallery
| DynamicZoneFullText
| DynamicZoneFullImage
| DynamicZoneEmphasiseArticle
| DynamicZoneDualColumnText
| DynamicZoneColumnImageText
| DynamicZoneFileDownload

View file

@ -1,6 +1,6 @@
import type ContentField from "../field/content";
import type BaseComponent from "./baseComponent";
import type BaseFile from "./baseFile";
import type ContentField from "../../field/content";
import type BaseComponent from "../baseComponent";
import type BaseFile from "../baseFile";
export default interface DynamicZoneColumnImageText extends BaseComponent {
__component: "dynamic-zone.column-image-text";

View file

@ -1,5 +1,5 @@
import type ContentField from "../field/content";
import type BaseComponent from "./baseComponent";
import type ContentField from "../../field/content";
import type BaseComponent from "../baseComponent";
export default interface DynamicZoneDualColumnText extends BaseComponent {
__component: "dynamic-zone.dual-column-text";

View file

@ -1,7 +1,6 @@
import type BaseComponent from "./baseComponent";
import type BaseComponent from "../baseComponent";
export default interface DynamicZoneEmbedding extends BaseComponent {
__component: "dynamic-zone.embedding";
title: string;
link: string;
}

View file

@ -1,9 +1,8 @@
import type BaseComponent from "./baseComponent";
import type BaseFile from "./baseFile";
import type BaseComponent from "../baseComponent";
import type BaseFile from "../baseFile";
export default interface DynamicZoneFileDownload extends BaseComponent {
__component: "dynamic-zone.file-download";
enable_download: boolean;
title: string;
file: BaseFile;
}

View file

@ -1,5 +1,5 @@
import type BaseComponent from "./baseComponent";
import type BaseFile from "./baseFile";
import type BaseComponent from "../baseComponent";
import type BaseFile from "../baseFile";
export default interface DynamicZoneFullImage extends BaseComponent {
__component: "dynamic-zone.full-image";

View file

@ -1,5 +1,5 @@
import type ContentField from "../field/content";
import type BaseComponent from "./baseComponent";
import type ContentField from "../../field/content";
import type BaseComponent from "../baseComponent";
export default interface DynamicZoneFullText extends BaseComponent {
__component: "dynamic-zone.full-text";

View file

@ -1,5 +1,5 @@
import type BaseComponent from "./baseComponent";
import type BaseFile from "./baseFile";
import type BaseComponent from "../baseComponent";
import type BaseFile from "../baseFile";
export default interface DynamicZoneGallery extends BaseComponent {
__component: "dynamic-zone.gallery";

View file

@ -0,0 +1,7 @@
import type BaseComponent from "../baseComponent";
export default interface DynamicZoneSection extends BaseComponent {
__component: "dynamic-zone.section";
title: string;
description: string;
}

View file

@ -0,0 +1,5 @@
import type BaseComponent from "../baseComponent";
export default interface DynamicZoneSpacer extends BaseComponent {
__component: "dynamic-zone.spacer";
}

View file

@ -1,10 +0,0 @@
import type Article from "../collection/article";
import type BaseComponent from "./baseComponent";
export default interface DynamicZoneEmphasiseArticle extends BaseComponent {
__component: "dynamic-zone.emphasise-article";
titel: string;
description: string;
articles: Array<Article>;
base_url: string;
}

View file

@ -0,0 +1,8 @@
import type FooterLink from "../items/footerLink";
export default interface Footer {
id: number;
copyright: undefined | string;
maintained_by: undefined | string;
links: FooterLink[];
}

View file

@ -0,0 +1,6 @@
import type NavbarItem from "../items/navbarItem";
export default interface Navbar {
id: number;
navbar_items: NavbarItem[];
}

View file

@ -1,4 +1,4 @@
export default interface SEOComponent {
export default interface SEO {
metaTitle: string;
metaDescription: string;
keywords: string;

View file

@ -1,8 +0,0 @@
import type FooterLink from "./itemsFooterLink";
export default interface Footer {
id: number;
copyright: string;
maintained?: string;
links: FooterLink[];
}

View file

@ -1,8 +0,0 @@
import type BaseFile from "./baseFile";
import type NavbarItem from "./itemsNavbarItem";
export default interface Navbar {
id: number;
logo: BaseFile;
navbar_items: NavbarItem[];
}

View file

@ -0,0 +1,7 @@
import type BaseFile from "../baseFile";
export default interface ItemsHero {
id: number;
title: string | undefined;
banner: BaseFile | undefined;
}

View file

@ -1,4 +1,4 @@
import type NavbarSubItem from "./itemsNavbarSubItem";
import type NavbarSubItem from "./navbarSubItem";
export default interface NavbarItem {
id: number;

View file

@ -1,4 +1,4 @@
import type Page from "../collection/page";
import type Page from "../../collection/page";
export default interface NavbarSubItem {
id: number;

View file

@ -0,0 +1,8 @@
import type Article from "../../collection/article";
import type BaseComponent from "../baseComponent";
export default interface SharedEmphasiseArticle extends BaseComponent {
__component: "shared.emphasise-article";
articles: Array<Article>;
link_to_articles: string;
}

View file

@ -0,0 +1,7 @@
import type Lookup from "../../collection/lookup";
import type BaseComponent from "../baseComponent";
export default interface SharedList extends BaseComponent {
__component: "shared.list";
lookup: Lookup;
}

View file

@ -1,7 +0,0 @@
import type BaseFile from "./baseFile";
export default interface SharedHero {
id: number;
title: string;
banner: BaseFile;
}

View file

@ -1,8 +0,0 @@
import type Lookup from "../collection/lookup";
import type BaseComponent from "./baseComponent";
export default interface SharedList extends BaseComponent {
__component: "shared.list";
enable_detail: boolean;
lookup: Lookup;
}

View file

@ -1,6 +1,7 @@
import type Footer from "../component/globalFooter";
import type Navbar from "../component/globalNavbar";
import type SEOComponent from "../component/seoComponent";
import type BaseFile from "../component/baseFile";
import type Footer from "../component/global/footer";
import type Navbar from "../component/global/navbar";
import type SEO from "../component/global/seo";
export default interface Global {
id: number;
@ -9,7 +10,8 @@ export default interface Global {
updatedAt: string;
publishedAt: string;
locale: string;
navbar: Navbar;
footer: Footer;
SEO: SEOComponent;
logo: BaseFile;
navbar: Navbar | undefined;
footer: Footer | undefined;
SEO: SEO | undefined;
}

View file

@ -8,7 +8,6 @@ export default interface Homepage {
updatedAt: string;
publishedAt: string;
locale: string;
backdrop: BaseFile;
hide_backdrop: boolean;
backdrop: undefined | BaseFile;
content: Array<ComponentTypes>;
}