feat: add relay factory
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { Api } from "./api.ts";
|
||||
import { makeRelayClient, RelayClient, RelayClientConfig } from "./client.ts";
|
||||
import { Procedure } from "./procedure.ts";
|
||||
import { Route, RouteMethod } from "./route.ts";
|
||||
@@ -24,6 +25,15 @@ export class Relay<
|
||||
indexRelays(relays, this.#index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new relay api instance with the given relays.
|
||||
*
|
||||
* @param relays - List of relays to handle.
|
||||
*/
|
||||
api<TRelays extends (Procedure | Route)[]>(relays: TRelays): Api<TRelays> {
|
||||
return new Api<TRelays>(relays);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new relay client instance from the instance procedures.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user