mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-19 03:09:14 +08:00
chore: types
This commit is contained in:
parent
40fe7a52a3
commit
a1c76de436
@ -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
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user