Skip to content

griffe_typedoc ¤

Griffe TypeDoc package.

Signatures for entire TypeScript programs using TypeDoc.

Classes:

  • Accessor –

    A property accessor with getter and setter signatures.

  • BlockTag –

    A comment tag and its content.

  • BlockTagContent –

    A text, code, or inline tag segment in a comment.

  • BlockTagContentKind –

    Kinds of content in a TypeDoc comment.

  • BlockTagKind –

    Tags supported in TypeDoc comments.

  • CallSignature –

    A callable signature with its parameters and return type.

  • Class –

    A TypeScript class reflection.

  • Comment –

    A TypeDoc comment with a summary and optional tags.

  • Constructor –

    A constructor and its signatures.

  • ConstructorSignature –

    A constructor signature with its parameters.

  • Enum –

    A TypeScript enum reflection.

  • EnumMember –

    A member of a TypeScript enum.

  • FileRegistry –

    Source files and their associated reflections.

  • Function –

    A TypeScript function and its call signatures.

  • GetSignature –

    A getter signature.

  • Group –

    A named group of reflections.

  • IndexSignature –

    An index signature with its parameters and value type.

  • Interface –

    A TypeScript interface reflection.

  • LogLevel –

    Enumeration of available log levels.

  • Method –

    A TypeScript method and its call signatures.

  • Module –

    A TypeScript module reflection.

  • Namespace –

    A TypeScript namespace reflection.

  • Parameter –

    A parameter in a callable signature.

  • Project –

    The root reflection of a TypeDoc project.

  • Property –

    A TypeScript property reflection.

  • Reference –

    A reflection that refers to another reflection by ID.

  • Reflection –

    Base model for a TypeDoc reflection.

  • ReflectionKind –

    Kinds of TypeDoc reflections.

  • SetSignature –

    A setter signature with its parameters.

  • Source –

    The source location of a reflection.

  • Target –

    A reference target identified by its source file and qualified name.

  • Type –

    A TypeScript type and the details associated with its kind.

  • TypeAlias –

    A TypeScript type alias reflection.

  • TypeKind –

    Kinds of TypeScript types represented by TypeDoc.

  • TypeLiteral –

    A type literal with its members and signatures.

  • TypeParameter –

    A generic type parameter with an optional constraint and default.

  • TypedocDecoder –

    JSON decoder.

  • Variable –

    A TypeScript variable reflection.

Functions:

  • get_logger –

    Create and return a new logger instance.

  • get_parser –

    Return the CLI argument parser.

  • load –

    Load TypeScript API data using TypeDoc.

  • main –

    Run the main program.

  • patch_loggers –

    Patch loggers.

Accessor dataclass ¤

Accessor(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
    get_signature: GetSignature | None = None,
    set_signature: SetSignature | None = None,
    overwrites: Type | None = None,
    implementation_of: Type | None = None,
    inherited_from: Type | None = None,
)

Bases: Reflection

A property accessor with getter and setter signatures.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

get_signature class-attribute instance-attribute ¤

get_signature: GetSignature | None = None

Getter signature of the accessor.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

implementation_of class-attribute instance-attribute ¤

implementation_of: Type | None = None

Reference to the declaration that this reflection implements.

inherited_from class-attribute instance-attribute ¤

inherited_from: Type | None = None

Reference to the declaration that this reflection inherits.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

overwrites class-attribute instance-attribute ¤

overwrites: Type | None = None

Reference to the declaration that this reflection overrides.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

set_signature class-attribute instance-attribute ¤

set_signature: SetSignature | None = None

Setter signature of the accessor.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

BlockTag dataclass ¤

BlockTag(
    *, kind: BlockTagKind, content: list[BlockTagContent]
)

A comment tag and its content.

Methods:

  • markdown –

    Render tag content as Markdown.

Attributes:

content instance-attribute ¤

Content segments of the tag.

kind instance-attribute ¤

Kind of comment tag.

markdown ¤

markdown(**kwargs: Any) -> str

Render tag content as Markdown.

Parameters:

  • **kwargs ¤

    (Any, default: {} ) –

    Keyword arguments passed to each content segment's markdown method.

Returns:

  • str –

    The rendered content segments joined together.

Source code in src/griffe_typedoc/_internal/models.py
336
337
338
339
340
341
342
343
344
345
def markdown(self, **kwargs: Any) -> str:
    """Render tag content as Markdown.

    Parameters:
        **kwargs: Keyword arguments passed to each content segment's `markdown` method.

    Returns:
        The rendered content segments joined together.
    """
    return "".join(block.markdown(**kwargs) for block in self.summary)  # ty:ignore[unresolved-attribute]

BlockTagContent dataclass ¤

BlockTagContent(
    *,
    kind: BlockTagContentKind,
    text: str,
    target: int | str | None = None,
    ts_link_text: str | None = None,
)

A text, code, or inline tag segment in a comment.

Methods:

  • markdown –

    Render the content segment as Markdown.

Attributes:

kind instance-attribute ¤

Kind of comment content.

target class-attribute instance-attribute ¤

target: int | str | None = None

Reflection ID or URL targeted by an inline link.

text instance-attribute ¤

text: str

Text of the content segment.

ts_link_text: str | None = None

Link text supplied in the TypeScript comment.

markdown ¤

markdown(
    symbol_map: dict[int, Reflection] | None = None,
) -> str

Render the content segment as Markdown.

Parameters:

  • symbol_map ¤

    (dict[int, Reflection] | None, default: None ) –

    Reflections indexed by ID, used to resolve internal links.

Returns:

  • str –

    Text, a Markdown link, or an autoref element for a resolved internal link.

Source code in src/griffe_typedoc/_internal/models.py
308
309
310
311
312
313
314
315
316
317
318
319
320
321
def markdown(self, symbol_map: dict[int, Reflection] | None = None) -> str:
    """Render the content segment as Markdown.

    Parameters:
        symbol_map: Reflections indexed by ID, used to resolve internal links.

    Returns:
        Text, a Markdown link, or an autoref element for a resolved internal link.
    """
    if self.target:
        if isinstance(self.target, int) and symbol_map:
            return f'<autoref identifier="{symbol_map[self.target].path}">{self.text}</autoref>'
        return f"[{self.text}]({self.target})"
    return self.text

