Skip to content

Commit

Permalink
Export axios
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Jan 4, 2025
1 parent fd78bb8 commit f22f9a1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
10 changes: 9 additions & 1 deletion openeo.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ declare module OpenEO {
* @hideconstructor
*/
export class Environment {
/**
* The axios instance to use for HTTP requests.
*
*
* @type {object}
* @static
*/
static axios: object;
/**
* Returns the name of the Environment, `Node` or `Browser`.
*
Expand Down Expand Up @@ -829,7 +837,7 @@ declare module OpenEO {
protected level: string | null;
/**
* @protected
* @type {Set<String>}
* @type {Set<string>}
*/
protected missing: Set<string>;
/**
Expand Down
16 changes: 13 additions & 3 deletions src/env.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
let Environment = null;
if (typeof window === 'undefined') {
module.exports = require('./node');
Environment = require('./node');
}
else {
module.exports = require('./browser');
}
Environment = require('./browser');
}
/**
* The axios instance to use for HTTP requests.
*
* @type {object}
* @static
*/
Environment.axios = require('axios');

module.exports = Environment;
2 changes: 1 addition & 1 deletion src/logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Logs {
this.level = level;
/**
* @protected
* @type {Set<String>}
* @type {Set<string>}
*/
this.missing = new Set();
}
Expand Down

0 comments on commit f22f9a1

Please sign in to comment.