Skip to content

Help needed with use with Typescript #105

@rickhoro

Description

@rickhoro

I've gotten this to work with node and typescript with the associated @types/backblaze-b2 package but I have not been able to figure out how to use the interfaces defined in the index.d.ts file in my node js program. For example, I am trying to define a BucketInfo interface that can be used to extract data from a getBucket() call. In the BucketInfo interface, I would like to define a bucketType: BucketType property, but I cannot figure out how to get access to the BucketType type definition in the index.d.ts file in @types/backblaze-b2. Can anyone suggest a solution?

Currently, I am importing the b2 definition like this:

import B2 = require("./node_modules/@types/backblaze-b2");

This allows me to call B2 as a constructor, but I don't seem to be able to use it as a namespace.

I'm not sure if this is appropriate to post as an issue, but it would be helpful to add this to the examples in the doc, so I suppose it is valid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions