@xunnamius/next-types

Various constants, utility types, and typed functions for Next.js-based projects

Usage no npm install needed!

<script type="module">
  import xunnamiusNextTypes from 'https://cdn.skypack.dev/@xunnamius/next-types';
</script>

README

Black Lives Matter! Maintenance status Last commit timestamp Open issues Pull requests Codecov Source license Tree shaking support Compressed package size NPM version Uses Semantic Release!

@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

FOSSA analysis

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.