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

Incomplete dependencies #5

@vongohren

Description

@vongohren

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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions