@securitydept/client 0.3.0-beta.1 → 0.3.0-beta.11
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/README.md +6 -0
- package/dist/create-i5VyYgN6.mjs +989 -0
- package/dist/create-i5VyYgN6.mjs.map +1 -0
- package/dist/handle-DwMgqe7R.mjs +638 -0
- package/dist/handle-DwMgqe7R.mjs.map +1 -0
- package/dist/index-Bo1BtjZH.d.mts +132 -0
- package/dist/index-CFAJ969E.d.mts +674 -0
- package/dist/index-CbeZ3AfB.d.mts +1680 -0
- package/dist/index.d.mts +3 -353
- package/dist/index.mjs +1196 -401
- package/dist/index.mjs.map +1 -1
- package/dist/router-at5bTdJQ.mjs +245 -0
- package/dist/router-at5bTdJQ.mjs.map +1 -0
- package/dist/rx/index.d.mts +68 -0
- package/dist/rx/index.mjs +2 -0
- package/dist/rx-DM6Ouv-m.mjs +1119 -0
- package/dist/rx-DM6Ouv-m.mjs.map +1 -0
- package/dist/server/index.d.mts +20 -0
- package/dist/server/index.mjs +29 -0
- package/dist/server/index.mjs.map +1 -0
- package/dist/test/index.d.mts +101 -0
- package/dist/test/index.mjs +270 -0
- package/dist/test/index.mjs.map +1 -0
- package/dist/uri-string-BPNbIMgv.mjs +300 -0
- package/dist/uri-string-BPNbIMgv.mjs.map +1 -0
- package/dist/web/index.d.mts +82 -337
- package/dist/web/index.mjs +334 -337
- package/dist/web/index.mjs.map +1 -1
- package/dist/webext/index.d.mts +73 -0
- package/dist/webext/index.mjs +231 -0
- package/dist/webext/index.mjs.map +1 -0
- package/package.json +28 -21
- package/dist/auth-coordination/index.d.mts +0 -198
- package/dist/auth-coordination/index.mjs +0 -107
- package/dist/auth-coordination/index.mjs.map +0 -1
- package/dist/events/index.d.mts +0 -2
- package/dist/events/index.mjs +0 -2
- package/dist/events-BUlfsRfl.mjs +0 -127
- package/dist/events-BUlfsRfl.mjs.map +0 -1
- package/dist/fetch-transport-Bd5RyWj2.d.mts +0 -339
- package/dist/fetch-transport-DtnSRWAH.mjs +0 -631
- package/dist/fetch-transport-DtnSRWAH.mjs.map +0 -1
- package/dist/index-C_wgl6dW.d.mts +0 -102
- package/dist/index-DbYSFHDe.d.mts +0 -39
- package/dist/persistence/index.d.mts +0 -3
- package/dist/persistence/index.mjs +0 -2
- package/dist/persistence/web/index.d.mts +0 -16
- package/dist/persistence/web/index.mjs +0 -51
- package/dist/persistence/web/index.mjs.map +0 -1
- package/dist/persistence-CSB8770k.mjs +0 -108
- package/dist/persistence-CSB8770k.mjs.map +0 -1
- package/dist/planner-host-CPyGNyQV.d.mts +0 -190
- package/dist/planner-host-CV38bMSn.mjs +0 -195
- package/dist/planner-host-CV38bMSn.mjs.map +0 -1
- package/dist/types-C59fcM5W.d.mts +0 -52
- package/dist/types-DQc088ZP.d.mts +0 -32
- package/dist/web-router/index.d.mts +0 -259
- package/dist/web-router/index.mjs +0 -395
- package/dist/web-router/index.mjs.map +0 -1
|
@@ -0,0 +1,674 @@
|
|
|
1
|
+
import { InjectionToken, Injector } from "injection-js";
|
|
2
|
+
import { BehaviorSubject, Observable, ObservableInput, OperatorFunction, ReplaySubject, Subject } from "rxjs";
|
|
3
|
+
//#region src/injection/types.d.ts
|
|
4
|
+
declare class SecuritydeptInjectionToken<T> extends InjectionToken<T> {}
|
|
5
|
+
type SecuritydeptAbstractType<T> = abstract new (...args: never[]) => T;
|
|
6
|
+
type SecuritydeptDependencyToken<T> = SecuritydeptInjectionToken<T> | SecuritydeptAbstractType<T>;
|
|
7
|
+
type SecuritydeptTypeProvider<T> = SecuritydeptAbstractType<T>;
|
|
8
|
+
declare const SecurityDeptOptional: import("injection-js").OptionalDecorator;
|
|
9
|
+
type SecuritydeptOptionalDependency<T> = readonly [InstanceType<typeof SecurityDeptOptional>, SecuritydeptDependencyToken<T>] | readonly [SecuritydeptDependencyToken<T>, InstanceType<typeof SecurityDeptOptional>];
|
|
10
|
+
type SecuritydeptDependencyDescriptor<T> = SecuritydeptDependencyToken<T> | SecuritydeptOptionalDependency<T>;
|
|
11
|
+
interface SecuritydeptValueProvider<T> {
|
|
12
|
+
provide: SecuritydeptDependencyToken<T>;
|
|
13
|
+
useValue: T;
|
|
14
|
+
}
|
|
15
|
+
interface SecuritydeptClassProvider<T> {
|
|
16
|
+
provide: SecuritydeptDependencyToken<T>;
|
|
17
|
+
useClass: SecuritydeptAbstractType<T>;
|
|
18
|
+
deps?: readonly SecuritydeptDependencyDescriptor<unknown>[];
|
|
19
|
+
}
|
|
20
|
+
interface SecuritydeptFactoryProvider<T> {
|
|
21
|
+
provide: SecuritydeptDependencyToken<T>;
|
|
22
|
+
useFactory: (...deps: never[]) => T;
|
|
23
|
+
deps?: readonly SecuritydeptDependencyDescriptor<unknown>[];
|
|
24
|
+
}
|
|
25
|
+
type WithTraitDeps<TDeps extends object> = TDeps;
|
|
26
|
+
interface SecuritydeptExistingProvider<T> {
|
|
27
|
+
provide: SecuritydeptDependencyToken<T>;
|
|
28
|
+
useExisting: SecuritydeptDependencyToken<T>;
|
|
29
|
+
}
|
|
30
|
+
type SecuritydeptProvider<T = unknown> = SecuritydeptTypeProvider<T> | SecuritydeptValueProvider<T> | SecuritydeptClassProvider<T> | SecuritydeptFactoryProvider<T> | SecuritydeptExistingProvider<T>;
|
|
31
|
+
declare function getSecuritydeptProviderToken(provider: SecuritydeptProvider): SecuritydeptDependencyToken<unknown>;
|
|
32
|
+
declare function createProviderIfTokenMissing<TProvider extends SecuritydeptProvider>(providedTokens: ReadonlySet<SecuritydeptDependencyToken<unknown>>, token: SecuritydeptDependencyToken<unknown>, createProvider: () => TProvider): TProvider | null;
|
|
33
|
+
declare function notMissingProvider(provider: SecuritydeptProvider | null): provider is SecuritydeptProvider;
|
|
34
|
+
interface SecuritydeptInjectorTrait {
|
|
35
|
+
get<T>(token: SecuritydeptDependencyToken<T>): T;
|
|
36
|
+
get<T>(token: SecuritydeptDependencyToken<T>, notFoundValue: T): T;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/injection/context.d.ts
|
|
40
|
+
interface SecuritydeptInjectOptions {
|
|
41
|
+
optional?: boolean;
|
|
42
|
+
}
|
|
43
|
+
declare function inject$1<T>(token: SecuritydeptDependencyToken<T>, options?: SecuritydeptInjectOptions & {
|
|
44
|
+
optional?: false;
|
|
45
|
+
}): T;
|
|
46
|
+
declare function inject$1<T>(token: SecuritydeptDependencyToken<T>, options?: SecuritydeptInjectOptions & {
|
|
47
|
+
optional?: true;
|
|
48
|
+
}): T | null;
|
|
49
|
+
declare function tryInjectInInjectionContext<T>(token: SecuritydeptDependencyToken<T>, options?: SecuritydeptInjectOptions): T | null;
|
|
50
|
+
declare function runInInjectionContext$1<ReturnT>(injector: SecuritydeptInjectorTrait, fn: () => ReturnT): ReturnT;
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/compat/disposable.d.ts
|
|
53
|
+
declare const SYMBOL_DISPOSE: typeof Symbol.dispose;
|
|
54
|
+
interface DisposableTrait {
|
|
55
|
+
dispose(): void;
|
|
56
|
+
[SYMBOL_DISPOSE](): void;
|
|
57
|
+
}
|
|
58
|
+
declare const SYMBOL_ASYNC_DISPOSE: typeof Symbol.asyncDispose;
|
|
59
|
+
interface AsyncDisposableTrait {
|
|
60
|
+
dispose(): Promise<void>;
|
|
61
|
+
[SYMBOL_ASYNC_DISPOSE](): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
interface DisposableStackTrait extends DisposableTrait {
|
|
64
|
+
readonly disposed: boolean;
|
|
65
|
+
use<T extends DisposableTrait>(disposable: T): T;
|
|
66
|
+
dispose(): void;
|
|
67
|
+
[SYMBOL_DISPOSE](): void;
|
|
68
|
+
}
|
|
69
|
+
declare const SYMBOL_DISPOSABLE_STACK = "@@disposableStack";
|
|
70
|
+
declare function injectDisposableStackFrom(arg: unknown, isOptions?: boolean): DisposableStackTrait | undefined;
|
|
71
|
+
declare class SimpleDisposableStack implements DisposableStackTrait {
|
|
72
|
+
private readonly stack;
|
|
73
|
+
disposed: boolean;
|
|
74
|
+
use<T extends DisposableTrait>(disposable: T): T;
|
|
75
|
+
dispose(): void;
|
|
76
|
+
[SYMBOL_DISPOSE](): void;
|
|
77
|
+
}
|
|
78
|
+
interface NativeDisposableStackLike {
|
|
79
|
+
readonly disposed: boolean;
|
|
80
|
+
use<T extends DisposableTrait>(disposable: T): T;
|
|
81
|
+
dispose(): void;
|
|
82
|
+
}
|
|
83
|
+
type NativeDisposableStackConstructor = new () => NativeDisposableStackLike;
|
|
84
|
+
declare class StdDisposableStack implements DisposableStackTrait {
|
|
85
|
+
private readonly stack;
|
|
86
|
+
constructor(Stack?: NativeDisposableStackConstructor);
|
|
87
|
+
get disposed(): boolean;
|
|
88
|
+
use<T extends DisposableTrait>(disposable: T): T;
|
|
89
|
+
dispose(): void;
|
|
90
|
+
[SYMBOL_DISPOSE](): void;
|
|
91
|
+
}
|
|
92
|
+
declare function createDisposableStack(): DisposableStackTrait;
|
|
93
|
+
declare function withDisposableStack(index: number, isOptions?: boolean): <TThis, TArgs extends unknown[], TReturn>(target: (this: TThis, ...args: TArgs) => TReturn, _context: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => TReturn>) => (this: TThis, ...args: TArgs) => TReturn;
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/injection/injector.d.ts
|
|
96
|
+
declare class SecuritydeptInjector implements SecuritydeptInjectorTrait {
|
|
97
|
+
private readonly runtimeInjector;
|
|
98
|
+
static resolveAndCreate(providers: readonly SecuritydeptProvider[]): SecuritydeptInjector;
|
|
99
|
+
static fromParentInjector(parent: SecuritydeptInjectorTrait, providers: readonly SecuritydeptProvider[]): SecuritydeptInjector;
|
|
100
|
+
static fromRuntimeInjector(runtimeInjector: Injector): SecuritydeptInjector;
|
|
101
|
+
private constructor();
|
|
102
|
+
get<T>(token: SecuritydeptDependencyToken<T>): T;
|
|
103
|
+
get<T>(token: SecuritydeptDependencyToken<T>, notFoundValue: T): T;
|
|
104
|
+
}
|
|
105
|
+
declare const INJECTOR_TOKEN: SecuritydeptInjectionToken<SecuritydeptInjector>;
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/compat/observable.d.ts
|
|
108
|
+
declare const SYMBOL_OBSERVABLE: typeof Symbol.observable;
|
|
109
|
+
/** Subscription handle with explicit unsubscribe. */
|
|
110
|
+
interface SubscriptionTrait {
|
|
111
|
+
unsubscribe(): void;
|
|
112
|
+
}
|
|
113
|
+
/** Observer for event streams — mirrors the Observable observer pattern. */
|
|
114
|
+
interface ObserverTrait<T> {
|
|
115
|
+
next(value: T): void;
|
|
116
|
+
error(error: unknown): void;
|
|
117
|
+
complete(): void;
|
|
118
|
+
}
|
|
119
|
+
interface SubscribableTrait<T> {
|
|
120
|
+
subscribe(observer: Partial<ObserverTrait<T>>): SubscriptionTrait;
|
|
121
|
+
}
|
|
122
|
+
interface InteropObservableTrait<T> {
|
|
123
|
+
[SYMBOL_OBSERVABLE](): SubscribableTrait<T>;
|
|
124
|
+
}
|
|
125
|
+
type WithInteropObservableTraitCompat<O extends InteropObservableTrait<unknown>, T extends O extends InteropObservableTrait<infer U> ? U : never> = O & InteropObservableTrait<T>;
|
|
126
|
+
declare function isInteropObservableTrait<T>(value: unknown): value is InteropObservableTrait<T>;
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/events/types.d.ts
|
|
129
|
+
/** Subscription handle with explicit unsubscribe. */
|
|
130
|
+
type EventSubscriptionTrait = SubscriptionTrait;
|
|
131
|
+
/** Observer for event streams — mirrors the Observable observer pattern. */
|
|
132
|
+
interface EventObserverTrait<T> {
|
|
133
|
+
next(value: T): void;
|
|
134
|
+
error(error: unknown): void;
|
|
135
|
+
complete(): void;
|
|
136
|
+
}
|
|
137
|
+
/** Read-only event stream — lazy push-based sequence. */
|
|
138
|
+
interface EventStreamTrait<T> extends InteropObservableTrait<T> {
|
|
139
|
+
subscribe(observer: Partial<EventObserverTrait<T>>): EventSubscriptionTrait;
|
|
140
|
+
}
|
|
141
|
+
/** Hot event producer. */
|
|
142
|
+
interface EventSubjectTrait<T> extends EventStreamTrait<T> {
|
|
143
|
+
next(value: T): void;
|
|
144
|
+
error(error: unknown): void;
|
|
145
|
+
complete(): void;
|
|
146
|
+
}
|
|
147
|
+
declare const EventSourceKind: {
|
|
148
|
+
readonly User: "user";
|
|
149
|
+
readonly Timer: "timer";
|
|
150
|
+
readonly Http: "http";
|
|
151
|
+
readonly Storage: "storage";
|
|
152
|
+
readonly Framework: "framework";
|
|
153
|
+
readonly System: "system";
|
|
154
|
+
};
|
|
155
|
+
type EventSourceKind = (typeof EventSourceKind)[keyof typeof EventSourceKind];
|
|
156
|
+
type EventSource = {
|
|
157
|
+
kind: typeof EventSourceKind.User;
|
|
158
|
+
actor?: string;
|
|
159
|
+
} | {
|
|
160
|
+
kind: typeof EventSourceKind.Timer;
|
|
161
|
+
timer: string;
|
|
162
|
+
} | {
|
|
163
|
+
kind: typeof EventSourceKind.Http;
|
|
164
|
+
requestId: string;
|
|
165
|
+
endpoint?: string;
|
|
166
|
+
} | {
|
|
167
|
+
kind: typeof EventSourceKind.Storage;
|
|
168
|
+
operation: string;
|
|
169
|
+
} | {
|
|
170
|
+
kind: typeof EventSourceKind.Framework;
|
|
171
|
+
name: string;
|
|
172
|
+
} | {
|
|
173
|
+
kind: typeof EventSourceKind.System;
|
|
174
|
+
subsystem: string;
|
|
175
|
+
};
|
|
176
|
+
interface RuntimeEventEnvelope<TType extends string, TPayload> {
|
|
177
|
+
id: string;
|
|
178
|
+
type: TType;
|
|
179
|
+
at: number;
|
|
180
|
+
source: EventSource;
|
|
181
|
+
payload: TPayload;
|
|
182
|
+
}
|
|
183
|
+
type EventOperatorFunction<T, R> = (stream: EventStreamTrait<T>) => EventStreamTrait<R>;
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/span/types.d.ts
|
|
186
|
+
interface SpanCreateOptions {
|
|
187
|
+
idFactory?: () => string;
|
|
188
|
+
attributes?: SpanAttributes;
|
|
189
|
+
mutable?: false;
|
|
190
|
+
}
|
|
191
|
+
type SpanAttributeValue = string | number | boolean | null | readonly SpanAttributeValue[] | {
|
|
192
|
+
readonly [name: string]: SpanAttributeValue;
|
|
193
|
+
};
|
|
194
|
+
type SpanAttributes = Readonly<Record<string, SpanAttributeValue>>;
|
|
195
|
+
interface SpanAttributeReadOptions {
|
|
196
|
+
providerId: string;
|
|
197
|
+
withShared?: boolean;
|
|
198
|
+
}
|
|
199
|
+
interface SpanPathOptions {
|
|
200
|
+
skipSelf?: boolean;
|
|
201
|
+
}
|
|
202
|
+
interface SpanNodeAttributes {
|
|
203
|
+
readonly spanId: string;
|
|
204
|
+
readonly parentSpanId?: string;
|
|
205
|
+
readonly attributes: SpanAttributes;
|
|
206
|
+
}
|
|
207
|
+
interface MutableSpanCreateOptions extends Omit<SpanCreateOptions, "mutable"> {
|
|
208
|
+
mutable: true;
|
|
209
|
+
}
|
|
210
|
+
interface SpanTrait {
|
|
211
|
+
readonly id: string;
|
|
212
|
+
readonly parent?: SpanTrait;
|
|
213
|
+
getAttributes(options?: SpanAttributeReadOptions): SpanAttributes;
|
|
214
|
+
getRootToNodePath(options?: SpanPathOptions): readonly SpanTrait[];
|
|
215
|
+
getRootToNodeAttributes(options?: SpanPathOptions & {
|
|
216
|
+
providerId?: string;
|
|
217
|
+
}): readonly SpanNodeAttributes[];
|
|
218
|
+
fork(options: MutableSpanCreateOptions): MutableSpanTrait;
|
|
219
|
+
fork(options?: SpanCreateOptions): SpanTrait;
|
|
220
|
+
fork(options?: SpanCreateOptions | MutableSpanCreateOptions): SpanTrait | MutableSpanTrait;
|
|
221
|
+
}
|
|
222
|
+
interface MutableSpanTrait extends SpanTrait {
|
|
223
|
+
setAttributes(attributes: SpanAttributes, options?: {
|
|
224
|
+
providerId?: string;
|
|
225
|
+
}): void;
|
|
226
|
+
}
|
|
227
|
+
declare const SPAN_TRAIT_TOKEN: SecuritydeptInjectionToken<SpanTrait>;
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region src/errors/types.d.ts
|
|
230
|
+
type ClientErrorSpanContext = readonly SpanNodeAttributes[];
|
|
231
|
+
/** Recovery actions the user might take. Aligned with server-side `UserRecovery`. */
|
|
232
|
+
declare const UserRecovery: {
|
|
233
|
+
readonly None: "none";
|
|
234
|
+
readonly Retry: "retry";
|
|
235
|
+
readonly RestartFlow: "restart_flow";
|
|
236
|
+
readonly Reauthenticate: "reauthenticate";
|
|
237
|
+
readonly ContactSupport: "contact_support";
|
|
238
|
+
};
|
|
239
|
+
type UserRecovery = (typeof UserRecovery)[keyof typeof UserRecovery];
|
|
240
|
+
/** Safe user-facing presentation supplied by a server error response. */
|
|
241
|
+
interface ServerErrorPresentation {
|
|
242
|
+
code: string;
|
|
243
|
+
message: string;
|
|
244
|
+
recovery: UserRecovery;
|
|
245
|
+
}
|
|
246
|
+
declare const ErrorPresentationTone: {
|
|
247
|
+
readonly Neutral: "neutral";
|
|
248
|
+
readonly Warning: "warning";
|
|
249
|
+
readonly Danger: "danger";
|
|
250
|
+
};
|
|
251
|
+
type ErrorPresentationTone = (typeof ErrorPresentationTone)[keyof typeof ErrorPresentationTone];
|
|
252
|
+
interface ErrorRecoveryActionDescriptor {
|
|
253
|
+
recovery: UserRecovery;
|
|
254
|
+
label: string;
|
|
255
|
+
href: string | null;
|
|
256
|
+
}
|
|
257
|
+
interface ErrorPresentationDescriptor {
|
|
258
|
+
code: string | null;
|
|
259
|
+
title: string;
|
|
260
|
+
description: string;
|
|
261
|
+
recovery: UserRecovery;
|
|
262
|
+
tone: ErrorPresentationTone;
|
|
263
|
+
primaryAction: ErrorRecoveryActionDescriptor | null;
|
|
264
|
+
}
|
|
265
|
+
interface ReadErrorPresentationDescriptorOptions {
|
|
266
|
+
fallbackTitle?: string;
|
|
267
|
+
fallbackDescription?: string;
|
|
268
|
+
codePresentations?: Readonly<Record<string, ErrorCodePresentation>>;
|
|
269
|
+
recoveryLinks?: Partial<Record<UserRecovery, string>>;
|
|
270
|
+
recoveryLabels?: Partial<Record<UserRecovery, string>>;
|
|
271
|
+
contextFormatter?: ClientErrorContextFormatter | null;
|
|
272
|
+
}
|
|
273
|
+
type ClientErrorContextFormatter = (context: ClientErrorSpanContext) => string | undefined;
|
|
274
|
+
interface ErrorCodePresentation {
|
|
275
|
+
title: string;
|
|
276
|
+
description: string;
|
|
277
|
+
tone?: ErrorPresentationTone;
|
|
278
|
+
recovery?: UserRecovery;
|
|
279
|
+
}
|
|
280
|
+
/** Machine-facing error kind discriminator. */
|
|
281
|
+
declare const ClientErrorKind: {
|
|
282
|
+
readonly Authorization: "authorization";
|
|
283
|
+
readonly Transport: "transport";
|
|
284
|
+
readonly Server: "server";
|
|
285
|
+
readonly Protocol: "protocol";
|
|
286
|
+
readonly Storage: "storage";
|
|
287
|
+
readonly Configuration: "configuration";
|
|
288
|
+
readonly Unauthenticated: "unauthenticated";
|
|
289
|
+
readonly Unauthorized: "unauthorized";
|
|
290
|
+
readonly Cancelled: "cancelled";
|
|
291
|
+
readonly Timeout: "timeout";
|
|
292
|
+
readonly Internal: "internal";
|
|
293
|
+
};
|
|
294
|
+
type ClientErrorKind = (typeof ClientErrorKind)[keyof typeof ClientErrorKind];
|
|
295
|
+
/** Stable source vocabulary for common client error producers. */
|
|
296
|
+
declare const ClientErrorSource: {
|
|
297
|
+
readonly Transport: "transport";
|
|
298
|
+
readonly Server: "server";
|
|
299
|
+
readonly Client: "client";
|
|
300
|
+
};
|
|
301
|
+
type ClientErrorSource = (typeof ClientErrorSource)[keyof typeof ClientErrorSource];
|
|
302
|
+
//#endregion
|
|
303
|
+
//#region src/errors/client-error.d.ts
|
|
304
|
+
declare const CLIENT_ERROR_SPAN_ATTRIBUTE_PROVIDER_ID = "@securitydept/client/error";
|
|
305
|
+
interface ClientErrorFromUnknownOptions {
|
|
306
|
+
message: string;
|
|
307
|
+
code: string;
|
|
308
|
+
source: string;
|
|
309
|
+
span?: SpanTrait;
|
|
310
|
+
}
|
|
311
|
+
interface ClientErrorFromHttpResponseOptions {
|
|
312
|
+
status: number;
|
|
313
|
+
body?: unknown;
|
|
314
|
+
source?: string;
|
|
315
|
+
span?: SpanTrait;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Base client error carrying both machine-facing context and an optional
|
|
319
|
+
* user-facing presentation layer.
|
|
320
|
+
*
|
|
321
|
+
* Top-level `code` and `recovery` provide stable machine contracts for
|
|
322
|
+
* policy decisions without requiring callers to unwrap `presentation`.
|
|
323
|
+
*/
|
|
324
|
+
declare class ClientError extends Error {
|
|
325
|
+
private _spanContext;
|
|
326
|
+
readonly kind: ClientErrorKind;
|
|
327
|
+
/**
|
|
328
|
+
* Stable machine-readable error code.
|
|
329
|
+
* Matches `presentation.code` when present, otherwise a default
|
|
330
|
+
* derived from `kind`.
|
|
331
|
+
*/
|
|
332
|
+
readonly code: string;
|
|
333
|
+
/** Recovery hint at the machine level. */
|
|
334
|
+
readonly recovery: UserRecovery;
|
|
335
|
+
/** Whether this error is safe to retry. */
|
|
336
|
+
readonly retryable: boolean;
|
|
337
|
+
/** Structured user-facing error presentation from the server. */
|
|
338
|
+
readonly presentation?: ServerErrorPresentation;
|
|
339
|
+
/** Source subsystem or component that produced the error. */
|
|
340
|
+
readonly source?: string;
|
|
341
|
+
get spanContext(): ClientErrorSpanContext | undefined;
|
|
342
|
+
constructor(options: {
|
|
343
|
+
kind: ClientErrorKind;
|
|
344
|
+
message: string;
|
|
345
|
+
code?: string;
|
|
346
|
+
recovery?: UserRecovery;
|
|
347
|
+
retryable?: boolean;
|
|
348
|
+
presentation?: ServerErrorPresentation;
|
|
349
|
+
source?: string;
|
|
350
|
+
cause?: unknown;
|
|
351
|
+
span?: SpanTrait;
|
|
352
|
+
});
|
|
353
|
+
captureSpanContext(span: SpanTrait): this;
|
|
354
|
+
/** Create a `ClientError` from a server error response body. */
|
|
355
|
+
static fromServerError(body: {
|
|
356
|
+
kind?: string;
|
|
357
|
+
code?: string;
|
|
358
|
+
message?: string;
|
|
359
|
+
recovery?: string;
|
|
360
|
+
presentation?: {
|
|
361
|
+
code?: string;
|
|
362
|
+
message?: string;
|
|
363
|
+
recovery?: string;
|
|
364
|
+
};
|
|
365
|
+
}, overrides?: {
|
|
366
|
+
kind?: ClientErrorKind;
|
|
367
|
+
source?: string;
|
|
368
|
+
span?: SpanTrait;
|
|
369
|
+
}): ClientError;
|
|
370
|
+
static fromUnknown(error: unknown, options: ClientErrorFromUnknownOptions): ClientError;
|
|
371
|
+
/**
|
|
372
|
+
* Create a `ClientError` from an HTTP response status and optional body.
|
|
373
|
+
* Used when a non-success status is unexpected.
|
|
374
|
+
*/
|
|
375
|
+
static fromHttpResponse(options: ClientErrorFromHttpResponseOptions): ClientError;
|
|
376
|
+
}
|
|
377
|
+
//#endregion
|
|
378
|
+
//#region src/errors/error-attributes.d.ts
|
|
379
|
+
interface ErrorSummary {
|
|
380
|
+
errorName: string;
|
|
381
|
+
errorKind?: ClientErrorKind;
|
|
382
|
+
errorCode?: string;
|
|
383
|
+
recovery?: UserRecovery;
|
|
384
|
+
}
|
|
385
|
+
/** Extract secret-safe diagnostic attributes without copying runtime messages. */
|
|
386
|
+
declare function describeError(error: unknown): ErrorSummary;
|
|
387
|
+
//#endregion
|
|
388
|
+
//#region src/errors/presentation-descriptor.d.ts
|
|
389
|
+
declare const formatClientErrorContext: ClientErrorContextFormatter;
|
|
390
|
+
declare function readErrorPresentationDescriptor(error: unknown, options?: ReadErrorPresentationDescriptorOptions): ErrorPresentationDescriptor;
|
|
391
|
+
//#endregion
|
|
392
|
+
//#region src/cancellation/types.d.ts
|
|
393
|
+
/** Cancelable operation handle. */
|
|
394
|
+
interface CancelableHandle {
|
|
395
|
+
cancel(): void;
|
|
396
|
+
}
|
|
397
|
+
interface CancellationTokenErrorData {
|
|
398
|
+
readonly cancellationError: ClientError;
|
|
399
|
+
readonly reason: unknown;
|
|
400
|
+
}
|
|
401
|
+
/** Cooperative cancellation token — consumers check / subscribe to cancellation. */
|
|
402
|
+
interface CancellationTokenTrait extends InteropObservableTrait<CancellationTokenErrorData> {
|
|
403
|
+
readonly isCancellationRequested: boolean;
|
|
404
|
+
readonly cancellationError?: ClientError | undefined;
|
|
405
|
+
readonly reason?: unknown;
|
|
406
|
+
onCancellationRequested(listener: (data: CancellationTokenErrorData) => void): DisposableTrait;
|
|
407
|
+
throwIfCancellationRequested(): void;
|
|
408
|
+
}
|
|
409
|
+
interface CancellationTokenOptions {
|
|
410
|
+
cancellationToken?: CancellationTokenTrait;
|
|
411
|
+
}
|
|
412
|
+
/** Cancellation source — producer-side control. */
|
|
413
|
+
interface CancellationTokenSourceTrait {
|
|
414
|
+
readonly token: CancellationTokenTrait;
|
|
415
|
+
cancel(reason?: unknown): void;
|
|
416
|
+
}
|
|
417
|
+
//#endregion
|
|
418
|
+
//#region src/signals/types.d.ts
|
|
419
|
+
interface SignalOptions<T> {
|
|
420
|
+
equals?: (a: T, b: T) => boolean;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Read-only signal interface.
|
|
424
|
+
* Semantics align with TC39 Signals proposal, but uses an SDK-owned thin protocol
|
|
425
|
+
* to avoid coupling to any specific polyfill or standard implementation.
|
|
426
|
+
*/
|
|
427
|
+
interface ReadableSignalTrait<T> extends InteropObservableTrait<T> {
|
|
428
|
+
readonly equals: (a: unknown, b: unknown) => boolean;
|
|
429
|
+
/** Return the current snapshot value. */
|
|
430
|
+
get(): T;
|
|
431
|
+
/**
|
|
432
|
+
* Watch value invalidations.
|
|
433
|
+
* The stream does not emit the current value on subscription; use
|
|
434
|
+
* `[SYMBOL_OBSERVABLE]()` when value replay is required.
|
|
435
|
+
*/
|
|
436
|
+
watchStream(): EventStreamTrait<void>;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Writable signal interface.
|
|
440
|
+
* State transitions should be controlled by the client / service layer;
|
|
441
|
+
* external consumers typically only see the read-only projection.
|
|
442
|
+
*/
|
|
443
|
+
interface WritableSignalTrait<T> extends ReadableSignalTrait<T> {
|
|
444
|
+
set(value: T): void;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Computed (derived) signal — always read-only, value is derived from
|
|
448
|
+
* other signals automatically.
|
|
449
|
+
*/
|
|
450
|
+
interface ComputedSignalTrait<T> extends ReadableSignalTrait<T> {}
|
|
451
|
+
declare const ResourceStatus: {
|
|
452
|
+
readonly Idle: "idle";
|
|
453
|
+
readonly Loading: "loading";
|
|
454
|
+
readonly LoadingError: "loading_error";
|
|
455
|
+
readonly Reloading: "reloading";
|
|
456
|
+
readonly Resolved: "resolved";
|
|
457
|
+
readonly Error: "error";
|
|
458
|
+
};
|
|
459
|
+
type ResourceStatus = (typeof ResourceStatus)[keyof typeof ResourceStatus];
|
|
460
|
+
interface ResourceIdleSnapshot {
|
|
461
|
+
readonly status: typeof ResourceStatus.Idle;
|
|
462
|
+
}
|
|
463
|
+
interface ResourceLoadingSnapshot {
|
|
464
|
+
readonly status: typeof ResourceStatus.Loading;
|
|
465
|
+
}
|
|
466
|
+
interface ResourceLoadingErrorSnapshot {
|
|
467
|
+
readonly status: typeof ResourceStatus.LoadingError;
|
|
468
|
+
readonly error: unknown;
|
|
469
|
+
}
|
|
470
|
+
interface ResourceReloadingSnapshot<T> {
|
|
471
|
+
readonly status: typeof ResourceStatus.Reloading;
|
|
472
|
+
readonly value: T;
|
|
473
|
+
}
|
|
474
|
+
interface ResourceResolvedSnapshot<T> {
|
|
475
|
+
readonly status: typeof ResourceStatus.Resolved;
|
|
476
|
+
readonly value: T;
|
|
477
|
+
}
|
|
478
|
+
interface ResourceErrorSnapshot<T> {
|
|
479
|
+
readonly status: typeof ResourceStatus.Error;
|
|
480
|
+
readonly value: T;
|
|
481
|
+
readonly error: unknown;
|
|
482
|
+
}
|
|
483
|
+
type ResourceSnapshot<T> = ResourceIdleSnapshot | ResourceLoadingSnapshot | ResourceLoadingErrorSnapshot | ResourceReloadingSnapshot<T> | ResourceResolvedSnapshot<T> | ResourceErrorSnapshot<T>;
|
|
484
|
+
interface ResourceWhenValueOptions {
|
|
485
|
+
readonly cancellationToken?: CancellationTokenTrait;
|
|
486
|
+
readonly staleValueWhenError?: boolean;
|
|
487
|
+
}
|
|
488
|
+
interface ResourceTrait<T> extends DisposableTrait, InteropObservableTrait<ResourceSnapshot<T>> {
|
|
489
|
+
readonly value: ReadableSignalTrait<T>;
|
|
490
|
+
readonly status: ReadableSignalTrait<ResourceStatus>;
|
|
491
|
+
readonly error: ReadableSignalTrait<unknown | undefined>;
|
|
492
|
+
readonly isLoading: ReadableSignalTrait<boolean>;
|
|
493
|
+
readonly snapshot: ReadableSignalTrait<ResourceSnapshot<T>>;
|
|
494
|
+
hasValue(): boolean;
|
|
495
|
+
whenValue(options?: ResourceWhenValueOptions): Promise<T>;
|
|
496
|
+
}
|
|
497
|
+
//#endregion
|
|
498
|
+
//#region src/scheduling/types.d.ts
|
|
499
|
+
interface TimestampProviderTrait {
|
|
500
|
+
/** Return current epoch milliseconds. */
|
|
501
|
+
now(): number;
|
|
502
|
+
}
|
|
503
|
+
/** Injectable time capability for host timers and deterministic tests. */
|
|
504
|
+
interface TimeTrait extends TimestampProviderTrait {
|
|
505
|
+
/** Return current epoch milliseconds. */
|
|
506
|
+
setTimeout(handler: () => void, delayMs: number): unknown;
|
|
507
|
+
clearTimeout(handle: unknown): void;
|
|
508
|
+
}
|
|
509
|
+
declare const TIME_TRAIT_TOKEN: SecuritydeptInjectionToken<TimeTrait>;
|
|
510
|
+
declare const IDLE_CALLBACK_TRAIT_TOKEN: SecuritydeptInjectionToken<IdleCallbackTrait | null>;
|
|
511
|
+
/** Injectable idle-callback capability for hosts that explicitly support it. */
|
|
512
|
+
interface IdleCallbackTrait {
|
|
513
|
+
requestIdleCallback(callback: () => void): unknown;
|
|
514
|
+
cancelIdleCallback(handle: unknown): void;
|
|
515
|
+
}
|
|
516
|
+
//#endregion
|
|
517
|
+
//#region src/cancellation/create.d.ts
|
|
518
|
+
/**
|
|
519
|
+
* Create a `CancellationTokenSource` that produces a cooperative cancellation token.
|
|
520
|
+
*/
|
|
521
|
+
declare function createCancellationTokenSource(): CancellationTokenSourceTrait;
|
|
522
|
+
declare function isCancellationTokenTrait(obj: unknown): obj is CancellationTokenTrait;
|
|
523
|
+
//#endregion
|
|
524
|
+
//#region src/cancellation/linked.d.ts
|
|
525
|
+
/**
|
|
526
|
+
* Create a cancellation token that fires when ANY of the given source tokens
|
|
527
|
+
* is cancelled.
|
|
528
|
+
*
|
|
529
|
+
* - Zero sources → returns a token that is never cancelled.
|
|
530
|
+
* - One source → returns that source directly (no allocation).
|
|
531
|
+
* - N sources → creates a linked source, subscribes to all, and cleans up
|
|
532
|
+
* subscriptions once the linked token fires.
|
|
533
|
+
*
|
|
534
|
+
* @example
|
|
535
|
+
* const cts = createCancellationTokenSource();
|
|
536
|
+
* const linked = createLinkedCancellationToken(clientRoot.token, cts.token);
|
|
537
|
+
* await transport.execute({ ..., cancellationToken: linked });
|
|
538
|
+
*/
|
|
539
|
+
declare function createLinkedCancellationToken(...sources: readonly (CancellationTokenTrait | undefined | null)[]): CancellationTokenTrait & DisposableTrait;
|
|
540
|
+
//#endregion
|
|
541
|
+
//#region src/rx/event.d.ts
|
|
542
|
+
type RxEventStreamProducer<T> = (observer: EventObserverTrait<T>) => (() => void) | void;
|
|
543
|
+
type RxEventStreamInput<T> = ObservableInput<T> | InteropObservableTrait<T> | SubscribableTrait<T>;
|
|
544
|
+
declare class RxEventStream<T> extends Observable<T> implements EventStreamTrait<T>, InteropObservableTrait<T> {
|
|
545
|
+
constructor(source: RxEventStreamInput<T> | RxEventStreamProducer<T>);
|
|
546
|
+
[SYMBOL_OBSERVABLE](): RxEventStream<T>;
|
|
547
|
+
static fromObservableInput<T>(input: RxEventStreamInput<T>): RxEventStream<T>;
|
|
548
|
+
pipe(): RxEventStream<T>;
|
|
549
|
+
pipe<A>(op1: OperatorFunction<T, A>): RxEventStream<A>;
|
|
550
|
+
pipe<A, B>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>): RxEventStream<B>;
|
|
551
|
+
pipe<A, B, C>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): RxEventStream<C>;
|
|
552
|
+
pipe<A, B, C, D>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>): RxEventStream<D>;
|
|
553
|
+
pipe<A, B, C, D, E>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>): RxEventStream<E>;
|
|
554
|
+
pipe<A, B, C, D, E, F>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>): RxEventStream<F>;
|
|
555
|
+
pipe<A, B, C, D, E, F, G>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>): RxEventStream<G>;
|
|
556
|
+
pipe<A, B, C, D, E, F, G, H>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>): RxEventStream<H>;
|
|
557
|
+
pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>): RxEventStream<I>;
|
|
558
|
+
pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>, ...operations: OperatorFunction<any, any>[]): RxEventStream<unknown>;
|
|
559
|
+
}
|
|
560
|
+
declare class RxEventSubject<T> extends Subject<T> implements EventSubjectTrait<T> {
|
|
561
|
+
[SYMBOL_OBSERVABLE](): RxEventStream<T>;
|
|
562
|
+
asObservable(): RxEventStream<T>;
|
|
563
|
+
}
|
|
564
|
+
declare class RxEventReplaySubject<T> extends ReplaySubject<T> implements EventSubjectTrait<T> {
|
|
565
|
+
[SYMBOL_OBSERVABLE](): RxEventStream<T>;
|
|
566
|
+
asObservable(): RxEventStream<T>;
|
|
567
|
+
}
|
|
568
|
+
//#endregion
|
|
569
|
+
//#region src/rx/signal.d.ts
|
|
570
|
+
interface RxSignalDirtyEvent<T> {
|
|
571
|
+
epoch: number;
|
|
572
|
+
signal: ReadableSignalTrait<T>;
|
|
573
|
+
}
|
|
574
|
+
type RxSignalOptions<T> = SignalOptions<T>;
|
|
575
|
+
type RxSignalWatchScheduler<THandle = unknown> = (flush: () => void) => THandle;
|
|
576
|
+
type RxSignalWatchCanceller<THandle = unknown> = (handle: THandle) => void;
|
|
577
|
+
interface RxSignalWatchOptions {
|
|
578
|
+
schedule: RxSignalWatchScheduler;
|
|
579
|
+
cancel?: RxSignalWatchCanceller;
|
|
580
|
+
}
|
|
581
|
+
declare abstract class RxSignal<T> implements ReadableSignalTrait<T>, InteropObservableTrait<T> {
|
|
582
|
+
protected static globalEpoch: number;
|
|
583
|
+
protected static currentContext: RxComputedSignal<any> | null;
|
|
584
|
+
protected valueEqVersion: number;
|
|
585
|
+
readonly equals: (a: unknown, b: unknown) => boolean;
|
|
586
|
+
abstract get(): T;
|
|
587
|
+
abstract dirtyObservable(): Observable<RxSignalDirtyEvent<T>>;
|
|
588
|
+
protected constructor(options: RxSignalOptions<T> | undefined);
|
|
589
|
+
watchStream(options?: RxSignalWatchOptions): RxEventStream<void>;
|
|
590
|
+
[SYMBOL_OBSERVABLE](): RxEventStream<T>;
|
|
591
|
+
abstract validateForEpoch(epoch: number): void;
|
|
592
|
+
}
|
|
593
|
+
declare class RxStateSignal<T> extends RxSignal<T> implements InteropObservableTrait<T>, WritableSignalTrait<T> {
|
|
594
|
+
protected dirtySubject: Subject<RxSignalDirtyEvent<T>>;
|
|
595
|
+
protected value: BehaviorSubject<T>;
|
|
596
|
+
protected constructor(initialValue: T, options: RxSignalOptions<T> | undefined);
|
|
597
|
+
set(input: T): void;
|
|
598
|
+
static fromInitialValue<T>(initialValue: T, options?: RxSignalOptions<T>): RxStateSignalCompat<T>;
|
|
599
|
+
get(): T;
|
|
600
|
+
validateForEpoch(): void;
|
|
601
|
+
dirtyObservable(): Observable<RxSignalDirtyEvent<T>>;
|
|
602
|
+
[SYMBOL_OBSERVABLE](): RxEventStream<T>;
|
|
603
|
+
}
|
|
604
|
+
type RxStateSignalCompat<T> = WithInteropObservableTraitCompat<RxStateSignal<T>, T>;
|
|
605
|
+
type AnyRxSignal = RxSignal<any> & {
|
|
606
|
+
valueEqVersion: number;
|
|
607
|
+
};
|
|
608
|
+
type ComputedCacheState<T> = {
|
|
609
|
+
kind: "empty";
|
|
610
|
+
} | {
|
|
611
|
+
kind: "value";
|
|
612
|
+
value: T;
|
|
613
|
+
} | {
|
|
614
|
+
kind: "error";
|
|
615
|
+
error: unknown;
|
|
616
|
+
};
|
|
617
|
+
declare class RxComputedSignal<T> extends RxSignal<T> {
|
|
618
|
+
protected readonly computeFn: () => T;
|
|
619
|
+
protected cacheState: ComputedCacheState<T>;
|
|
620
|
+
protected sources: ReadonlyMap<AnyRxSignal, number>;
|
|
621
|
+
protected sourcesSubject: BehaviorSubject<ReadonlyMap<AnyRxSignal, number>>;
|
|
622
|
+
private validatedEpoch;
|
|
623
|
+
private isComputing;
|
|
624
|
+
private collectingSources;
|
|
625
|
+
private dirty$;
|
|
626
|
+
protected constructor(computeFn: () => T, options: RxSignalOptions<T> | undefined);
|
|
627
|
+
markDependency(signal: RxSignal<any>): void;
|
|
628
|
+
protected cacheStatesEqual(left: ComputedCacheState<T>, right: ComputedCacheState<T>): boolean;
|
|
629
|
+
protected recompute(): void;
|
|
630
|
+
validateForEpoch(epoch: number): void;
|
|
631
|
+
get(): T;
|
|
632
|
+
dirtyObservable(): Observable<RxSignalDirtyEvent<T>>;
|
|
633
|
+
static computed<T>(fn: () => T, options?: RxSignalOptions<T>): RxComputedSignalCompat<T>;
|
|
634
|
+
}
|
|
635
|
+
type RxComputedSignalCompat<T> = WithInteropObservableTraitCompat<RxComputedSignal<T>, T>;
|
|
636
|
+
//#endregion
|
|
637
|
+
//#region src/rx/resource.d.ts
|
|
638
|
+
interface RxResourceStreamContext<T, R> {
|
|
639
|
+
readonly request: R;
|
|
640
|
+
readonly previous: ResourceSnapshot<T>;
|
|
641
|
+
readonly cancellationToken: CancellationTokenTrait;
|
|
642
|
+
}
|
|
643
|
+
interface RxResourceOptions<T, R = undefined> {
|
|
644
|
+
readonly request?: ReadableSignalTrait<R | undefined> | (() => R | undefined);
|
|
645
|
+
readonly stream: (context: RxResourceStreamContext<T, R>) => ObservableInput<T>;
|
|
646
|
+
}
|
|
647
|
+
declare abstract class RxResourceBase<T> implements ResourceTrait<T>, InteropObservableTrait<ResourceSnapshot<T>> {
|
|
648
|
+
abstract readonly snapshot: ReadableSignalTrait<ResourceSnapshot<T>>;
|
|
649
|
+
readonly value: RxComputedSignalCompat<T>;
|
|
650
|
+
readonly status: RxComputedSignalCompat<ResourceStatus>;
|
|
651
|
+
readonly error: RxComputedSignalCompat<unknown | undefined>;
|
|
652
|
+
readonly isLoading: RxComputedSignalCompat<boolean>;
|
|
653
|
+
protected readonly destroyed: RxStateSignalCompat<boolean>;
|
|
654
|
+
protected readonly destroyed$: Observable<true>;
|
|
655
|
+
protected constructor();
|
|
656
|
+
hasValue(): boolean;
|
|
657
|
+
whenValue(options?: ResourceWhenValueOptions): Promise<T>;
|
|
658
|
+
dispose(): void;
|
|
659
|
+
[SYMBOL_DISPOSE](): void;
|
|
660
|
+
[SYMBOL_OBSERVABLE](): RxEventStream<ResourceSnapshot<T>>;
|
|
661
|
+
}
|
|
662
|
+
declare class RxResource<T, R = undefined> extends RxResourceBase<T> {
|
|
663
|
+
private readonly options;
|
|
664
|
+
readonly snapshot: RxStateSignalCompat<ResourceSnapshot<T>>;
|
|
665
|
+
constructor(options: RxResourceOptions<T, R>);
|
|
666
|
+
private connect;
|
|
667
|
+
static create<T, R = undefined>(options: RxResourceOptions<T, R>): RxResource<T, R>;
|
|
668
|
+
}
|
|
669
|
+
declare function resourceFromSnapshots<T>(source: () => ResourceSnapshot<T>): WithInteropObservableTraitCompat<ResourceTrait<T>, ResourceSnapshot<T>>;
|
|
670
|
+
declare function mapResource<T, U>(source: ResourceTrait<T>, mapValue: (value: T) => U): WithInteropObservableTraitCompat<ResourceTrait<U>, ResourceSnapshot<U>>;
|
|
671
|
+
declare function rxResource<T, R = undefined>(options: RxResourceOptions<T, R>): WithInteropObservableTraitCompat<ResourceTrait<T>, ResourceSnapshot<T>>;
|
|
672
|
+
//#endregion
|
|
673
|
+
export { ClientErrorContextFormatter as $, SecuritydeptClassProvider as $t, ResourceIdleSnapshot as A, SubscribableTrait as At, WritableSignalTrait as B, SYMBOL_DISPOSABLE_STACK as Bt, IdleCallbackTrait as C, EventStreamTrait as Ct, ComputedSignalTrait as D, InteropObservableTrait as Dt, TimestampProviderTrait as E, RuntimeEventEnvelope as Et, ResourceSnapshot as F, SecuritydeptInjector as Ft, formatClientErrorContext as G, injectDisposableStackFrom as Gt, CancellationTokenOptions as H, SimpleDisposableStack as Ht, ResourceStatus as I, AsyncDisposableTrait as It, describeError as J, inject$1 as Jt, readErrorPresentationDescriptor as K, withDisposableStack as Kt, ResourceTrait as L, DisposableStackTrait as Lt, ResourceLoadingSnapshot as M, WithInteropObservableTraitCompat as Mt, ResourceReloadingSnapshot as N, isInteropObservableTrait as Nt, ReadableSignalTrait as O, ObserverTrait as Ot, ResourceResolvedSnapshot as P, INJECTOR_TOKEN as Pt, ClientErrorFromUnknownOptions as Q, SecuritydeptAbstractType as Qt, ResourceWhenValueOptions as R, DisposableTrait as Rt, IDLE_CALLBACK_TRAIT_TOKEN as S, EventSourceKind as St, TimeTrait as T, EventSubscriptionTrait as Tt, CancellationTokenSourceTrait as U, StdDisposableStack as Ut, CancelableHandle as V, SYMBOL_DISPOSE as Vt, CancellationTokenTrait as W, createDisposableStack as Wt, ClientError as X, tryInjectInInjectionContext as Xt, CLIENT_ERROR_SPAN_ATTRIBUTE_PROVIDER_ID as Y, runInInjectionContext$1 as Yt, ClientErrorFromHttpResponseOptions as Z, SecurityDeptOptional as Zt, RxEventStream as _, SpanPathOptions as _t, resourceFromSnapshots as a, SecuritydeptInjectorTrait as an, ErrorPresentationTone as at, createCancellationTokenSource as b, EventOperatorFunction as bt, RxComputedSignalCompat as c, SecuritydeptValueProvider as cn, ServerErrorPresentation as ct, RxSignalWatchCanceller as d, getSecuritydeptProviderToken as dn, SPAN_TRAIT_TOKEN as dt, SecuritydeptDependencyDescriptor as en, ClientErrorKind as et, RxSignalWatchOptions as f, notMissingProvider as fn, SpanAttributeReadOptions as ft, RxEventReplaySubject as g, SpanNodeAttributes as gt, RxStateSignalCompat as h, SpanCreateOptions as ht, mapResource as i, SecuritydeptInjectionToken as in, ErrorPresentationDescriptor as it, ResourceLoadingErrorSnapshot as j, SubscriptionTrait as jt, ResourceErrorSnapshot as k, SYMBOL_OBSERVABLE as kt, RxSignalDirtyEvent as l, WithTraitDeps as ln, UserRecovery as lt, RxStateSignal as m, SpanAttributes as mt, RxResourceOptions as n, SecuritydeptExistingProvider as nn, ClientErrorSpanContext as nt, rxResource as o, SecuritydeptProvider as on, ErrorRecoveryActionDescriptor as ot, RxSignalWatchScheduler as p, SpanAttributeValue as pt, ErrorSummary as q, SecuritydeptInjectOptions as qt, RxResourceStreamContext as r, SecuritydeptFactoryProvider as rn, ErrorCodePresentation as rt, RxComputedSignal as s, SecuritydeptTypeProvider as sn, ReadErrorPresentationDescriptorOptions as st, RxResource as t, SecuritydeptDependencyToken as tn, ClientErrorSource as tt, RxSignalOptions as u, createProviderIfTokenMissing as un, MutableSpanTrait as ut, RxEventSubject as v, SpanTrait as vt, TIME_TRAIT_TOKEN as w, EventSubjectTrait as wt, isCancellationTokenTrait as x, EventSource as xt, createLinkedCancellationToken as y, EventObserverTrait as yt, SignalOptions as z, SYMBOL_ASYNC_DISPOSE as zt };
|
|
674
|
+
//# sourceMappingURL=index-CFAJ969E.d.mts.map
|