From 1ff4ed9553fc644c66ad71fea3b0da6c45ccecb4 Mon Sep 17 00:00:00 2001 From: Tushar Verma Date: Sun, 7 Dec 2025 08:28:29 +0530 Subject: [PATCH] fix: Remove 'any' types by centralizing type definitions --- components/DocTable.tsx | 123 ++++++++++-------- pages/[slug].page.tsx | 7 +- pages/ambassadors/index.page.tsx | 2 +- pages/draft-05/index.page.tsx | 16 ++- pages/draft-06/[slug].page.tsx | 9 +- pages/draft-06/index.page.tsx | 15 ++- pages/draft-07/[slug].page.tsx | 9 +- pages/draft-07/index.page.tsx | 15 ++- pages/draft/2019-09/[slug].page.tsx | 9 +- pages/draft/2019-09/index.page.tsx | 15 ++- pages/draft/2020-12/[slug].page.tsx | 9 +- pages/draft/2020-12/index.page.tsx | 15 ++- pages/implementers/[slug].page.tsx | 9 +- pages/implementers/index.page.tsx | 9 +- pages/learn/[slug].page.tsx | 9 +- .../index.page.tsx | 8 +- pages/overview/[slug].page.tsx | 17 +-- pages/overview/code-of-conduct/index.page.tsx | 8 +- pages/overview/sponsors/index.page.tsx | 2 +- .../json-hyper-schema/index.page.tsx | 20 ++- pages/specification/migration/index.page.tsx | 12 +- .../release-notes/index.page.tsx | 12 +- .../understanding-json-schema/[slug].page.tsx | 9 +- .../understanding-json-schema/index.page.tsx | 9 +- .../reference/[slug].page.tsx | 9 +- types/common.ts | 122 +++++++++++++++++ 26 files changed, 352 insertions(+), 147 deletions(-) create mode 100644 types/common.ts diff --git a/components/DocTable.tsx b/components/DocTable.tsx index a8862797b..b717ab73e 100644 --- a/components/DocTable.tsx +++ b/components/DocTable.tsx @@ -3,16 +3,25 @@ import React from 'react'; import Link from 'next/link'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; +interface Author { + name: string; + photo?: string; +} + interface DocTableProps { frontmatter: { - Specification: string; - Published: string; - authors: string[]; - Metaschema: string; + Specification?: string; + Published?: string; + authors?: (string | Author)[]; + Metaschema?: string; }; } const DocTable = ({ frontmatter }: DocTableProps) => { + const authors = frontmatter.authors ?? []; + const getAuthorName = (author: string | Author): string => + typeof author === 'string' ? author : author.name; + return ( @@ -22,63 +31,71 @@ const DocTable = ({ frontmatter }: DocTableProps) => {
-
-
-
- Specification -
-
- - {frontmatter.Specification} - + {frontmatter.Specification && ( +
+
+
+ Specification +
+
+ + {frontmatter.Specification} + +
-
-
-
-
- Published + )} + {frontmatter.Published && ( +
+
+
+ Published +
+
{frontmatter.Published}
-
{frontmatter.Published}
-
-
-
-
- Authors -
-
- {frontmatter.authors.map((author: string, index: number) => ( - - {author} - {index < frontmatter.authors.length - 1 ? ', ' : ''} - - ))} + )} + {authors.length > 0 && ( +
+
+
+ Authors +
+
+ {authors.map((author, index: number) => ( + + {getAuthorName(author)} + {index < authors.length - 1 ? ', ' : ''} + + ))} +
-
-
-
-
- Metaschema -
-
- - {frontmatter.Metaschema} - + )} + {frontmatter.Metaschema && ( +
+
+
+ Metaschema +
+
+ + {frontmatter.Metaschema} + +
-
+ )}
diff --git a/pages/[slug].page.tsx b/pages/[slug].page.tsx index 7a9e7726e..22eab1a2a 100644 --- a/pages/[slug].page.tsx +++ b/pages/[slug].page.tsx @@ -8,11 +8,12 @@ import { Headline1 } from '~/components/Headlines'; import { SectionContext } from '~/context'; import { DocsHelp } from '~/components/DocsHelp'; import NextPrevButton from '~/components/NavigationButtons'; +import type { Frontmatter } from '~/types/common'; export async function getStaticPaths() { return getStaticMarkdownPaths('pages'); } -export async function getStaticProps(args: any) { +export async function getStaticProps(args: { params?: { slug: string } }) { return getStaticMarkdownProps(args, 'pages'); } @@ -20,8 +21,8 @@ export default function StaticMarkdownPage({ frontmatter, content, }: { - frontmatter: any; - content: any; + frontmatter: Frontmatter; + content: string; }) { const fileRenderType = '_md'; const newTitle = 'JSON Schema - ' + frontmatter.title; diff --git a/pages/ambassadors/index.page.tsx b/pages/ambassadors/index.page.tsx index 259d32035..1f713a1c0 100644 --- a/pages/ambassadors/index.page.tsx +++ b/pages/ambassadors/index.page.tsx @@ -26,7 +26,7 @@ export async function getStaticProps() { export default function ambassadorPages({ ambassadorData, }: { - ambassadorData: any; + ambassadorData: string; }) { return ( diff --git a/pages/draft-05/index.page.tsx b/pages/draft-05/index.page.tsx index e8c83ca8c..939ce5608 100644 --- a/pages/draft-05/index.page.tsx +++ b/pages/draft-05/index.page.tsx @@ -8,6 +8,7 @@ import DocTable from '~/components/DocTable'; import { Headline1 } from '~/components/Headlines'; import { DocsHelp } from '~/components/DocsHelp'; import NextPrevButton from '~/components/NavigationButtons'; +import { Frontmatter } from '~/types/common'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft-05/index.md', 'utf-8'); @@ -27,12 +28,23 @@ export async function getStaticProps() { }; } +interface DraftFrontmatter extends Frontmatter { + Specification?: string; + Published?: string; + Metaschema?: string; +} + +interface BlocksData { + index: string; + body: string; +} + export default function ImplementationsPages({ blocks, frontmatter, }: { - blocks: any; - frontmatter: any; + blocks: BlocksData; + frontmatter: DraftFrontmatter; }) { const fileRenderType = 'indexmd'; return ( diff --git a/pages/draft-06/[slug].page.tsx b/pages/draft-06/[slug].page.tsx index 64655ed3c..1b4dcd2be 100644 --- a/pages/draft-06/[slug].page.tsx +++ b/pages/draft-06/[slug].page.tsx @@ -7,11 +7,12 @@ import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps'; import { Headline1 } from '~/components/Headlines'; import { SectionContext } from '~/context'; import { DocsHelp } from '~/components/DocsHelp'; +import { Frontmatter } from '~/types/common'; export async function getStaticPaths() { return getStaticMarkdownPaths('pages/draft-06'); } -export async function getStaticProps(args: any) { +export async function getStaticProps(args: { params?: { slug: string } }) { return getStaticMarkdownProps(args, 'pages/draft-06'); } @@ -19,14 +20,14 @@ export default function StaticMarkdownPage({ frontmatter, content, }: { - frontmatter: any; - content: any; + frontmatter: Frontmatter; + content: string; }) { const fileRenderType = '_md'; const newTitle = 'JSON Schema - ' + frontmatter.title; return ( - + {newTitle} diff --git a/pages/draft-06/index.page.tsx b/pages/draft-06/index.page.tsx index 12a760519..1b2b3c0c3 100644 --- a/pages/draft-06/index.page.tsx +++ b/pages/draft-06/index.page.tsx @@ -8,6 +8,7 @@ import DocTable from '~/components/DocTable'; import { Headline1 } from '~/components/Headlines'; import { DocsHelp } from '~/components/DocsHelp'; import NextPrevButton from '~/components/NavigationButtons'; +import { Frontmatter } from '~/types/common'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft-06/index.md', 'utf-8'); @@ -25,12 +26,22 @@ export async function getStaticProps() { }; } +interface DraftFrontmatter extends Frontmatter { + Specification?: string; + Published?: string; + Metaschema?: string; +} + +interface BlocksData { + index: string; +} + export default function ImplementationsPages({ blocks, frontmatter, }: { - blocks: any; - frontmatter: any; + blocks: BlocksData; + frontmatter: DraftFrontmatter; }) { const fileRenderType = 'indexmd'; return ( diff --git a/pages/draft-07/[slug].page.tsx b/pages/draft-07/[slug].page.tsx index f4ef2b082..68b7eaf41 100644 --- a/pages/draft-07/[slug].page.tsx +++ b/pages/draft-07/[slug].page.tsx @@ -7,11 +7,12 @@ import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps'; import { Headline1 } from '~/components/Headlines'; import { SectionContext } from '~/context'; import { DocsHelp } from '~/components/DocsHelp'; +import { Frontmatter } from '~/types/common'; export async function getStaticPaths() { return getStaticMarkdownPaths('pages/draft-07'); } -export async function getStaticProps(args: any) { +export async function getStaticProps(args: { params?: { slug: string } }) { return getStaticMarkdownProps(args, 'pages/draft-07'); } @@ -19,14 +20,14 @@ export default function StaticMarkdownPage({ frontmatter, content, }: { - frontmatter: any; - content: any; + frontmatter: Frontmatter; + content: string; }) { const fileRenderType = '_md'; const newTitle = 'JSON Schema - ' + frontmatter.title; return ( - + {newTitle} diff --git a/pages/draft-07/index.page.tsx b/pages/draft-07/index.page.tsx index a639ca275..f727b6f9a 100644 --- a/pages/draft-07/index.page.tsx +++ b/pages/draft-07/index.page.tsx @@ -8,6 +8,7 @@ import DocTable from '~/components/DocTable'; import { Headline1 } from '~/components/Headlines'; import { DocsHelp } from '~/components/DocsHelp'; import NextPrevButton from '~/components/NavigationButtons'; +import { Frontmatter } from '~/types/common'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft-07/index.md', 'utf-8'); @@ -25,12 +26,22 @@ export async function getStaticProps() { }; } +interface DraftFrontmatter extends Frontmatter { + Specification?: string; + Published?: string; + Metaschema?: string; +} + +interface BlocksData { + index: string; +} + export default function ImplementationsPages({ blocks, frontmatter, }: { - blocks: any; - frontmatter: any; + blocks: BlocksData; + frontmatter: DraftFrontmatter; }) { const fileRenderType = 'indexmd'; return ( diff --git a/pages/draft/2019-09/[slug].page.tsx b/pages/draft/2019-09/[slug].page.tsx index 26acaf0e1..5252c4a30 100644 --- a/pages/draft/2019-09/[slug].page.tsx +++ b/pages/draft/2019-09/[slug].page.tsx @@ -7,11 +7,12 @@ import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps'; import { Headline1 } from '~/components/Headlines'; import { SectionContext } from '~/context'; import { DocsHelp } from '~/components/DocsHelp'; +import { Frontmatter } from '~/types/common'; export async function getStaticPaths() { return getStaticMarkdownPaths('pages/draft/2019-09'); } -export async function getStaticProps(args: any) { +export async function getStaticProps(args: { params?: { slug: string } }) { return getStaticMarkdownProps(args, 'pages/draft/2019-09'); } @@ -19,14 +20,14 @@ export default function StaticMarkdownPage({ frontmatter, content, }: { - frontmatter: any; - content: any; + frontmatter: Frontmatter; + content: string; }) { const fileRenderType = '_md'; const newTitle = 'JSON Schema - ' + frontmatter.title; return ( - + {newTitle} diff --git a/pages/draft/2019-09/index.page.tsx b/pages/draft/2019-09/index.page.tsx index 51898b28e..81fbc7bf5 100644 --- a/pages/draft/2019-09/index.page.tsx +++ b/pages/draft/2019-09/index.page.tsx @@ -8,6 +8,7 @@ import DocTable from '~/components/DocTable'; import { Headline1 } from '~/components/Headlines'; import { DocsHelp } from '~/components/DocsHelp'; import NextPrevButton from '~/components/NavigationButtons'; +import { Frontmatter } from '~/types/common'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft/2019-09/index.md', 'utf-8'); @@ -24,12 +25,22 @@ export async function getStaticProps() { }; } +interface DraftFrontmatter extends Frontmatter { + Specification?: string; + Published?: string; + Metaschema?: string; +} + +interface BlocksData { + index: string; +} + export default function ImplementationsPages({ blocks, frontmatter, }: { - blocks: any; - frontmatter: any; + blocks: BlocksData; + frontmatter: DraftFrontmatter; }) { const fileRenderType = 'indexmd'; return ( diff --git a/pages/draft/2020-12/[slug].page.tsx b/pages/draft/2020-12/[slug].page.tsx index cc2331502..14176f965 100644 --- a/pages/draft/2020-12/[slug].page.tsx +++ b/pages/draft/2020-12/[slug].page.tsx @@ -7,11 +7,12 @@ import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps'; import { Headline1 } from '~/components/Headlines'; import { SectionContext } from '~/context'; import { DocsHelp } from '~/components/DocsHelp'; +import { Frontmatter } from '~/types/common'; export async function getStaticPaths() { return getStaticMarkdownPaths('pages/draft/2020-12'); } -export async function getStaticProps(args: any) { +export async function getStaticProps(args: { params?: { slug: string } }) { return getStaticMarkdownProps(args, 'pages/draft/2020-12'); } @@ -19,14 +20,14 @@ export default function StaticMarkdownPage({ frontmatter, content, }: { - frontmatter: any; - content: any; + frontmatter: Frontmatter; + content: string; }) { const fileRenderType = '_md'; const newTitle = 'JSON Schema - ' + frontmatter.title; return ( - + {newTitle} diff --git a/pages/draft/2020-12/index.page.tsx b/pages/draft/2020-12/index.page.tsx index b5162ef02..64b5be76f 100644 --- a/pages/draft/2020-12/index.page.tsx +++ b/pages/draft/2020-12/index.page.tsx @@ -8,6 +8,7 @@ import DocTable from '~/components/DocTable'; import { Headline1 } from '~/components/Headlines'; import { DocsHelp } from '~/components/DocsHelp'; import NextPrevButton from '~/components/NavigationButtons'; +import { Frontmatter } from '~/types/common'; export async function getStaticProps() { const index = fs.readFileSync('pages/draft/2020-12/index.md', 'utf-8'); @@ -24,12 +25,22 @@ export async function getStaticProps() { }; } +interface DraftFrontmatter extends Frontmatter { + Specification?: string; + Published?: string; + Metaschema?: string; +} + +interface BlocksData { + index: string; +} + export default function ImplementationsPages({ blocks, frontmatter, }: { - blocks: any; - frontmatter: any; + blocks: BlocksData; + frontmatter: DraftFrontmatter; }) { const fileRenderType = 'indexmd'; return ( diff --git a/pages/implementers/[slug].page.tsx b/pages/implementers/[slug].page.tsx index c149e95eb..8dfd7af40 100644 --- a/pages/implementers/[slug].page.tsx +++ b/pages/implementers/[slug].page.tsx @@ -8,11 +8,12 @@ import { Headline1 } from '~/components/Headlines'; import { SectionContext } from '~/context'; import { DocsHelp } from '~/components/DocsHelp'; import NextPrevButton from '~/components/NavigationButtons'; +import { Frontmatter } from '~/types/common'; export async function getStaticPaths() { return getStaticMarkdownPaths('pages/implementers'); } -export async function getStaticProps(args: any) { +export async function getStaticProps(args: { params?: { slug: string } }) { return getStaticMarkdownProps(args, 'pages/implementers'); } @@ -20,13 +21,13 @@ export default function StaticMarkdownPage({ frontmatter, content, }: { - frontmatter: any; - content: any; + frontmatter: Frontmatter; + content: string; }) { const fileRenderType = '_md'; const newTitle = 'JSON Schema - ' + frontmatter.title; return ( - + {newTitle} diff --git a/pages/implementers/index.page.tsx b/pages/implementers/index.page.tsx index 7579ba030..23b3af754 100644 --- a/pages/implementers/index.page.tsx +++ b/pages/implementers/index.page.tsx @@ -17,13 +17,8 @@ export async function getStaticProps() { }, }; } -export default function ContentExample({ - blocks, -}: { - blocks: any[]; - frontmatter: any; - content: any; -}) { + +export default function ContentExample({ blocks }: { blocks: string[] }) { const fileRenderType = '_indexmd'; return ( diff --git a/pages/learn/[slug].page.tsx b/pages/learn/[slug].page.tsx index d186f1a4d..ad657ed70 100644 --- a/pages/learn/[slug].page.tsx +++ b/pages/learn/[slug].page.tsx @@ -8,11 +8,12 @@ import { Headline1 } from '~/components/Headlines'; import { SectionContext } from '~/context'; import { DocsHelp } from '~/components/DocsHelp'; import NextPrevButton from '~/components/NavigationButtons'; +import { Frontmatter } from '~/types/common'; export async function getStaticPaths() { return getStaticMarkdownPaths('pages/learn'); } -export async function getStaticProps(args: any) { +export async function getStaticProps(args: { params?: { slug: string } }) { return getStaticMarkdownProps(args, 'pages/learn'); } @@ -20,13 +21,13 @@ export default function StaticMarkdownPage({ frontmatter, content, }: { - frontmatter: any; - content: any; + frontmatter: Frontmatter; + content: string; }) { const fileRenderType = '_md'; const newTitle = 'JSON Schema - ' + frontmatter.title; return ( - + {newTitle} diff --git a/pages/learn/getting-started-step-by-step/index.page.tsx b/pages/learn/getting-started-step-by-step/index.page.tsx index de2cab73f..e20ad14f8 100644 --- a/pages/learn/getting-started-step-by-step/index.page.tsx +++ b/pages/learn/getting-started-step-by-step/index.page.tsx @@ -29,13 +29,7 @@ export async function getStaticProps() { }; } -export default function StyledValidator({ - blocks, -}: { - blocks: any[]; - frontmatter: any; - content: any; -}) { +export default function StyledValidator({ blocks }: { blocks: string[] }) { const newTitle = 'Creating your first schema'; const fileRenderType = 'tsx'; return ( diff --git a/pages/overview/[slug].page.tsx b/pages/overview/[slug].page.tsx index c50fa4f39..3b37072e4 100644 --- a/pages/overview/[slug].page.tsx +++ b/pages/overview/[slug].page.tsx @@ -8,11 +8,12 @@ import { Headline1 } from '~/components/Headlines'; import { SectionContext } from '~/context'; import { DocsHelp } from '~/components/DocsHelp'; import NextPrevButton from '~/components/NavigationButtons'; +import { Frontmatter } from '~/types/common'; export async function getStaticPaths() { return getStaticMarkdownPaths('pages/overview'); } -export async function getStaticProps(args: any) { +export async function getStaticProps(args: { params?: { slug: string } }) { return getStaticMarkdownProps(args, 'pages/overview'); } @@ -20,24 +21,24 @@ export default function StaticMarkdownPage({ frontmatter, content, }: { - frontmatter: any; - content: any; + frontmatter: Frontmatter; + content: string; }) { const fileRenderType = '_md'; const newTitle = 'JSON Schema - ' + frontmatter.title; return ( - + {newTitle} {frontmatter.title} diff --git a/pages/overview/code-of-conduct/index.page.tsx b/pages/overview/code-of-conduct/index.page.tsx index 75e6000f2..82a99b1ed 100644 --- a/pages/overview/code-of-conduct/index.page.tsx +++ b/pages/overview/code-of-conduct/index.page.tsx @@ -21,13 +21,7 @@ export async function getStaticProps() { }; } -export default function Content({ - blocks, -}: { - blocks: any[]; - frontmatter: any; - content: any; -}) { +export default function Content({ blocks }: { blocks: string[] }) { const newTitle = 'Code of Conduct'; const fileRenderType = 'https://github.com/json-schema-org/.github/blob/main/CODE_OF_CONDUCT.md'; diff --git a/pages/overview/sponsors/index.page.tsx b/pages/overview/sponsors/index.page.tsx index c3c59d4ee..6c88b38d0 100644 --- a/pages/overview/sponsors/index.page.tsx +++ b/pages/overview/sponsors/index.page.tsx @@ -19,7 +19,7 @@ export async function getStaticProps() { }; } -export default function ContentExample({ blocks }: { blocks: any[] }) { +export default function ContentExample({ blocks }: { blocks: string[] }) { const newTitle = 'Sponsors'; const fileRenderType = 'https://github.com/json-schema-org/community/blob/main/programs/sponsors/sponsors.md'; diff --git a/pages/specification/json-hyper-schema/index.page.tsx b/pages/specification/json-hyper-schema/index.page.tsx index 83d5376d8..21b07a40d 100644 --- a/pages/specification/json-hyper-schema/index.page.tsx +++ b/pages/specification/json-hyper-schema/index.page.tsx @@ -7,6 +7,7 @@ import { SectionContext } from '~/context'; import { Headline1 } from '~/components/Headlines'; import { DocsHelp } from '~/components/DocsHelp'; import NextPrevButton from '~/components/NavigationButtons'; +import { Frontmatter } from '~/types/common'; export async function getStaticProps() { const index = fs.readFileSync( @@ -29,22 +30,31 @@ export async function getStaticProps() { }; } +interface SpecificationFrontmatter extends Frontmatter { + Specification?: string; +} + +interface BlocksData { + index: string; + body?: string; +} + export default function ImplementationsPages({ blocks, frontmatter, }: { - blocks: any; - frontmatter: any; + blocks: BlocksData; + frontmatter: SpecificationFrontmatter; }) { const fileRenderType = '_indexmd'; return ( {frontmatter.title} -

{frontmatter.type}

-

{frontmatter.Specification}

+ {frontmatter.type &&

{frontmatter.type}

} + {frontmatter.Specification &&

{frontmatter.Specification}

} - + {blocks.body && } {frontmatter.title} - + {blocks.body && }
{frontmatter.title} - + {blocks.body && }
+ {newTitle} diff --git a/pages/understanding-json-schema/index.page.tsx b/pages/understanding-json-schema/index.page.tsx index 40ed5c449..9e819ce51 100644 --- a/pages/understanding-json-schema/index.page.tsx +++ b/pages/understanding-json-schema/index.page.tsx @@ -19,13 +19,8 @@ export async function getStaticProps() { }, }; } -export default function ContentExample({ - blocks, -}: { - blocks: any[]; - frontmatter: any; - content: any; -}) { + +export default function ContentExample({ blocks }: { blocks: string[] }) { const fileRenderType = '_indexmd'; return ( diff --git a/pages/understanding-json-schema/reference/[slug].page.tsx b/pages/understanding-json-schema/reference/[slug].page.tsx index dc87fef98..eb6faf5ff 100644 --- a/pages/understanding-json-schema/reference/[slug].page.tsx +++ b/pages/understanding-json-schema/reference/[slug].page.tsx @@ -8,11 +8,12 @@ import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps'; import { SectionContext } from '~/context'; import { DocsHelp } from '~/components/DocsHelp'; import NextPrevButton from '~/components/NavigationButtons'; +import { Frontmatter } from '~/types/common'; export async function getStaticPaths() { return getStaticMarkdownPaths('pages/understanding-json-schema/reference'); } -export async function getStaticProps(args: any) { +export async function getStaticProps(args: { params?: { slug: string } }) { return getStaticMarkdownProps( args, 'pages/understanding-json-schema/reference', @@ -23,13 +24,13 @@ export default function StaticMarkdownPage({ frontmatter, content, }: { - frontmatter: any; - content: any; + frontmatter: Frontmatter; + content: string; }) { const newTitle = 'JSON Schema - ' + frontmatter.title; const fileRenderType = '_md'; return ( - + {newTitle} diff --git a/types/common.ts b/types/common.ts new file mode 100644 index 000000000..decc5bc29 --- /dev/null +++ b/types/common.ts @@ -0,0 +1,122 @@ +// Common type definitions for the JSON Schema website +import React from 'react'; + +// Author type for blog posts and content +export interface Author { + name: string; + photo: string; + twitter?: string; + link?: string; +} + +// Frontmatter type for markdown files +export interface Frontmatter { + title: string; + date?: string; + excerpt?: string; + cover?: string; + authors?: Author[]; + type?: string | string[]; + section?: SectionType; + prev?: NavLink; + next?: NavLink; + [key: string]: unknown; +} + +// Props for getStaticProps parameter +export interface StaticPropsParams { + params?: { + slug: string; + }; +} + +// Return type for markdown page props +export interface MarkdownPageProps { + frontmatter: Frontmatter; + content: string; +} + +// Props for pages with blocks +export interface PageWithBlocksProps extends MarkdownPageProps { + blocks: string[]; +} + +// Calendar event type +export interface CalendarEvent { + title: string; + time: string; + day: string; + timezone: string; + parsedStartDate: string; +} + +// iCal event data structure +export interface ICalEventData { + [key: string]: { + type: string; + summary?: string; + start?: { + tz: string; + [key: string]: unknown; + }; + rrule?: { + between: (start: Date, end: Date, inclusive: boolean) => Date[]; + }; + [key: string]: unknown; + }; +} + +// Blog post structure +export interface BlogPost { + slug: string; + frontmatter: Frontmatter; + content: string; +} + +// Slate editor types for JsonEditor +export interface SlateRenderProps { + attributes: { + 'data-slate-node'?: string; + 'data-slate-inline'?: boolean; + 'data-slate-void'?: boolean; + dir?: 'rtl'; + ref: React.RefObject; + [key: string]: unknown; + }; + children: React.ReactNode; + element?: unknown; + leaf?: unknown; + text?: { + text: string; + [key: string]: unknown; + }; +} + +// Section context type +export type SectionType = + | 'learn' + | 'docs' + | 'implementers' + | 'tools' + | 'implementations' + | 'blog' + | 'community' + | 'specification' + | 'overview' + | 'getting-started' + | 'reference' + | 'roadmap' + | 'ambassador' + | 'pro-help' + | null; + +// Navigation link type +export interface NavLink { + label: string; + url: string; +} + +// JSON Schema specific types +export interface JsonKeywordValue { + [key: string]: unknown; +}