Metadata missing class - possible fix
// The exportedMetadataname is already used for exporting the "raw" JSON metadata type. // Then,Metadataclass has become exported, but its name is already taken, so TypeScript users seem to be unable to use theMetadataclass. // If someone knows a solution then they could propose it in an issue. // export class Metadata { // ... // }
about that: you can rename type Metadata to MetadataConfig
and create typings :
interface LeadingDigitsFn {
(): string | undefined;
}
interface NumberingPlan {
leadingDigits: LeadingDigitsFn;
}
export class Metadata {
constructor(config: MetadataConfig) {}
public country(country: CountryCode): void;
public numberingPlan: NumberingPlan;
}
and create also file metadata.min.json.d.ts with content
import { MetadataConfig } from './types';
declare const minMetadataData: MetadataConfig;
export default minMetadataData;
and import-export it from other d.ts
here is my patch for version 1.9.26: https://pastebin.com/X2vwqYBF
Edited by Michal Jamrozy