MCPcopy Create free account
hub / github.com/Effect-TS/effect / makeApi

Function makeApi

packages/tools/jsdocs/src/Jsdocs.ts:2085–2128  ·  view source on GitHub ↗
(input: {
  readonly file: JSDocModelFile
  readonly imports: ParsedJSDocImports
  readonly kind: JSDocApiKind
  readonly bucket: ExportBucket | null
  readonly apiName: string
  readonly localName: string
  readonly signature: string | null
  readonly parentApiName: string | null
  readonly namespacePath: ReadonlyArray<string>
  readonly memberPath: ReadonlyArray<string>
  readonly sourcePath: ReadonlyArray<string | number>
  readonly sourceRange: readonly [number, number]
  readonly description: ParsedDescription
  readonly examples: ReadonlyArray<ParsedExample>
  readonly tags: ParsedDeclarationTags | ParsedNamespaceTags | ParsedMemberTags
})

Source from the content-addressed store, hash-verified

2083}
2084
2085function makeApi(input: {
2086 readonly file: JSDocModelFile
2087 readonly imports: ParsedJSDocImports
2088 readonly kind: JSDocApiKind
2089 readonly bucket: ExportBucket | null
2090 readonly apiName: string
2091 readonly localName: string
2092 readonly signature: string | null
2093 readonly parentApiName: string | null
2094 readonly namespacePath: ReadonlyArray<string>
2095 readonly memberPath: ReadonlyArray<string>
2096 readonly sourcePath: ReadonlyArray<string | number>
2097 readonly sourceRange: readonly [number, number]
2098 readonly description: ParsedDescription
2099 readonly examples: ReadonlyArray<ParsedExample>
2100 readonly tags: ParsedDeclarationTags | ParsedNamespaceTags | ParsedMemberTags
2101}): JSDocApi {
2102 const apiFqn = `${input.imports.module}.${input.apiName}`
2103 return {
2104 id: apiId(input.kind, input.bucket, apiFqn),
2105 kind: input.kind,
2106 moduleName: input.imports.module,
2107 apiName: input.apiName,
2108 localName: input.localName,
2109 signature: input.signature,
2110 parentApiName: input.parentApiName,
2111 apiFqn,
2112 hasFqnCollision: false,
2113 bucket: input.bucket,
2114 importable: input.kind === "root-declaration",
2115 namespacePath: input.namespacePath,
2116 memberPath: input.memberPath,
2117 source: {
2118 file: input.file.file,
2119 path: input.sourcePath,
2120 range: input.sourceRange
2121 },
2122 description: renderDescription(input.description),
2123 examples: renderExamples(input.examples),
2124 tags: apiTags(input.tags),
2125 see: unresolvedSee(input.tags.see),
2126 importGuidance: importGuidance(input.imports, input.kind, input.bucket, input.apiName)
2127 }
2128}
2129
2130function buildJSDocApis(files: ReadonlyArray<JSDocModelFile>): ReadonlyArray<JSDocApi> {
2131 const apis: Array<JSDocApi> = []

Callers 3

addMembersFunction · 0.70
addNamespacesFunction · 0.70
buildJSDocApisFunction · 0.70

Calls 6

apiIdFunction · 0.85
renderExamplesFunction · 0.85
apiTagsFunction · 0.85
unresolvedSeeFunction · 0.85
importGuidanceFunction · 0.85
renderDescriptionFunction · 0.70

Tested by

no test coverage detected