Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Aug 2, 2023
1 parent e0e7a37 commit 093a650
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/runtime/components/ContentDoc.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { PropType, defineComponent, h, useSlots } from 'vue'
import { type PropType, type VNode, defineComponent, h, useSlots } from 'vue'
import { withTrailingSlash } from 'ufo'
import type { ParsedContent, QueryBuilderParams } from '../types'
import ContentRenderer from './ContentRenderer.vue'
Expand Down Expand Up @@ -120,7 +120,7 @@ const ContentDoc = defineComponent({
export default ContentDoc as typeof ContentDoc & {
new (): {
$slots: {
default: (context: { doc: ParsedContent, refresh: () => Promise<void> }) => any
default: (context: { doc: ParsedContent, refresh: () => Promise<void> }) => VNode[] | undefined
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/ContentList.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { PropType, defineComponent, h, useSlots } from 'vue'
import { type PropType, type VNode, defineComponent, h, useSlots } from 'vue'
import type { ParsedContent, QueryBuilderParams } from '../types'
import ContentQuery from './ContentQuery.vue'
Expand Down Expand Up @@ -71,7 +71,7 @@ const ContentList = defineComponent({
export default ContentList as typeof ContentList & {
new (): {
$slots: {
default: (context: { data: ParsedContent[], refresh: () => Promise<void> }) => any
default: (context: { data: ParsedContent[], refresh: () => Promise<void> }) => VNode[] | undefined
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/runtime/components/ContentNavigation.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import { toRefs, defineComponent, h, useSlots, computed } from 'vue'
import type { PropType, VNode } from 'vue'
import { toRefs, defineComponent, h, useSlots, computed, type PropType, type VNode } from 'vue'
import { hash } from 'ohash'
import type { NavItem, QueryBuilderParams, QueryBuilder } from '../types'
import { useAsyncData, fetchContentNavigation, useState, useContent } from '#imports'
Expand Down Expand Up @@ -80,7 +79,7 @@ const ContentNavigation = defineComponent({
export default ContentNavigation as typeof ContentNavigation & {
new (): {
$slots: {
default: ({ navigation }: { navigation: NavItem[] }) => any
default: ({ navigation }: { navigation: NavItem[] }) => VNode[] | undefined
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/ContentQuery.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { hash } from 'ohash'
import { PropType, toRefs, defineComponent, h, useSlots, watch } from 'vue'
import { type PropType, type VNode, toRefs, defineComponent, h, useSlots, watch } from 'vue'
import type { ParsedContent, ParsedContentMeta, QueryBuilder, SortParams } from '../types'
import { computed, useAsyncData, queryContent, useRuntimeConfig } from '#imports'
Expand Down Expand Up @@ -242,7 +242,7 @@ export interface ContentQueryDefaultSlotContext {
export default ContentQuery as typeof ContentQuery & {
new (): {
$slots: {
default: (context: ContentQueryDefaultSlotContext) => any
default: (context: ContentQueryDefaultSlotContext) => VNode[] | undefined
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/plugins/documentDriven.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ export default defineNuxtPlugin((nuxt) => {
}

// Use `redirect` key to redirect to another page
const redirectTo = _page?.result?.redirect || _page?.dirConfig?.navigation?.redirect || _page?.redirect || _page?._dir?.navigation?.redirect
const redirectTo = _page?.result?.redirect || _page?.dirConfig?.navigation?.redirect
if (redirectTo) {
// In case of redirection, it is not necessary to fetch page layout
// Just fill the page state with the redirect path
pages.value[_path] = _page?.result
pages.value[_path] = _page.result
return redirectTo
}

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/transformers/json.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import destr from 'destr'
import { ParsedContent } from '../types'
import type { ParsedContent } from '../types'
import { defineTransformer } from './utils'

export default defineTransformer({
Expand Down

0 comments on commit 093a650

Please sign in to comment.