{"name":"ts-type","version":"1.2.12","keywords":[".d.ts","@types","declaration","dev","develop","development","environment","ide","interface","node","playground","runtime","ts","type","type-level","typelevel","types","typescript","typing","typings"],"author":"","license":"ISC","_id":"ts-type@1.2.12","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":"7c59f19a2132fa887559e5f3e307a20a50281cc5","tarball":"http://registry-npm.ywwl.com/ts-type/download/ts-type-1.2.12.tgz","fileCount":44,"integrity":"sha512-r7OKmpKUa5GIPs8Gc4y3ibWQxn53E0B3thmVyu0oR9dkYtuO0T377IfeHKwfyFh4gk3/0OMIbu9Yq94R9lFT/Q==","signatures":[{"sig":"MEUCIGnLrsZh85eR0+zMlJlHfErcwZgqHdfhQdw1EW9mOan/AiEA9Je7kImTUewTwgFJTMd7Qxzi8vuijFdHVCvRJHBtXd4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeBVWiCRA9TVsSAnZWagAAuHwQAJFct1FvBPqU3Wmgo8sN\nEl6VmkC1pYeVqMGzl1fRdH13j9fxwk70Of86sGop/BQk2qtbE5hRsq6zIovf\njJdR+tgRScqr++N1M/KHlDTfQvJ3vh/1Qw2x/bHL1i2U8jrD6KiSdavVTskB\nuHGToHTkgRwoy6F0JY2TcWVyAxQTqTr20IeX69KtOJCI2GVlhiiUGX1w1Mvw\nIg/snxsnDUmqoWO5BiaE2D6UxnVvgd48PnudNRFRKfpM/iO9OfkfUuiEtZZf\nZiVidgVmPDvmNxIjk1tTTa7FiaxX+vhxN9gi+fcdJmmBb4AB16V3XMKbHf5j\nISMV4V25bmK5AnEciXG6gV8pL7hPYAgdy9Bw5/ijGL7OzmIWeKcgGTJBS6ZV\nlL7UZukRBLa9KmTrQwo5HXMUbcuVXaaZGyepU0hqiknRcu7syb+2XXE/znNY\nKBN4VYhAJmMETgKacQdHh1gayGz0+RnPcfg52A0AXyPq3hNAchsq9E8hXTh0\nzozlzSe59NGGdcr2eiDR+ZJVTy0DcQS/PLL1nvOByfyFff49KoGbltdbBEPS\nxtlOR82TIgbTz/xogg82q4eu7iptBNou6cVndmmRsYfywRXcn2al2Nh4+h1o\nVsJSxodo/8zGAp9HeeadJ3n0ZTNn3hxyM+qNlglrAjKwLeQ2z3/4owlvXBrP\neoC6\r\n=v8pE\r\n-----END PGP SIGNATURE-----\r\n","size":44257,"noattachment":false,"key":"/ts-type/-/ts-type-1.2.12.tgz"},"main":"index.js","gitHead":"efd1bcea460dec4146efa2af356a0d80dec1d7a0","scripts":{"ncu":"npx npm-check-updates -u","lint":"npx eslint ./index.ts","test":"npm run lint","build":"npm run build-lib-toc","coverage":"npx nyc npm run test","build:toc":"tsc -p ./","postpublish_":"git commit -m \"publish new version\" .","build-lib-toc":"npx ts-node ./test/script/toc && npm run build:toc","prepublishOnly":"npm run ncu && npm run sort-package-json && npm run build && npm run test","sort-package-json":"npx sort-package-json ./package.json"},"_npmUser":{"name":"bluelovers","email":"codelovers@users.sourceforge.net"},"repository":{"url":"git+https://github.com/bluelovers/ws-ts-type.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v13.5.0+x64 (win32)","description":"add some typescript type and re-export some build-in typescript type","directories":{"lib":"lib","test":"test"},"_nodeVersion":"13.5.0","dependencies":{"ts-toolbelt":"^6.0.1","typedarray-dts":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"*","@types/bluebird":"*","@bluelovers/tsconfig":"^1.0.13"},"peerDependencies":{"@types/node":"*","@types/bluebird":"*"},"_npmOperationalInternal":{"tmp":"tmp/ts-type_1.2.12_1577407906514_0.8710867810357086","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":1577407906661,"_cnpm_publish_time":1577407906661,"dist-tags":{"latest":"3.0.19"}}