Skip to content

Commit

Permalink
Export all automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
pihart committed Jan 17, 2021
1 parent 2a91b0c commit a88030e
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as CustomError, ErrorWithCode } from "./lib/error";
export { default as Network, HTTPError, ResourceNotFoundException } from "./lib/network";
export * from "./lib/error";
export * from "./lib/network";
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as CustomError, ErrorWithCode } from "./lib/error";
export { default as Network, HTTPError, ResourceNotFoundException } from "./lib/network";
export * from "./lib/error";
export * from "./lib/network";
2 changes: 1 addition & 1 deletion dist/lib/error.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default class CustomError extends Error {
export declare class CustomError extends Error {
constructor(message: string);
}
export declare class ErrorWithCode extends CustomError {
Expand Down
2 changes: 1 addition & 1 deletion dist/lib/error.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default class CustomError extends Error {
export class CustomError extends Error {
constructor(message) {
super(message);
this.name = this.constructor.name;
Expand Down
2 changes: 1 addition & 1 deletion dist/lib/network.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export declare class HTTPError extends ErrorWithCode {
export declare class ResourceNotFoundException extends HTTPError {
constructor(code?: number, message?: string);
}
export default class Network {
export declare class Network {
static loadJSON(filePath: string): Promise<any>;
static fetch(url: string, prerequest?: (xhr: XMLHttpRequest) => void, method?: string, body?: null, resolveCondition?: Predicate<number>): Promise<XMLHttpRequest>;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/lib/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class ResourceNotFoundException extends HTTPError {
super(code, message);
}
}
export default class Network {
export class Network {
static async loadJSON(filePath) {
const xhr = await Network.fetch(filePath, (xhr) => {
xhr.overrideMimeType("application/json");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts",
"version": "1.0.1",
"version": "1.0.2",
"description": "Typescript extensions",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as CustomError, ErrorWithCode } from "./lib/error"
export { default as Network, HTTPError, ResourceNotFoundException } from "./lib/network"
export * from "./lib/error"
export * from "./lib/network"
2 changes: 1 addition & 1 deletion src/lib/error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default class CustomError extends Error {
export class CustomError extends Error {
constructor(message: string) {
super(message);
this.name = this.constructor.name;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class ResourceNotFoundException extends HTTPError {
}
}

export default class Network {
export class Network {
static async loadJSON(filePath: string): Promise<any> {
const xhr = await Network.fetch(filePath, (xhr) => {
xhr.overrideMimeType("application/json");
Expand Down

0 comments on commit a88030e

Please sign in to comment.