chore: improve JS Client TSDoc comments (#5582)
* add oas schema to tsdoc parser * add tsdoc (part 1) * Finished tsdoc in js client * general fixes * added tsdoc in core medusa package * parse schema tags in model files * added maxlevel option * added more tsdoc * added tsdoc in core * added TSDoc in core package * generated client types * support featureFlag and expandable tags * added support for resource feature flag note * fix api ignore plugin * added eslint plugin * support feature flag and expandable badges * adjusted overview page + generated reference * revert generated files * added changeset * add details about new typedoc options * fix broken link
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import React from "react"
|
||||
import { Badge, Link, Tooltip } from "@/components"
|
||||
|
||||
export type ExpandableNoticeProps = {
|
||||
type: "request" | "method"
|
||||
link: string
|
||||
badgeContent?: React.ReactNode
|
||||
badgeClassName?: string
|
||||
}
|
||||
|
||||
export const ExpandableNotice = ({
|
||||
type = "request",
|
||||
link,
|
||||
badgeContent = "expendable",
|
||||
badgeClassName,
|
||||
}: ExpandableNoticeProps) => {
|
||||
return (
|
||||
<Tooltip
|
||||
tooltipChildren={
|
||||
<>
|
||||
If this {type} accepts an <code>expand</code>{" "}
|
||||
{type === "request" ? "parameter" : "property or option"},
|
||||
<br /> this field can be <Link href={link}>expanded</Link> into an
|
||||
object.
|
||||
</>
|
||||
}
|
||||
clickable
|
||||
>
|
||||
<Badge variant="blue" className={badgeClassName}>
|
||||
{badgeContent}
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user