interface ResultsSets { [objectType: string]: ResultsType; } interface ResultsType { [resultsType: number]: string; } /** * Class for storing and working with .out file contents. * This class expects a standard ArrayBuffer type, which * can be extracted by extracting a binary .out file's buffer. */ export declare class SwmmOut { /** * @type {ArrayBuffer} the contents of a .out file buffer. */ value: ArrayBuffer; /** * @type {number} the count of bytes in a time period. */ bytesPerPeriod: number; /** * @type {number} the count of subcatchments in a model. */ totalSubcatchments: number; subcatchmentOutputVars: number; totalNodes: number; nodeOutputVars: number; totalLinks: number; linkOutputVars: number; subcatchmentMap: Map; linkMap: Map; nodeMap: Map; static RECORD_SIZE: number; static MAX_SUBCATCHMENT_INPUT_VARIABLES: number; static MAX_NODE_INPUT_VARIABLES: number; static MAX_LINK_INPUT_VARIABLES: number; static SUBCATCHMENT_OUTPUT_VARIABLE_COUNT: number; static NODE_OUTPUT_VARIABLE_COUNT: number; static LINK_OUTPUT_VARIABLE_COUNT: number; static SYSTEM_OUTPUT_VARIABLE_COUNT: number; static SUBCATCH: number; static NODE: number; static LINK: number; static SYS: number; static POLLUT: number; static SUBCATCH_RAINFALL: number; static SUBCATCH_SNOWDEPTH: number; static SUBCATCH_EVAP: number; static SUBCATCH_INFILTRATION: number; static SUBCATCH_RUNOFF: number; static SUBCATCH_GWFLOW: number; static SUBCATCH_GWELEV: number; static SUBCATCH_SOILMOISTURE: number; static NODE_DEPTH: number; static NODE_HEAD: number; static NODE_VOLUME: number; static NODE_LATFLOW: number; static NODE_INFLOW: number; static NODE_OVERFLOW: number; static LINK_FLOW: number; static LINK_DEPTH: number; static LINK_VELOCITY: number; static LINK_VOLUME: number; static LINK_CAPACITY: number; /** * @type {JSON} * Description strings structure for documenting output. */ static sections: ({ name: string; contents: { name: string; description: string; }[]; } | { name: string; contents: { name: string; description: string; }[][]; })[]; /** * @type {Array} * Description strings for flow units. */ static FLOW_UNIT_VALUES: string[]; /** * @type {Array} * Description strings for unit system. */ static UNIT_SYSTEM: string[]; /** * @type {Array} * Description strings for subcatchment types. */ static SUBCATCHMENT_TYPE_CODES: string[]; /** * @type {Array} * Description strings structure for node types. */ static NODE_TYPE_CODES: string[]; /** * @type {Array} * Description strings structure for link types. */ static LINK_TYPE_CODES: string[]; /** * @type {Array} * Description strings structure for subcatchment results. */ static SUBCATCHMENT_RESULTS: string[]; /** * @type {Array} * Description strings structure for node results. */ static NODE_RESULTS: Array; /** * @type {Array} * Description strings structure for link results. */ static LINK_RESULTS: string[]; /** * @type {Array} * Description strings structure for system results. */ static SYS_RESULTS: string[]; /** * @type {Array} * Description strings structure for subcatchment results. * Should replace SUBCATCHMENT_RESULTS, NODE_RESULTS, LINK_RESULTS, SYS_RESULTS * because those systems are easier to access with string identifiers if given a base * object for SwmmOut to reference, like 'RESULTS'. */ static RESULTS: ResultsSets; /** * @type {Array} * Strings structure for pollutant concentrations. */ static POLLUTANT_CONCENTRATIONS: string[]; /** * Constructor for the SwmmOut class. */ constructor(n: ArrayBuffer); /** * Returns the object's core value. * * @returns {ArrayBuffer} Binary contents of a .out or simulated .out file. */ val(): ArrayBuffer; /** * Returns the object's EPA-SWMM version number. * * @returns {number} Integer. EPA-SWMM version number. */ version(): number; /** * Returns the object's first magic number. * * @returns {number} Integer. Magic number. */ magic1(): number; /** * Returns the flow unit code. * * @returns {number} Integer. Flow unit code. */ flowUnitCode(): number; /** * Returns the count of subcatchments. * * @returns {number} Integer. Count of subcatchments. */ subcatchmentCount(): number; /** * Returns the count of nodes. * * @returns {number} Integer. Count of nodes. */ nodeCount(): number; /** * Returns the count of links. * * @returns {number} Integer. Count of links. */ linkCount(): number; /** * Returns the count of pollutants. * * @returns {number} Integer. Count of pollutants. */ pollutantCount(): number; /** * Returns the memory position of the Object ID names, * relative to the start of the SwmmOut object. * * @returns {number} Integer. byte position of Object ID names. */ objectIDNames(): number; /** * Returns the memory position of the Object properties, * relative to the start of the SwmmOut object. * * @returns {number} Integer. byte position of Object properties. */ objectProperties(): number; /** * Returns the memory position of the computed results, * relative to the start of the SwmmOut object. * * @returns {number} Integer. byte position of computed results. */ computedResults(): number; /** * Returns the count of reporting periods. * * @returns {number} Integer. Count of reporting periods. */ reportingPeriods(): number; /** * Returns the error code. * * @returns {number} Integer. Error code of the SwmmOut object. */ errorCode(): number; /** * Returns the object's second magic number, * should be equal to the object's first magic number (magic1). * * @returns {number} Integer. Object's second magic number. */ magic2(): number; /** * Returns a unit string for a given data value ('Volume, cf', or 'Area, m^2'). * * @param {string} objectType Type of an object, e.g.: 'NODE_RESULTS' * @param {number} resultIndex Index of a result from e.g.: NODE_RESULTS[] * @returns {string} subcatchment's name. */ unitString(objectType: string, resultIndex: number): string; /** * Returns the SwmmOut subcatchment ID (name) at the index provided. * * @param {number} objectIndex The index of the subcatchment. * @returns {string} subcatchment's name. */ subcatchmentName(objectIndex: number): string; /** * Returns the SwmmOut node ID (name) at the index provided. * * @param {number} objectIndex The index of the node. * @returns {string} node's name. */ nodeName(objectIndex: number): string; subcatchmentMapFunc(): Map; linkMapFunc(): Map; nodeMapFunc(): Map; /** * Returns the SwmmOut link ID (name) at the index provided. * * @param {number} objectIndex The index of the link. * @returns {string} link's name. */ linkName(objectIndex: number): string; /** * Returns the SwmmOut pollutant ID (name) at the index provided. * * @param {number} objectIndex The index of the pollutant. * @returns {string} pollutant's name. */ pollutantName(objectIndex: number): string; /** * Returns the SwmmOut pollutant concentration units for * the pollutant at index objectIndex. * * @param {number} objectIndex The index of the link. * @returns {string} the pollutant concentration units. */ pollutantConcentrationUnits(objectIndex: number): string; /** * Returns the count of subcatchment descriptor variables. * Always 1. * * @returns {number} Integer. Count of subcatchment descriptor variables. */ subcatchmentInputCount(): number; /** * Returns the type of a subcatchment descriptor variable. * Code: * 1: Area * * @param {number} index The index of the subcatchment descriptor variable. * @returns {number} Integer. Type of a subcatchment descriptor variable. */ subcatchmentInputType(index: number): number; /** * Returns the value of a subcatchment's area. * * @param {number} index The index of the subcatchment. * @returns {number} Float. Value of a subcatchment's area. */ subcatchmentArea(index: number): number; /** * Returns the memory offset of the node input variables in the SwmmOut object. * * @returns {number} Integer. Offset location of node input variables. */ nodeInputOffset(): number; /** * Returns the count of node descriptor variables. * Always 3. * * @returns {number} Integer. Count of node descriptor variables. */ nodeInputCount(): number; /** * Returns the type of a node descriptor variable. * Code: * 0: Node Type * 2: Invert Elevation * 3: Maximum Depth * * @param {number} index The index of the node descriptor variable. * @returns {number} Integer. Type of a node descriptor variable. */ nodeInputType(index: number): number; /** * Returns the value of a nodes's type. * * @param {number} index The index of the node. * @returns {number} Integer. Value of a nodes's type. * Code: * 0: Junction * 1: Outfall * 2: Storage * 3: Divider */ nodeType(index: number): number; /** * Returns the string value of a nodes's type. * * @param {number} index The index of the node. * @returns {string} String. Value of a nodes's type. * Code: * 0: Junction * 1: Outfall * 2: Storage * 3: Divider */ nodeTypeString(index: number): string; /** * Returns the value of a nodes's invert elevation. * * @param {number} index The index of the node. * @returns {number} Float. Value of a nodes's invert elevation. */ nodeInvertElevation(index: number): number; /** * Returns the value of a nodes's maximum depth. * * @param {number} index The index of the node. * @returns {number} Float. Value of a nodes's maximum depth. */ nodeMaximumDepth(index: number): number; /** * Returns the memory offset of the link input variables in the SwmmOut object. * * @returns {number} Integer. Offset location of link input variables. */ linkInputOffset(): number; /** * Returns the count of link descriptor variables. * Always 5. * * @returns {number} Integer. Count of link descriptor variables. */ linkInputCount(): number; /** * Returns the type of a link descriptor variable. * Code: * 0: Link Type * 4: Upstream Invert Offset * 4: Downstream Invert Offset * 3: Maximum Depth * 5: Length * * @param {number} index The index of the link descriptor variable. * @returns {number} Integer. Type of a link descriptor variable. */ linkInputType(index: number): number; /** * Returns the value of a link's type. * * @param {number} index The index of the link. * @returns {number} Integer. Value of a link's type. * Code: * 0: Junction * 1: Outfall * 2: Storage * 3: Divider */ linkType(index: number): number; /** * Returns the string value of a link's type. * * @param {number} index The index of the link. * @returns {string} String. Value of a link's type. * Code: * 0: Junction * 1: Outfall * 2: Storage * 3: Divider */ linkTypeString(index: number): string; /** * Returns the value of a link's Upstream invert offset. * * @param {number} index The index of the link. * @returns {number} Integer. Value of a link's Upstream invert offset. */ linkUpstreamInvertOffset(index: number): number; /** * Returns the value of a link's Downstream invert offset. * * @param {number} index The index of the link. * @returns {number} Integer. Value of a link's Downstream invert offset. */ linkDownstreamInvertOffset(index: number): number; /** * Returns the value of a link's Maximum depth. * * @param {number} index The index of the link. * @returns {number} Integer. Value of a link's Maximum depth. */ linkMaximumDepth(index: number): number; /** * Returns the value of a link's Maximum depth. * * @param {number} index The index of the link. * @returns {number} Integer. Value of a link's Maximum depth. */ linkLength(index: number): number; /** * Returns the memory offset of the subcatchment output variables in the SwmmOut object. * * @returns {number} Integer. Offset location of subcatchment output variables. */ outputVariablesOffset(): number; /** * Returns the count of subcatchment output variables. * Always 8 + pollutant count. * * @returns {number} Integer. Count of subcatchment output variables. */ subcatchmentOutputCount(): number; /** * Returns the index of subcatchment output variables. * This part of the .out file appears redundant. * * @param {number} index The index of the subcatchment output variable index. * @returns {number} Integer. Index of the subcatchment output variable index. */ subcatchmentOutputVariable(index: number): number; /** * Returns the count of node output variables. * Always 6 + pollutant count. * * @returns {number} Integer. Count of node output variables. */ nodeOutputCount(): number; /** * Returns the index of node output variables. * This part of the .out file appears redundant. * * @param {number} index The index of the node output variable index. * @returns {number} Integer. Index of the node output variable index. */ nodeOutputVariable(index: number): number; /** * Returns the count of link output variables. * Always 5 + pollutant count. * * @returns {number} Integer. Count of link output variables. */ linkOutputCount(): number; /** * Returns the index of link output variables. * This part of the .out file appears to be redundant. * * @param {number} index The index of the link output variable index. * @returns {number} Integer. Index of the link output variable index. */ linkOutputVariable(index: number): number; /** * Returns the count of system output variables. * Always 15. * * @returns {number} Integer. Count of system output variables. */ systemOutputCount(): number; /** * Returns the index of system output variables. * This part of the .out file appears to be redundant. * * @param {number} index The index of the system output variable index. * @returns {number} Integer. Index of the system output variable index. */ systemOutputVariable(index: number): number; /** * Returns the start date & time of the simulation in count of days since 12/30/1899. Use this to interact with EPA-SWMM files and functions. * * @returns {number} Float64. Start date & time. */ startTime_swmmFormat(): number; /** * Returns the start date & time of the simulation in count of milliseconds since 12/31/1970. Use this to interact with Unix timestamp functions. * * @returns {number} Float64. Start date & time. */ startTime_Unix(): number; /** * Returns the time step duration of the simulation, in seconds. * * @returns {number} Integer. Time step duration, seconds. */ timeStep(): number; /** * Returns a Javascript Date version of a Float64 as passed from startTime(). Use this to make date objects for interacting with non-EPA-SWMM files. * * @param {number} theDouble A 64-bit floating point number representing the number of days since 12/30/1899 00:00. * @returns {Date} A Javascript date object. */ static doubleToDate_swmmFormat(theDouble: number): Date; /** * Returns a human-readable string version of a Float64 date as passed from startTime(). Use this to make strings for interacting with non-EPA-SWMM files. * * @param {number} theDouble A 64-bit floating point number representing the number of days since 12/30/1899 00:00 * @returns {string} A Javascript string object. */ static doubleDateToString_swmmFormat(theDouble: number): string; /** * Returns a human-readable string version of an integer time step. * Use this to make strings that can be written to EPA-SWMM files. * * @param {number} timeStep An integer representing the time step of * the model. Does not need to be within the bounds of the model. * @returns {string} A Javascript string object. */ swmmStepToDate(timeStep: number): string; /** * Returns the count of days since 12/30/1899 a given time step. * * @param {number} timeStep The index of the time step (1-based, also 1 time-step ahead of StartDate). * @returns {number} Float64. Date & time in count of days since 12/30/1899. */ dateStep_swmmFormat(timeStep: number): number; /** * Returns the value stored as a result from a given object. * * @param {number} iType The type of the object (SUBCATCHMENT, NODE, LINK, SYS). * @param {number} iIndex The index of the object. * @param {number} vIndex The index of the variable. * @param {number} period The index of the time period. (1-based) * @returns {number} Float32. value stored as a result. */ get_result(iType: number, iIndex: number, vIndex: number, period: number): number; /** * Returns the value stored as a result from a subcatchment. * * @param {number} iIndex The index of the subcatchment. * @param {number} vIndex The index of the variable. * @param {number} period The index of the time period. (1-based) * @returns {number} Float32. value stored as a result. */ subcatchmentOutput(iIndex: number, vIndex: number, period: number): number; /** * Returns the value stored as a result from a node. * * @param {number} iIndex The index of the node. * @param {number} vIndex The index of the variable. * @param {number} period The index of the time period. (1-based) * @returns {number} Float32. value stored as a result. */ nodeOutput(iIndex: number, vIndex: number, period: number): number; /** * Returns the value stored as a result from a link. * * @param {number} iIndex The index of the node. * @param {number} vIndex The index of the variable. * @param {number} period The index of the time period. (1-based) * @returns {number} Float32. value stored as a result. */ linkOutput(iIndex: number, vIndex: number, period: number): number; /** * Returns the value stored as a result from a system variable. * * @param {number} vIndex The index of the system variable. * @param {number} period The index of the time period. (1-based) * @returns {number} Float32. value stored as a result. */ sysOutput(vIndex: number, period: number): number; /** * Returns the total count of bytes per time period. * * @returns {number} Integer. The total count of bytes per time period. */ bytesPerPeriod_func(): number; /** * Returns the memory location of a result value in SwmmOut. * * @param {number} iType The type of the object. * @param {number} iIndex The index of the object. * @param {number} vIndex The index of the variable. * @param {number} period The index of the time period. * @returns {number} Float32. value stored as a result. */ getswmmresultoffset(iType: number, iIndex: number, vIndex: number, period: number): number; /** * Reads a 32-bit signed integer from a position in SwmmOut. * * @param {number} offset The position of the readable integer, in number of bytes from the start of the SwmmOut object. * @returns {number} An integer read from SwmmOut. */ readInt(offset: number): number; /** * Reads a 32-bit signed float from a position in SwmmOut. * * @param {number} offset The position of the readable float, in number of bytes from the start of the SwmmOut object. * @returns {number} A float read from SwmmOut. */ readFloat(offset: number): number; /** * Reads a 64-bit signed float from a position in SwmmOut. * * @param {number} offset The position of the readable float, in number of bytes from the start of the SwmmOut object. * @returns {number} A 64-bit float (double)read from SwmmOut. */ readDouble(offset: number): number; /** * Reads a string from a position in SwmmOut. * * @param {number} offset1 The position of the start of the readable string, in number of bytes from the start of the SwmmOut object. * @param {number} offset2 The position of the end of the readable string, in number of bytes from the start of the SwmmOut object. * @returns {number} A string read from the SwmmOut object. */ intArrayToString(offset1: number, offset2: number): string; /** * Change the Computed Results section of a swmm .out file to an object that describes a set of objects * and a specific output result type. * @param {Array} objNames array of object IDs (names) to provide results for. * @param {outputType} int the flag type of the objects to be parsed. * @param {outputPos} int the flag type of the output to be parsed. * @returns {JSON} object representation of the Computed Results section of a swmm.out file. */ processOut(objNames: Array, objectType: number, outputPos: number): {}; /** * Change the Computed Results section of a swmm .out file to an object that describes a set of objects * and a specific output result type. * @param {Array} objNames array of object IDs (names) to provide results for. * @param {outputType} int the flag type of the objects to be parsed. * @param {outputPos} int the flag type of the output to be parsed. * @returns {JSON} object representation of the Computed Results section of a swmm.out file. */ CreateGeoJSONTimestep(objNames: Array, objectType: number, resultType: number, geoJSONData: any, timeStep: number): any; /** * Change the Node Computed Results section of a swmm .out file to an object. * @param {string} objName object ID (name) to provide results for. * @param {outputPos} int the flag type of the output to be parsed. * @param {timeStep} int the positional timestep of the results. 0 for all time steps. * @returns {JSON} object representation of the Computed Results section of a swmm.out file. */ nodeResults(objName: string, outputPos: number, timeStep: number): any; /** * Change the Link Computed Results section of a swmm .out file to an object. * @param {string} objName object ID (name) to provide results for. * @param {outputPos} int the flag type of the output to be parsed. * @param {timeStep} int the positional timestep of the results. 0 for all time steps. * @returns {JSON} object representation of the Computed Results section of a swmm.out file. */ linkResults(objName: string, outputPos: number, timeStep: number): any; /** * Change the Subcatchment Computed Results section of a swmm .out file to an object. * @param {string} objName object ID (name) to provide results for. * @param {outputPos} int the flag type of the output to be parsed. * @param {timeStep} int the positional timestep of the results. 0 for all time steps. * @returns {JSON} object representation of the Computed Results section of a swmm.out file. */ subcatchmentResults(objName: string, outputPos: number, timeStep: number): any; /** * Create time-based subsection * @param {iCount} number count of object names * @param {nameFunc} function function to get an object name * @param {func} function function that retrieves the object value * @param {timePeriods} number count of time periods * @param {timeFunc} function function that translates time periods * @param {timeStep} int the positional timestep of the results. 0 for all time steps. * @returns {JSON} an object representing a time-based subsection. */ timeOuput(objName: string, objIndex: number, iCount: number, nameFunc: Function, func: Function, timePeriods: number, timeFunc: Function, outputPos: number, timeStep: number): any; } export {};