docs-util: mark type parameters as optional (#8320)
Mark all type parameters in references as optional. Closes DOCS-802
This commit is contained in:
@@ -18,13 +18,10 @@ export default function (theme: MarkdownTheme) {
|
||||
reflection: parameter,
|
||||
level: 1,
|
||||
maxLevel,
|
||||
isTypeParams: true,
|
||||
})
|
||||
)
|
||||
|
||||
// if (typeof options.hash.sectionTitle !== "string") {
|
||||
// console.log("here3")
|
||||
// }
|
||||
|
||||
return formatParameterComponent({
|
||||
parameterComponent,
|
||||
componentItems: parameters,
|
||||
|
||||
@@ -37,6 +37,7 @@ type ReflectionFormatterOptions = {
|
||||
maxLevel?: number | undefined
|
||||
project?: ProjectReflection
|
||||
type?: ParameterStyle
|
||||
isTypeParams?: boolean
|
||||
}
|
||||
|
||||
export default function reflectionFormatter({
|
||||
@@ -123,10 +124,13 @@ export function reflectionComponentFormatter({
|
||||
level = 1,
|
||||
maxLevel,
|
||||
project,
|
||||
isTypeParams,
|
||||
}: ReflectionFormatterOptions): Parameter {
|
||||
const defaultValue = getDefaultValue(reflection) || ""
|
||||
const optional =
|
||||
reflection.flags.isOptional || reflection.kind === ReflectionKind.EnumMember
|
||||
isTypeParams ||
|
||||
reflection.flags.isOptional ||
|
||||
reflection.kind === ReflectionKind.EnumMember
|
||||
const comments = getComments(reflection)
|
||||
const componentItem: Parameter = {
|
||||
name: reflection.name,
|
||||
|
||||
Reference in New Issue
Block a user