UNPKG

1.91 kBTypeScriptView Raw
1import { QueryCollectionFormat } from "./queryCollectionFormat";
2import { Mapper } from "./serializer";
3export declare type ParameterPath = string | string[] | {
4 [propertyName: string]: ParameterPath;
5};
6/**
7 * A common interface that all Operation parameter's extend.
8 */
9export interface OperationParameter {
10 /**
11 * The path to this parameter's value in OperationArguments or the object that contains paths for
12 * each property's value in OperationArguments.
13 */
14 parameterPath: ParameterPath;
15 /**
16 * The mapper that defines how to validate and serialize this parameter's value.
17 */
18 mapper: Mapper;
19}
20/**
21 * A parameter for an operation that will be substituted into the operation's request URL.
22 */
23export interface OperationURLParameter extends OperationParameter {
24 /**
25 * Whether or not to skip encoding the URL parameter's value before adding it to the URL.
26 */
27 skipEncoding?: boolean;
28}
29/**
30 * A parameter for an operation that will be added as a query parameter to the operation's HTTP
31 * request.
32 */
33export interface OperationQueryParameter extends OperationParameter {
34 /**
35 * Whether or not to skip encoding the query parameter's value before adding it to the URL.
36 */
37 skipEncoding?: boolean;
38 /**
39 * If this query parameter's value is a collection, what type of format should the value be
40 * converted to.
41 */
42 collectionFormat?: QueryCollectionFormat;
43}
44/**
45 * Get the path to this parameter's value as a dotted string (a.b.c).
46 * @param parameter The parameter to get the path string for.
47 * @returns The path to this parameter's value as a dotted string.
48 */
49export declare function getPathStringFromParameter(parameter: OperationParameter): string;
50export declare function getPathStringFromParameterPath(parameterPath: ParameterPath, mapper: Mapper): string;
51//# sourceMappingURL=operationParameter.d.ts.map
\No newline at end of file