Skip to content

Commit ee21b99

Browse files
committed
feat: export additional types from client module for better type accessibility
1 parent aae84da commit ee21b99

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

packages/api/src/client/client.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ import type {
1313
SomeObject,
1414
} from '../types.js';
1515

16-
type InitialConfig = {
16+
export type InitialConfig = {
1717
method: string;
1818
url: string;
1919
};
2020

21-
type Handler<
21+
export type Handler<
2222
I,
2323
O,
2424
M extends string,
@@ -42,12 +42,14 @@ type Handler<
4242
T<OI = I, OO = O>(): Handler<OI, OO, M, U, S, T, C>;
4343
};
4444

45-
type HandleBuilder<M extends string, C extends SomeObject> = <U extends string>(
45+
export type HandleBuilder<M extends string, C extends SomeObject> = <
46+
U extends string,
47+
>(
4648
url: U,
4749
initialConfig?: C,
4850
) => Handler<ExtractPathParams<U>, unknown, M, U, never, never, C>;
4951

50-
type Action<Req, Ctx> = (
52+
export type Action<Req, Ctx> = (
5153
opts: Prettify<
5254
Options & {
5355
req: Req;

packages/api/src/client/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
export { ApiClient } from './client.js';
22
export { createClient } from './createClient.js';
3-
export type { ApiClientOptions } from './client.js';
3+
export type {
4+
ApiClientOptions,
5+
Handler as ApiClientHandler,
6+
HandleBuilder as ApiClientHandleBuilder,
7+
Action as ApiClientAction,
8+
InitialConfig as ApiClientInitialConfig,
9+
} from './client.js';
410

511
export * from './middleware/replacePathParams.js';
612
export * from './middleware/refreshToken.js';

0 commit comments

Comments
 (0)