···11111212[@hey-api/openapi-ts](https://github.com/hey-api/openapi-ts) is an [open source](/openapi-ts/license) OpenAPI to TypeScript code generator trusted by companies like Google, Amazon, and PayPal to generate API clients, SDKs, validators, and more. We also build complementary tools and [services](https://app.heyapi.dev/) that help teams design, manage, and distribute APIs more effectively.
13131414-> “OpenAPI codegen that just works.”
1515-> — Guillermo Rauch
1414+> _“OpenAPI codegen that just works.”_
1515+>
1616+> <sub>— Guillermo Rauch, CEO of Vercel</sub>
16171718### Demo
1819
···11<div align="center">
22 <img alt="Two people looking at the blueprint" height="214" src="https://heyapi.dev/images/blueprint-640w.png" width="320">
33 <h1><b>OpenAPI TypeScript</b></h1>
44- <p><em>“OpenAPI codegen that just works.”</em><br/><sub>— Guillermo Rauch</sub></p>
44+ <p><em>“OpenAPI codegen that just works.”</em><br/><sub>— Guillermo Rauch, CEO of Vercel</sub></p>
55</div>
6677<p align="center">
···11import type { DefinePlugin, Plugin } from '~/plugins';
22import type { Client } from '~/plugins/@hey-api/client-core/types';
3344-import type { IApi } from './api';
55-64export type UserConfig = Plugin.Name<'@hey-api/client-nuxt'> & Client.Config;
7588-export type HeyApiClientNuxtPlugin = DefinePlugin<UserConfig, UserConfig, IApi>;
66+export type HeyApiClientNuxtPlugin = DefinePlugin<UserConfig, UserConfig>;
···33import type { IR } from '~/ir/types';
44import type { DefinePlugin, Plugin } from '~/plugins';
5566-import type { IApi } from './api';
76import type { ExpressionTransformer } from './expressions';
8798/**
···7877 typeTransformers: ReadonlyArray<TypeTransformer>;
7978 };
80798181-export type HeyApiTransformersPlugin = DefinePlugin<UserConfig, Config, IApi>;
8080+export type HeyApiTransformersPlugin = DefinePlugin<UserConfig, Config>;
···11+export { defaultConfig, defineConfig } from './config';
22+export type { SwrPlugin } from './types';
+5
packages/openapi-ts/src/plugins/swr/plugin.ts
···11+import type { SwrPlugin } from './types';
22+33+export const handler: SwrPlugin['Handler'] = ({ plugin }) => {
44+ console.log(plugin.name);
55+};
+624
packages/openapi-ts/src/plugins/swr/types.d.ts
···11+import type { IR } from '~/ir/types';
22+import type { DefinePlugin, Plugin } from '~/plugins';
33+import type { StringCase, StringName } from '~/types/case';
44+55+export type UserConfig = Plugin.Name<'swr'> &
66+ Plugin.Hooks & {
77+ /**
88+ * The casing convention to use for generated names.
99+ *
1010+ * @default 'camelCase'
1111+ */
1212+ case?: StringCase;
1313+ /**
1414+ * Add comments from SDK functions to the generated TanStack Query code?
1515+ *
1616+ * Duplicating comments this way is useful so you don't need to drill into
1717+ * the underlying SDK function to learn what it does or whether it's
1818+ * deprecated. You can set this option to `false` if you prefer less
1919+ * comment duplication.
2020+ *
2121+ * @default true
2222+ */
2323+ comments?: boolean;
2424+ /**
2525+ * Should the exports from the generated files be re-exported in the index
2626+ * barrel file?
2727+ *
2828+ * @default false
2929+ */
3030+ exportFromIndex?: boolean;
3131+ /**
3232+ * Configuration for generated infinite query key helpers.
3333+ *
3434+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/infiniteQueryOptions infiniteQueryOptions}
3535+ *
3636+ * Can be:
3737+ * - `boolean`: Shorthand for `{ enabled: boolean }`
3838+ * - `string` or `function`: Shorthand for `{ name: string | function }`
3939+ * - `object`: Full configuration object
4040+ *
4141+ * @default true
4242+ */
4343+ infiniteQueryKeys?:
4444+ | boolean
4545+ | StringName
4646+ | {
4747+ /**
4848+ * The casing convention to use for generated names.
4949+ *
5050+ * @default 'camelCase'
5151+ */
5252+ case?: StringCase;
5353+ /**
5454+ * Whether to generate infinite query key helpers.
5555+ *
5656+ * @default true
5757+ */
5858+ enabled?: boolean;
5959+ /**
6060+ * Custom naming pattern for generated infinite query key names. The name variable is
6161+ * obtained from the SDK function name.
6262+ *
6363+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/infiniteQueryOptions infiniteQueryOptions}
6464+ *
6565+ * @default '{{name}}InfiniteQueryKey'
6666+ */
6767+ name?: StringName;
6868+ /**
6969+ * Whether to include operation tags in infinite query keys.
7070+ * This will make query keys larger but provides better cache invalidation capabilities.
7171+ *
7272+ * @default false
7373+ */
7474+ tags?: boolean;
7575+ };
7676+ /**
7777+ * Configuration for generated infinite query options helpers.
7878+ *
7979+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/infiniteQueryOptions infiniteQueryOptions}
8080+ *
8181+ * Can be:
8282+ * - `boolean`: Shorthand for `{ enabled: boolean }`
8383+ * - `string` or `function`: Shorthand for `{ name: string | function }`
8484+ * - `object`: Full configuration object
8585+ *
8686+ * @default true
8787+ */
8888+ infiniteQueryOptions?:
8989+ | boolean
9090+ | StringName
9191+ | {
9292+ /**
9393+ * The casing convention to use for generated names.
9494+ *
9595+ * @default 'camelCase'
9696+ */
9797+ case?: StringCase;
9898+ /**
9999+ * Whether to generate infinite query options helpers.
100100+ *
101101+ * @default true
102102+ */
103103+ enabled?: boolean;
104104+ /**
105105+ * Custom function to generate metadata for the operation.
106106+ * Can return any valid meta object that will be included in the generated infinite query options.
107107+ *
108108+ * @param operation - The operation object containing all available metadata
109109+ * @returns A meta object with any properties you want to include
110110+ *
111111+ * @example
112112+ * ```typescript
113113+ * meta: (operation) => ({
114114+ * customField: operation.id,
115115+ * isDeprecated: operation.deprecated,
116116+ * tags: operation.tags,
117117+ * customObject: {
118118+ * method: operation.method,
119119+ * path: operation.path
120120+ * }
121121+ * })
122122+ * ```
123123+ *
124124+ * @default undefined
125125+ */
126126+ meta?: (operation: IR.OperationObject) => Record<string, unknown>;
127127+ /**
128128+ * Custom naming pattern for generated infinite query options names. The name variable is
129129+ * obtained from the SDK function name.
130130+ *
131131+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/infiniteQueryOptions infiniteQueryOptions}
132132+ *
133133+ * @default '{{name}}InfiniteOptions'
134134+ */
135135+ name?: StringName;
136136+ };
137137+ /**
138138+ * Configuration for generated mutation options helpers.
139139+ *
140140+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/useMutation useMutation}
141141+ *
142142+ * Can be:
143143+ * - `boolean`: Shorthand for `{ enabled: boolean }`
144144+ * - `string` or `function`: Shorthand for `{ name: string | function }`
145145+ * - `object`: Full configuration object
146146+ *
147147+ * @default true
148148+ */
149149+ mutationOptions?:
150150+ | boolean
151151+ | StringName
152152+ | {
153153+ /**
154154+ * The casing convention to use for generated names.
155155+ *
156156+ * @default 'camelCase'
157157+ */
158158+ case?: StringCase;
159159+ /**
160160+ * Whether to generate mutation options helpers.
161161+ *
162162+ * @default true
163163+ */
164164+ enabled?: boolean;
165165+ /**
166166+ * Custom function to generate metadata for the operation.
167167+ * Can return any valid meta object that will be included in the generated mutation options.
168168+ *
169169+ * @param operation - The operation object containing all available metadata
170170+ * @returns A meta object with any properties you want to include
171171+ *
172172+ * @example
173173+ * ```typescript
174174+ * meta: (operation) => ({
175175+ * customField: operation.id,
176176+ * isDeprecated: operation.deprecated,
177177+ * tags: operation.tags,
178178+ * customObject: {
179179+ * method: operation.method,
180180+ * path: operation.path
181181+ * }
182182+ * })
183183+ * ```
184184+ *
185185+ * @default undefined
186186+ */
187187+ meta?: (operation: IR.OperationObject) => Record<string, unknown>;
188188+ /**
189189+ * Custom naming pattern for generated mutation options names. The name variable is
190190+ * obtained from the SDK function name.
191191+ *
192192+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/useMutation useMutation}
193193+ *
194194+ * @default '{{name}}Mutation'
195195+ */
196196+ name?: StringName;
197197+ };
198198+ /**
199199+ * Configuration for generated query keys.
200200+ *
201201+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/queryKey queryKey}
202202+ *
203203+ * Can be:
204204+ * - `boolean`: Shorthand for `{ enabled: boolean }`
205205+ * - `string` or `function`: Shorthand for `{ name: string | function }`
206206+ * - `object`: Full configuration object
207207+ *
208208+ * @default true
209209+ */
210210+ queryKeys?:
211211+ | boolean
212212+ | StringName
213213+ | {
214214+ /**
215215+ * The casing convention to use for generated names.
216216+ *
217217+ * @default 'camelCase'
218218+ */
219219+ case?: StringCase;
220220+ /**
221221+ * Whether to generate query keys.
222222+ *
223223+ * @default true
224224+ */
225225+ enabled?: boolean;
226226+ /**
227227+ * Custom naming pattern for generated query key names. The name variable is
228228+ * obtained from the SDK function name.
229229+ *
230230+ * See {@link https://tanstack.com/query/v5/docs/framework/react/guides/query-keys Query Keys}
231231+ *
232232+ * @default '{{name}}QueryKey'
233233+ */
234234+ name?: StringName;
235235+ /**
236236+ * Whether to include operation tags in query keys.
237237+ * This will make query keys larger but provides better cache invalidation capabilities.
238238+ *
239239+ * @default false
240240+ */
241241+ tags?: boolean;
242242+ };
243243+ /**
244244+ * Configuration for generated query options helpers.
245245+ *
246246+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/queryOptions queryOptions}
247247+ *
248248+ * Can be:
249249+ * - `boolean`: Shorthand for `{ enabled: boolean }`
250250+ * - `string` or `function`: Shorthand for `{ name: string | function }`
251251+ * - `object`: Full configuration object
252252+ *
253253+ * @default true
254254+ */
255255+ queryOptions?:
256256+ | boolean
257257+ | StringName
258258+ | {
259259+ /**
260260+ * The casing convention to use for generated names.
261261+ *
262262+ * @default 'camelCase'
263263+ */
264264+ case?: StringCase;
265265+ /**
266266+ * Whether to generate query options helpers.
267267+ *
268268+ * @default true
269269+ */
270270+ enabled?: boolean;
271271+ /**
272272+ * Whether to export generated symbols.
273273+ *
274274+ * @default true
275275+ */
276276+ exported?: boolean;
277277+ /**
278278+ * Custom function to generate metadata for the operation.
279279+ * Can return any valid meta object that will be included in the generated query options.
280280+ *
281281+ * @param operation - The operation object containing all available metadata
282282+ * @returns A meta object with any properties you want to include
283283+ *
284284+ * @example
285285+ * ```typescript
286286+ * meta: (operation) => ({
287287+ * customField: operation.id,
288288+ * isDeprecated: operation.deprecated,
289289+ * tags: operation.tags,
290290+ * customObject: {
291291+ * method: operation.method,
292292+ * path: operation.path
293293+ * }
294294+ * })
295295+ * ```
296296+ *
297297+ * @default undefined
298298+ */
299299+ meta?: (operation: IR.OperationObject) => Record<string, unknown>;
300300+ /**
301301+ * Custom naming pattern for generated query options names. The name variable is
302302+ * obtained from the SDK function name.
303303+ *
304304+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/queryOptions queryOptions}
305305+ *
306306+ * @default '{{name}}Options'
307307+ */
308308+ name?: StringName;
309309+ };
310310+ /**
311311+ * Configuration for generated `useQuery()` function helpers.
312312+ *
313313+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/useQuery useQuery}
314314+ *
315315+ * Can be:
316316+ * - `boolean`: Shorthand for `{ enabled: boolean }`
317317+ * - `string` or `function`: Shorthand for `{ name: string | function }`
318318+ * - `object`: Full configuration object
319319+ *
320320+ * @default false
321321+ */
322322+ useQuery?:
323323+ | boolean
324324+ | StringName
325325+ | {
326326+ /**
327327+ * The casing convention to use for generated names.
328328+ *
329329+ * @default 'camelCase'
330330+ */
331331+ case?: StringCase;
332332+ /**
333333+ * Whether to generate `useQuery()` function helpers.
334334+ *
335335+ * @default true
336336+ */
337337+ enabled?: boolean;
338338+ /**
339339+ * Custom naming pattern for generated `useQuery()` function names. The name variable is
340340+ * obtained from the SDK function name.
341341+ *
342342+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/useQuery useQuery}
343343+ *
344344+ * @default 'use{{name}}Query'
345345+ */
346346+ name?: StringName;
347347+ };
348348+ };
349349+350350+export type Config = Plugin.Name<'swr'> &
351351+ Plugin.Hooks & {
352352+ /**
353353+ * The casing convention to use for generated names.
354354+ *
355355+ * @default 'camelCase'
356356+ */
357357+ case: StringCase;
358358+ /**
359359+ * Add comments from SDK functions to the generated TanStack Query code?
360360+ *
361361+ * @default true
362362+ */
363363+ comments: boolean;
364364+ /**
365365+ * Should the exports from the generated files be re-exported in the index barrel file?
366366+ *
367367+ * @default false
368368+ */
369369+ exportFromIndex: boolean;
370370+ /**
371371+ * Resolved configuration for generated infinite query key helpers.
372372+ *
373373+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/infiniteQueryOptions infiniteQueryOptions}
374374+ */
375375+ infiniteQueryKeys: {
376376+ /**
377377+ * The casing convention to use for generated names.
378378+ *
379379+ * @default 'camelCase'
380380+ */
381381+ case: StringCase;
382382+ /**
383383+ * Whether to generate infinite query key helpers.
384384+ *
385385+ * @default true
386386+ */
387387+ enabled: boolean;
388388+ /**
389389+ * Custom naming pattern for generated infinite query key names. The name variable is obtained from the SDK function name.
390390+ *
391391+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/infiniteQueryOptions infiniteQueryOptions}
392392+ *
393393+ * @default '{{name}}InfiniteQueryKey'
394394+ */
395395+ name: StringName;
396396+ /**
397397+ * Whether to include operation tags in infinite query keys.
398398+ * This will make query keys larger but provides better cache invalidation capabilities.
399399+ *
400400+ * @default false
401401+ */
402402+ tags: boolean;
403403+ };
404404+ /**
405405+ * Resolved configuration for generated infinite query options helpers.
406406+ *
407407+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/infiniteQueryOptions infiniteQueryOptions}
408408+ */
409409+ infiniteQueryOptions: {
410410+ /**
411411+ * The casing convention to use for generated names.
412412+ *
413413+ * @default 'camelCase'
414414+ */
415415+ case: StringCase;
416416+ /**
417417+ * Whether to generate infinite query options helpers.
418418+ *
419419+ * @default true
420420+ */
421421+ enabled: boolean;
422422+ /**
423423+ * Custom function to generate metadata for the operation.
424424+ * Can return any valid meta object that will be included in the generated infinite query options.
425425+ *
426426+ * @param operation - The operation object containing all available metadata
427427+ * @returns A meta object with any properties you want to include
428428+ *
429429+ * @example
430430+ * ```typescript
431431+ * meta: (operation) => ({
432432+ * customField: operation.id,
433433+ * isDeprecated: operation.deprecated,
434434+ * tags: operation.tags,
435435+ * customObject: {
436436+ * method: operation.method,
437437+ * path: operation.path
438438+ * }
439439+ * })
440440+ * ```
441441+ *
442442+ * @default undefined
443443+ */
444444+ meta: (operation: IR.OperationObject) => Record<string, unknown>;
445445+ /**
446446+ * Custom naming pattern for generated infinite query options names. The name variable is obtained from the SDK function name.
447447+ *
448448+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/infiniteQueryOptions infiniteQueryOptions}
449449+ *
450450+ * @default '{{name}}InfiniteOptions'
451451+ */
452452+ name: StringName;
453453+ };
454454+ /**
455455+ * Resolved configuration for generated mutation options helpers.
456456+ *
457457+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/useMutation useMutation}
458458+ */
459459+ mutationOptions: {
460460+ /**
461461+ * The casing convention to use for generated names.
462462+ *
463463+ * @default 'camelCase'
464464+ */
465465+ case: StringCase;
466466+ /**
467467+ * Whether to generate mutation options helpers.
468468+ *
469469+ * @default true
470470+ */
471471+ enabled: boolean;
472472+ /**
473473+ * Custom function to generate metadata for the operation.
474474+ * Can return any valid meta object that will be included in the generated mutation options.
475475+ *
476476+ * @param operation - The operation object containing all available metadata
477477+ * @returns A meta object with any properties you want to include
478478+ *
479479+ * @example
480480+ * ```typescript
481481+ * meta: (operation) => ({
482482+ * customField: operation.id,
483483+ * isDeprecated: operation.deprecated,
484484+ * tags: operation.tags,
485485+ * customObject: {
486486+ * method: operation.method,
487487+ * path: operation.path
488488+ * }
489489+ * })
490490+ * ```
491491+ *
492492+ * @default undefined
493493+ */
494494+ meta: (operation: IR.OperationObject) => Record<string, unknown>;
495495+ /**
496496+ * Custom naming pattern for generated mutation options names. The name variable is obtained from the SDK function name.
497497+ *
498498+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/useMutation useMutation}
499499+ *
500500+ * @default '{{name}}Mutation'
501501+ */
502502+ name: StringName;
503503+ };
504504+ /**
505505+ * Resolved configuration for generated query keys.
506506+ *
507507+ * See {@link https://tanstack.com/query/v5/docs/framework/react/guides/query-keys Query Keys}
508508+ */
509509+ queryKeys: {
510510+ /**
511511+ * The casing convention to use for generated names.
512512+ *
513513+ * @default 'camelCase'
514514+ */
515515+ case: StringCase;
516516+ /**
517517+ * Whether to generate query keys.
518518+ *
519519+ * @default true
520520+ */
521521+ enabled: boolean;
522522+ /**
523523+ * Custom naming pattern for generated query key names. The name variable is obtained from the SDK function name.
524524+ *
525525+ * See {@link https://tanstack.com/query/v5/docs/framework/react/guides/query-keys Query Keys}
526526+ *
527527+ * @default '{{name}}QueryKey'
528528+ */
529529+ name: StringName;
530530+ /**
531531+ * Whether to include operation tags in query keys.
532532+ * This will make query keys larger but provides better cache invalidation capabilities.
533533+ *
534534+ * @default false
535535+ */
536536+ tags: boolean;
537537+ };
538538+ /**
539539+ * Resolved configuration for generated query options helpers.
540540+ *
541541+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/queryOptions queryOptions}
542542+ */
543543+ queryOptions: {
544544+ /**
545545+ * The casing convention to use for generated names.
546546+ *
547547+ * @default 'camelCase'
548548+ */
549549+ case: StringCase;
550550+ /**
551551+ * Whether to generate query options helpers.
552552+ *
553553+ * @default true
554554+ */
555555+ enabled: boolean;
556556+ /**
557557+ * Whether to export generated symbols.
558558+ *
559559+ * @default true
560560+ */
561561+ exported: boolean;
562562+ /**
563563+ * Custom function to generate metadata for the operation.
564564+ * Can return any valid meta object that will be included in the generated query options.
565565+ *
566566+ * @param operation - The operation object containing all available metadata
567567+ * @returns A meta object with any properties you want to include
568568+ *
569569+ * @example
570570+ * ```typescript
571571+ * meta: (operation) => ({
572572+ * customField: operation.id,
573573+ * isDeprecated: operation.deprecated,
574574+ * tags: operation.tags,
575575+ * customObject: {
576576+ * method: operation.method,
577577+ * path: operation.path
578578+ * }
579579+ * })
580580+ * ```
581581+ *
582582+ * @default undefined
583583+ */
584584+ meta: (operation: IR.OperationObject) => Record<string, unknown>;
585585+ /**
586586+ * Custom naming pattern for generated query options names. The name variable is obtained from the SDK function name.
587587+ *
588588+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/queryOptions queryOptions}
589589+ *
590590+ * @default '{{name}}Options'
591591+ */
592592+ name: StringName;
593593+ };
594594+ /**
595595+ * Configuration for generated `useQuery()` function helpers.
596596+ *
597597+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/useQuery useQuery}
598598+ */
599599+ useQuery: {
600600+ /**
601601+ * The casing convention to use for generated names.
602602+ *
603603+ * @default 'camelCase'
604604+ */
605605+ case: StringCase;
606606+ /**
607607+ * Whether to generate `useQuery()` function helpers.
608608+ *
609609+ * @default true
610610+ */
611611+ enabled: boolean;
612612+ /**
613613+ * Custom naming pattern for generated `useQuery()` function names. The name variable is
614614+ * obtained from the SDK function name.
615615+ *
616616+ * See {@link https://tanstack.com/query/v5/docs/framework/react/reference/useQuery useQuery}
617617+ *
618618+ * @default 'use{{name}}Query'
619619+ */
620620+ name: StringName;
621621+ };
622622+ };
623623+624624+export type SwrPlugin = DefinePlugin<UserConfig, Config>;
+3-29
packages/openapi-ts/src/plugins/types.d.ts
···2727 | '@tanstack/svelte-query'
2828 | '@tanstack/vue-query'
2929 | 'fastify'
3030+ | 'swr'
3031 | PluginValidatorNames;
31323233export type AnyPluginName = PluginNames | (string & {});
···6869 */
6970export namespace Plugin {
7071 export type Config<T extends Types> = Pick<T, 'api'> & {
7171- config: Omit<T['config'], 'name' | 'output'>;
7272+ config: Omit<T['config'], 'name'>;
7273 /**
7374 * Dependency plugins will be always processed, regardless of whether user
7475 * explicitly defines them in their `plugins` config.
···7677 dependencies?: ReadonlyArray<AnyPluginName>;
7778 handler: Handler<T>;
7879 name: T['config']['name'];
7979- output?: NonNullable<T['config']['output']>;
8080 /**
8181 * Resolves static configuration values into their runtime equivalents. For
8282 * example, when `validator` is set to `true`, it figures out which plugin
···8989 context: PluginContext,
9090 ) => void;
9191 /**
9292- * Optional tags can be used to help with deciding plugin order and resolving
9292+ * Tags can be used to help with deciding plugin order and resolving
9393 * plugin configuration options.
9494 */
9595 tags?: ReadonlyArray<PluginTag>;
9696 };
97979898- export type ConfigWithName<T extends Types> = Omit<Config<T>, 'config'> & {
9999- config: Omit<T['config'], 'output'>;
100100- };
101101-102102- /** @deprecated use `definePluginConfig()` instead */
103103- export type DefineConfig<
104104- Config extends BaseConfig,
105105- ResolvedConfig extends BaseConfig = Config,
106106- > = (config?: UserConfig<Omit<Config, 'name'>>) => Omit<
107107- Plugin.Config<Config, ResolvedConfig>,
108108- 'name'
109109- > & {
110110- /**
111111- * Cast name to `any` so it doesn't throw type error in `plugins` array.
112112- * We could allow any `string` as plugin `name` in the object syntax, but
113113- * that TypeScript trick would cause all string methods to appear as
114114- * suggested auto completions, which is undesirable.
115115- */
116116- name: any;
117117- };
118118-11998 /**
12099 * Generic wrapper for plugin hooks.
121100 */
···133112 config: Config;
134113 resolvedConfig: ResolvedConfig;
135114 };
136136-137137- /**
138138- * Users cannot modify output file path to avoid risk of conflicts.
139139- */
140140- export type UserConfig<Config extends BaseConfig> = Omit<Config, 'output'>;
141115}
142116143117export type DefinePlugin<