@phreshos/client 0.1.29 → 0.1.31
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/context.d.ts +1 -1
- package/dist/domain.d.ts +13 -13
- package/dist/service.d.ts +4 -4
- package/dist/system.d.ts +3 -3
- package/package.json +3 -3
package/dist/context.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Context as CoreContext, ContextCapture as CoreContextCapture, ContextEvents as CoreContextEvents, ContextMessage as CoreContextMessage } from "@phreshos/core";
|
|
2
2
|
import { Server, type Endpoint, type Process, type Program, type Window } from "./domain.js";
|
|
3
3
|
/** The executing Process's canonical Server handle. */
|
|
4
|
-
export type ContextServer<Events extends object = {}> = Server<Events>;
|
|
4
|
+
export type ContextServer<Events extends object = {}, Fallback = never> = Server<Events, Fallback>;
|
|
5
5
|
/** One value addressed to the current Client, with a client-visible sender. */
|
|
6
6
|
export type ContextMessage<Payload = unknown> = CoreContextMessage<Payload, Endpoint | null>;
|
|
7
7
|
/** Applies the client-visible sender envelope to known Context events. */
|
package/dist/domain.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ export type TrafficMessage<Payload = unknown> = CoreTrafficMessage<Payload, Endp
|
|
|
84
84
|
/** Applies client-visible destination metadata to known traffic events. */
|
|
85
85
|
export type TrafficEvents<Events extends object> = CoreTrafficEvents<Events, Endpoint | null>;
|
|
86
86
|
/** Every ordinary event observable in client-visible Endpoint traffic. */
|
|
87
|
-
export type TrafficCapture<Events extends object = {}> = CoreTrafficCapture<Events, Endpoint | null>;
|
|
87
|
+
export type TrafficCapture<Events extends object = {}, Fallback = never> = CoreTrafficCapture<Events, Endpoint | null, Fallback>;
|
|
88
88
|
/** Question with a Server destination hidden when it crosses the Client boundary. */
|
|
89
89
|
export type AskMessage<Payload = unknown> = CoreAskMessage<Payload, Server | null>;
|
|
90
90
|
/** One question observable in client-visible Endpoint traffic. */
|
|
@@ -98,29 +98,29 @@ export type AnswerCapture<Result = unknown> = CoreAnswerCapture<Result, Endpoint
|
|
|
98
98
|
/** Callback that observes answers sent by a client-visible Server. */
|
|
99
99
|
export type AnswerSubscriber<Result = unknown> = CoreAnswerSubscriber<Result, Endpoint | null>;
|
|
100
100
|
/** Directed communication originating from one client-visible Endpoint. */
|
|
101
|
-
export type EndpointTraffic<Events extends object = {}> = CoreEndpointTraffic<Events, Endpoint | null, Server | null>;
|
|
101
|
+
export type EndpointTraffic<Events extends object = {}, Fallback = never> = CoreEndpointTraffic<Events, Endpoint | null, Server | null, Fallback>;
|
|
102
102
|
/** Directed communication originating from one client-visible Server. */
|
|
103
|
-
export type ServerTraffic<Events extends object = {}> = CoreServerTraffic<Events, Endpoint | null, Server | null>;
|
|
103
|
+
export type ServerTraffic<Events extends object = {}, Fallback = never> = CoreServerTraffic<Events, Endpoint | null, Server | null, Fallback>;
|
|
104
104
|
/** Directed communication originating from one client-visible Client. */
|
|
105
|
-
export type ClientTraffic<Events extends object = {}> = CoreClientTraffic<Events, Endpoint | null, Server | null>;
|
|
105
|
+
export type ClientTraffic<Events extends object = {}, Fallback = never> = CoreClientTraffic<Events, Endpoint | null, Server | null, Fallback>;
|
|
106
106
|
/** Common Endpoint handle visible inside a structurally isolated Client. */
|
|
107
|
-
export type Endpoint<Events extends object = {}> = Omit<CoreEndpoint<Events>, "process" | "traffic"> & {
|
|
107
|
+
export type Endpoint<Events extends object = {}, Fallback = never> = Omit<CoreEndpoint<Events, Fallback>, "process" | "traffic"> & {
|
|
108
108
|
/** Directed communication originating from this Endpoint. */
|
|
109
|
-
readonly traffic: EndpointTraffic<Events>;
|
|
109
|
+
readonly traffic: EndpointTraffic<Events, Fallback>;
|
|
110
110
|
/** Returns the Process that owns this Endpoint. */
|
|
111
111
|
process(): Promise<Process>;
|
|
112
112
|
};
|
|
113
113
|
/** Server handle visible inside a structurally isolated Client. */
|
|
114
|
-
export type Server<Events extends object = {}> = Omit<CoreServer<Events>, "process" | "traffic"> & Endpoint<Events> & {
|
|
114
|
+
export type Server<Events extends object = {}, Fallback = never> = Omit<CoreServer<Events, Fallback>, "process" | "traffic"> & Endpoint<Events, Fallback> & {
|
|
115
115
|
/** Directed communication originating from this Server. */
|
|
116
|
-
readonly traffic: ServerTraffic<Events>;
|
|
116
|
+
readonly traffic: ServerTraffic<Events, Fallback>;
|
|
117
117
|
/** Returns the Process that owns this Server. */
|
|
118
118
|
process(): Promise<Process>;
|
|
119
119
|
};
|
|
120
120
|
/** Client handle visible inside a structurally isolated Client. */
|
|
121
|
-
export type Client<Events extends object = {}> = Omit<CoreClient<Events>, "process" | "traffic" | "window"> & Endpoint<Events> & {
|
|
121
|
+
export type Client<Events extends object = {}, Fallback = never> = Omit<CoreClient<Events, Fallback>, "process" | "traffic" | "window"> & Endpoint<Events, Fallback> & {
|
|
122
122
|
/** Directed communication originating from this Client. */
|
|
123
|
-
readonly traffic: ClientTraffic<Events>;
|
|
123
|
+
readonly traffic: ClientTraffic<Events, Fallback>;
|
|
124
124
|
/** Presentation capability permanently owned by this Client handle. */
|
|
125
125
|
readonly window: Window;
|
|
126
126
|
/** Returns the Process that owns this Client. */
|
|
@@ -140,7 +140,7 @@ export declare class TrafficHandle extends Events {
|
|
|
140
140
|
event: string;
|
|
141
141
|
questionId: string;
|
|
142
142
|
message: Readonly<{
|
|
143
|
-
to: Server<{}> | null;
|
|
143
|
+
to: Server<{}, never> | null;
|
|
144
144
|
payload: unknown;
|
|
145
145
|
}>;
|
|
146
146
|
}>>;
|
|
@@ -152,7 +152,7 @@ export declare class ServerTrafficHandle extends TrafficHandle {
|
|
|
152
152
|
event: string;
|
|
153
153
|
questionId: string;
|
|
154
154
|
message: Readonly<{
|
|
155
|
-
to: Endpoint<{}> | null;
|
|
155
|
+
to: Endpoint<{}, never> | null;
|
|
156
156
|
outcome: Outcome<unknown>;
|
|
157
157
|
}>;
|
|
158
158
|
}>>;
|
|
@@ -173,7 +173,7 @@ export declare function process(record: ProcessRecord, endpoints?: {
|
|
|
173
173
|
client?: Client;
|
|
174
174
|
}): Process;
|
|
175
175
|
export declare function endpoint(reference: EndpointReference | undefined): Endpoint;
|
|
176
|
-
export declare function claimEndpoint(reference: string, kind: "server" | "client", endpoint: Endpoint): Endpoint<{}>;
|
|
176
|
+
export declare function claimEndpoint(reference: string, kind: "server" | "client", endpoint: Endpoint): Endpoint<{}, never>;
|
|
177
177
|
export declare function window(target: WindowTarget): Window;
|
|
178
178
|
/** Resolves only endpoint identities intentionally visible to this Client. */
|
|
179
179
|
export declare function visibleEndpoint(reference: EndpointReference | null | undefined): Endpoint | null;
|
package/dist/service.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type ClientService, type ServerService, type Service, type ServiceKey } from "@phreshos/core";
|
|
2
|
-
export declare function prepareService<EventsMap extends object = {}>(key: ServiceKey & {
|
|
2
|
+
export declare function prepareService<EventsMap extends object = {}, Fallback = never>(key: ServiceKey & {
|
|
3
3
|
endpoint: "server";
|
|
4
|
-
}): ServerService<EventsMap>;
|
|
5
|
-
export declare function prepareService<EventsMap extends object = {}>(key: ServiceKey & {
|
|
4
|
+
}): ServerService<EventsMap, Fallback>;
|
|
5
|
+
export declare function prepareService<EventsMap extends object = {}, Fallback = never>(key: ServiceKey & {
|
|
6
6
|
endpoint: "client";
|
|
7
|
-
}): ClientService<EventsMap>;
|
|
7
|
+
}): ClientService<EventsMap, Fallback>;
|
|
8
8
|
export declare function prepareService(key: ServiceKey): Service;
|
package/dist/system.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ type ServiceEndpoint = ServiceKey["endpoint"];
|
|
|
4
4
|
type ServiceAddress<Endpoint extends ServiceEndpoint> = Omit<ServiceKey, "endpoint"> & Readonly<{
|
|
5
5
|
endpoint: Endpoint;
|
|
6
6
|
}>;
|
|
7
|
-
type ServiceHandle<Endpoint extends ServiceEndpoint, Events extends object> = Endpoint extends "server" ? ServerService<Events> : ClientService<Events>;
|
|
7
|
+
type ServiceHandle<Endpoint extends ServiceEndpoint, Events extends object, Fallback = never> = Endpoint extends "server" ? ServerService<Events, Fallback> : ClientService<Events, Fallback>;
|
|
8
8
|
/** Desktop capabilities structurally available to a Client endpoint. */
|
|
9
9
|
export interface System {
|
|
10
10
|
/** Complete unresolved Appearance read from the System authority. */
|
|
@@ -18,9 +18,9 @@ export interface System {
|
|
|
18
18
|
/** Returns a precisely typed stable handle for either service endpoint. */
|
|
19
19
|
service<Endpoint extends ServiceEndpoint>(key: ServiceAddress<Endpoint>): ServiceHandle<Endpoint, {}>;
|
|
20
20
|
/** Returns a typed stable handle for one exact Server service identity. */
|
|
21
|
-
service<ServiceEvents extends object>(key: ServiceAddress<"server">): ServerService<ServiceEvents>;
|
|
21
|
+
service<ServiceEvents extends object, Fallback = never>(key: ServiceAddress<"server">): ServerService<ServiceEvents, Fallback>;
|
|
22
22
|
/** Returns a typed stable handle for one exact Client service identity. */
|
|
23
|
-
service<ServiceEvents extends object>(key: ServiceAddress<"client">): ClientService<ServiceEvents>;
|
|
23
|
+
service<ServiceEvents extends object, Fallback = never>(key: ServiceAddress<"client">): ClientService<ServiceEvents, Fallback>;
|
|
24
24
|
}
|
|
25
25
|
/** Desktop capabilities available to this Client. */
|
|
26
26
|
export declare const system: System;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phreshos/client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"description": "The SDK used by a Program's client endpoint.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"prepack": "node --run build"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@phreshos/core": "^0.1.
|
|
50
|
+
"@phreshos/core": "^0.1.35"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@msgpack/msgpack": "^3.1.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@phreshos/core": "^0.1.
|
|
56
|
+
"@phreshos/core": "^0.1.35",
|
|
57
57
|
"typescript": "^6.0.3"
|
|
58
58
|
}
|
|
59
59
|
}
|