fix: use any for Quartz types to avoid conflicts with Quartz internals

This commit is contained in:
saberzero1 2026-02-07 06:22:07 +01:00
parent 284b29a339
commit 1c9176d44c
No known key found for this signature in database

View file

@ -1,4 +1,4 @@
import type { VNode } from "preact";
import type { VNode, JSX } from "preact";
export interface ExampleComponentOptions {
prefix?: string;
@ -6,21 +6,18 @@ export interface ExampleComponentOptions {
className?: string;
}
export interface QuartzComponentProps {
ctx: {
cfg: {
configuration: Record<string, unknown>;
};
allFiles: string[];
export type QuartzComponentProps = {
ctx: any; // eslint-disable-line @typescript-eslint/no-explicit-any
externalResources: any; // eslint-disable-line @typescript-eslint/no-explicit-any
fileData: any; // eslint-disable-line @typescript-eslint/no-explicit-any
cfg: any; // eslint-disable-line @typescript-eslint/no-explicit-any
children: any; // eslint-disable-line @typescript-eslint/no-explicit-any
tree: any; // eslint-disable-line @typescript-eslint/no-explicit-any
allFiles: any[]; // eslint-disable-line @typescript-eslint/no-explicit-any
displayClass?: "mobile-only" | "desktop-only";
} & JSX.IntrinsicAttributes & {
[key: string]: any; // eslint-disable-line @typescript-eslint/no-explicit-any
};
fileData: {
slug?: string;
frontmatter?: {
title?: string;
description?: string;
};
};
}
export interface QuartzComponent {
(props: QuartzComponentProps): VNode;
@ -33,7 +30,7 @@ export const ExampleComponent = (opts?: ExampleComponentOptions) => {
const { prefix = "", suffix = "", className = "example-component" } = opts ?? {};
const Component: QuartzComponent = (props: QuartzComponentProps) => {
const title = props.fileData.frontmatter?.title ?? "Untitled";
const title = props.fileData?.frontmatter?.title ?? "Untitled";
const fullText = `${prefix}${title}${suffix}`;
return <div class={className}>{fullText}</div>;