Skip to content

Commit 83b9c82

Browse files
Sherwin HeydarbeygiJamieMason
Sherwin Heydarbeygi
authored andcommitted
fix(types): use Partial type to set all parameters as optional
Closes #1
1 parent ea9ef2f commit 83b9c82

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This package was created on 15 Nov 2022, it is new but please give it a try and
2323
```ts
2424
import type { ImgixUrl } from 'typescript-imgix-url-params';
2525

26-
const params: Partial<ImgixUrl.Params> = {
26+
const params: ImgixUrl.Params = {
2727
w: 100,
2828
h: 100,
2929
fm: 'pjpg',

src/get-source.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function getParamsInterface(
6868
return [tsdoc, `'${key}': ${type};`].join('\n');
6969
});
7070

71-
return [`export interface ${name} {`, ...props, '}'].join('\n\n');
71+
return [`export type ${name} = Partial<{`, ...props, '}>'].join('\n\n');
7272
}
7373

7474
function getHexColorType(): string {

0 commit comments

Comments
 (0)