Skip to content

Commit

Permalink
TypeStronggh-1556 overloaded function and lodash reexport
Browse files Browse the repository at this point in the history
  • Loading branch information
srmagura committed Oct 2, 2021
1 parent b405848 commit 9f64490
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
26 changes: 26 additions & 0 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions example/package.json
Expand Up @@ -11,6 +11,10 @@
"typedoc": "node ../bin/typedoc ./src"
},
"devDependencies": {
"@types/lodash": "^4.14.175",
"typescript": "^4.4.3"
},
"dependencies": {
"lodash": "^4.17.21"
}
}
25 changes: 25 additions & 0 deletions example/src/functions.ts
Expand Up @@ -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()
);
}
1 change: 1 addition & 0 deletions example/src/index.ts
Expand Up @@ -3,3 +3,4 @@ export * from "./functions";
export * from "./variables";
export * from "./types";
export * from "./enums";
export * from "./reexports";
4 changes: 4 additions & 0 deletions example/src/reexports.ts
@@ -0,0 +1,4 @@
/**
* Here is a useful function re-exported from Lodash.
*/
export { sortBy as lodashSortBy } from "lodash";

0 comments on commit 9f64490

Please sign in to comment.