Dev cleaning (#106)

This commit is contained in:
Munawwirul Jamal
2025-10-08 00:03:36 +07:00
committed by GitHub
parent 7fdd5c61f0
commit 3eb9dde21d
892 changed files with 51326 additions and 1 deletions
+27
View File
@@ -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
+7
View File
@@ -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
}
+16
View File
@@ -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 {}