Initial commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import type { ApiClients } from '~/types/api'
|
||||
|
||||
export function useApi(): ApiClients {
|
||||
return useNuxtApp().$api
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { AuthClient } from '~/types/auth'
|
||||
|
||||
export function useAuth(): AuthClient {
|
||||
return useNuxtApp().$auth
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
type LogLevel = 'debug' | 'info' | 'warn' | 'error'
|
||||
|
||||
type LoggerPayload = Record<string, unknown> | undefined
|
||||
|
||||
type LoggerApi = {
|
||||
debug: (message: string, payload?: LoggerPayload) => void
|
||||
info: (message: string, payload?: LoggerPayload) => void
|
||||
warn: (message: string, payload?: LoggerPayload) => void
|
||||
error: (message: string, payload?: LoggerPayload) => void
|
||||
}
|
||||
|
||||
export function useLogger(): LoggerApi {
|
||||
return useNuxtApp().$logger
|
||||
}
|
||||
|
||||
export type { LoggerApi, LoggerPayload, LogLevel }
|
||||
Reference in New Issue
Block a user