Skip to content

Commit

Permalink
Fix Documentation type
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Mar 4, 2023
1 parent cc94da2 commit 98a1138
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/polite-pandas-push.md
@@ -0,0 +1,5 @@
---
'react-docgen': patch
---

Add `displayName` and `description` to Doccumentation type
9 changes: 6 additions & 3 deletions packages/react-docgen/src/Documentation.ts
@@ -1,15 +1,17 @@
export interface DocumentationObject {
props?: Record<string, PropDescriptor>;
context?: Record<string, PropDescriptor>;
childContext?: Record<string, PropDescriptor>;
composes?: string[];
context?: Record<string, PropDescriptor>;
description?: string;
displayName?: string;
methods?: MethodDescriptor[];
props?: Record<string, PropDescriptor>;
}

export interface MethodParameter {
name: string;
type?: TypeDescriptor<FunctionSignatureType> | null;
optional: boolean;
type?: TypeDescriptor<FunctionSignatureType> | null;
}

export interface MethodReturn {
Expand Down Expand Up @@ -162,6 +164,7 @@ export default class Documentation {
this.#data.set(key, value);
}

get<T>(key: string): T | null;
get(key: string): unknown {
return this.#data.get(key);
}
Expand Down

0 comments on commit 98a1138

Please sign in to comment.