I'm currently working on creating Typescript typings for the link2aws package in order to incorporate it into my Angular project. Despite generating a .d.ts file, I am still encountering the following error message:
TypeError: (new link2aws__WEBPACK_IMPORTED_MODULE_1__.ARN(...)).consoleLink is not a function
.
The way I am importing ARN
from link2aws
is as follows:
import { ARN } from 'link2aws';
And I am using it like this:
arn = 'arn:aws:...'
let link = new ARN(arn).consoleLink();
link2aws.d.ts
// Type definitions for link2aws
// Project: https://github.com/link2aws/link2aws.github.io#readme
// Definitions by: me <url redacted>
declare module 'link2aws' {
class ARN {
constructor(text: string);
string(): string;
console(): string;
qualifiers(): string[];
pathLast(): string;
consoleLink(): string;
}
}