mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-31 10:58:04 +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 defu from "defu"
|
||||||
import type { RSSHubOption, RSSHubInfo as RSSHubResponse, SourceGetter, SourceOption } from "#/types"
|
import type { RSSHubOption, RSSHubInfo as RSSHubResponse, SourceGetter, SourceOption } from "#/types"
|
||||||
|
|
||||||
type X = SourceGetter | Partial<Record<AllSourceID, SourceGetter>>
|
type R = Partial<Record<AllSourceID, SourceGetter>>
|
||||||
export function defineSource<T extends X>(source: T): T {
|
export function defineSource(source: SourceGetter): SourceGetter
|
||||||
|
export function defineSource(source: R): R
|
||||||
|
export function defineSource(source: SourceGetter | R): SourceGetter | R {
|
||||||
return source
|
return source
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { ColumnID } from "@shared/types"
|
import type { FixedColumnID } from "@shared/types"
|
||||||
import { useAtom } from "jotai"
|
import { useAtom } from "jotai"
|
||||||
import { useEffect } from "react"
|
import { useEffect } from "react"
|
||||||
import { useTitle } from "react-use"
|
import { useTitle } from "react-use"
|
||||||
@ -7,7 +7,7 @@ import { NavBar } from "../navbar"
|
|||||||
import { Dnd } from "./dnd"
|
import { Dnd } from "./dnd"
|
||||||
import { currentColumnIDAtom } from "~/atoms"
|
import { currentColumnIDAtom } from "~/atoms"
|
||||||
|
|
||||||
export function Column({ id }: { id: ColumnID }) {
|
export function Column({ id }: { id: FixedColumnID }) {
|
||||||
const [currentColumnID, setCurrentColumnID] = useAtom(currentColumnIDAtom)
|
const [currentColumnID, setCurrentColumnID] = useAtom(currentColumnIDAtom)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setCurrentColumnID(id)
|
setCurrentColumnID(id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user