feat: 🎸 Made User properties optional for hook convenience (#31)
This commit is contained in:
parent
d7e4981822
commit
0e0e996589
|
@ -10,7 +10,7 @@ export interface CallInfo extends RequestInit {
|
|||
}
|
||||
|
||||
export interface FetcherOptions {
|
||||
record?: (info: CallInfo, data: string | Blob | Buffer | ArrayBuffer) => Promise<void>
|
||||
record?: (info: CallInfo, data: string | Blob | ArrayBuffer | any) => Promise<void>
|
||||
}
|
||||
|
||||
export interface Fetcher {
|
||||
|
@ -18,7 +18,7 @@ export interface Fetcher {
|
|||
}
|
||||
|
||||
export interface Recorder {
|
||||
(info: CallInfo, data: string | Blob | Buffer | ArrayBuffer): Promise<void>
|
||||
(info: CallInfo, data: string | Blob | ArrayBuffer | any): Promise<void>
|
||||
}
|
||||
|
||||
const record = async (
|
||||
|
@ -28,7 +28,7 @@ const record = async (
|
|||
type: string,
|
||||
options: FetcherOptions,
|
||||
response: Response,
|
||||
data: string | Buffer | ArrayBuffer | Blob,
|
||||
data: string | ArrayBuffer | Blob | any,
|
||||
): Promise<void> => {
|
||||
if (!options.record) {
|
||||
return
|
||||
|
|
12
lib/types.ts
12
lib/types.ts
|
@ -146,10 +146,10 @@ export interface MenuItem {
|
|||
}
|
||||
|
||||
export interface User {
|
||||
personalNumber: string
|
||||
isAuthenticated: boolean
|
||||
firstName: string
|
||||
lastName: string
|
||||
email: string | null
|
||||
notificationId: string
|
||||
personalNumber?: string
|
||||
isAuthenticated?: boolean
|
||||
firstName?: string
|
||||
lastName?: string
|
||||
email?: string | null
|
||||
notificationId?: string
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue