refactor: migrate interfaces to dedicated directory

Reorganizes TypeScript interfaces into a modular structure:
- Create dedicated interfaces directory with specialized files
- Split interfaces by domain (claims, common, limits, records, user)
- Update imports in endorserServer.ts to use new interface locations
- Replace 'any' types with 'unknown' for better type safety
- Add proper type imports and exports

This improves code organization and maintainability by:
- Centralizing interface definitions
- Reducing file size of endorserServer.ts
- Making interface relationships more explicit
- Improving type safety with stricter types
This commit is contained in:
Matthew Raymer
2025-02-24 11:21:08 +00:00
parent fbb9fba347
commit c708716675
69 changed files with 663 additions and 645 deletions

View File

@@ -11,7 +11,7 @@
@click="$router.go(-1)"
class="text-lg text-center px-2 py-1 absolute -left-2 -top-1"
>
<fa icon="chevron-left" class="fa-fw" />
<font-awesome icon="chevron-left" class="fa-fw" />
</button>
<span
v-if="
@@ -44,7 +44,7 @@
@click="confirmConfirmClaim()"
>
Confirm
<fa icon="circle-check" class="ml-2 text-white cursor-pointer" />
<font-awesome icon="circle-check" class="ml-2 text-white cursor-pointer" />
</button>
<button
v-else
@@ -52,7 +52,7 @@
class="col-span-1 bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-4 py-2 rounded-md"
>
Confirm
<fa icon="circle-check" class="ml-2 text-white cursor-pointer" />
<font-awesome icon="circle-check" class="ml-2 text-white cursor-pointer" />
</button>
</div>
@@ -62,26 +62,26 @@
<div class="overflow-hidden">
<div class="text-sm">
<div>
<fa icon="arrow-left" class="fa-fw text-slate-400" />
<font-awesome icon="arrow-left" class="fa-fw text-slate-400" />
{{ giverName }}
</div>
<div class="ml-6">gave</div>
<div v-if="giveDetails.amount">
<fa icon="hand-holding-dollar" class="fa-fw text-slate-400" />
<font-awesome icon="hand-holding-dollar" class="fa-fw text-slate-400" />
{{ displayAmount(giveDetails.unit, giveDetails.amount) }}
</div>
<div v-if="giveDetails.description">
<fa icon="message" class="fa-fw text-slate-400" />
<font-awesome icon="message" class="fa-fw text-slate-400" />
{{ giveDetails.amount ? "and:" : "" }}
{{ giveDetails.description }}
</div>
<div class="ml-6">to</div>
<div>
<fa icon="arrow-right" class="fa-fw text-slate-400" />
<font-awesome icon="arrow-right" class="fa-fw text-slate-400" />
{{ recipientName }}
</div>
<div>
<fa icon="calendar" class="fa-fw text-slate-400" />
<font-awesome icon="calendar" class="fa-fw text-slate-400" />
on
{{ giveDetails.issuedAt.substring(0, 10) }}
</div>
@@ -99,7 +99,7 @@
target="_blank"
>
This fulfills a bigger plan
<fa icon="arrow-up-right-from-square" class="fa-fw" />
<font-awesome icon="arrow-up-right-from-square" class="fa-fw" />
</router-link>
</div>
<!-- if there's another, it's probably fulfilling an offer, too -->
@@ -125,7 +125,7 @@
giveDetails?.fulfillsType || "",
)
}}
<fa icon="arrow-up-right-from-square" class="fa-fw" />
<font-awesome icon="arrow-up-right-from-square" class="fa-fw" />
</router-link>
</div>
</div>
@@ -133,7 +133,7 @@
</div>
</div>
<div class="mt-2">
<fa icon="comment" class="text-slate-400" />
<font-awesome icon="comment" class="text-slate-400" />
{{ issuerName }} posted that.
</div>
@@ -185,7 +185,7 @@
)
"
>
<fa icon="copy" class="text-slate-400 fa-fw" />
<font-awesome icon="copy" class="text-slate-400 fa-fw" />
</button>
</span>
</div>
@@ -228,7 +228,7 @@
)
"
>
<fa icon="copy" class="text-slate-400 fa-fw" />
<font-awesome icon="copy" class="text-slate-400 fa-fw" />
</button>
</span>
</div>
@@ -260,8 +260,8 @@
@click="showVeriClaimDump = !showVeriClaimDump"
>
Details
<fa v-if="showVeriClaimDump" icon="chevron-up" />
<fa v-else icon="chevron-right" />
<font-awesome v-if="showVeriClaimDump" icon="chevron-up" />
<font-awesome v-else icon="chevron-right" />
</h2>
<div v-if="showVeriClaimDump">
<div
@@ -323,7 +323,7 @@
class="list-disc p-4"
>
<div class="text-sm">
<fa icon="minus" class="fa-fw" />
<font-awesome icon="minus" class="fa-fw" />
The {{ visibleDidPath }} is visible to:
</div>
<div class="ml-12 p-1">
@@ -342,12 +342,12 @@
copyToClipboard('The DID of ' + visDid, visDid)
"
>
<fa icon="copy" class="text-slate-400 fa-fw" />
<font-awesome icon="copy" class="text-slate-400 fa-fw" />
</button>
</span>
<span v-if="veriClaim.publicUrls?.[visDid]"
>, found at
<fa icon="globe" class="fa-fw text-slate-400" />
<font-awesome icon="globe" class="fa-fw text-slate-400" />
<a
:href="veriClaim.publicUrls?.[visDid]"
class="text-blue-500"
@@ -375,7 +375,7 @@
@click="showClaimPage(veriClaim.id)"
class="text-blue-500 cursor-pointer"
>
<fa icon="file-lines" />
<font-awesome icon="file-lines" />
See All Generic Info
</a>
</div>
@@ -385,7 +385,7 @@
class="text-blue-500 cursor-pointer"
:href="urlForNewGive"
>
<fa icon="file-lines" />
<font-awesome icon="file-lines" />
Record a Give Similar to the Original
</a>
</div>
@@ -397,7 +397,7 @@
class="fixed left-6 bottom-24 text-center text-4xl leading-none bg-slate-400 text-white w-14 py-2.5 rounded-full"
v-if="isLoading"
>
<fa icon="spinner" class="fa-spin-pulse"></fa>
<font-awesome icon="spinner" class="fa-spin-pulse"></font-awesome>
</div>
</section>
</template>