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

Function simplifyLitQueriesControllerTypes

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 1

findMethod · 0.45

Tested by

no test coverage detected