Dev cleaning (#106)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Base interface untuk error yang digunakan di seluruh aplikasi
|
||||
*/
|
||||
export interface XError {
|
||||
/** Pesan error yang akan ditampilkan */
|
||||
message: string
|
||||
/** Kode error (opsional) */
|
||||
code?: string
|
||||
/** Nilai yang diharapkan (untuk validasi) */
|
||||
expectedVal?: string
|
||||
/** Nilai yang diberikan (untuk validasi) */
|
||||
givenVal?: string
|
||||
/** Path field yang error (untuk form validation) */
|
||||
path?: readonly (string | number)[]
|
||||
/** Properties tambahan lainnya */
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
/**
|
||||
* Collection of errors dengan key sebagai field name
|
||||
*/
|
||||
export type XErrors = Record<string, XError>
|
||||
|
||||
/**
|
||||
* Form errors type alias untuk kompatibilitas
|
||||
*/
|
||||
export type FormErrors = XErrors
|
||||
@@ -0,0 +1,7 @@
|
||||
export interface ExposedForm<TValues = any> {
|
||||
// eslint-disable-next-line style/member-delimiter-style
|
||||
validate: () => Promise<{ valid: boolean; values: TValues; errors: any }> | undefined
|
||||
resetForm: () => void
|
||||
setValues: (values: any, shouldValidate?: boolean) => void
|
||||
values: TValues
|
||||
}
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
// app/types/index.d.ts
|
||||
import type { Pinia } from 'pinia'
|
||||
|
||||
declare module '#app' {
|
||||
interface NuxtApp {
|
||||
$pinia: Pinia
|
||||
}
|
||||
}
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
interface ComponentCustomProperties {
|
||||
$pinia: Pinia
|
||||
}
|
||||
}
|
||||
|
||||
export {}
|
||||
Reference in New Issue
Block a user