File tree 3 files changed +15
-4
lines changed
packages/docusaurus-theme-redoc/src
3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " docusaurus-theme-redoc " : minor
3
+ ---
4
+
5
+ Adding onLoaded callback for RedocStandalone
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ function Redoc(props: Props): JSX.Element {
17
17
'docusaurus-theme-redoc' ,
18
18
) ;
19
19
const theme = isDarkTheme ? darkTheme : lightTheme ;
20
- const { spec, specUrl } = props ;
20
+ const { spec, specUrl, onLoaded } = props ;
21
21
const store = useMemo ( ( ) => {
22
22
if ( ! spec ) return null ;
23
23
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -39,6 +39,7 @@ function Redoc(props: Props): JSX.Element {
39
39
...redocOptions ,
40
40
theme,
41
41
} }
42
+ onLoaded = { onLoaded }
42
43
/>
43
44
) }
44
45
</ div >
Original file line number Diff line number Diff line change 1
1
import type { Props as LayoutProps } from '@theme/Layout' ;
2
- import type { RedocRawOptions , ObjectDescriptionProps } from 'redoc' ;
2
+ import type {
3
+ RedocRawOptions ,
4
+ ObjectDescriptionProps ,
5
+ RedocStandaloneProps ,
6
+ } from 'redoc' ;
3
7
import type { RecursivePartial } from './util' ;
4
8
5
- export type RedocProps = {
9
+ export interface RedocProps
10
+ extends Omit < RedocStandaloneProps , 'spec' | 'specUrl' | 'options' > {
6
11
spec ?: Record < string , unknown > ;
7
12
specUrl ?: string ;
8
- } ;
13
+ }
9
14
10
15
export type ApiSchemaProps = Omit <
11
16
ObjectDescriptionProps ,
You can’t perform that action at this time.
0 commit comments