[F] setMediaTypeHint
function setMediaTypeHint( program, target, mediaType): void;Sets the default media type hint for the given target type.
This value is a hint ONLY. Emitters are not required to use it, but may use it to get the default media type associated with a TypeSpec type.
If a type already has a default media type hint set, this function will override it with the new value.
WARNING: this function will throw an error if the provided media type string is not recognized as a valid MIME type.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
program | Program | the Program containing the target |
target | | Enum | Model | Scalar | Union | the target to set the MIME type hint for |
mediaType | string | the default media type hint to set for the target |
Returns
Section titled “Returns”void
Throws
Section titled “Throws”if the provided media type string is not recognized as a valid MIME type