diff --git a/example/package-lock.json b/example/package-lock.json index bda39155d..05e9e60d0 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -8,10 +8,25 @@ "name": "typedoc-example", "version": "0.0.0", "license": "Apache-2.0", + "dependencies": { + "lodash": "^4.17.21" + }, "devDependencies": { + "@types/lodash": "^4.14.175", "typescript": "^4.4.3" } }, + "node_modules/@types/lodash": { + "version": "4.14.175", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.175.tgz", + "integrity": "sha512-XmdEOrKQ8a1Y/yxQFOMbC47G/V2VDO1GvMRnl4O75M4GW/abC5tnfzadQYkqEveqRM1dEJGFFegfPNA2vvx2iw==", + "dev": true + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "node_modules/typescript": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", @@ -27,6 +42,17 @@ } }, "dependencies": { + "@types/lodash": { + "version": "4.14.175", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.175.tgz", + "integrity": "sha512-XmdEOrKQ8a1Y/yxQFOMbC47G/V2VDO1GvMRnl4O75M4GW/abC5tnfzadQYkqEveqRM1dEJGFFegfPNA2vvx2iw==", + "dev": true + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "typescript": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", diff --git a/example/package.json b/example/package.json index f3b9ed79a..1729cead5 100644 --- a/example/package.json +++ b/example/package.json @@ -11,6 +11,10 @@ "typedoc": "node ../bin/typedoc ./src" }, "devDependencies": { + "@types/lodash": "^4.14.175", "typescript": "^4.4.3" + }, + "dependencies": { + "lodash": "^4.17.21" } } diff --git a/example/src/functions.ts b/example/src/functions.ts index 4697ac58c..aeb2e99d1 100644 --- a/example/src/functions.ts +++ b/example/src/functions.ts @@ -97,3 +97,28 @@ export function makeHttpCall2( return fetch(url, { method, headers, body, mode }); } + +/** + * Stringifies and concatenates two numbers into a single string. + * + * The documentation site allows you to toggle between the different overloads + * of a function. The implementation signature of the overloaded function is not + * included in the documentation. + */ +export function overloadedFunction(a: number, b: number): string; + +/** + * Concatenates two strings. + * + * The documentation site allows you to toggle between the different overloads + * of a function. The implementation signature of the overloaded function is not + * included in the documentation. + */ +export function overloadedFunction(a: string, b: string): string; + +export function overloadedFunction(a: unknown, b: unknown): string { + return ( + (a as { toString(): string }).toString() + + (b as { toString(): string }).toString() + ); +} diff --git a/example/src/index.ts b/example/src/index.ts index 3d0f7e25e..0c0d0d749 100644 --- a/example/src/index.ts +++ b/example/src/index.ts @@ -3,3 +3,4 @@ export * from "./functions"; export * from "./variables"; export * from "./types"; export * from "./enums"; +export * from "./reexports"; diff --git a/example/src/reexports.ts b/example/src/reexports.ts new file mode 100644 index 000000000..f7eb5a446 --- /dev/null +++ b/example/src/reexports.ts @@ -0,0 +1,4 @@ +/** + * Here is a useful function re-exported from Lodash. + */ +export { sortBy as lodashSortBy } from "lodash";