Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/clean up unused imports and types #62

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/errors.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { serialize, deserialize } from 'superjson'

export class EdenFetchError<
Status extends number = number,
Value = unknown
Expand Down
5 changes: 0 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
import type { Elysia } from 'elysia'

import type { EdenTreaty } from './treaty'
import type { EdenFetch } from './fetch'

export { edenTreaty } from './treaty'
export { edenFetch } from './fetch'
18 changes: 1 addition & 17 deletions src/treaty/types.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
/// <reference lib="dom" />
import type { Elysia } from 'elysia'
import type { EdenWS } from './index'
import type {
IsUnknown,
IsNever,
IsAny,
UnionToIntersect,
MapError
} from '../types'
import type { IsUnknown, IsNever, UnionToIntersect, MapError } from '../types'
import type { EdenFetchError } from '../errors'

type Files = File | FileList
Expand All @@ -30,10 +24,6 @@ type Split<S extends string> = S extends `${infer Head}/${infer Tail}`
? [Head]
: [S]

type Prettify<T> = {
[K in keyof T]: T[K]
} & {}

type AnySchema = {
body: unknown
headers: unknown
Expand All @@ -52,12 +42,6 @@ export namespace EdenTreaty {
? UnionToIntersect<Sign<Schema>>
: 'Please install Elysia before using Eden'

type SplitKeys<T> = T extends [infer First, ...infer Rest]
? [First, Rest]
: T extends [infer First, ...infer Rest][number]
? [First, Rest]
: never

type UnwrapPromise<T> = T extends Promise<infer A> ? A : T

export type Transform<T = unknown> = MaybeArray<
Expand Down