Not with destructuring the argument like that, no.
You could define the type somewhere else, if it's at all reused.
import { MyTypeHere } from './somewhere'
export const useSignOut = ({
authState,
authToken,
setAuthState,
setAuthToken,
}: MyTypeHere) => {
...
}
Or you could avoid the destructuring altogether:
export const useSignOut = (options: {
authState: AuthState;
authToken: OAuthToken | null;
setAuthState: React.Dispatch<React.SetStateAction<AuthState>>;
setAuthToken: React.Dispatch<React.SetStateAction<OAuthToken | null>>;
}) => {
console.log(options.authState)
}
Or do it like you already are. And I think that's pretty much all your options.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…