es-git 0.5.0-next.166 → 0.5.0-next.168

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.
Files changed (3) hide show
  1. package/index.d.ts +94 -0
  2. package/index.js +4 -0
  3. package/package.json +11 -11
package/index.d.ts CHANGED
@@ -2640,6 +2640,43 @@ export declare class Repository {
2640
2640
  * @returns An Annotated Commit created from `FETCH_HEAD`.
2641
2641
  */
2642
2642
  getAnnotatedCommitFromFetchHead(branchName: string, remoteUrl: string, id: string): AnnotatedCommit
2643
+ /**
2644
+ * Apply a Diff to the given repo, making changes directly in the working directory, the index, or both.
2645
+ *
2646
+ * @category Repository/Methods
2647
+ * ```ts
2648
+ * class Repository {
2649
+ * apply(diff: Diff, location: ApplyLocation, options?: ApplyOptions | null | undefined): void;
2650
+ * }
2651
+ * ```
2652
+ *
2653
+ * @param {Diff} diff - The diff to apply
2654
+ * @param {ApplyLocation} location - The location to apply
2655
+ * @param {ApplyOptions} [options] - The options for the apply
2656
+ */
2657
+ apply(diff: Diff, location: ApplyLocation, options?: ApplyOptions | undefined | null): void
2658
+ /**
2659
+ * Apply a Diff to the provided tree, and return the resulting Index.
2660
+ *
2661
+ * @category Repository/Methods
2662
+ * @signature
2663
+ * ```ts
2664
+ * class Repository {
2665
+ * applyToTree(
2666
+ * tree: Tree,
2667
+ * diff: Diff,
2668
+ * options?: ApplyOptions | null | undefined
2669
+ * ): Index;
2670
+ * }
2671
+ * ```
2672
+ *
2673
+ * @param {Tree} tree - The tree to apply the diff to
2674
+ * @param {Diff} diff - The diff to apply
2675
+ * @param {ApplyOptions} [options] - The options for the apply
2676
+ *
2677
+ * @returns The postimage of the application
2678
+ */
2679
+ applyToTree(tree: Tree, diff: Diff, options?: ApplyOptions | undefined | null): Index
2643
2680
  /**
2644
2681
  * Creates a blame object for the file at the given path
2645
2682
  *
@@ -5673,6 +5710,23 @@ export interface AmendOptions {
5673
5710
  messageEncoding?: string
5674
5711
  }
5675
5712
 
5713
+ /**
5714
+ * Possible application locations for git_apply
5715
+ * see <https://libgit2.org/libgit2/#HEAD/type/git_apply_options>
5716
+ */
5717
+ export type ApplyLocation = /** Apply the patch to the workdir */
5718
+ 'WorkDir'|
5719
+ /** Apply the patch to the index */
5720
+ 'Index'|
5721
+ /** Apply the patch to both the working directory and the index */
5722
+ 'Both';
5723
+
5724
+ /** Options to specify when applying a diff */
5725
+ export interface ApplyOptions {
5726
+ /** Don't actually make changes, just test that the patch applies. */
5727
+ check?: boolean
5728
+ }
5729
+
5676
5730
  /**
5677
5731
  * - `Unspecified` : Use the setting from the remote's configuration
5678
5732
  * - `Auto` : Ask the server for tags pointing to objects we're already downloading
@@ -7974,6 +8028,46 @@ export type StatusShow = 'Index'|
7974
8028
  'Workdir'|
7975
8029
  'IndexAndWorkdir';
7976
8030
 
8031
+ /**
8032
+ * Clear the global subscriber
8033
+ *
8034
+ * @category Tracing
8035
+ * @signature
8036
+ * ```ts
8037
+ * function traceClear(): void;
8038
+ * ```
8039
+ */
8040
+ export declare function traceClear(): void
8041
+
8042
+ /**
8043
+ * Available tracing levels. When tracing is set to a particular level,
8044
+ * callers will be provided tracing at the given level and all lower levels.
8045
+ */
8046
+ export type TraceLevel = 'None'|
8047
+ 'Fatal'|
8048
+ 'Error'|
8049
+ 'Warn'|
8050
+ 'Info'|
8051
+ 'Debug'|
8052
+ 'Trace';
8053
+
8054
+ /**
8055
+ * Set the global subscriber called when libgit2 produces a tracing message.
8056
+ *
8057
+ * @category Tracing
8058
+ * @signature
8059
+ * ```ts
8060
+ * function traceSet(
8061
+ * level: TraceLevel,
8062
+ * callback: (level: TraceLevel, message: string) => void,
8063
+ * ): void;
8064
+ * ```
8065
+ *
8066
+ * @param {TraceLevel} level - Level to set tracing to
8067
+ * @param {(level: TraceLevel, message: string) => void} callback - Callback to call with trace data
8068
+ */
8069
+ export declare function traceSet(level: TraceLevel, callback: (level: TraceLevel, message: string) => void): void
8070
+
7977
8071
  /**
7978
8072
  * - `PreOrder` : Runs the traversal in pre-order.
7979
8073
  * - `PostOrder` : Runs the traversal in post-order.
package/index.js CHANGED
@@ -609,6 +609,7 @@ module.exports.Tag = nativeBinding.Tag
609
609
  module.exports.Tree = nativeBinding.Tree
610
610
  module.exports.TreeEntry = nativeBinding.TreeEntry
611
611
  module.exports.TreeIter = nativeBinding.TreeIter
612
+ module.exports.ApplyLocation = nativeBinding.ApplyLocation
612
613
  module.exports.AutotagOption = nativeBinding.AutotagOption
613
614
  module.exports.BranchType = nativeBinding.BranchType
614
615
  module.exports.cloneRepository = nativeBinding.cloneRepository
@@ -655,5 +656,8 @@ module.exports.RevparseMode = nativeBinding.RevparseMode
655
656
  module.exports.revparseModeContains = nativeBinding.revparseModeContains
656
657
  module.exports.RevwalkSort = nativeBinding.RevwalkSort
657
658
  module.exports.StatusShow = nativeBinding.StatusShow
659
+ module.exports.traceClear = nativeBinding.traceClear
660
+ module.exports.TraceLevel = nativeBinding.TraceLevel
661
+ module.exports.traceSet = nativeBinding.traceSet
658
662
  module.exports.TreeWalkMode = nativeBinding.TreeWalkMode
659
663
  module.exports.zeroOid = nativeBinding.zeroOid
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-git",
3
- "version": "0.5.0-next.166+44a2a2d",
3
+ "version": "0.5.0-next.168+bf33892",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "files": [
@@ -54,15 +54,15 @@
54
54
  "vitest": "^3.0.5"
55
55
  },
56
56
  "optionalDependencies": {
57
- "es-git-darwin-x64": "0.5.0-next.166+44a2a2d",
58
- "es-git-darwin-arm64": "0.5.0-next.166+44a2a2d",
59
- "es-git-win32-x64-msvc": "0.5.0-next.166+44a2a2d",
60
- "es-git-win32-arm64-msvc": "0.5.0-next.166+44a2a2d",
61
- "es-git-linux-x64-gnu": "0.5.0-next.166+44a2a2d",
62
- "es-git-linux-x64-musl": "0.5.0-next.166+44a2a2d",
63
- "es-git-android-arm64": "0.5.0-next.166+44a2a2d",
64
- "es-git-linux-arm64-gnu": "0.5.0-next.166+44a2a2d",
65
- "es-git-linux-arm64-musl": "0.5.0-next.166+44a2a2d",
66
- "es-git-android-arm-eabi": "0.5.0-next.166+44a2a2d"
57
+ "es-git-darwin-x64": "0.5.0-next.168+bf33892",
58
+ "es-git-darwin-arm64": "0.5.0-next.168+bf33892",
59
+ "es-git-win32-x64-msvc": "0.5.0-next.168+bf33892",
60
+ "es-git-win32-arm64-msvc": "0.5.0-next.168+bf33892",
61
+ "es-git-linux-x64-gnu": "0.5.0-next.168+bf33892",
62
+ "es-git-linux-x64-musl": "0.5.0-next.168+bf33892",
63
+ "es-git-android-arm64": "0.5.0-next.168+bf33892",
64
+ "es-git-linux-arm64-gnu": "0.5.0-next.168+bf33892",
65
+ "es-git-linux-arm64-musl": "0.5.0-next.168+bf33892",
66
+ "es-git-android-arm-eabi": "0.5.0-next.168+bf33892"
67
67
  }
68
68
  }