1.0.11 • Published 2 years ago

@npm.piece/types v1.0.11

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Types for fast coding with React

Install

npm i @npm.piece/types -D
yarn add @npm.piece/types -D

Create .d.ts file in src folder and import types

/// <reference types="@npm.piece/types/global" />
/// <reference types="@npm.piece/types/frontend" />
/// <reference types="@npm.piece/types/backend" />

Global Types:

type Nullable<T> = T | null | undefined

type Callback<Value = void | unknown, ReturnType = void> = (
  value: Value
) => ReturnType

type UnknownCallback = (...args: any[]) => any

Frontend Types:

// Function Component
type FC<T = {}> = FunctionComponent<T & ChildrenType>

// Container Component
type CC<T = {}> = () => T

// Service Component
type SC = () => void

type ImportedMF<T = {}> = FC<T & MFPropsType>
1.0.11

2 years ago

1.0.10

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago