Skip to content

Commit

Permalink
added discit-types dev dep
Browse files Browse the repository at this point in the history
  • Loading branch information
cdleveille committed Jun 8, 2024
1 parent 30c0075 commit 2f7e1e3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 30 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@types/node": "^20",
"@types/react": "npm:types-react@rc",
"@types/react-dom": "npm:types-react-dom@rc",
"discit-types": "^1.0.0",
"eslint": "^8",
"eslint-config-next": "15.0.0-rc.0",
"prettier": "^3.3.1",
Expand Down
31 changes: 4 additions & 27 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import type { Dispatch, SetStateAction } from "react";
import type * as shared from "discit-types";

import { View } from "@constants";

export type Disc = shared.Disc;
export type Bag = shared.Bag;

export * from "./request";
export * from "./props";

Expand All @@ -12,33 +16,6 @@ export type Config = {

export type ViewOption = `${View}`;

export type Disc = {
id: string;
name: string;
brand: string;
category: string;
speed: string;
glide: string;
turn: string;
fade: string;
stability: string;
link: string;
pic: string;
name_slug: string;
brand_slug: string;
category_slug: string;
stability_slug: string;
color: string;
background_color: string;
};

export type Bag = {
id: string;
name: string;
user_id: string;
discs: string[];
};

export type AppContext = {
discs: Disc[];
setDiscs: Dispatch<SetStateAction<Disc[]>>;
Expand Down
6 changes: 3 additions & 3 deletions src/types/request.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { RequestMethod } from "@constants";

import type * as shared from "discit-types";

export type RequestParams = {
path: string;
method: RequestMethodOption;
Expand Down Expand Up @@ -43,6 +45,4 @@ export type ApiErrorUnknown = {
error?: unknown;
};

export type ApiError = {
error?: string;
};
export type ApiError = shared.ApiError;

0 comments on commit 2f7e1e3

Please sign in to comment.