- This function does not accept any parameters. -
- ), - showSections = ['parameters', 'returns'], -}) => { - const definition = generateDefinition({ - code: rawDefinition, - }); - const showParameters = showSections.includes('parameters'); - const showReturns = showSections.includes('returns'); - const showThrows = showSections.includes('throws'); - if ('entries' in definition) { - return ( -- This function does not accept any parameters. -
- ), - typeLinkMap = {}, -}: { - signature: GeneratedFunction['signatures'][number]; - index?: string | number; - showParameters?: boolean; - showReturns?: boolean; - showThrows?: boolean; - noParametersContent?: ReactNode; - typeLinkMap?: TSDocProps['typeLinkMap']; -}) { - const slugger = new Slugger(); - const unnamedReturnId = `returns${index}`; - - return ( -| Name | -Type | -Description | -- {linkify(prop.description || '', typeLinkMap)} - | -
|---|
- {linkify(signature.returns.type, typeLinkMap)}
-
- | Type | -Description | -
-
- {linkify(type, typeLinkMap)}
-
- |
-
- {description && (
- - {linkify(description, typeLinkMap)} - - )} - |
-
|---|
- This function does not throw any errors. -
- )} -
- {name}
-
- )}
- | Name | -Type | -Description | -- {linkify(description, typeLinkMap)} - | -
|---|
- {part}
-
- );
- }
- return part;
- })
- .filter(Boolean);
-
- parts.push(
-
- {linkContent}
-
- );
- } else {
- parts.push(
-
- {linkText}
-
- );
- }
- } else if (match[4]) {
- // It's inline code: `code`
- const codeText = match[5];
- parts.push(
-
- {codeText}
-
- );
- }
-
- lastIndex = match.index + match[0].length;
- match = markdownRegex.exec(text);
- }
-
- // Add any remaining text
- if (lastIndex < text.length) {
- parts.push(text.substring(lastIndex));
- }
-
- // If no markdown links were found, use the original logic for type links
- if (parts.length === 0) {
- const result: (string | ReactElement)[] = [];
- const chunks = text.match(/(\w+|\W+)/g) || [];
-
- for (const chunk of chunks) {
- const href = Object.hasOwn(typeLinkMap, chunk)
- ? typeLinkMap[chunk]
- : undefined;
- if (href) {
- result.push(
-
- {chunk}
-
- );
- continue;
- }
- if (typeof result.at(-1) === 'string') {
- result[result.length - 1] += chunk;
- continue;
- }
- result.push(chunk);
- }
- return result;
- }
-
- // Process remaining text parts for type links
- return parts.flatMap((part, index) => {
- if (typeof part !== 'string') return part;
-
- // Apply type link mapping to text parts
- const chunks = part.match(/(\w+|\W+)/g) || [];
- const processedChunks: (string | ReactElement)[] = [];
-
- for (const chunk of chunks) {
- const href = Object.hasOwn(typeLinkMap, chunk)
- ? typeLinkMap[chunk]
- : undefined;
- if (href) {
- processedChunks.push(
-
- {chunk}
-
- );
- } else {
- if (typeof processedChunks[processedChunks.length - 1] === 'string') {
- processedChunks[processedChunks.length - 1] += chunk;
- } else {
- processedChunks.push(chunk);
- }
- }
- }
-
- return processedChunks.length === 1 ? processedChunks[0] : processedChunks;
- });
-}
diff --git a/docs/lib/tsdoc/types.ts b/docs/lib/tsdoc/types.ts
deleted file mode 100644
index d4acce4284..0000000000
--- a/docs/lib/tsdoc/types.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-export type Tags = Record