chore(website): cleanup ts-errors

This commit is contained in:
iCrawl
2023-04-14 20:03:40 +02:00
parent 2c25639a85
commit 615752e32b
14 changed files with 17 additions and 107 deletions

View File

@@ -15,8 +15,8 @@ import type {
ApiFunction,
} from '@microsoft/api-extractor-model';
import { ApiItemKind, ApiModel } from '@microsoft/api-extractor-model';
import type { Metadata } from 'next';
import { notFound } from 'next/navigation';
import type { Metadata } from 'next/types';
import { fetchModelJSON } from '~/app/docAPI';
import { Class } from '~/components/model/Class';
import { Interface } from '~/components/model/Interface';
@@ -42,11 +42,11 @@ async function fetchHeadMember({ package: packageName, version, item }: ItemRout
return findMember(model, packageName, memberName);
}
function resolveMemberSearchParams(packageName: string, member: ApiItem) {
function resolveMemberSearchParams(packageName: string, member?: ApiItem) {
const params = new URLSearchParams({
pkg: packageName,
kind: member?.kind,
name: member?.displayName,
kind: member?.kind ?? '',
name: member?.displayName ?? '',
});
switch (member?.kind) {

View File

@@ -3,10 +3,9 @@ import { VscArrowRight } from '@react-icons/all-files/vsc/VscArrowRight';
import { VscVersions } from '@react-icons/all-files/vsc/VscVersions';
import Link from 'next/link';
import { notFound } from 'next/navigation';
import type { ServerRuntime } from 'next/types';
import { PACKAGES } from '~/util/constants';
export const runtime: ServerRuntime = 'edge';
export const runtime = 'edge';
async function getData(pkg: string) {
if (!PACKAGES.includes(pkg)) {

View File

@@ -3,10 +3,9 @@ import { VscArrowLeft } from '@react-icons/all-files/vsc/VscArrowLeft';
import { VscArrowRight } from '@react-icons/all-files/vsc/VscArrowRight';
import { VscPackage } from '@react-icons/all-files/vsc/VscPackage';
import Link from 'next/link';
import type { ServerRuntime } from 'next/types';
import { PACKAGES } from '~/util/constants';
export const runtime: ServerRuntime = 'edge';
export const runtime = 'edge';
export default function Page() {
return (