Skip to content

Commit

Permalink
feat: use node next module
Browse files Browse the repository at this point in the history
  • Loading branch information
gz65555 committed Mar 19, 2024
1 parent 01cb16e commit 5921d2c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/node/NodeBasisEncoder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IBasisModule, IEncodeOptions, SourceType } from "../type";
import { applyInputOptions } from "../utils";
import { IBasisModule, IEncodeOptions, SourceType } from "../type.js";
import { applyInputOptions } from "../utils.js";
import BASIS from "./basis/basis_encoder.js";

let promise: Promise<IBasisModule> | null = null;
Expand Down
4 changes: 2 additions & 2 deletions src/node/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IEncodeOptions } from "../type";
import { nodeEncoder } from "./NodeBasisEncoder";
import { IEncodeOptions } from "../type.js";
import { nodeEncoder } from "./NodeBasisEncoder.js";

export function encodeToKTX2(imageBuffer: Uint8Array, options: Partial<IEncodeOptions> = {}): Promise<Uint8Array> {
if (!options.imageDecoder) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IBasisEncoder, IEncodeOptions } from "./type";
import { IBasisEncoder, IEncodeOptions } from "./type.js";

export const DefaultOptions = {
enableDebug: false,
Expand Down
4 changes: 2 additions & 2 deletions src/web/BrowserBasisEncoder.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { read, write } from "ktx-parse";
import { BasisTextureType, IBasisModule, IEncodeOptions, SourceType } from "../type";
import { applyInputOptions } from "../utils";
import { BasisTextureType, IBasisModule, IEncodeOptions, SourceType } from "../type.js";
import { applyInputOptions } from "../utils.js";

declare function importScripts(...args: any): any;

Expand Down
6 changes: 3 additions & 3 deletions src/web/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IEncodeOptions } from "../type";
import { browserEncoder } from "./BrowserBasisEncoder";
import { decodeImageBitmap } from "./decodeImageData";
import { IEncodeOptions } from "../type.js";
import { browserEncoder } from "./BrowserBasisEncoder.js";
import { decodeImageBitmap } from "./decodeImageData.js";

export function encodeToKTX2(imageBuffer: Uint8Array, options: Partial<IEncodeOptions> = {}): Promise<Uint8Array> {
options.imageDecoder ??= decodeImageBitmap;
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"module": "NodeNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"moduleResolution": "NodeNext",
"allowImportingTsExtensions": false,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down

0 comments on commit 5921d2c

Please sign in to comment.