Answer the question
In order to leave comments, you need to log in
How to import a type from another declaration file in Typescript?
Good day.
There are two declaration files. I'm trying to import one into the other, but it doesn't work.
// module.d.ts
import * as types from 'constants';
declare module '@vendor/module' {
function createComplex(
password: string,
encryptOptions: types.KDF_ENCRYPT_OPTIONS
): Promise<any>;
}
// constants.d.ts
export type KDF_ENCRYPT_OPTIONS = {
kdf: string,
n: number,
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question