Skip to content

Commit

Permalink
Merge pull request #7 from oshx/update/optional-class-name
Browse files Browse the repository at this point in the history
Updated README.md.
Updated 'PropsWithClassName' type as an optional value.
Updated versions.
  • Loading branch information
oshx authored Jul 21, 2024
2 parents 1ce750a + 42e96ad commit c59b620
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ $ npm i -D @oshx/type-helper

Please add below in `tsconfig.json` file.
```json
{
"compilerOptions": {
"typeRoots": [
"node_modules/@oshx"
]
}
}
```

If your TypeScript doesn't accept that type, then add below.
```json
{
"compilerOptions": {
"typeRoots": [
Expand Down
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ declare type ObjectValue<T extends object = any> = T[ObjectKey<T>]
*/
declare type PropsWithClassName<
T extends object = object,
ClassNameType = string | undefined
ClassNameType = string
> = {
className: ClassNameType
className?: ClassNameType
} & T

/** The simple `Any function` declaration.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oshx/type-helper",
"version": "1.0.5",
"version": "1.0.6",
"description": "Types help TypeScript types.",
"repository": {
"type": "git",
Expand Down

0 comments on commit c59b620

Please sign in to comment.