(
codeRef: RefObject<HTMLDivElement | null>,
files: DownloadFiles['files'],
urls: {[name: string]: string},
entry: string | undefined
)
| 288 | } |
| 289 | |
| 290 | function getExampleFiles( |
| 291 | codeRef: RefObject<HTMLDivElement | null>, |
| 292 | files: DownloadFiles['files'], |
| 293 | urls: {[name: string]: string}, |
| 294 | entry: string | undefined |
| 295 | ): DownloadFiles['files'] { |
| 296 | if (!entry) { |
| 297 | return { |
| 298 | ...files, |
| 299 | 'Example.tsx': {contents: getExampleCode(codeRef, urls)} |
| 300 | }; |
| 301 | } |
| 302 | |
| 303 | return files; |
| 304 | } |
| 305 | |
| 306 | function getTextContent(element: Element) { |
| 307 | // Manually walk over text nodes inside the element and concatenate them. |
no test coverage detected