{"name":"ts-type","version":"2.1.8","keywords":[".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"],"author":"","license":"ISC","_id":"ts-type@2.1.8","maintainers":[{"name":"bluelovers","email":"codelovers@users.sourceforge.net"}],"homepage":"https://github.com/bluelovers/ws-ts-type/tree/master/packages/ts-type#readme","bugs":{"url":"https://github.com/bluelovers/ws-ts-type/issues"},"dist":{"shasum":"b799b2233c014604d3b16fda6dbce78e9a1dd057","tarball":"http://registry-npm.ywwl.com/ts-type/download/ts-type-2.1.8.tgz","fileCount":115,"integrity":"sha512-iWYYRpeU1t5lW8AGYSX0px1Lx1el5yTFt9cyr+Y2v+EkdJ7LYwuiM+qIFKaZXS3N1ow9TX3KrMtt6VetuzTDXw==","signatures":[{"sig":"MEYCIQCLNaa+81M67CGpNDvZkbOzg6rNJcBhRiCsS46e0EOchAIhAMPY2V6jcRCWoBKJn6CMjGiLRb+hQBkuFS7102AO2C3c","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":282502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixQltACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo2XQ//afzRJXZO9leWDxwM0SvlPCQliOnl/fxXjXweb29W/IOfE5OJ\r\nXL2aZqfgNBmG4gw+78nLNTI+Tn2yHKRuN4UhEOOlqc3fovlvV5krqWBtAZFQ\r\nSa0JK3rA1kkGjkLyQq2Dm9u0lq8imFLAcpVApX2Tb0oNKZDF2Ri3cycBBUhQ\r\n7I1IXVA2agl+taXqCrflMzRxNuMAHy1+Qs3nx4a7yjYq6RJ0wDLKgA7t2yfP\r\ndlfJlxzOUr3IumKwix7qyGqfUEkrtwl2UOTVtfC1thF7e6xVP8bvtrbKnYOt\r\n4whamlbx0+fHf58SqsnmI9nlVPlg/NplkpO5bUfC+pBOtHY0erSHfXmtN+oj\r\nGce/S5gEolmLU2w0eDYFdK95L2MnJBHXj6JIsCnwVULCSTsryx/4zexL5JbM\r\nxgzeJJ5y9B0h2pHSHsrPEkP0uha+/5f9/Oxz4uTj+8vm7hTmwb2Ipz2JTN2r\r\nH6T0N/HPl91PO443GI3uQHvO76Abf8PEE4SYPMgZ6WVc2zICAiC/Mtf/q8aY\r\nwSL1slk0Gk+yJ1SmHCpEQfBeTqnUlG8OMX7oL5c5cL03XsOykbHUR+MlY7xX\r\n85HWLxxI8SHI1QmIsBSvJ2geynZkXLDjKMyJ3uCmi1G3euyWji7EZqeRE8rQ\r\nJRUyH/o1yNiZfjflSpAtTsRhAsnMeIjDjiY=\r\n=cvck\r\n-----END PGP SIGNATURE-----\r\n","size":53231,"noattachment":false,"key":"/ts-type/-/ts-type-2.1.8.tgz"},"main":"index.js","gitHead":"095cead0934e3722045025990d906c290869e3f6","scripts":{"ncu":"npx yarn-tool ncu -u","test":"yarn run ts:check","build":"yarn run build-lib-toc","pretest":"yarn run build","ts:check":"tsc --noEmit -p tsconfig.check.json","build:toc":"tsc -p ./ --isolatedModules --noStrictGenericChecks --skipLibCheck & echo build:toc","preversion":"yarn run test && yarn run postpublish:git:commit","build-lib-toc":"ynpx ts-node ./test/script/toc && yarn run build:toc","prepublishOnly":"echo prepublishOnly","sort-package-json":"npx yarn-tool sort","postpublish:git:commit":"git commit -m \"build(release): publish\" ./lib/index.d.ts & echo postpublish:git:commit"},"_npmUser":{"name":"bluelovers","email":"codelovers@users.sourceforge.net"},"repository":{"url":"git+https://github.com/bluelovers/ws-ts-type.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v18.4.0+x64 (win32)","description":"add some typescript type and re-export some build-in typescript type","directories":{"lib":"lib","test":"test"},"_nodeVersion":"18.4.0","dependencies":{"tslib":"^2","typedarray-dts":"^1.0.0"},"_hasShrinkwrap":false,"peerDependencies":{"@types/node":"*","ts-toolbelt":"^9.6.0","@types/bluebird":"*"},"_npmOperationalInternal":{"tmp":"tmp/ts-type_2.1.8_1657080173129_0.7314262168404442","host":"s3://npm-registry-packages"},"readme":"# ts-type\n\n**TypeScript 類型工具庫** / **TypeScript Type Utility Library**\n\n提供豐富的 TypeScript 類型操作工具和重新導出的內建類型，支援雙語註解（繁體中文 + 英文）。\n\nProvides rich TypeScript type manipulation utilities and re-exported built-in types with bilingual comments (Traditional Chinese + English).\n\nsee [index.d.ts](https://github.com/bluelovers/ws-ts-type/tree/master/packages/ts-type/index.d.ts)\n\n## 安裝 / Installation\n\n```bash\n# npm\nnpm install ts-type\n\n# yarn\nyarn add ts-type\n\n# pnpm\npnpm add ts-type\n```\n\n## 範例 / Examples\n\n- [demo](https://github.com/bluelovers/ws-ts-type/tree/master/packages/ts-type/test/demo)\n- \n\n### ITSOverwrite\n\n```ts\nexport interface A1\n{\n\ts: string\n}\n\nexport type A2 = ITSOverwrite<A1, {\n\ts: number,\n}>\nexport declare let a2: A2;\n// a2.s is number\n```\n\n### ITSOverwriteReturnType\n\n覆寫函數返回值類型 / Overwrite function return type\n\n```ts\nimport { ITSOverwriteReturnType } from '..';\n\ndeclare function f(a: number): number\n\ndeclare let c: ITSOverwriteReturnType<typeof f, string>;\n// c is (a: number) => string\n// c(1).toUpperCase()\n```\n\n### Promise / Bluebird / PromiseLike\n\nPromise 相關類型操作 / Promise related type operations\n\n```nodemon\nnpm install @types/bluebird ts-type\n```\n\n```ts\nexport declare function p1(a: number): Promise<number>\n\nexport declare let p1_v: ITSUnpackedReturnType<typeof p1>;\n\np1_v.toFixed()\n\nexport declare let p2: ITSWrapFunctionPromise<typeof p1>;\nexport declare let p3: ITSWrapFunctionBluebird<typeof p2>;\nexport declare let p4: ITSWrapFunctionBluebird<typeof p1>;\n\np2(1).then(v => v.toFixed())\np3(1).then(v => v.toFixed())\np4(1).then(v => v.toFixed())\n```\n\n### this 類型操作 / this Type Operations\n\n操作函數的 this 類型 / Manipulate function's this type\n\n```ts\nexport declare function t1(this: string, a: number): Promise<number>\n\nexport declare let t1_this: ITSUnpackedThisFunction<typeof t1>;\n\n// => t1_this is string\n```\n\n```ts\nexport declare function t2(this: string, a: number): number\n\nexport declare let t3: ITSOverwriteThisFunction<number, typeof t2>;\n\nt3 = function ()\n{\n\tthis.toFixed() // => this is number\n\n\treturn 1\n}\n```\n\n```ts\ninterface Function2 extends Function\n{\n\tbind<T extends any, F extends (...args: any[]) => any>(this: F, thisArg: T, ...argArray: any[]): ITSOverwriteThisFunction<T, F>;\n}\n\nexport interface t4 extends Function2\n{\n\t(): string\n}\n\nexport declare let t5: t4\n\nexport let t6 = t5.bind([] as string[])\n\nt6 = function ()\n{\n\tthis.includes('') // => this is string[]\n\n\treturn ''\n}\n```\n\n## 文檔 / Documentation\n\n詳細的類型工具說明文件請參閱 [docs/](docs/) 目錄。\n\nFor detailed type utility documentation, see the [docs/](docs/) directory.\n\n### 分類指南 / Category Guide\n\n- [基礎類型](docs/01-base-types.md) - 基礎類型別名與工具 / Base type aliases and utilities\n- [內建類型](docs/02-built-in-types.md) - 重新導出的內建類型 / Re-exported built-in types\n- [函數類型工具](docs/03-function-types.md) - 函數類型操作 / Function type operations\n- [Promise 類型工具](docs/04-promise-types.md) - Promise 相關類型 / Promise related types\n- [陣列與元組類型](docs/05-array-tuple-types.md) - 陣列與元組操作 / Array and tuple operations\n- [物件與記錄類型](docs/06-object-record-types.md) - 物件類型操作 / Object type operations\n- [字串與數字類型](docs/07-string-number-types.md) - 字串與數字類型操作 / String and number operations\n- [邏輯類型工具](docs/08-logic-types.md) - 類型層級邏輯判斷 / Type-level logic\n\n## 其他相關專案 / Related Projects\n\n- [callable-instance2](https://www.npmjs.com/package/callable-instance2) - create an ES6 class that is callable as a function\n- https://github.com/piotrwitek/utility-types\n- \n\n## 文件與教學 / Documentation & Tutorials\n\n- http://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html\n- https://www.tslang.cn/docs/release-notes/typescript-3.1.html#toc-whats-new\n- https://www.logicbig.com/tutorials/misc/typescript.html\n\n## 相關連結 / Related Links\n\n- https://github.com/krzkaczor/ts-essentials\n- https://github.com/millsp/ts-toolbelt\n- https://github.com/type-challenges/type-challenges\n- https://github.com/andnp/SimplyTyped\n- https://github.com/piotrwitek/utility-types\n- \n","publish_time":1657080173334,"_cnpm_publish_time":1657080173334,"dist-tags":{"latest":"3.0.19"}}