BlockTagContentKind ¤

Bases: Enum

Kinds of content in a TypeDoc comment.

Attributes:

  • CODE –

    Code content.

  • INLINE_TAG –

    An inline comment tag.

  • TEXT –

    Plain text content.

CODE class-attribute instance-attribute ¤

CODE = 'code'

Code content.

INLINE_TAG class-attribute instance-attribute ¤

INLINE_TAG = 'inline-tag'

An inline comment tag.

TEXT class-attribute instance-attribute ¤

TEXT = 'text'

Plain text content.

BlockTagKind ¤

Bases: Enum

Tags supported in TypeDoc comments.

Attributes:

  • ALPHA –

    The @alpha comment tag.

  • BETA –

    The @beta comment tag.

  • CATEGORY –

    The @category comment tag.

  • DEFAULT_VALUE –

    The @defaultValue comment tag.

  • DEPRECATED –

    The @deprecated comment tag.

  • ENUM –

    The @enum comment tag.

  • EVENT –

    The @event comment tag.

  • EVENT_PROPERTY –

    The @eventProperty comment tag.

  • EXAMPLE –

    The @example comment tag.

  • EXPERIMENTAL –

    The @experimental comment tag.

  • GROUP –

    The @group comment tag.

  • HIDDEN –

    The @hidden comment tag.

  • IGNORE –

    The @ignore comment tag.

  • INHERIT_DOC –

    The @inheritDoc comment tag.

  • INTERFACE –

    The @interface comment tag.

  • INTERNAL –

    The @internal comment tag.

  • LABEL –

    The @label comment tag.

  • LINK –

    The @link comment tag.

  • MODULE –

    The @module comment tag.

  • NAMESPACE –

    The @namespace comment tag.

  • OVERLOAD –

    The @overload comment tag.

  • OVERRIDE –

    The @override comment tag.

  • PACKAGE_DOCUMENTATION –

    The @packageDocumentation comment tag.

  • PARAM –

    The @param comment tag.

  • PRIVATE –

    The @private comment tag.

  • PRIVATE_REMARKS –

    The @privateRemarks comment tag.

  • PROPERTY –

    The @property comment tag.

  • PROTECTED –

    The @protected comment tag.

  • PUBLIC –

    The @public comment tag.

  • READONLY –

    The @readonly comment tag.

  • REMARKS –

    The @remarks comment tag.

  • RETURNS –

    The @returns comment tag.

  • SATISFIES –

    The @satisfies comment tag.

  • SEALED –

    The @sealed comment tag.

  • SEE –

    The @see comment tag.

  • TEMPLATE –

    The @template comment tag.

  • THROWS –

    The @throws comment tag.

  • TYPE_PARAM –

    The @typeParam comment tag.

  • VIRTUAL –

    The @virtual comment tag.

ALPHA class-attribute instance-attribute ¤

ALPHA = '@alpha'

The @alpha comment tag.

BETA class-attribute instance-attribute ¤

BETA = '@beta'

The @beta comment tag.

CATEGORY class-attribute instance-attribute ¤

CATEGORY = '@category'

The @category comment tag.

DEFAULT_VALUE class-attribute instance-attribute ¤

DEFAULT_VALUE = '@defaultValue'

The @defaultValue comment tag.

DEPRECATED class-attribute instance-attribute ¤

DEPRECATED = '@deprecated'

The @deprecated comment tag.

ENUM class-attribute instance-attribute ¤

ENUM = '@enum'

The @enum comment tag.

EVENT class-attribute instance-attribute ¤

EVENT = '@event'

The @event comment tag.

EVENT_PROPERTY class-attribute instance-attribute ¤

EVENT_PROPERTY = '@eventProperty'

The @eventProperty comment tag.

EXAMPLE class-attribute instance-attribute ¤

EXAMPLE = '@example'

The @example comment tag.

EXPERIMENTAL class-attribute instance-attribute ¤

EXPERIMENTAL = '@experimental'

The @experimental comment tag.

GROUP class-attribute instance-attribute ¤

GROUP = '@group'

The @group comment tag.

HIDDEN class-attribute instance-attribute ¤

HIDDEN = '@hidden'

The @hidden comment tag.

IGNORE class-attribute instance-attribute ¤

IGNORE = '@ignore'

The @ignore comment tag.

INHERIT_DOC class-attribute instance-attribute ¤

INHERIT_DOC = '@inheritDoc'

The @inheritDoc comment tag.

INTERFACE class-attribute instance-attribute ¤

INTERFACE = '@interface'

The @interface comment tag.

INTERNAL class-attribute instance-attribute ¤

INTERNAL = '@internal'

The @internal comment tag.

LABEL class-attribute instance-attribute ¤

LABEL = '@label'

The @label comment tag.

LINK = '@link'

The @link comment tag.

MODULE class-attribute instance-attribute ¤

MODULE = '@module'

The @module comment tag.

NAMESPACE class-attribute instance-attribute ¤

NAMESPACE = '@namespace'

The @namespace comment tag.

OVERLOAD class-attribute instance-attribute ¤

OVERLOAD = '@overload'

The @overload comment tag.

OVERRIDE class-attribute instance-attribute ¤

OVERRIDE = '@override'

The @override comment tag.

PACKAGE_DOCUMENTATION class-attribute instance-attribute ¤

PACKAGE_DOCUMENTATION = '@packageDocumentation'

The @packageDocumentation comment tag.

PARAM class-attribute instance-attribute ¤

PARAM = '@param'

The @param comment tag.

PRIVATE class-attribute instance-attribute ¤

PRIVATE = '@private'

The @private comment tag.

PRIVATE_REMARKS class-attribute instance-attribute ¤

