@gjsify/fs 0.4.28 → 0.4.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/esm/sync.js CHANGED
@@ -1 +1 @@
1
- import"./_virtual/_rolldown/runtime.js";import{decode as e,encodeUint8Array as t,getEncodingFromOptions as n}from"./encoding.js";import{normalizePath as r,tempDirPath as i}from"./utils.js";import{FSWatcher as a}from"./fs-watcher.js";import{Dirent as o}from"./dirent.js";import{BigIntStats as s,STAT_ATTRIBUTES as c,Stats as l}from"./stats.js";import{FileHandle as u}from"./file-handle.js";import{createNodeError as d,isNotFoundError as f}from"./errors.js";import p from"@girs/glib-2.0";import m from"@girs/gio-2.0";import{join as h}from"node:path";import{Buffer as g}from"node:buffer";import{existsSync as _}from"@gjsify/utils";function statSync(e,t){let n=r(e);try{let e=m.File.new_for_path(n).query_info(c,m.FileQueryInfoFlags.NONE,null);return t?.bigint?new s(e,n):new l(e,n)}catch(e){if(t?.throwIfNoEntry===!1&&f(e))return;throw d(e,`stat`,n)}}function lstatSync(e,t){let n=r(e);try{let e=m.File.new_for_path(n).query_info(c,m.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null);return t?.bigint?new s(e,n):new l(e,n)}catch(e){if(t?.throwIfNoEntry===!1&&f(e))return;throw d(e,`lstat`,n)}}function readdirSync(e,t){let n=r(e),i=m.File.new_for_path(n).enumerate_children(`standard::name,standard::type`,m.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null),a=[];try{let e=i.next_file(null);for(;e!==null;)a.push({name:e.get_name(),type:e.get_file_type()}),e=i.next_file(null)}finally{try{i.close(null)}catch{}}let s=[];for(let e of a){let r=h(n,e.name);if(t?.withFileTypes?s.push(new o(r,e.name,e.type)):s.push(e.name),t?.recursive&&e.type===m.FileType.DIRECTORY){let n=readdirSync(r,t);for(let t of n)typeof t==`string`?s.push(h(e.name,t)):s.push(t)}}return s}function realpathSync(e){let t=r(e),n=m.File.new_for_path(t),i=0;for(;;){let e=n.query_info(`standard::is-symlink,standard::symlink-target`,m.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null);if(!e.get_is_symlink())return n.get_path();let r=e.get_symlink_target(),a=n.get_parent();if(n=a?a.resolve_relative_path(r):m.File.new_for_path(r),++i>40)throw Error(`ELOOP: too many levels of symbolic links, realpath '${t}'`)}}realpathSync.native=realpathSync;function symlinkSync(e,t,n){let i=r(t),a=r(e);m.File.new_for_path(i).make_symbolic_link(a,null)}function readFileSync(e,i={encoding:null,flag:`r`}){let a=r(e),o=m.File.new_for_path(a);try{let[e,r]=o.load_contents(null);if(!e)throw d(Error(`failed to read file`),`read`,a);return t(n(i,`buffer`),r)}catch(e){throw e.code&&typeof e.code==`string`?e:d(e,`read`,a)}}function mkdirSync(e,t){let n=!1,i=511;if(typeof t==`object`?(t?.recursive&&(n=t.recursive),t?.mode&&(i=t.mode)):i=t||511,e=r(e),typeof i==`string`)throw TypeError(`mode as string is currently not supported!`);if(n)return mkdirSyncRecursive(e,i);let a=m.File.new_for_path(e);try{a.make_directory(null)}catch(t){throw d(t,`mkdir`,e)}}function mkdirSyncRecursive(e,t){let n=m.File.new_for_path(e);try{return n.make_directory(null),e}catch(n){let r=n;if(r.code===m.IOErrorEnum.EXISTS)return;if(r.code===m.IOErrorEnum.NOT_FOUND){let r=h(e,`..`),i=m.File.new_for_path(r).get_path();if(i===e)throw d(n,`mkdir`,e);let a=mkdirSyncRecursive(i,t),o=m.File.new_for_path(e);try{o.make_directory(null)}catch(t){throw d(t,`mkdir`,e)}return a??e}throw d(n,`mkdir`,e)}}function rmdirSync(e,t){let n=r(e),i=m.File.new_for_path(n);try{if(i.query_info(`standard::type`,m.FileQueryInfoFlags.NONE,null).get_file_type()!==m.FileType.DIRECTORY)throw d(Object.assign(Error(),{code:4}),`rmdir`,n);if(i.enumerate_children(`standard::name`,m.FileQueryInfoFlags.NONE,null).next_file(null)!==null)throw d(Object.assign(Error(),{code:5}),`rmdir`,n);i.delete(null)}catch(e){throw e.code&&typeof e.code==`string`?e:d(e,`rmdir`,n)}}function unlinkSync(e){let t=r(e),n=m.File.new_for_path(t);try{n.delete(null)}catch(e){throw d(e,`unlink`,t)}}function writeFileSync(e,t){p.file_set_contents(r(e),t)}function renameSync(e,t){let n=r(e),i=r(t),a=m.File.new_for_path(n),o=m.File.new_for_path(i);try{a.move(o,m.FileCopyFlags.OVERWRITE,null,null)}catch(e){throw d(e,`rename`,n,i)}}function copyFileSync(e,t,n){let i=r(e),a=r(t),o=m.File.new_for_path(i),s=m.File.new_for_path(a),c=m.FileCopyFlags.NONE;n&&!(n&1)?c=m.FileCopyFlags.OVERWRITE:n||(c=m.FileCopyFlags.OVERWRITE);try{o.copy(s,c,null,null)}catch(e){throw d(e,`copyfile`,i,a)}}function accessSync(e,t){let n=r(e),i=m.File.new_for_path(n);try{let e=i.query_info(`access::*`,m.FileQueryInfoFlags.NONE,null);if(t!==void 0&&t!==0){let r={code:14,message:`permission denied, access '${n}'`};if(t&4&&!e.get_attribute_boolean(`access::can-read`)||t&2&&!e.get_attribute_boolean(`access::can-write`)||t&1&&!e.get_attribute_boolean(`access::can-execute`))throw d(r,`access`,n)}}catch(e){throw e.code&&typeof e.code==`string`?e:d(e,`access`,n)}}function appendFileSync(e,t,n){let i=r(e),a=m.File.new_for_path(i),o;o=typeof t==`string`?new TextEncoder().encode(t):t;try{let e=a.append_to(m.FileCreateFlags.NONE,null);o.length>0&&e.write_bytes(new p.Bytes(o),null),e.close(null)}catch(e){throw d(e,`appendfile`,i)}}function readlinkSync(e,t){let n=r(e),i=m.File.new_for_path(n);try{let e=i.query_info(`standard::symlink-target`,m.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null).get_symlink_target();if(!e)throw Object.assign(Error(`EINVAL: invalid argument, readlink '${n}'`),{code:`EINVAL`,errno:-22,syscall:`readlink`,path:n});return(typeof t==`string`?t:t?.encoding)===`buffer`?g.from(e):e}catch(e){throw typeof e.code==`string`?e:d(e,`readlink`,n)}}function linkSync(e,t){let n=r(e),i=r(t);if(!p.spawn_command_line_sync(`ln ${n} ${i}`)[0])throw Object.assign(Error(`EPERM: operation not permitted, link '${n}' -> '${i}'`),{code:`EPERM`,errno:-1,syscall:`link`,path:n,dest:i})}function truncateSync(e,t){let n=r(e),i=m.File.new_for_path(n);try{let e=i.replace(null,!1,m.FileCreateFlags.NONE,null);if(t&&t>0){let[,n]=i.load_contents(null),r=n.slice(0,t);r.length>0&&e.write_bytes(new p.Bytes(r),null)}e.close(null)}catch(e){throw d(e,`truncate`,n)}}function chmodSync(e,t){let n=r(e),i=typeof t==`string`?parseInt(t,8):t;if(!p.spawn_command_line_sync(`chmod ${i.toString(8)} ${n}`)[0])throw Object.assign(Error(`EPERM: operation not permitted, chmod '${n}'`),{code:`EPERM`,errno:-1,syscall:`chmod`,path:n})}function chownSync(e,t,n){let i=r(e);if(!p.spawn_command_line_sync(`chown ${t}:${n} ${i}`)[0])throw Object.assign(Error(`EPERM: operation not permitted, chown '${i}'`),{code:`EPERM`,errno:-1,syscall:`chown`,path:i})}function watch(e,t,n){return new a(r(e),t,n)}function openSync(e,t,n){return new u({path:e,flags:t,mode:n})}function mkdtempSync(t,r){let a=n(r),o=i(t);return mkdirSync(o,{recursive:!1,mode:511}),e(o,a)}function rmSync(e,t){let n=r(e),i=m.File.new_for_path(n),a=t?.recursive||!1,s=t?.force||!1,c;try{c=new o(n)}catch(t){if(s&&f(t))return;throw d(t,`rm`,e)}if(c.isDirectory()){let r=readdirSync(e);if(!a&&r.length)throw d(Object.assign(Error(),{code:5}),`rm`,e);for(let e of r)rmSync(h(n,e),t)}try{i.delete(null)}catch(t){if(s&&f(t))return;throw d(t,`rm`,e)}}export{accessSync,appendFileSync,chmodSync,chownSync,copyFileSync,_ as existsSync,linkSync,lstatSync,mkdirSync,mkdtempSync,openSync,readFileSync,readdirSync,readlinkSync,realpathSync,renameSync,rmSync,rmdirSync,statSync,symlinkSync,truncateSync,unlinkSync,watch,writeFileSync};
1
+ import"./_virtual/_rolldown/runtime.js";import{decode as e,encodeUint8Array as t,getEncodingFromOptions as n}from"./encoding.js";import{normalizePath as r,tempDirPath as i}from"./utils.js";import{FSWatcher as a}from"./fs-watcher.js";import{Dirent as o}from"./dirent.js";import{BigIntStats as s,STAT_ATTRIBUTES as c,Stats as l}from"./stats.js";import{FileHandle as u}from"./file-handle.js";import{createNodeError as d,isNotFoundError as f}from"./errors.js";import p from"@girs/glib-2.0";import m from"@girs/gio-2.0";import{join as h}from"node:path";import{Buffer as g}from"node:buffer";import{existsSync as _}from"@gjsify/utils";function statSync(e,t){let n=r(e);try{let e=m.File.new_for_path(n).query_info(c,m.FileQueryInfoFlags.NONE,null);return t?.bigint?new s(e,n):new l(e,n)}catch(e){if(t?.throwIfNoEntry===!1&&f(e))return;throw d(e,`stat`,n)}}function lstatSync(e,t){let n=r(e);try{let e=m.File.new_for_path(n).query_info(c,m.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null);return t?.bigint?new s(e,n):new l(e,n)}catch(e){if(t?.throwIfNoEntry===!1&&f(e))return;throw d(e,`lstat`,n)}}function readdirSync(e,t){let n=r(e),i=m.File.new_for_path(n).enumerate_children(`standard::name,standard::type`,m.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null),a=[];try{let e=i.next_file(null);for(;e!==null;)a.push({name:e.get_name(),type:e.get_file_type()}),e=i.next_file(null)}finally{try{i.close(null)}catch{}}let s=[];for(let e of a){let r=h(n,e.name);if(t?.withFileTypes?s.push(new o(r,e.name,e.type)):s.push(e.name),t?.recursive&&e.type===m.FileType.DIRECTORY){let n=readdirSync(r,t);for(let t of n)typeof t==`string`?s.push(h(e.name,t)):s.push(t)}}return s}function realpathSync(e){let t=r(e),n=m.File.new_for_path(t),i=0;for(;;){let e=n.query_info(`standard::is-symlink,standard::symlink-target`,m.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null);if(!e.get_is_symlink())return n.get_path();let r=e.get_symlink_target(),a=n.get_parent();if(n=a?a.resolve_relative_path(r):m.File.new_for_path(r),++i>40)throw Error(`ELOOP: too many levels of symbolic links, realpath '${t}'`)}}realpathSync.native=realpathSync;function symlinkSync(e,t,n){let i=r(t),a=r(e);m.File.new_for_path(i).make_symbolic_link(a,null)}function readFileSync(e,i={encoding:null,flag:`r`}){let a=r(e),o=m.File.new_for_path(a);try{let[e,r]=o.load_contents(null);if(!e)throw d(Error(`failed to read file`),`read`,a);return t(n(i,`buffer`),r)}catch(e){throw e.code&&typeof e.code==`string`?e:d(e,`read`,a)}}function mkdirSync(e,t){let n=!1,i=511;if(typeof t==`object`?(t?.recursive&&(n=t.recursive),t?.mode&&(i=t.mode)):i=t||511,e=r(e),typeof i==`string`)throw TypeError(`mode as string is currently not supported!`);if(n)return mkdirSyncRecursive(e);let a=m.File.new_for_path(e);try{a.make_directory(null)}catch(t){throw d(t,`mkdir`,e)}}function mkdirSyncRecursive(e){let t=m.File.new_for_path(e);try{return t.make_directory(null),e}catch(t){let n=t;if(n.code===m.IOErrorEnum.EXISTS)return;if(n.code===m.IOErrorEnum.NOT_FOUND){let n=h(e,`..`),r=m.File.new_for_path(n).get_path();if(r===e)throw d(t,`mkdir`,e);let i=mkdirSyncRecursive(r),a=m.File.new_for_path(e);try{a.make_directory(null)}catch(t){throw d(t,`mkdir`,e)}return i??e}throw d(t,`mkdir`,e)}}function rmdirSync(e,t){let n=r(e),i=m.File.new_for_path(n);try{if(i.query_info(`standard::type`,m.FileQueryInfoFlags.NONE,null).get_file_type()!==m.FileType.DIRECTORY)throw d(Object.assign(Error(),{code:4}),`rmdir`,n);if(i.enumerate_children(`standard::name`,m.FileQueryInfoFlags.NONE,null).next_file(null)!==null)throw d(Object.assign(Error(),{code:5}),`rmdir`,n);i.delete(null)}catch(e){throw e.code&&typeof e.code==`string`?e:d(e,`rmdir`,n)}}function unlinkSync(e){let t=r(e),n=m.File.new_for_path(t);try{n.delete(null)}catch(e){throw d(e,`unlink`,t)}}function writeFileSync(e,t){p.file_set_contents(r(e),t)}function renameSync(e,t){let n=r(e),i=r(t),a=m.File.new_for_path(n),o=m.File.new_for_path(i);try{a.move(o,m.FileCopyFlags.OVERWRITE,null,null)}catch(e){throw d(e,`rename`,n,i)}}function copyFileSync(e,t,n){let i=r(e),a=r(t),o=m.File.new_for_path(i),s=m.File.new_for_path(a),c=m.FileCopyFlags.NONE;n&&!(n&1)?c=m.FileCopyFlags.OVERWRITE:n||(c=m.FileCopyFlags.OVERWRITE);try{o.copy(s,c,null,null)}catch(e){throw d(e,`copyfile`,i,a)}}function accessSync(e,t){let n=r(e),i=m.File.new_for_path(n);try{let e=i.query_info(`access::*`,m.FileQueryInfoFlags.NONE,null);if(t!==void 0&&t!==0){let r={code:14,message:`permission denied, access '${n}'`};if(t&4&&!e.get_attribute_boolean(`access::can-read`)||t&2&&!e.get_attribute_boolean(`access::can-write`)||t&1&&!e.get_attribute_boolean(`access::can-execute`))throw d(r,`access`,n)}}catch(e){throw e.code&&typeof e.code==`string`?e:d(e,`access`,n)}}function appendFileSync(e,t,n){let i=r(e),a=m.File.new_for_path(i),o;o=typeof t==`string`?new TextEncoder().encode(t):t;try{let e=a.append_to(m.FileCreateFlags.NONE,null);o.length>0&&e.write_bytes(new p.Bytes(o),null),e.close(null)}catch(e){throw d(e,`appendfile`,i)}}function readlinkSync(e,t){let n=r(e),i=m.File.new_for_path(n);try{let e=i.query_info(`standard::symlink-target`,m.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,null).get_symlink_target();if(!e)throw Object.assign(Error(`EINVAL: invalid argument, readlink '${n}'`),{code:`EINVAL`,errno:-22,syscall:`readlink`,path:n});return(typeof t==`string`?t:t?.encoding)===`buffer`?g.from(e):e}catch(e){throw typeof e.code==`string`?e:d(e,`readlink`,n)}}function linkSync(e,t){let n=r(e),i=r(t);if(!p.spawn_command_line_sync(`ln ${n} ${i}`)[0])throw Object.assign(Error(`EPERM: operation not permitted, link '${n}' -> '${i}'`),{code:`EPERM`,errno:-1,syscall:`link`,path:n,dest:i})}function truncateSync(e,t){let n=r(e),i=m.File.new_for_path(n);try{let e=i.replace(null,!1,m.FileCreateFlags.NONE,null);if(t&&t>0){let[,n]=i.load_contents(null),r=n.slice(0,t);r.length>0&&e.write_bytes(new p.Bytes(r),null)}e.close(null)}catch(e){throw d(e,`truncate`,n)}}function chmodSync(e,t){let n=r(e),i=typeof t==`string`?parseInt(t,8):t;if(!p.spawn_command_line_sync(`chmod ${i.toString(8)} ${n}`)[0])throw Object.assign(Error(`EPERM: operation not permitted, chmod '${n}'`),{code:`EPERM`,errno:-1,syscall:`chmod`,path:n})}function chownSync(e,t,n){let i=r(e);if(!p.spawn_command_line_sync(`chown ${t}:${n} ${i}`)[0])throw Object.assign(Error(`EPERM: operation not permitted, chown '${i}'`),{code:`EPERM`,errno:-1,syscall:`chown`,path:i})}function watch(e,t,n){return new a(r(e),t,n)}function openSync(e,t,n){return new u({path:e,flags:t,mode:n})}function mkdtempSync(t,r){let a=n(r),o=i(t);return mkdirSync(o,{recursive:!1,mode:511}),e(o,a)}function rmSync(e,t){let n=r(e),i=m.File.new_for_path(n),a=t?.recursive||!1,s=t?.force||!1,c;try{c=new o(n)}catch(t){if(s&&f(t))return;throw d(t,`rm`,e)}if(c.isDirectory()){let r=readdirSync(e);if(!a&&r.length)throw d(Object.assign(Error(),{code:5}),`rm`,e);for(let e of r)rmSync(h(n,e),t)}try{i.delete(null)}catch(t){if(s&&f(t))return;throw d(t,`rm`,e)}}export{accessSync,appendFileSync,chmodSync,chownSync,copyFileSync,_ as existsSync,linkSync,lstatSync,mkdirSync,mkdtempSync,openSync,readFileSync,readdirSync,readlinkSync,realpathSync,renameSync,rmSync,rmdirSync,statSync,symlinkSync,truncateSync,unlinkSync,watch,writeFileSync};
@@ -1,4 +1,4 @@
1
- import { PathLike, OpenMode, Mode, ReadPosition, ReadAsyncOptions, NoParamCallback, RmOptions, RmDirOptions, MakeDirectoryOptions } from 'node:fs';
1
+ import type { PathLike, OpenMode, Mode, ReadPosition, ReadAsyncOptions, NoParamCallback, RmOptions, RmDirOptions, MakeDirectoryOptions } from 'node:fs';
2
2
  import { Buffer } from 'node:buffer';
