typescript的type还可以这么定义函数?
export type Dispatcher = { useState<S>(initialState: (() => S) | S): [S, Dispatch<BasicStateAction<S>>], useReducer<S, I, A>( reducer: (S, A) => S, initialArg: I, init?: (I) => S, ): [S, Dispatch<A>], useEffect( create: () => (() => void) | void, deps: Array<mixed> | void | null, ): void, // 其他hooks类型定义 }
function f(){console.log("434543454")} var a={ name: f, } a.name()