{}
*/
export class ClassWithFlags {
/** @experimental */
- expermintalProp: string;
+ expermintalProp!: string;
/** @internal */
- private internalProp: string;
+ private internalProp!: string;
/** @experimental */
expermintalMethod() {}
/**
@@ -241,7 +241,7 @@ export class ClassWithPropCategories {
/**@category CatB */
prop2: string;
- constructor(opts) {
+ constructor(opts: { a: string; b: string }) {
this.prop1 = opts.a;
this.prop2 = opts.b;
}
@@ -254,7 +254,7 @@ export class ClassWithoutPropCategories {
prop1: string;
prop2: string;
- constructor(opts) {
+ constructor(opts: { a: string; b: string }) {
this.prop1 = opts.a;
this.prop2 = opts.b;
}
@@ -272,17 +272,17 @@ export class ClassWithAccessorKeywords {
* const x = 1;
* ```
*/
- public accessor accessor1: string;
+ public accessor accessor1!: string;
/**
* Accessor comments
*
* @remarks Remark comments
*/
- public accessor accessor2: string;
+ public accessor accessor2!: string;
/**
* Accessor comments
*/
- public accessor accessor3: string;
+ public accessor accessor3!: string;
}
diff --git a/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/functions.ts b/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/functions.ts
index 52a1e7a0d..c6460fa10 100644
--- a/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/functions.ts
+++ b/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/functions.ts
@@ -191,6 +191,43 @@ export function functionReturningAPromise(): Promise<{
});
}
+const foo = {
+ /**
+ * a comments
+ */
+ a: '',
+ /**
+ * b comments
+ */
+ b: '',
+};
+
+type Foo = typeof foo;
+
+export function functionWithUnionParams(
+ /**
+ * Comments for primitiveUnions
+ */
+ primitiveUnions: string | number,
+ /**
+ * Comments for objectUnions
+ */
+ objectUnions: {
+ /**
+ * Comments for a
+ */
+ a: string;
+ b: 1;
+ },
+ mixedUnions: string | Foo,
+ /**
+ * Comments for noUnions
+ */
+ noUnions: string,
+) {
+ return void 0;
+}
+
/**
* Comments for main curriedFunction
*/
diff --git a/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/index.ts b/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/index.ts
index dc3226435..4ca6f3217 100644
--- a/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/index.ts
+++ b/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/index.ts
@@ -1,12 +1,12 @@
/**
- * Module commments
+ * Module comments
*
* @module
*/
-export * from './classes';
-export * from './enums';
-export * from './functions';
-export * from './interfaces';
-export * from './types';
-export * from './variables';
+export * from './classes.js';
+export * from './enums.js';
+export * from './functions.js';
+export * from './interfaces.js';
+export * from './types.js';
+export * from './variables.js';
diff --git a/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/interfaces.ts b/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/interfaces.ts
index 9e9ecbc69..79604ba8d 100644
--- a/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/interfaces.ts
+++ b/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/interfaces.ts
@@ -2,7 +2,7 @@
* @module
*/
-import { CallbacksOptions } from './classes';
+import { CallbacksOptions } from './classes.js';
/**
* Comments for BasicInterface
diff --git a/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/types.ts b/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/types.ts
index 8e3b004f6..009a2bf6e 100644
--- a/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/types.ts
+++ b/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/types.ts
@@ -1,5 +1,5 @@
import { Application } from 'typedoc';
-import { ClassWithTypeParameters } from './classes';
+import { ClassWithTypeParameters } from './classes.js';
/**
* Comments for PrimitiveType
@@ -16,6 +16,19 @@ export type ArrayType = string[];
*/
export type UnionType = string | boolean | { z: string };
+/**
+ * Comments for useful UnionType
+ */
+export type UsefulUnionType =
+ | string
+ | boolean
+ | {
+ /**
+ * Comments for z
+ */
+ z: string;
+ };
+
/**
* Comments for StringLiteralType
*/
diff --git a/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/variables.ts b/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/variables.ts
index c7b29aba5..469a338b2 100644
--- a/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/variables.ts
+++ b/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/variables.ts
@@ -31,13 +31,22 @@ export const objectLiteralVariable = {
valueY: function (unionParam: 'a' | 'b', _undercoreParam_: string) {
return 'foo';
},
+ /**
+ * Comments for valueX
+ */
valueX: {
valueZ: 'foo',
valueY: (z: string) => {
return { a: 'test', b: z, c: { a: 1, b: 2 } };
},
+ /**
+ * Comment for valueX.valueA
+ */
valueA: [100, 200, 300],
},
+ /**
+ * Comments for valueA
+ */
valueA: 100,
valueB: true,
};
diff --git a/packages/typedoc-plugin-markdown/test/fixtures/src/utils/index.ts b/packages/typedoc-plugin-markdown/test/fixtures/src/utils/index.ts
index fef5fd7ec..29bd9f530 100644
--- a/packages/typedoc-plugin-markdown/test/fixtures/src/utils/index.ts
+++ b/packages/typedoc-plugin-markdown/test/fixtures/src/utils/index.ts
@@ -6,7 +6,7 @@ export interface InterfaceWithChars