@withgraphite/retyped-routes
TypeScript icon, indicating that this package has built-in type declarations

0.3.7 • Public • Published

Retyped routes (beta)

About

Retyped routes provides a type-safe way to create API definitions with retype in a way that can be read both by the server and client.

Install

yarn add @withgraphite/retyped-routes

Usage

import * as t from "@withgraphite/retype";
import { asRouteTree } from "@withgraphite/retyped-routes";

const API_ROUTES = asRouteTree({
  login: {
    method: "POST",
    url: "/auth",
    params: {
      email: t.string,
      password: t.string,
    },
    response: {
      token: t.string,
    },
  },
} as const);

export default API_ROUTES;

License

Copyright 2021, Screenplay Studios Inc.

Readme

Keywords

none

Package Sidebar

Install

npm i @withgraphite/retyped-routes

Weekly Downloads

10

Version

0.3.7

License

None

Unpacked Size

18.9 kB

Total Files

18

Last publish

Collaborators

  • taksh
  • alyssabaum
  • db_graphite
  • bngo
  • david_graphite
  • wzy-graphite
  • kushg
  • jacobgold
  • nicholasyan
  • tomasreimers
  • gregorymfoster