@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.
@@ -0,0 +1,2 @@
1
+ import { IHttpOperation } from '@stoplight/types';
2
+ export declare const operation: IHttpOperation;
@@ -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;
@@ -1,6 +1,7 @@
1
1
  import { IHttpService } from '@stoplight/types';
2
2
  import React from 'react';
3
3
  interface AdditionalInfoProps {
4
+ id: string;
4
5
  termsOfService?: string;
5
6
  contact?: IHttpService['contact'];
6
7
  license?: IHttpService['license'];
@@ -1,5 +1,5 @@
1
+ import type { IServer } from '@stoplight/types';
1
2
  import * as React from 'react';
2
- import { IServer } from '../../../utils/http-spec/IServer';
3
3
  interface ServerInfoProps {
4
4
  servers: IServer[];
5
5
  mockUrl?: string;
@@ -0,0 +1,3 @@
1
+ import { LinkHeadingProps } from '@stoplight/mosaic';
2
+ import * as React from 'react';
3
+ export declare const LinkHeading: React.NamedExoticComponent<LinkHeadingProps>;
@@ -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,4 +1,4 @@
1
- import type { IServer } from '../../../utils/http-spec/IServer';
1
+ import type { IServer } from '@stoplight/types';
2
2
  export declare type ServersDropdownProps = {
3
3
  servers: IServer[];
4
4
  };
@@ -1,4 +1,4 @@
1
- import { IHttpOperation } from '@stoplight/types';
1
+ import type { IHttpOperation } from '@stoplight/types';
2
2
  import { Request as HarRequest } from 'har-format';
3
3
  import * as React from 'react';
4
4
  export interface TryItProps {
@@ -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 '../../utils/http-spec/IServer';
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;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import type { RouterType } from '../types';
3
+ export declare const RouterTypeContext: React.Context<RouterType>;
@@ -0,0 +1,6 @@
1
+ declare type ChosenServerUrl = {
2
+ leading: string;
3
+ trailing: string | null;
4
+ };
5
+ export declare function useChosenServerUrl(chosenServerUrl: string): ChosenServerUrl;
6
+ export {};