Skip to content

Commit 9fb35c3

Browse files
committed
fix: resolve theme type conflicts
1 parent fbca820 commit 9fb35c3

File tree

6 files changed

+20
-242
lines changed

6 files changed

+20
-242
lines changed

packages/docusaurus-theme-openapi-docs/src/theme-openapi.d.ts

Lines changed: 0 additions & 240 deletions
Original file line numberDiff line numberDiff line change
@@ -15,246 +15,6 @@ export type {
1515
PropSidebars,
1616
} from "@docusaurus/plugin-content-docs/lib/sidebars/types";
1717

18-
/* eslint-disable @typescript-eslint/no-use-before-define */
19-
2018
declare module "docusaurus-theme-openapi-docs" {
2119
export type ThemeConfig = Partial<import("./types").ThemeConfig>;
2220
}
23-
24-
declare module "@theme/ApiItem/hooks" {
25-
export { useTypedDispatch, useTypedSelector };
26-
}
27-
28-
declare module "@theme/ApiItem/Layout" {
29-
export interface Props {
30-
readonly children: JSX.Element;
31-
}
32-
33-
export default function Layout(props: any): JSX.Element;
34-
}
35-
36-
declare module "@theme/ApiItem/store" {
37-
export { AppDispatch, RootState };
38-
}
39-
40-
declare module "@theme/SchemaTabs" {
41-
export default function SchemaTabs(props: any): JSX.Element;
42-
}
43-
44-
declare module "@theme/Markdown" {
45-
export default function Markdown(props: any): JSX.Element;
46-
}
47-
48-
declare module "@theme/ApiExplorer/Accept" {
49-
export default function Accept(): JSX.Element;
50-
}
51-
52-
declare module "@theme/ApiExplorer/Accept/slice" {
53-
export { setAccept };
54-
export default accept as Reducer<State, AnyAction>;
55-
}
56-
57-
declare module "@theme/ApiExplorer/Authorization" {
58-
export default function Authorization(): JSX.Element;
59-
}
60-
61-
declare module "@theme/ApiExplorer/Authorization/slice" {
62-
export { AuthState, Scheme, setAuthData, setSelectedAuth, createAuth };
63-
export default auth as Reducer<State, AnyAction>;
64-
}
65-
66-
declare module "@theme/ApiExplorer/Body" {
67-
import { Props as BodyProps } from "@theme/ApiExplorer/Body";
68-
69-
export default function Body(props: BodyProps): JSX.Element;
70-
}
71-
72-
declare module "@theme/ApiExplorer/Body/json2xml" {
73-
export default function json2xml(any, any?): any;
74-
}
75-
76-
declare module "@theme/ApiExplorer/Body/slice" {
77-
import { Body, Content, State } from "@theme/ApiExplorer/Body/slice";
78-
79-
export { Body, Content, State };
80-
export function setStringRawBody(any, any?): any;
81-
export default body as Reducer<State, AnyAction>;
82-
}
83-
84-
declare module "@theme/ApiExplorer/buildPostmanRequest" {
85-
export default function buildPostmanRequest(any, any?): any;
86-
}
87-
88-
declare module "@theme/ApiExplorer/CodeTabs" {
89-
import { Props as CodeTabsProps } from "@theme/ApiExplorer/CodeTabs";
90-
91-
export default function CodeTabs(props: CodeTabsProps): JSX.Element;
92-
}
93-
94-
declare module "@theme/ApiExplorer/ContentType" {
95-
export default function ContentType(): JSX.Element;
96-
}
97-
98-
declare module "@theme/ApiExplorer/ContentType/slice" {
99-
export { setContentType };
100-
export default contentType as Reducer<State, AnyAction>;
101-
}
102-
103-
declare module "@theme/ApiExplorer/CodeSnippets" {
104-
import { Props as CurlProps } from "@theme/ApiExplorer/CodeSnippets";
105-
106-
export { languageSet, Language } from "@theme/ApiExplorer/CodeSnippets";
107-
export default function Curl(props: CurlProps): JSX.Element;
108-
}
109-
110-
declare module "@theme/ApiExplorer/FloatingButton" {
111-
import { Props as FloatingButtonProps } from "@theme/ApiExplorer/FloatingButton";
112-
113-
export default function FloatingButton(
114-
props: FloatingButtonProps
115-
): JSX.Element;
116-
}
117-
118-
declare module "@theme/ApiExplorer/FormItem" {
119-
import { Props as FormItemProps } from "@theme/ApiExplorer/FormItem";
120-
121-
export default function FormItem(props: FormItemProps): JSX.Element;
122-
}
123-
124-
declare module "@theme/ApiExplorer/FormSelect" {
125-
import { Props as FormSelectProps } from "@theme/ApiExplorer/FormSelect";
126-
127-
export default function FormSelect(props: FormSelectProps): JSX.Element;
128-
}
129-
130-
declare module "@theme/ApiExplorer/FormTextInput" {
131-
import { Props as FormTextInputProps } from "@theme/ApiExplorer/FormTextInput";
132-
133-
export default function FormTextInput(props: FormTextInputProps): JSX.Element;
134-
}
135-
136-
declare module "@theme/ApiExplorer/FormFileUpload" {
137-
import { Props as FormFileUploadProps } from "@theme/ApiExplorer/FormFileUpload";
138-
139-
export default function FormFileUpload(
140-
props: FormFileUploadProps
141-
): JSX.Element;
142-
}
143-
144-
declare module "@theme/ApiExplorer/FormMultiSelect" {
145-
import { Props as FormMultiSelectProps } from "@theme/ApiExplorer/FormMultiSelect";
146-
147-
export default function FormMultiSelect(
148-
props: FormMultiSelectProps
149-
): JSX.Element;
150-
}
151-
152-
declare module "@theme/ApiExplorer/Execute" {
153-
import { Props as ExecuteProps } from "@theme/ApiExplorer/Execute";
154-
155-
export default function Execute(props: ExecuteProps): JSX.Element;
156-
}
157-
158-
declare module "@theme/ApiExplorer/LiveEditor" {
159-
export default function LiveEditor(props: any): JSX.Element;
160-
}
161-
162-
declare module "@theme/ApiExplorer/MethodEndpoint" {
163-
import { Props as MethodEndpointProps } from "@theme/ApiExplorer/MethodEndpoint";
164-
165-
export default function MethodEndpoint(
166-
props: MethodEndpointProps
167-
): JSX.Element;
168-
}
169-
170-
declare module "@theme/ApiExplorer/ParamOptions" {
171-
import { ParamProps } from "@theme/ApiExplorer/ParamOptions";
172-
173-
export default function ParamOptions(props: ParamProps): JSX.Element;
174-
}
175-
176-
declare module "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem" {
177-
import { ParamProps } from "@theme/ApiExplorer/ParamOptions";
178-
179-
export default function ParamMultiSelectFormItem(
180-
props: ParamProps
181-
): JSX.Element;
182-
}
183-
184-
declare module "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem" {
185-
import { ParamProps } from "@theme/ApiExplorer/ParamOptions";
186-
187-
export default function ParamArrayFormItem(props: ParamProps): JSX.Element;
188-
}
189-
190-
declare module "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem" {
191-
import { ParamProps } from "@theme/ApiExplorer/ParamOptions";
192-
193-
export default function ParamSelectFormItem(props: ParamProps): JSX.Element;
194-
}
195-
196-
declare module "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem" {
197-
import { ParamProps } from "@theme/ApiExplorer/ParamOptions";
198-
199-
export default function ParamBooleanFormItem(props: ParamProps): JSX.Element;
200-
}
201-
202-
declare module "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem" {
203-
import { ParamProps } from "@theme/ApiExplorer/ParamOptions";
204-
205-
export default function ParamTextFormItem(props: ParamProps): JSX.Element;
206-
}
207-
208-
declare module "@theme/ApiExplorer/ParamOptions/slice" {
209-
export type { Param };
210-
export const setParam;
211-
export default params as Reducer<State, AnyAction>;
212-
}
213-
214-
declare module "@theme/ApiExplorer/persistanceMiddleware" {
215-
export { createPersistanceMiddleware };
216-
}
217-
218-
declare module "@theme/ApiExplorer/Request" {
219-
import { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
220-
221-
export interface RequestProps {
222-
item: NonNullable<ApiItem>;
223-
}
224-
export default function Request(props: RequestProps): JSX.Element;
225-
}
226-
227-
declare module "@theme/ApiExplorer/Response" {
228-
import { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
229-
230-
export interface ResponseProps {
231-
item: NonNullable<ApiItem>;
232-
}
233-
234-
export default function Response(props: ResponseProps): JSX.Element;
235-
}
236-
237-
declare module "@theme/ApiExplorer/Response/slice" {
238-
export { setResponse, setCode, setHeaders, clearCode, clearHeaders };
239-
export default response as Reducer<State, AnyAction>;
240-
}
241-
242-
declare module "@theme/ApiExplorer/SecuritySchemes" {
243-
export default function SecuritySchemes(props: any): JSX.Element;
244-
}
245-
246-
declare module "@theme/ApiExplorer/Server" {
247-
export default function Server(): JSX.Element;
248-
}
249-
250-
declare module "@theme/ApiExplorer/ApiCodeBlock" {
251-
export default function ApiCodeBlock(): JSX.Element;
252-
}
253-
254-
declare module "@theme/ApiExplorer/Server/slice" {
255-
export default server as Reducer<State, AnyAction>;
256-
}
257-
258-
declare module "@theme/ApiExplorer/storage-utils" {
259-
export { createStorage, hashArray };
260-
}

packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/Authorization/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function Authorization() {
3636
<FormSelect
3737
options={optionKeys}
3838
value={selected}
39-
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
39+
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => {
4040
dispatch(setSelectedAuth(e.target.value));
4141
}}
4242
/>

packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/Body/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function Body({
168168
>
169169
<FormSelect
170170
options={["---", ...val.enum]}
171-
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
171+
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => {
172172
const val = e.target.value;
173173
if (val === "---") {
174174
dispatch(clearFormBodyKey(key));
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* ============================================================================
2+
* Copyright (c) Palo Alto Networks
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
* ========================================================================== */
7+
8+
export default function json2xml(input: any, indent?: any): any;

packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/FormTextInput/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export interface Props {
1717
placeholder?: string;
1818
password?: boolean;
1919
onChange?: React.ChangeEventHandler<HTMLInputElement>;
20+
paramName?: string;
21+
isRequired?: boolean;
2022
}
2123

2224
function FormTextInput({
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* ============================================================================
2+
* Copyright (c) Palo Alto Networks
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
* ========================================================================== */
7+
8+
export default function Markdown(props: any): JSX.Element;

0 commit comments

Comments
 (0)