Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ts-type

bluelovers201.2kISC3.0.1TypeScript support: included

add some typescript type and re-export some build-in typescript type

.d.ts, @types, declaration, dev, develop, development, environment, ide, interface, node, playground, runtime, ts, type, type-level, typelevel, types, typescript, typing, typings, type-helprt, toolbox, toolbelt

readme

README

add some typescript type and re-export some build-in typescript type

see index.d.ts

install

npm install ts-type

demo

ITSOverwrite

export interface A1
{
    s: string
}

export type A2 = ITSOverwrite<A1, {
    s: number,
}>
export declare let a2: A2;
// a2.s is number

ITSOverwriteReturnType

import { ITSOverwriteReturnType } from '..';

declare function f(a: number): number

declare let c: ITSOverwriteReturnType<typeof f, string>;
// c is (a: number) => string
// c(1).toUpperCase()

Promise / Bluebird / PromiseLike

npm install @types/bluebird ts-type
export declare function p1(a: number): Promise<number>

export declare let p1_v: ITSUnpackedReturnType<typeof p1>;

p1_v.toFixed()

export declare let p2: ITSWrapFunctionPromise<typeof p1>;
export declare let p3: ITSWrapFunctionBluebird<typeof p2>;
export declare let p4: ITSWrapFunctionBluebird<typeof p1>;

p2(1).then(v => v.toFixed())
p3(1).then(v => v.toFixed())
p4(1).then(v => v.toFixed())

this

export declare function t1(this: string, a: number): Promise<number>

export declare let t1_this: ITSUnpackedThisFunction<typeof t1>;

// => t1_this is string
export declare function t2(this: string, a: number): number

export declare let t3: ITSOverwriteThisFunction<number, typeof t2>;

t3 = function ()
{
    this.toFixed() // => this is number

    return 1
}
interface Function2 extends Function
{
    bind<T extends any, F extends (...args: any[]) => any>(this: F, thisArg: T, ...argArray: any[]): ITSOverwriteThisFunction<T, F>;
}

export interface t4 extends Function2
{
    (): string
}

export declare let t5: t4

export let t6 = t5.bind([] as string[])

t6 = function ()
{
    this.includes('') // => this is string[]

    return ''
}

other

docs

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

3.0.1 (2022-10-10)

BREAKING CHANGES

  • remove unpacked , bluebird
  • .

✨ Features

📦 Code Refactoring

🛠 Build System

📌 Dependencies

🔖 Miscellaneous

2.1.10 (2022-08-10)

🐛 Bug Fixes

  • fix typo { ITSToWriteableAArray => ITSToWriteableArray } (4d2853e)

✨ Features

🛠 Build System

2.1.9 (2022-08-10)

✨ Features

🛠 Build System

2.1.8 (2022-07-06)

✨ Features

🛠 Build System

2.1.7 (2022-07-05)

✨ Features

  • type: add ITSEmptyRecord (29ccf90)

🛠 Build System

♻️ Dependencies

2.1.6 (2022-03-12)

📦 Code Refactoring

  • { ITSToArray => ITSToWriteableAArray } (adda840)

2.1.5 (2022-02-26)

✨ Features

  • add ITSToReadonlyArray , ITSToArray (f968c89)

2.1.4 (2022-01-12)

🔖 Miscellaneous

2.1.2 (2021-12-04)

✨ Features

  • type ITSValueOrArrayMaybeReadonly<T> = T | ITSArrayListMaybeReadonly<T>; (0ae2f20)

2.1.1 (2021-12-04)

🐛 Bug Fixes

BREAKING CHANGE

    • { ITAndStringLiteral => ITSAndStringLiteral }
  • { ITAndTypeAndStringLiteral => ITSAndTypeAndStringLiteral }

2.0.3 (2021-11-28)

✨ Features

  • add ITSOmitIndexSignatures (cd93c7c)

🔖 Miscellaneous

2.0.2 (2021-11-28)

✨ Features

  • add ITSOmitIndexSignatures (cd93c7c)

2.0.1 (2021-11-20)

🐛 Bug Fixes

📦 Code Refactoring

  • split and breaking changes (c5b8a8c)

1.2.40 (2021-08-31)

✨ Features

🛠 Build System

🔖 Miscellaneous

1.2.39 (2021-07-20)

🔖 Miscellaneous

1.2.38 (2021-07-19)

🛠 Build System

🔖 Miscellaneous

1.2.37 (2021-07-19)

🔖 Miscellaneous

1.2.36 (2021-07-16)

✨ Features

  • update ITSValueOfArray<T> (8b0138b)

1.2.35 (2021-06-15)

✨ Features

  • ITSRequiredPick<T, K extends keyof T = keyof T> (ef20549)

🔖 Miscellaneous

1.2.34 (2020-09-04)

✨ Features

  • deps: move ts-toolbelt to peer deps (3d4ef95)
  • get readonly keys of an Object. (41de826)

🚨 Tests

  • use [@ts-expect-error](https://github.com/ts-expect-error) (c446116)

BREAKING CHANGE

  • deps: ts-toolbelt is peer deps now

1.2.33 (2020-09-04)

✨ Features

  • add type ITSTupleKeys<T extends any[]> (7671f09)
  • add type ITSUnionToIntersection<U> (b15af47)

♻️ Chores

1.2.32 (2020-07-31)

♻️ Chores

1.2.31 (2020-07-28)

✨ Features

1.2.30 (2020-07-27)

🐛 Bug Fixes

1.2.29 (2020-07-26)

🔖 Miscellaneous

1.2.28 (2020-07-26)

🔖 Miscellaneous

1.2.27 (2020-07-26)

✨ Features

  • update type to interface, add simple test (888fa10)

BREAKING CHANGES

  • omit [k: string]

1.2.26 (2020-07-26)

🐛 Bug Fixes

  • record: fix ITSMergeBoth<T, U> (d74791b)

✨ Features

🔖 Miscellaneous

1.2.25 (2020-07-09)

♻️ Chores

1.2.24 (2020-07-05)

♻️ Chores

1.2.23 (2020-06-11)

Note: Version bump only for package ts-type

1.2.22 (2020-06-11)

Bug Fixes

1.2.21 (2020-06-11)

Bug Fixes

1.2.20 (2020-06-11)

Note: Version bump only for package ts-type

1.2.19 (2020-06-11)

Note: Version bump only for package ts-type

1.2.18 (2020-06-11)

Features

1.2.17 (2020-06-01)

Note: Version bump only for package ts-type

1.2.16 (2020-05-05)

Features