| 45 | * @since 0.6.0 |
| 46 | */ |
| 47 | export class Doc { |
| 48 | readonly description: string | undefined |
| 49 | readonly since: ReadonlyArray<string> |
| 50 | readonly deprecated: ReadonlyArray<string> |
| 51 | readonly examples: ReadonlyArray<string> |
| 52 | readonly category: ReadonlyArray<string> |
| 53 | readonly throws: ReadonlyArray<string> |
| 54 | readonly sees: ReadonlyArray<string> |
| 55 | readonly tags: Record<string, ReadonlyArray<string> | undefined> |
| 56 | constructor( |
| 57 | description: string | undefined, |
| 58 | since: ReadonlyArray<string>, |
| 59 | deprecated: ReadonlyArray<string>, |
| 60 | examples: ReadonlyArray<string>, |
| 61 | category: ReadonlyArray<string>, |
| 62 | throws: ReadonlyArray<string>, |
| 63 | sees: ReadonlyArray<string>, |
| 64 | tags: Record<string, ReadonlyArray<string> | undefined> |
| 65 | ) { |
| 66 | this.description = description |
| 67 | this.since = since |
| 68 | this.deprecated = deprecated |
| 69 | this.examples = examples |
| 70 | this.category = category |
| 71 | this.throws = throws |
| 72 | this.sees = sees |
| 73 | this.tags = tags |
| 74 | } |
| 75 | |
| 76 | modifyDescription(description: string | undefined): Doc { |
| 77 | return new Doc( |
| 78 | description, |
| 79 | this.since, |
| 80 | this.deprecated, |
| 81 | this.examples, |
| 82 | this.category, |
| 83 | this.throws, |
| 84 | this.sees, |
| 85 | this.tags |
| 86 | ) |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * Parsed documentation model for one source module. |