migrate types to lib/types

This commit is contained in:
lightling 2024-05-03 17:19:14 -04:00
parent 531fb2fc4b
commit f48118122b
20 changed files with 60 additions and 32 deletions

View file

@ -81,17 +81,6 @@ export type GalleryEntry = GalleryEntryInheritedProperties & {
*/
export type GalleryEntries = { [idOrTitle: string]: GalleryEntry }
/**
* A wrapper around {@link GalleryEntries} for the app's use only which adds additional fields
* in order for the app to effectively display the entries.
*/
export type GalleryDisplayedEntries = { [idOrTitle: string]: GalleryEntry & {
/**
* specifies whether the entry is hidden by the tags selected by a visitor
*/
hidden?: boolean
}}
/**
* Defines a tag used by entries in a gallery
* used for filtering entries from view

View file

@ -1,5 +1,11 @@
export * from './content/globals'
export * from './content/navigation'
export * from './content/routing'
export * from './content/themes'
export * from './content/warnings'
export * from './config/globals'
export * from './config/navigation'
export * from './config/routing'
export * from './config/themes'
export * from './config/warnings'
export * from './content/dateRange'
export * from './content/link'
export * from './content/templates/gallery'
export * from './content/templates/project'

View file

@ -1,4 +1,5 @@
import type { ProjectListingInfo } from 'src/views/project/project'
import type { ProjectListingInfo } from '@goldenwere/static-web-templates-types'
import { getFormattedPeriod } from 'src/utilities/dom'
/**

View file

@ -1,10 +1,10 @@
import type { ProjectListingInfo } from '@goldenwere/static-web-templates-types'
import { inflateDescriptionListEmbeds } from './descriptionList'
import { inflateDetailsElements } from './details'
import { inflateImageEmbeds } from './image'
import { inflateVideoEmbeds } from './video'
import type { ProjectListingInfo } from 'src/views/project/project'
/**
* Inflates various supported embeds
* @param _window the reference to the window

View file

@ -1,6 +1,8 @@
import rfdc from 'rfdc'
import { type DateRange } from 'src/types/shared/dateRange'
import type {
DateRange,
} from '@goldenwere/static-web-templates-types'
export const deepCopy = rfdc()

View file

@ -1,9 +1,12 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { type GalleryListDefinition } from '@goldenwere/static-web-templates-types'
import type {
GalleryEntry,
GalleryList,
GalleryListDefinition,
} from '@goldenwere/static-web-templates-types'
import { type RouteRecordRaw, useRouter } from 'vue-router'
import type { GalleryDisplayedEntries, GalleryList } from './gallery'
import { amendVariantsWithDefaults } from './gallery-utilities'
import { fetchAndParseYaml, storage } from 'src/utilities/fetch'
import { getCurrentRoute } from 'src/utilities/vuetils'
@ -11,6 +14,17 @@ import { useRouteStore } from 'src/routes'
import GalleryTile from './gallery-tile.vue'
/**
* A wrapper around {@link GalleryEntries} for the app's use only which adds additional fields
* in order for the app to effectively display the entries.
*/
type GalleryDisplayedEntries = { [idOrTitle: string]: GalleryEntry & {
/**
* specifies whether the entry is hidden by the tags selected by a visitor
*/
hidden?: boolean
}}
const props = defineProps<{
variants: string[]
}>()

View file

@ -1,7 +1,9 @@
<script setup lang="ts">
import { computed } from 'vue'
import type {
GalleryEntry,
} from '@goldenwere/static-web-templates-types'
import type { GalleryEntry } from './gallery'
import { getTitleFromEntryOrId } from './gallery-utilities'
const props = defineProps<{

View file

@ -1,6 +1,9 @@
import { deepCopy } from 'src/utilities/dom'
import type {
GalleryEntry,
GalleryEntryInheritedProperties,
} from '@goldenwere/static-web-templates-types'
import type { GalleryEntry, GalleryEntryInheritedProperties } from './gallery'
import { deepCopy } from 'src/utilities/dom'
export const getTitleFromEntryOrId = (entry: GalleryEntry, id: string) => (
entry.title !== undefined

View file

@ -1,8 +1,11 @@
<script setup lang="ts">
import { computed, onMounted, ref } from 'vue'
import { type GalleryListDefinition } from '@goldenwere/static-web-templates-types'
import type {
GalleryEntry,
GalleryList,
GalleryListDefinition,
} from '@goldenwere/static-web-templates-types'
import type { GalleryEntry, GalleryList } from './gallery'
import { amendVariantsWithDefaults, getTitleFromEntryOrId } from './gallery-utilities'
import { fetchAndParseYaml } from 'src/utilities/fetch'
import { getCurrentRoute } from 'src/utilities/vuetils'

View file

@ -1,8 +1,11 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { type ProjectListDefinition } from '@goldenwere/static-web-templates-types'
import type {
ProjectList,
ProjectListingInfo,
ProjectListDefinition,
} from '@goldenwere/static-web-templates-types'
import type { ProjectList, ProjectListingInfo } from './project'
import { fetchAndParseYaml } from 'src/utilities/fetch'
import { getCurrentRoute } from 'src/utilities/vuetils'
import { useRouteStore } from 'src/routes'

View file

@ -1,9 +1,11 @@
<script setup lang="ts">
import { computed } from 'vue'
import { marked } from 'marked'
import type {
ProjectListingInfo,
} from '@goldenwere/static-web-templates-types'
import { getFormattedPeriod } from 'src/utilities/dom'
import type { ProjectListingInfo } from './project'
import { getCurrentRoute } from 'src/utilities/vuetils'
const props = defineProps<{

View file

@ -1,8 +1,11 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { type ProjectListDefinition } from '@goldenwere/static-web-templates-types'
import type {
ProjectList,
ProjectListingInfo,
ProjectListDefinition,
} from '@goldenwere/static-web-templates-types'
import type { ProjectList, ProjectListingInfo } from './project'
import { fetchAndParseMarkdown, fetchAndParseYaml } from 'src/utilities/fetch'
import { getCurrentRoute } from 'src/utilities/vuetils'
import { useRouteStore } from 'src/routes'