import type { Canonical } from "atom.io/foundations/canonical" import { IMPLICIT, resetInStore } from "atom.io/internal" import type { WritableFamilyToken, WritableToken } from "." /** * Set the value of a state into the implicit store back to its default value. * @param token - An atom or writable selector token. * @overload Default * @default */ export function resetState(token: WritableToken): void /** * Set the value of a state into the implicit store back to its default value. * @param token - An atom family or writable selector family token. * @param key - The unique key of the state to set. * @overload Streamlined */ export function resetState( token: WritableFamilyToken, key: K, ): void export function resetState( ...params: | [token: WritableFamilyToken, key: Canonical] | [token: WritableToken] ): void { resetInStore(IMPLICIT.STORE, ...params) }