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

Function makeApi

packages/tools/jsdocs/src/Jsdocs.ts:2033–2076  ·  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

2031}
2032
2033function makeApi(input: {
2034 readonly file: JSDocModelFile
2035 readonly imports: ParsedJSDocImports
2036 readonly kind: JSDocApiKind
2037 readonly bucket: ExportBucket | null
2038 readonly apiName: string
2039 readonly localName: string
2040 readonly signature: string | null
2041 readonly parentApiName: string | null
2042 readonly namespacePath: ReadonlyArray<string>
2043 readonly memberPath: ReadonlyArray<string>
2044 readonly sourcePath: ReadonlyArray<string | number>
2045 readonly sourceRange: readonly [number, number]
2046 readonly description: ParsedDescription
2047 readonly examples: ReadonlyArray<ParsedExample>
2048 readonly tags: ParsedDeclarationTags | ParsedNamespaceTags | ParsedMemberTags
2049}): JSDocApi {
2050 const apiFqn = `${input.imports.module}.${input.apiName}`
2051 return {
2052 id: apiId(input.kind, input.bucket, apiFqn),
2053 kind: input.kind,
2054 moduleName: input.imports.module,
2055 apiName: input.apiName,
2056 localName: input.localName,
2057 signature: input.signature,
2058 parentApiName: input.parentApiName,
2059 apiFqn,
2060 hasFqnCollision: false,
2061 bucket: input.bucket,
2062 importable: input.kind === "root-declaration",
2063 namespacePath: input.namespacePath,
2064 memberPath: input.memberPath,
2065 source: {
2066 file: input.file.file,
2067 path: input.sourcePath,
2068 range: input.sourceRange
2069 },
2070 description: renderDescription(input.description),
2071 examples: renderExamples(input.examples),
2072 tags: apiTags(input.tags),
2073 see: unresolvedSee(input.tags.see),
2074 importGuidance: importGuidance(input.imports, input.kind, input.bucket, input.apiName)
2075 }
2076}
2077
2078function buildJSDocApis(files: ReadonlyArray<JSDocModelFile>): ReadonlyArray<JSDocApi> {
2079 const apis: Array<JSDocApi> = []

Callers 3

addMembersFunction · 0.85
addNamespacesFunction · 0.85
buildJSDocApisFunction · 0.85

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