import { VariableExpressionType, VariableSkeleton } from '../../api/cloud/VariablesApi'; import { State } from '../../shared/State'; import { ExportMetaData } from '../OpsTypes'; export type Variable = { /** * Read variable by id/name * @param {string} variableId variable id/name * @param {boolean} noDecode Do not decode value (default: false) * @returns {Promise} a promise that resolves to a variable object */ readVariable(variableId: string, noDecode?: boolean): Promise; /** * Read all variables * @param {boolean} noDecode Do not decode values (default: false) * @returns {Promise} a promise that resolves to an array of variable objects */ readVariables(noDecode?: boolean): Promise; /** * Export variable. The response can be saved to file as is. * @param {string} variableId variable id/name * @param {boolean} noDecode Do not decode value (default: false) * @returns {Promise} Promise resolving to a VariablesExportInterface object. */ exportVariable(variableId: string, noDecode?: boolean): Promise; /** * Export all variables * @param {boolean} noDecode Do not decode values (default: false) * @returns {Promise} Promise resolving to an VariablesExportInterface object. */ exportVariables(noDecode?: boolean): Promise; /** * Import variable by id * @param {string} variableId variable id/name * @param {VariablesExportInterface} importData import data * @returns {Promise} imported variable object */ importVariable(variableId: string, importData: VariablesExportInterface): Promise; /** * Import variables * @param {VariablesExportInterface} importData import data * @returns {Promise} array of imported variable objects */ importVariables(importData: VariablesExportInterface): Promise; /** * Create variable * @param {string} variableId variable id/name * @param {string} value variable value * @param {string} description variable description * @param {VariableExpressionType} expressionType type of the value * @param {boolean} noEncode do not encode if passing a pre-encoded (base64) value * @returns {Promise} a promise that resolves to a variable object */ createVariable(variableId: string, value: string, description: string, expressionType?: VariableExpressionType, noEncode?: boolean): Promise; /** * Update or create variable * @param {string} variableId variable id/name * @param {string} value variable value * @param {string} description variable description * @param {VariableExpressionType} expressionType type of the value * @param {boolean} noEncode do not encode if passing a pre-encoded (base64) value * @returns {Promise} a promise that resolves to a variable object */ updateVariable(variableId: string, value: string, description: string, expressionType?: VariableExpressionType, noEncode?: boolean): Promise; /** * Update variable description * @param {string} variableId variable id/name * @param {string} description variable description * @returns {Promise} a promise that resolves to a status object */ updateVariableDescription(variableId: string, description: string): Promise; /** * Delete variable by id/name * @param {string} variableId variable id/name * @returns {Promise} a promise that resolves to a variable object */ deleteVariable(variableId: string): Promise; /** * Get variable by id/name * @param {string} variableId variable id/name * @returns {Promise} a promise that resolves to a variable object * @deprecated since v2.0.0 use {@link Variable.readVariable | readVariable} instead * ```javascript * readVariable(variableId: string): Promise * ``` * @group Deprecated */ getVariable(variableId: string): Promise; /** * Get all variables * @returns {Promise} a promise that resolves to an array of variable objects * @deprecated since v2.0.0 use {@link Variable.readVariables | readVariables} instead * ```javascript * readVariables(): Promise * ``` * @group Deprecated */ getVariables(): Promise; /** * Create variable * @param {string} variableId variable id/name * @param {string} valueBase64 base64-encoded variable value * @param {string} description variable description * @param {VariableExpressionType} expressionType type of the value * @returns {Promise} a promise that resolves to a variable object * @deprecated since v2.0.0 use {@link Variable.createVariable | createVariable} instead * ```javascript * createVariable(variableId: string, value: string, description: string, expressionType?: VariableExpressionType): Promise * ``` * @group Deprecated */ putVariable(variableId: string, valueBase64: string, description: string, expressionType?: VariableExpressionType): Promise; /** * Set variable description * @param {string} variableId variable id/name * @param {string} description variable description * @returns {Promise} a promise that resolves to an empty string * @deprecated since v2.0.0 use {@link Variable.updateVariableDescription | updateVariableDescription} instead * ```javascript * updateVariableDescription(variableId: string, description: string): Promise * ``` * @group Deprecated */ setVariableDescription(variableId: string, description: string): Promise; }; declare const _default: (state: State) => Variable; export default _default; export interface VariablesExportInterface { meta?: ExportMetaData; variable: Record; } export declare function createVariablesExportTemplate({ state, }: { state: State; }): VariablesExportInterface; export declare function readVariable({ variableId, noDecode, state, }: { variableId: string; noDecode?: boolean; state: State; }): Promise; export declare function readVariables({ noDecode, state, }: { noDecode?: boolean; state: State; }): Promise; export declare function exportVariable({ variableId, noDecode, state, }: { variableId: string; noDecode: boolean; state: State; }): Promise; export declare function exportVariables({ noDecode, state, }: { noDecode: boolean; state: State; }): Promise; /** * Import variable * @param {string} variableId variable id/name * @param {VariablesExportInterface} importData import data * @returns {Promise} array of imported variable objects */ export declare function importVariable({ variableId, importData, state, }: { variableId?: string; importData: VariablesExportInterface; state: State; }): Promise; /** * Import variables * @param {VariablesExportInterface} importData import data * @returns {Promise} array of imported variable objects */ export declare function importVariables({ importData, state, }: { importData: VariablesExportInterface; state: State; }): Promise; export declare function createVariable({ variableId, value, description, expressionType, noEncode, state, }: { variableId: string; value: string; description?: string; expressionType?: VariableExpressionType; noEncode?: boolean; state: State; }): Promise; export declare function updateVariable({ variableId, value, description, expressionType, noEncode, state, }: { variableId: string; value: string; description?: string; expressionType?: VariableExpressionType; noEncode?: boolean; state: State; }): Promise; export declare function updateVariableDescription({ variableId, description, state, }: { variableId: string; description: string; state: State; }): Promise; export declare function deleteVariable({ variableId, state, }: { variableId: string; state: State; }): Promise; //# sourceMappingURL=VariablesOps.d.ts.map