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
TypeAliasDeclarationnodeType
Typechecker
TypeCheckerdeclaration
diagnostics
({ 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