Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#66740 fix: add number type to Content in P…
Browse files Browse the repository at this point in the history
…dfmake by @pengshengjie

* fix: add number type

* fix: interface test
  • Loading branch information
Shengjie Peng authored Sep 20, 2023
1 parent d2fedd8 commit b950930
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions types/pdfmake/interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@ export type StyleReference = string | Style | Array<string | Style>;
*/
export type Content =
| string
| number
| Content[]
| ContentText
| ContentColumns
Expand Down
2 changes: 1 addition & 1 deletion types/pdfmake/test/pdfmake-interfaces-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
const createContent: () => Content = () => 'allo';
const content: Content = createContent();

if (typeof content !== 'string' && 'stack' in content && content.stack) {
if (typeof content !== 'string' && typeof content !== 'number' && 'stack' in content && content.stack) {
// $ExpectType ContentStack
content;
}
Expand Down

0 comments on commit b950930

Please sign in to comment.