refactor: enhance type safety by replacing any types with stricter types across the codebase, improving error handling and reducing potential bugs

This commit is contained in:
Usman Baig
2026-02-22 20:29:16 +01:00
parent 1947c6a886
commit 06f54176f1
15 changed files with 94 additions and 65 deletions

21
types/iso-3166-2.d.ts vendored Normal file
View File

@@ -0,0 +1,21 @@
declare module 'iso-3166-2' {
interface SubdivisionInfo {
name: string
type: string
parent?: string
}
interface CountryInfo {
name: string
sub: Record<string, SubdivisionInfo>
}
const iso3166: {
data: Record<string, CountryInfo>
country(code: string): CountryInfo | undefined
subdivision(code: string): SubdivisionInfo | undefined
codes: string[]
}
export default iso3166
}

9
types/jspdf-autotable.d.ts vendored Normal file
View File

@@ -0,0 +1,9 @@
import 'jspdf'
declare module 'jspdf' {
interface jsPDF {
lastAutoTable: {
finalY: number
}
}
}