Skip to content

Commit

Permalink
Mute & fix TypeScript errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kossnocorp committed Nov 16, 2023
1 parent 87995eb commit 2ec125d
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 18 deletions.
4 changes: 4 additions & 0 deletions src/ui/components/Drop/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export function Drop({
setTrianglePosition('above')
return true
}
return false
},

above: () => {
Expand All @@ -84,6 +85,7 @@ export function Drop({
setTrianglePosition('below')
return true
}
return false
},

left: () => {
Expand All @@ -94,6 +96,7 @@ export function Drop({
setTrianglePosition('right')
return true
}
return false
},

right: () => {
Expand All @@ -104,6 +107,7 @@ export function Drop({
setTrianglePosition('left')
return true
}
return false
},
}

Expand Down
14 changes: 11 additions & 3 deletions src/ui/components/TypeDocSignature/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,17 @@ export const TypeDocSignature: FunctionComponent<TypeDocSignatureProps> = ({
<>
<span>
{name && `function ${name}`}
{signature.typeParameter && (
<Generics params={signature.typeParameter} />
)}
{
// @ts-expect-error - TypeDoc is being difficult
signature.typeParameter && (
<Generics
params={
// @ts-expect-error - TypeDoc is being difficult
signature.typeParameter
}
/>
)
}
(
</span>

Expand Down
9 changes: 8 additions & 1 deletion src/ui/components/TypeDocType/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,14 @@ export const TypeDocType: FunctionComponent<TypeDocTypeProps> = ({
case 'intersection':

case 'literal':
return <>{JSON.stringify(type.value)}</>
return (
<>
{
// @ts-expect-error - TypeDoc is being difficult
JSON.stringify(type.value)
}
</>
)

case 'reflection':
return <TypeDocReflection reflection={type} listed={listed} />
Expand Down
5 changes: 4 additions & 1 deletion src/ui/screens/Docs/Doc/JSDoc/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export const JSDoc: FunctionComponent<Props> = ({ doc }) => (
{doc.content.exceptions && (
<Exceptions exceptions={doc.content.exceptions} />
)}
{doc.content.examples && <DocExamples examples={doc.content.examples} />}
{doc.content.examples && (
// @ts-expect-error - TypeDoc is being difficult
<DocExamples examples={doc.content.examples} />
)}

<DocLinks />
</div>
Expand Down
20 changes: 13 additions & 7 deletions src/ui/screens/Docs/Doc/TypeDoc/Function/Signature/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,19 @@ export const Signature: FunctionComponent<SignatureProps> = ({
<Type name={name} signature={signature} header={header} scope={scope} />
</IgnoreParentTypesSourceContext.Provider>

{signature.typeParameter && (
<Generics
args={signature.typeParameter}
header={header}
scope={scope}
/>
)}
{
// @ts-expect-error - TypeDoc is being difficult
signature.typeParameter && (
<Generics
args={
// @ts-expect-error - TypeDoc is being difficult
signature.typeParameter
}
header={header}
scope={scope}
/>
)
}

{signature.parameters && signature.parameters.length > 0 && (
<Arguments args={signature.parameters} header={header} scope={scope} />
Expand Down
1 change: 1 addition & 0 deletions src/ui/screens/Docs/Doc/TypeDoc/Function/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function buildParentTypesMap(
const map: ParentTypesMap = {}

refl?.signatures?.forEach((signature) => {
// @ts-expect-error - TypeDoc is being difficult
signature?.typeParameter?.map((r) => {
map[r.id] = pageTypeHash(r.name, r.id)
})
Expand Down
26 changes: 20 additions & 6 deletions src/ui/screens/Docs/Doc/TypeDoc/Types/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const useTypesModal = createModal<TypesModalProps>(

const { query, setQuery, searchRef } = useQuery()

// @ts-expect-error - TypeDoc is being difficult
const navItems: TypeItem[] = useMemo(
() =>
types.map((t) => {
Expand Down Expand Up @@ -225,12 +226,24 @@ function TypeContent({ type, scope }: ContentProps) {
case 'Type parameter':
return (
<div>
{type.default && (
<div>
<SectionHeader header="Default type" scope={scope} tag="h3" />
<Code value={<TypeDocType type={type.default} />} />
</div>
)}
{
// @ts-expect-error - TypeDoc is being difficult
type.default && (
<div>
<SectionHeader header="Default type" scope={scope} tag="h3" />
<Code
value={
<TypeDocType
type={
// @ts-expect-error - TypeDoc is being difficult
type.default
}
/>
}
/>
</div>
)
}
</div>
)

Expand Down Expand Up @@ -354,6 +367,7 @@ function buildParentTypesMap(
const map: ParentTypesMap = accMap || {}

refl &&
// @ts-expect-error - TypeDoc is being difficult
((refl && type?.typeParameter) || type?.typeParameters)?.map((ref) => {
map[ref.id] = inlineTypeHash(refl, ref)
})
Expand Down

0 comments on commit 2ec125d

Please sign in to comment.