0.3.2 • Published 2 years ago

api-typify v0.3.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years 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

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago