UNPKG

2.14 kBTypeScriptView Raw
1import { BaseParameter, BaseValue } from "@atomist/automation-client/lib/internal/metadata/decoratorSupport";
2export declare type ParametersDefinition<PARAMS = any> = ParametersListing | ParametersObject<PARAMS>;
3/**
4 * Interface mixed in with BaseParameter to allow adding a default value to a parameter.
5 * When the class-style decorated approach is used, this is unnecessary as any field
6 * value will be used as a default.
7 */
8export interface HasDefaultValue {
9 defaultValue?: any;
10}
11export declare type ParametersObjectValue = BaseParameter & HasDefaultValue;
12export declare type MappedParameterOrSecretObjectValue = MappedParameterOrSecretDeclaration;
13export declare type ValueParameterObjectValue = ValueDeclaration;
14/**
15 * Object with properties defining parameters, secrets, mapped parameters and values.
16 * Useful for combination via spreads.
17 */
18export declare type ParametersObject<PARAMS, K extends keyof PARAMS = keyof PARAMS> = Record<K, ParametersObjectValue | MappedParameterOrSecretObjectValue | ValueParameterObjectValue>;
19export declare enum DeclarationType {
20 Mapped = "mapped",
21 Secret = "secret"
22}
23export interface MappedParameterOrSecretDeclaration {
24 declarationType: DeclarationType;
25 uri: string;
26 /**
27 * Only valid on mapped parameters
28 */
29 required?: boolean;
30}
31/**
32 * Define values to be injected from the SDM configuration
33 */
34export declare type ValueDeclaration = BaseValue;
35/**
36 * Define parameters used in a command
37 */
38export interface ParametersListing {
39 readonly parameters: NamedParameter[];
40 readonly mappedParameters: NamedMappedParameter[];
41 readonly secrets: NamedSecret[];
42 readonly values: NamedValue[];
43}
44export declare type NamedParameter = BaseParameter & {
45 name: string;
46} & HasDefaultValue;
47export interface NamedSecret {
48 name: string;
49 uri: string;
50}
51export interface NamedMappedParameter {
52 name: string;
53 uri: string;
54 required?: boolean;
55}
56export declare type NamedValue = NamedValueParameter;
57export interface NamedValueParameter extends BaseValue {
58 name: string;
59}
60//# sourceMappingURL=ParametersDefinition.d.ts.map
\No newline at end of file