spws
Version:
SharePoint Web Services Wrapper
24 lines (23 loc) • 1.03 kB
TypeScript
import { List, ListAttributes, SpwsResponse } from "../../../types";
type Params = {
res: SpwsResponse;
attributes?: ListAttributes[];
};
/**
* Parses a list from the provided parameters.
*
* @param params - The parameters for parsing the list.
* @param params.res - The response object containing the XML data.
* @param params.attributes - An optional array of attribute names to include in the parsed data.
*
* @returns An object containing the parsed list data.
*
* @throws {SpwsError} If the list cannot be found in the response XML.
*
* @remarks
* - If the `attributes` parameter is empty or includes `StaticName`, the function attempts to get the static name.
* - If the `attributes` parameter is empty or includes `Fields`, the function adds fields to the data.
* - The function handles various child elements such as Choices, Validation, DefaultFormula, DefaultFormulaValue, Default, and Formula.
*/
declare const parseList: (params: Params) => List;
export default parseList;