PRIVATE_REMARKS = '@privateRemarks'

The @privateRemarks comment tag.

PROPERTY class-attribute instance-attribute ¤

PROPERTY = '@property'

The @property comment tag.

PROTECTED class-attribute instance-attribute ¤

PROTECTED = '@protected'

The @protected comment tag.

PUBLIC class-attribute instance-attribute ¤

PUBLIC = '@public'

The @public comment tag.

READONLY class-attribute instance-attribute ¤

READONLY = '@readonly'

The @readonly comment tag.

REMARKS class-attribute instance-attribute ¤

REMARKS = '@remarks'

The @remarks comment tag.

RETURNS class-attribute instance-attribute ¤

RETURNS = '@returns'

The @returns comment tag.

SATISFIES class-attribute instance-attribute ¤

SATISFIES = '@satisfies'

The @satisfies comment tag.

SEALED class-attribute instance-attribute ¤

SEALED = '@sealed'

The @sealed comment tag.

SEE class-attribute instance-attribute ¤

SEE = '@see'

The @see comment tag.

TEMPLATE class-attribute instance-attribute ¤

TEMPLATE = '@template'

The @template comment tag.

THROWS class-attribute instance-attribute ¤

THROWS = '@throws'

The @throws comment tag.

TYPE_PARAM class-attribute instance-attribute ¤

TYPE_PARAM = '@typeParam'

The @typeParam comment tag.

VIRTUAL class-attribute instance-attribute ¤

VIRTUAL = '@virtual'

The @virtual comment tag.

CallSignature dataclass ¤

CallSignature(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type,
    parameters: list[Parameter] | None = None,
    type_parameters: list[TypeParameter] | None = None,
    overwrites: Type | None = None,
    implementation_of: Type | None = None,
    inherited_from: Type | None = None,
)

Bases: Reflection

A callable signature with its parameters and return type.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

implementation_of class-attribute instance-attribute ¤

implementation_of: Type | None = None

Reference to the declaration that this reflection implements.

inherited_from class-attribute instance-attribute ¤

inherited_from: Type | None = None

Reference to the declaration that this reflection inherits.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

overwrites class-attribute instance-attribute ¤

overwrites: Type | None = None

Reference to the declaration that this reflection overrides.

parameters class-attribute instance-attribute ¤

parameters: list[Parameter] | None = None

Parameters of the signature.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type instance-attribute ¤

type: Type

Return type of the signature.

type_parameters class-attribute instance-attribute ¤

type_parameters: list[TypeParameter] | None = None

Generic type parameters of the declaration.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

Class dataclass ¤

Class(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
    extended_types: list[Type] | None = None,
    extended_by: list[Type] | None = None,
    implemented_types: list[Type] | None = None,
    index_signatures: list[IndexSignature] | None = None,
    type_parameters: list[TypeParameter] | None = None,
)

Bases: Reflection

A TypeScript class reflection.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

extended_by class-attribute instance-attribute ¤

extended_by: list[Type] | None = None

Types that extend the declaration.

extended_types class-attribute instance-attribute ¤

extended_types: list[Type] | None = None

Types extended by the declaration.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

implemented_types class-attribute instance-attribute ¤

implemented_types: list[Type] | None = None

Interfaces implemented by the class.

index_signatures class-attribute instance-attribute ¤

index_signatures: list[IndexSignature] | None = None

Index signatures of the declaration.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

type_parameters class-attribute instance-attribute ¤

type_parameters: list[TypeParameter] | None = None

Generic type parameters of the declaration.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

Comment dataclass ¤

Comment(
    *,
    summary: list[BlockTagContent],
    tags: list[BlockTag] | None = None,
    block_tags: list[BlockTag] | None = None,
)

A TypeDoc comment with a summary and optional tags.

Methods:

  • markdown –

    Render the comment summary as Markdown.

Attributes:

block_tags class-attribute instance-attribute ¤

block_tags: list[BlockTag] | None = None

Block tags associated with the comment.

summary instance-attribute ¤

Content segments of the comment summary.

tags class-attribute instance-attribute ¤

tags: list[BlockTag] | None = None

Tags associated with the comment.

markdown ¤

markdown(**kwargs: Any) -> str

Render the comment summary as Markdown.

Parameters:

  • **kwargs ¤

    (Any, default: {} ) –

    Keyword arguments passed to each content segment's markdown method.

Returns:

  • str –

    The rendered summary segments joined together.

Source code in src/griffe_typedoc/_internal/models.py
362
363
364
365
366
367
368
369
370
371
def markdown(self, **kwargs: Any) -> str:
    """Render the comment summary as Markdown.

    Parameters:
        **kwargs: Keyword arguments passed to each content segment's `markdown` method.

    Returns:
        The rendered summary segments joined together.
    """
    return "".join(block.markdown(**kwargs) for block in self.summary)

Constructor dataclass ¤

Constructor(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
    signatures: list[ConstructorSignature] | None = None,
    overwrites: Type | None = None,
    inherited_from: Type | None = None,
)

Bases: Reflection

A constructor and its signatures.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

inherited_from class-attribute instance-attribute ¤

inherited_from: Type | None = None

Reference to the declaration that this reflection inherits.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

overwrites class-attribute instance-attribute ¤

overwrites: Type | None = None

Reference to the declaration that this reflection overrides.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

signatures class-attribute instance-attribute ¤

signatures: list[ConstructorSignature] | None = None

Callable signatures of the reflection.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

ConstructorSignature dataclass ¤

ConstructorSignature(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
    parameters: list[Parameter] | None = None,
    overwrites: Type | None = None,
    inherited_from: Type | None = None,
    type_parameters: list[TypeParameter] | None = None,
)

Bases: Reflection

A constructor signature with its parameters.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

inherited_from class-attribute instance-attribute ¤

inherited_from: Type | None = None

Reference to the declaration that this reflection inherits.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

overwrites class-attribute instance-attribute ¤

overwrites: Type | None = None

