Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Incomplete dependencies #5

Open
vongohren opened this issue Feb 18, 2019 · 0 comments
Open

Incomplete dependencies #5

vongohren opened this issue Feb 18, 2019 · 0 comments
Assignees

Comments

@vongohren
Copy link

I tried using this lib in a Type Script project, but it complains

yarn tsc
yarn run v1.13.0
$ tsc
../../node_modules/uport-did-resolver/lib/register.d.ts:10:47 - error TS2304: Cannot find name 'UportLiteRegistry'.

10 export default function register(configured?: UportLiteRegistry): void;
                                                 ~~~~~~~~~~~~~~~~~


Found 2 errors.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

What I did to get past it was to add the interface to the node_module lib folder, meaning the compiled code:

import { DIDDocument } from 'did-resolver';
export declare interface LegacyUport {
    publicKey: string;
    publicEncKey?: string;
    name?: string;
    description?: string;
    image?: any;
}
---->
interface UportLiteRegistry {
    (mnid: string, callback: (error?: any , doc?: any) => void) : void
}
---->
export declare function convertToDid(did: string, legacy: LegacyUport): DIDDocument;
export default function register(configured?: UportLiteRegistry): void;

This stop the complaint and I could continue. But I think the problem is that the root vendor.d.ts file is never imported somehow, meaning that it acctually never knows its type.
Or any other idea?

@mi-xu mi-xu self-assigned this Feb 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants