Skip to content

Commit 8a3e9c7

Browse files
committed
chore: update readme
1 parent dfd392f commit 8a3e9c7

3 files changed

Lines changed: 101 additions & 1 deletion

File tree

packages/js/client/README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,92 @@ Invoke a wrapper.
5555

5656
# Reference
5757

58+
## Configuration
59+
60+
Below you will find a reference of object definitions which can be used to configure the Polywrap client. Please note that the intended way of configuring the client is to use the `ClientConfigBuilder`, as explained above.
61+
62+
### ClientConfig
63+
```ts
64+
/**
65+
* Client configuration that can be passed to the PolywrapClient
66+
*
67+
* @remarks
68+
* The PolywrapClient converts the ClientConfig to a CoreClientConfig.
69+
*/
70+
export interface ClientConfig {
71+
/** set environmental variables for a wrapper */
72+
readonly envs: Env[];
73+
74+
/** register interface implementations */
75+
readonly interfaces: InterfaceImplementations[];
76+
77+
/** redirect invocations from one uri to another */
78+
readonly redirects: IUriRedirect[];
79+
80+
/** add embedded wrappers */
81+
readonly wrappers: IUriWrapper[];
82+
83+
/** add and configure embedded packages */
84+
readonly packages: IUriPackage[];
85+
86+
/** customize URI resolution
87+
*
88+
* @remarks
89+
* A UriResolverLike can be any one of:
90+
* IUriResolver<unknown>
91+
* | IUriRedirect
92+
* | IUriPackage
93+
* | IUriWrapper
94+
* | UriResolverLike[]
95+
* */
96+
readonly resolvers: UriResolverLike[];
97+
}
98+
```
99+
100+
### PolywrapClientConfig
101+
```ts
102+
/**
103+
* Client configuration that can be passed to the PolywrapClient.
104+
*
105+
* @remarks
106+
* Extends ClientConfig from @polywrap/client-js.
107+
* The PolywrapClient converts the PolywrapClientConfig to a CoreClientConfig.
108+
*/
109+
export interface PolywrapClientConfig<TUri extends Uri | string = string> {
110+
/** set environmental variables for a wrapper */
111+
readonly envs: GenericEnv<TUri>[];
112+
113+
/** register interface implementations */
114+
readonly interfaces: GenericInterfaceImplementations<TUri>[];
115+
116+
/** redirect invocations from one uri to another */
117+
readonly redirects: IGenericUriRedirect<TUri>[];
118+
119+
/** add embedded wrappers */
120+
readonly wrappers: IGenericUriWrapper<TUri>[];
121+
122+
/** add and configure embedded packages */
123+
readonly packages: IGenericUriPackage<TUri>[];
124+
125+
/** customize URI resolution
126+
*
127+
* @remarks
128+
* A UriResolverLike can be any one of:
129+
* IUriResolver<unknown>
130+
* | IUriRedirect
131+
* | IUriPackage
132+
* | IUriWrapper
133+
* | UriResolverLike<TUri>[]
134+
* */
135+
readonly resolvers: GenericUriResolverLike<TUri>[];
136+
/** a wrapper cache to be used in place of the default wrapper cache */
137+
readonly wrapperCache?: IWrapperCache;
138+
139+
/** configuration for opentelemetry tracing to aid in debugging */
140+
readonly tracerConfig?: Readonly<Partial<TracerConfig>>;
141+
}
142+
```
143+
58144
## PolywrapClient
59145

60146
### Constructor

packages/js/client/readme/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ $snippet: quickstart-invoke
4141

4242
# Reference
4343

44+
## Configuration
45+
46+
Below you will find a reference of object definitions which can be used to configure the Polywrap client. Please note that the intended way of configuring the client is to use the `ClientConfigBuilder`, as explained above.
47+
48+
### ClientConfig
49+
```ts
50+
$snippet: ClientConfig
51+
```
52+
53+
### PolywrapClientConfig
54+
```ts
55+
$snippet: PolywrapClientConfig
56+
```
57+
4458
## PolywrapClient
4559

4660
### Constructor

packages/js/client/src/legacy/PolywrapClientConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { Uri } from "@polywrap/core-js";
1616
* Client configuration that can be passed to the PolywrapClient.
1717
*
1818
* @remarks
19-
* Extends ClientConfig from @polywrap/client-config-builder-js.
19+
* Extends ClientConfig from @polywrap/client-js.
2020
* The PolywrapClient converts the PolywrapClientConfig to a CoreClientConfig.
2121
*/
2222
export interface PolywrapClientConfig<TUri extends Uri | string = string> {

0 commit comments

Comments
 (0)