Reference to the declaration that this reflection overrides.

parameters class-attribute instance-attribute ¤

parameters: list[Parameter] | None = None

Parameters of the signature.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

type_parameters class-attribute instance-attribute ¤

type_parameters: list[TypeParameter] | None = None

Generic type parameters of the declaration.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

Enum dataclass ¤

Enum(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
)

Bases: Reflection

A TypeScript enum reflection.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

EnumMember dataclass ¤

EnumMember(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
)

Bases: Reflection

A member of a TypeScript enum.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

FileRegistry dataclass ¤

FileRegistry(
    *, entries: dict[int, str], reflections: dict[int, int]
)

Source files and their associated reflections.

Methods:

  • filepath –

    Return the file path associated with a reflection ID.

Attributes:

entries instance-attribute ¤

entries: dict[int, str]

File paths indexed by file ID.

reflections instance-attribute ¤

reflections: dict[int, int]

Reflection IDs indexed by file ID.

reverse_reflections cached property ¤

reverse_reflections: dict[int, int]

File IDs indexed by reflection ID.

filepath ¤

filepath(reflection_id: int) -> str

Return the file path associated with a reflection ID.

Parameters:

  • reflection_id ¤

    (int) –

    ID of the reflection whose file path is requested.

Returns:

  • str –

    The registered file path.

Raises:

  • KeyError –

    If the reflection or file ID is not registered.

Source code in src/griffe_typedoc/_internal/models.py
277
278
279
280
281
282
283
284
285
286
287
288
289
def filepath(self, reflection_id: int) -> str:
    """Return the file path associated with a reflection ID.

    Parameters:
        reflection_id: ID of the reflection whose file path is requested.

    Returns:
        The registered file path.

    Raises:
        KeyError: If the reflection or file ID is not registered.
    """
    return self.entries[self.reverse_reflections[reflection_id]]

Function dataclass ¤

Function(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
    signatures: list[CallSignature],
)

Bases: Reflection

A TypeScript function and its call signatures.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

exports property ¤

exports: list[Reflection]

References to properties of the first signature's return type declaration.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

signatures instance-attribute ¤

signatures: list[CallSignature]

Callable signatures of the reflection.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

GetSignature dataclass ¤

GetSignature(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
    overwrites: Type | None = None,
    implementation_of: Type | None = None,
    inherited_from: Type | None = None,
)

Bases: Reflection

A getter signature.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

implementation_of class-attribute instance-attribute ¤

implementation_of: Type | None = None

Reference to the declaration that this reflection implements.

inherited_from class-attribute instance-attribute ¤

inherited_from: Type | None = None

Reference to the declaration that this reflection inherits.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

overwrites class-attribute instance-attribute ¤

overwrites: Type | None = None

Reference to the declaration that this reflection overrides.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

Group dataclass ¤

Group(*, title: str, children: list[int | Reflection])

A named group of reflections.

Attributes:

children instance-attribute ¤

children: list[int | Reflection]

IDs or reflections belonging to the group.

title instance-attribute ¤

title: str

Title of the group.

IndexSignature dataclass ¤

IndexSignature(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type,
    parameters: list[Parameter] | None = None,
)

Bases: Reflection

An index signature with its parameters and value type.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

parameters class-attribute instance-attribute ¤

parameters: list[Parameter] | None = None

Parameters of the signature.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type instance-attribute ¤

type: Type

Value type of the index signature.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

Interface dataclass ¤

Interface(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
    extended_types: list[Type] | None = None,
    extended_by: list[Type] | None = None,
    type_parameters: list[TypeParameter] | None = None,
    index_signature: IndexSignature | None = None,
    implemented_by: list[Type] | None = None,
    index_signatures: list[IndexSignature] | None = None,
    signatures: list[CallSignature] | None = None,
)

Bases: Reflection

A TypeScript interface reflection.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

extended_by class-attribute instance-attribute ¤

extended_by: list[Type] | None = None

Types that extend the declaration.

extended_types class-attribute instance-attribute ¤

extended_types: list[Type] | None = None

Types extended by the declaration.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

implemented_by class-attribute instance-attribute ¤

implemented_by: list[Type] | None = None

Types that implement the declaration.

index_signature class-attribute instance-attribute ¤

index_signature: IndexSignature | None = None

Index signature of the interface.

index_signatures class-attribute instance-attribute ¤

index_signatures: list[IndexSignature] | None = None

Index signatures of the declaration.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

signatures class-attribute instance-attribute ¤

signatures: list[CallSignature] | None = None

Callable signatures of the reflection.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

type_parameters class-attribute instance-attribute ¤

type_parameters: list[TypeParameter] | None = None

Generic type parameters of the declaration.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

LogLevel ¤

Bases: Enum

Enumeration of available log levels.

Attributes:

  • critical –

    Critical error messages.

  • debug –

    Debugging messages.

  • error –

    Error messages.

  • info –

    Informational messages.

  • success –

    Messages reporting successful operations.

  • trace –

    Detailed tracing messages.

  • warning –

    Warning messages.

critical class-attribute instance-attribute ¤

critical = 'critical'

Critical error messages.

debug class-attribute instance-attribute ¤

debug = 'debug'

Debugging messages.

error class-attribute instance-attribute ¤

error = 'error'

Error messages.

info class-attribute instance-attribute ¤

info = 'info'

Informational messages.

success class-attribute instance-attribute ¤

success = 'success'

Messages reporting successful operations.

trace class-attribute instance-attribute ¤

trace = 'trace'

Detailed tracing messages.

warning class-attribute instance-attribute ¤

warning = 'warning'

Warning messages.

Method dataclass ¤

Method(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
    signatures: list[CallSignature],
    overwrites: Type | None = None,
    implementation_of: Type | None = None,
    inherited_from: Type | None = None,
)

Bases: Reflection

A TypeScript method and its call signatures.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

implementation_of class-attribute instance-attribute ¤

implementation_of: Type | None = None

Reference to the declaration that this reflection implements.

