Skip to content

fix: resolve TypeScript strict-mode gaps across API, store, and queue layers (#800 #801 #802 #803) - #888

Merged
RUKAYAT-CODER merged 6 commits into
rinafcode:mainfrom
NteinPrecious:fix/ntein-typescript-strict-800-801-802-803
Jul 27, 2026
Merged

fix: resolve TypeScript strict-mode gaps across API, store, and queue layers (#800 #801 #802 #803)#888
RUKAYAT-CODER merged 6 commits into
rinafcode:mainfrom
NteinPrecious:fix/ntein-typescript-strict-800-801-802-803

Conversation

@NteinPrecious

@NteinPrecious NteinPrecious commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

closes #800
closes #801
closes #802
closes #803

Summary

Resolves four TypeScript strict-mode findings that caused implicit any propagation and unsafe casts in the API and store layers.

#800 — Axios config module augmentation
Added src/types/axios.d.ts with a declare module 'axios' augmentation that declares _retry, _retryCount, _requestStartMs, and _timingFinish on InternalAxiosRequestConfig. These fields are now the single typed source of truth — no more as any casts needed anywhere that reads or writes them.

#801 — Generic response types for POST/PUT/PATCH
apiService.post, apiService.put, and apiService.patch in src/services/api/index.ts previously returned Promise<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 typed patch method that was previously missing.

#802 — ApiClient interface for RequestQueue
Created src/types/apiClient.ts with an ApiClient interface defining the minimum HTTP contract (get, post, put, patch, delete, and callable-config overload) required by RequestQueue. Replaced all apiClient?: any parameters and the private apiClient: any | null field in requestQueue.ts with ApiClient. 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 onRehydrateStorage callback in src/store/createStore.ts previously inferred the error parameter as any (implicitly, via the as Error cast). 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

@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Well done on the job so far!
Kindly resolve conflict

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project

@RUKAYAT-CODER
RUKAYAT-CODER merged commit 2240ee1 into rinafcode:main Jul 27, 2026
2 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment