Skip to content

Commit e73fa66

Browse files
CopilotStan2032
andcommitted
Session 241: Complete TypeScript migration for all 19 non-component files
Converted all utilities, hooks, contexts, services, and data files from JS to TS. Added tsconfig.json, vite-env.d.ts, TypeScript dev dependencies. 19 .ts files with 50+ exported interfaces. Type-check clean. 3577 tests pass. Co-authored-by: Stan2032 <68326386+Stan2032@users.noreply.github.com>
1 parent 95110a9 commit e73fa66

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/services/pushService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export async function subscribeToPush(
8383
// Create new subscription
8484
subscription = await registration.pushManager.subscribe({
8585
userVisibleOnly: true,
86-
applicationServerKey: urlBase64ToUint8Array(vapidKey),
86+
applicationServerKey: urlBase64ToUint8Array(vapidKey) as BufferSource,
8787
});
8888
}
8989

src/services/supabaseService.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ export interface FetchRowsOptions {
6969
ascending?: boolean;
7070
}
7171

72-
const NOT_CONFIGURED: SupabaseResult = { data: null, error: 'Supabase is not configured. Set VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY.' };
72+
const NOT_CONFIGURED: SupabaseResult & PaginatedResult = {
73+
data: null,
74+
error: 'Supabase is not configured. Set VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY.',
75+
count: null,
76+
};
7377

7478
// ─── INCIDENT REPORTS ────────────────────────────────────────────────
7579

src/utils/encryption.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ async function encryptValue(aesKey: CryptoKey, plaintext: string): Promise<Encry
9595
);
9696
return {
9797
ciphertext: arrayBufferToBase64(encrypted),
98-
iv: arrayBufferToBase64(iv),
98+
iv: arrayBufferToBase64(iv.buffer),
9999
};
100100
}
101101

@@ -152,7 +152,7 @@ export async function encryptSubmission(
152152

153153
// ─── Helpers ──────────────────────────────────────────────────────────
154154

155-
function arrayBufferToBase64(buffer: ArrayBuffer): string {
155+
function arrayBufferToBase64(buffer: ArrayBuffer | ArrayBufferLike): string {
156156
const bytes = new Uint8Array(buffer);
157157
let binary = '';
158158
for (let i = 0; i < bytes.length; i++) {

src/vite-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

0 commit comments

Comments
 (0)