From d8cc097b1e830217df22eee7192cd4ebec4ab2ae Mon Sep 17 00:00:00 2001 From: Tylor Steinberger Date: Thu, 29 Feb 2024 15:22:51 -0500 Subject: [PATCH] chore: update docs --- docs/fx/Fx.ts.md | 94 +++++++++++++++++++++++++++++++- docs/fx/RefSubject.ts.md | 2 +- docs/path/Interpolate.ts.md | 5 +- docs/path/ParamsOf.ts.md | 3 +- docs/router/CurrentRoute.ts.md | 2 +- docs/template/EventHandler.ts.md | 2 +- packages/path/src/Interpolate.ts | 2 +- packages/path/src/ParamsOf.ts | 3 +- 8 files changed, 102 insertions(+), 11 deletions(-) diff --git a/docs/fx/Fx.ts.md b/docs/fx/Fx.ts.md index ee263752f..c8faa3366 100644 --- a/docs/fx/Fx.ts.md +++ b/docs/fx/Fx.ts.md @@ -54,7 +54,9 @@ Added in v1.20.0 - [toEffect (method)](#toeffect-method) - [KeyedOptions (interface)](#keyedoptions-interface) - [MatchCauseOptions (type alias)](#matchcauseoptions-type-alias) + - [MatchCauseOptionsEffect (type alias)](#matchcauseoptionseffect-type-alias) - [MatchErrorOptions (type alias)](#matcherroroptions-type-alias) + - [MatchErrorOptionsEffect (type alias)](#matcherroroptionseffect-type-alias) - [Success (type alias)](#success-type-alias-1) - [Unify (type alias)](#unify-type-alias-1) - [WithKeyOptions (interface)](#withkeyoptions-interface) @@ -198,6 +200,8 @@ Added in v1.20.0 - [periodic](#periodic) - [prepend](#prepend) - [prependAll](#prependall) + - [promise](#promise) + - [promiseFx](#promisefx) - [provide](#provide) - [provideContext](#providecontext) - [provideLayer](#providelayer) @@ -227,7 +231,9 @@ Added in v1.20.0 - [switchMapEffect](#switchmapeffect) - [switchMapError](#switchmaperror) - [switchMatchCause](#switchmatchcause) + - [switchMatchCauseEffect](#switchmatchcauseeffect) - [switchMatchError](#switchmatcherror) + - [switchMatchErrorEffect](#switchmatcherroreffect) - [sync](#sync) - [take](#take) - [takeUntiEffect](#takeuntieffect) @@ -719,6 +725,20 @@ export type MatchCauseOptions = { Added in v1.20.0 +## MatchCauseOptionsEffect (type alias) + +**Signature** + +```ts +export type MatchCauseOptionsEffect = { + readonly onFailure: (cause: Cause.Cause) => Effect.Effect + readonly onSuccess: (a: A) => Effect.Effect + readonly executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined +} +``` + +Added in v1.20.0 + ## MatchErrorOptions (type alias) **Signature** @@ -733,6 +753,20 @@ export type MatchErrorOptions = { Added in v1.20.0 +## MatchErrorOptionsEffect (type alias) + +**Signature** + +```ts +export type MatchErrorOptionsEffect = { + readonly onFailure: (e: E) => Effect.Effect + readonly onSuccess: (a: A) => Effect.Effect + readonly executionStrategy?: ExecutionStrategy.ExecutionStrategy | undefined +} +``` + +Added in v1.20.0 + ## Success (type alias) **Signature** @@ -2507,7 +2541,7 @@ export declare const matchError: { ): (fx: Fx) => Fx ( fx: Fx, - opts: core.MatchErrorOptions + opts: MatchErrorOptions ): Fx } ``` @@ -2878,6 +2912,26 @@ export declare const prependAll: { Added in v1.20.0 +## promise + +**Signature** + +```ts +export declare function promise(f: (signal: AbortSignal) => Promise) +``` + +Added in v2.0.0 + +## promiseFx + +**Signature** + +```ts +export declare function promiseFx(f: (signal: AbortSignal) => Promise>) +``` + +Added in v2.0.0 + ## provide **Signature** @@ -3299,6 +3353,24 @@ export declare const switchMatchCause: { Added in v1.20.0 +## switchMatchCauseEffect + +**Signature** + +```ts +export declare const switchMatchCauseEffect: { + ( + opts: MatchCauseOptionsEffect + ): (fx: Fx) => Fx + ( + fx: Fx, + opts: MatchCauseOptionsEffect + ): Fx +} +``` + +Added in v2.0.0 + ## switchMatchError **Signature** @@ -3310,13 +3382,31 @@ export declare const switchMatchError: { ): (fx: Fx) => Fx ( fx: Fx, - opts: core.MatchErrorOptions + opts: MatchErrorOptions ): Fx } ``` Added in v1.20.0 +## switchMatchErrorEffect + +**Signature** + +```ts +export declare const switchMatchErrorEffect: { + ( + opts: MatchErrorOptionsEffect + ): (fx: Fx) => Fx + ( + fx: Fx, + opts: MatchErrorOptionsEffect + ): Fx +} +``` + +Added in v2.0.0 + ## sync **Signature** diff --git a/docs/fx/RefSubject.ts.md b/docs/fx/RefSubject.ts.md index ad34cc405..03e260121 100644 --- a/docs/fx/RefSubject.ts.md +++ b/docs/fx/RefSubject.ts.md @@ -1022,7 +1022,7 @@ Added in v1.20.0 **Signature** ```ts -export declare function tagged( +export declare function tagged( replay?: number ): { >(identifier: I): RefSubject.Tagged, E, A> diff --git a/docs/path/Interpolate.ts.md b/docs/path/Interpolate.ts.md index 4f1148f06..7f419f53c 100644 --- a/docs/path/Interpolate.ts.md +++ b/docs/path/Interpolate.ts.md @@ -28,9 +28,8 @@ Interpolate a path with parameters **Signature** ```ts -export type Interpolate

> = PathJoin< - InterpolateParts>, Params> -> +export type Interpolate

> = + A.Equals<[P], [string]> extends 1 ? string : PathJoin>, Params>> ``` Added in v1.0.0 diff --git a/docs/path/ParamsOf.ts.md b/docs/path/ParamsOf.ts.md index 93e14e549..132c117d7 100644 --- a/docs/path/ParamsOf.ts.md +++ b/docs/path/ParamsOf.ts.md @@ -28,7 +28,8 @@ Extract the parameters from a path **Signature** ```ts -export type ParamsOf = ToParams>> +export type ParamsOf = + A.Equals<[T], [string]> extends 1 ? {} : ToParams>> ``` Added in v1.0.0 diff --git a/docs/router/CurrentRoute.ts.md b/docs/router/CurrentRoute.ts.md index fbaf5ba31..33494a5ca 100644 --- a/docs/router/CurrentRoute.ts.md +++ b/docs/router/CurrentRoute.ts.md @@ -36,7 +36,7 @@ Added in v1.0.0 ```ts export declare const CurrentParams: RefSubject.Filtered< - Readonly>, + Readonly>, never, CurrentRoute | Navigation > diff --git a/docs/template/EventHandler.ts.md b/docs/template/EventHandler.ts.md index 91836d30b..96927167a 100644 --- a/docs/template/EventHandler.ts.md +++ b/docs/template/EventHandler.ts.md @@ -109,7 +109,7 @@ Added in v1.0.0 **Signature** ```ts -export declare function make( +export declare function make( handler: (event: Ev) => Effect, options?: AddEventListenerOptions ): EventHandler diff --git a/packages/path/src/Interpolate.ts b/packages/path/src/Interpolate.ts index adcf8a2c8..3bcadda0c 100644 --- a/packages/path/src/Interpolate.ts +++ b/packages/path/src/Interpolate.ts @@ -25,7 +25,7 @@ import type { PathJoin } from "./PathJoin.js" * Interpolate a path with parameters * @since 1.0.0 */ -export type Interpolate

> = A.Equals extends 1 ? string : +export type Interpolate

> = A.Equals<[P], [string]> extends 1 ? string : PathJoin< InterpolateParts< ParseSegments>, diff --git a/packages/path/src/ParamsOf.ts b/packages/path/src/ParamsOf.ts index 5c37a371a..1b11f8dfb 100644 --- a/packages/path/src/ParamsOf.ts +++ b/packages/path/src/ParamsOf.ts @@ -25,7 +25,8 @@ import type { * Extract the parameters from a path * @since 1.0.0 */ -export type ParamsOf = A.Equals extends 1 ? {} : ToParams>> +export type ParamsOf = A.Equals<[T], [string]> extends 1 ? {} + : ToParams>> type ToParams, Params = {}> = [ // @ts-expect-error Type potentially infinite