specpress
Version:
Export PDF and/or DOCX files from a subset of Markdown, ASN.1 and JSON files
98 lines (97 loc) • 4.38 kB
TypeScript
import { JsonObject, RAN4JsonEncoder, CompiledSchema } from "./JsonTools.js";
export declare class KEYS {
static readonly scs = "scs";
static readonly scsList = "scsList";
static readonly bandwidthList = "bandwidthList";
static readonly bw = "bw";
static readonly uplink = "uplink";
static readonly downlink = "downlink";
static readonly notes = "notes";
static readonly bcId = "bcId";
static readonly bcsList = "bcsList";
static readonly bcsId = "bcsId";
static readonly bandList = "bandList";
static readonly ulConfigList = "ulConfigList";
static readonly bandEntry = "bandEntry";
static readonly bandNumber = "bandNumber";
static readonly contCarrierGroups = "contCarrierGroups";
static readonly nonContiguousCarriers = "nonContiguousCarriers";
static readonly contiguousCarriers = "contiguousCarriers";
static readonly referencedComponents = "referencedComponents";
static readonly maxAggBwPerBand = "maxAggBwPerBand";
static readonly bandCombinationList = "bandCombinationList";
static readonly singleUlAllowed = "singleUlAllowed";
static readonly dlInterruptionsAllowed = "dlInterruptionsAllowed";
static readonly specification = "specification";
static readonly schemaVersion = "schemaVersion";
}
export declare class UnsupportedKeyException extends Error {
constructor(message: string);
}
export declare class MissingParentObjectException extends Error {
constructor(message: string);
}
export declare class InvalidInputTypeException extends Error {
constructor(message: string);
}
export declare class NoEntriesException extends Error {
constructor(message: string);
}
export declare class DuplicateEntryException extends Error {
constructor(message: string);
}
export declare class FileNameMismatchException extends Error {
constructor(message: string);
}
export declare function IsInt(aStr: string | number): boolean;
export declare function listToString(aList: unknown[]): string;
export declare function FindAll(aString: string | null, aSubString: string | null, aStartIndex?: number): number[];
type Constructor<T> = abstract new (...args: any[]) => T;
export declare abstract class BaseClass extends JsonObject {
parent: BaseClass | null;
constructor(aParent?: BaseClass | null);
getParent<T>(aType?: Constructor<T>): T | BaseClass | null;
getDescriptor(aMaxNrofLevels?: number): string;
abstract validate(...args: unknown[]): void;
abstract getTag(): string;
}
export type ValidationErrorCounts = {
schemaErrors: number;
contentErrors: number;
};
export declare abstract class BaseList extends BaseClass {
data: Map<string, BaseClass>;
constructor(aParent?: BaseClass | null);
getTag(): string;
has(aKey: string | number): boolean;
get(aKey: string | number): BaseClass | undefined;
protected abstract _createEntry(aValue: unknown, aParent: BaseList): BaseClass;
protected abstract _getEntryId(anEntry: BaseClass): string;
add(aValue: unknown): void;
addAll(aList: unknown[]): void;
validate(): void;
validateCollectErrors(): string[];
protected _getTargetSubfolder(_anEntry: BaseClass): string;
protected _getFileName(anEntry: BaseClass): string;
protected _shouldStoreEntry(_anEntry: BaseClass): boolean;
storeAsJsonFiles(aFolder: string): void;
loadFromFolder(aFolder: string, skipValidation?: boolean, aJsonSchema?: CompiledSchema | null, abortOnError?: boolean): ValidationErrorCounts;
loadByPattern(aRootFolder: string, aPattern: string, skipValidation?: boolean, aJsonSchema?: CompiledSchema | null, abortOnError?: boolean): ValidationErrorCounts;
private _loadFiles;
toJSON(anEncoder: RAN4JsonEncoder, aLevel: number): void;
}
/**
* Normalizes a single RAN4 JSON file (Band, CA, or DC configuration).
*
* Detects the file type from the JSON content and applies appropriate normalization:
* - Key ordering enforced by toJSON() methods
* - UL configs sorted (for CA/DC)
* - notes object keys sorted alphabetically
* - Consistent indentation via RAN4JsonEncoder
*
* @param filePath - Path to the JSON file to normalize
* @returns The absolute path of the normalized file
* @throws Error if the file is not a valid RAN4 JSON file
*/
export declare function normalizeJsonFile(filePath: string): Promise<string>;
export {};