refactor: update provider method signature

This commit is contained in:
jamesgeorge007
2024-02-10 12:46:14 +05:30
parent a0e373a4f3
commit 2c47a63ca0
4 changed files with 44 additions and 38 deletions

View File

@@ -19,17 +19,22 @@ export type HoppInheritedProperty = {
}
type ModifiedAuth<T, AuthType> = {
[K in keyof T]: K extends 'inheritedAuth' ? Extract<T[K], AuthType> : T[K]
[K in keyof T]: K extends "inheritedAuth" ? Extract<T[K], AuthType> : T[K]
}
type ModifiedHeaders<T, HeaderType> = {
[K in keyof T]: K extends 'inheritedHeader' ? Extract<T[K], HeaderType> : T[K]
[K in keyof T]: K extends "inheritedHeader" ? Extract<T[K], HeaderType> : T[K]
}
type ModifiedHoppInheritedProperty<AuthType, HeaderType> = {
auth: ModifiedAuth<HoppInheritedProperty['auth'], AuthType>
headers: ModifiedHeaders<HoppInheritedProperty['headers'][number], HeaderType>[]
auth: ModifiedAuth<HoppInheritedProperty["auth"], AuthType>
headers: ModifiedHeaders<
HoppInheritedProperty["headers"][number],
HeaderType
>[]
}
export type HoppInheritedRESTProperty = ModifiedHoppInheritedProperty<HoppRESTAuth, HoppRESTHeader>
export type HoppInheritedRESTProperty = ModifiedHoppInheritedProperty<
HoppRESTAuth,
HoppRESTHeader
>