-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshopware.d.ts
36 lines (32 loc) · 1.24 KB
/
shopware.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
declare module "#shopware" {
import type { createAPIClient } from "@shopware/api-client";
import type {
operationPaths as defaultOperationPaths,
operations as defaultOperations,
components as defaultComponents,
} from "@shopware/api-client/api-types";
import type {
RequestParameters as DefaultRequestParameters,
RequestReturnType as DefaultRequestReturnType,
} from "@shopware/api-client";
type changedComponents = defaultComponents;
// example how to extend Cart schema:
// type changedComponents = components & {
// schemas: {
// Cart: components["schemas"]["Cart"] & {
// myspecialfield: "hello field";
// };
// };
// };
export type operations = defaultOperations<changedComponents>;
export type operationPaths = defaultOperationPaths;
export type Schemas = changedComponents["schemas"];
// we're exporting our own Api Client definition as it depends on our own instance
export type ApiClient = ReturnType<
typeof createAPIClient<operations, operationPaths>
>;
export type RequestParameters<T extends keyof operations> =
DefaultRequestParameters<T, operations>;
export type RequestReturnType<T extends keyof operations> =
DefaultRequestReturnType<T, operations>;
}