0.3.2 • Published 10 months ago

api-typify v0.3.2

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

Examples

// api.ts
const routes = {
  GET: {
    "/users/{id}": {
      req: undefined, // Requests body type
      res: User, // Response type
    },
  },
};

const api = getAPI<typeof routes>(
  "https://api.example.com",
  fetch,
);

// Get's the user object
const user = await api.get("/users/{id}", {
  params: {
    id: "123",
  },
});
0.3.2

10 months ago

0.3.1

10 months ago

0.3.0

10 months ago

0.2.3

10 months ago

0.2.2

10 months ago

0.2.1

10 months ago

0.2.0

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago