import type { XCodeSample } from '@scalar/workspace-store/schemas/extensions/operation'; import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'; /** Picker group label for samples generated by an SDK provider (Scalar, Stainless, …). */ declare const SDK_GROUP_LABEL = "SDK"; /** Picker group label for generic or docs-platform samples (the standard `x-codeSamples` family, ReadMe, …). */ export declare const CODE_EXAMPLES_GROUP_LABEL = "Code Examples"; type CustomCodeSampleGroupLabel = typeof SDK_GROUP_LABEL | typeof CODE_EXAMPLES_GROUP_LABEL; type CustomCodeSamples = { /** * Group label for the code sample picker. * * Samples that come from an SDK provider extension (`x-scalar-examples`, * `x-stainless-snippets`, `x-stainless-examples`) surface under "SDK". Generic * or docs-platform samples (`x-readme`, the `x-codeSamples` family) surface * under "Code Examples". */ label: CustomCodeSampleGroupLabel; /** The custom code samples, in picker order. */ samples: XCodeSample[]; }; /** * Grabs any custom code samples from the operation. * * Several tools write code samples into OpenAPI under different extensions. When * more than one is present we use the highest-priority source only, rather than * showing duplicates from every tool. Priority, highest first: * * 1. `x-scalar-examples` (SDK) * 2. `x-stainless-snippets` (SDK, overrides `x-stainless-examples`) * 3. `x-stainless-examples` (SDK) * 4. `x-readme.code-samples` (Code Examples) * 5. `x-codeSamples` / `x-code-samples` / `x-custom-examples` (Code Examples) * * The winning source also determines the picker group label: SDK-provider * extensions surface under "SDK", everything else under "Code Examples". * * Note that Speakeasy does not have its own extension — it writes into the * standard `x-codeSamples`, so its snippets surface under "Code Examples". * * @param operation - The operation to get the custom code samples from * @returns The picker group label and the custom code samples which exist in the operation */ export declare const getCustomCodeSamples: (operation: OperationObject) => CustomCodeSamples; export {}; //# sourceMappingURL=get-custom-code-samples.d.ts.map