Typescript typical of cloudboost (and use it with ionic2)

Interesting about any types available for cloudboost.io https://github.com/CloudBoost/JavaScriptSDK . I have no experience writing typing for existing js modules. I tried to prepare any of the most stupid d.ts, but to no avail. that is, using ionic2 and npm install cloudboost(also currently required separately npm install fs), I tried to use cloudboost.d.tsboth.

declare module "cloudboost" {}

or

declare var CB: any;
declare module "cloudboost" {
  export var CB: any;
}

the result is strange because it is cloudboostincluded in the ionic2 assembly (using its webpack configuration), however when using ie

import * as CB from "cloudboost";

import return CB socket.io, webpack, , cloudboost. any .

+4
1

typescript CloudBoost JavaScript SDK, .

, SO .

Node, typescript: https://github.com/basarat/ts-npm-module

typescript, https://github.com/basarat/ts-npm-module-consume

:

commonjs : true

.d.ts

.d.ts.

, .

-Nawaz CloudBoost.io

+1

Source: https://habr.com/ru/post/1625115/


All Articles