@sjcx/vorma 0.0.0-pre.2 → 0.0.0-pre.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/assemble-artifacts.d.ts +1 -1
- package/dist/build/bundle-client.d.ts +1 -1
- package/dist/build/cli.js +53 -44
- package/dist/build/compile-application.d.ts +2 -2
- package/dist/build/development-artifacts.d.ts +1 -1
- package/dist/build/development-build.d.ts +3 -6
- package/dist/build/development-server-process.d.ts +3 -3
- package/dist/build/development-work.d.ts +4 -3
- package/dist/build/generate-application.d.ts +4 -4
- package/dist/build/index.d.ts +2 -3
- package/dist/build/index.js +1 -1
- package/dist/build/inspect-projects.d.ts +3 -3
- package/dist/build/load-config.d.ts +17 -16
- package/dist/build/publish-artifacts.d.ts +1 -4
- package/dist/build/render-client-transport.d.ts +1 -1
- package/dist/build/render-server-generated.d.ts +1 -12
- package/dist/build/render-types.d.ts +1 -1
- package/dist/build/resolve-config.d.ts +6 -9
- package/dist/build/source-layout.d.ts +2 -2
- package/dist/build/typescript-projects.d.ts +5 -0
- package/dist/{build-DcP5_DUV.js → build-BeUTL6eX.js} +104 -301
- package/package.json +5 -36
- package/dist/build/compile-server.d.ts +0 -42
- package/dist/client/assembly.d.ts +0 -40
- package/dist/client/browser-http-client.d.ts +0 -10
- package/dist/client/client-loaders.d.ts +0 -93
- package/dist/client/commit.d.ts +0 -41
- package/dist/client/contracts.d.ts +0 -192
- package/dist/client/core.d.ts +0 -45
- package/dist/client/development.d.ts +0 -16
- package/dist/client/document-recovery.d.ts +0 -4
- package/dist/client/endpoints.d.ts +0 -54
- package/dist/client/errors.d.ts +0 -87
- package/dist/client/freshness.d.ts +0 -51
- package/dist/client/head.d.ts +0 -14
- package/dist/client/history.d.ts +0 -25
- package/dist/client/index.d.ts +0 -80
- package/dist/client/index.js +0 -150
- package/dist/client/links.d.ts +0 -48
- package/dist/client/materialize.d.ts +0 -21
- package/dist/client/modules.d.ts +0 -2
- package/dist/client/navigation.d.ts +0 -47
- package/dist/client/payload.d.ts +0 -54
- package/dist/client/prefetch.d.ts +0 -28
- package/dist/client/prepare.d.ts +0 -47
- package/dist/client/projections.d.ts +0 -26
- package/dist/client/queries.d.ts +0 -33
- package/dist/client/react/application.d.ts +0 -87
- package/dist/client/react/hooks.d.ts +0 -36
- package/dist/client/react/index.d.ts +0 -5
- package/dist/client/react/index.js +0 -3237
- package/dist/client/react/link.d.ts +0 -27
- package/dist/client/react/view.d.ts +0 -86
- package/dist/client/request.d.ts +0 -16
- package/dist/client/route-context.d.ts +0 -31
- package/dist/client/route-matching.d.ts +0 -22
- package/dist/client/route-synchronization.d.ts +0 -30
- package/dist/client/route-url.d.ts +0 -5
- package/dist/client/runtime.d.ts +0 -82
- package/dist/client/scroll.d.ts +0 -16
- package/dist/client/services.d.ts +0 -34
- package/dist/client/state.d.ts +0 -102
- package/dist/client/static-assets.d.ts +0 -3
- package/dist/client/stylesheets.d.ts +0 -7
- package/dist/client/transport-type-entries.d.ts +0 -2
- package/dist/client/types.d.ts +0 -152
- package/dist/client/view-definition.d.ts +0 -24
- package/dist/client/work-indicator.d.ts +0 -18
- package/dist/compile-Me8EOyMK.js +0 -870
- package/dist/development-B_rxuwY7.js +0 -128
- package/dist/hash-set-BPx3iXec.js +0 -141
- package/dist/href-Cqyax8Y0.js +0 -357
- package/dist/materialize-DZ7VSLFk.js +0 -739
- package/dist/metadata-BoPKo-G2.js +0 -32
- package/dist/primitives/tasks/index.d.ts +0 -1
- package/dist/primitives/tasks/index.js +0 -1
- package/dist/route-context-CtY_9U_W.js +0 -559
- package/dist/route-matching-D_uSG2P9.js +0 -33
- package/dist/search-parse-0f7oqVsG.js +0 -375
- package/dist/server/config/index.d.ts +0 -36
- package/dist/server/config/index.js +0 -30
- package/dist/server/development/metadata.d.ts +0 -11
- package/dist/server/document.d.ts +0 -37
- package/dist/server/form-data.d.ts +0 -21
- package/dist/server/graph/compile.d.ts +0 -118
- package/dist/server/graph/declarations.d.ts +0 -117
- package/dist/server/graph/literal-error-tag.d.ts +0 -14
- package/dist/server/graph/pattern-conflicts.d.ts +0 -36
- package/dist/server/graph/search-schema.d.ts +0 -13
- package/dist/server/graph/transport-schema.d.ts +0 -11
- package/dist/server/index.d.ts +0 -310
- package/dist/server/index.js +0 -2311
- package/dist/server/public-assets.d.ts +0 -18
- package/dist/server/runtime/application.d.ts +0 -15
- package/dist/server/runtime/assets.d.ts +0 -15
- package/dist/server/runtime/context.d.ts +0 -96
- package/dist/server/runtime/domain-errors.d.ts +0 -11
- package/dist/server/runtime/effects.d.ts +0 -83
- package/dist/server/runtime/execute.d.ts +0 -13
- package/dist/server/runtime/finalize.d.ts +0 -44
- package/dist/server/runtime/handler.d.ts +0 -106
- package/dist/server/runtime/head.d.ts +0 -22
- package/dist/server/runtime/payload.d.ts +0 -50
- package/dist/server/runtime/pipeline.d.ts +0 -27
- package/dist/server/runtime/plan.d.ts +0 -98
- package/dist/server/runtime/render-document.d.ts +0 -16
- package/dist/server/runtime/startup-error.d.ts +0 -11
- package/dist/server/runtime/transport-type-entries.d.ts +0 -2
- package/dist/server/runtime/vercel-deployment.d.ts +0 -2
- package/dist/server/url-pathname.d.ts +0 -13
- package/dist/static-assets-BrH3O0M8.js +0 -199
- package/dist/universal/generated-types.d.ts +0 -9
- package/dist/universal/href.d.ts +0 -17
- package/dist/universal/http-method.d.ts +0 -4
- package/dist/universal/json-transport.d.ts +0 -14
- package/dist/universal/null-prototype-record.d.ts +0 -7
- package/dist/universal/path-wire.d.ts +0 -71
- package/dist/universal/pattern-language.d.ts +0 -4
- package/dist/universal/protocol-schemas.d.ts +0 -99
- package/dist/universal/protocol.d.ts +0 -162
- package/dist/universal/search-grammar.d.ts +0 -7
- package/dist/universal/search-parse.d.ts +0 -22
- package/dist/universal/search-serialize.d.ts +0 -16
- package/dist/universal/search-shape.d.ts +0 -32
- package/dist/universal/static-assets.d.ts +0 -2
- package/dist/universal/transport-types/big-decimal.d.ts +0 -13
- package/dist/universal/transport-types/chunk.d.ts +0 -8
- package/dist/universal/transport-types/date-time-utc.d.ts +0 -13
- package/dist/universal/transport-types/date-time-zoned.d.ts +0 -13
- package/dist/universal/transport-types/duration.d.ts +0 -13
- package/dist/universal/transport-types/hash-map.d.ts +0 -8
- package/dist/universal/transport-types/hash-set.d.ts +0 -8
- package/dist/universal/transport-types/option.d.ts +0 -10
- package/dist/universal/transport-types/redacted.d.ts +0 -9
- package/dist/universal/value-transport.d.ts +0 -117
- package/dist/value-transport-Bst4Hk-n.js +0 -864
- /package/dist/{universal → build}/content-digest.d.ts +0 -0
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { type ComponentProps, type JSX, type ReactNode } from "react";
|
|
2
|
-
import type { NavigationTargetInput } from "../contracts.ts";
|
|
3
|
-
import { type LinkMatchRules, type LinkState } from "../links.ts";
|
|
4
|
-
import type { NavigationOptions } from "../types.ts";
|
|
5
|
-
export type LinkBehaviorProps = {
|
|
6
|
-
readonly prefetch?: "intent" | "none";
|
|
7
|
-
readonly prefetchDelayMs?: number;
|
|
8
|
-
readonly visitOnPointerDown?: boolean;
|
|
9
|
-
/** Search and fragment comparisons are opt-in; pathname matching is automatic. */
|
|
10
|
-
readonly matchRules?: LinkMatchRules;
|
|
11
|
-
readonly replace?: NavigationOptions["replace"];
|
|
12
|
-
readonly scrollToTop?: NavigationOptions["scrollToTop"];
|
|
13
|
-
readonly scrollToFragment?: NavigationOptions["scrollToFragment"];
|
|
14
|
-
readonly historyState?: unknown;
|
|
15
|
-
readonly skipWorkIndicator?: boolean;
|
|
16
|
-
};
|
|
17
|
-
export type DefaultLinkProps = Partial<LinkBehaviorProps & Omit<ComponentProps<"a">, "href">>;
|
|
18
|
-
export type LinkProps = NavigationTargetInput & LinkBehaviorProps & Omit<ComponentProps<"a">, "href"> & {
|
|
19
|
-
readonly children?: ReactNode;
|
|
20
|
-
};
|
|
21
|
-
/** The active and pending facts of a target under its match rules; an invalid target follows the applicable route boundary. */
|
|
22
|
-
export declare function useLinkState(input: NavigationTargetInput & {
|
|
23
|
-
readonly matchRules?: LinkMatchRules;
|
|
24
|
-
}): LinkState;
|
|
25
|
-
declare function LinkComponent(rawProps: LinkProps): JSX.Element;
|
|
26
|
-
export declare const Link: import("react").MemoExoticComponent<typeof LinkComponent>;
|
|
27
|
-
export {};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { type Effect, type Layer } from "effect";
|
|
2
|
-
import type { Atom } from "effect/unstable/reactivity";
|
|
3
|
-
import { type ComponentType, type JSX } from "react";
|
|
4
|
-
import type { ClientLoaderContext, RoutePattern } from "../contracts.ts";
|
|
5
|
-
import { type RouteContext } from "../route-context.ts";
|
|
6
|
-
import { clientRuntime, universalRuntime, type ClientCoordinatorService } from "../runtime.ts";
|
|
7
|
-
import type { BoundaryError } from "../types.ts";
|
|
8
|
-
import type { RouteTransitionFn, ViewDefinition } from "../view-definition.ts";
|
|
9
|
-
import type { DefaultLinkProps } from "./link.tsx";
|
|
10
|
-
declare const UI_VIEW_TYPES: unique symbol;
|
|
11
|
-
export type ApplicationContext = {
|
|
12
|
-
readonly coordinator: ClientCoordinatorService;
|
|
13
|
-
readonly defaultErrorBoundary: ComponentType<{
|
|
14
|
-
readonly error: BoundaryError;
|
|
15
|
-
}>;
|
|
16
|
-
readonly defaultLinkProps: DefaultLinkProps | undefined;
|
|
17
|
-
};
|
|
18
|
-
export declare const ApplicationProvider: import("react").Provider<ApplicationContext | null>;
|
|
19
|
-
/** The mounted application. A Vorma component outside one cannot work, and React's protocol for that is a throw to the caller. */
|
|
20
|
-
export declare function useApplication(): ApplicationContext;
|
|
21
|
-
export type UiViewClientLoaderContract<Success = unknown, Error = unknown, Requirements = unknown> = {
|
|
22
|
-
readonly success: Success;
|
|
23
|
-
readonly error: Error;
|
|
24
|
-
readonly requirements: Requirements;
|
|
25
|
-
};
|
|
26
|
-
type OptionalClientLoaderContract = UiViewClientLoaderContract | undefined;
|
|
27
|
-
type RuntimeServices<Runtime> = Runtime extends Atom.AtomRuntime<infer Services, unknown> ? Services : never;
|
|
28
|
-
/** A route's runtime: the application runtime's services plus the view's local Layers. */
|
|
29
|
-
export type RouteRuntime<Base, LocalServices, LocalError> = Base extends Atom.AtomRuntime<infer Services, infer Error> ? Atom.AtomRuntime<Services | LocalServices, Error | LocalError> : never;
|
|
30
|
-
export type ViewProps<Pattern extends string = RoutePattern, ClientLoaderContract extends OptionalClientLoaderContract = OptionalClientLoaderContract, ClientOnlyServices = never, ClientOnlyServicesError = never, UniversalServices = never, UniversalServicesError = never> = RouteContext<Extract<Pattern, RoutePattern>> & {
|
|
31
|
-
readonly Outlet: ComponentType;
|
|
32
|
-
readonly clientRuntime: RouteRuntime<typeof clientRuntime, ClientOnlyServices | UniversalServices, ClientOnlyServicesError | UniversalServicesError>;
|
|
33
|
-
readonly universalRuntime: RouteRuntime<typeof universalRuntime, UniversalServices, UniversalServicesError>;
|
|
34
|
-
readonly [UI_VIEW_TYPES]?: {
|
|
35
|
-
readonly clientLoader: ClientLoaderContract;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
type ErrorBoundaryComponent = ComponentType<{
|
|
39
|
-
readonly error: BoundaryError;
|
|
40
|
-
}>;
|
|
41
|
-
export type UiViewDefinition<Pattern extends string = RoutePattern, ClientLoaderContract extends OptionalClientLoaderContract = undefined> = ViewDefinition & {
|
|
42
|
-
readonly pattern: Pattern;
|
|
43
|
-
readonly component: ComponentType<never>;
|
|
44
|
-
readonly descendantErrorBoundary?: ErrorBoundaryComponent;
|
|
45
|
-
readonly [UI_VIEW_TYPES]?: {
|
|
46
|
-
readonly clientLoader: ClientLoaderContract;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
/** The client-loader contract the generated declarations read from a view module. */
|
|
50
|
-
export type GetUiViewClientLoaderContract<Definition> = Definition extends UiViewDefinition<RoutePattern, infer ClientLoaderContract> ? ClientLoaderContract : undefined;
|
|
51
|
-
type ViewField<Definition, Key extends PropertyKey> = Key extends keyof Definition ? Exclude<Definition[Key], undefined> : never;
|
|
52
|
-
type ViewLayerServices<Value> = Value extends Layer.Layer<infer Services, unknown, unknown> ? Services : never;
|
|
53
|
-
type RequiredViewField<Definition, Key extends PropertyKey> = Key extends keyof Definition ? Definition extends {
|
|
54
|
-
readonly [Property in Key]: unknown;
|
|
55
|
-
} ? Definition[Key] : never : never;
|
|
56
|
-
type ViewHookRequirements<Value> = Value extends RouteTransitionFn<infer Requirements> ? Requirements : never;
|
|
57
|
-
/** Checks each authored definition's providers; an optional layer cannot guarantee a service. */
|
|
58
|
-
type MissingRouteTransitionServices<Definition> = Definition extends unknown ? Exclude<ViewHookRequirements<ViewField<Definition, "beforeRouteCommit" | "beforeRouteReplacement">>, RuntimeServices<typeof clientRuntime> | ViewLayerServices<RequiredViewField<Definition, "clientOnlyServices" | "universalServices">>> : never;
|
|
59
|
-
type RouteTransitionRequirementCheck<Definition> = [
|
|
60
|
-
MissingRouteTransitionServices<Definition>
|
|
61
|
-
] extends [never] ? unknown : {
|
|
62
|
-
readonly unsatisfiedRouteTransitionRequirement: never;
|
|
63
|
-
};
|
|
64
|
-
type UiViewOptions<Pattern extends string, ClientLoaderContract extends OptionalClientLoaderContract, ClientOnlyServices, ClientOnlyServicesError, UniversalServices, UniversalServicesError> = {
|
|
65
|
-
readonly pattern: Pattern;
|
|
66
|
-
readonly component: ComponentType<ViewProps<Pattern, ClientLoaderContract, ClientOnlyServices, ClientOnlyServicesError, UniversalServices, UniversalServicesError>>;
|
|
67
|
-
readonly descendantErrorBoundary?: ErrorBoundaryComponent;
|
|
68
|
-
readonly beforeRouteCommit?: RouteTransitionFn<unknown>;
|
|
69
|
-
readonly beforeRouteReplacement?: RouteTransitionFn<unknown>;
|
|
70
|
-
readonly reuseLoaderDataWithin?: ViewDefinition["reuseLoaderDataWithin"];
|
|
71
|
-
readonly rerunClientLoaderOnHotUpdate?: boolean;
|
|
72
|
-
readonly clientOnlyServices?: Layer.Layer<ClientOnlyServices, ClientOnlyServicesError, RuntimeServices<typeof clientRuntime> | UniversalServices>;
|
|
73
|
-
readonly universalServices?: Layer.Layer<UniversalServices, UniversalServicesError, RuntimeServices<typeof universalRuntime>>;
|
|
74
|
-
};
|
|
75
|
-
declare function makeUiView<Definition, const Pattern extends string, ClientLoaderSuccess, ClientLoaderError, ClientLoaderRequirements extends RuntimeServices<typeof clientRuntime> | NoInfer<ClientOnlyServices | UniversalServices>, ClientOnlyServices = never, ClientOnlyServicesError = never, UniversalServices = never, UniversalServicesError = never>(definition: Definition & RouteTransitionRequirementCheck<Definition> & UiViewOptions<Pattern, UiViewClientLoaderContract<ClientLoaderSuccess, ClientLoaderError, ClientLoaderRequirements>, ClientOnlyServices, ClientOnlyServicesError, UniversalServices, UniversalServicesError> & {
|
|
76
|
-
readonly clientLoader: (context: ClientLoaderContext<Extract<Pattern, RoutePattern>>) => Effect.Effect<ClientLoaderSuccess, ClientLoaderError, ClientLoaderRequirements>;
|
|
77
|
-
}): UiViewDefinition<Pattern, UiViewClientLoaderContract<ClientLoaderSuccess, ClientLoaderError, ClientLoaderRequirements>>;
|
|
78
|
-
declare function makeUiView<Definition, const Pattern extends string, ClientOnlyServices = never, ClientOnlyServicesError = never, UniversalServices = never, UniversalServicesError = never>(definition: Definition & RouteTransitionRequirementCheck<Definition> & UiViewOptions<Pattern, undefined, ClientOnlyServices, ClientOnlyServicesError, UniversalServices, UniversalServicesError> & {
|
|
79
|
-
readonly clientLoader?: never;
|
|
80
|
-
}): UiViewDefinition<Pattern>;
|
|
81
|
-
export declare const UiView: {
|
|
82
|
-
readonly make: typeof makeUiView;
|
|
83
|
-
};
|
|
84
|
-
/** The application boundary encloses every route. */
|
|
85
|
-
export declare function RootOutlet(): JSX.Element;
|
|
86
|
-
export {};
|
package/dist/client/request.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Effect, type Option } from "effect";
|
|
2
|
-
import type { HttpClientRequest } from "effect/unstable/http";
|
|
3
|
-
import type { OperationId, RequestKind } from "./types.ts";
|
|
4
|
-
/** The request and framework identity supplied to application request decoration. */
|
|
5
|
-
export type ClientRequestContext = {
|
|
6
|
-
readonly request: HttpClientRequest.HttpClientRequest;
|
|
7
|
-
readonly requestKind: RequestKind;
|
|
8
|
-
readonly operationId: Option.Option<OperationId>;
|
|
9
|
-
};
|
|
10
|
-
/** An application request decorator whose Effect may use assembled client services. */
|
|
11
|
-
export type PrepareRequestFn<Requirements = never> = (context: ClientRequestContext) => Effect.Effect<HttpClientRequest.HttpClientRequest, unknown, Requirements>;
|
|
12
|
-
/** Applies the application's request transformation before dispatch. */
|
|
13
|
-
export declare function prepareClientRequest<Requirements>(input: {
|
|
14
|
-
readonly context: ClientRequestContext;
|
|
15
|
-
readonly prepareRequestFn: PrepareRequestFn<Requirements> | undefined;
|
|
16
|
-
}): Effect.Effect<HttpClientRequest.HttpClientRequest, unknown, Requirements>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Option } from "effect";
|
|
2
|
-
import { Atom } from "effect/unstable/reactivity";
|
|
3
|
-
import type { ClientLoaderData, ClientLoaderState, ClientLoaderRoutePattern, LoaderData, LoaderRoutePattern, RouteMatch, RoutePattern } from "./contracts.ts";
|
|
4
|
-
import type { RouteEntry } from "./state.ts";
|
|
5
|
-
export declare const ROUTE_CONTEXT: unique symbol;
|
|
6
|
-
export type RouteContextMatch = {
|
|
7
|
-
readonly pattern: string;
|
|
8
|
-
readonly params: Readonly<Record<string, string>>;
|
|
9
|
-
readonly splatValues: ReadonlyArray<string>;
|
|
10
|
-
readonly input: unknown;
|
|
11
|
-
};
|
|
12
|
-
export type RouteContext<Pattern extends string> = {
|
|
13
|
-
readonly [ROUTE_CONTEXT]: {
|
|
14
|
-
readonly pattern: Pattern;
|
|
15
|
-
readonly index: number;
|
|
16
|
-
readonly loaderDataAtom: Atom.Atom<unknown>;
|
|
17
|
-
readonly clientLoaderDataAtom: Atom.Atom<unknown>;
|
|
18
|
-
readonly matchAtom: Atom.Atom<RouteContextMatch>;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
/** The route context of a view mounted at `index` for `entry`; its atoms follow that position while it holds the entry's pattern. */
|
|
22
|
-
export declare function createRouteContext(index: number, entry: RouteEntry): RouteContext<string>;
|
|
23
|
-
/** A stable native atom describing one pattern's committed server-loader data. */
|
|
24
|
-
export declare function getLoaderDataAtom<Pattern extends LoaderRoutePattern>(context: RouteContext<Pattern>): Atom.Atom<LoaderData<Pattern>>;
|
|
25
|
-
export declare function getLoaderDataAtom<Pattern extends LoaderRoutePattern>(pattern: Pattern): Atom.Atom<Option.Option<LoaderData<Pattern>>>;
|
|
26
|
-
/** A view reads its loaded value; a pattern read includes absence and failure states. */
|
|
27
|
-
export declare function getClientLoaderDataAtom<Pattern extends ClientLoaderRoutePattern>(context: RouteContext<Pattern>): Atom.Atom<ClientLoaderData<Pattern>>;
|
|
28
|
-
export declare function getClientLoaderDataAtom<Pattern extends ClientLoaderRoutePattern>(pattern: Pattern): Atom.Atom<Option.Option<ClientLoaderState<Pattern>>>;
|
|
29
|
-
/** A stable native atom describing one pattern's committed match facts. */
|
|
30
|
-
export declare function getRouteMatchAtom<Pattern extends RoutePattern>(context: RouteContext<Pattern>): Atom.Atom<RouteMatch<Pattern>>;
|
|
31
|
-
export declare function getRouteMatchAtom<Pattern extends RoutePattern>(pattern: Pattern): Atom.Atom<Option.Option<RouteMatch<Pattern>>>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type CompiledNestedPattern } from "@vorma/primitives/matcher";
|
|
2
|
-
import { Result } from "effect";
|
|
3
|
-
import type { SearchContractDocument } from "../universal/protocol-schemas.ts";
|
|
4
|
-
import { type SearchParamsError } from "../universal/search-parse.ts";
|
|
5
|
-
export type LearnedMatch<Value> = {
|
|
6
|
-
readonly value: Value;
|
|
7
|
-
readonly params: Readonly<Record<string, string>>;
|
|
8
|
-
readonly splatValues: ReadonlyArray<string>;
|
|
9
|
-
};
|
|
10
|
-
export type LearnedMatcher<Value> = {
|
|
11
|
-
/** The registrations a canonical path matches completely, outermost to innermost; null when it matches none, or a capture does not decode. */
|
|
12
|
-
readonly matchPath: (path: string) => ReadonlyArray<LearnedMatch<Value>> | null;
|
|
13
|
-
};
|
|
14
|
-
export declare function createLearnedMatcher<Value>(registrations: ReadonlyArray<{
|
|
15
|
-
readonly pattern: CompiledNestedPattern;
|
|
16
|
-
readonly value: Value;
|
|
17
|
-
}>): LearnedMatcher<Value>;
|
|
18
|
-
/** Parses a destination's search through the decoded contract structure, without validating its checks. */
|
|
19
|
-
export declare function parseSearch(input: {
|
|
20
|
-
readonly document: SearchContractDocument;
|
|
21
|
-
readonly searchParams: URLSearchParams;
|
|
22
|
-
}): Result.Result<unknown, SearchParamsError>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Effect, Result, Stream, type Duration } from "effect";
|
|
2
|
-
import type { RoutePattern, RouteTarget } from "./contracts.ts";
|
|
3
|
-
import { NavigationError, type InputError } from "./errors.ts";
|
|
4
|
-
import { ClientCoordinator, type ClientCoordinatorService } from "./runtime.ts";
|
|
5
|
-
import type { NavigationOptions } from "./types.ts";
|
|
6
|
-
export type RouteSynchronizationOptions<Pattern extends RoutePattern = RoutePattern, Error = never, Requirements = never> = {
|
|
7
|
-
readonly targets: Stream.Stream<RouteTarget<Pattern>, Error, Requirements>;
|
|
8
|
-
readonly debounceDelay?: Duration.Input;
|
|
9
|
-
readonly replace?: NavigationOptions["replace"];
|
|
10
|
-
readonly scrollToTop?: NavigationOptions["scrollToTop"];
|
|
11
|
-
readonly scrollToFragment?: NavigationOptions["scrollToFragment"];
|
|
12
|
-
readonly skipWorkIndicator?: boolean;
|
|
13
|
-
};
|
|
14
|
-
type ResolvedSynchronizationTarget = {
|
|
15
|
-
readonly href: string;
|
|
16
|
-
readonly navigationOptions: NavigationOptions;
|
|
17
|
-
};
|
|
18
|
-
export declare function runSynchronizationTarget(input: {
|
|
19
|
-
readonly coordinator: ClientCoordinatorService;
|
|
20
|
-
readonly target: ResolvedSynchronizationTarget;
|
|
21
|
-
readonly debounceDelay: Duration.Input | undefined;
|
|
22
|
-
}): Effect.Effect<void, NavigationError>;
|
|
23
|
-
export declare function readSynchronizationTarget(input: {
|
|
24
|
-
readonly coordinator: ClientCoordinatorService;
|
|
25
|
-
readonly href: Result.Result<string, InputError>;
|
|
26
|
-
readonly options: Pick<RouteSynchronizationOptions, "replace" | "scrollToTop" | "scrollToFragment" | "skipWorkIndicator">;
|
|
27
|
-
}): Effect.Effect<ResolvedSynchronizationTarget, NavigationError>;
|
|
28
|
-
/** Keeps a route synchronized with the latest target from a native Stream. */
|
|
29
|
-
export declare function synchronizeRoute<Pattern extends RoutePattern, Error = never, Requirements = never>(input: RouteSynchronizationOptions<Pattern, Error, Requirements>): Effect.Effect<void, Error | NavigationError, Requirements | ClientCoordinator>;
|
|
30
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Result } from "effect";
|
|
2
|
-
import type { NavigationTargetInput } from "./contracts.ts";
|
|
3
|
-
import { InputError } from "./errors.ts";
|
|
4
|
-
/** Returns a raw href unchanged or encodes a typed destination as an origin-relative URL. */
|
|
5
|
-
export declare function toHref(input: NavigationTargetInput): Result.Result<string, InputError>;
|
package/dist/client/runtime.d.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { Context, Effect, type Fiber, type Stream } from "effect";
|
|
2
|
-
import type { HttpClient } from "effect/unstable/http";
|
|
3
|
-
import { Atom, type AtomRegistry, type Reactivity } from "effect/unstable/reactivity";
|
|
4
|
-
import type { EndpointOperations } from "./endpoints.ts";
|
|
5
|
-
import type { ClientApplicationContracts } from "./index.ts";
|
|
6
|
-
import type { NavigationOwner } from "./navigation.ts";
|
|
7
|
-
import type { PrefetchOwner } from "./prefetch.ts";
|
|
8
|
-
import type { QueryOwner } from "./queries.ts";
|
|
9
|
-
import type { ClientEvent } from "./types.ts";
|
|
10
|
-
export type ClientUnavailableError = {
|
|
11
|
-
readonly _tag: "ClientUnavailableError";
|
|
12
|
-
};
|
|
13
|
-
export declare const CLIENT_UNAVAILABLE_ERROR: ClientUnavailableError;
|
|
14
|
-
declare const CLIENT_COORDINATOR: unique symbol;
|
|
15
|
-
/** The mounted browser application's Effect requirement. */
|
|
16
|
-
export type ClientCoordinator = {
|
|
17
|
-
readonly [CLIENT_COORDINATOR]: true;
|
|
18
|
-
};
|
|
19
|
-
export type ClientCoordinatorService = {
|
|
20
|
-
readonly trackWork: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
21
|
-
readonly registry: AtomRegistry.AtomRegistry;
|
|
22
|
-
readonly events: Stream.Stream<ClientEvent>;
|
|
23
|
-
readonly publishEvent: (event: ClientEvent) => void;
|
|
24
|
-
readonly navigation: NavigationOwner;
|
|
25
|
-
readonly prefetch: PrefetchOwner;
|
|
26
|
-
readonly endpoints: EndpointOperations;
|
|
27
|
-
readonly queries: QueryOwner;
|
|
28
|
-
/** Forks application-owned work into the application scope. */
|
|
29
|
-
readonly fork: <A, E>(effect: Effect.Effect<A, E>) => Fiber.Fiber<A, E>;
|
|
30
|
-
/** Admits a render failure into route error metadata when it belongs to the committed render. */
|
|
31
|
-
readonly reportRenderFailure: (input: {
|
|
32
|
-
readonly index: number | undefined;
|
|
33
|
-
readonly pattern: string | undefined;
|
|
34
|
-
readonly revision: number;
|
|
35
|
-
readonly error: unknown;
|
|
36
|
-
}) => void;
|
|
37
|
-
};
|
|
38
|
-
export declare const ClientCoordinator: Context.Service<ClientCoordinator, ClientCoordinatorService>;
|
|
39
|
-
/** Services acquired by the browser application and available to client computations. */
|
|
40
|
-
export type FrameworkClientServices = ClientCoordinator | AtomRegistry.AtomRegistry | Reactivity.Reactivity | HttpClient.HttpClient;
|
|
41
|
-
type RegisteredClientServices = ClientApplicationContracts extends {
|
|
42
|
-
readonly clientOnlyServices: {
|
|
43
|
-
readonly services: infer ClientOnlyServices;
|
|
44
|
-
readonly error: infer ClientOnlyServicesError;
|
|
45
|
-
};
|
|
46
|
-
readonly universalServices: {
|
|
47
|
-
readonly services: infer UniversalServices;
|
|
48
|
-
readonly error: infer UniversalServicesError;
|
|
49
|
-
};
|
|
50
|
-
} ? {
|
|
51
|
-
readonly services: FrameworkClientServices | ClientOnlyServices | UniversalServices;
|
|
52
|
-
readonly error: ClientUnavailableError | ClientOnlyServicesError | UniversalServicesError;
|
|
53
|
-
} : {
|
|
54
|
-
readonly services: FrameworkClientServices;
|
|
55
|
-
readonly error: ClientUnavailableError;
|
|
56
|
-
};
|
|
57
|
-
type RegisteredUniversalServices = ClientApplicationContracts extends {
|
|
58
|
-
readonly universalServices: {
|
|
59
|
-
readonly services: infer Services;
|
|
60
|
-
};
|
|
61
|
-
} ? Services : never;
|
|
62
|
-
type RegisteredUniversalServicesError = ClientApplicationContracts extends {
|
|
63
|
-
readonly universalServices: {
|
|
64
|
-
readonly error: infer Error;
|
|
65
|
-
};
|
|
66
|
-
} ? Error | ClientUnavailableError : ClientUnavailableError;
|
|
67
|
-
/** The contexts one mounted application assembled once; both runtimes read them. */
|
|
68
|
-
export type ApplicationContexts = {
|
|
69
|
-
readonly universal: Context.Context<never>;
|
|
70
|
-
readonly client: Context.Context<never>;
|
|
71
|
-
};
|
|
72
|
-
export declare function publishApplicationContexts(input: {
|
|
73
|
-
readonly registry: AtomRegistry.AtomRegistry;
|
|
74
|
-
readonly contexts: ApplicationContexts;
|
|
75
|
-
}): void;
|
|
76
|
-
/** Browser operations and both service groups. Asynchronous computations stay Initial before boot. */
|
|
77
|
-
export declare const clientRuntime: Atom.AtomRuntime<RegisteredClientServices["services"], RegisteredClientServices["error"]>;
|
|
78
|
-
/** Provides only the application's universal service group. */
|
|
79
|
-
export declare const universalRuntime: Atom.AtomRuntime<RegisteredUniversalServices, RegisteredUniversalServicesError>;
|
|
80
|
-
/** Runs an Effect with the mounted application's client context. */
|
|
81
|
-
export declare function provideClientContext<A, E>(contexts: ApplicationContexts, effect: Effect.Effect<A, E, unknown>): Effect.Effect<A, E>;
|
|
82
|
-
export {};
|
package/dist/client/scroll.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Result } from "effect";
|
|
2
|
-
/** A target scroll: a coordinate pair, or a fragment whose element scrolls into view. */
|
|
3
|
-
export type ScrollTarget = {
|
|
4
|
-
readonly x: number;
|
|
5
|
-
readonly y: number;
|
|
6
|
-
} | {
|
|
7
|
-
readonly hash: string;
|
|
8
|
-
};
|
|
9
|
-
export type ScrollPosition = {
|
|
10
|
-
readonly x: number;
|
|
11
|
-
readonly y: number;
|
|
12
|
-
};
|
|
13
|
-
export declare function readScrollPosition(): ScrollPosition;
|
|
14
|
-
export declare function normalizeFragment(hash: string): string;
|
|
15
|
-
/** Applies the target through the browser's scroll calls, the one platform boundary here; a failure comes back as a value. */
|
|
16
|
-
export declare function applyScroll(target: ScrollTarget): Result.Result<void, unknown>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Context, Effect, Option, RcMap, Scope } from "effect";
|
|
2
|
-
import { Atom } from "effect/unstable/reactivity";
|
|
3
|
-
import { type ApplicationContexts, type ClientCoordinator } from "./runtime.ts";
|
|
4
|
-
import type { CachedRouteEntry, RouteEntry } from "./state.ts";
|
|
5
|
-
import type { ViewDefinition } from "./view-definition.ts";
|
|
6
|
-
/** Identifies one activation; a new key means a new activation. */
|
|
7
|
-
export type ActivationKey = {
|
|
8
|
-
readonly pattern: string;
|
|
9
|
-
readonly view: ViewDefinition;
|
|
10
|
-
};
|
|
11
|
-
export type RouteActivation = {
|
|
12
|
-
readonly key: ActivationKey;
|
|
13
|
-
readonly client: Context.Context<ClientCoordinator>;
|
|
14
|
-
readonly universal: Context.Context<never>;
|
|
15
|
-
readonly clientRuntime: Atom.AtomRuntime<ClientCoordinator, never>;
|
|
16
|
-
readonly universalRuntime: Atom.AtomRuntime<never, never>;
|
|
17
|
-
};
|
|
18
|
-
/** The activation a route-local computation runs under; a mutation holds it until settlement. */
|
|
19
|
-
export declare const CurrentActivation: Context.Service<ActivationKey, ActivationKey>;
|
|
20
|
-
export type ActivationMap = RcMap.RcMap<ActivationKey, RouteActivation, unknown>;
|
|
21
|
-
export declare function declaresServices(view: ViewDefinition): boolean;
|
|
22
|
-
/** Builds the activation map in the application scope. */
|
|
23
|
-
export declare function createActivationMap(getApplicationContextsFn: () => Option.Option<ApplicationContexts>): Effect.Effect<ActivationMap, never, Scope.Scope>;
|
|
24
|
-
/**
|
|
25
|
-
* Acquires every entry's activation in `scope`. A live preparation keeps its
|
|
26
|
-
* hold until this scope acquires it. A cached entry contains only the key;
|
|
27
|
-
* re-entry builds a new activation when no owner retains that key.
|
|
28
|
-
*/
|
|
29
|
-
export declare function acquireActivations(activations: ActivationMap, input: {
|
|
30
|
-
readonly entries: ReadonlyArray<RouteEntry | CachedRouteEntry>;
|
|
31
|
-
readonly scope: Scope.Scope;
|
|
32
|
-
}): Effect.Effect<ReadonlyArray<RouteEntry>, unknown>;
|
|
33
|
-
/** Omits acquired contexts and runtimes from a reusable entry. */
|
|
34
|
-
export declare function toCachedRouteEntry(entry: RouteEntry): CachedRouteEntry;
|
package/dist/client/state.d.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { Option, type Deferred, type Scope } from "effect";
|
|
2
|
-
import { AsyncResult, Atom } from "effect/unstable/reactivity";
|
|
3
|
-
import type { ScrollIntent } from "./commit.ts";
|
|
4
|
-
import type { NavigationError, RevalidationError } from "./errors.ts";
|
|
5
|
-
import type { HeadSections } from "./head.ts";
|
|
6
|
-
import type { ActivationKey, RouteActivation } from "./services.ts";
|
|
7
|
-
import type { BuildMismatch, ClientLifecycle, RouteErrorSource, NavigationResult, OperationId, OperationState, PendingNavigation, RevalidationResult } from "./types.ts";
|
|
8
|
-
import type { ViewDefinition } from "./view-definition.ts";
|
|
9
|
-
export type RouteErrorState = {
|
|
10
|
-
readonly index: number;
|
|
11
|
-
readonly pattern: string | undefined;
|
|
12
|
-
readonly source: RouteErrorSource;
|
|
13
|
-
readonly error: unknown;
|
|
14
|
-
};
|
|
15
|
-
/** One matched route's facts, kept together from preparation through commit. */
|
|
16
|
-
export type RouteEntry = {
|
|
17
|
-
readonly pattern: string;
|
|
18
|
-
readonly params: Readonly<Record<string, string>>;
|
|
19
|
-
readonly splatValues: ReadonlyArray<string>;
|
|
20
|
-
/** The decoded search input; `undefined` when the route has none or decoding failed. */
|
|
21
|
-
readonly input: unknown;
|
|
22
|
-
/** The view module's definition; `undefined` for a server-only route or a missing module. */
|
|
23
|
-
readonly view: ViewDefinition | undefined;
|
|
24
|
-
/** The decoded server loader output; `undefined` when unavailable. */
|
|
25
|
-
readonly loaderData: unknown;
|
|
26
|
-
readonly clientLoaderData: AsyncResult.AsyncResult<unknown, unknown>;
|
|
27
|
-
/** The route's service activation, held by its owner's scope; `undefined` when the view declares no local services. */
|
|
28
|
-
readonly activation: RouteActivation | undefined;
|
|
29
|
-
};
|
|
30
|
-
/** Reusable route data identifies an activation without retaining its acquired services. */
|
|
31
|
-
export type CachedRouteEntry = Omit<RouteEntry, "activation"> & {
|
|
32
|
-
readonly activationKey: ActivationKey | undefined;
|
|
33
|
-
};
|
|
34
|
-
/** The committed frame: what the screen shows and what the public route state describes. */
|
|
35
|
-
export type Frame = {
|
|
36
|
-
readonly href: string;
|
|
37
|
-
readonly historyState: unknown;
|
|
38
|
-
/** The history entry's key; absent when the entry predates the client. */
|
|
39
|
-
readonly key: string | undefined;
|
|
40
|
-
readonly clientBuildId: string;
|
|
41
|
-
readonly entries: ReadonlyArray<RouteEntry>;
|
|
42
|
-
readonly error: RouteErrorState | null;
|
|
43
|
-
readonly head: HeadSections;
|
|
44
|
-
readonly cssBundles: ReadonlyArray<string>;
|
|
45
|
-
/** Holds the entries' activations; closed when a later frame replaces it. */
|
|
46
|
-
readonly scope: Scope.Closeable;
|
|
47
|
-
readonly revision: number;
|
|
48
|
-
readonly committedAt: number;
|
|
49
|
-
/** Applied by the renderer once the destination view exists in the DOM. */
|
|
50
|
-
readonly scrollIntent: ScrollIntent | undefined;
|
|
51
|
-
};
|
|
52
|
-
export type NavigationFacts = {
|
|
53
|
-
readonly pending: PendingNavigation | null;
|
|
54
|
-
readonly latest: AsyncResult.AsyncResult<NavigationResult, NavigationError>;
|
|
55
|
-
};
|
|
56
|
-
export type FreshnessDemand = {
|
|
57
|
-
readonly afterSequence: number;
|
|
58
|
-
readonly skipWorkIndicator: boolean;
|
|
59
|
-
/** A trigger registered while an attempt was running; a failed attempt then runs again. */
|
|
60
|
-
readonly renewed: boolean;
|
|
61
|
-
/** The query computations that evaluated for the demand's epoch and were not released; each must acknowledge. */
|
|
62
|
-
readonly expectedQueries: ReadonlySet<string>;
|
|
63
|
-
/** Expected queries that acknowledged, by the sequence of the read they acknowledged with. */
|
|
64
|
-
readonly acknowledgedQueries: ReadonlyMap<string, number>;
|
|
65
|
-
/** The sequence of the qualifying route read, once one committed. */
|
|
66
|
-
readonly routeReadSequence: number | null;
|
|
67
|
-
readonly waiters: ReadonlyArray<Deferred.Deferred<RevalidationResult, RevalidationError>>;
|
|
68
|
-
};
|
|
69
|
-
export type FreshnessAttempt = {
|
|
70
|
-
/** The demand sequence this attempt's read covers; `null` before any attempt. */
|
|
71
|
-
readonly coveredSequence: number | null;
|
|
72
|
-
/** `retrying`: the last read failed and the application's schedule holds the next one. */
|
|
73
|
-
readonly phase: "idle" | "running" | "retrying" | "failed";
|
|
74
|
-
readonly skipWorkIndicator: boolean;
|
|
75
|
-
/** The waiter batch captured when the attempt started; a failure settles only these. */
|
|
76
|
-
readonly waiters: ReadonlyArray<Deferred.Deferred<RevalidationResult, RevalidationError>>;
|
|
77
|
-
readonly latest: AsyncResult.AsyncResult<RevalidationResult, RevalidationError>;
|
|
78
|
-
};
|
|
79
|
-
export type FreshnessFacts = {
|
|
80
|
-
readonly demand: FreshnessDemand | null;
|
|
81
|
-
readonly attempt: FreshnessAttempt;
|
|
82
|
-
/** Advances with every registered demand; active queries recompute on it. */
|
|
83
|
-
readonly epoch: number;
|
|
84
|
-
};
|
|
85
|
-
export type PrefetchFacts = {
|
|
86
|
-
readonly href: string;
|
|
87
|
-
readonly skipWorkIndicator: boolean;
|
|
88
|
-
};
|
|
89
|
-
export type ClientState = {
|
|
90
|
-
readonly lifecycle: ClientLifecycle;
|
|
91
|
-
readonly frame: Frame | null;
|
|
92
|
-
readonly navigation: NavigationFacts;
|
|
93
|
-
readonly freshness: FreshnessFacts;
|
|
94
|
-
readonly operations: ReadonlyMap<OperationId, OperationState>;
|
|
95
|
-
readonly prefetch: ReadonlyMap<string, PrefetchFacts>;
|
|
96
|
-
readonly buildMismatch: Option.Option<BuildMismatch>;
|
|
97
|
-
readonly generation: number;
|
|
98
|
-
readonly sequence: number;
|
|
99
|
-
};
|
|
100
|
-
export declare const INITIAL_CLIENT_STATE: ClientState;
|
|
101
|
-
/** Registry-local state; private to the package. Public atoms are projections. */
|
|
102
|
-
export declare const clientStateAtom: Atom.Writable<ClientState, ClientState>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Effect, type Scope } from "effect";
|
|
2
|
-
/** Reads the stylesheet bundles that the initial document applied. */
|
|
3
|
-
export declare function readDocumentStylesheets(): ReadonlyArray<string>;
|
|
4
|
-
/** Starts managed CSS preloads and waits for every load or error without applying destination styles. */
|
|
5
|
-
export declare function prepareStylesheets(bundles: ReadonlyArray<string>): Effect.Effect<void, never, Scope.Scope>;
|
|
6
|
-
/** Publishes managed styles after their preload attempts have settled. */
|
|
7
|
-
export declare function applyStylesheets(bundles: ReadonlyArray<string>): void;
|
package/dist/client/types.d.ts
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import type { Brand, Cause, Exit, Option } from "effect";
|
|
2
|
-
import type { AsyncResult } from "effect/unstable/reactivity";
|
|
3
|
-
import type { NavigationError, RevalidationError } from "./errors.ts";
|
|
4
|
-
/** An opaque identity Vorma assigns to one endpoint operation execution. */
|
|
5
|
-
export type OperationId = string & Brand.Brand<"VormaOperationId">;
|
|
6
|
-
/** Public server-failure presentation fields. */
|
|
7
|
-
export type PublicRouteError = {
|
|
8
|
-
readonly status: number;
|
|
9
|
-
readonly clientMessage: string;
|
|
10
|
-
};
|
|
11
|
-
export type RouteMatchSummary = {
|
|
12
|
-
readonly pattern: string;
|
|
13
|
-
readonly params: Readonly<Record<string, string>>;
|
|
14
|
-
readonly splatValues: ReadonlyArray<string>;
|
|
15
|
-
};
|
|
16
|
-
/** Server failures contain public fields only; browser failures retain their native Effect cause. */
|
|
17
|
-
export type BoundaryError = PublicRouteError & ({
|
|
18
|
-
readonly source: "serverLoader";
|
|
19
|
-
} | {
|
|
20
|
-
readonly source: "clientLoader" | "render" | "boot";
|
|
21
|
-
readonly cause: Cause.Cause<unknown>;
|
|
22
|
-
});
|
|
23
|
-
export type RouteErrorSource = Exclude<BoundaryError["source"], "boot">;
|
|
24
|
-
export type RouteError = BoundaryError & {
|
|
25
|
-
/** Absent when the server does not disclose the failed route. */
|
|
26
|
-
readonly pattern: string | undefined;
|
|
27
|
-
readonly source: RouteErrorSource;
|
|
28
|
-
};
|
|
29
|
-
/** The committed location and matched-route metadata. */
|
|
30
|
-
export type RouteState = {
|
|
31
|
-
readonly href: string;
|
|
32
|
-
readonly historyState: Option.Option<unknown>;
|
|
33
|
-
readonly matches: ReadonlyArray<RouteMatchSummary>;
|
|
34
|
-
readonly error: Option.Option<RouteError>;
|
|
35
|
-
};
|
|
36
|
-
export type RouteUpdateReason = "boot" | "navigation" | "popstate" | "hmr" | "revalidation";
|
|
37
|
-
export type NavigationSource = "navigate" | "popstate" | "redirect";
|
|
38
|
-
export type NavigationResult = {
|
|
39
|
-
readonly _tag: "Committed";
|
|
40
|
-
readonly href: string;
|
|
41
|
-
} | {
|
|
42
|
-
readonly _tag: "Unchanged";
|
|
43
|
-
readonly href: string;
|
|
44
|
-
} | {
|
|
45
|
-
readonly _tag: "Superseded";
|
|
46
|
-
} | {
|
|
47
|
-
readonly _tag: "DocumentNavigation";
|
|
48
|
-
readonly href: string;
|
|
49
|
-
};
|
|
50
|
-
export type NavigationOptions = {
|
|
51
|
-
readonly replace?: boolean;
|
|
52
|
-
/** A URL fragment still scrolls to its target when false. */
|
|
53
|
-
readonly scrollToTop?: boolean;
|
|
54
|
-
/** False disables fragment scrolling independently of scrolling to the top. */
|
|
55
|
-
readonly scrollToFragment?: boolean;
|
|
56
|
-
readonly historyState?: unknown;
|
|
57
|
-
readonly skipWorkIndicator?: boolean;
|
|
58
|
-
};
|
|
59
|
-
export type PendingNavigation = {
|
|
60
|
-
readonly href: string;
|
|
61
|
-
readonly source: NavigationSource;
|
|
62
|
-
readonly skipWorkIndicator: boolean;
|
|
63
|
-
};
|
|
64
|
-
export type NavigationState = {
|
|
65
|
-
readonly pending: Option.Option<PendingNavigation>;
|
|
66
|
-
readonly latestAttempt: AsyncResult.AsyncResult<NavigationResult, NavigationError>;
|
|
67
|
-
};
|
|
68
|
-
export type RevalidationResult = {
|
|
69
|
-
readonly _tag: "Refreshed";
|
|
70
|
-
} | {
|
|
71
|
-
readonly _tag: "Skipped";
|
|
72
|
-
} | {
|
|
73
|
-
readonly _tag: "DocumentNavigation";
|
|
74
|
-
readonly href: string;
|
|
75
|
-
};
|
|
76
|
-
export type PendingRevalidation = {
|
|
77
|
-
readonly phase: "scheduled" | "running";
|
|
78
|
-
readonly skipWorkIndicator: boolean;
|
|
79
|
-
};
|
|
80
|
-
export type RevalidationState = {
|
|
81
|
-
readonly requiresRevalidation: boolean;
|
|
82
|
-
readonly pending: Option.Option<PendingRevalidation>;
|
|
83
|
-
readonly latestAttempt: AsyncResult.AsyncResult<RevalidationResult, RevalidationError>;
|
|
84
|
-
};
|
|
85
|
-
export type OperationKind = "Query" | "Mutation";
|
|
86
|
-
export type OperationPhase = "preparing" | "dispatched" | "settled";
|
|
87
|
-
/** Public lifecycle facts of one endpoint operation; bodies and credentials stay private. */
|
|
88
|
-
export type OperationState = {
|
|
89
|
-
readonly operationId: OperationId;
|
|
90
|
-
readonly kind: OperationKind;
|
|
91
|
-
readonly request: {
|
|
92
|
-
readonly method: string;
|
|
93
|
-
readonly pattern: string;
|
|
94
|
-
readonly href: Option.Option<string>;
|
|
95
|
-
};
|
|
96
|
-
readonly phase: OperationPhase;
|
|
97
|
-
readonly skipWorkIndicator: boolean;
|
|
98
|
-
readonly skipAutoRevalidate: boolean;
|
|
99
|
-
};
|
|
100
|
-
export type PendingPrefetch = {
|
|
101
|
-
readonly href: string;
|
|
102
|
-
readonly phase: "preparing";
|
|
103
|
-
readonly skipWorkIndicator: boolean;
|
|
104
|
-
};
|
|
105
|
-
export type WorkState = {
|
|
106
|
-
readonly navigation: Option.Option<PendingNavigation>;
|
|
107
|
-
readonly revalidation: Option.Option<PendingRevalidation>;
|
|
108
|
-
readonly prefetches: ReadonlyArray<PendingPrefetch>;
|
|
109
|
-
readonly operations: ReadonlyArray<OperationState>;
|
|
110
|
-
};
|
|
111
|
-
export type RequestKind = "Navigation" | "Prefetch" | "Revalidation" | "Query" | "Mutation" | "Stream";
|
|
112
|
-
export type BuildMismatch = {
|
|
113
|
-
readonly clientBuildId: string;
|
|
114
|
-
/** The build the server named; `undefined` when the refusing response did not name one. */
|
|
115
|
-
readonly serverBuildId: string | undefined;
|
|
116
|
-
readonly requestedHref: string;
|
|
117
|
-
readonly requestKind: RequestKind;
|
|
118
|
-
readonly status: number;
|
|
119
|
-
};
|
|
120
|
-
export type FailureSource = "hmr" | "navigation" | "revalidation" | "clientLoader" | "clientLoaderEligibility" | "render" | "browserProgram";
|
|
121
|
-
export type ClientEvent = {
|
|
122
|
-
readonly _tag: "RouteCommitted";
|
|
123
|
-
readonly previous: Option.Option<RouteState>;
|
|
124
|
-
readonly current: RouteState;
|
|
125
|
-
readonly reason: RouteUpdateReason;
|
|
126
|
-
} | {
|
|
127
|
-
readonly _tag: "OperationSettled";
|
|
128
|
-
readonly operation: OperationState;
|
|
129
|
-
readonly outcome: Exit.Exit<unknown, unknown>;
|
|
130
|
-
} | {
|
|
131
|
-
readonly _tag: "BuildMismatchDetected";
|
|
132
|
-
readonly mismatch: BuildMismatch;
|
|
133
|
-
} | {
|
|
134
|
-
readonly _tag: "FailureReported";
|
|
135
|
-
readonly source: FailureSource;
|
|
136
|
-
readonly cause: Cause.Cause<unknown>;
|
|
137
|
-
};
|
|
138
|
-
export type ClientBootError = {
|
|
139
|
-
readonly _tag: "ClientBootError";
|
|
140
|
-
readonly message: string;
|
|
141
|
-
readonly cause?: unknown;
|
|
142
|
-
};
|
|
143
|
-
export type ClientLifecycle = {
|
|
144
|
-
readonly _tag: "PreBoot";
|
|
145
|
-
} | {
|
|
146
|
-
readonly _tag: "BootFailed";
|
|
147
|
-
readonly error: ClientBootError;
|
|
148
|
-
} | {
|
|
149
|
-
readonly _tag: "Ready";
|
|
150
|
-
} | {
|
|
151
|
-
readonly _tag: "Disposed";
|
|
152
|
-
};
|