specpress
Version:
Export PDF and/or DOCX files from a subset of Markdown, ASN.1 and JSON files
168 lines (167 loc) • 7.36 kB
TypeScript
import { RAN4JsonEncoder } from "./JsonTools.js";
import { BaseClass, BaseList } from "./Utils.js";
import { HtmlTable } from "./HtmlTable.js";
import { BandNumber } from "./BandNumber.js";
import { SCS } from "./SubcarrierSpacing.js";
/** Maximum supported carrier bandwidth in MHz. */
export declare const MAX_CARRIER_BW_MHZ = 2400;
/** Thrown when a carrier bandwidth value is out of range. */
export declare class InvalidCarrierBandwidthException extends Error {
constructor(message: string);
}
/** Thrown when a required SCS value is missing. */
export declare class MissingScsException extends Error {
constructor(message: string);
}
/** Thrown when a required bandwidth list is missing. */
export declare class MissingBandwidthListException extends Error {
constructor(message: string);
}
/** Thrown when a required band number is missing. */
export declare class MissingBandNumberException extends Error {
constructor(message: string);
}
/** Thrown when a required SCS list is missing. */
export declare class MissingScsListException extends Error {
constructor(message: string);
}
/** Thrown when the specification field does not match the expected value. */
export declare class InvalidSpecificationException extends Error {
constructor(message: string);
}
/** Enumeration of uplink/downlink support types for a channel bandwidth. */
export declare class ENUMS {
static readonly OPTIONAL = "optional";
static readonly MANDATORY = "mandatory";
static readonly UNDEFINED = "undefined";
static readonly SCELL_ONLY = "scell_only";
}
/**
* A single channel bandwidth entry with uplink/downlink support type.
*
* Represents one supported bandwidth value (in MHz) for a given band and SCS,
* along with whether uplink and downlink are mandatory, optional, undefined,
* or SCell-only.
*/
export declare class ChannelBandwidth extends BaseClass {
/** Bandwidth in MHz. */
bw: number;
/** Uplink support type (mandatory, optional, undefined, scell_only). */
uplink: string;
/** Downlink support type (mandatory, optional, undefined, scell_only). */
downlink: string;
/**
* @param aValue — a dict from JSON, an existing ChannelBandwidth to copy, or a plain number.
* @param aParent — the parent SCSEntry.
*/
constructor(aValue: Record<string, unknown> | ChannelBandwidth | number, aParent?: BaseClass | null);
/** Validates that bw is in range and uplink/downlink types are valid. */
validate(): this;
getTag(): string;
/** Sets the uplink support type. @returns this for chaining. */
setUplink(aType: string): this;
/** Returns the uplink support type. */
getUplink(): string;
/** Sets the downlink support type. @returns this for chaining. */
setDownlink(aType: string): this;
/** Returns the downlink support type. */
getDownlink(): string;
/** Returns the bandwidth as a float (MHz). */
asFloat(): number;
toString(): string;
toJSON(anEncoder: RAN4JsonEncoder, aLevel: number): void;
}
/**
* Groups a subcarrier spacing value with its list of supported channel bandwidths.
*
* Each SCSEntry belongs to a ChBwOneBand and contains one SCS value
* (e.g. 15 kHz, 30 kHz) and the bandwidths supported at that SCS.
*/
export declare class SCSEntry extends BaseClass {
/** The subcarrier spacing in kHz. */
scs: SCS;
/** The list of supported channel bandwidths at this SCS. */
bandwidthList: ChannelBandwidth[];
/**
* @param aValue — a dict from JSON or an existing SCSEntry to copy.
* @param aParent — the parent ChBwOneBand.
*/
constructor(aValue: Record<string, unknown> | SCSEntry, aParent?: BaseClass | null);
/** Validates that scs and bandwidthList are present, and validates each bandwidth. */
validate(): this;
/** Returns true if the given bandwidth (MHz) is in this SCS entry's bandwidth list. */
isBandwidthSupported(aBandwidth: number): boolean;
getTag(): string;
toString(): string;
toJSON(anEncoder: RAN4JsonEncoder, aLevel: number): void;
toHTML(aHtmlTable: HtmlTable, aRow?: number, aColumn?: number): void;
}
/**
* Channel bandwidth definition for one NR band.
*
* Contains the band number, a list of SCS entries (each with its supported
* bandwidths), and optional notes. Corresponds to one JSON file in the
* `FR1_NR_bands` or `FR2_NR_bands` folders.
*/
export declare class ChBwOneBand extends BaseClass {
/** The NR band number (e.g. n1, n78). */
bandNumber: BandNumber | null;
/** SCS entries with their supported bandwidths. */
scsList: SCSEntry[];
/** Optional specification notes. */
notes: Record<string, boolean>;
/** Specification number (e.g. "38.101-1"). */
specification: string | null;
/** Schema version. */
schemaVersion: string | null;
/**
* @param aDict — a dict from JSON or an existing ChBwOneBand to copy.
* @param aParent — the parent ChannelBandwidthList.
*/
constructor(aDict: Record<string, unknown> | ChBwOneBand, aParent?: BaseClass | null);
/** Validates that bandNumber and scsList are present, and validates each SCS entry. */
validate(): this;
/** Returns true if the given bandwidth (MHz) is supported by any SCS entry in this band. */
isBandwidthSupported(aBandwidth: number): boolean;
getTag(): string;
toString(): string;
toJSON(anEncoder: RAN4JsonEncoder, aLevel: number): void;
toHTML(aHtmlTable: HtmlTable, aRow?: number, aColumn?: number): void;
}
/**
* Collection of channel bandwidth definitions for all NR bands.
*
* Keyed by band number string (e.g. `"n1"`, `"n78"`). Supports loading from
* individual JSON files or a single multi-band file, validation, and export
* to JSON or HTML.
*/
export declare class ChannelBandwidthList extends BaseList {
/** HTML table used for HTML export. */
html: HtmlTable;
constructor(aParent?: BaseClass | null);
protected _createEntry(aValue: unknown, aParent: BaseList): BaseClass;
protected _getEntryId(anEntry: BaseClass): string;
/** Returns true if the given band number exists in this list. */
hasBand(aBandNumber: BandNumber | string | number): boolean;
/**
* Returns true if the given bandwidth is supported for the given band.
* @param aBandNumber — the band to check.
* @param aBandwidth — the bandwidth in MHz.
*/
isChBwSupported(aBandNumber: BandNumber | string | number, aBandwidth: number): boolean;
/** Loads channel bandwidths from a single JSON file containing a bandList array. */
loadFromFile(aJsonFile: string): void;
protected _getTargetSubfolder(anEntry: BaseClass): string;
protected _getFileName(anEntry: BaseClass): string;
/** Exports all channel bandwidths to an HTML table file, sorted by band number. */
storeAsHtmlFile(aFileName: string): void;
/** Adds standard band table headers to the given HTML table. */
static addTableHeaders(aHtmlTable: HtmlTable): void;
/**
* Renders a single band as a complete HTML table string.
* @param data — Raw JSON object containing band data
* @returns HTML table string with headers and one band row
*/
static renderAsHtml(data: Record<string, unknown>): string;
toJSON(anEncoder: RAN4JsonEncoder, aLevel: number): void;
}