MCPcopy Create free account
hub / github.com/TanStack/query / simplifyLitQueriesControllerTypes

Function simplifyLitQueriesControllerTypes

scripts/generate-docs.ts:35–74  ·  view source on GitHub ↗
(
  project: TypeDocReflectionWithSignatures,
)

Source from the content-addressed store, hash-verified

33}
34
35function simplifyLitQueriesControllerTypes(
36 project: TypeDocReflectionWithSignatures,
37) {
38 const stack: Array<TypeDocReflectionWithSignatures> = [project]
39
40 for (const reflection of stack) {
41 stack.push(...(reflection.children ?? []))
42
43 if (reflection.name !== 'createQueriesController') {
44 continue
45 }
46
47 for (const signature of reflection.signatures ?? []) {
48 const combinedResult = signature.typeParameters?.find(
49 (typeParameter) => typeParameter.name === 'TCombinedResult',
50 )
51
52 if (!combinedResult?.default) {
53 continue
54 }
55
56 const queryOptionsType = TypeDoc.ReferenceType.createBrokenReference(
57 'TQueryOptions',
58 project,
59 undefined,
60 )
61 queryOptionsType.refersToTypeParameter = true
62
63 // CreateQueriesResults is internal; render it as plain text, not a link.
64 const queriesResultsType = TypeDoc.ReferenceType.createBrokenReference(
65 'CreateQueriesResults',
66 project,
67 undefined,
68 )
69 queriesResultsType.typeArguments = [queryOptionsType]
70
71 combinedResult.default = queriesResultsType
72 }
73 }
74}
75
76async function trimTrailingWhitespaceInMarkdown(outputDir: string) {
77 const entries = await readdir(outputDir, { withFileTypes: true })

Callers 1

Calls 1

findMethod · 0.45

Tested by

no test coverage detected