silgi 0.3.2 → 0.3.3
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/cli/index.mjs +1 -1
- package/dist/index.d.mts +8 -6
- package/dist/index.d.ts +8 -6
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -58,15 +58,17 @@ declare class SilgiError extends Error {
|
|
|
58
58
|
type RequestBodyOption<Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route]> = SilgiRouterTypes[Route][Method] extends {
|
|
59
59
|
input: any;
|
|
60
60
|
} ? {
|
|
61
|
-
body
|
|
61
|
+
body?: SilgiRouterTypes[Route][Method]['input'];
|
|
62
62
|
} : {
|
|
63
63
|
body?: never;
|
|
64
64
|
};
|
|
65
|
-
type DefaultMethod<Route extends keyof SilgiRouterTypes> =
|
|
66
|
-
type
|
|
67
|
-
method
|
|
68
|
-
}
|
|
69
|
-
type SilgiFetchClient = <Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route] = DefaultMethod<Route>>(url: Route, options?:
|
|
65
|
+
type DefaultMethod<Route extends keyof SilgiRouterTypes> = keyof SilgiRouterTypes[Route];
|
|
66
|
+
type SilgiFetchOptions<Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route] = keyof SilgiRouterTypes[Route]> = {
|
|
67
|
+
method?: Method;
|
|
68
|
+
} & RequestBodyOption<Route, Method> & Omit<FetchOptions, 'query' | 'body' | 'method'>;
|
|
69
|
+
type SilgiFetchClient = <Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route] = DefaultMethod<Route>>(url: Route, options?: SilgiFetchOptions<Route, Method>) => Promise<SilgiRouterTypes[Route][Method] extends {
|
|
70
|
+
output: any;
|
|
71
|
+
} ? SilgiRouterTypes[Route][Method]['output'] : any>;
|
|
70
72
|
declare function createSilgiFetch(options: FetchOptions | ((options: FetchOptions) => FetchOptions), localFetch?: typeof globalThis.$fetch): SilgiFetchClient;
|
|
71
73
|
|
|
72
74
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -58,15 +58,17 @@ declare class SilgiError extends Error {
|
|
|
58
58
|
type RequestBodyOption<Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route]> = SilgiRouterTypes[Route][Method] extends {
|
|
59
59
|
input: any;
|
|
60
60
|
} ? {
|
|
61
|
-
body
|
|
61
|
+
body?: SilgiRouterTypes[Route][Method]['input'];
|
|
62
62
|
} : {
|
|
63
63
|
body?: never;
|
|
64
64
|
};
|
|
65
|
-
type DefaultMethod<Route extends keyof SilgiRouterTypes> =
|
|
66
|
-
type
|
|
67
|
-
method
|
|
68
|
-
}
|
|
69
|
-
type SilgiFetchClient = <Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route] = DefaultMethod<Route>>(url: Route, options?:
|
|
65
|
+
type DefaultMethod<Route extends keyof SilgiRouterTypes> = keyof SilgiRouterTypes[Route];
|
|
66
|
+
type SilgiFetchOptions<Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route] = keyof SilgiRouterTypes[Route]> = {
|
|
67
|
+
method?: Method;
|
|
68
|
+
} & RequestBodyOption<Route, Method> & Omit<FetchOptions, 'query' | 'body' | 'method'>;
|
|
69
|
+
type SilgiFetchClient = <Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route] = DefaultMethod<Route>>(url: Route, options?: SilgiFetchOptions<Route, Method>) => Promise<SilgiRouterTypes[Route][Method] extends {
|
|
70
|
+
output: any;
|
|
71
|
+
} ? SilgiRouterTypes[Route][Method]['output'] : any>;
|
|
70
72
|
declare function createSilgiFetch(options: FetchOptions | ((options: FetchOptions) => FetchOptions), localFetch?: typeof globalThis.$fetch): SilgiFetchClient;
|
|
71
73
|
|
|
72
74
|
/**
|