99
1010import { invokeTauriCommand } from './helpers/tauri'
1111
12- export interface ClientOptions {
12+ interface ClientOptions {
1313 maxRedirections : number
1414 connectTimeout : number
1515}
1616
17- export enum ResponseType {
17+ enum ResponseType {
1818 JSON = 1 ,
1919 Text = 2 ,
2020 Binary = 3
2121}
2222
23- export type Part = 'string' | number [ ]
23+ type Part = 'string' | number [ ]
2424
2525/** The body object to be used on POST and PUT requests. */
26- export class Body {
26+ class Body {
2727 type : string
2828 payload : unknown
2929
3030 /** @ignore */
31- constructor ( type : string , payload : unknown ) {
31+ private constructor ( type : string , payload : unknown ) {
3232 this . type = type
3333 this . payload = payload
3434 }
@@ -79,7 +79,7 @@ export class Body {
7979}
8080
8181/** The request HTTP verb. */
82- export type HttpVerb =
82+ type HttpVerb =
8383 | 'GET'
8484 | 'POST'
8585 | 'PUT'
@@ -91,7 +91,7 @@ export type HttpVerb =
9191 | 'TRACE'
9292
9393/** Options object sent to the backend. */
94- export interface HttpOptions {
94+ interface HttpOptions {
9595 method : HttpVerb
9696 url : string
9797 headers ?: Record < string , any >
@@ -102,12 +102,12 @@ export interface HttpOptions {
102102}
103103
104104/** Request options. */
105- export type RequestOptions = Omit < HttpOptions , 'method' | 'url' >
105+ type RequestOptions = Omit < HttpOptions , 'method' | 'url' >
106106/** Options for the `fetch` API. */
107- export type FetchOptions = Omit < HttpOptions , 'url' >
107+ type FetchOptions = Omit < HttpOptions , 'url' >
108108
109109/** Response object. */
110- export interface Response < T > {
110+ interface Response < T > {
111111 /** The request URL. */
112112 url : string
113113 /** The response status code. */
@@ -118,7 +118,7 @@ export interface Response<T> {
118118 data : T
119119}
120120
121- export class Client {
121+ class Client {
122122 id : number
123123 /** @ignore */
124124 constructor ( id : number ) {
@@ -286,4 +286,15 @@ async function fetch<T>(
286286 } )
287287}
288288
289- export { getClient , fetch }
289+ export type {
290+ ClientOptions ,
291+ ResponseType ,
292+ Part ,
293+ HttpVerb ,
294+ HttpOptions ,
295+ RequestOptions ,
296+ FetchOptions ,
297+ Response
298+ }
299+
300+ export { getClient , fetch , Body , Client }
0 commit comments