inherited_from class-attribute instance-attribute ¤

inherited_from: Type | None = None

Reference to the declaration that this reflection inherits.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

overwrites class-attribute instance-attribute ¤

overwrites: Type | None = None

Reference to the declaration that this reflection overrides.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

signatures instance-attribute ¤

signatures: list[CallSignature]

Callable signatures of the reflection.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

Module dataclass ¤

Module(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
    package_version: str | None = None,
    readme: str | None = None,
)

Bases: Reflection

A TypeScript module reflection.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

exports property ¤

exports: list[Reflection]

Reflections exported by the module through an export= function, or an empty list.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

package_version class-attribute instance-attribute ¤

package_version: str | None = None

Version of the documented package.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

readme class-attribute instance-attribute ¤

readme: str | None = None

README content associated with the reflection.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

Namespace dataclass ¤

Namespace(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
)

Bases: Reflection

A TypeScript namespace reflection.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

Parameter dataclass ¤

Parameter(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
    default_value: str | None = None,
)

Bases: Reflection

A parameter in a callable signature.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

default_value class-attribute instance-attribute ¤

default_value: str | None = None

Default value as TypeScript source text.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type of the parameter.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

Project dataclass ¤

Project(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
    package_name: str,
    readme: list[BlockTagContent] | None = None,
    symbol_id_map: dict[int, Reflection] = dict(),
    package_version: str | None = None,
    files: FileRegistry | None = None,
)

Bases: Reflection

The root reflection of a TypeDoc project.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

files class-attribute instance-attribute ¤

files: FileRegistry | None = None

Registry of source files in the project.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

package_name instance-attribute ¤

package_name: str

Name of the documented package.

package_version class-attribute instance-attribute ¤

package_version: str | None = None

Version of the documented package.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

readme class-attribute instance-attribute ¤

readme: list[BlockTagContent] | None = None

README content associated with the reflection.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_id_map class-attribute instance-attribute ¤

symbol_id_map: dict[int, Reflection] = field(
    default_factory=dict, repr=False
)

Reflections indexed by ID.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Project reflections indexed by ID.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

Property dataclass ¤

Property(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type,
    inherited_from: Type | None = None,
    overwrites: Type | None = None,
    default_value: str | None = None,
    implementation_of: Type | None = None,
)

Bases: Reflection

A TypeScript property reflection.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

default_value class-attribute instance-attribute ¤

default_value: str | None = None

Default value as TypeScript source text.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

implementation_of class-attribute instance-attribute ¤

implementation_of: Type | None = None

Reference to the declaration that this reflection implements.

inherited_from class-attribute instance-attribute ¤

inherited_from: Type | None = None

Reference to the declaration that this reflection inherits.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

overwrites class-attribute instance-attribute ¤

overwrites: Type | None = None

Reference to the declaration that this reflection overrides.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type instance-attribute ¤

type: Type

Type of the property.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

Reference dataclass ¤

Reference(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
    target: int,
)

Bases: Reflection

A reflection that refers to another reflection by ID.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

target instance-attribute ¤

target: int

ID of the referenced reflection.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

Reflection dataclass ¤

Reflection(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
)

Base model for a TypeDoc reflection.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

ReflectionKind ¤

Bases: Enum

Kinds of TypeDoc reflections.

Methods:

  • from_int –

    Convert a TypeDoc reflection kind integer to an enum member.

  • to_int –

    Return the TypeDoc integer identifying this reflection kind.

Attributes:

ACCESSOR class-attribute instance-attribute ¤

ACCESSOR = 'accessor'

The accessor reflection kind.

CALL_SIGNATURE class-attribute instance-attribute ¤

CALL_SIGNATURE = 'call_signature'

The call signature reflection kind.

CLASS class-attribute instance-attribute ¤

CLASS = 'class'

The class reflection kind.

CONSTRUCTOR class-attribute instance-attribute ¤

CONSTRUCTOR = 'constructor'

The constructor reflection kind.

CONSTRUCTOR_SIGNATURE class-attribute instance-attribute ¤

CONSTRUCTOR_SIGNATURE = 'constructor_signature'

The constructor signature reflection kind.

ENUM class-attribute instance-attribute ¤

ENUM = 'enum'

The enum reflection kind.

ENUM_MEMBER class-attribute instance-attribute ¤

ENUM_MEMBER = 'enum_member'

The enum member reflection kind.

FUNCTION class-attribute instance-attribute ¤

FUNCTION = 'function'

The function reflection kind.

GET_SIGNATURE class-attribute instance-attribute ¤

GET_SIGNATURE = 'get_signature'

The get signature reflection kind.

INDEX_SIGNATURE class-attribute instance-attribute ¤

INDEX_SIGNATURE = 'index_signature'

The index signature reflection kind.

INTERFACE class-attribute instance-attribute ¤

INTERFACE = 'interface'

The interface reflection kind.

METHOD class-attribute instance-attribute ¤

METHOD = 'method'

The method reflection kind.

MODULE class-attribute instance-attribute ¤

MODULE = 'module'

The module reflection kind.

NAMESPACE class-attribute instance-attribute ¤

NAMESPACE = 'namespace'

The namespace reflection kind.

PARAMETER class-attribute instance-attribute ¤

PARAMETER = 'parameter'

The parameter reflection kind.

PROJECT class-attribute instance-attribute ¤

PROJECT = 'project'

The project reflection kind.

PROPERTY class-attribute instance-attribute ¤

PROPERTY = 'property'

The property reflection kind.

REFERENCE class-attribute instance-attribute ¤

REFERENCE = 'reference'

The reference reflection kind.

SET_SIGNATURE class-attribute instance-attribute ¤

SET_SIGNATURE = 'set_signature'

The set signature reflection kind.

TYPE_ALIAS class-attribute instance-attribute ¤

TYPE_ALIAS = 'type_alias'

The type alias reflection kind.

TYPE_LITERAL class-attribute instance-attribute ¤

TYPE_LITERAL = 'type_literal'

