Skip to content

Refactor: export useSlmApi internal interfaces to shared types #3196

@mrveiss

Description

@mrveiss

Context

Discovered during implementation of #3167 (PR #3180). When replacing any types, consumers had to duplicate interface definitions instead of importing them.

Problem

useSlmApi.ts defines 57 interfaces inside the composable function scope. None are exported. This forces consumers to:

Example: AdminMonitoringView.vue had to define its own MonitoringError interface matching the shape of items in RecentErrorsResponse.errors, because RecentError is scoped inside useSlmApi().

Affected Interfaces (sample)

Solution

Move shared response interfaces to src/types/slm.ts (or a new src/types/api-responses.ts) and import them in both useSlmApi.ts and consumer components. This eliminates duplication and makes type-safe API consumption straightforward.

Discovered During

Implementation of #3167 (PR #3180)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions