Work
This commit is contained in:
20
src/effect/schema/class/Class.ts
Normal file
20
src/effect/schema/class/Class.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Schema as S } from "@effect/schema"
|
||||
import type { Annotations, Struct } from "@effect/schema/Schema"
|
||||
import type { HasFields } from "./util"
|
||||
|
||||
|
||||
export function Class<Self>(identifier: string) {
|
||||
return <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>,
|
||||
{},
|
||||
{}
|
||||
>
|
||||
}
|
||||
Reference in New Issue
Block a user