GithubHelp home page GithubHelp logo

Comments (6)

kevlened avatar kevlened commented on May 25, 2024 1

re: ensureSecure - I'll need to add it
re: getRandomValues - Yeah, I should def fix that in the docs
re: TypeScript version - I didn't develop using TypeScript. I used the intellisense in VSCode to determine whether types were available. I believe my version was backed by 2.6

from isomorphic-webcrypto.

kevlened avatar kevlened commented on May 25, 2024

Both entries exist so you can import two ways and still get types:

  1. import crypto from 'isomorphic-webcrypto';
  2. const crypto = require('isomorphic-webcrypto');

I imagine you stop getting types on the ES6 import example if you remove the default export. I think you'd have to import like this:

import * as crypto from 'isomorphic-webcrypto';

from isomorphic-webcrypto.

kevlened avatar kevlened commented on May 25, 2024

Seems related to a breaking change introduced in TypeScript 2.7

I'm hesitant to remove the default statement unless both scenarios above work, so we'll probably have to find another solution.

from isomorphic-webcrypto.

sinewave440hz avatar sinewave440hz commented on May 25, 2024

Ah ok. With my tsconfig I have to have one or the other - this is another thing that I suppose a working example might avoid, if an example tsconfig is supplied... In either case, ensureSecure() is not available in the types (with my ts/tsconfig, at least). Also, getRandomValues() requires an argument (I am told by ts ;) ). What version of typescript did you develop against btw?

from isomorphic-webcrypto.

kevlened avatar kevlened commented on May 25, 2024

I'll include an example using TypeScript to clear this up.

from isomorphic-webcrypto.

kevlened avatar kevlened commented on May 25, 2024

I set up a React Native TypeScript example with [email protected] and I've added the ensureSecure method.

Hope this helps. Closing for now.

from isomorphic-webcrypto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.