3
3
  import { Stats, BigIntStats } from './stats.js';
4
4
  export declare function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
@@ -1,6 +1,6 @@
1
1
  import { Buffer } from 'node:buffer';
2
2
  import type { ReadOptions } from './types/index.js';
3
3
  import type { ObjectEncodingOptions, BufferEncodingOption } from 'node:fs';
4
- export declare function getEncodingFromOptions(options?: ReadOptions | ObjectEncodingOptions | BufferEncodingOption, defaultEncoding?: null | BufferEncoding | "buffer"): BufferEncoding | 'buffer';
4
+ export declare function getEncodingFromOptions(options?: ReadOptions | ObjectEncodingOptions | BufferEncodingOption, defaultEncoding?: null | BufferEncoding | 'buffer'): BufferEncoding | 'buffer';
5
5
  export declare function encodeUint8Array(encoding: BufferEncoding | 'buffer', data: Uint8Array): string | Buffer<ArrayBuffer>;
6
6
  export declare function decode(str: string, encoding?: string): string;
@@ -1,4 +1,4 @@
1
- import { Stats, BigIntStats } from './stats.js';
1
+ import type { Stats, BigIntStats } from './stats.js';
2
2
  import type { PathLike, TimeLike, StatOptions } from 'node:fs';
3
3
  export declare function fstatSync(fd: number, options?: {
4
4
  bigint?: false;
@@ -1,8 +1,8 @@
1
- import { ReadStream } from "./read-stream.js";
2
- import { WriteStream } from "./write-stream.js";
3
- import { Stats, BigIntStats } from "./stats.js";
4
- import type { ReadableStream } from "node:stream/web";
5
- import { Buffer } from "node:buffer";
1
+ import { ReadStream } from './read-stream.js';
2
+ import { WriteStream } from './write-stream.js';
3
+ import { Stats, BigIntStats } from './stats.js';
4
+ import type { ReadableStream } from 'node:stream/web';
5
+ import { Buffer } from 'node:buffer';
6
6
  import type { Abortable } from 'node:events';
7
7
  import type { FlagAndOpenMode, FileReadResult, FileReadOptions, OpenFlags } from './types/index.js';
8
8
  import type { FileHandle as IFileHandle, CreateReadStreamOptions, CreateWriteStreamOptions } from 'node:fs/promises';
@@ -1,5 +1,6 @@
1
1
  import { cpAsync } from './cp.js';
2
- import { opendirAsync, Dir } from './dir.js';
2
+ import type { Dir } from './dir.js';
3
+ import { opendirAsync } from './dir.js';
3
4
  import { globAsync } from './glob.js';
4
5
  import { watchAsync } from './fs-watcher.js';
5
6
  import { statfsAsync } from './statfs.js';
@@ -1,5 +1,5 @@
1
- import { Buffer } from "node:buffer";
2
- import { Readable } from "node:stream";
1
+ import { Buffer } from 'node:buffer';
2
+ import { Readable } from 'node:stream';
3
3
  import type { CreateReadStreamOptions } from 'node:fs/promises';
4
4
  import type { PathLike, ReadStream as IReadStream } from 'node:fs';
5
5
  export declare class ReadStream extends Readable implements IReadStream {
@@ -58,7 +58,7 @@ export declare function writeFileSync(path: PathLike, data: string | Uint8Array)
58
58
  export declare function renameSync(oldPath: PathLike, newPath: PathLike): void;
59
59
  export declare function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void;
60
60
  export declare function accessSync(path: PathLike, mode?: number): void;
61
- export declare function appendFileSync(path: PathLike, data: string | Uint8Array, options?: {
61
+ export declare function appendFileSync(path: PathLike, data: string | Uint8Array, _options?: {
62
62
  encoding?: string;
63
63
  mode?: number;
64
64
  flag?: string;
@@ -1 +1 @@
1
- export type OpenFlags = "a" | "ax" | "a+" | "ax+" | "as" | "as+" | "r" | "r+" | "rs+" | "w" | "wx" | "w+" | "wx+";
1
+ export type OpenFlags = 'a' | 'ax' | 'a+' | 'ax+' | 'as' | 'as+' | 'r' | 'r+' | 'rs+' | 'w' | 'wx' | 'w+' | 'wx+';
@@ -1,4 +1,4 @@
1
- import { Writable } from "node:stream";
1
+ import { Writable } from 'node:stream';
2
2
  import type { OpenFlags } from './types/index.js';
3
3
  import type { PathLike, WriteStream as IWriteStream } from 'node:fs';
4
4
  import type { CreateWriteStreamOptions } from 'node:fs/promises';
@@ -12,23 +12,23 @@ export declare class WriteStream extends Writable implements IWriteStream {
12
12
  */
13
13
  close(callback?: (err?: NodeJS.ErrnoException | null) => void, err?: Error | null): void;
14
14
  /**
15
- * The number of bytes written so far. Does not include data that is still queued
16
- * for writing.
17
- * @since v0.4.7
18
- */
15
+ * The number of bytes written so far. Does not include data that is still queued
16
+ * for writing.
17
+ * @since v0.4.7
18
+ */
19
19
  bytesWritten: number;
20
20
  /**
21
- * The path to the file the stream is writing to as specified in the first
22
- * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a
23
- * `Buffer`.
24
- * @since v0.1.93
25
- */
21
+ * The path to the file the stream is writing to as specified in the first
22
+ * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a
23
+ * `Buffer`.
24
+ * @since v0.1.93
25
+ */
26
26
  path: string | Buffer;
27
27
  /**
28
- * This property is `true` if the underlying file has not been opened yet,
29
- * i.e. before the `'ready'` event is emitted.
30
- * @since v11.2.0
31
- */
28
+ * This property is `true` if the underlying file has not been opened yet,
29
+ * i.e. before the `'ready'` event is emitted.
30
+ * @since v11.2.0
31
+ */
32
32
  pending: boolean;
33
33
  fd: number | null;
34
34
  flags: OpenFlags;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/fs",
3
- "version": "0.4.28",
3
+ "version": "0.4.30",
4
4
  "description": "Node.js fs module for Gjs",
5
5
  "module": "lib/esm/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -37,18 +37,18 @@
37
37
  "fs"
38
38
  ],
39
39
  "devDependencies": {
40
- "@gjsify/cli": "^0.4.28",
41
- "@gjsify/unit": "^0.4.28",
40
+ "@gjsify/cli": "^0.4.30",
41
+ "@gjsify/unit": "^0.4.30",
42
42
  "@types/node": "^25.9.1",
43
43
  "typescript": "^6.0.3"
44
44
  },
45
45
  "dependencies": {
46
46
  "@girs/gio-2.0": "2.88.0-4.0.1",
47
47
  "@girs/glib-2.0": "2.88.0-4.0.1",
48
- "@gjsify/buffer": "^0.4.28",
49
- "@gjsify/events": "^0.4.28",
50
- "@gjsify/stream": "^0.4.28",
51
- "@gjsify/url": "^0.4.28",
52
- "@gjsify/utils": "^0.4.28"
48
+ "@gjsify/buffer": "^0.4.30",
49
+ "@gjsify/events": "^0.4.30",
50
+ "@gjsify/stream": "^0.4.30",
51
+ "@gjsify/url": "^0.4.30",
52
+ "@gjsify/utils": "^0.4.30"
53
53
  }
54
54
  }