@stoplight/elements-core 7.6.4 → 7.7.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/__fixtures__/operations/operation-minimal.d.ts +2 -0
- package/components/Docs/Docs.d.ts +2 -1
- package/components/Docs/HttpOperation/Body.d.ts +1 -1
- package/components/Docs/HttpService/AdditionalInfo.d.ts +1 -0
- package/components/Docs/HttpService/ServerInfo.d.ts +1 -1
- package/components/LinkHeading.d.ts +3 -0
- package/components/TryIt/Body/request-body-utils.d.ts +1 -1
- package/components/TryIt/Servers/ServersDropdown.d.ts +1 -1
- package/components/TryIt/TryIt.d.ts +1 -1
- package/components/TryIt/build-request.d.ts +5 -2
- package/components/TryIt/build-request.spec.d.ts +1 -0
- package/components/TryIt/chosenServer.d.ts +1 -1
- package/context/Options.d.ts +9 -0
- package/context/RouterType.d.ts +3 -0
- package/hooks/useChosenServerUrl.d.ts +6 -0
- package/index.esm.js +266 -77
- package/index.js +266 -77
- package/index.mjs +266 -77
- package/package.json +7 -7
- package/styles.min.css +1 -1
- package/utils/http-spec/IServer.d.ts +1 -2
- package/utils/ref-resolving/ReferenceResolver.d.ts +1 -1
- package/utils/ref-resolving/resolvedObject.d.ts +3 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NodeType } from '@stoplight/types';
|
|
1
|
+
import type { NodeHasChangedFn, NodeType } from '@stoplight/types';
|
|
2
2
|
import { Location } from 'history';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ParsedNode } from '../../types';
|
|
@@ -24,6 +24,7 @@ interface BaseDocsProps {
|
|
|
24
24
|
hideExport?: boolean;
|
|
25
25
|
compact?: number | boolean;
|
|
26
26
|
};
|
|
27
|
+
nodeHasChanged?: NodeHasChangedFn<React.ReactNode>;
|
|
27
28
|
}
|
|
28
29
|
export interface DocsProps extends BaseDocsProps {
|
|
29
30
|
nodeType: NodeType;
|
|
@@ -3,7 +3,7 @@ export interface BodyProps {
|
|
|
3
3
|
body: IHttpOperationRequestBody;
|
|
4
4
|
onChange: (requestBodyIndex: number) => void;
|
|
5
5
|
}
|
|
6
|
-
export declare const isBodyEmpty: (body?: IHttpOperationRequestBody | undefined) => boolean;
|
|
6
|
+
export declare const isBodyEmpty: (body?: IHttpOperationRequestBody<false> | undefined) => boolean;
|
|
7
7
|
export declare const Body: {
|
|
8
8
|
({ body, onChange }: BodyProps): JSX.Element | null;
|
|
9
9
|
displayName: string;
|
|
@@ -6,7 +6,7 @@ export declare const isFormDataContent: (content: IMediaTypeContent) => boolean;
|
|
|
6
6
|
export declare function createRequestBody(mediaTypeContent: IMediaTypeContent | undefined, bodyParameterValues: BodyParameterValues | undefined): Promise<string | Blob | ArrayBuffer | ArrayBufferView | FormData | ReadableStream<Uint8Array> | undefined>;
|
|
7
7
|
export declare const useBodyParameterState: (mediaTypeContent: IMediaTypeContent | undefined) => readonly [BodyParameterValues, React.Dispatch<React.SetStateAction<BodyParameterValues>>, ParameterOptional, React.Dispatch<React.SetStateAction<ParameterOptional>>, {
|
|
8
8
|
readonly isFormDataBody: true;
|
|
9
|
-
readonly bodySpecification: IMediaTypeContent
|
|
9
|
+
readonly bodySpecification: IMediaTypeContent<false>;
|
|
10
10
|
}] | readonly [BodyParameterValues, React.Dispatch<React.SetStateAction<BodyParameterValues>>, ParameterOptional, React.Dispatch<React.SetStateAction<ParameterOptional>>, {
|
|
11
11
|
readonly isFormDataBody: false;
|
|
12
12
|
readonly bodySpecification: undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Dictionary, IHttpOperation, IMediaTypeContent } from '@stoplight/types';
|
|
1
|
+
import { Dictionary, IHttpOperation, IMediaTypeContent, IServer } from '@stoplight/types';
|
|
2
2
|
import { Request as HarRequest } from 'har-format';
|
|
3
|
-
import { IServer } from '../../utils/http-spec/IServer';
|
|
4
3
|
import { HttpSecuritySchemeWithValues } from './Auth/authentication-utils';
|
|
5
4
|
import { BodyParameterValues } from './Body/request-body-utils';
|
|
6
5
|
import { MockData } from './Mocking/mocking-utils';
|
|
@@ -15,6 +14,10 @@ interface BuildRequestInput {
|
|
|
15
14
|
credentials?: 'omit' | 'include' | 'same-origin';
|
|
16
15
|
corsProxy?: string;
|
|
17
16
|
}
|
|
17
|
+
export declare const getQueryParams: ({ httpOperation, parameterValues, }: Pick<BuildRequestInput, 'httpOperation'> & Pick<BuildRequestInput, 'parameterValues'>) => {
|
|
18
|
+
name: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}[];
|
|
18
21
|
export declare function buildFetchRequest({ httpOperation, mediaTypeContent, bodyInput, parameterValues, mockData, auth, chosenServer, credentials, corsProxy, }: BuildRequestInput): Promise<Parameters<typeof fetch>>;
|
|
19
22
|
export declare function buildHarRequest({ httpOperation, bodyInput, parameterValues, mediaTypeContent, auth, mockData, chosenServer, corsProxy, }: BuildRequestInput): Promise<HarRequest>;
|
|
20
23
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IServer } from '
|
|
1
|
+
import type { IServer } from '@stoplight/types';
|
|
2
2
|
export declare const chosenServerAtom: import("jotai").Atom<IServer | null | undefined> & {
|
|
3
3
|
write: (get: {
|
|
4
4
|
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { DocsProps } from '../components/Docs';
|
|
3
|
+
export declare type ElementsOptionsContextProps = Pick<DocsProps, 'nodeHasChanged'>;
|
|
4
|
+
export declare const ElementsOptionsContext: React.Context<ElementsOptionsContextProps>;
|
|
5
|
+
export declare const useOptionsCtx: () => ElementsOptionsContextProps;
|
|
6
|
+
export declare type ProviderProps = Partial<ElementsOptionsContextProps> & {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export declare function ElementsOptionsProvider({ children, nodeHasChanged }: ProviderProps): JSX.Element;
|