fix: improve TypeScript type safety across views

Changes:
- Add proper type annotations for component properties
- Fix null checks with optional chaining
- Add missing interface properties
- Replace any with proper types where possible
- Move interfaces from endorserServer to interfaces/
- Add proper Router and Route typing
- Add default empty string for optional text fields

This improves type safety and reduces TypeScript errors across views.
This commit is contained in:
Matthew Raymer
2025-02-25 11:36:24 +00:00
parent 52150dd6eb
commit 61da40596c
9 changed files with 92 additions and 84 deletions

View File

@@ -30,7 +30,12 @@ export interface OfferVerifiableCredential extends GenericVerifiableCredential {
includesObject?: { amountOfThisGood: number; unitCode: string };
itemOffered?: {
description?: string;
isPartOf?: { identifier?: string; lastClaimId?: string; "@type"?: string };
isPartOf?: {
identifier?: string;
lastClaimId?: string;
"@type"?: string;
name?: string;
};
};
offeredBy?: { identifier: string };
recipient?: { identifier: string };

View File

@@ -2,6 +2,7 @@ import { GiveVerifiableCredential, OfferVerifiableCredential } from "./claims";
// a summary record; the VC is found the fullClaim field
export interface GiveSummaryRecord {
type?: string;
agentDid: string;
amount: number;
amountConfirmed: number;