fix: add type extensions to postman-collection types
This commit is contained in:
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user