refactor: use type instead of interface

This commit is contained in:
Gauthier Roebroeck 2025-10-15 09:07:27 +08:00
parent 0d5e827503
commit 4e5bcb9b65
6 changed files with 13 additions and 13 deletions

View file

@ -35,11 +35,11 @@ const client = createClient<paths>({
})
client.use(coladaMiddleware)
interface SpringError {
type SpringError = {
message?: string
}
export interface ErrorCause {
export type ErrorCause = {
body?: unknown
status?: number
message?: string

View file

@ -96,7 +96,7 @@ async function submitForm(isActive: Ref<boolean, boolean>) {
}
}
export interface DialogConfirmProps {
export type DialogConfirmProps = {
title?: string
subtitle?: string
okText?: string

View file

@ -79,7 +79,7 @@ async function submitForm(callback: () => void) {
if (valid) callback()
}
export interface DialogConfirmEditProps {
export type DialogConfirmEditProps = {
/**
* Dialog title
* @type string

View file

@ -265,7 +265,7 @@ import { commonMessages } from '@/utils/i18n/common-messages'
const intl = useIntl()
interface UserExtend {
type UserExtend = {
id?: string
email: string
password?: string

View file

@ -29,22 +29,22 @@ export const useDialogsStore = defineStore('dialogs', {
}),
})
interface DialogActivation<T> {
type DialogActivation<T> = {
activator?: Element | string
dialogProps: T
callback: (hideDialog: () => void, setLoading: (isLoading: boolean) => void) => void
}
interface DialogConfirmEditActivation extends DialogActivation<DialogConfirmEditProps> {
type DialogConfirmEditActivation = DialogActivation<DialogConfirmEditProps> & {
slot: ComponentWithProps
record?: unknown
}
interface DialogConfirmActivation extends DialogActivation<DialogConfirmProps> {
type DialogConfirmActivation = DialogActivation<DialogConfirmProps> & {
slotWarning: ComponentWithProps
}
interface ComponentWithProps {
type ComponentWithProps = {
component?: Component
props: object
}

View file

@ -1,19 +1,19 @@
export interface ActuatorInfo {
export type ActuatorInfo = {
git: ActuatorGit
build: ActuatorBuild
}
export interface ActuatorGit {
export type ActuatorGit = {
commit: ActuatorGitCommit
branch: string
}
export interface ActuatorGitCommit {
export type ActuatorGitCommit = {
time: Date
id: string
}
export interface ActuatorBuild {
export type ActuatorBuild = {
version: string
artifact: string
name: string