Refactoring
All checks were successful
Lint / lint (push) Successful in 11s

This commit is contained in:
Julien Valverdé
2024-06-16 04:12:28 +02:00
parent c5c0b5b952
commit 6fac7c7321
5 changed files with 57 additions and 50 deletions

View File

@@ -3,18 +3,16 @@ import type { Annotations, Struct } from "@effect/schema/Schema"
import type { HasFields } from "./util"
export function Class<Self>(identifier: string) {
return <Fields extends Struct.Fields>(
export const Class = S.Class as <Self>(identifier: string) =>
<Fields extends Struct.Fields>(
fieldsOr: Fields | HasFields<Fields>,
annotations?: Annotations.Schema<Self>,
) =>
S.Class<Self>(identifier)(fieldsOr, annotations) as S.Class<
Self,
Fields,
Struct.Encoded<Fields>,
Struct.Context<Fields>,
Struct.Constructor<Fields>,
{},
{}
>
}
) => S.Class<
Self,
Fields,
Struct.Encoded<Fields>,
Struct.Context<Fields>,
Struct.Constructor<Fields>,
{},
{}
>