chore: types

This commit is contained in:
Ou 2024-10-29 11:38:06 +08:00
parent 40fe7a52a3
commit a1c76de436
2 changed files with 6 additions and 4 deletions

View File

@ -2,8 +2,10 @@ import type { AllSourceID } from "@shared/types"
import defu from "defu"
import type { RSSHubOption, RSSHubInfo as RSSHubResponse, SourceGetter, SourceOption } from "#/types"
type X = SourceGetter | Partial<Record<AllSourceID, SourceGetter>>
export function defineSource<T extends X>(source: T): T {
type R = Partial<Record<AllSourceID, SourceGetter>>
export function defineSource(source: SourceGetter): SourceGetter
export function defineSource(source: R): R
export function defineSource(source: SourceGetter | R): SourceGetter | R {
return source
}

View File

@ -1,4 +1,4 @@
import type { ColumnID } from "@shared/types"
import type { FixedColumnID } from "@shared/types"
import { useAtom } from "jotai"
import { useEffect } from "react"
import { useTitle } from "react-use"
@ -7,7 +7,7 @@ import { NavBar } from "../navbar"
import { Dnd } from "./dnd"
import { currentColumnIDAtom } from "~/atoms"
export function Column({ id }: { id: ColumnID }) {
export function Column({ id }: { id: FixedColumnID }) {
const [currentColumnID, setCurrentColumnID] = useAtom(currentColumnIDAtom)
useEffect(() => {
setCurrentColumnID(id)