def METHOD_NAME(schema: Schema) -> TypeScriptPrimitive | TypeScriptLiteral | TypeScriptUnion:
    """Parse an OpenAPI schema representing a primitive type(s).
    Args:
        schema: An OpenAPI schema.
    Returns:
        A typescript type.
    """
    if schema.enum:
        return TypeScriptUnion(types=tuple(TypeScriptLiteral(value=value) for value in schema.enum))
    if schema.const:
        return TypeScriptLiteral(value=schema.const)
    if isinstance(schema.type, list):
        return TypeScriptUnion(
            tuple(TypeScriptPrimitive(openapi_to_typescript_type_map[s_type]) for s_type in schema.type)
        )
    if schema.type in openapi_to_typescript_type_map and isinstance(schema.type, OpenAPIType):
        return TypeScriptPrimitive(openapi_to_typescript_type_map[schema.type])
    raise TypeError(f"received an unexpected openapi type: {schema.type}")  # pragma: no cover