Skip to content

Commit 98a1138

Browse files
committed
Fix Documentation type
1 parent cc94da2 commit 98a1138

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Diff for: .changeset/polite-pandas-push.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-docgen': patch
3+
---
4+
5+
Add `displayName` and `description` to Doccumentation type

Diff for: packages/react-docgen/src/Documentation.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
export interface DocumentationObject {
2-
props?: Record<string, PropDescriptor>;
3-
context?: Record<string, PropDescriptor>;
42
childContext?: Record<string, PropDescriptor>;
53
composes?: string[];
4+
context?: Record<string, PropDescriptor>;
5+
description?: string;
6+
displayName?: string;
67
methods?: MethodDescriptor[];
8+
props?: Record<string, PropDescriptor>;
79
}
810

911
export interface MethodParameter {
1012
name: string;
11-
type?: TypeDescriptor<FunctionSignatureType> | null;
1213
optional: boolean;
14+
type?: TypeDescriptor<FunctionSignatureType> | null;
1315
}
1416

1517
export interface MethodReturn {
@@ -162,6 +164,7 @@ export default class Documentation {
162164
this.#data.set(key, value);
163165
}
164166

167+
get<T>(key: string): T | null;
165168
get(key: string): unknown {
166169
return this.#data.get(key);
167170
}

0 commit comments

Comments
 (0)