···2626Hey API natively supports the following clients.
27272828- [Fetch API](/openapi-ts/clients/fetch)
2929+- [Angular](/openapi-ts/clients/angular)
2930- [Axios](/openapi-ts/clients/axios)
3031- [Next.js](/openapi-ts/clients/next-js)
3132- [Nuxt](/openapi-ts/clients/nuxt)
3232-- [Angular](/openapi-ts/clients/angular) <span data-soon>Soon</span>
3333- [Effect](/openapi-ts/clients/effect) <span data-soon>Soon</span>
3434- [Legacy](/openapi-ts/clients/legacy)
3535
+173-61
docs/openapi-ts/clients/angular.md
···11---
22-title: Angular client
33-description: Angular client for Hey API. Compatible with all our features.
22+title: Angular v20 Client
33+description: Generate a type-safe Angular v20 client from OpenAPI with the Angular client for openapi-ts. Fully compatible with validators, transformers, and all core features.
44---
5566<script setup lang="ts">
77-import { embedProject } from '../../embed'
77+import AuthorsList from '@components/AuthorsList.vue';
88+import Heading from '@components/Heading.vue';
99+import { maxScopp } from '@data/people.js';
1010+import AngularVersionSwitcher from '@versions/AngularVersionSwitcher.vue';
811</script>
9121013<Heading>
1114 <h1>Angular</h1>
1212- <VersionLabel value="v1" />
1313- <ExperimentalLabel />
1515+ <AngularVersionSwitcher />
1416</Heading>
15171818+::: warning
1919+Angular client is currently in beta. The interface might change before it becomes stable. We encourage you to leave feedback on [GitHub](https://github.com/hey-api/openapi-ts/issues).
2020+:::
2121+1622### About
17231818-[Angular](https://angular.dev/) is a web framework for building fast, reliable applications.
2424+[Angular](https://angular.dev/) is a web framework that empowers developers to build fast, reliable applications.
19252020-::: warning Requirements
2121-**Angular 19+** is required for full feature support, including the experimental `httpResource` API.
2222-:::
2626+The Angular client for Hey API generates a type-safe client from your OpenAPI spec, fully compatible with validators, transformers, and all core features.
2727+2828+### Collaborators
23292424-::: tip First Release
2525-Angular client support is in its first release. Share your feedback on [GitHub](https://github.com/hey-api/openapi-ts/issues).
2626-:::
3030+<AuthorsList :people="[maxScopp]" />
27312832## Features
29333030-- Modern Angular patterns with signals and reactive programming
3131-- Dependency injection with `@Injectable()` decorators
3232-- Type-safe response data and errors
3333-- Experimental **httpResource** support (Angular 19+)
3434+- Angular v20 support
3535+- seamless integration with `@hey-api/openapi-ts` ecosystem
3636+- type-safe response data and errors
3737+- support for [`@Injectable()`](https://angular.dev/api/core/Injectable) decorators
3838+- response data validation and transformation
3939+- access to the original request and response
4040+- granular request and response customization options
4141+- minimal learning curve thanks to extending the underlying technology
4242+- support bundling inside the generated output
4343+4444+## Installation
34453535-## Usage
4646+In your [configuration](/openapi-ts/get-started), add `@hey-api/client-angular` to your plugins and you'll be ready to generate client artifacts. :tada:
36473737-Add `@hey-api/client-angular` to your plugins:
4848+::: code-group
38493939-```js
5050+```js [config]
4051export default {
4152 input: 'https://get.heyapi.dev/hey-api/backend',
4253 output: 'src/client',
4343- plugins: [
4444- '@hey-api/client-angular', // [!code ++]
4545- ],
5454+ plugins: ['@hey-api/client-angular'], // [!code ++]
4655};
4756```
48574949-After generating the client, integrate it with Angular's `HttpClient` by adding `provideHeyApiClient` to your app configuration:
5858+```sh [cli]
5959+npx @hey-api/openapi-ts \
6060+ -i https://get.heyapi.dev/hey-api/backend \
6161+ -o src/client \
6262+ -c @hey-api/client-angular # [!code ++]
6363+```
6464+6565+:::
6666+6767+### Providers
6868+6969+You can use the Angular client in your application by adding `provideHeyApiClient` to your providers.
50705171```ts
5252-import { provideHttpClient, withFetch } from '@angular/common/http';
5372import { provideHeyApiClient, client } from './client/client.gen';
54735555-export const appConfig = {
7474+export const appConfig: ApplicationConfig = {
5675 providers: [
5776 provideHttpClient(withFetch()),
5877 provideHeyApiClient(client), // [!code ++]
···62816382## Configuration
64836565-### Injectable Classes Configuration
8484+The Angular client is built as a thin wrapper on top of Angular, extending its functionality to work with Hey API. If you're already familiar with Angular, configuring your client will feel like working directly with Angular.
8585+8686+When we installed the client above, it created a [`client.gen.ts`](/openapi-ts/output#client) file. You will most likely want to configure the exported `client` instance. There are two ways to do that.
8787+8888+### `setConfig()`
66896767-You can configure the SDK to generate injectable classes by setting the `asClass` option to `true` in your plugin configuration. This will generate Angular services with `@Injectable()` decorators, making them available for dependency injection.
9090+This is the simpler approach. You can call the `setConfig()` method at the beginning of your application or anytime you need to update the client configuration. You can pass any `HttpRequest` configuration option to `setConfig()`, and even your own [`httpClient`](#custom-httpclient) implementation.
9191+9292+```js
9393+import { client } from 'client/client.gen';
9494+9595+client.setConfig({
9696+ baseUrl: 'https://example.com',
9797+});
9898+```
9999+100100+The disadvantage of this approach is that your code may call the `client` instance before it's configured for the first time. Depending on your use case, you might need to use the second approach.
101101+102102+### Runtime API
103103+104104+Since `client.gen.ts` is a generated file, we can't directly modify it. Instead, we can tell our configuration to use a custom file implementing the Runtime API. We do that by specifying the `runtimeConfigPath` option.
6810569106```js
70107export default {
71108 input: 'https://get.heyapi.dev/hey-api/backend',
72109 output: 'src/client',
73110 plugins: [
7474- '@hey-api/client-angular',
75111 {
7676- name: '@hey-api/sdk',
7777- asClass: true, // [!code ++]
112112+ name: '@hey-api/client-angular',
113113+ runtimeConfigPath: './src/hey-api.ts', // [!code ++]
78114 },
79115 ],
80116};
81117```
821188383-::: warning
8484-While this feature is available, it is **discouraged** as it can negatively impact tree shaking, leading to larger bundle sizes. Consider using other configuration options for better optimization.
8585-:::
119119+In our custom file, we need to export a `createClientConfig()` method. This function is a simple wrapper allowing us to override configuration values.
861208787-### Angular Providers
121121+::: code-group
881228989-Use `provideHeyApiClient` to integrate the generated client with Angular's `HttpClient`:
123123+```ts [hey-api.ts]
124124+import type { CreateClientConfig } from './client/client.gen';
901259191-```ts
9292-import { provideHttpClient, withFetch } from '@angular/common/http';
9393-import { provideHeyApiClient, client } from './client/client.gen';
9494-9595-export const appConfig = {
9696- providers: [provideHttpClient(withFetch()), provideHeyApiClient(client)],
9797-};
126126+export const createClientConfig: CreateClientConfig = (config) => ({
127127+ ...config,
128128+ baseUrl: 'https://example.com',
129129+});
98130```
99131132132+:::
133133+134134+With this approach, `client.gen.ts` will call `createClientConfig()` before initializing the `client` instance. If needed, you can still use `setConfig()` to update the client configuration later.
135135+100136### `createClient()`
101137102102-Manually create a client instance for custom configurations:
138138+You can also create your own client instance. You can use it to manually send requests or point it to a different domain.
103139104104-```ts
140140+```js
105141import { createClient } from './client/client';
106142107143const myClient = createClient({
···109145});
110146```
111147112112-## Plugin Configuration
148148+You can also pass this instance to any SDK function through the `client` option. This will override the default instance from `client.gen.ts`.
113149114114-The `@hey-api/client-angular` plugin supports options like `throwOnError` for error handling:
150150+```js
151151+const response = await getFoo({
152152+ client: myClient,
153153+});
154154+```
155155+156156+### SDKs
157157+158158+Alternatively, you can pass the client configuration options to each SDK function. This is useful if you don't want to create a client instance for one-off use cases.
115159116160```js
161161+const response = await getFoo({
162162+ baseUrl: 'https://example.com', // <-- override default configuration
163163+});
164164+```
165165+166166+## `@Injectable`
167167+168168+If you prefer to use the [`@Injectable()`](https://angular.dev/api/core/Injectable) decorators, set the `asClass` option in your SDK plugin to `true`.
169169+170170+::: code-group
171171+172172+```ts [example]
173173+@Injectable({ providedIn: 'root' })
174174+export class FooService {
175175+ // class methods
176176+}
177177+```
178178+179179+```js [config]
117180export default {
118181 input: 'https://get.heyapi.dev/hey-api/backend',
119182 output: 'src/client',
120183 plugins: [
184184+ '@hey-api/client-angular',
121185 {
122122- name: '@hey-api/client-angular',
123123- throwOnError: false,
186186+ name: '@hey-api/sdk',
187187+ asClass: true, // [!code ++]
124188 },
125189 ],
126190};
127191```
128192129129-## httpResource
193193+:::
194194+195195+## Interceptors
196196+197197+::: warning
198198+This section is under construction. We appreciate your patience.
199199+:::
200200+201201+## Auth
202202+203203+::: warning
204204+This section is under construction. We appreciate your patience.
205205+:::
206206+207207+## Build URL
208208+209209+If you need to access the compiled URL, you can use the `buildUrl()` method. It's loosely typed by default to accept almost any value; in practice, you will want to pass a type hint.
210210+211211+```ts
212212+type FooData = {
213213+ path: {
214214+ fooId: number;
215215+ };
216216+ query?: {
217217+ bar?: string;
218218+ };
219219+ url: '/foo/{fooId}';
220220+};
221221+222222+const url = client.buildUrl<FooData>({
223223+ path: {
224224+ fooId: 1,
225225+ },
226226+ query: {
227227+ bar: 'baz',
228228+ },
229229+ url: '/foo/{fooId}',
230230+});
231231+console.log(url); // prints '/foo/1?bar=baz'
232232+```
130233131131-Angular 19 introduces a experimental api – `httpResource`, a reactive approach to data loading. Enable it with:
234234+## Custom `httpClient`
235235+236236+You can implement your own `httpClient`. This is useful if you need to extend the default `httpClient` methods with extra functionality, or replace it altogether.
132237133238```js
134134-export default {
135135- plugins: [
136136- {
137137- name: '@angular/common',
138138- httpResource: {
139139- enabled: true,
140140- asClass: true,
141141- },
142142- },
143143- ],
144144-};
239239+import { client } from 'client/client.gen';
240240+241241+client.setConfig({
242242+ httpClient: inject(CustomHttpClient),
243243+});
145244```
245245+246246+You can use any of the approaches mentioned in [Configuration](#configuration), depending on how granular you want your custom client to be.
247247+248248+## Plugins
249249+250250+You might be also interested in the [Angular](/openapi-ts/plugins/angular) plugin.
251251+252252+## API
253253+254254+You can view the complete list of options in the [UserConfig](https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/plugins/@hey-api/client-angular/types.d.ts) interface.
255255+256256+<!--@include: ../../partials/examples.md-->
257257+<!--@include: ../../partials/sponsors.md-->
+257
docs/openapi-ts/clients/angular/v19.md
···11+---
22+title: Angular v19 Client
33+description: Generate a type-safe Angular v19 client from OpenAPI with the Angular client for openapi-ts. Fully compatible with validators, transformers, and all core features.
44+---
55+66+<script setup lang="ts">
77+import AuthorsList from '@components/AuthorsList.vue';
88+import Heading from '@components/Heading.vue';
99+import { maxScopp } from '@data/people.js';
1010+import AngularVersionSwitcher from '@versions/AngularVersionSwitcher.vue';
1111+</script>
1212+1313+<Heading>
1414+ <h1>Angular</h1>
1515+ <AngularVersionSwitcher />
1616+</Heading>
1717+1818+::: warning
1919+Angular client is currently in beta. The interface might change before it becomes stable. We encourage you to leave feedback on [GitHub](https://github.com/hey-api/openapi-ts/issues).
2020+:::
2121+2222+### About
2323+2424+[Angular](https://angular.dev/) is a web framework that empowers developers to build fast, reliable applications.
2525+2626+The Angular client for Hey API generates a type-safe client from your OpenAPI spec, fully compatible with validators, transformers, and all core features.
2727+2828+### Collaborators
2929+3030+<AuthorsList :people="[maxScopp]" />
3131+3232+## Features
3333+3434+- Angular v19 support
3535+- seamless integration with `@hey-api/openapi-ts` ecosystem
3636+- type-safe response data and errors
3737+- support for [`@Injectable()`](https://angular.dev/api/core/Injectable) decorators
3838+- response data validation and transformation
3939+- access to the original request and response
4040+- granular request and response customization options
4141+- minimal learning curve thanks to extending the underlying technology
4242+- support bundling inside the generated output
4343+4444+## Installation
4545+4646+In your [configuration](/openapi-ts/get-started), add `@hey-api/client-angular` to your plugins and you'll be ready to generate client artifacts. :tada:
4747+4848+::: code-group
4949+5050+```js [config]
5151+export default {
5252+ input: 'https://get.heyapi.dev/hey-api/backend',
5353+ output: 'src/client',
5454+ plugins: ['@hey-api/client-angular'], // [!code ++]
5555+};
5656+```
5757+5858+```sh [cli]
5959+npx @hey-api/openapi-ts \
6060+ -i https://get.heyapi.dev/hey-api/backend \
6161+ -o src/client \
6262+ -c @hey-api/client-angular # [!code ++]
6363+```
6464+6565+:::
6666+6767+### Providers
6868+6969+You can use the Angular client in your application by adding `provideHeyApiClient` to your providers.
7070+7171+```ts
7272+import { provideHeyApiClient, client } from './client/client.gen';
7373+7474+export const appConfig: ApplicationConfig = {
7575+ providers: [
7676+ provideHttpClient(withFetch()),
7777+ provideHeyApiClient(client), // [!code ++]
7878+ ],
7979+};
8080+```
8181+8282+## Configuration
8383+8484+The Angular client is built as a thin wrapper on top of Angular, extending its functionality to work with Hey API. If you're already familiar with Angular, configuring your client will feel like working directly with Angular.
8585+8686+When we installed the client above, it created a [`client.gen.ts`](/openapi-ts/output#client) file. You will most likely want to configure the exported `client` instance. There are two ways to do that.
8787+8888+### `setConfig()`
8989+9090+This is the simpler approach. You can call the `setConfig()` method at the beginning of your application or anytime you need to update the client configuration. You can pass any `HttpRequest` configuration option to `setConfig()`, and even your own [`httpClient`](#custom-httpclient) implementation.
9191+9292+```js
9393+import { client } from 'client/client.gen';
9494+9595+client.setConfig({
9696+ baseUrl: 'https://example.com',
9797+});
9898+```
9999+100100+The disadvantage of this approach is that your code may call the `client` instance before it's configured for the first time. Depending on your use case, you might need to use the second approach.
101101+102102+### Runtime API
103103+104104+Since `client.gen.ts` is a generated file, we can't directly modify it. Instead, we can tell our configuration to use a custom file implementing the Runtime API. We do that by specifying the `runtimeConfigPath` option.
105105+106106+```js
107107+export default {
108108+ input: 'https://get.heyapi.dev/hey-api/backend',
109109+ output: 'src/client',
110110+ plugins: [
111111+ {
112112+ name: '@hey-api/client-angular',
113113+ runtimeConfigPath: './src/hey-api.ts', // [!code ++]
114114+ },
115115+ ],
116116+};
117117+```
118118+119119+In our custom file, we need to export a `createClientConfig()` method. This function is a simple wrapper allowing us to override configuration values.
120120+121121+::: code-group
122122+123123+```ts [hey-api.ts]
124124+import type { CreateClientConfig } from './client/client.gen';
125125+126126+export const createClientConfig: CreateClientConfig = (config) => ({
127127+ ...config,
128128+ baseUrl: 'https://example.com',
129129+});
130130+```
131131+132132+:::
133133+134134+With this approach, `client.gen.ts` will call `createClientConfig()` before initializing the `client` instance. If needed, you can still use `setConfig()` to update the client configuration later.
135135+136136+### `createClient()`
137137+138138+You can also create your own client instance. You can use it to manually send requests or point it to a different domain.
139139+140140+```js
141141+import { createClient } from './client/client';
142142+143143+const myClient = createClient({
144144+ baseUrl: 'https://example.com',
145145+});
146146+```
147147+148148+You can also pass this instance to any SDK function through the `client` option. This will override the default instance from `client.gen.ts`.
149149+150150+```js
151151+const response = await getFoo({
152152+ client: myClient,
153153+});
154154+```
155155+156156+### SDKs
157157+158158+Alternatively, you can pass the client configuration options to each SDK function. This is useful if you don't want to create a client instance for one-off use cases.
159159+160160+```js
161161+const response = await getFoo({
162162+ baseUrl: 'https://example.com', // <-- override default configuration
163163+});
164164+```
165165+166166+## `@Injectable`
167167+168168+If you prefer to use the [`@Injectable()`](https://angular.dev/api/core/Injectable) decorators, set the `asClass` option in your SDK plugin to `true`.
169169+170170+::: code-group
171171+172172+```ts [example]
173173+@Injectable({ providedIn: 'root' })
174174+export class FooService {
175175+ // class methods
176176+}
177177+```
178178+179179+```js [config]
180180+export default {
181181+ input: 'https://get.heyapi.dev/hey-api/backend',
182182+ output: 'src/client',
183183+ plugins: [
184184+ '@hey-api/client-angular',
185185+ {
186186+ name: '@hey-api/sdk',
187187+ asClass: true, // [!code ++]
188188+ },
189189+ ],
190190+};
191191+```
192192+193193+:::
194194+195195+## Interceptors
196196+197197+::: warning
198198+This section is under construction. We appreciate your patience.
199199+:::
200200+201201+## Auth
202202+203203+::: warning
204204+This section is under construction. We appreciate your patience.
205205+:::
206206+207207+## Build URL
208208+209209+If you need to access the compiled URL, you can use the `buildUrl()` method. It's loosely typed by default to accept almost any value; in practice, you will want to pass a type hint.
210210+211211+```ts
212212+type FooData = {
213213+ path: {
214214+ fooId: number;
215215+ };
216216+ query?: {
217217+ bar?: string;
218218+ };
219219+ url: '/foo/{fooId}';
220220+};
221221+222222+const url = client.buildUrl<FooData>({
223223+ path: {
224224+ fooId: 1,
225225+ },
226226+ query: {
227227+ bar: 'baz',
228228+ },
229229+ url: '/foo/{fooId}',
230230+});
231231+console.log(url); // prints '/foo/1?bar=baz'
232232+```
233233+234234+## Custom `httpClient`
235235+236236+You can implement your own `httpClient`. This is useful if you need to extend the default `httpClient` methods with extra functionality, or replace it altogether.
237237+238238+```js
239239+import { client } from 'client/client.gen';
240240+241241+client.setConfig({
242242+ httpClient: inject(CustomHttpClient),
243243+});
244244+```
245245+246246+You can use any of the approaches mentioned in [Configuration](#configuration), depending on how granular you want your custom client to be.
247247+248248+## Plugins
249249+250250+You might be also interested in the [Angular](/openapi-ts/plugins/angular/v19) plugin.
251251+252252+## API
253253+254254+You can view the complete list of options in the [UserConfig](https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/plugins/@hey-api/client-angular/types.d.ts) interface.
255255+256256+<!--@include: ../../../partials/examples.md-->
257257+<!--@include: ../../../partials/sponsors.md-->
+8-2
docs/openapi-ts/clients/axios.md
···11---
22-title: Axios client
33-description: Axios client for Hey API. Compatible with all our features.
22+title: Axios v1 Client
33+description: Generate a type-safe Axios v1 client from OpenAPI with the Axios client for openapi-ts. Fully compatible with validators, transformers, and all core features.
44---
5566<script setup lang="ts">
77+import Heading from '@components/Heading.vue';
88+import VersionLabel from '@components/VersionLabel.vue';
99+710import { embedProject } from '../../embed'
811</script>
912···16191720[Axios](https://axios-http.com) is a simple promise based HTTP client for the browser and Node.js. Axios provides a simple to use library in a small package with a very extensible interface.
18212222+The Axios client for Hey API generates a type-safe client from your OpenAPI spec, fully compatible with validators, transformers, and all core features.
2323+1924### Demo
20252126<button class="buttonLink" @click="(event) => embedProject('hey-api-client-axios-example')(event)">
···24292530## Features
26313232+- Axios v1 support
2733- seamless integration with `@hey-api/openapi-ts` ecosystem
2834- type-safe response data and errors
2935- response data validation and transformation
+4
docs/openapi-ts/clients/effect.md
···33description: Effect client for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# Effect <span data-soon>soon</span>
711812<FeatureStatus issueNumber=2082 name="Effect" />
+4-2
docs/openapi-ts/clients/fetch.md
···11---
22-title: Fetch API client
33-description: Fetch API client for Hey API. Compatible with all our features.
22+title: Fetch API Client
33+description: Generate a type-safe Fetch API client from OpenAPI with the Fetch API client for openapi-ts. Fully compatible with validators, transformers, and all core features.
44---
5566<script setup lang="ts">
···1212### About
13131414The [Fetch API](https://developer.mozilla.org/docs/Web/API/Fetch_API) provides an interface for fetching resources (including across the network). It is a more powerful and flexible replacement for XMLHttpRequest.
1515+1616+The Fetch API client for Hey API generates a type-safe client from your OpenAPI spec, fully compatible with validators, transformers, and all core features.
15171618### Demo
1719
+3-5
docs/openapi-ts/clients/next-js.md
···11---
22-title: Next.js client
33-description: Next.js client for Hey API. Compatible with all our features.
22+title: Next.js Client
33+description: Generate a type-safe Next.js client from OpenAPI with the Next.js client for openapi-ts. Fully compatible with validators, transformers, and all core features.
44---
5566# Next.js
···991010[Next.js](https://nextjs.org) is the React framework for the web. Used by some of the world's largest companies, Next.js enables you to create high-quality web applications with the power of React components.
11111212-<!-- <button class="buttonLink" @click="(event) => embedProject('hey-api-client-next-example')(event)">
1313-Launch demo
1414-</button> -->
1212+The Next.js client for Hey API generates a type-safe client from your OpenAPI spec, fully compatible with validators, transformers, and all core features.
15131614## Features
1715
+9-5
docs/openapi-ts/clients/nuxt.md
···11---
22-title: Nuxt client
33-description: Nuxt client for Hey API. Compatible with all our features.
22+title: Nuxt v3 Client
33+description: Generate a type-safe Nuxt v3 client from OpenAPI with the Nuxt client for openapi-ts. Fully compatible with validators, transformers, and all core features.
44---
55+66+<script setup lang="ts">
77+import Heading from '@components/Heading.vue';
88+import VersionLabel from '@components/VersionLabel.vue';
99+</script>
510611<Heading>
712 <h1>Nuxt</h1>
···16211722[Nuxt](https://nuxt.com) is an open source framework that makes web development intuitive and powerful.
18231919-<!-- <button class="buttonLink" @click="(event) => embedProject('hey-api-client-fetch-example')(event)">
2020-Launch demo
2121-</button> -->
2424+The Nuxt client for Hey API generates a type-safe client from your OpenAPI spec, fully compatible with validators, transformers, and all core features.
22252326## Features
24272828+- Nuxt v3 support
2529- seamless integration with `@hey-api/openapi-ts` ecosystem
2630- type-safe response data and errors
2731- response data validation and transformation
···33description: AdonisJS plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# AdonisJS <span data-soon>soon</span>
711812<FeatureStatus issueNumber=2364 name="AdonisJS" />
+4
docs/openapi-ts/plugins/ajv.md
···33description: Ajv plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# Ajv <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1476 name="Ajv" />
+123
docs/openapi-ts/plugins/angular.md
···11+---
22+title: Angular v20 Plugin
33+description: Generate Angular v20 HTTP requests and resources from OpenAPI with the Angular plugin for openapi-ts. Fully compatible with validators, transformers, and all core features.
44+---
55+66+<script setup lang="ts">
77+import AuthorsList from '@components/AuthorsList.vue';
88+import Heading from '@components/Heading.vue';
99+import { maxScopp } from '@data/people.js';
1010+import AngularVersionSwitcher from '@versions/AngularVersionSwitcher.vue';
1111+</script>
1212+1313+<Heading>
1414+ <h1>Angular</h1>
1515+ <AngularVersionSwitcher />
1616+</Heading>
1717+1818+::: warning
1919+Angular client is currently in beta. The interface might change before it becomes stable. We encourage you to leave feedback on [GitHub](https://github.com/hey-api/openapi-ts/issues).
2020+:::
2121+2222+### About
2323+2424+[Angular](https://angular.dev/) is a web framework that empowers developers to build fast, reliable applications.
2525+2626+The Angular plugin for Hey API generates HTTP requests and resources from your OpenAPI spec, fully compatible with validators, transformers, and all core features.
2727+2828+### Collaborators
2929+3030+<AuthorsList :people="[maxScopp]" />
3131+3232+## Features
3333+3434+- Angular v20 support
3535+- seamless integration with `@hey-api/openapi-ts` ecosystem
3636+- generate HTTP requests
3737+- generate HTTP resources
3838+- minimal learning curve thanks to extending the underlying technology
3939+4040+## Installation
4141+4242+In your [configuration](/openapi-ts/get-started), add `@angular/common` to your plugins and you'll be ready to generate Angular artifacts. :tada:
4343+4444+```js
4545+export default {
4646+ input: 'https://get.heyapi.dev/hey-api/backend',
4747+ output: 'src/client',
4848+ plugins: [
4949+ // ...other plugins
5050+ '@angular/common', // [!code ++]
5151+ ],
5252+};
5353+```
5454+5555+## Output
5656+5757+The Angular plugin will generate the following artifacts, depending on the input specification.
5858+5959+## Requests
6060+6161+A single function is generated for each endpoint. It returns an [`HttpRequest`](https://angular.dev/api/common/http/HttpRequest) result.
6262+6363+::: code-group
6464+6565+```ts [example]
6666+export const addPetRequest = (options) =>
6767+ client.requestOptions({
6868+ method: 'POST',
6969+ responseStyle: 'data',
7070+ url: '/pet',
7171+ ...options,
7272+ });
7373+```
7474+7575+```js [config]
7676+export default {
7777+ input: 'https://get.heyapi.dev/hey-api/backend',
7878+ output: 'src/client',
7979+ plugins: [
8080+ // ...other plugins
8181+ {
8282+ name: '@angular/common',
8383+ httpRequests: true, // [!code ++]
8484+ },
8585+ ],
8686+};
8787+```
8888+8989+:::
9090+9191+## Resources
9292+9393+A single function is generated for each endpoint. It returns a result from [`httpResource`](https://angular.dev/api/common/http/httpResource) call.
9494+9595+::: code-group
9696+9797+```ts [example]
9898+export const addPetResource = (options) =>
9999+ httpResource(() => addPetRequest(options()));
100100+```
101101+102102+```js [config]
103103+export default {
104104+ input: 'https://get.heyapi.dev/hey-api/backend',
105105+ output: 'src/client',
106106+ plugins: [
107107+ // ...other plugins
108108+ {
109109+ name: '@angular/common',
110110+ httpResources: true, // [!code ++]
111111+ },
112112+ ],
113113+};
114114+```
115115+116116+:::
117117+118118+## API
119119+120120+You can view the complete list of options in the [UserConfig](https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/plugins/@angular/common/types.d.ts) interface.
121121+122122+<!--@include: ../../partials/examples.md-->
123123+<!--@include: ../../partials/sponsors.md-->
+123
docs/openapi-ts/plugins/angular/v19.md
···11+---
22+title: Angular v19 Plugin
33+description: Generate Angular v19 HTTP requests and resources from OpenAPI with the Angular plugin for openapi-ts. Fully compatible with validators, transformers, and all core features.
44+---
55+66+<script setup lang="ts">
77+import AuthorsList from '@components/AuthorsList.vue';
88+import Heading from '@components/Heading.vue';
99+import { maxScopp } from '@data/people.js';
1010+import AngularVersionSwitcher from '@versions/AngularVersionSwitcher.vue';
1111+</script>
1212+1313+<Heading>
1414+ <h1>Angular</h1>
1515+ <AngularVersionSwitcher />
1616+</Heading>
1717+1818+::: warning
1919+Angular client is currently in beta. The interface might change before it becomes stable. We encourage you to leave feedback on [GitHub](https://github.com/hey-api/openapi-ts/issues).
2020+:::
2121+2222+### About
2323+2424+[Angular](https://angular.dev/) is a web framework that empowers developers to build fast, reliable applications.
2525+2626+The Angular plugin for Hey API generates HTTP requests and resources from your OpenAPI spec, fully compatible with validators, transformers, and all core features.
2727+2828+### Collaborators
2929+3030+<AuthorsList :people="[maxScopp]" />
3131+3232+## Features
3333+3434+- Angular v19 support
3535+- seamless integration with `@hey-api/openapi-ts` ecosystem
3636+- generate HTTP requests
3737+- generate HTTP resources
3838+- minimal learning curve thanks to extending the underlying technology
3939+4040+## Installation
4141+4242+In your [configuration](/openapi-ts/get-started), add `@angular/common` to your plugins and you'll be ready to generate Angular artifacts. :tada:
4343+4444+```js
4545+export default {
4646+ input: 'https://get.heyapi.dev/hey-api/backend',
4747+ output: 'src/client',
4848+ plugins: [
4949+ // ...other plugins
5050+ '@angular/common', // [!code ++]
5151+ ],
5252+};
5353+```
5454+5555+## Output
5656+5757+The Angular plugin will generate the following artifacts, depending on the input specification.
5858+5959+## Requests
6060+6161+A single function is generated for each endpoint. It returns an [`HttpRequest`](https://v19.angular.dev/api/common/http/HttpRequest) result.
6262+6363+::: code-group
6464+6565+```ts [example]
6666+export const addPetRequest = (options) =>
6767+ client.requestOptions({
6868+ method: 'POST',
6969+ responseStyle: 'data',
7070+ url: '/pet',
7171+ ...options,
7272+ });
7373+```
7474+7575+```js [config]
7676+export default {
7777+ input: 'https://get.heyapi.dev/hey-api/backend',
7878+ output: 'src/client',
7979+ plugins: [
8080+ // ...other plugins
8181+ {
8282+ name: '@angular/common',
8383+ httpRequests: true, // [!code ++]
8484+ },
8585+ ],
8686+};
8787+```
8888+8989+:::
9090+9191+## Resources
9292+9393+A single function is generated for each endpoint. It returns a result from [`httpResource`](https://v19.angular.dev/api/common/http/httpResource) call.
9494+9595+::: code-group
9696+9797+```ts [example]
9898+export const addPetResource = (options) =>
9999+ httpResource(() => addPetRequest(options()));
100100+```
101101+102102+```js [config]
103103+export default {
104104+ input: 'https://get.heyapi.dev/hey-api/backend',
105105+ output: 'src/client',
106106+ plugins: [
107107+ // ...other plugins
108108+ {
109109+ name: '@angular/common',
110110+ httpResources: true, // [!code ++]
111111+ },
112112+ ],
113113+};
114114+```
115115+116116+:::
117117+118118+## API
119119+120120+You can view the complete list of options in the [UserConfig](https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/plugins/@angular/common/types.d.ts) interface.
121121+122122+<!--@include: ../../partials/examples.md-->
123123+<!--@include: ../../partials/sponsors.md-->
+4
docs/openapi-ts/plugins/arktype.md
···33description: Arktype plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# Arktype <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1473 name="Arktype" />
+4
docs/openapi-ts/plugins/express.md
···33description: Express plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# Express <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1484 name="Express" />
+4
docs/openapi-ts/plugins/faker.md
···33description: Faker plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# Faker <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1485 name="Faker" />
+8-9
docs/openapi-ts/plugins/fastify.md
···33description: Generate Fastify v5 route handlers from OpenAPI with the Fastify plugin for openapi-ts. Fully compatible with validators, transformers, and all core features.
44---
5566+<script setup lang="ts">
77+import AuthorsList from '@components/AuthorsList.vue';
88+import Heading from '@components/Heading.vue';
99+import { jacobCohen } from '@data/people.js';
1010+import VersionLabel from '@components/VersionLabel.vue';
1111+</script>
1212+613<Heading>
714 <h1>Fastify</h1>
815 <VersionLabel value="v5" />
···18251926The Fastify plugin for Hey API generates route handlers from your OpenAPI spec, fully compatible with all core features.
20272121-<!-- ### Demo
2222-2323-<button class="buttonLink" @click="(event) => embedProject('hey-api-client-fetch-plugin-fastify-example')(event)">
2424-StackBlitz
2525-</button> -->
2626-2728### Collaborators
28292929-<AuthorsList :people="[
3030- { name: 'Jacob Cohen', github: 'https://github.com/jacobinu' },
3131-]" />
3030+<AuthorsList :people="[jacobCohen]" />
32313332## Features
3433
+4
docs/openapi-ts/plugins/hono.md
···33description: Hono plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# Hono <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1483 name="Hono" />
+4
docs/openapi-ts/plugins/joi.md
···33description: Joi plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# Joi <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1477 name="Joi" />
+4
docs/openapi-ts/plugins/koa.md
···33description: Koa plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# Koa <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1482 name="Koa" />
+4
docs/openapi-ts/plugins/msw.md
···33description: MSW plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# MSW <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1486 name="MSW" />
+4
docs/openapi-ts/plugins/nest.md
···33description: Nest plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# Nest <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1481 name="Nest" />
+4
docs/openapi-ts/plugins/nock.md
···33description: Nock plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# Nock <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1487 name="Nock" />
+4
docs/openapi-ts/plugins/pinia-colada.md
···33description: Pinia Colada plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# Pinia Colada <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1242 name="Pinia Colada" />
+4
docs/openapi-ts/plugins/superstruct.md
···33description: Superstruct plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# Superstruct <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1489 name="Superstruct" />
+4
docs/openapi-ts/plugins/supertest.md
···33description: Supertest plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# Supertest <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1488 name="Supertest" />
+4
docs/openapi-ts/plugins/swr.md
···33description: SWR plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# SWR <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1479 name="SWR" />
+3
docs/openapi-ts/plugins/tanstack-query.md
···44---
5566<script setup lang="ts">
77+import Heading from '@components/Heading.vue';
88+import VersionLabel from '@components/VersionLabel.vue';
99+710import { embedProject } from '../../embed'
811</script>
912
+4
docs/openapi-ts/plugins/typebox.md
···33description: TypeBox plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# TypeBox <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1475 name="TypeBox" />
+4-9
docs/openapi-ts/plugins/valibot.md
···33description: Generate Valibot v1 schemas from OpenAPI with the Valibot plugin for openapi-ts. Fully compatible with validators, transformers, and all core features.
44---
5566-<!-- <script setup lang="ts">
77-import { embedProject } from '../../embed'
88-</script> -->
66+<script setup lang="ts">
77+import Heading from '@components/Heading.vue';
88+import VersionLabel from '@components/VersionLabel.vue';
99+</script>
9101011<Heading>
1112 <h1>Valibot</h1>
···1718[Valibot](https://valibot.dev) is the open source schema library for TypeScript with bundle size, type safety and developer experience in mind.
18191920The Valibot plugin for Hey API generates schemas from your OpenAPI spec, fully compatible with validators, transformers, and all core features.
2020-2121-<!-- ### Demo
2222-2323-<button class="buttonLink" @click="(event) => embedProject('hey-api-client-fetch-plugin-valibot-example')(event)">
2424-Launch demo
2525-</button> -->
26212722## Features
2823
+4
docs/openapi-ts/plugins/yup.md
···33description: Yup plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# Yup <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1478 name="Yup" />
+5-10
docs/openapi-ts/plugins/zod.md
···44---
5566<script setup lang="ts">
77-// import { embedProject } from '../../embed'
88-import ZodHeading from './zod/ZodHeading.vue';
77+import Heading from '@components/Heading.vue';
88+import ZodVersionSwitcher from '@versions/ZodVersionSwitcher.vue';
99</script>
10101111-<ZodHeading>
1111+<Heading>
1212 <h1>Zod</h1>
1313-</ZodHeading>
1313+ <ZodVersionSwitcher />
1414+</Heading>
14151516### About
16171718[Zod](https://zod.dev) is a TypeScript-first schema validation library with static type inference.
18191920The Zod plugin for Hey API generates schemas from your OpenAPI spec, fully compatible with validators, transformers, and all core features.
2020-2121-<!-- ### Demo
2222-2323-<button class="buttonLink" @click="(event) => embedProject('hey-api-client-fetch-plugin-zod-example')(event)">
2424-Launch demo
2525-</button> -->
26212722## Features
2823
···44---
5566<script setup lang="ts">
77-// import { embedProject } from '../../embed'
88-import ZodHeading from './ZodHeading.vue';
77+import Heading from '@components/Heading.vue';
88+import ZodVersionSwitcher from '@versions/ZodVersionSwitcher.vue';
99</script>
10101111-<ZodHeading>
1111+<Heading>
1212 <h1>Zod</h1>
1313-</ZodHeading>
1313+ <ZodVersionSwitcher />
1414+</Heading>
14151516### About
16171718[Zod](https://zod.dev) is a TypeScript-first schema validation library with static type inference.
18191920The Zod plugin for Hey API generates schemas from your OpenAPI spec, fully compatible with validators, transformers, and all core features.
2020-2121-<!-- ### Demo
2222-2323-<button class="buttonLink" @click="(event) => embedProject('hey-api-client-fetch-plugin-zod-example')(event)">
2424-Launch demo
2525-</button> -->
26212722## Features
2823
+5-10
docs/openapi-ts/plugins/zod/v3.md
···44---
5566<script setup lang="ts">
77-// import { embedProject } from '../../embed'
88-import ZodHeading from './ZodHeading.vue';
77+import Heading from '@components/Heading.vue';
88+import ZodVersionSwitcher from '@versions/ZodVersionSwitcher.vue';
99</script>
10101111-<ZodHeading>
1111+<Heading>
1212 <h1>Zod</h1>
1313-</ZodHeading>
1313+ <ZodVersionSwitcher />
1414+</Heading>
14151516### About
16171718[Zod](https://v3.zod.dev/) is a TypeScript-first schema validation library with static type inference.
18191920The Zod plugin for Hey API generates schemas from your OpenAPI spec, fully compatible with validators, transformers, and all core features.
2020-2121-<!-- ### Demo
2222-2323-<button class="buttonLink" @click="(event) => embedProject('hey-api-client-fetch-plugin-zod-example')(event)">
2424-Launch demo
2525-</button> -->
26212722## Features
2823
+4
docs/openapi-ts/plugins/zustand.md
···33description: Zustand plugin for Hey API. Compatible with all our features.
44---
5566+<script setup lang="ts">
77+import FeatureStatus from '@components/FeatureStatus.vue';
88+</script>
99+610# Zustand <span data-soon>soon</span>
711812<FeatureStatus issueNumber=1480 name="Zustand" />
+1
docs/openapi-ts/web-frameworks.md
···11111212Hey API natively supports the following frameworks.
13131414+- [Angular](/openapi-ts/plugins/angular)
1415- [Fastify](/openapi-ts/plugins/fastify)
1516- [Adonis](/openapi-ts/plugins/adonis) <span data-soon>Soon</span>
1617- [Express](/openapi-ts/plugins/express) <span data-soon>Soon</span>
···11+// This file is auto-generated by @hey-api/openapi-ts
22+export * from './@angular/common/http/requests.gen';
33+export * from './@angular/common/http/resources.gen';
44+export * from './sdk.gen';
55+export * from './types.gen';
···5959 updatePetWithFormRequest,
6060 updateUserRequest,
6161 uploadFileRequest,
6262-} from './httpRequests.gen';
6262+} from './requests.gen';
63636464@Injectable({
6565 providedIn: 'root',
6666})
6767-export class PetResources {
6767+export class PetServiceResources {
6868 /**
6969 * Add a new pet to the store.
7070 * Add a new pet to the store.
···155155@Injectable({
156156 providedIn: 'root',
157157})
158158-export class StoreResources {
158158+export class StoreServiceResources {
159159 /**
160160 * Returns pet inventories by status.
161161 * Returns a map of status codes to quantities.
···206206@Injectable({
207207 providedIn: 'root',
208208})
209209-export class UserResources {
209209+export class UserServiceResources {
210210 /**
211211 * Create user.
212212 * This can only be done by the logged in user.
···11-// This file is auto-generated by @hey-api/openapi-ts
22-export * from './@angular/common/http/httpRequests.gen';
33-export * from './@angular/common/http/httpResource.gen';
44-export * from './sdk.gen';
55-export * from './types.gen';
···282282### Native Clients
283283284284- [`@hey-api/client-fetch`](https://heyapi.dev/openapi-ts/clients/fetch)
285285+- [`@hey-api/client-angular`](https://heyapi.dev/openapi-ts/clients/angular)
285286- [`@hey-api/client-axios`](https://heyapi.dev/openapi-ts/clients/axios)
286287- [`@hey-api/client-next`](https://heyapi.dev/openapi-ts/clients/next-js)
287288- [`@hey-api/client-nuxt`](https://heyapi.dev/openapi-ts/clients/nuxt)
···290291291292The following clients are planned but not in development yet. You can help us prioritize them by voting on [GitHub](https://github.com/hey-api/openapi-ts/labels/RSVP%20%F0%9F%91%8D%F0%9F%91%8E).
292293293293-- [`@hey-api/client-angular`](https://heyapi.dev/openapi-ts/clients/angular)
294294- [`@hey-api/client-effect`](https://heyapi.dev/openapi-ts/clients/effect)
295295296296Don't see your client? [Build your own](https://heyapi.dev/openapi-ts/clients/custom) or let us know your interest by [opening an issue](https://github.com/hey-api/openapi-ts/issues).
···308308- [`@tanstack/solid-query`](https://heyapi.dev/openapi-ts/plugins/tanstack-query)
309309- [`@tanstack/svelte-query`](https://heyapi.dev/openapi-ts/plugins/tanstack-query)
310310- [`@tanstack/vue-query`](https://heyapi.dev/openapi-ts/plugins/tanstack-query)
311311+- [`@angular/common`](https://heyapi.dev/openapi-ts/plugins/angular)
311312- [`fastify`](https://heyapi.dev/openapi-ts/plugins/fastify)
312313- [`valibot`](https://heyapi.dev/openapi-ts/plugins/valibot)
313314- [`zod`](https://heyapi.dev/openapi-ts/plugins/zod)
···11-import type { Operation } from '../../../types/client';
11+import type { StringName } from '../../../types/case';
22import type { DefinePlugin, Plugin } from '../../types';
3344-export type AngularHttpResourceOptions = {
44+export type UserConfig = Plugin.Name<'@angular/common'> & {
55 /**
66- * Whether to generate the resource as a class.
66+ * Should the exports from the generated files be re-exported in the index
77+ * barrel file?
88+ *
79 * @default false
810 */
99- asClass?: boolean;
1010-1111+ exportFromIndex?: boolean;
1112 /**
1212- * Builds the class name for the generated resource.
1313- * By default, the class name is suffixed with "Resources".
1313+ * Options for generating HTTP Request instances.
1414+ *
1515+ * @default true
1416 */
1515- classNameBuilder?: (className: string) => string;
1616-1717+ httpRequests?:
1818+ | boolean
1919+ | {
2020+ /**
2121+ * Whether to generate the resource as a class.
2222+ *
2323+ * @default false
2424+ */
2525+ asClass?: boolean;
2626+ /**
2727+ * Builds the class name for the generated resource.
2828+ * By default, the class name is suffixed with "Resources".
2929+ */
3030+ classNameBuilder?: StringName;
3131+ /**
3232+ * Whether or not to create HTTP Request instances.
3333+ *
3434+ * @default true
3535+ */
3636+ enabled?: boolean;
3737+ /**
3838+ * Builds the method name for the generated resource.
3939+ *
4040+ * By default, the operation id is used, if `asClass` is false, the method is also suffixed with "Resource".
4141+ */
4242+ methodNameBuilder?: (operation: IR.OperationObject) => string;
4343+ };
1744 /**
1818- * Wether or not to create http resource APIs.
4545+ * Options for generating HTTP resource APIs.
4646+ *
4747+ * @default true
1948 */
2020- enabled: boolean;
2121-4949+ httpResources?:
5050+ | boolean
5151+ | {
5252+ /**
5353+ * Whether to generate the resource as a class.
5454+ * @default false
5555+ */
5656+ asClass?: boolean;
5757+ /**
5858+ * Builds the class name for the generated resource.
5959+ * By default, the class name is suffixed with "Resources".
6060+ */
6161+ classNameBuilder?: StringName;
6262+ /**
6363+ * Whether or not to create HTTP resource APIs.
6464+ *
6565+ * @default true
6666+ */
6767+ enabled?: boolean;
6868+ /**
6969+ * Builds the method name for the generated resource.
7070+ *
7171+ * By default, the operation id is used, if `asClass` is false, the method is also suffixed with "Resource".
7272+ */
7373+ methodNameBuilder?: (operation: IR.OperationObject) => string;
7474+ };
2275 /**
2323- * Builds the method name for the generated resource.
2424- * By default, the operation id is used, if `asClass` is false, the method is also suffixed with "Resource".
7676+ * Name of the generated file.
7777+ *
7878+ * @default '@angular/common'
2579 */
2626- methodNameBuilder?: (operation: IR.OperationObject | Operation) => string;
8080+ output?: string;
2781};
28822929-export type AngularHttpRequestOptions = {
8383+export type Config = Plugin.Name<'@angular/common'> & {
3084 /**
3131- * Whether to generate the resource as a class.
8585+ * Should the exports from the generated files be re-exported in the index
8686+ * barrel file?
8787+ *
3288 * @default false
3389 */
3434- asClass?: boolean;
3535-3636- /**
3737- * Builds the class name for the generated resource.
3838- * By default, the class name is suffixed with "Resources".
3939- */
4040- classNameBuilder?: (className: string) => string;
4141-4242- /**
4343- * Builds the method name for the generated resource.
4444- * By default, the operation id is used, if `asClass` is false, the method is also suffixed with "Resource".
4545- */
4646- methodNameBuilder?: (operation: IR.OperationObject | Operation) => string;
4747-};
4848-4949-export type UserConfig = Plugin.Name<'@angular/common'> & {
9090+ exportFromIndex: boolean;
5091 /**
5192 * Options for generating HTTP Request instances.
5293 */
5353- httpRequest?: AngularHttpRequestOptions;
5454-9494+ httpRequests: {
9595+ /**
9696+ * Whether to generate the resource as a class.
9797+ *
9898+ * @default false
9999+ */
100100+ asClass: boolean;
101101+ /**
102102+ * Builds the class name for the generated resource.
103103+ * By default, the class name is suffixed with "Resources".
104104+ */
105105+ classNameBuilder: StringName;
106106+ /**
107107+ * Whether or not to create HTTP Request instances.
108108+ *
109109+ * @default true
110110+ */
111111+ enabled: boolean;
112112+ /**
113113+ * Builds the method name for the generated resource.
114114+ * By default, the operation id is used, if `asClass` is false, the method is also suffixed with "Resource".
115115+ */
116116+ methodNameBuilder: (operation: IR.OperationObject) => string;
117117+ };
55118 /**
56119 * Options for generating HTTP resource APIs.
57120 */
5858- httpResource?: AngularHttpResourceOptions;
5959-121121+ httpResources: {
122122+ /**
123123+ * Whether to generate the resource as a class.
124124+ *
125125+ * @default false
126126+ */
127127+ asClass: boolean;
128128+ /**
129129+ * Builds the class name for the generated resource.
130130+ * By default, the class name is suffixed with "Resources".
131131+ */
132132+ classNameBuilder: StringName;
133133+ /**
134134+ * Whether or not to create HTTP resource APIs.
135135+ *
136136+ * @default true
137137+ */
138138+ enabled: boolean;
139139+ /**
140140+ * Builds the method name for the generated resource.
141141+ * By default, the operation id is used, if `asClass` is false, the method is also suffixed with "Resource".
142142+ */
143143+ methodNameBuilder: (operation: IR.OperationObject) => string;
144144+ };
60145 /**
61146 * Name of the generated file.
62147 *
63148 * @default '@angular/common'
64149 */
6565- output?: string;
150150+ output: string;
66151};
671526868-export type AngularCommonPlugin = DefinePlugin<UserConfig, UserConfig>;
153153+export type AngularCommonPlugin = DefinePlugin<UserConfig, Config>;