@scalar/api-client-react 0.5.15 → 1.0.1

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/dist/index.d.ts CHANGED
@@ -1,25 +1,35 @@
1
- import { ClientRequestConfig } from '@scalar/api-client';
1
+ import { App } from 'vue';
2
+ import { AuthenticationState } from '@scalar/oas-utils';
3
+ import { ClientConfiguration } from '@scalar/api-client';
2
4
  import { default as default_2 } from 'react';
5
+ import { OpenClientPayload } from '@scalar/api-client';
6
+ import { PropsWithChildren } from 'react';
7
+ import { SpecConfiguration } from '@scalar/oas-utils';
3
8
 
4
9
  /**
5
- * Api Client React
10
+ * Api Client Modal React
11
+ *
12
+ * Provider which mounts the Scalar Api Client Modal vue app
6
13
  */
7
- export declare const ApiClientReact: ({ proxy, close, isOpen, request, }: Props) => default_2.JSX.Element;
14
+ export declare const ApiClientModalProvider: ({ children, configuration, }: Props) => default_2.JSX.Element;
8
15
 
9
- /**
10
- * Api Client base for react
11
- * You are probably looking for ApiClientReact
12
- * only use this if you know what you are doing
13
- */
14
- export declare const ApiClientReactBase: (props: {
15
- proxy: string;
16
- }) => default_2.JSX.Element;
16
+ declare type Props = PropsWithChildren<{
17
+ configuration?: ClientConfiguration;
18
+ }>;
17
19
 
18
- declare type Props = {
19
- close: () => void;
20
- isOpen: boolean;
21
- proxy?: string;
22
- request: ClientRequestConfig | null;
23
- };
20
+ export declare const useApiClientModal: () => {
21
+ app: App<Element>;
22
+ updateConfig(newConfig: ClientConfiguration, mergeConfigs?: boolean): void;
23
+ updateServerUrl: (serverUrl: string) => void;
24
+ updateAuth: (auth: AuthenticationState) => void;
25
+ updateSpec: (spec: SpecConfiguration) => void;
26
+ open: (payload?: OpenClientPayload) => void;
27
+ mount: (mountingEl?: HTMLElement | null) => void;
28
+ modalState: {
29
+ open: boolean;
30
+ show: () => void;
31
+ hide: () => void;
32
+ };
33
+ } | null;
24
34
 
25
35
  export { }