typescript-extract-type-properties.ts

Property extraction for TypeScript type aliases.

extractTypeAliasProperties walks the resolved type and emits members for named properties, index signatures, call signatures, and construct signatures. Handles object literals, intersections, mapped types (Partial, Pick, Readonly, etc.), type references, and function types. Called by extractTypeInfo in typescript-extract-type.ts for type aliases (interfaces use a different path that walks node.members directly).

@see typescript-extract-shared.ts for shared helpers @see typescript-extract-type.ts for the dispatcher

view source

Declarations
#

extractTypeAliasProperties
#

typescript-extract-type-properties.ts view source

(node: TypeAliasDeclaration, nodeType: Type, checker: TypeChecker, declaration: DeclarationJsonBuild, diagnostics: ({ ...; } | ... 12 more ... | { ...; })[], isExternalFile: IsExternalFile): void import {extractTypeAliasProperties} from 'svelte-docinfo/typescript-extract-type-properties.js';

Extract properties from a type alias via the TypeScript checker API.

Handles object literals, intersections, mapped types (Partial, Pick, Readonly, etc.), type references, and function types. Extracts:

  • Named properties (with readonly/optional detection, TSDoc from declarations)
  • Index signatures (string/number)
  • Call signatures ((call))
  • Construct signatures ((construct))

node

type TypeAliasDeclaration

nodeType

type Type

checker

type TypeChecker

declaration

diagnostics

type ({ symbolName: string; file: string; message: string; severity: "error" | "warning"; kind: "type_extraction_failed"; line?: number | undefined; column?: number | undefined; } | { functionName: string; ... 5 more ...; column?: number | undefined; } | ... 11 more ... | { ...; })[]

isExternalFile

returns

void

mutates

  • declaration — adds members

Depends on
#

Imported by
#