Skip to content

Commit ac49ad0

Browse files
committed
fix(core): mark option object properties optional
1 parent 5a05be1 commit ac49ad0

File tree

7 files changed

+35
-26
lines changed

7 files changed

+35
-26
lines changed

.changeset/fresh-cows-check.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'typedoc-plugin-markdown': patch
3+
---
4+
5+
- Mark object properties as optional in PluginOptions interface (#777).

devtools/packages/prebuild-options/tasks/generate-models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function getType(
214214
}
215215
if (option.type === ParameterType.Flags && option.defaults) {
216216
return `{${Object.keys(option.defaults)
217-
.map((key) => `'${key}': boolean`)
217+
.map((key) => `'${key}'?: boolean`)
218218
.join(';')}}`;
219219
}
220220
if (option.type === ParameterType.Mixed && option.defaultValue) {

packages/typedoc-plugin-markdown/src/_typedoc.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ declare module 'typedoc' {
3232
mergeReadme: boolean;
3333
modulesFileName: string;
3434
navigationModel: {
35-
excludeGroups: boolean;
36-
excludeCategories: boolean;
37-
excludeFolders: boolean;
35+
excludeGroups?: boolean;
36+
excludeCategories?: boolean;
37+
excludeFolders?: boolean;
3838
};
3939
outputFileStrategy: 'members' | 'modules';
4040
pageTitleTemplates: {
@@ -54,13 +54,13 @@ declare module 'typedoc' {
5454
publicPath: string;
5555
sanitizeComments: boolean;
5656
tableColumnSettings: {
57-
hideDefaults: boolean;
58-
hideInherited: boolean;
59-
hideModifiers: boolean;
60-
hideOverrides: boolean;
61-
hideSources: boolean;
62-
hideValues: boolean;
63-
leftAlignHeaders: boolean;
57+
hideDefaults?: boolean;
58+
hideInherited?: boolean;
59+
hideModifiers?: boolean;
60+
hideOverrides?: boolean;
61+
hideSources?: boolean;
62+
hideValues?: boolean;
63+
leftAlignHeaders?: boolean;
6464
};
6565
textContentMappings: ManuallyValidatedOption<{
6666
'header.title': string;

packages/typedoc-plugin-markdown/src/theme/navigation/navigation-builder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ export class NavigationBuilder {
2020
private options: Options;
2121
private packagesMeta: any;
2222
private navigationOptions: {
23-
excludeCategories: boolean;
24-
excludeGroups: boolean;
25-
excludeFolders: boolean;
23+
excludeCategories?: boolean;
24+
excludeGroups?: boolean;
25+
excludeFolders?: boolean;
2626
};
2727
private navigation: NavigationItem[] = [];
2828
private isPackages: boolean;

packages/typedoc-plugin-markdown/src/types/options.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ export interface PluginOptions {
127127
* @deprecated This option has been deprecated in favour of TypeDoc `navigation` option.
128128
*/
129129
navigationModel: {
130-
excludeGroups: boolean;
131-
excludeCategories: boolean;
132-
excludeFolders: boolean;
130+
excludeGroups?: boolean;
131+
excludeCategories?: boolean;
132+
excludeFolders?: boolean;
133133
};
134134

135135
/**
@@ -189,13 +189,13 @@ export interface PluginOptions {
189189
* Control how table columns are configured and displayed.
190190
*/
191191
tableColumnSettings: {
192-
hideDefaults: boolean;
193-
hideInherited: boolean;
194-
hideModifiers: boolean;
195-
hideOverrides: boolean;
196-
hideSources: boolean;
197-
hideValues: boolean;
198-
leftAlignHeaders: boolean;
192+
hideDefaults?: boolean;
193+
hideInherited?: boolean;
194+
hideModifiers?: boolean;
195+
hideOverrides?: boolean;
196+
hideSources?: boolean;
197+
hideValues?: boolean;
198+
leftAlignHeaders?: boolean;
199199
};
200200

201201
/**

packages/typedoc-plugin-remark/src/_typedoc.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import { ManuallyValidatedOption } from 'typedoc';
33
import { RemarkPlugin } from './types/options.js';
44
declare module 'typedoc' {
55
export interface TypeDocOptionMap {
6-
defaultRemarkPlugins: { gfm: boolean; frontmatter: boolean; mdx: boolean };
6+
defaultRemarkPlugins: {
7+
gfm?: boolean;
8+
frontmatter?: boolean;
9+
mdx?: boolean;
10+
};
711
remarkPlugins: ManuallyValidatedOption<RemarkPlugin[]>;
812
remarkStringifyOptions: ManuallyValidatedOption<Record<string, any>>;
913
}

packages/typedoc-plugin-remark/src/types/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface PluginOptions {
99
/**
1010
* A set of flags that control the enabling or disabling of remark plugins that are loaded by default.
1111
*/
12-
defaultRemarkPlugins: { gfm: boolean; frontmatter: boolean; mdx: boolean };
12+
defaultRemarkPlugins: { gfm?: boolean; frontmatter?: boolean; mdx?: boolean };
1313

1414
/**
1515
* An array of remark plugin names to be executed.

0 commit comments

Comments
 (0)