/** * mpxj-ts: reads Microsoft Project plans in the browser. * * .mpp and .mpt from Project 2010 to 2024 (a TypeScript port of MPXJ's MPP14 * reader, https://github.com/joniles/mpxj), Project's XML (MSPDI), and MPX. * * Copyright (c) 2000-2026 Jon Iles and the MPXJ contributors (the parts * ported from MPXJ); port and the rest (c) 2026 johnmcm.com. * Licensed under the GNU Lesser General Public License, version 2.1 or later: * see LICENSE. Source: /source/mpxj/ on johnmcm.com. */ import { readMpp, ProjectFileError } from './mpp14'; import { isMpx, readMpx } from './mpx'; import { readMspdi } from './mspdi'; import { Project } from './model'; export * from './model'; export { ProjectFileError }; export function readProject(bytes: Uint8Array): Project { if (bytes[0] === 0xd0 && bytes[1] === 0xcf && bytes[2] === 0x11 && bytes[3] === 0xe0) return readMpp(bytes); const text = decodeText(bytes); if (isMpx(text)) return readMpx(text); if (/^\s*