Skip to content

Commit

Permalink
refactor: update type definitions for block components
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed Feb 3, 2025
1 parent d6d443c commit df147d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ import {
+ LazyKirbyBlockNoteHeader,
} from '#components'

const blockComponents: Partial<Record<string, new () => ComponentPublicInstance>> = {
const blockComponents: Partial<Record<string, Component> = {
// Custom blocks
+ 'note-header': LazyKirbyBlockNoteHeader,
}
Expand Down
6 changes: 2 additions & 4 deletions components/Kirby/Blocks.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import type { KirbyBlock } from '#nuxt-kql'
import type { ComponentPublicInstance } from 'vue'
import type { Component } from 'vue'
import {
LazyKirbyBlockHeading,
LazyKirbyBlockImage,
Expand All @@ -18,9 +18,7 @@ defineProps<{
blocks: KirbyBlock<string>[]
}>()
type ComponentConstructor = new (...args: any[]) => ComponentPublicInstance
const blockComponents: Record<string, ComponentConstructor> = {
const blockComponents: Record<string, Component> = {
// Built-in Kirby blocks
heading: LazyKirbyBlockHeading,
image: LazyKirbyBlockImage,
Expand Down

0 comments on commit df147d2

Please sign in to comment.