The type literal reflection kind.

TYPE_PARAMETER class-attribute instance-attribute ¤

TYPE_PARAMETER = 'type_parameter'

The type parameter reflection kind.

VARIABLE class-attribute instance-attribute ¤

VARIABLE = 'variable'

The variable reflection kind.

from_int classmethod ¤

from_int(value: int) -> ReflectionKind

Convert a TypeDoc reflection kind integer to an enum member.

Parameters:

  • value ¤

    (int) –

    Integer identifying one reflection kind.

Returns:

Raises:

  • KeyError –

    If the integer does not identify a supported kind.

Source code in src/griffe_typedoc/_internal/models.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
@classmethod
def from_int(cls, value: int) -> ReflectionKind:
    """Convert a TypeDoc reflection kind integer to an enum member.

    Parameters:
        value: Integer identifying one reflection kind.

    Returns:
        The matching reflection kind.

    Raises:
        KeyError: If the integer does not identify a supported kind.
    """
    return {
        0x1: cls.PROJECT,
        0x2: cls.MODULE,
        0x4: cls.NAMESPACE,
        0x8: cls.ENUM,
        0x10: cls.ENUM_MEMBER,
        0x20: cls.VARIABLE,
        0x40: cls.FUNCTION,
        0x80: cls.CLASS,
        0x100: cls.INTERFACE,
        0x200: cls.CONSTRUCTOR,
        0x400: cls.PROPERTY,
        0x800: cls.METHOD,
        0x1000: cls.CALL_SIGNATURE,
        0x2000: cls.INDEX_SIGNATURE,
        0x4000: cls.CONSTRUCTOR_SIGNATURE,
        0x8000: cls.PARAMETER,
        0x10000: cls.TYPE_LITERAL,
        0x20000: cls.TYPE_PARAMETER,
        0x40000: cls.ACCESSOR,
        0x80000: cls.GET_SIGNATURE,
        0x100000: cls.SET_SIGNATURE,
        0x200000: cls.TYPE_ALIAS,
        0x400000: cls.REFERENCE,
    }[value]

to_int ¤

to_int() -> int

Return the TypeDoc integer identifying this reflection kind.

Source code in src/griffe_typedoc/_internal/models.py
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
def to_int(self) -> int:
    """Return the TypeDoc integer identifying this reflection kind."""
    return {
        self.PROJECT: 0x1,
        self.MODULE: 0x2,
        self.NAMESPACE: 0x4,
        self.ENUM: 0x8,
        self.ENUM_MEMBER: 0x10,
        self.VARIABLE: 0x20,
        self.FUNCTION: 0x40,
        self.CLASS: 0x80,
        self.INTERFACE: 0x100,
        self.CONSTRUCTOR: 0x200,
        self.PROPERTY: 0x400,
        self.METHOD: 0x800,
        self.CALL_SIGNATURE: 0x1000,
        self.INDEX_SIGNATURE: 0x2000,
        self.CONSTRUCTOR_SIGNATURE: 0x4000,
        self.PARAMETER: 0x8000,
        self.TYPE_LITERAL: 0x10000,
        self.TYPE_PARAMETER: 0x20000,
        self.ACCESSOR: 0x40000,
        self.GET_SIGNATURE: 0x80000,
        self.SET_SIGNATURE: 0x100000,
        self.TYPE_ALIAS: 0x200000,
        self.REFERENCE: 0x400000,
    }[self]  # type: ignore[index]

SetSignature dataclass ¤

SetSignature(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
    parameters: list[Parameter] | None = None,
    overwrites: Type | None = None,
    implementation_of: Type | None = None,
    inherited_from: Type | None = None,
)

Bases: Reflection

A setter signature with its parameters.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

implementation_of class-attribute instance-attribute ¤

implementation_of: Type | None = None

Reference to the declaration that this reflection implements.

inherited_from class-attribute instance-attribute ¤

inherited_from: Type | None = None

Reference to the declaration that this reflection inherits.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

overwrites class-attribute instance-attribute ¤

overwrites: Type | None = None

Reference to the declaration that this reflection overrides.

parameters class-attribute instance-attribute ¤

parameters: list[Parameter] | None = None

Parameters of the signature.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

Source dataclass ¤

Source(
    *,
    file_name: str,
    line: int,
    character: int,
    url: str | None = None,
)

The source location of a reflection.

Attributes:

  • character (int) –

    Character offset within the source line.

  • contents (str) –

    Source text at the recorded line number, including its line ending.

  • file_name (str) –

    Name of the source file.

  • filepath (str) –

    Path of the source file resolved through the project file registry.

  • line (int) –

    Source line number, starting at one.

  • url (str | None) –

    URL of the source location.

character instance-attribute ¤

character: int

Character offset within the source line.

contents property ¤

contents: str

Source text at the recorded line number, including its line ending.

file_name instance-attribute ¤

file_name: str

Name of the source file.

filepath property ¤

filepath: str

Path of the source file resolved through the project file registry.

line instance-attribute ¤

line: int

Source line number, starting at one.

url class-attribute instance-attribute ¤

url: str | None = None

URL of the source location.

Target dataclass ¤

Target(*, source_file_name: str, qualified_name: str)

A reference target identified by its source file and qualified name.

Attributes:

qualified_name instance-attribute ¤

qualified_name: str

Qualified name of the referenced symbol.

source_file_name instance-attribute ¤

source_file_name: str

Source file containing the target.

Type dataclass ¤

Type(
    *,
    type: TypeKind,
    name: str | None = None,
    target: int | Target | None = None,
    package: str | None = None,
    type_arguments: list[Type] | None = None,
    qualified_name: str | None = None,
    element_type: Type | None = None,
    refers_to_type_parameter: bool | None = None,
    value: str | None = None,
    types: list[Type] | None = None,
    declaration: TypeLiteral | None = None,
    elements: list[Type] | None = None,
    prefer_values: bool | None = None,
    query_type: Type | None = None,
    operator: str | None = None,
    parameter: str | None = None,
    parameter_type: Type | None = None,
    template_type: Type | None = None,
)

