@qualisero/openapi-endpoint 0.12.3 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +135 -252
- package/dist/cli.js +1318 -58
- package/dist/index.d.ts +9 -213
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -143
- package/dist/openapi-helpers.d.ts +4 -17
- package/dist/openapi-helpers.d.ts.map +1 -1
- package/dist/openapi-helpers.js +3 -93
- package/dist/openapi-mutation.d.ts +48 -111
- package/dist/openapi-mutation.d.ts.map +1 -1
- package/dist/openapi-mutation.js +75 -104
- package/dist/openapi-query.d.ts +46 -209
- package/dist/openapi-query.d.ts.map +1 -1
- package/dist/openapi-query.js +50 -88
- package/dist/openapi-utils.d.ts +31 -4
- package/dist/openapi-utils.d.ts.map +1 -1
- package/dist/openapi-utils.js +45 -56
- package/dist/types.d.ts +250 -280
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +11 -0
- package/package.json +3 -2
- package/dist/openapi-endpoint.d.ts +0 -18
- package/dist/openapi-endpoint.d.ts.map +0 -1
- package/dist/openapi-endpoint.js +0 -24
- package/dist/types-documentation.d.ts +0 -158
- package/dist/types-documentation.d.ts.map +0 -1
- package/dist/types-documentation.js +0 -9
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,kBAAkB,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAA;AACxG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,kBAAkB,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAA;AACxG,OAAO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AC,CAAC,GAAG,SAAS;CAC3E,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,CAAC,GAAG,SAAS,MAAM,EAAE,EAAE,SAAS,MAAM,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC,SAAS;IACrF,UAAU,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,WAAW,CAAA;KAAE,CAAA;CAC1C,GACG,WAAW,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACzC;KAAG,CAAC,IAAI,MAAM,WAAW,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;CAAE,GAC7C,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACvB,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA"}
|
package/dist/types.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// HTTP Methods
|
|
3
|
+
// ============================================================================
|
|
1
4
|
export var HttpMethod;
|
|
2
5
|
(function (HttpMethod) {
|
|
3
6
|
HttpMethod["GET"] = "GET";
|
|
@@ -9,3 +12,11 @@ export var HttpMethod;
|
|
|
9
12
|
HttpMethod["OPTIONS"] = "OPTIONS";
|
|
10
13
|
HttpMethod["TRACE"] = "TRACE";
|
|
11
14
|
})(HttpMethod || (HttpMethod = {}));
|
|
15
|
+
export const QUERY_METHODS = [HttpMethod.GET, HttpMethod.HEAD, HttpMethod.OPTIONS];
|
|
16
|
+
export const MUTATION_METHODS = [HttpMethod.POST, HttpMethod.PUT, HttpMethod.PATCH, HttpMethod.DELETE];
|
|
17
|
+
export function isQueryMethod(method) {
|
|
18
|
+
return QUERY_METHODS.includes(method);
|
|
19
|
+
}
|
|
20
|
+
export function isMutationMethod(method) {
|
|
21
|
+
return MUTATION_METHODS.includes(method);
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qualisero/openapi-endpoint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/qualisero/openapi-endpoint.git"
|
|
@@ -58,7 +58,8 @@
|
|
|
58
58
|
"@tanstack/vue-query": ">=5.90",
|
|
59
59
|
"axios": ">=1.12",
|
|
60
60
|
"vue": ">=3.3",
|
|
61
|
-
"openapi-typescript": "^7.9.1"
|
|
61
|
+
"openapi-typescript": "^7.9.1",
|
|
62
|
+
"@vue/reactivity": ">=3.3"
|
|
62
63
|
},
|
|
63
64
|
"devDependencies": {
|
|
64
65
|
"@eslint/js": "^9.37.0",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type MaybeRefOrGetter } from 'vue';
|
|
2
|
-
import { EndpointQueryReturn } from './openapi-query';
|
|
3
|
-
import { EndpointMutationReturn } from './openapi-mutation';
|
|
4
|
-
import type { GetPathParameters, QQueryOptions, QMutationOptions, Operations, IsQueryOperation } from './types';
|
|
5
|
-
import { type OpenApiHelpers } from './openapi-helpers';
|
|
6
|
-
/**
|
|
7
|
-
* Composable for performing a strictly typed OpenAPI operation (query or mutation) using Vue Query.
|
|
8
|
-
* Automatically detects whether the operation is a query or mutation and delegates to the appropriate composable.
|
|
9
|
-
* Returns a reactive query or mutation object with strict typing and helpers.
|
|
10
|
-
*
|
|
11
|
-
* @template T OperationId type representing the OpenAPI operation.
|
|
12
|
-
* @param operationId The OpenAPI operation ID to execute.
|
|
13
|
-
* @param pathParamsOrOptions Optional path parameters for the endpoint, can be reactive.
|
|
14
|
-
* @param optionsOrNull Optional query or mutation options, including Vue Query options.
|
|
15
|
-
* @returns Query or mutation object with strict typing and helpers.
|
|
16
|
-
*/
|
|
17
|
-
export declare function useEndpoint<Ops extends Operations<Ops>, Op extends keyof Ops>(operationId: Op, helpers: OpenApiHelpers<Ops, Op>, pathParamsOrOptions?: MaybeRefOrGetter<GetPathParameters<Ops, Op> | null | undefined> | (IsQueryOperation<Ops, Op> extends true ? QQueryOptions<Ops, Op> : QMutationOptions<Ops, Op>), optionsOrNull?: IsQueryOperation<Ops, Op> extends true ? QQueryOptions<Ops, Op> : QMutationOptions<Ops, Op>): IsQueryOperation<Ops, Op> extends true ? EndpointQueryReturn<Ops, Op> : EndpointMutationReturn<Ops, Op>;
|
|
18
|
-
//# sourceMappingURL=openapi-endpoint.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openapi-endpoint.d.ts","sourceRoot":"","sources":["../src/openapi-endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAoB,MAAM,iBAAiB,CAAA;AACvE,OAAO,EAAE,sBAAsB,EAAuB,MAAM,oBAAoB,CAAA;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC/G,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,GAAG,SAAS,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,MAAM,GAAG,EAC3E,WAAW,EAAE,EAAE,EACf,OAAO,EAAE,cAAc,CAAC,GAAG,EAAE,EAAE,CAAC,EAChC,mBAAmB,CAAC,EAChB,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,GAC/D,CAAC,gBAAgB,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,IAAI,GAAG,aAAa,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,gBAAgB,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EACjG,aAAa,CAAC,EAAE,gBAAgB,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,IAAI,GAAG,aAAa,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,gBAAgB,CAAC,GAAG,EAAE,EAAE,CAAC,GAC1G,gBAAgB,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,IAAI,GAAG,mBAAmB,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,sBAAsB,CAAC,GAAG,EAAE,EAAE,CAAC,CAuBzG"}
|
package/dist/openapi-endpoint.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { useEndpointQuery } from './openapi-query.js';
|
|
2
|
-
import { useEndpointMutation } from './openapi-mutation.js';
|
|
3
|
-
/**
|
|
4
|
-
* Composable for performing a strictly typed OpenAPI operation (query or mutation) using Vue Query.
|
|
5
|
-
* Automatically detects whether the operation is a query or mutation and delegates to the appropriate composable.
|
|
6
|
-
* Returns a reactive query or mutation object with strict typing and helpers.
|
|
7
|
-
*
|
|
8
|
-
* @template T OperationId type representing the OpenAPI operation.
|
|
9
|
-
* @param operationId The OpenAPI operation ID to execute.
|
|
10
|
-
* @param pathParamsOrOptions Optional path parameters for the endpoint, can be reactive.
|
|
11
|
-
* @param optionsOrNull Optional query or mutation options, including Vue Query options.
|
|
12
|
-
* @returns Query or mutation object with strict typing and helpers.
|
|
13
|
-
*/
|
|
14
|
-
export function useEndpoint(operationId, helpers, pathParamsOrOptions, optionsOrNull) {
|
|
15
|
-
if (helpers.isMutationOperation(operationId)) {
|
|
16
|
-
return useEndpointMutation(operationId, helpers, pathParamsOrOptions, optionsOrNull);
|
|
17
|
-
}
|
|
18
|
-
else if (helpers.isQueryOperation(operationId)) {
|
|
19
|
-
return useEndpointQuery(operationId, helpers, pathParamsOrOptions, optionsOrNull);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
throw new Error(`Operation ${String(operationId)} is neither a query nor a mutation operation`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Documentation-only exports for better API reference.
|
|
3
|
-
*
|
|
4
|
-
* This file exports types that are used internally but important for users to understand
|
|
5
|
-
* when working with the library. These are re-exported from types.ts with enhanced
|
|
6
|
-
* documentation for TypeDoc generation.
|
|
7
|
-
*/
|
|
8
|
-
import type { QQueryOptions as _QQueryOptions } from './types.js';
|
|
9
|
-
import type { QMutationOptions as _QMutationOptions } from './types.js';
|
|
10
|
-
import type { EndpointQueryReturn as _EndpointQueryReturn } from './openapi-query.js';
|
|
11
|
-
import type { EndpointMutationReturn as _EndpointMutationReturn } from './openapi-mutation.js';
|
|
12
|
-
import type { Operations } from './types.js';
|
|
13
|
-
/**
|
|
14
|
-
* Query options for `useQuery` that extend TanStack Query options.
|
|
15
|
-
*
|
|
16
|
-
* This type combines all options from TanStack Query's `UseQueryOptions` with
|
|
17
|
-
* custom options specific to this library, such as reactive query parameters,
|
|
18
|
-
* custom error handling, and axios configuration.
|
|
19
|
-
*
|
|
20
|
-
* @group Types
|
|
21
|
-
* @template Ops - The operations type from your OpenAPI specification
|
|
22
|
-
* @template Op - The operation key from your operations type
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* // Using with type inference (recommended)
|
|
27
|
-
* const { data } = api.useQuery('listPets', {
|
|
28
|
-
* enabled: computed(() => isLoggedIn.value),
|
|
29
|
-
* staleTime: 5000,
|
|
30
|
-
* queryParams: { limit: 10, status: 'available' },
|
|
31
|
-
* onError: (error) => toast.error(error.message)
|
|
32
|
-
* })
|
|
33
|
-
*
|
|
34
|
-
* // Using explicit type
|
|
35
|
-
* const options: QQueryOptions<OpenApiOperations, 'listPets'> = {
|
|
36
|
-
* enabled: true,
|
|
37
|
-
* staleTime: 10000
|
|
38
|
-
* }
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
export type QQueryOptions<Ops extends Operations<Ops>, Op extends keyof Ops> = _QQueryOptions<Ops, Op>;
|
|
42
|
-
/**
|
|
43
|
-
* Mutation options for `useMutation` that extend TanStack Query options.
|
|
44
|
-
*
|
|
45
|
-
* This type combines all options from TanStack Query's `UseMutationOptions` with
|
|
46
|
-
* custom options for cache management, such as controlling automatic cache updates
|
|
47
|
-
* and specifying operations to invalidate after the mutation.
|
|
48
|
-
*
|
|
49
|
-
* @group Types
|
|
50
|
-
* @template Ops - The operations type from your OpenAPI specification
|
|
51
|
-
* @template Op - The operation key from your operations type
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```typescript
|
|
55
|
-
* // Default cache management (automatic)
|
|
56
|
-
* const mutation = api.useMutation('createPet', {
|
|
57
|
-
* onSuccess: (data) => console.log('Created', data)
|
|
58
|
-
* })
|
|
59
|
-
*
|
|
60
|
-
* // Disable automatic cache management
|
|
61
|
-
* const mutation = api.useMutation('updatePet', {
|
|
62
|
-
* dontInvalidate: true,
|
|
63
|
-
* dontUpdateCache: true
|
|
64
|
-
* })
|
|
65
|
-
*
|
|
66
|
-
* // Invalidate specific operations
|
|
67
|
-
* const mutation = api.useMutation('deletePet', {
|
|
68
|
-
* invalidateOperations: ['listPets', 'getUserPets']
|
|
69
|
-
* })
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
export type QMutationOptions<Ops extends Operations<Ops>, Op extends keyof Ops> = _QMutationOptions<Ops, Op>;
|
|
73
|
-
/**
|
|
74
|
-
* Return type of `useQuery` with all available reactive properties.
|
|
75
|
-
*
|
|
76
|
-
* This type represents the complete object returned by `useQuery`, including
|
|
77
|
-
* all properties from TanStack Query's `UseQueryResult` plus additional
|
|
78
|
-
* helper properties provided by this library.
|
|
79
|
-
*
|
|
80
|
-
* @group Types
|
|
81
|
-
* @template Ops - The operations type from your OpenAPI specification
|
|
82
|
-
* @template Op - The operation key from your operations type
|
|
83
|
-
*
|
|
84
|
-
* @property {ComputedRef<GetResponseData<Ops, Op> | undefined>} data - The response data, typed according to your OpenAPI spec
|
|
85
|
-
* @property {ComputedRef<boolean>} isEnabled - Whether the query is enabled and can execute
|
|
86
|
-
* @property {ComputedRef<unknown[]>} queryKey - The query key used by TanStack Query
|
|
87
|
-
* @property {(callback: (data: GetResponseData<Ops, Op>) => void) => void} onLoad - Register a callback for when data loads
|
|
88
|
-
* @property {ComputedRef<boolean>} isLoading - Whether the query is currently fetching
|
|
89
|
-
* @property {ComputedRef<Error | null>} error - Any error that occurred
|
|
90
|
-
* @property {ComputedRef<boolean>} isFetching - Whether the query is currently fetching (including background refetches)
|
|
91
|
-
* @property {ComputedRef<boolean>} isSuccess - Whether the query has successfully fetched data
|
|
92
|
-
* @property {ComputedRef<boolean>} isError - Whether the query has encountered an error
|
|
93
|
-
* @property {() => Promise<void>} refetch - Function to manually refetch the query
|
|
94
|
-
* @property {() => void} remove - Function to remove the query from the cache
|
|
95
|
-
*
|
|
96
|
-
* @example
|
|
97
|
-
* ```typescript
|
|
98
|
-
* const query = api.useQuery('getPet', { petId: '123' })
|
|
99
|
-
*
|
|
100
|
-
* // Access reactive properties
|
|
101
|
-
* if (query.isLoading.value) {
|
|
102
|
-
* console.log('Loading...')
|
|
103
|
-
* } else if (query.error.value) {
|
|
104
|
-
* console.error('Error:', query.error.value)
|
|
105
|
-
* } else if (query.data.value) {
|
|
106
|
-
* console.log('Pet:', query.data.value.name)
|
|
107
|
-
* }
|
|
108
|
-
*
|
|
109
|
-
* // Register load callback
|
|
110
|
-
* query.onLoad((pet) => {
|
|
111
|
-
* console.log('Pet loaded:', pet.name)
|
|
112
|
-
* })
|
|
113
|
-
* ```
|
|
114
|
-
*/
|
|
115
|
-
export type EndpointQueryReturn<Ops extends Operations<Ops>, Op extends keyof Ops> = _EndpointQueryReturn<Ops, Op>;
|
|
116
|
-
/**
|
|
117
|
-
* Return type of `useMutation` with all available reactive properties.
|
|
118
|
-
*
|
|
119
|
-
* This type represents the complete object returned by `useMutation`, including
|
|
120
|
-
* all properties from TanStack Query's `UseMutationResult` plus additional
|
|
121
|
-
* helper properties provided by this library.
|
|
122
|
-
*
|
|
123
|
-
* @group Types
|
|
124
|
-
* @template Ops - The operations type from your OpenAPI specification
|
|
125
|
-
* @template Op - The operation key from your operations type
|
|
126
|
-
*
|
|
127
|
-
* @property {ComputedRef<AxiosResponse<GetResponseData<Ops, Op>> | undefined>} data - The axios response with typed data
|
|
128
|
-
* @property {ComputedRef<boolean>} isEnabled - Whether the mutation can execute (path is resolved)
|
|
129
|
-
* @property {ComputedRef<GetPathParameters<Ops, Op>>} pathParams - Current path parameters
|
|
130
|
-
* @property {ComputedRef<Error | null>} error - Any error that occurred
|
|
131
|
-
* @property {ComputedRef<boolean>} isIdle - Whether the mutation has not been triggered yet
|
|
132
|
-
* @property {ComputedRef<boolean>} isPending - Whether the mutation is currently executing
|
|
133
|
-
* @property {ComputedRef<boolean>} isSuccess - Whether the last mutation was successful
|
|
134
|
-
* @property {ComputedRef<boolean>} isError - Whether the last mutation encountered an error
|
|
135
|
-
* @property {Ref<GetPathParameters<Ops, Op>>} extraPathParams - Ref to set additional path parameters when calling mutate
|
|
136
|
-
* @property {(variables) => void} mutate - Trigger mutation synchronously (throws error on failure)
|
|
137
|
-
* @property {(variables) => Promise<void>} mutateAsync - Trigger mutation asynchronously (returns promise)
|
|
138
|
-
* @property {() => void} reset - Reset the mutation to its initial state
|
|
139
|
-
*
|
|
140
|
-
* @example
|
|
141
|
-
* ```typescript
|
|
142
|
-
* const mutation = api.useMutation('createPet', {
|
|
143
|
-
* onSuccess: (response) => console.log('Created:', response.data)
|
|
144
|
-
* })
|
|
145
|
-
*
|
|
146
|
-
* // Execute mutation
|
|
147
|
-
* await mutation.mutateAsync({ data: { name: 'Fluffy' } })
|
|
148
|
-
*
|
|
149
|
-
* // Check state
|
|
150
|
-
* if (mutation.isPending.value) {
|
|
151
|
-
* console.log('Creating...')
|
|
152
|
-
* } else if (mutation.isSuccess.value) {
|
|
153
|
-
* console.log('Success!')
|
|
154
|
-
* }
|
|
155
|
-
* ```
|
|
156
|
-
*/
|
|
157
|
-
export type EndpointMutationReturn<Ops extends Operations<Ops>, Op extends keyof Ops> = _EndpointMutationReturn<Ops, Op>;
|
|
158
|
-
//# sourceMappingURL=types-documentation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-documentation.d.ts","sourceRoot":"","sources":["../src/types-documentation.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,aAAa,IAAI,cAAc,EAAE,MAAM,YAAY,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,IAAI,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACvE,OAAO,KAAK,EAAE,mBAAmB,IAAI,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACrF,OAAO,KAAK,EAAE,sBAAsB,IAAI,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAC9F,OAAO,KAAK,EAA0E,UAAU,EAAE,MAAM,YAAY,CAAA;AAEpH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,aAAa,CAAC,GAAG,SAAS,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,MAAM,GAAG,IAAI,cAAc,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AAEtG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,MAAM,gBAAgB,CAAC,GAAG,SAAS,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,MAAM,GAAG,IAAI,iBAAiB,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AAE5G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,MAAM,mBAAmB,CAAC,GAAG,SAAS,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,MAAM,GAAG,IAAI,oBAAoB,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AAElH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,MAAM,sBAAsB,CAAC,GAAG,SAAS,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,MAAM,GAAG,IAAI,uBAAuB,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
/**
|
|
3
|
-
* @fileoverview Documentation-only exports for better API reference.
|
|
4
|
-
*
|
|
5
|
-
* This file exports types that are used internally but important for users to understand
|
|
6
|
-
* when working with the library. These are re-exported from types.ts with enhanced
|
|
7
|
-
* documentation for TypeDoc generation.
|
|
8
|
-
*/
|
|
9
|
-
export {};
|