fix: resolve TypeScript strict-mode gaps across API, store, and queue layers (#800 #801 #802 #803) - #888
Merged
RUKAYAT-CODER merged 6 commits intoJul 27, 2026
Conversation
|
@NteinPrecious Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Well done on the job so far! |
Contributor
|
Thank you for contributing to the project |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #800
closes #801
closes #802
closes #803
Summary
Resolves four TypeScript strict-mode findings that caused implicit
anypropagation and unsafe casts in the API and store layers.#800 — Axios config module augmentation
Added
src/types/axios.d.tswith adeclare module 'axios'augmentation that declares_retry,_retryCount,_requestStartMs, and_timingFinishonInternalAxiosRequestConfig. These fields are now the single typed source of truth — no moreas anycasts needed anywhere that reads or writes them.#801 — Generic response types for POST/PUT/PATCH
apiService.post,apiService.put, andapiService.patchinsrc/services/api/index.tspreviously returnedPromise<any>. Added<T = unknown>generic parameters so callers can supply the expected response type and catch API contract violations at compile time. Also added a typedpatchmethod that was previously missing.#802 — ApiClient interface for RequestQueue
Created
src/types/apiClient.tswith anApiClientinterface defining the minimum HTTP contract (get,post,put,patch,delete, and callable-config overload) required byRequestQueue. Replaced allapiClient?: anyparameters and the privateapiClient: any | nullfield inrequestQueue.tswithApiClient. Passing an object without the required HTTP methods now fails at compile time instead of crashing at runtime.#803 — Typed persist middleware error callback
The
onRehydrateStoragecallback insrc/store/createStore.tspreviously inferred theerrorparameter asany(implicitly, via theas Errorcast). Replaced with an explicit(rehydratedState: T | undefined, error: Error | undefined)signature that matches the Zustand persist middleware contract. Added a warning log on corrupt-state detection to aid debugging.Files changed
src/types/axios.d.ts— new module augmentation file ([TypeScript] axios.config.ts extends AxiosRequestConfig without declaration merging for _retry and _retryCount #800)src/services/api/index.ts— generic post/put/patch ([TypeScript] api/index.ts POST/PUT/PATCH return Promise<any> — callers lose response type #801)src/types/apiClient.ts— new ApiClient interface ([TypeScript] requestQueue.ts accepts apiClient?: any — queue can process with wrong client type #802)src/services/api/requestQueue.ts— replace any with ApiClient ([TypeScript] requestQueue.ts accepts apiClient?: any — queue can process with wrong client type #802)src/store/createStore.ts— typed rehydration error callback ([TypeScript] createStore.ts missing type for persist middleware error callback parameter #803)