@just-web/types
TypeScript icon, indicating that this package has built-in type declarations

6.0.2 • Public • Published

@just-web/types

NPM version NPM downloads

@just-web/types provides type definitions for @just-web modules.

Install

# npm
npm install @just-web/types

# yarn
yarn add @just-web/types

# pnpm
pnpm install @just-web/types

#rush
rush add -p @just-web/types

definePlugin()

Use this helper function to define a plugin module.

The result should be exported as the default export.

import { definePlugin } from '@just-web/types'

export default definePlugin({
  init: async () => []
})

It is strongly typed and should work for most scenarios.

defineInit()

If your plugin adds feature to the app using generics, currently definePlugin() does not support that.

Instead, you can use defineInit() and other individual helpers instead:

import { defineInit } from '@just-web/types'

export default {
  init: defineInit(async <N>(ctx: { n: N }) => [{ n }])
}

Readme

Keywords

Package Sidebar

Install

npm i @just-web/types

Weekly Downloads

2

Version

6.0.2

License

MIT

Unpacked Size

35.2 kB

Total Files

13

Last publish

Collaborators

  • unional