Skip to content

Commit

Permalink
Merge pull request #5 from oshx/fix/rename
Browse files Browse the repository at this point in the history
Renamed file for tsconfig.
Added a badge.
Removed the paths field.
Updated a version with applied file rename.
  • Loading branch information
oshx authored Jul 2, 2024
2 parents 06d01dd + 571e393 commit 88208a4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# @oshx/type-helper
[![Node.js Package](https://github.com/oshx/type-helper/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/oshx/type-helper/actions/workflows/npm-publish.yml)

This package includes the practical type helper for TypeScript users.

## Installation
Expand Down Expand Up @@ -26,8 +28,8 @@ type ObjectKey
type ObjectValue
// explicit constant object values

interface PropsWithClassName
// extendable interface with optional property 'className'
type PropsWithClassName
// extendable interface-like-type with optional property 'className'

type AnyFunction
// simply declared any function
Expand Down
8 changes: 4 additions & 4 deletions types.d.ts → index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ declare type ObjectKey<T extends object = any> = keyof T
*/
declare type ObjectValue<T extends object = any> = T[ObjectKey<T>]

/** The extendable interface for CSS-in-JS users.
/** The extendable interface-like-type for CSS-in-JS users.
*
* @example
* interface ReactComponentProps extends PropsWithChildren, PropsWithClassName {
* ...
* }
*/
declare interface PropsWithClassName<
declare type PropsWithClassName<
T extends object = object,
ClassNameType = string | undefined
> extends T {
> = {
className: ClassNameType
}
} & T

/** The simple `Any function` declaration.
*
Expand Down
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.3",
"version": "1.0.4",
"description": "Types help TypeScript types.",
"repository": {
"type": "git",
Expand All @@ -13,12 +13,12 @@
"exports": {
".": {
"types": {
"default": "./types.d.ts"
"default": "./index.d.ts"
}
}
},
"typeRoots": "./types.d.ts",
"types": "./types.d.ts",
"typeRoots": "./index.d.ts",
"types": "./index.d.ts",
"author": {
"name": "오승환",
"email": "[email protected]",
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"rootDir": "./",
"moduleResolution": "node",
"baseUrl": "./",
"paths": {},
"allowJs": true,
"checkJs": true,
"declaration": true,
Expand Down

0 comments on commit 88208a4

Please sign in to comment.