UNPKG

@openmeteo/sdk

Version:
122 lines (121 loc) 5.09 kB
"use strict"; // automatically generated by the FlatBuffers compiler, do not modify var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.VariableWithValues = void 0; /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ const flatbuffers = __importStar(require("flatbuffers")); const aggregation_js_1 = require("./aggregation.js"); const unit_js_1 = require("./unit.js"); const variable_js_1 = require("./variable.js"); class VariableWithValues { constructor() { this.bb = null; this.bb_pos = 0; } __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } static getRootAsVariableWithValues(bb, obj) { return (obj || new VariableWithValues()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } static getSizePrefixedRootAsVariableWithValues(bb, obj) { bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new VariableWithValues()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } variable() { const offset = this.bb.__offset(this.bb_pos, 4); return offset ? this.bb.readUint8(this.bb_pos + offset) : variable_js_1.Variable.undefined; } unit() { const offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.readUint8(this.bb_pos + offset) : unit_js_1.Unit.undefined; } value() { const offset = this.bb.__offset(this.bb_pos, 8); return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0; } values(index) { const offset = this.bb.__offset(this.bb_pos, 10); return offset ? this.bb.readFloat32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0; } valuesLength() { const offset = this.bb.__offset(this.bb_pos, 10); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; } valuesArray() { const offset = this.bb.__offset(this.bb_pos, 10); return offset ? new Float32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; } valuesInt64(index) { const offset = this.bb.__offset(this.bb_pos, 12); return offset ? this.bb.readInt64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0); } valuesInt64Length() { const offset = this.bb.__offset(this.bb_pos, 12); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; } altitude() { const offset = this.bb.__offset(this.bb_pos, 14); return offset ? this.bb.readInt16(this.bb_pos + offset) : 0; } aggregation() { const offset = this.bb.__offset(this.bb_pos, 16); return offset ? this.bb.readUint8(this.bb_pos + offset) : aggregation_js_1.Aggregation.none; } pressureLevel() { const offset = this.bb.__offset(this.bb_pos, 18); return offset ? this.bb.readInt16(this.bb_pos + offset) : 0; } depth() { const offset = this.bb.__offset(this.bb_pos, 20); return offset ? this.bb.readInt16(this.bb_pos + offset) : 0; } depthTo() { const offset = this.bb.__offset(this.bb_pos, 22); return offset ? this.bb.readInt16(this.bb_pos + offset) : 0; } ensembleMember() { const offset = this.bb.__offset(this.bb_pos, 24); return offset ? this.bb.readInt16(this.bb_pos + offset) : 0; } previousDay() { const offset = this.bb.__offset(this.bb_pos, 26); return offset ? this.bb.readInt16(this.bb_pos + offset) : 0; } } exports.VariableWithValues = VariableWithValues;