Skip to content

Commit 89d46be

Browse files
committed
fix: Support files attribute on projects
Issue-2: mkdocstrings/typescript#2
1 parent 2b28c68 commit 89d46be

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/griffe_typedoc/dataclasses.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
# from pydantic.dataclasses import dataclass, Field as field
88

9+
# TODO: Use info from https://typedoc.org/api/modules/JSONOutput.html to rebuild models!
10+
911

1012
# https://github.com/TypeStrong/typedoc/blob/master/src/lib/models/reflections/kind.ts
1113
class ReflectionKind(Enum):
@@ -138,6 +140,12 @@ class BlockTagContentKind(Enum):
138140
CODE: str = "code"
139141

140142

143+
@dataclass(kw_only=True)
144+
class FileRegistry:
145+
entries: dict[int, str]
146+
reflections: dict[int, int]
147+
148+
141149
@dataclass(kw_only=True)
142150
class BlockTagContent:
143151
kind: BlockTagContentKind
@@ -310,9 +318,10 @@ def source_contents(self, base_file_path: str = ".") -> str:
310318
@dataclass(kw_only=True)
311319
class Project(Reflection):
312320
package_name: str
313-
readme: list[BlockTagContent]
321+
readme: list[BlockTagContent] | None = None
314322
symbol_id_map: dict[int, Reflection] = field(default_factory=dict, repr=False)
315323
package_version: str | None = None
324+
files: FileRegistry | None = None
316325

317326
@property
318327
def kind(self) -> ReflectionKind:

0 commit comments

Comments
 (0)