mirror of
https://github.com/quartz-community/plugin-template.git
synced 2026-07-22 02:50:24 +00:00
fix: use any for Quartz types to avoid conflicts with Quartz internals
This commit is contained in:
parent
284b29a339
commit
1c9176d44c
1 changed files with 13 additions and 16 deletions
|
|
@ -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>;
|
||||
|
|
|
|||
Loading…
Reference in a new issue