@xunnamius/next-types
v1.0.9
Published
Various constants, utility types, and typed functions for Next.js-based projects
Downloads
7
Maintainers
Readme
@xunnamius/next-types
This package contains several TypeScript utility types and helper functions for use with Next.js-based projects.
Install
npm install --save-dev @xunnamius/next-types
Usage
You can use this library's exports in your TypeScript projects like so:
import type { NextApiHandler } from 'next';
import type { WithConfig } from '@xunnamius/next-types';
// ...
const handler: WithConfig<NextApiHandler> = getHandler();
Type and Constant Glossary
This package exports the following:
WithConfig
This type is used to show a NextPage
or NextApiHandler
exports a Config
object.
import * as EndpointHandler from 'universe/pages/api/your-endpoint';
import type { WithConfig } from '@xunnamius/next-types';
const endpointHandler: WithConfig<typeof EndpointHandler.default> =
EndpointHandler.default;
endpointHandler.config = EndpointHandler.config;
Function Glossary
The following functions are available: (none yet)
Documentation
Further documentation can be found under docs/
.
License
Contributing and Support
New issues and pull requests are always welcome and greatly appreciated! 🤩 Just as well, you can star 🌟 this project to let me know you found it useful! ✊🏿 Thank you!
See CONTRIBUTING.md and SUPPORT.md for more information.