@@ -311,22 +311,14 @@ function renderHeader(input: {
311311 editUrl : string | boolean
312312 description : string
313313} ) {
314- const relativePath = path . relative (
315- path . dirname ( path . join ( OUTPUT_DIR , `${ input . moduleName } .mdx` ) ) ,
316- "src/components/tsdoc" ,
317- )
318314 return [
319315 `---` ,
320316 `title: ${ input . title } ` ,
321317 `editUrl: ${ input . editUrl } ` ,
322318 `description: ${ input . description } ` ,
323319 `---` ,
324320 "" ,
325- `import Segment from '${ relativePath } /Segment.astro';` ,
326- `import Section from '${ relativePath } /Section.astro';` ,
327- `import NestedTitle from '${ relativePath } /NestedTitle.astro';` ,
328- `import InlineSection from '${ relativePath } /InlineSection.astro';` ,
329- `import { Tabs, TabItem } from '@astrojs/starlight/components';` ,
321+ "import { Segment, Section, NestedTitle, InlineSection } from 'toolbeam-docs-theme/components'" ,
330322 "" ,
331323 ]
332324}
@@ -497,16 +489,16 @@ function renderComment(declaration: TypeDoc.Reflection) {
497489
498490 return [
499491 declaration instanceof TypeDoc . DeclarationReflection &&
500- declaration . defaultValue
492+ declaration . defaultValue
501493 ? [
502- `` ,
503- `<InlineSection>` ,
504- `**Default** ${ renderType ( {
505- type : "literal" ,
506- value : declaration . defaultValue . replace ( / " / g, "" ) ,
507- } as TypeDoc . LiteralType ) } `,
508- `</InlineSection>` ,
509- ]
494+ `` ,
495+ `<InlineSection>` ,
496+ `**Default** ${ renderType ( {
497+ type : "literal" ,
498+ value : declaration . defaultValue . replace ( / " / g, "" ) ,
499+ } as TypeDoc . LiteralType ) } `,
500+ `</InlineSection>` ,
501+ ]
510502 : [ ] ,
511503 declaration . comment . blockTags
512504 . filter ( ( tag ) => tag . tag === "@default" )
@@ -518,13 +510,13 @@ function renderComment(declaration: TypeDoc.Reflection) {
518510 // Otherwise render it as a comment ie. No domains configured
519511 tag . content . length === 1 && tag . content [ 0 ] . kind === "code"
520512 ? `**Default** ${ renderType (
521- new TypeDoc . IntrinsicType (
522- tag . content [ 0 ] . text
523- . replace ( / ` / g, "" )
524- . replace ( / { / g, "{" )
525- . replace ( / } / g, "}" ) ,
526- ) ,
527- ) } `
513+ new TypeDoc . IntrinsicType (
514+ tag . content [ 0 ] . text
515+ . replace ( / ` / g, "" )
516+ . replace ( / { / g, "{" )
517+ . replace ( / } / g, "}" ) ,
518+ ) ,
519+ ) } `
528520 : `**Default** ${ tag . content . map ( ( c ) => c . text ) } ` ,
529521 `</InlineSection>` ,
530522 ]
@@ -546,11 +538,11 @@ function renderSignatureAsType(signature: TypeDoc.SignatureReflection) {
546538 . map (
547539 ( parameter ) =>
548540 `${ renderParameter ( parameter ) } : ${
549- // If the type is an object, render it inline
550- parameter . type ?. type === "reflection" &&
541+ // If the type is an object, render it inline
542+ parameter . type ?. type === "reflection" &&
551543 parameter . type . declaration . kind === TypeDoc . ReflectionKind . TypeLiteral
552- ? renderObjectTypeInline ( parameter . type )
553- : renderType ( parameter . type ! )
544+ ? renderObjectTypeInline ( parameter . type )
545+ : renderType ( parameter . type ! )
554546 } `,
555547 )
556548 . join ( ", " )
@@ -696,8 +688,8 @@ function renderUnionType(type: TypeDoc.UnionType) {
696688function renderArrayType ( type : TypeDoc . ArrayType ) {
697689 return type . elementType . type === "union"
698690 ? `<code class="symbol">(</code>${ renderType (
699- type . elementType ,
700- ) } <code class="symbol">)[]</code>`
691+ type . elementType ,
692+ ) } <code class="symbol">)[]</code>`
701693 : `${ renderType ( type . elementType ) } <code class="symbol">[]</code>`
702694}
703695function renderCallbackType ( type : TypeDoc . ReflectionType ) {
@@ -713,7 +705,7 @@ function renderObjectTypeInline(type: TypeDoc.ReflectionType): Text {
713705 `<code class="symbol">: </code>` ,
714706 // If rendering inline, also render children inline
715707 c . type ?. type === "reflection" &&
716- c . type . declaration . kind === TypeDoc . ReflectionKind . TypeLiteral
708+ c . type . declaration . kind === TypeDoc . ReflectionKind . TypeLiteral
717709 ? renderObjectTypeInline ( c . type )
718710 : renderType ( c . type ! ) ,
719711 ] . join ( "" ) ,
@@ -809,17 +801,17 @@ function flattenNestedTypes(
809801 { prefix, subType, depth } ,
810802 ...( subType . kind === TypeDoc . ReflectionKind . Property
811803 ? flattenNestedTypes (
812- subType . type ! ,
813- `${ prefix } .${ subType . name } ` ,
814- depth + 1 ,
815- )
804+ subType . type ! ,
805+ `${ prefix } .${ subType . name } ` ,
806+ depth + 1 ,
807+ )
816808 : [ ] ) ,
817809 ...( subType . kind === TypeDoc . ReflectionKind . Accessor
818810 ? flattenNestedTypes (
819- subType . getSignature ?. type ! ,
820- `${ prefix } .${ subType . name } ` ,
821- depth + 1 ,
822- )
811+ subType . getSignature ?. type ! ,
812+ `${ prefix } .${ subType . name } ` ,
813+ depth + 1 ,
814+ )
823815 : [ ] ) ,
824816 ] )
825817 }
@@ -847,8 +839,8 @@ function configureLogger() {
847839 return
848840 }
849841
850- console . debug = ( ) => { }
851- console . warn = ( ) => { }
842+ console . debug = ( ) => { }
843+ console . warn = ( ) => { }
852844}
853845
854846function printWarnings ( ) {
0 commit comments