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

1.1.0 • Public • Published

Swell App Types

TypeScript bindings for Swell Apps.

Install

npm install @swell/app-types -D
-- Or
yarn add @swell/app-types -D

Usage

The following is a minimal tsconfig.json for use alongside this package:

tsconfig.json

{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "lib": ["esnext"],
    "types": ["@swell/app-types"]
  }
}

Importable Types

It's not always possible (or desirable) to modify the tsconfig.json settings for a project to include all the Swell app types. For use cases like that, this package provides importable versions of its types, which are usable with no additional tsconfig.json setup. For example:

import type { SwellRequest, SwellResponse } from "@swell/app-types"

export default async function (request: SwellRequest) {
    return new SwellResponse({ success: true })
  }
}

/@swell/app-types/

    Package Sidebar

    Install

    npm i @swell/app-types

    Weekly Downloads

    9

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    7.18 kB

    Total Files

    5

    Last publish

    Collaborators

    • maarten_swell
    • swell-mike
    • ei
    • papertokyo