A TypeScript type and the details associated with its kind.

Attributes:

declaration class-attribute instance-attribute ¤

declaration: TypeLiteral | None = None

Declaration of a reflection type.

element_type class-attribute instance-attribute ¤

element_type: Type | None = None

Element type of an array.

elements class-attribute instance-attribute ¤

elements: list[Type] | None = None

Element types of a tuple.

name class-attribute instance-attribute ¤

name: str | None = None

Name of the type, when applicable.

operator class-attribute instance-attribute ¤

operator: str | None = None

Operator applied to a type.

package class-attribute instance-attribute ¤

package: str | None = None

Package containing the referenced type.

parameter class-attribute instance-attribute ¤

parameter: str | None = None

Parameter name in a mapped type.

parameter_type class-attribute instance-attribute ¤

parameter_type: Type | None = None

Type of the parameter in a mapped type.

prefer_values class-attribute instance-attribute ¤

prefer_values: bool | None = None

Whether the type reference prefers a value target.

qualified_name class-attribute instance-attribute ¤

qualified_name: str | None = None

Qualified name of the referenced symbol.

query_type class-attribute instance-attribute ¤

query_type: Type | None = None

Type referenced by a type query.

refers_to_type_parameter class-attribute instance-attribute ¤

refers_to_type_parameter: bool | None = None

Whether the reference points to a type parameter.

target class-attribute instance-attribute ¤

target: int | Target | None = None

Reflection ID or external symbol targeted by a reference type.

template_type class-attribute instance-attribute ¤

template_type: Type | None = None

Template type used by a mapped type.

type instance-attribute ¤

type: TypeKind

Kind of the TypeScript type.

type_arguments class-attribute instance-attribute ¤

type_arguments: list[Type] | None = None

Type arguments supplied to a generic type.

types class-attribute instance-attribute ¤

types: list[Type] | None = None

Types in a union or intersection.

value class-attribute instance-attribute ¤

value: str | None = None

Value of a literal type.

TypeAlias dataclass ¤

TypeAlias(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type,
    type_parameters: list[TypeParameter] | None = None,
    implemented_by: list[Type] | None = None,
)

Bases: Reflection

A TypeScript type alias reflection.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

implemented_by class-attribute instance-attribute ¤

implemented_by: list[Type] | None = None

Types that implement the declaration.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type instance-attribute ¤

type: Type

Type represented by the alias.

type_parameters class-attribute instance-attribute ¤

type_parameters: list[TypeParameter] | None = None

Generic type parameters of the declaration.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

TypeKind ¤

Bases: Enum

Kinds of TypeScript types represented by TypeDoc.

Attributes:

ARRAY class-attribute instance-attribute ¤

ARRAY = 'array'

An array type.

INTERSECTION class-attribute instance-attribute ¤

INTERSECTION = 'intersection'

An intersection of types.

INTRINSIC class-attribute instance-attribute ¤

INTRINSIC = 'intrinsic'

A built-in TypeScript type.

LITERAL class-attribute instance-attribute ¤

LITERAL = 'literal'

A literal value type.

MAPPED class-attribute instance-attribute ¤

MAPPED = 'mapped'

A mapped type.

OPERATOR class-attribute instance-attribute ¤

OPERATOR = 'typeOperator'

A type operator expression.

QUERY class-attribute instance-attribute ¤

QUERY = 'query'

A type query.

REFERENCE class-attribute instance-attribute ¤

REFERENCE = 'reference'

A reference to a named type.

REFLECTION class-attribute instance-attribute ¤

REFLECTION = 'reflection'

A type described by a reflection declaration.

TUPLE class-attribute instance-attribute ¤

TUPLE = 'tuple'

A tuple type.

UNION class-attribute instance-attribute ¤

UNION = 'union'

A union of types.

TypeLiteral dataclass ¤

TypeLiteral(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
    signatures: list[CallSignature] | None = None,
    index_signatures: list[IndexSignature] | None = None,
)

Bases: Reflection

A type literal with its members and signatures.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

index_signatures class-attribute instance-attribute ¤

index_signatures: list[IndexSignature] | None = None

Index signatures of the declaration.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

signatures class-attribute instance-attribute ¤

signatures: list[CallSignature] | None = None

Callable signatures of the reflection.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type associated with the reflection.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

TypeParameter dataclass ¤

TypeParameter(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type | None = None,
    default: Type | None = None,
)

Bases: Reflection

A generic type parameter with an optional constraint and default.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

default class-attribute instance-attribute ¤

default: Type | None = None

Default type used when no type argument is supplied.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type class-attribute instance-attribute ¤

type: Type | None = None

Type constraint of the generic parameter.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

TypedocDecoder ¤

TypedocDecoder(*args: Any, **kwargs: Any)

Bases: JSONDecoder

JSON decoder.

Parameters:

  • *args ¤

    (Any, default: () ) –

    Arguments passed to parent init method.

  • *kwargs ¤

    (Any, default: {} ) –

    Keyword arguments passed to parent init method.

Source code in src/griffe_typedoc/_internal/decoder.py
556
557
558
559
560
561
562
563
564
565
def __init__(self, *args: Any, **kwargs: Any) -> None:
    """Initialize the decoder.

    Parameters:
        *args: Arguments passed to parent init method.
        *kwargs: Keyword arguments passed to parent init method.
    """
    kwargs["object_hook"] = self._object_hook
    super().__init__(*args, **kwargs)
    self._symbol_map: dict[int, Any] = {}

Variable dataclass ¤

Variable(
    *,
    id: int,
    name: str,
    variant: str,
    comment: Comment | None = None,
    children: list[Reflection] = list(),
    flags: dict = dict(),
    groups: list[Group] = list(),
    sources: list[Source] = list(),
    parent: Reflection | None = None,
    type: Type,
    default_value: str | None = None,
)

Bases: Reflection

