From 32162b538656f7efe4ed8480ab89f1f26de2eec1 Mon Sep 17 00:00:00 2001
From: Lightling <contact@lightling.xyz>
Date: Thu, 14 Mar 2024 00:21:34 -0400
Subject: [PATCH] forgot to commit types

---
 src/components/inflators/descriptionList.ts |  2 +-
 src/components/inflators/embed.ts           |  2 +-
 src/types/projects/project.ts               | 52 +++++++++++++++++++++
 src/types/projects/tag.ts                   |  8 ++++
 src/types/shared/dateRange.ts               |  4 ++
 src/types/shared/filter.ts                  | 48 +++++++++++++++++++
 src/types/shared/link.ts                    |  5 ++
 7 files changed, 119 insertions(+), 2 deletions(-)
 create mode 100644 src/types/projects/project.ts
 create mode 100644 src/types/projects/tag.ts
 create mode 100644 src/types/shared/dateRange.ts
 create mode 100644 src/types/shared/filter.ts
 create mode 100644 src/types/shared/link.ts

diff --git a/src/components/inflators/descriptionList.ts b/src/components/inflators/descriptionList.ts
index 545b9d1..e932681 100644
--- a/src/components/inflators/descriptionList.ts
+++ b/src/components/inflators/descriptionList.ts
@@ -1,4 +1,4 @@
-import { type ProjectListingInfo } from 'src/types/shared/project'
+import { type ProjectListingInfo } from 'src/types/projects/project'
 import { getFormattedPeriod } from 'src/utilities/dom'
 
 /**
diff --git a/src/components/inflators/embed.ts b/src/components/inflators/embed.ts
index ca813d2..5029a8b 100644
--- a/src/components/inflators/embed.ts
+++ b/src/components/inflators/embed.ts
@@ -3,7 +3,7 @@ import { inflateDetailsElements } from './details'
 import { inflateImageEmbeds } from './image'
 import { inflateVideoEmbeds } from './video'
 
-import { type ProjectListingInfo } from 'src/types/shared/project'
+import { type ProjectListingInfo } from 'src/types/projects/project'
 
 /**
  * Inflates various supported embeds
diff --git a/src/types/projects/project.ts b/src/types/projects/project.ts
new file mode 100644
index 0000000..377713c
--- /dev/null
+++ b/src/types/projects/project.ts
@@ -0,0 +1,52 @@
+import { DateRange } from 'src/types/shared/dateRange'
+
+/**
+ * This describes aditional information about a project.
+ * to display when listing the project on the portfolio page.
+ * At minimum, the title should be specified.
+ */
+export type ProjectListingInfo = {
+  /**[Supports Markdown]
+   * Caption displayed below the title of the project on the projects page
+   */
+  caption?: string
+  /**
+   * When defined, the period will be displayed as {from} - {to}
+   */
+  period?: DateRange
+  /**[Supports Markdown]
+   * Information to summarize a project
+   */
+  summary?: string
+  /**
+   * Tags that correspond to project filters on the portfolio page if defined
+   */
+  tags?: string[]
+  /**[Supports Markdown]
+   * The title of the project
+   */
+  title: string
+  /**[CSS:background]
+   * Background image, repeat, attachment, and position for the project
+   */
+  thumbnailBackground?: string
+  /**[CSS:background-size]
+   * Background image size
+   */
+  thumbnailBackgroundSize?: string
+}
+
+/**
+ * This concatenates project files for entry within the store.
+ */
+export type ProjectStoreEntry = {
+  /**
+   * Content pulled from the projects' markdown (.md) file
+   */
+  content?: string
+
+  /**
+   * Listing information pulled from the projects' yaml (.yml) file
+   */
+  listing?: ProjectListingInfo
+}
diff --git a/src/types/projects/tag.ts b/src/types/projects/tag.ts
new file mode 100644
index 0000000..bd00a95
--- /dev/null
+++ b/src/types/projects/tag.ts
@@ -0,0 +1,8 @@
+export type TagDefinition = {
+  displayName: string
+  className: string
+}
+
+export type Tag = 
+| TagDefinition
+| string
diff --git a/src/types/shared/dateRange.ts b/src/types/shared/dateRange.ts
new file mode 100644
index 0000000..7b80d0a
--- /dev/null
+++ b/src/types/shared/dateRange.ts
@@ -0,0 +1,4 @@
+export type DateRange = {
+  from: string
+  to: string
+}
diff --git a/src/types/shared/filter.ts b/src/types/shared/filter.ts
new file mode 100644
index 0000000..830eeab
--- /dev/null
+++ b/src/types/shared/filter.ts
@@ -0,0 +1,48 @@
+import { type ProjectListingInfo } from 'src/types/projects/project'
+
+/**
+ * Defines a filter category in the filters panel
+ */
+export type ProjectFilterCategory = {
+  /**
+   * The heading of the category
+   */
+  heading: string
+  /**
+   * The filters associated with the category, or more categories
+   */
+  filters: FilterDefinition[] | ProjectFilterCategory[]
+}
+
+/**
+ * Defines a filter for a project
+ */
+export type FilterDefinition = {
+  /**
+   * The name to display in the filters panel
+   */
+  displayName: string
+  /**
+   * The tag which the filter corresponds to for when defined in {@link ProjectListingInfo.tags}
+   */
+  tag: string
+}
+
+/**
+ * Whenever a filter is toggled in the filters panel, this holds the data regarding that change
+ */
+export type FilterChangeEvent = {
+  /**
+   * The tag that the filter is associated with
+   */
+  tag: string
+  /**
+   * The toggle state of the filter
+   */
+  value: boolean
+}
+
+/**
+ * Defines the state of the filters panel
+ */
+export type FilterState = { [tag: string]: boolean }
diff --git a/src/types/shared/link.ts b/src/types/shared/link.ts
new file mode 100644
index 0000000..5cd3c74
--- /dev/null
+++ b/src/types/shared/link.ts
@@ -0,0 +1,5 @@
+export interface Link {
+  caption?: string
+  href: string
+  target?: '_blank' | '_parent' | '_self' | '_top'
+}