yavascript 0.0.13 → 0.14.1

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/yavascript.d.ts CHANGED
@@ -792,6 +792,20 @@ declare class Path {
792
792
  * @param replacement - The new final segment(s) for the returned Path
793
793
  */
794
794
  replaceLast(replacement: string | Path | Array<string | Path>): Path;
795
+
796
+ /**
797
+ * Return a boolean indicating whether this Path has the same separator and
798
+ * segments as another Path.
799
+ *
800
+ * To check only segments and not separator, use {@link Path.prototype.hasEqualSegments}.
801
+ */
802
+ equals(other: string | Path | Array<string | Path>): boolean;
803
+
804
+ /**
805
+ * Return a boolean indicating whether this Path has the same segments as
806
+ * another Path. **Separator is not checked; use {@link Path.prototype.equals} for that.**
807
+ */
808
+ hasEqualSegments(other: string | Path | Array<string | Path>): boolean;
795
809
  }
796
810
 
797
811
  /**
@@ -949,9 +963,11 @@ interface Chmod {
949
963
  * { all: "full" }
950
964
  * ```
951
965
  */
952
- (
953
- operation: Chmod.Operation,
954
- permissions: Record<Chmod.Who, Chmod.Permission>,
966
+ <Operation extends Chmod.Operation>(
967
+ operation: Operation,
968
+ permissions: Operation extends "set"
969
+ ? Record<Chmod.Who, Chmod.Permission>
970
+ : Partial<Record<Chmod.Who, Chmod.Permission>>,
955
971
  path: string | Path
956
972
  ): void;
957
973
  }
@@ -1515,7 +1531,8 @@ declare interface ChildProcess {
1515
1531
  err: FILE;
1516
1532
  };
1517
1533
 
1518
- pid: number | null;
1534
+ get state(): ChildProcessState;
1535
+ get pid(): number | null;
1519
1536
 
1520
1537
  /** Spawns the process and returns its pid (process id). */
1521
1538
  start(): number;
@@ -1526,6 +1543,33 @@ declare interface ChildProcess {
1526
1543
  | { status: undefined; signal: number };
1527
1544
  }
1528
1545
 
1546
+ declare type ChildProcessState =
1547
+ | {
1548
+ id: "UNSTARTED";
1549
+ }
1550
+ | {
1551
+ id: "STARTED";
1552
+ pid: number;
1553
+ }
1554
+ | {
1555
+ id: "STOPPED";
1556
+ pid: number;
1557
+ }
1558
+ | {
1559
+ id: "CONTINUED";
1560
+ pid: number;
1561
+ }
1562
+ | {
1563
+ id: "EXITED";
1564
+ oldPid: number;
1565
+ status: number;
1566
+ }
1567
+ | {
1568
+ id: "SIGNALED";
1569
+ oldPid: number;
1570
+ signal: number;
1571
+ };
1572
+
1529
1573
  /**
1530
1574
  * Options to be passed to the ChildProcess constructor. Their purposes and
1531
1575
  * types match the same-named properties found on the resulting ChildProcess.