A TypeScript variable reflection.

Attributes:

children class-attribute instance-attribute ¤

children: list[Reflection] = field(default_factory=list)

Child reflections.

comment class-attribute instance-attribute ¤

comment: Comment | None = None

Documentation comment associated with the reflection.

default_value class-attribute instance-attribute ¤

default_value: str | None = None

Default value as TypeScript source text.

final_target property ¤

final_target: Reflection

Final reflection reached by following reference targets.

flags class-attribute instance-attribute ¤

flags: dict = field(default_factory=dict)

Reflection flags recorded by TypeDoc.

groups class-attribute instance-attribute ¤

groups: list[Group] = field(default_factory=list)

Named groups of child reflections.

id instance-attribute ¤

id: int

Unique reflection ID within the project.

kind property ¤

Kind of the reflection.

name instance-attribute ¤

name: str

Name of the reflection.

parent class-attribute instance-attribute ¤

parent: Reflection | None = None

Parent reflection, or None for a root reflection.

path property ¤

path: str

Slash-separated symbol path, with index modules omitted.

resolved_groups property ¤

resolved_groups: list[Group]

Groups with child IDs replaced by their reflections.

resolved_target property ¤

resolved_target: Reflection

Referenced reflection resolved through the symbol map.

root property ¤

root: Reflection

The root ancestor of the reflection tree.

root_module property ¤

root_module: Reflection

The highest ancestor below the project, or this reflection if it has no parent.

source_contents property ¤

source_contents: str

Source lines joined together, with trailing whitespace and an opening brace removed.

sources class-attribute instance-attribute ¤

sources: list[Source] = field(default_factory=list)

Source locations of the reflection.

symbol_map property ¤

symbol_map: dict[int, Reflection]

Reflections indexed by ID, inherited from the parent when available.

type instance-attribute ¤

type: Type

Type of the variable.

variant instance-attribute ¤

variant: str

Reflection variant recorded by TypeDoc.

get_logger ¤

get_logger(name: str) -> _Logger

Create and return a new logger instance.

Parameters:

  • name ¤

    (str) –

    The logger name.

Returns:

  • _Logger –

    The logger.

Source code in src/griffe_typedoc/_internal/logger.py
73
74
75
76
77
78
79
80
81
82
def get_logger(name: str) -> _Logger:
    """Create and return a new logger instance.

    Parameters:
        name: The logger name.

    Returns:
        The logger.
    """
    return _Logger(name)

get_parser ¤

get_parser() -> ArgumentParser

Return the CLI argument parser.

Returns:

Source code in src/griffe_typedoc/_internal/cli.py
48
49
50
51
52
53
54
55
56
57
def get_parser() -> argparse.ArgumentParser:
    """Return the CLI argument parser.

    Returns:
        An argparse parser.
    """
    parser = argparse.ArgumentParser(prog="griffe-typedoc")
    parser.add_argument("-V", "--version", action="version", version=f"%(prog)s {debug._get_version()}")
    parser.add_argument("--debug-info", action=_DebugInfo, help="Print debug information.")
    return parser

load ¤

Load TypeScript API data using TypeDoc.

Parameters:

  • typedoc_command ¤

    (str | list[str]) –

    Name/path of the 1typedoc executable, or a command as list.

  • working_directory ¤

    (str, default: '.' ) –

    Where to execute the command.

Returns:

  • Project –

    Top-level project object containing API data.

Source code in src/griffe_typedoc/_internal/loader.py
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
def load(typedoc_command: str | list[str], working_directory: str = ".") -> Project:
    """Load TypeScript API data using TypeDoc.

    Parameters:
        typedoc_command: Name/path of the 1`typedoc` executable, or a command as list.
        working_directory: Where to execute the command.

    Returns:
        Top-level project object containing API data.
    """
    with NamedTemporaryFile("r+") as tmpfile:
        if isinstance(typedoc_command, str):
            typedoc_command += f" --json {tmpfile.name}"
            shell = True
        else:
            typedoc_command += ["--json", tmpfile.name]
            shell = False
        env = os.environ.copy()
        env["NO_COLOR"] = "1"
        process = subprocess.Popen(  # noqa: S603
            typedoc_command,
            shell=shell,
            text=True,
            stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT,
            cwd=working_directory,
            env=env,
        )
        while True:
            if line := process.stdout.readline().strip():  # ty:ignore[unresolved-attribute]
                level, line = line.split(" ", 1)
                level = match.group(1) if (match := re.search(r"\[(\w+)\]", level)) else "info"
                getattr(_logger, level.lower())(_double_brackets(line))
            else:
                break
        process.wait()
        return json.load(tmpfile, cls=TypedocDecoder)

main ¤

main(args: list[str] | None = None) -> int

Run the main program.

This function is executed when you type griffe-typedoc or python -m griffe_typedoc.

Parameters:

  • args ¤

    (list[str] | None, default: None ) –

    Arguments passed from the command line.

Returns:

  • int –

    An exit code.

Source code in src/griffe_typedoc/_internal/cli.py
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
def main(args: list[str] | None = None) -> int:
    """Run the main program.

    This function is executed when you type `griffe-typedoc` or `python -m griffe_typedoc`.

    Parameters:
        args: Arguments passed from the command line.

    Returns:
        An exit code.
    """
    parser = get_parser()
    opts = parser.parse_args(args=args)
    print(opts)
    return 0

patch_loggers ¤

patch_loggers(
    get_logger_func: Callable[[str], Any],
) -> None

Patch loggers.

Parameters:

  • get_logger_func ¤

    (Callable[[str], Any]) –

    A function accepting a name as parameter and returning a logger.

Source code in src/griffe_typedoc/_internal/logger.py
85
86
87
88
89
90
91
def patch_loggers(get_logger_func: Callable[[str], Any]) -> None:
    """Patch loggers.

    Parameters:
        get_logger_func: A function accepting a name as parameter and returning a logger.
    """
    _Logger._patch_loggers(get_logger_func)