vitepress-openapi 0.1.14 → 0.1.15

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.
@@ -1,4 +1,5 @@
1
1
  import type { OpenAPIV3 } from '@scalar/openapi-types';
2
+ import type { PlaygroundExampleBehavior } from '../../composables/useTheme';
2
3
  import type { OAExampleObject } from '../../types';
3
4
  interface Props {
4
5
  operationId: string;
@@ -9,6 +10,8 @@ interface Props {
9
10
  examples?: {
10
11
  [key: string]: OAExampleObject;
11
12
  };
13
+ exampleBehavior?: PlaygroundExampleBehavior;
14
+ xExampleBehavior?: PlaygroundExampleBehavior;
12
15
  }
13
16
  declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
17
  submit: () => any;
@@ -1,3 +1,4 @@
1
+ import type { PlaygroundExampleBehavior } from '../../composables/useTheme';
1
2
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
3
  parameter: {
3
4
  type: ObjectConstructor;
@@ -14,6 +15,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
14
15
  type: StringConstructor;
15
16
  required: true;
16
17
  };
18
+ exampleBehavior: {
19
+ type: () => PlaygroundExampleBehavior;
20
+ default: string;
21
+ };
22
+ xExampleBehavior: {
23
+ type: () => PlaygroundExampleBehavior;
24
+ default: string;
25
+ };
17
26
  enabled: {
18
27
  type: BooleanConstructor;
19
28
  default: boolean;
@@ -42,6 +51,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
42
51
  type: StringConstructor;
43
52
  required: true;
44
53
  };
54
+ exampleBehavior: {
55
+ type: () => PlaygroundExampleBehavior;
56
+ default: string;
57
+ };
58
+ xExampleBehavior: {
59
+ type: () => PlaygroundExampleBehavior;
60
+ default: string;
61
+ };
45
62
  enabled: {
46
63
  type: BooleanConstructor;
47
64
  default: boolean;
@@ -55,6 +72,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
55
72
  onSubmit?: ((...args: any[]) => any) | undefined;
56
73
  "onUpdate:enabled"?: ((...args: any[]) => any) | undefined;
57
74
  }>, {
75
+ exampleBehavior: PlaygroundExampleBehavior;
76
+ xExampleBehavior: PlaygroundExampleBehavior;
58
77
  enabled: boolean;
59
78
  hideLabel: boolean;
60
79
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,4 +1,5 @@
1
1
  import type { OpenAPIV3 } from '@scalar/openapi-types';
2
+ import type { PlaygroundExampleBehavior } from '../../composables/useTheme';
2
3
  import type { SecurityUiItem } from '../../types';
3
4
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
5
  operationId: {
@@ -46,6 +47,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
46
47
  type: ObjectConstructor;
47
48
  required: false;
48
49
  };
50
+ exampleBehavior: {
51
+ type: () => PlaygroundExampleBehavior;
52
+ default: string;
53
+ };
54
+ xExampleBehavior: {
55
+ type: () => PlaygroundExampleBehavior;
56
+ default: string;
57
+ };
49
58
  requestBody: {
50
59
  type: ObjectConstructor;
51
60
  required: false;
@@ -98,6 +107,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
98
107
  type: ObjectConstructor;
99
108
  required: false;
100
109
  };
110
+ exampleBehavior: {
111
+ type: () => PlaygroundExampleBehavior;
112
+ default: string;
113
+ };
114
+ xExampleBehavior: {
115
+ type: () => PlaygroundExampleBehavior;
116
+ default: string;
117
+ };
101
118
  requestBody: {
102
119
  type: ObjectConstructor;
103
120
  required: false;
@@ -107,6 +124,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
107
124
  }>, {
108
125
  parameters: OpenAPIV3.ParameterObject[];
109
126
  servers: unknown[];
127
+ exampleBehavior: PlaygroundExampleBehavior;
128
+ xExampleBehavior: PlaygroundExampleBehavior;
110
129
  securityUi: Record<string, any>;
111
130
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
112
131
  export default _default;
@@ -10,8 +10,8 @@ declare const _default: import("vue").DefineComponent<SelectWithCustomOptionProp
10
10
  "onUpdate:customValue"?: ((value: string) => any) | undefined;
11
11
  "onUpdate:isCustom"?: ((value: boolean) => any) | undefined;
12
12
  }>, {
13
- modelValue: string;
14
13
  placeholder: string;
14
+ modelValue: string;
15
15
  isCustom: boolean;
16
16
  customValue: string;
17
17
  defaultCustomValue: string;
@@ -44,6 +44,7 @@ export interface ResponseConfig {
44
44
  defaultView?: Ref<BodyViewType>;
45
45
  };
46
46
  }
47
+ export type PlaygroundExampleBehavior = 'placeholder' | 'value' | 'ignore';
47
48
  export interface PlaygroundConfig {
48
49
  jsonEditor?: {
49
50
  mode?: Ref<PlaygroundJsonEditorMode>;
@@ -51,6 +52,10 @@ export interface PlaygroundConfig {
51
52
  navigationBar?: Ref<boolean>;
52
53
  statusBar?: Ref<boolean>;
53
54
  };
55
+ examples?: {
56
+ behavior?: Ref<PlaygroundExampleBehavior>;
57
+ playgroundExampleBehavior?: Ref<PlaygroundExampleBehavior>;
58
+ };
54
59
  }
55
60
  export interface SecurityConfig {
56
61
  defaultScheme?: Ref<string | null>;
@@ -196,6 +201,10 @@ export declare function useTheme(initialConfig?: PartialUseThemeConfig): {
196
201
  navigationBar?: boolean | undefined;
197
202
  statusBar?: boolean | undefined;
198
203
  } | undefined;
204
+ examples?: {
205
+ behavior?: PlaygroundExampleBehavior | undefined;
206
+ playgroundExampleBehavior?: PlaygroundExampleBehavior | undefined;
207
+ } | undefined;
199
208
  } | undefined;
200
209
  security?: {
201
210
  defaultScheme?: string | null | undefined;
@@ -307,6 +316,10 @@ export declare function useTheme(initialConfig?: PartialUseThemeConfig): {
307
316
  setPlaygroundJsonEditorNavigationBar: (value: boolean) => void;
308
317
  getPlaygroundJsonEditorStatusBar: () => boolean | undefined;
309
318
  setPlaygroundJsonEditorStatusBar: (value: boolean) => void;
319
+ getPlaygroundExamplesBehavior: () => PlaygroundExampleBehavior;
320
+ setPlaygroundExamplesBehavior: (value: PlaygroundExampleBehavior) => void;
321
+ getPlaygroundXExampleBehavior: () => PlaygroundExampleBehavior;
322
+ setPlaygroundXExampleBehavior: (value: PlaygroundExampleBehavior) => void;
310
323
  getSecurityDefaultScheme: () => string | null | undefined;
311
324
  setSecurityDefaultScheme: (value: string | null) => void;
312
325
  getOperationBadges: () => OperationBadges[];
@@ -1 +1,3 @@
1
+ export declare function getPlaygroundSpecificExample(property: any): any;
2
+ export declare function getStandardExample(property: any): any;
1
3
  export declare function getPropertyExample(property: any): any;
@@ -0,0 +1,5 @@
1
+ import type { PlaygroundExampleBehavior } from '../../composables/useTheme';
2
+ export declare function useExampleForPlaceholder(behavior: PlaygroundExampleBehavior): boolean;
3
+ export declare function useExampleForValue(behavior: PlaygroundExampleBehavior): boolean;
4
+ export declare function resolveExampleForValue(property: any, behavior: PlaygroundExampleBehavior, xExampleBehavior?: PlaygroundExampleBehavior): any;
5
+ export declare function resolveExampleForPlaceholder(property: any, behavior: PlaygroundExampleBehavior, xExampleBehavior?: PlaygroundExampleBehavior): any;