fix: add type extensions to postman-collection types
This commit is contained in:
parent
fda9f2e842
commit
cb92a8d7a6
1 changed files with 21 additions and 0 deletions
21
packages/hoppscotch-app/types/pm-coll-exts.d.ts
vendored
Normal file
21
packages/hoppscotch-app/types/pm-coll-exts.d.ts
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import "postman-collection"
|
||||
|
||||
/*
|
||||
There are some small mismatches in some types that the 'postman-collection'
|
||||
package provides (come on guys ;) ). These type definitions append extra
|
||||
information which is present in the runtime values of the types
|
||||
*/
|
||||
|
||||
type PMRawLanguage = "text" | "javascript" | "json" | "html" | "xml"
|
||||
|
||||
declare module "postman-collection" {
|
||||
interface RequestBody {
|
||||
// Options is not well-defined by the schema, so we are treating everything as optional for runtime safety.
|
||||
// See: https://schema.postman.com/collection/json/v2.1.0/draft-04/collection.json
|
||||
options?: {
|
||||
raw?: {
|
||||
language?: PMRawLanguage
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue