0.1.0 #1

Merged
Thilawyn merged 81 commits from next into master 2025-07-17 21:17:57 +02:00
Showing only changes of commit 450ace94c9 - Show all commits

View File

@@ -179,14 +179,93 @@ export namespace make {
i: (_: H, props: NoInfer<P>) => Effect.Effect<React.ReactNode, EOut, ROut>, i: (_: H, props: NoInfer<P>) => Effect.Effect<React.ReactNode, EOut, ROut>,
): Component<EOut, ROut, P> ): Component<EOut, ROut, P>
} }
export type NonGen = {
<Eff extends Effect.Effect<React.ReactNode, any, any>, P extends {} = {}>(
body: (props: P) => Eff
): Component<Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>, P>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => Eff,
): Component<Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>, P>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => B,
b: (_: B, props: NoInfer<P>) => Eff,
): Component<Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>, P>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => B,
b: (_: B, props: NoInfer<P>) => C,
c: (_: C, props: NoInfer<P>) => Eff,
): Component<Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>, P>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => B,
b: (_: B, props: NoInfer<P>) => C,
c: (_: C, props: NoInfer<P>) => D,
d: (_: D, props: NoInfer<P>) => Eff,
): Component<Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>, P>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => B,
b: (_: B, props: NoInfer<P>) => C,
c: (_: C, props: NoInfer<P>) => D,
d: (_: D, props: NoInfer<P>) => E,
e: (_: E, props: NoInfer<P>) => Eff,
): Component<Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>, P>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, F, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => B,
b: (_: B, props: NoInfer<P>) => C,
c: (_: C, props: NoInfer<P>) => D,
d: (_: D, props: NoInfer<P>) => E,
e: (_: E, props: NoInfer<P>) => F,
f: (_: F, props: NoInfer<P>) => Eff,
): Component<Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>, P>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, F, G, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => B,
b: (_: B, props: NoInfer<P>) => C,
c: (_: C, props: NoInfer<P>) => D,
d: (_: D, props: NoInfer<P>) => E,
e: (_: E, props: NoInfer<P>) => F,
f: (_: F, props: NoInfer<P>) => G,
g: (_: G, props: NoInfer<P>) => Eff,
): Component<Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>, P>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, F, G, H, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => B,
b: (_: B, props: NoInfer<P>) => C,
c: (_: C, props: NoInfer<P>) => D,
d: (_: D, props: NoInfer<P>) => E,
e: (_: E, props: NoInfer<P>) => F,
f: (_: F, props: NoInfer<P>) => G,
g: (_: G, props: NoInfer<P>) => H,
h: (_: H, props: NoInfer<P>) => Eff,
): Component<Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>, P>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, F, G, H, I, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => B,
b: (_: B, props: NoInfer<P>) => C,
c: (_: C, props: NoInfer<P>) => D,
d: (_: D, props: NoInfer<P>) => E,
e: (_: E, props: NoInfer<P>) => F,
f: (_: F, props: NoInfer<P>) => G,
g: (_: G, props: NoInfer<P>) => H,
h: (_: H, props: NoInfer<P>) => I,
i: (_: I, props: NoInfer<P>) => Eff,
): Component<Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>, P>
}
} }
export const make: ( export const make: (
& make.Gen & make.Gen
& make.NonGen
& (( & ((
spanName: string, spanName: string,
spanOptions?: Tracer.SpanOptions, spanOptions?: Tracer.SpanOptions,
) => make.Gen) ) => make.Gen & make.NonGen)
) = (spanNameOrBody: Function | string, ...pipeables: any[]) => { ) = (spanNameOrBody: Function | string, ...pipeables: any[]) => {
if (typeof spanNameOrBody !== "string") { if (typeof spanNameOrBody !== "string") {
const displayName = displayNameFromBody(spanNameOrBody) const displayName = displayNameFromBody(spanNameOrBody)
@@ -208,7 +287,7 @@ export const make: (
} }
} }
export const makeUntraced: make.Gen = (body: Function, ...pipeables: any[]) => Object.setPrototypeOf({ export const makeUntraced: make.Gen & make.NonGen = (body: Function, ...pipeables: any[]) => Object.setPrototypeOf({
body: Effect.fnUntraced(body as any, ...pipeables as []), body: Effect.fnUntraced(body as any, ...pipeables as []),
displayName: displayNameFromBody(body), displayName: displayNameFromBody(body),
options: { ...defaultOptions }, options: { ...defaultOptions },