Skip to content

Commit

Permalink
Merge pull request #1 from oshx/fix/errors
Browse files Browse the repository at this point in the history
Updated versions of each dependencies and fixed wrong types.
Updated a package version.
Created a package lock file and edited a tsconfig.json.
  • Loading branch information
oshx authored Jul 1, 2024
2 parents fbdd75b + 2868b09 commit 78b1940
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 13 deletions.
11 changes: 6 additions & 5 deletions @types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* type ObjectKey<ObjectA> = 'KEY_A'|'KEY_B';
*/

declare type ObjectKey<T extends object = any> = keyof T

/** Expected to a type of value of an object. Cast `as const` object is usually supported autocomplete in some IDEs.
Expand All @@ -20,7 +21,7 @@ declare type ObjectKey<T extends object = any> = keyof T
*
* type ObjectValue<ObjectA> = 'valueA'|'valueB';
*/
declare type ObjectValue<T extends object = any> = T[ObjectKey]
declare type ObjectValue<T extends object = any> = T[ObjectKey<T>]

/** The extendable interface for CSS-in-JS users.
*
Expand All @@ -29,12 +30,12 @@ declare type ObjectValue<T extends object = any> = T[ObjectKey]
* ...
* }
*/
declare interface PropsWithClassName<
declare type PropsWithClassName<
T extends object = object,
ClassNameType extends string = string | undefined
> extends T {
ClassNameType = string | undefined
> = {
className: ClassNameType
}
} & T;

/** The simple `Any function` declaration.
*
Expand Down
48 changes: 48 additions & 0 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oshx/type-helper",
"version": "1.0.0",
"version": "1.0.1",
"description": "Types help TypeScript types.",
"repository": {
"type": "git",
Expand All @@ -23,11 +23,11 @@
},
"homepage": "https://github.com/oshx/type-helper#readme",
"devDependencies": {
"prettier": "^2.7.1",
"typescript": "^4.7.4"
"typescript": "^4.7.4",
"prettier": "^2.7.1"
},
"peerDependencies": {
"typescript": "^4.7.4"
"typescript": ">=4.7.4"
},
"type": "module"
}
5 changes: 1 addition & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
"target": "es5",
"lib": [
"es2021.intl"
],
"jsx": "preserve",
"noLib": true,
"module": "commonjs",
"rootDir": "./",
"moduleResolution": "node",
Expand All @@ -27,8 +25,7 @@
"skipLibCheck": true
},
"include": [
"types/**/*.ts",
"types/**/*.d.ts"
"./**/*"
],
"exclude": [
"node_modules"
Expand Down

0 comments on commit 78b1940

Please sign in to comment.