Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 fix(typing) add missing elements and fixes when() signature
- Loading branch information
Showing
4 changed files
with
72 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,35 @@ | ||
declare module '@k-ramel/driver-http' { | ||
import { StoreBase, Driver, BaseAction } from 'k-ramel' | ||
declare module "@k-ramel/driver-http" { | ||
import { StoreBase, Driver, BaseAction } from "k-ramel"; | ||
|
||
const httpDriver: () => Driver | ||
const httpDriver: () => Driver; | ||
|
||
export type HTTPOptions = Omit<body, RequestInit> | ||
export type RequestFunction = (url: string, body?: BodyInit | object, options?: HTTPOptions) => void | ||
export type HTTPOptions = Omit<body, RequestInit>; | ||
export type RequestFunction = ( | ||
url: string, | ||
body?: BodyInit | object, | ||
options?: HTTPOptions | ||
) => void; | ||
|
||
export type HTTPDriver = ( | ||
name: string, | ||
context?: object, | ||
context?: any | ||
) => { | ||
post: RequestFunction | ||
get: RequestFunction | ||
head: RequestFunction | ||
patch: RequestFunction | ||
put: RequestFunction | ||
delete: RequestFunction | ||
options: RequestFunction | ||
connect: RequestFunction | ||
} | ||
post: RequestFunction; | ||
get: RequestFunction; | ||
head: RequestFunction; | ||
patch: RequestFunction; | ||
put: RequestFunction; | ||
delete: RequestFunction; | ||
options: RequestFunction; | ||
connect: RequestFunction; | ||
}; | ||
|
||
export interface HTTPBaseAction<Payload> extends BaseAction { | ||
payload: Payload | ||
status: number | ||
headers: Headers | ||
payload: Payload; | ||
context: any; | ||
status: number; | ||
headers: Headers; | ||
} | ||
|
||
export default httpDriver | ||
export default httpDriver; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,35 @@ | ||
declare module '@k-ramel/driver-http' { | ||
import { StoreBase, Driver, BaseAction } from 'k-ramel' | ||
declare module "@k-ramel/driver-http" { | ||
import { StoreBase, Driver, BaseAction } from "k-ramel"; | ||
|
||
const httpDriver: () => Driver | ||
const httpDriver: () => Driver; | ||
|
||
export type HTTPOptions = Omit<body, RequestInit> | ||
export type RequestFunction = (url: string, body?: BodyInit | object, options?: HTTPOptions) => void | ||
export type HTTPOptions = Omit<body, RequestInit>; | ||
export type RequestFunction = ( | ||
url: string, | ||
body?: BodyInit | object, | ||
options?: HTTPOptions | ||
) => void; | ||
|
||
export type HTTPDriver = ( | ||
name: string, | ||
context?: object, | ||
context?: any | ||
) => { | ||
post: RequestFunction | ||
get: RequestFunction | ||
head: RequestFunction | ||
patch: RequestFunction | ||
put: RequestFunction | ||
delete: RequestFunction | ||
options: RequestFunction | ||
connect: RequestFunction | ||
} | ||
post: RequestFunction; | ||
get: RequestFunction; | ||
head: RequestFunction; | ||
patch: RequestFunction; | ||
put: RequestFunction; | ||
delete: RequestFunction; | ||
options: RequestFunction; | ||
connect: RequestFunction; | ||
}; | ||
|
||
export interface HTTPBaseAction<Payload> extends BaseAction { | ||
payload: Payload | ||
status: number | ||
headers: Headers | ||
payload: Payload; | ||
context: any; | ||
status: number; | ||
headers: Headers; | ||
} | ||
|
||
export default httpDriver | ||
export default httpDriver; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters