@npm.piece/types
TypeScript icon, indicating that this package has built-in type declarations

1.0.11 • Public • Published

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>

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i @npm.piece/types

    Weekly Downloads

    7

    Version

    1.0.11

    License

    ISC

    Unpacked Size

    2.1 kB

    Total Files

    4

    Last publish

    Collaborators

    • npm.piece