UNPKG

specpress

Version:

Export PDF and/or DOCX files from a subset of Markdown, ASN.1 and JSON files

138 lines (137 loc) 6.1 kB
import { BWC_ID } from "./BWC_ID.js"; import { BandNumber, RAT } from "./BandNumber.js"; /** Thrown when a BC-ID string cannot be parsed or is structurally invalid. */ export declare class InvalidBcIdException extends Error { constructor(message: string); } /** * The type of band combination. * - SC — single carrier (one band, one carrier) * - CA — carrier aggregation (NR-only, multiple carriers or bands) * - NRDC — NR dual connectivity * - ENDC — EN-DC (E-UTRA anchor + NR secondary) * - NEDC — NE-DC (NR anchor + E-UTRA secondary) */ export declare enum BcType { SC = "SC", CA = "CA", NRDC = "NR-DC", ENDC = "EN-DC", NEDC = "NE-DC" } /** * Splits a single band entry string (e.g. `"n78C"`, `"3A"`, `"(n)40CA"`) into * its RAT/BcType, BandNumber, and BWC-ID components. * * @param aString — a single band entry from a BC-ID (e.g. `"n1A"`, `"7C"`, `"(n)3AA"`). * @returns a tuple of [RAT or BcType, BandNumber, BWC_ID or raw string]. * @throws InvalidBcIdException if the string cannot be parsed. */ export declare function SplitBandEntry(aString: string): [RAT | BcType, BandNumber, BWC_ID | string]; /** * Splits a BC-ID string into its RAT-level components. * * For inter-RAT DC identifiers containing `(n)`, the string is split around * the `(n)` marker. For NR-only or EUTRA-only identifiers, the string is * split on `_` (which separates the NR and EUTRA parts in DC identifiers). * * @param aString — the BC-ID value string (without prefix). * @returns an array of RAT-level component strings. */ export declare function GetRatComponents(aString: string | null): string[]; /** * Represents a 3GPP Band Combination Identifier (BC-ID). * * A BC-ID encodes one or more bands with their BWC-IDs, and optionally a * prefix (`CA_` or `DC_`) indicating carrier aggregation or dual connectivity. * * Examples: * - `"CA_n1A-n78C"` — inter-band CA with bands n1 (single carrier) and n78 (contiguous pair) * - `"DC_1A-8A_n77(2A)"` — EN-DC with EUTRA bands 1+8 and NR band n77 (two non-contiguous carriers) * - `"n78A"` — single-carrier NR configuration * * The class parses the identifier, determines the BcType (SC, CA, NR-DC, EN-DC, NE-DC), * extracts per-band BWC-IDs, and provides comparison operators for sorting. */ export declare class BC_ID { private readonly str; /** The prefix: `"CA_"`, `"DC_"`, or `""`. */ prefix: string; /** If this BC-ID uses SUL naming, the original SUL name; otherwise null. */ sulName: string | null; /** Total number of band entries in this BC-ID. */ nrofBandEntries: number; /** Map from band number string (e.g. `"n78"`) to its BWC-ID or raw DC string. */ bwcIdsPerBand: Map<string, BWC_ID | string>; /** True if any band has a BWC-ID other than `"A"` (i.e. intra-band CA). */ intraBand: boolean; /** The determined combination type (SC, CA, NR-DC, EN-DC, NE-DC). */ bctype: RAT | BcType | null; private bandNumberObjects; /** * Parses a BC-ID string or copies an existing BC_ID. * * @param aValue — the BC-ID string (e.g. `"CA_n1A-n78C"`, `"DC_1A_n77A"`) * or an existing BC_ID to copy. * @throws InvalidBcIdException if the string cannot be parsed. */ constructor(aValue: string | BC_ID | null); /** Returns the BC-ID value string (without prefix). */ valueOf(): string; /** Returns the full BC-ID string including prefix (e.g. `"CA_n1A-n78C"`). */ toString(): string; /** Returns a human-readable description including intra/inter-band and BcType. */ describe(): string; /** Returns the BandNumber objects in this BC-ID, sorted by numeric value. */ getBandNumbers(): BandNumber[]; /** Returns the number of distinct bands in this BC-ID. */ nrofBands(): number; /** * Returns the total number of component carriers across all bands. * * Sums the actual carrier count from each band's BWC-ID using getNrofCarriers(). * E.g., "CA_n1A-n3A" returns 2 (1+1), "CA_n3B" returns 2 (contiguous pair), * "CA_n25(2A)-n41(A-C)" returns 5 (2*1 + 1 + 2). * * For DC configurations with EUTRA bands, the EUTRA carriers are not parsed * (BWC-ID is stored as a raw string), so the count uses a heuristic. */ getNrofCarriers(): number; /** Returns true if all carriers belong to a single band. */ isIntraBand(): boolean; /** Returns the map from band number string to BWC-ID (or raw DC string). */ getBwcIDsPerBand(): Map<string, BWC_ID | string>; /** Returns true if this is a single-carrier configuration (one band, BWC = 'A'). */ isSingleCarrier(): boolean; /** Returns true if the prefix is `"DC_"`. */ isDualConnectivity(): boolean; /** Returns true if all bands are in FR1. */ isFr1(): boolean; /** Returns true if all bands are in FR2. */ isFr2(): boolean; /** Returns true if at least one band is in FR2. */ hasFr2(): boolean; /** Returns true if this is a pure NR combination (no EUTRA bands, no EN-DC/NE-DC). */ isNR(): boolean; /** Determines the specification this BC-ID belongs to. */ getSpecification(): string; /** Returns the prefix string (`"CA_"`, `"DC_"`, or `""`). */ getPrefix(): string; /** Returns true if this BC-ID uses SUL naming. */ isSUL(): boolean; /** Returns true if this BC-ID has the same value string as `other`. */ equals(other: BC_ID | string): boolean; /** * Ordering comparison for sorting BC-IDs. * * Compares first by number of bands (fewer first), then by band number * lists lexicographically, then by BWC-IDs per band. */ lessThan(value: BC_ID | string): boolean; /** Returns true if this BC-ID is strictly greater than `value`. */ greaterThan(value: BC_ID | string): boolean; /** Returns true if this BC-ID is less than or equal to `value`. */ lessOrEqual(value: BC_ID | string): boolean; /** Returns true if this BC-ID is greater than or equal to `value`. */ greaterOrEqual(value: BC_ID | string): boolean; }