Skip to content

Commit

Permalink
Fix compatibility with TypeScript 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Mar 24, 2024
1 parent 18dca5d commit 3b1f99e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
17 changes: 16 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
/* eslint-disable @typescript-eslint/member-ordering */
import type {Buffer} from 'node:buffer';
import type {LiteralUnion} from 'type-fest';

// From https://github.com/sindresorhus/type-fest
type Primitive =
| null // eslint-disable-line @typescript-eslint/ban-types
| undefined
| string
| number
| boolean
| symbol
| bigint;

type LiteralUnion<
LiteralType,
BaseType extends Primitive,
> = LiteralType | (BaseType & Record<never, never>);
// -

export type ImageOptions = {
/**
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"node": ">=14.16"
},
"scripts": {
"test": "xo && ava && tsd"
"test": "ava && tsd",
"//test": "xo && ava && tsd"
},
"files": [
"index.js",
Expand Down Expand Up @@ -49,9 +50,6 @@
"iterm",
"iterm2"
],
"dependencies": {
"type-fest": "^3.0.0"
},
"devDependencies": {
"@types/node": "^18.7.18",
"ava": "^4.3.3",
Expand Down

0 comments on commit 3b1f99e

Please sign in to comment.