import { RootStore } from "atom.io/internal"; import { Logger, ReadableFamilyToken, ReadableToken } from "atom.io"; import { Canonical } from "atom.io/foundations/canonical"; //#region src/testing/has-implicit-store-been-created.d.ts /** * Check whether the implicit store has been initialized without creating it. */ declare function hasImplicitStoreBeenCreated(): boolean; //#endregion //#region src/testing/set-test-log-level.d.ts /** * Set the implicit store's atom.io logger level while running tests. * * Committed tests should pass `null` so atom.io's internal logs stay silent. * Passing `"error"`, `"warn"`, or `"info"` is intentionally a TypeScript error: * it still works at runtime for local debugging, but the type error makes the * temporary change hard to check in by accident. * * The returned logger can be spied on to assert public logging behavior without * turning atom.io's internal console logging on. * * @example * ```ts * const logger = setTestLogLevel(null) * vitest.spyOn(logger, "error") * ``` * * @example * ```ts * // @ts-expect-error Local debugging only. Do not commit. * setTestLogLevel("info") * ``` */ declare function setTestLogLevel(logLevel: null): Logger; //#endregion //#region src/testing/snapshot.d.ts /** * A snapshot of the store state that can be restored. */ type Snapshot = { restore(): void; store: RootStore; }; /** * Capture the current store structure and return a function that restores it. */ declare function takeSnapshot(store?: RootStore): Snapshot; //#endregion //#region src/testing/state-exists.d.ts /** * Check whether a state currently exists in a store without creating it. * * Useful for asserting that disposal released a state, while keeping tests away * from the store's internal data structures. */ declare function stateExists(token: ReadableToken): boolean; declare function stateExists(family: ReadableFamilyToken, key: NoInfer): boolean; declare function stateExistsInStore(store: RootStore, token: ReadableToken): boolean; declare function stateExistsInStore(store: RootStore, family: ReadableFamilyToken, key: NoInfer): boolean; declare function stateExistsInStore(store: RootStore, ...params: [token: ReadableToken] | [family: ReadableFamilyToken, key: NoInfer]): boolean; //#endregion //#region src/testing/store-has-state-values.d.ts /** * Check whether a store currently retains any state values. * * Useful for asserting that a failed transaction did not commit values, while * keeping tests away from the store's internal value containers. */ declare function storeHasStateValues(store?: RootStore): boolean; //#endregion export { Snapshot, hasImplicitStoreBeenCreated, setTestLogLevel, stateExists, stateExistsInStore, storeHasStateValues, takeSnapshot }; //# sourceMappingURL=index.d.ts.map