{"_id":"@best-skn/next-types","_rev":"6-963610fdfb7ec715d9e151e256040011","name":"@best-skn/next-types","dist-tags":{"latest":"1.1.2"},"versions":{"1.0.0":{"name":"@best-skn/next-types","version":"1.0.0","keywords":["react","type","library","next"],"author":{"url":"https://skn.best","name":"SKN Shukhan","email":"skn437physx@gmail.com"},"license":"MIT","_id":"@best-skn/next-types@1.0.0","maintainers":[{"name":"skn437","email":"skn437physx@gmail.com"}],"homepage":"https://github.com/skn437/skn-next-types#readme","bugs":{"url":"https://github.com/skn437/skn-next-types/issues"},"dist":{"shasum":"2a829a1b76f591f7beabc8342d6d3c6005df3096","tarball":"https://registry.npmjs.org/@best-skn/next-types/-/next-types-1.0.0.tgz","fileCount":5,"integrity":"sha512-/8EP5MloBctfMx2CYpwLZClV5vt1P+OVl+ciiiv1uyY290skt2aPp2clcwkssO2VImOJYMHjNqnVzhEp4XB3Pw==","signatures":[{"sig":"MEUCIAdxgjzll5w5gewF3QBFg7p1+q4m6uO2rTwKCj/woTH1AiEAoR7y0Z9z5XQZEFm4tcVkek0C0JFZ7aF6f+BVJ6qnILg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7735},"main":"","types":"index.d.ts","gitHead":"851634125c6dd9d6da0a10b68a6cf694baca7f61","_npmUser":{"name":"skn437","email":"skn437physx@gmail.com"},"repository":{"url":"git+https://github.com/skn437/skn-next-types.git","type":"git"},"_npmVersion":"10.7.0","description":"A Simple Type Definition Extension For Next.js 14","directories":{},"_nodeVersion":"22.2.0","dependencies":{"next":"^14.2.3","react":"^18.3.1","react-dom":"^18.3.1"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5.4.5","@types/node":"^20.14.2","@types/react":"^18.3.3","@types/react-dom":"^18.3.0"},"_npmOperationalInternal":{"tmp":"tmp/next-types_1.0.0_1717960369040_0.9673363824503625","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@best-skn/next-types","version":"1.0.1","keywords":["react","type","library","next"],"author":{"url":"https://skn.best","name":"SKN Shukhan","email":"skn437physx@gmail.com"},"license":"MIT","_id":"@best-skn/next-types@1.0.1","maintainers":[{"name":"skn437","email":"skn437physx@gmail.com"}],"homepage":"https://github.com/skn437/skn-next-types#readme","bugs":{"url":"https://github.com/skn437/skn-next-types/issues"},"dist":{"shasum":"f6a6e2ee1874a2e1c224725b1573839e1f2e4783","tarball":"https://registry.npmjs.org/@best-skn/next-types/-/next-types-1.0.1.tgz","fileCount":5,"integrity":"sha512-Ya/dg5QhAUq0kyJ0DtS9Vnez5qYuDAvCHpigJ1+h2fPDPuNnlliunZJIYKFDjRPq4o3JyE/VwjAEvjwYxt/Z9w==","signatures":[{"sig":"MEYCIQDp4NG7Pb5c6dOGxEL1MXPOAhNPe+shtECFkf0nvt81OAIhAJkMJMY0Xf0u906BztZcSDhlxwQiGmZXCMjYtW0grxQO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17248},"main":"","types":"index.d.ts","gitHead":"11ede30c9d5cf545165f15c6821de46a86ebc28d","_npmUser":{"name":"skn437","email":"skn437physx@gmail.com"},"repository":{"url":"git+https://github.com/skn437/skn-next-types.git","type":"git"},"_npmVersion":"10.7.0","description":"A Simple Type Definition Extension Library For Next.js 14","directories":{},"_nodeVersion":"20.14.0","dependencies":{"next":"^14.2.3","react":"^18.3.1","react-dom":"^18.3.1"},"_hasShrinkwrap":true,"devDependencies":{"typescript":"^5.4.5","@types/node":"^20.14.2","@types/react":"^18.3.3","@types/react-dom":"^18.3.0"},"_npmOperationalInternal":{"tmp":"tmp/next-types_1.0.1_1718048510764_0.3573704750040445","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@best-skn/next-types","version":"1.0.2","keywords":["react","type","library","next"],"author":{"url":"https://skn.best","name":"SKN Shukhan","email":"skn437physx@gmail.com"},"license":"MIT","_id":"@best-skn/next-types@1.0.2","maintainers":[{"name":"skn437","email":"skn437physx@gmail.com"}],"homepage":"https://github.com/skn437/skn-next-types#readme","bugs":{"url":"https://github.com/skn437/skn-next-types/issues"},"dist":{"shasum":"adc552b4700267b2461cf792259984bc63670bbe","tarball":"https://registry.npmjs.org/@best-skn/next-types/-/next-types-1.0.2.tgz","fileCount":4,"integrity":"sha512-VI+zniC3H/uwihFTg5nY/l+a4zR+h4jdCTy1Y7kf4qZPw80lh1CkFXQTuQn6hIEB9DFJwt2pQKnNEkSge29nRg==","signatures":[{"sig":"MEQCIBX/HmPIoRlRHk2V/i92/PFW53DZMOWCZzoev1m7CO2MAiB25eN9Hf7g78a3StrwnkpCmoySeVrbGH4Sw+uWD5Dy/w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10387},"main":"","types":"index.d.ts","gitHead":"0c3a106351670509f1230e59054b12e3ef41fec1","_npmUser":{"name":"skn437","email":"skn437physx@gmail.com"},"repository":{"url":"git+https://github.com/skn437/skn-next-types.git","type":"git"},"_npmVersion":"10.7.0","description":"A Simple Type Definition Extension Library For Next.js 14","directories":{},"_nodeVersion":"20.14.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.5","@types/node":"^20.14.2"},"peerDependencies":{"next":">= 14.2.3 < 15","react":">= 18.3.1 < 19","react-dom":">= 18.3.1 < 19","@types/react":">= 18.3.3 < 19","@types/react-dom":">= 18.3.0 < 19"},"_npmOperationalInternal":{"tmp":"tmp/next-types_1.0.2_1718097178668_0.5095322710601133","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@best-skn/next-types","version":"1.1.0","keywords":["react","type","library","next"],"author":{"url":"https://skn.best","name":"SKN Shukhan","email":"skn437physx@gmail.com"},"license":"MIT","_id":"@best-skn/next-types@1.1.0","maintainers":[{"name":"skn437","email":"skn437physx@gmail.com"}],"homepage":"https://github.com/skn437/skn-next-types#readme","bugs":{"url":"https://github.com/skn437/skn-next-types/issues"},"dist":{"shasum":"f4428b738ed3f4dee4bc6dfff6539f2d3a133405","tarball":"https://registry.npmjs.org/@best-skn/next-types/-/next-types-1.1.0.tgz","fileCount":4,"integrity":"sha512-Rb+oSoSk41phrqe1YaiADLH/br2niha0mD4Ze5FJzS2AGRtDKAa3smrE5SQYLgeuaryIbgJB7z4SHR6tiDuaKQ==","signatures":[{"sig":"MEYCIQDaL/ELyew3lPcHGq+t5jBrTFWQhBgm/2OGO2Cmlwu0twIhAKEsfGTBhd37gNUpnwOizWqeJSjpDBChNDNYAT+2wFW8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10346},"main":"","types":"index.d.ts","gitHead":"c92c1a55424a8717f82301a8309c26082b9cf411","_npmUser":{"name":"skn437","email":"skn437physx@gmail.com"},"repository":{"url":"git+https://github.com/skn437/skn-next-types.git","type":"git"},"_npmVersion":"10.7.0","description":"A Simple Type Definition Extension Library For Next.js 14","directories":{},"_nodeVersion":"20.15.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.5.3","@types/node":"^20.14.10"},"peerDependencies":{"next":">= 14.2.3 < 15","react":">= 18.3.1 < 19","react-dom":">= 18.3.1 < 19","@types/react":">= 18.3.3 < 19","@types/react-dom":">= 18.3.0 < 19"},"_npmOperationalInternal":{"tmp":"tmp/next-types_1.1.0_1720334762032_0.9168883273606965","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@best-skn/next-types","version":"1.1.1","keywords":["react","type","library","next"],"author":{"url":"https://skn.best","name":"SKN Shukhan","email":"skn437physx@gmail.com"},"license":"MIT","_id":"@best-skn/next-types@1.1.1","maintainers":[{"name":"skn437","email":"skn437physx@gmail.com"}],"homepage":"https://github.com/skn437/skn-next-types#readme","bugs":{"url":"https://github.com/skn437/skn-next-types/issues"},"dist":{"shasum":"960850c0466fc7cbf62085b3a8bfae68f824b5b6","tarball":"https://registry.npmjs.org/@best-skn/next-types/-/next-types-1.1.1.tgz","fileCount":4,"integrity":"sha512-EpNcZkVN4+cmIkzWWoLAqLxZj7kw6MBs/o/9Nh6qxi4ot4hIGrhgxB/6spt4I97SeLyzKcOdwIocIj9XuJZJWA==","signatures":[{"sig":"MEQCIFuvDK47Upu520yXUCx+L5XQthdSEol59UROiQA4XNo6AiBVts5JXowJPWx7QX41TyZ982GLl7DiYseUaxoJImjYow==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10474},"main":"","types":"index.d.ts","gitHead":"3b3470056df658fd228db163c087f9c25ef7fafe","_npmUser":{"name":"skn437","email":"skn437physx@gmail.com"},"repository":{"url":"git+https://github.com/skn437/skn-next-types.git","type":"git"},"_npmVersion":"10.8.1","description":"A Simple Type Definition Extension Library For Next.js 14","directories":{},"_nodeVersion":"20.16.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.5.3","@types/node":"^20.14.10"},"peerDependencies":{"next":">= 14.2.3 < 15","react":">= 18.3.1 < 19","react-dom":">= 18.3.1 < 19","@types/react":">= 18.3.3 < 19","@types/react-dom":">= 18.3.0 < 19"},"_npmOperationalInternal":{"tmp":"tmp/next-types_1.1.1_1724009426059_0.26077499327405085","host":"s3://npm-registry-packages"}},"1.1.2":{"name":"@best-skn/next-types","description":"A Simple Type Definition Extension Library For Next.js 14","version":"1.1.2","main":"","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/skn437/skn-next-types.git"},"keywords":["react","type","library","next"],"author":{"name":"SKN Shukhan","email":"skn437physx@gmail.com","url":"https://skn.best"},"license":"MIT","devDependencies":{"@types/node":"^20.14.10","typescript":"^5.5.3"},"peerDependencies":{"@types/react":">= 18.3.3 < 19","@types/react-dom":">= 18.3.0 < 19","next":">= 14.2.3 < 15","react":">= 18.3.1 < 19","react-dom":">= 18.3.1 < 19"},"_id":"@best-skn/next-types@1.1.2","gitHead":"75f41b3b2365d1254c87e67641c4f18987477ee7","bugs":{"url":"https://github.com/skn437/skn-next-types/issues"},"homepage":"https://github.com/skn437/skn-next-types#readme","_nodeVersion":"20.19.5","_npmVersion":"10.8.2","dist":{"integrity":"sha512-vSWuLtATAWfllR56Xu+ugKFTUx+8LQWsQm0ztTKnp8rJwTI/Ch1ltBjY/6HB26izQ20mpq6NRWObf4WQBiB8Dw==","shasum":"988a4dabe7476e0775b2c4aa9752536eda2bb687","tarball":"https://registry.npmjs.org/@best-skn/next-types/-/next-types-1.1.2.tgz","fileCount":4,"unpackedSize":10218,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFBLIKZcNZ37HADDy1v0eKFFy+hMoXfz29Z0EAeb/yUIAiEAmaAUSIGyJCZef1/Q2FjkgItQTNCdgDNDjEbbKAPcW8A="}]},"_npmUser":{"name":"skn437","email":"skn437physx@gmail.com"},"directories":{},"maintainers":[{"name":"skn437","email":"skn437physx@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/next-types_1.1.2_1761200675197_0.7185390844408868"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-09T19:12:48.958Z","modified":"2025-10-23T06:24:35.548Z","1.0.0":"2024-06-09T19:12:49.246Z","1.0.1":"2024-06-10T19:41:50.908Z","1.0.2":"2024-06-11T09:12:58.805Z","1.1.0":"2024-07-07T06:46:02.163Z","1.1.1":"2024-08-18T19:30:26.248Z","1.1.2":"2025-10-23T06:24:35.362Z"},"bugs":{"url":"https://github.com/skn437/skn-next-types/issues"},"author":{"name":"SKN Shukhan","email":"skn437physx@gmail.com","url":"https://skn.best"},"license":"MIT","homepage":"https://github.com/skn437/skn-next-types#readme","keywords":["react","type","library","next"],"repository":{"type":"git","url":"git+https://github.com/skn437/skn-next-types.git"},"description":"A Simple Type Definition Extension Library For Next.js 14","maintainers":[{"name":"skn437","email":"skn437physx@gmail.com"}],"readme":"# SKN Next.js Type Extension Library\n\n<img width=\"150px\" src=\"https://firebasestorage.googleapis.com/v0/b/skn-ultimate-project-la437.appspot.com/o/GitHub%20Library%2F09-TypeScript-SNT.svg?alt=media&token=779098df-3836-4a06-b568-31027db5c644\" alt=\"nextjs\" />\n\n> TypeScript Next.js\n\n[![NPM Version](https://img.shields.io/npm/v/%40best-skn%2Fnext-types)](https://www.npmjs.com/package/@best-skn/next-types) [![MIT License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/license/mit)\n\n&nbsp;\n\n## **_Introduction:_**\n\n### This is a simple TypeScript Type Extension Library for Next.js 14\n\n### I made this library so that I can use it in all of my Next.js 14 projects without writing the same codes over and over again\n\n&nbsp;\n\n## **_Details:_**\n\n### **`ParamProps` Type**\n\n- An interface taking a generic that has `params` property of type `Record<T, string>`\n- `ParamProps` is the prop type for Next.js dynamic route `page.tsx` default exported server component.\n- `ParamProps` generic type is actually a string which is the name of the slug i.e. the name of the dynamic id\n- The dynamic id can have names like: \"slug\", \"id\" etc. which becomes the directory name like: [slug], [id] etc\n- For usage instruction, see `Usage` section\n\n### **`GenerateMetadata` Type**\n\n- `GenerateMetadata` is the type for Next.js dynamic route `generateMetadata` function\n- The generic type which is the dynamic id, must match that of `ParamProps` in a certain dynamic route component\n- For usage instruction, see `Usage` section\n\n### **`GenerateStaticParams` Type**\n\n- `GenerateStaticParams` is the type for Next.js dynamic route `generateStaticParams` function\n- The generic type which is the dynamic id, must match that of `ParamProps` in a certain dynamic route component\n- For usage instruction, see `Usage` section\n\n### **`NextErrorProps` Type**\n\n- an interface for Next.js `error.tsx` client component\n- `NextErrorProps` is the prop type for `error.tsx` default exported function\n\n&nbsp;\n\n## **_Use Case:_**\n\n- Next.js\n\n&nbsp;\n\n## **_Requirements:_**\n\n### This library has peer dependency for React & React DOM of minimum 18.3.1. It may or may not work on 19.x\n\n### This library is intended to be used in Next.js of minimum 14.2.3. It may or may not work on 15.x\n\n- 💀 Minimum [react](https://www.npmjs.com/package/react) Version: `18.3.1`\n- 💀 Minimum [@types/react](https://www.npmjs.com/package/@types/react) Version: `18.3.3`\n- 💀 Minimum [react-dom](https://www.npmjs.com/package/react-dom) Version: `18.3.1`\n- 💀 Minimum [@types/react-dom](https://www.npmjs.com/package/@types/react-dom) Version: `18.3.0`\n- 💀 Minimum [next](https://www.npmjs.com/package/next) Version: `14.2.3`\n\n&nbsp;\n\n## **_Complementary Libraries:_**\n\n- [@best-skn/react-types](https://www.npmjs.com/package/@best-skn/react-types)\n\n&nbsp;\n\n## **_Usage:_**\n\n### To install the package, type the following in console\n\n> ```zsh\n> npm add -D @best-skn/next-types\n> #or\n> yarn add -D @best-skn/next-types\n> #or\n> pnpm add -D @best-skn/next-types\n> #or\n> bun add -D @best-skn/next-types\n> ```\n\n### Create a directory called `types` in the root location of your project, and create a file called `next.d.ts`, then do this\n\n> ```typescript\n> import \"@best-skn/next-types\";\n> ```\n\n### Check your `tsconfig.json`, if `includes` property has `**/*.ts` & `**/*.tsx` or not otherwise the type definition file may not work\n\n### Now Inside your Next.js 14 Project, use the package like this (Just an example)\n\n#### **_`ParamProps`, `GenerateMetadata` & `GenerateStaticParams` Types:_**\n\n#### For any dynamic routes, use like this\n\n> ```typescript jsx\n> // Location: app/users/[slug]/page.tsx\n> // Dynamic id: slug\n> import type {\n>   GenerateMetadata,\n>   GenerateStaticParams,\n>   ParamProps,\n> } from \"next\";\n>\n> // Generic type here `slug` as the dynamic id is that\n> export const generateMetadata: GenerateMetadata<\"slug\"> = async (props) => {\n>   const { slug } = props.params;\n>   // some codes here...\n>   return {\n>     // some codes here...\n>   };\n> };\n>\n> // Generic type here `slug` as the dynamic id is that\n> export const generateStaticParams: GenerateStaticParams<\"slug\"> = async () => {\n>   // your code for generating static params here...\n>   // you'll get type safe dynamic route: `slug`\n> };\n>\n> // Generic type here `slug` as the dynamic id is that\n> // here `React.SC` type is from my another package: `@best-skn/react-types`\n> const User: React.SC<ParamProps<\"slug\">> = async (props) => {\n>   const { slug } = props.params; // you'll get a type safe dynamic id name\n>\n>   return ();\n> };\n>\n> ```\n\n#### **_`NextErrorProps` Type:_**\n\n#### For `error.tsx` files, use like this\n\n> ```typescript jsx\n> \"use client\";\n>\n> import type { NextErrorProps } from \"next\";\n>\n> const Error: React.FC<NextErrorProps> = (props) => {\n>   const { error, reset } = props;\n>   // some codes here...\n>   return (\n>     <div>something...</div>\n>   );\n> };\n> ```\n\n&nbsp;\n\n## **_Dedicated To:_**\n\n- 👩‍🎨`Prodipta Das Logno` & 🧛‍♀️`Atoshi Sarker Prithula`: The two most special ladies of my life. My best wishes will always be with you two. May you two always be happy.\n- 💯`My Parents`: The greatest treasures of my life ever.\n\n&nbsp;\n\n## **_License:_**\n\nCopyright (C) 2024 SKN Shukhan\n\nLicensed under the MIT License\n","readmeFilename":"README.md"}