mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 19:57:52 +01:00
fs: make imports esm compatible
This commit is contained in:
@@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import FileStreamSource from "./filestreamsource";
|
import FileStreamSource from "./filestreamsource.js";
|
||||||
import { IFileStorage } from "./interfaces";
|
import { IFileStorage } from "./interfaces.js";
|
||||||
import { File } from "./types";
|
import { File } from "./types.js";
|
||||||
import { chunkPrefix } from "./utils";
|
import { chunkPrefix } from "./utils.js";
|
||||||
|
|
||||||
export default class FileHandle {
|
export default class FileHandle {
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { File } from "./types";
|
import { File } from "./types.js";
|
||||||
import { IFileStorage } from "./interfaces";
|
import { IFileStorage } from "./interfaces.js";
|
||||||
|
|
||||||
export default class FileStreamSource {
|
export default class FileStreamSource {
|
||||||
private index = 0;
|
private index = 0;
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import FileHandle from "./src/filehandle";
|
import FileHandle from "./filehandle.js";
|
||||||
import { IFileStorage, IStreamableFS } from "./src/interfaces";
|
import { IFileStorage, IStreamableFS } from "./interfaces.js";
|
||||||
import { File } from "./src/types";
|
import { File } from "./types.js";
|
||||||
import { chunkPrefix } from "./src/utils";
|
import { chunkPrefix } from "./utils.js";
|
||||||
|
|
||||||
export class StreamableFS implements IStreamableFS {
|
export class StreamableFS implements IStreamableFS {
|
||||||
/**
|
/**
|
||||||
@@ -81,3 +81,5 @@ export class StreamableFS implements IStreamableFS {
|
|||||||
await this.storage.clear();
|
await this.storage.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type { IFileStorage, File, FileHandle };
|
||||||
@@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import FileHandle from "./filehandle";
|
import FileHandle from "./filehandle.js";
|
||||||
import { File } from "./types";
|
import { File } from "./types.js";
|
||||||
|
|
||||||
export interface IStreamableFS {
|
export interface IStreamableFS {
|
||||||
createFile(
|
createFile(
|
||||||
|
|||||||
@@ -4,5 +4,5 @@
|
|||||||
"lib": ["DOM", "ESNext"],
|
"lib": ["DOM", "ESNext"],
|
||||||
"outDir": "./dist"
|
"outDir": "./dist"
|
||||||
},
|
},
|
||||||
"include": ["./index.ts", "./src/"]
|
"include": ["./src/"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user