Skip to content

Commit

Permalink
feat(urbex): added core urbex class for creating http clients
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael committed Oct 16, 2022
1 parent 40288e0 commit ac5216e
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions lib/core/urbex.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import type { RequestUrlPath } from "../types";
import type { UrbexClientConfig } from "./config/request-config";

import { RequestApi } from "./api/request-api";
import { RequestConfig } from "./config/request-config";

export class UrbexClient extends RequestApi {
private $config: RequestConfig;
private $interceptors = {};
private $subscriptions = {};

constructor(config?: UrbexClientConfig) {
super();

this.$config = new RequestConfig(config);
}

/**
*
* Creates a new instance of the UrbexClient.
*/
static create(): UrbexClient {
return new UrbexClient();
}

get config(): UrbexClientConfig {
return this.$config.get();
}

/**
* Configures the UrbexClient.
*
* @param config The configuration to use.
*/
public configure(config: UrbexClientConfig): void {
this.$config.set(config);
}

public get() {}

public post() {}

public put() {}

public patch() {}

public delete() {}

public head() {}

public options() {}
}

export function isUrbexClient(client: unknown): client is UrbexClient {
return client instanceof UrbexClient;
}

0 comments on commit ac5216e

Please sign in to comment.