import type { WritableFamilyToken, WritableToken } from "atom.io" import type { Canonical } from "atom.io/foundations/canonical" import type { Store } from "../store/index.ts" import { setIntoStore } from "./set-into-store.ts" export const RESET_STATE: unique symbol = Symbol(`RESET`) export function resetInStore( store: Store, token: WritableToken, ): void export function resetInStore( store: Store, token: WritableFamilyToken, key: NoInfer, ): void export function resetInStore( store: Store, ...params: | [token: WritableFamilyToken, key: NoInfer] | [token: WritableToken] ): void export function resetInStore( store: Store, ...params: | [token: WritableFamilyToken, key: NoInfer] | [token: WritableToken] ): void { const subParams = [...params, RESET_STATE] as const setIntoStore(store, ...subParams) }