@orpc/client 0.0.0-next.d16a1b6 → 0.0.0-next.d1f8ea3
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 +14 -1
- package/dist/adapters/fetch/index.d.mts +13 -16
- package/dist/adapters/fetch/index.d.ts +13 -16
- package/dist/adapters/fetch/index.mjs +14 -14
- package/dist/adapters/standard/index.d.mts +7 -147
- package/dist/adapters/standard/index.d.ts +7 -147
- package/dist/adapters/standard/index.mjs +2 -2
- package/dist/index.d.mts +20 -18
- package/dist/index.d.ts +20 -18
- package/dist/index.mjs +35 -33
- package/dist/plugins/index.d.mts +61 -0
- package/dist/plugins/index.d.ts +61 -0
- package/dist/plugins/index.mjs +126 -0
- package/dist/shared/client.3Fsj0tpH.d.mts +30 -0
- package/dist/shared/client.3Fsj0tpH.d.ts +30 -0
- package/dist/shared/client.CQMGo-9I.d.ts +103 -0
- package/dist/shared/client.D0qRuwQp.d.mts +103 -0
- package/dist/shared/{client.MkoaGU3v.mjs → client.D77bw0hs.mjs} +149 -137
- package/dist/shared/client.DZhZ5QON.d.ts +39 -0
- package/dist/shared/client.Dpozrd9X.d.mts +39 -0
- package/dist/shared/{client.DcaJQZfy.mjs → client.jKEwIsRd.mjs} +6 -96
- package/package.json +10 -5
- package/dist/shared/client.D_CzLDyB.d.mts +0 -42
- package/dist/shared/client.D_CzLDyB.d.ts +0 -42
@@ -1,42 +0,0 @@
|
|
1
|
-
type ClientContext = Record<string, any>;
|
2
|
-
type ClientOptions<TClientContext extends ClientContext> = {
|
3
|
-
signal?: AbortSignal;
|
4
|
-
lastEventId?: string | undefined;
|
5
|
-
} & (Record<never, never> extends TClientContext ? {
|
6
|
-
context?: TClientContext;
|
7
|
-
} : {
|
8
|
-
context: TClientContext;
|
9
|
-
});
|
10
|
-
type ClientRest<TClientContext extends ClientContext, TInput> = Record<never, never> extends TClientContext ? undefined extends TInput ? [input?: TInput, options?: ClientOptions<TClientContext>] : [input: TInput, options?: ClientOptions<TClientContext>] : [input: TInput, options: ClientOptions<TClientContext>];
|
11
|
-
type ClientPromiseResult<TOutput, TError extends Error> = Promise<TOutput> & {
|
12
|
-
__error?: {
|
13
|
-
type: TError;
|
14
|
-
};
|
15
|
-
};
|
16
|
-
interface Client<TClientContext extends ClientContext, TInput, TOutput, TError extends Error> {
|
17
|
-
(...rest: ClientRest<TClientContext, TInput>): ClientPromiseResult<TOutput, TError>;
|
18
|
-
}
|
19
|
-
type NestedClient<TClientContext extends ClientContext> = Client<TClientContext, any, any, any> | {
|
20
|
-
[k: string]: NestedClient<TClientContext>;
|
21
|
-
};
|
22
|
-
type InferClientContext<T extends NestedClient<any>> = T extends NestedClient<infer U> ? U : never;
|
23
|
-
type ClientOptionsOut<TClientContext extends ClientContext> = ClientOptions<TClientContext> & {
|
24
|
-
context: TClientContext;
|
25
|
-
};
|
26
|
-
interface ClientLink<TClientContext extends ClientContext> {
|
27
|
-
call: (path: readonly string[], input: unknown, options: ClientOptionsOut<TClientContext>) => Promise<unknown>;
|
28
|
-
}
|
29
|
-
|
30
|
-
declare function mapEventIterator<TYield, TReturn, TNext, TMap = TYield | TReturn>(iterator: AsyncIterator<TYield, TReturn, TNext>, maps: {
|
31
|
-
value: (value: NoInfer<TYield | TReturn>, done: boolean | undefined) => Promise<TMap>;
|
32
|
-
error: (error: unknown) => Promise<unknown>;
|
33
|
-
}): AsyncGenerator<TMap, TMap, TNext>;
|
34
|
-
interface EventIteratorReconnectOptions {
|
35
|
-
lastRetry: number | undefined;
|
36
|
-
lastEventId: string | undefined;
|
37
|
-
retryTimes: number;
|
38
|
-
error: unknown;
|
39
|
-
}
|
40
|
-
declare function createAutoRetryEventIterator<TYield, TReturn>(initial: AsyncIterator<TYield, TReturn, void>, reconnect: (options: EventIteratorReconnectOptions) => Promise<AsyncIterator<TYield, TReturn, void> | null>, initialLastEventId: string | undefined): AsyncGenerator<TYield, TReturn, void>;
|
41
|
-
|
42
|
-
export { type ClientContext as C, type EventIteratorReconnectOptions as E, type InferClientContext as I, type NestedClient as N, type ClientOptionsOut as a, type ClientLink as b, type ClientPromiseResult as c, createAutoRetryEventIterator as d, type ClientOptions as e, type ClientRest as f, type Client as g, mapEventIterator as m };
|