@shopify/cli-kit 0.33.6 → 1.0.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/dist/index.d.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  /// <reference types="node" />
2
2
  import { EventEmitter } from 'events';
3
3
  import { Readable } from 'stream';
4
- import { Writable } from 'node:stream';
4
+ import { ChildProcess } from 'node:child_process';
5
+ import { Readable as Readable$1, Writable } from 'node:stream';
5
6
  import path$1 from 'path';
6
7
  import * as fs from 'fs';
8
+ import { SpawnOptions } from 'child_process';
7
9
  import { platform } from 'node:process';
8
10
  import { RequestOptions } from 'http';
9
11
 
@@ -1461,6 +1463,180 @@ declare namespace error$1 {
1461
1463
  };
1462
1464
  }
1463
1465
 
1466
+ interface ExecaReturnBase<StdoutStderrType> {
1467
+ /**
1468
+ The file and arguments that were run, for logging purposes.
1469
+
1470
+ This is not escaped and should not be executed directly as a process, including using `execa()` or `execaCommand()`.
1471
+ */
1472
+ command: string;
1473
+
1474
+ /**
1475
+ Same as `command` but escaped.
1476
+
1477
+ This is meant to be copy and pasted into a shell, for debugging purposes.
1478
+ Since the escaping is fairly basic, this should not be executed directly as a process, including using `execa()` or `execaCommand()`.
1479
+ */
1480
+ escapedCommand: string;
1481
+
1482
+ /**
1483
+ The numeric exit code of the process that was run.
1484
+ */
1485
+ exitCode: number;
1486
+
1487
+ /**
1488
+ The output of the process on stdout.
1489
+ */
1490
+ stdout: StdoutStderrType;
1491
+
1492
+ /**
1493
+ The output of the process on stderr.
1494
+ */
1495
+ stderr: StdoutStderrType;
1496
+
1497
+ /**
1498
+ Whether the process failed to run.
1499
+ */
1500
+ failed: boolean;
1501
+
1502
+ /**
1503
+ Whether the process timed out.
1504
+ */
1505
+ timedOut: boolean;
1506
+
1507
+ /**
1508
+ Whether the process was killed.
1509
+ */
1510
+ killed: boolean;
1511
+
1512
+ /**
1513
+ The name of the signal that was used to terminate the process. For example, `SIGFPE`.
1514
+
1515
+ If a signal terminated the process, this property is defined and included in the error message. Otherwise it is `undefined`.
1516
+ */
1517
+ signal?: string;
1518
+
1519
+ /**
1520
+ A human-friendly description of the signal that was used to terminate the process. For example, `Floating point arithmetic error`.
1521
+
1522
+ If a signal terminated the process, this property is defined and included in the error message. Otherwise it is `undefined`. It is also `undefined` when the signal is very uncommon which should seldomly happen.
1523
+ */
1524
+ signalDescription?: string;
1525
+ }
1526
+
1527
+ interface ExecaSyncReturnValue<StdoutErrorType = string>
1528
+ extends ExecaReturnBase<StdoutErrorType> {
1529
+ }
1530
+
1531
+ /**
1532
+ Result of a child process execution. On success this is a plain object. On failure this is also an `Error` instance.
1533
+
1534
+ The child process fails when:
1535
+ - its exit code is not `0`
1536
+ - it was killed with a signal
1537
+ - timing out
1538
+ - being canceled
1539
+ - there's not enough memory or there are already too many child processes
1540
+ */
1541
+ interface ExecaReturnValue<StdoutErrorType = string>
1542
+ extends ExecaSyncReturnValue<StdoutErrorType> {
1543
+ /**
1544
+ The output of the process with `stdout` and `stderr` interleaved.
1545
+
1546
+ This is `undefined` if either:
1547
+ - the `all` option is `false` (default value)
1548
+ - `execaSync()` was used
1549
+ */
1550
+ all?: StdoutErrorType;
1551
+
1552
+ /**
1553
+ Whether the process was canceled.
1554
+
1555
+ You can cancel the spawned process using the [`signal`](https://github.com/sindresorhus/execa#signal-1) option.
1556
+ */
1557
+ isCanceled: boolean;
1558
+ }
1559
+
1560
+ interface ExecaSyncError<StdoutErrorType = string>
1561
+ extends Error,
1562
+ ExecaReturnBase<StdoutErrorType> {
1563
+ /**
1564
+ Error message when the child process failed to run. In addition to the underlying error message, it also contains some information related to why the child process errored.
1565
+
1566
+ The child process stderr then stdout are appended to the end, separated with newlines and not interleaved.
1567
+ */
1568
+ message: string;
1569
+
1570
+ /**
1571
+ This is the same as the `message` property except it does not include the child process stdout/stderr.
1572
+ */
1573
+ shortMessage: string;
1574
+
1575
+ /**
1576
+ Original error message. This is the same as the `message` property except it includes neither the child process stdout/stderr nor some additional information added by Execa.
1577
+
1578
+ This is `undefined` unless the child process exited due to an `error` event or a timeout.
1579
+ */
1580
+ originalMessage?: string;
1581
+ }
1582
+
1583
+ interface ExecaError<StdoutErrorType = string>
1584
+ extends ExecaSyncError<StdoutErrorType> {
1585
+ /**
1586
+ The output of the process with `stdout` and `stderr` interleaved.
1587
+
1588
+ This is `undefined` if either:
1589
+ - the `all` option is `false` (default value)
1590
+ - `execaSync()` was used
1591
+ */
1592
+ all?: StdoutErrorType;
1593
+
1594
+ /**
1595
+ Whether the process was canceled.
1596
+ */
1597
+ isCanceled: boolean;
1598
+ }
1599
+
1600
+ interface KillOptions {
1601
+ /**
1602
+ Milliseconds to wait for the child process to terminate before sending `SIGKILL`.
1603
+
1604
+ Can be disabled with `false`.
1605
+
1606
+ @default 5000
1607
+ */
1608
+ forceKillAfterTimeout?: number | false;
1609
+ }
1610
+
1611
+ interface ExecaChildPromise<StdoutErrorType> {
1612
+ /**
1613
+ Stream combining/interleaving [`stdout`](https://nodejs.org/api/child_process.html#child_process_subprocess_stdout) and [`stderr`](https://nodejs.org/api/child_process.html#child_process_subprocess_stderr).
1614
+
1615
+ This is `undefined` if either:
1616
+ - the `all` option is `false` (the default value)
1617
+ - both `stdout` and `stderr` options are set to [`'inherit'`, `'ipc'`, `Stream` or `integer`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio)
1618
+ */
1619
+ all?: Readable$1;
1620
+
1621
+ catch<ResultType = never>(
1622
+ onRejected?: (reason: ExecaError<StdoutErrorType>) => ResultType | PromiseLike<ResultType>
1623
+ ): Promise<ExecaReturnValue<StdoutErrorType> | ResultType>;
1624
+
1625
+ /**
1626
+ Same as the original [`child_process#kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal), except if `signal` is `SIGTERM` (the default value) and the child process is not terminated after 5 seconds, force it by sending `SIGKILL`.
1627
+ */
1628
+ kill(signal?: string, options?: KillOptions): void;
1629
+
1630
+ /**
1631
+ Similar to [`childProcess.kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal). This is preferred when cancelling the child process execution as the error is more descriptive and [`childProcessResult.isCanceled`](#iscanceled) is set to `true`.
1632
+ */
1633
+ cancel(): void;
1634
+ }
1635
+
1636
+ type ExecaChildProcess<StdoutErrorType = string> = ChildProcess &
1637
+ ExecaChildPromise<StdoutErrorType> &
1638
+ Promise<ExecaReturnValue<StdoutErrorType>>;
1639
+
1464
1640
  interface ExecOptions {
1465
1641
  cwd?: string;
1466
1642
  stdout?: Writable;
@@ -1474,7 +1650,7 @@ declare const open: (url: string) => Promise<void>;
1474
1650
  * @returns A promise that resolves with the aggregatted stdout of the command.
1475
1651
  */
1476
1652
  declare const captureOutput: (command: string, args: string[]) => Promise<string>;
1477
- declare const exec: (command: string, args: string[], options?: ExecOptions | undefined) => Promise<void>;
1653
+ declare const exec: (command: string, args: string[], options?: ExecOptions | undefined) => ExecaChildProcess<string>;
1478
1654
 
1479
1655
  type system_ExecOptions = ExecOptions;
1480
1656
  declare const system_open: typeof open;
@@ -1510,18 +1686,18 @@ declare namespace template {
1510
1686
  };
1511
1687
  }
1512
1688
 
1513
- interface Options$4 {
1689
+ interface Options$5 {
1514
1690
  splitRegexp?: RegExp | RegExp[];
1515
1691
  stripRegexp?: RegExp | RegExp[];
1516
1692
  delimiter?: string;
1517
1693
  transform?: (part: string, index: number, parts: string[]) => string;
1518
1694
  }
1519
1695
 
1520
- declare function camelCase(input: string, options?: Options$4): string;
1696
+ declare function camelCase(input: string, options?: Options$5): string;
1521
1697
 
1522
- declare function paramCase(input: string, options?: Options$4): string;
1698
+ declare function paramCase(input: string, options?: Options$5): string;
1523
1699
 
1524
- declare function snakeCase(input: string, options?: Options$4): string;
1700
+ declare function snakeCase(input: string, options?: Options$5): string;
1525
1701
 
1526
1702
  /** Returns a random string */
1527
1703
  declare function randomHex(size: number): string;
@@ -1557,7 +1733,7 @@ declare const format: typeof path$1.format;
1557
1733
  declare const basename: typeof path$1.basename;
1558
1734
  declare const parse: typeof path$1.parse;
1559
1735
 
1560
- interface Options$3 {
1736
+ interface Options$4 {
1561
1737
  /**
1562
1738
  The current working directory.
1563
1739
 
@@ -1590,7 +1766,7 @@ declare const findUpStop: unique symbol;
1590
1766
 
1591
1767
  type Match = string | typeof findUpStop | undefined;
1592
1768
 
1593
- interface Options$2 extends Options$3 {
1769
+ interface Options$3 extends Options$4 {
1594
1770
  /**
1595
1771
  The path to the directory to stop the search before reaching root if there were no matches before the `stopAt` directory.
1596
1772
 
@@ -1626,7 +1802,7 @@ console.log(await findUp(['rainbow.png', 'unicorn.png']));
1626
1802
  //=> '/Users/sindresorhus/unicorn.png'
1627
1803
  ```
1628
1804
  */
1629
- declare function findUp(name: string | readonly string[], options?: Options$2): Promise<string | undefined>;
1805
+ declare function findUp(name: string | readonly string[], options?: Options$3): Promise<string | undefined>;
1630
1806
 
1631
1807
  /**
1632
1808
  Find a file or directory by walking up parent directories.
@@ -1646,7 +1822,7 @@ console.log(await findUp(async directory => {
1646
1822
  //=> '/Users/sindresorhus'
1647
1823
  ```
1648
1824
  */
1649
- declare function findUp(matcher: (directory: string) => (Match | Promise<Match>), options?: Options$2): Promise<string | undefined>;
1825
+ declare function findUp(matcher: (directory: string) => (Match | Promise<Match>), options?: Options$3): Promise<string | undefined>;
1650
1826
 
1651
1827
  declare type ErrnoException$1 = NodeJS.ErrnoException;
1652
1828
 
@@ -1701,7 +1877,7 @@ declare type Entry = Entry$1;
1701
1877
  declare type Pattern = string;
1702
1878
  declare type FileSystemAdapter = FileSystemAdapter$1;
1703
1879
 
1704
- declare type Options$1 = {
1880
+ declare type Options$2 = {
1705
1881
  /**
1706
1882
  * Return the absolute path for entries.
1707
1883
  *
@@ -1846,25 +2022,25 @@ declare type Task = {
1846
2022
  };
1847
2023
 
1848
2024
  declare type EntryObjectModePredicate = {
1849
- [TKey in keyof Pick<Options$1, 'objectMode'>]-?: true;
2025
+ [TKey in keyof Pick<Options$2, 'objectMode'>]-?: true;
1850
2026
  };
1851
2027
  declare type EntryStatsPredicate = {
1852
- [TKey in keyof Pick<Options$1, 'stats'>]-?: true;
2028
+ [TKey in keyof Pick<Options$2, 'stats'>]-?: true;
1853
2029
  };
1854
2030
  declare type EntryObjectPredicate = EntryObjectModePredicate | EntryStatsPredicate;
1855
- declare function FastGlob(source: Pattern | Pattern[], options: Options$1 & EntryObjectPredicate): Promise<Entry[]>;
1856
- declare function FastGlob(source: Pattern | Pattern[], options?: Options$1): Promise<string[]>;
2031
+ declare function FastGlob(source: Pattern | Pattern[], options: Options$2 & EntryObjectPredicate): Promise<Entry[]>;
2032
+ declare function FastGlob(source: Pattern | Pattern[], options?: Options$2): Promise<string[]>;
1857
2033
  declare namespace FastGlob {
1858
- type Options = Options$1;
2034
+ type Options = Options$2;
1859
2035
  type Entry = Entry;
1860
2036
  type Task = Task;
1861
2037
  type Pattern = Pattern;
1862
2038
  type FileSystemAdapter = FileSystemAdapter;
1863
- function sync(source: Pattern | Pattern[], options: Options$1 & EntryObjectPredicate): Entry[];
1864
- function sync(source: Pattern | Pattern[], options?: Options$1): string[];
1865
- function stream(source: Pattern | Pattern[], options?: Options$1): NodeJS.ReadableStream;
1866
- function generateTasks(source: Pattern | Pattern[], options?: Options$1): Task[];
1867
- function isDynamicPattern(source: Pattern, options?: Options$1): boolean;
2039
+ function sync(source: Pattern | Pattern[], options: Options$2 & EntryObjectPredicate): Entry[];
2040
+ function sync(source: Pattern | Pattern[], options?: Options$2): string[];
2041
+ function stream(source: Pattern | Pattern[], options?: Options$2): NodeJS.ReadableStream;
2042
+ function generateTasks(source: Pattern | Pattern[], options?: Options$2): Task[];
2043
+ function isDynamicPattern(source: Pattern, options?: Options$2): boolean;
1868
2044
  function escapePath(source: Pattern): Pattern;
1869
2045
  }
1870
2046
 
@@ -1925,7 +2101,10 @@ declare function copy(from: string, to: string): Promise<void>;
1925
2101
  declare function write(path: string, data: string): Promise<void>;
1926
2102
  declare function append(path: string, data: string): Promise<void>;
1927
2103
  declare function mkdir(path: string): Promise<void>;
1928
- declare function rmdir(path: string): Promise<void>;
2104
+ declare function remove(path: string): Promise<void>;
2105
+ declare function rmdir(path: string, { force }?: {
2106
+ force?: boolean;
2107
+ }): Promise<void>;
1929
2108
  declare function mkTmpDir(): Promise<string>;
1930
2109
  declare function isDirectory(path: string): Promise<boolean>;
1931
2110
  /**
@@ -1961,6 +2140,7 @@ declare const file_copy: typeof copy;
1961
2140
  declare const file_write: typeof write;
1962
2141
  declare const file_append: typeof append;
1963
2142
  declare const file_mkdir: typeof mkdir;
2143
+ declare const file_remove: typeof remove;
1964
2144
  declare const file_rmdir: typeof rmdir;
1965
2145
  declare const file_mkTmpDir: typeof mkTmpDir;
1966
2146
  declare const file_isDirectory: typeof isDirectory;
@@ -1976,6 +2156,7 @@ declare namespace file {
1976
2156
  file_write as write,
1977
2157
  file_append as append,
1978
2158
  file_mkdir as mkdir,
2159
+ file_remove as remove,
1979
2160
  file_rmdir as rmdir,
1980
2161
  file_mkTmpDir as mkTmpDir,
1981
2162
  file_isDirectory as isDirectory,
@@ -1986,10 +2167,1413 @@ declare namespace file {
1986
2167
  };
1987
2168
  }
1988
2169
 
2170
+ declare const EMPTY_COMMANDS: [];
2171
+ declare type EmptyTask = {
2172
+ commands: typeof EMPTY_COMMANDS;
2173
+ format: 'empty';
2174
+ parser: EmptyTaskParser;
2175
+ onError?: undefined;
2176
+ };
2177
+
2178
+ declare type TaskResponseFormat = Buffer | string;
2179
+ interface TaskParser<INPUT extends TaskResponseFormat, RESPONSE> {
2180
+ (stdOut: INPUT, stdErr: INPUT): RESPONSE;
2181
+ }
2182
+ interface EmptyTaskParser {
2183
+ (executor: SimpleGitExecutor): void;
2184
+ }
2185
+ interface SimpleGitTaskConfiguration<RESPONSE, FORMAT, INPUT extends TaskResponseFormat> {
2186
+ commands: string[];
2187
+ format: FORMAT;
2188
+ parser: TaskParser<INPUT, RESPONSE>;
2189
+ onError?: (result: GitExecutorResult, error: Error, done: (result: Buffer | Buffer[]) => void, fail: (error: string | Error) => void) => void;
2190
+ }
2191
+ declare type StringTask<R> = SimpleGitTaskConfiguration<R, 'utf-8', string>;
2192
+ declare type BufferTask<R> = SimpleGitTaskConfiguration<R, 'buffer', Buffer>;
2193
+ declare type RunnableTask<R> = StringTask<R> | BufferTask<R>;
2194
+ declare type SimpleGitTask<R> = RunnableTask<R> | EmptyTask;
2195
+
2196
+ /**
2197
+ * The `GitError` is thrown when the underlying `git` process throws a
2198
+ * fatal exception (eg an `ENOENT` exception when attempting to use a
2199
+ * non-writable directory as the root for your repo), and acts as the
2200
+ * base class for more specific errors thrown by the parsing of the
2201
+ * git response or errors in the configuration of the task about to
2202
+ * be run.
2203
+ *
2204
+ * When an exception is thrown, pending tasks in the same instance will
2205
+ * not be executed. The recommended way to run a series of tasks that
2206
+ * can independently fail without needing to prevent future tasks from
2207
+ * running is to catch them individually:
2208
+ *
2209
+ * ```typescript
2210
+ import { gitP, SimpleGit, GitError, PullResult } from 'simple-git';
2211
+
2212
+ function catchTask (e: GitError) {
2213
+ return e.
2214
+ }
2215
+
2216
+ const git = gitP(repoWorkingDir);
2217
+ const pulled: PullResult | GitError = await git.pull().catch(catchTask);
2218
+ const pushed: string | GitError = await git.pushTags().catch(catchTask);
2219
+ ```
2220
+ */
2221
+ declare class GitError extends Error {
2222
+ task?: EmptyTask | StringTask<any> | BufferTask<any> | undefined;
2223
+ constructor(task?: EmptyTask | StringTask<any> | BufferTask<any> | undefined, message?: string);
2224
+ }
2225
+
2226
+ /**
2227
+ * The node-style callback to a task accepts either two arguments with the first as a null
2228
+ * and the second as the data, or just one argument which is an error.
2229
+ */
2230
+ declare type SimpleGitTaskCallback<T = string, E extends GitError = GitError> = (err: E | null, data: T) => void;
2231
+ /**
2232
+ * The event data emitted to the progress handler whenever progress detail is received.
2233
+ */
2234
+ interface SimpleGitProgressEvent {
2235
+ /** The underlying method called - push, pull etc */
2236
+ method: string;
2237
+ /** The type of progress being reported, note that any one task may emit many stages - for example `git clone` emits both `receiving` and `resolving` */
2238
+ stage: 'compressing' | 'counting' | 'receiving' | 'resolving' | 'unknown' | 'writing' | string;
2239
+ /** The percent progressed as a number 0 - 100 */
2240
+ progress: number;
2241
+ /** The number of items processed so far */
2242
+ processed: number;
2243
+ /** The total number of items to be processed */
2244
+ total: number;
2245
+ }
2246
+
2247
+ /**
2248
+ * Most tasks accept custom options as an array of strings as well as the
2249
+ * options object. Unless the task is explicitly documented as such, the
2250
+ * tasks will not accept both formats at the same time, preferring whichever
2251
+ * appears last in the arguments.
2252
+ */
2253
+ declare type TaskOptions<O extends Options$1 = Options$1> = string[] | O;
2254
+ /**
2255
+ * Options supplied in most tasks as an optional trailing object
2256
+ */
2257
+ declare type OptionsValues = null | string | number;
2258
+ declare type Options$1 = Record<string, OptionsValues>;
2259
+ declare type OptionFlags<FLAGS extends string, VALUE = null> = Partial<Record<FLAGS, VALUE>>;
2260
+ /**
2261
+ * A function called by the executor immediately after creating a child
2262
+ * process. Allows the calling application to implement custom handling of
2263
+ * the incoming stream of data from the `git`.
2264
+ */
2265
+ declare type outputHandler = (command: string, stdout: NodeJS.ReadableStream, stderr: NodeJS.ReadableStream, args: string[]) => void;
2266
+ /**
2267
+ * Environment variables to be passed into the child process.
2268
+ */
2269
+ declare type GitExecutorEnv = NodeJS.ProcessEnv | undefined;
2270
+ /**
2271
+ * Public interface of the Executor
2272
+ */
2273
+ interface SimpleGitExecutor {
2274
+ env: GitExecutorEnv;
2275
+ outputHandler?: outputHandler;
2276
+ binary: string;
2277
+ cwd: string;
2278
+ chain(): SimpleGitExecutor;
2279
+ push<R>(task: SimpleGitTask<R>): Promise<R>;
2280
+ }
2281
+ /**
2282
+ * The resulting output from running the git child process
2283
+ */
2284
+ interface GitExecutorResult {
2285
+ stdOut: Buffer[];
2286
+ stdErr: Buffer[];
2287
+ exitCode: number;
2288
+ rejection: Maybe<Error>;
2289
+ }
2290
+ interface SimpleGitPluginConfig {
2291
+ /**
2292
+ * Configures the events that should be used to determine when the unederlying child process has
2293
+ * been terminated.
2294
+ *
2295
+ * Version 2 will default to use `onClose=true, onExit=50` to mean the `close` event will be
2296
+ * used to immediately treat the child process as closed and start using the data from `stdOut`
2297
+ * / `stdErr`, whereas the `exit` event will wait `50ms` before treating the child process
2298
+ * as closed.
2299
+ *
2300
+ * This will be changed in version 3 to use `onClose=true, onExit=false` so that only the
2301
+ * close event is used to determine the termination of the process.
2302
+ */
2303
+ completion: {
2304
+ onClose?: boolean | number;
2305
+ onExit?: boolean | number;
2306
+ };
2307
+ /**
2308
+ * Configures the content of errors thrown by the `simple-git` instance for each task
2309
+ */
2310
+ errors(error: Buffer | Error | undefined, result: Omit<GitExecutorResult, 'rejection'>): Buffer | Error | undefined;
2311
+ /**
2312
+ * Handler to be called with progress events emitted through the progress plugin
2313
+ */
2314
+ progress(data: SimpleGitProgressEvent): void;
2315
+ /**
2316
+ * Configuration for the `timeoutPlugin`
2317
+ */
2318
+ timeout: {
2319
+ /**
2320
+ * The number of milliseconds to wait after spawning the process / receiving
2321
+ * content on the stdOut/stdErr streams before forcibly closing the git process.
2322
+ */
2323
+ block: number;
2324
+ };
2325
+ spawnOptions: Pick<SpawnOptions, 'uid' | 'gid'>;
2326
+ }
2327
+ /**
2328
+ * Optional configuration settings to be passed to the `simpleGit`
2329
+ * builder.
2330
+ */
2331
+ interface SimpleGitOptions extends Partial<SimpleGitPluginConfig> {
2332
+ baseDir: string;
2333
+ binary: string;
2334
+ maxConcurrentProcesses: number;
2335
+ config: string[];
2336
+ }
2337
+ declare type Maybe<T> = T | undefined;
2338
+
2339
+ interface DefaultLogFields {
2340
+ hash: string;
2341
+ date: string;
2342
+ message: string;
2343
+ refs: string;
2344
+ body: string;
2345
+ author_name: string;
2346
+ author_email: string;
2347
+ }
2348
+ declare type LogOptions<T = DefaultLogFields> = {
2349
+ file?: string;
2350
+ format?: T;
2351
+ from?: string;
2352
+ mailMap?: boolean;
2353
+ maxCount?: number;
2354
+ multiLine?: boolean;
2355
+ splitter?: string;
2356
+ strictDate?: boolean;
2357
+ symmetric?: boolean;
2358
+ to?: string;
2359
+ };
2360
+
2361
+ interface BranchSummaryBranch {
2362
+ current: boolean;
2363
+ name: string;
2364
+ commit: string;
2365
+ label: string;
2366
+ }
2367
+
2368
+ interface BranchSummary {
2369
+ detached: boolean;
2370
+ current: string;
2371
+ all: string[];
2372
+ branches: {
2373
+ [key: string]: BranchSummaryBranch;
2374
+ };
2375
+ }
2376
+
2377
+ /**
2378
+ * Represents the successful deletion of a single branch
2379
+ */
2380
+ interface BranchSingleDeleteSuccess {
2381
+ branch: string;
2382
+ hash: string;
2383
+ success: true;
2384
+ }
2385
+
2386
+ /**
2387
+ * Represents the failure to delete a single branch
2388
+ */
2389
+ interface BranchSingleDeleteFailure {
2390
+ branch: string;
2391
+ hash: null;
2392
+ success: false;
2393
+ }
2394
+
2395
+ type BranchSingleDeleteResult = BranchSingleDeleteFailure | BranchSingleDeleteSuccess;
2396
+
2397
+ /**
2398
+ * Represents the status of having deleted a batch of branches
2399
+ */
2400
+ interface BranchMultiDeleteResult {
2401
+ /**
2402
+ * All branches included in the response
2403
+ */
2404
+ all: BranchSingleDeleteResult[];
2405
+
2406
+ /**
2407
+ * Branches mapped by their branch name
2408
+ */
2409
+ branches: { [branchName: string]: BranchSingleDeleteResult };
2410
+
2411
+ /**
2412
+ * Array of responses that are in error
2413
+ */
2414
+ errors: BranchSingleDeleteResult[];
2415
+
2416
+ /**
2417
+ * Flag showing whether all branches were deleted successfully
2418
+ */
2419
+ readonly success: boolean;
2420
+ }
2421
+
2422
+ interface CleanSummary {
2423
+ readonly dryRun: boolean;
2424
+ paths: string[];
2425
+ files: string[];
2426
+ folders: string[];
2427
+ }
2428
+
2429
+ interface CommitResult {
2430
+ author: null | {
2431
+ email: string;
2432
+ name: string;
2433
+ };
2434
+ branch: string;
2435
+ commit: string;
2436
+ root: boolean;
2437
+ summary: {
2438
+ changes: number;
2439
+ insertions: number;
2440
+ deletions: number;
2441
+ };
2442
+ }
2443
+
2444
+ /** Represents the response to using `git.getConfig` */
2445
+ interface ConfigGetResult {
2446
+ /** The key that was searched for */
2447
+ key: string;
2448
+
2449
+ /** The single value seen by `git` for this key (equivalent to `git config --get key`) */
2450
+ value: string | null;
2451
+
2452
+ /** All possible values for this key no matter the scope (equivalent to `git config --get-all key`) */
2453
+ values: string[];
2454
+
2455
+ /** The file paths from which configuration was read */
2456
+ paths: string[];
2457
+
2458
+ /**
2459
+ * The full hierarchy of values the property can have had across the
2460
+ * various scopes that were searched (keys in this Map are the strings
2461
+ * also found in the `paths` array).
2462
+ */
2463
+ scopes: Map<string, string[]>;
2464
+ }
2465
+
2466
+ /**
2467
+ * Represents the current git configuration, as defined by the output from `git log`
2468
+ */
2469
+ interface ConfigListSummary {
2470
+
2471
+ /**
2472
+ * All configuration settings, where local/user settings override user/global settings
2473
+ * the overridden value will appear in this object.
2474
+ */
2475
+ readonly all: ConfigValues;
2476
+
2477
+ /**
2478
+ * The file paths configuration was read from
2479
+ */
2480
+ files: string[];
2481
+
2482
+ /**
2483
+ * The `ConfigValues` for each of the `files`, use this object to determine
2484
+ * local repo, user and global settings.
2485
+ */
2486
+ values: { [fileName: string]: ConfigValues };
2487
+ }
2488
+
2489
+ /**
2490
+ * Represents the map of configuration settings
2491
+ */
2492
+ interface ConfigValues {
2493
+ [key: string]: string | string[];
2494
+ }
2495
+
2496
+ interface DiffResultTextFile {
2497
+ file: string;
2498
+ changes: number;
2499
+ insertions: number;
2500
+ deletions: number;
2501
+ binary: false;
2502
+ }
2503
+
2504
+ interface DiffResultBinaryFile {
2505
+ file: string;
2506
+ before: number;
2507
+ after: number;
2508
+ binary: true;
2509
+ }
2510
+
2511
+ interface DiffResult {
2512
+ /** The total number of files changed as reported in the summary line */
2513
+ changed: number;
2514
+
2515
+ /** When present in the diff, lists the details of each file changed */
2516
+ files: Array<DiffResultTextFile | DiffResultBinaryFile>;
2517
+
2518
+ /** The number of files changed with insertions */
2519
+ insertions: number;
2520
+
2521
+ /** The number of files changed with deletions */
2522
+ deletions: number;
2523
+ }
2524
+
2525
+ interface FetchResult {
2526
+ raw: string;
2527
+ remote: string | null;
2528
+ branches: {
2529
+ name: string;
2530
+ tracking: string;
2531
+ }[];
2532
+ tags: {
2533
+ name: string;
2534
+ tracking: string;
2535
+ }[];
2536
+ }
2537
+
2538
+ /** Represents the response to git.grep */
2539
+ interface GrepResult {
2540
+ paths: Set<string>;
2541
+ results: Record<string, Array<{
2542
+ line: number;
2543
+ path: string;
2544
+ preview: string;
2545
+ }>>;
2546
+ }
2547
+
2548
+ /**
2549
+ * The `InitResult` is returned when (re)initialising a git repo.
2550
+ */
2551
+ interface InitResult {
2552
+ /**
2553
+ * Boolean representing whether the `--bare` option was used
2554
+ */
2555
+ readonly bare: boolean;
2556
+
2557
+ /**
2558
+ * Boolean representing whether the repo already existed (re-initialised rather than initialised)
2559
+ */
2560
+ readonly existing: boolean;
2561
+
2562
+ /**
2563
+ * The path used when initialising
2564
+ */
2565
+ readonly path: string;
2566
+
2567
+ /**
2568
+ * The git configuration directory - for a bare repo this is the same as `path`, in non-bare repos
2569
+ * this will usually be a sub-directory with the name `.git` (or value of the `$GIT_DIR` environment
2570
+ * variable).
2571
+ */
2572
+ readonly gitDir: string;
2573
+ }
2574
+
2575
+ /**
2576
+ * A parsed response summary for calls to `git mv`
2577
+ */
2578
+ interface MoveResult {
2579
+ /**
2580
+ * Array of files moved
2581
+ */
2582
+ moves: Array<{ from: string, to: string }>;
2583
+ }
2584
+
2585
+ interface PullDetailFileChanges {
2586
+ [fileName: string]: number;
2587
+ }
2588
+
2589
+ interface PullDetailSummary {
2590
+ changes: number;
2591
+ insertions: number;
2592
+ deletions: number;
2593
+ }
2594
+
2595
+ interface PullDetail {
2596
+ /** Array of all files that are referenced in the pull */
2597
+ files: string[];
2598
+
2599
+ /** Map of file names to the number of insertions in that file */
2600
+ insertions: PullDetailFileChanges;
2601
+
2602
+ /** Map of file names to the number of deletions in that file */
2603
+ deletions: PullDetailFileChanges;
2604
+
2605
+ summary: PullDetailSummary;
2606
+
2607
+ /** Array of file names that have been created */
2608
+ created: string[];
2609
+
2610
+ /** Array of file names that have been deleted */
2611
+ deleted: string[];
2612
+ }
2613
+
2614
+ interface PullResult extends PullDetail, RemoteMessageResult {
2615
+ }
2616
+
2617
+ /**
2618
+ * Represents file name changes in a StatusResult
2619
+ */
2620
+ interface StatusResultRenamed {
2621
+ from: string;
2622
+ to: string;
2623
+ }
2624
+
2625
+ interface FileStatusResult {
2626
+
2627
+ /** Original location of the file, when the file has been moved */
2628
+ from?: string
2629
+
2630
+ /** Path of the file */
2631
+ path: string;
2632
+
2633
+ /** First digit of the status code of the file, e.g. 'M' = modified.
2634
+ Represents the status of the index if no merge conflicts, otherwise represents
2635
+ status of one side of the merge. */
2636
+ index: string;
2637
+
2638
+ /** Second digit of the status code of the file. Represents status of the working directory
2639
+ if no merge conflicts, otherwise represents status of other side of a merge. */
2640
+ working_dir: string;
2641
+ }
2642
+
2643
+ /**
2644
+ * The StatusResult is returned for calls to `git.status()`, represents the state of the
2645
+ * working directory.
2646
+ */
2647
+ interface StatusResult {
2648
+ not_added: string[];
2649
+ conflicted: string[];
2650
+ created: string[];
2651
+ deleted: string[];
2652
+
2653
+ /**
2654
+ * Ignored files are not listed by default, add `--ignored` to the task options in order to see
2655
+ * this array of ignored files/paths.
2656
+ *
2657
+ * Note: ignored files will not be added to the `files` array, and will not be included in the
2658
+ * `isClean()` calculation.
2659
+ */
2660
+ ignored?: string[];
2661
+ modified: string[];
2662
+ renamed: StatusResultRenamed[];
2663
+ staged: string[];
2664
+
2665
+ /**
2666
+ * All files represented as an array of objects containing the `path` and status in `index` and
2667
+ * in the `working_dir`.
2668
+ */
2669
+ files: FileStatusResult[];
2670
+
2671
+ /**
2672
+ * Number of commits ahead of the tracked branch
2673
+ */
2674
+ ahead: number;
2675
+
2676
+ /**
2677
+ *Number of commits behind the tracked branch
2678
+ */
2679
+ behind: number;
2680
+
2681
+ /**
2682
+ * Name of the current branch
2683
+ */
2684
+ current: string | null;
2685
+
2686
+ /**
2687
+ * Name of the branch being tracked
2688
+ */
2689
+ tracking: string | null;
2690
+
2691
+ /**
2692
+ * Detached status of the working copy, for more detail of what the working branch
2693
+ * is detached from use `git.branch()`
2694
+ */
2695
+ detached: boolean;
2696
+
2697
+ /**
2698
+ * Gets whether this represents a clean working branch.
2699
+ */
2700
+ isClean(): boolean;
2701
+ }
2702
+
2703
+ /**
2704
+ * Response retrieved when using the `git.tags` method
2705
+ */
2706
+ interface TagResult {
2707
+ /**
2708
+ * All tag names
2709
+ */
2710
+ all: string[];
2711
+
2712
+ /**
2713
+ * The semver latest tag name or `undefined` when no tags are named in the response
2714
+ */
2715
+ latest: string | undefined;
2716
+ }
2717
+
2718
+ /**
2719
+ * The ListLogLine represents a single entry in the `git.log`, the properties on the object
2720
+ * are mixed in depending on the names used in the format (see `DefaultLogFields`), but some
2721
+ * properties are dependent on the command used.
2722
+ */
2723
+ interface ListLogLine {
2724
+ /**
2725
+ * When using a `--stat=4096` or `--shortstat` options in the `git.log` or `git.stashList`,
2726
+ * each entry in the `ListLogSummary` will also have a `diff` property representing as much
2727
+ * detail as was given in the response.
2728
+ */
2729
+ diff?: DiffResult;
2730
+ }
2731
+
2732
+ interface LogResult<T = DefaultLogFields> {
2733
+ all: ReadonlyArray<T & ListLogLine>;
2734
+ total: number;
2735
+ latest: (T & ListLogLine) | null;
2736
+ }
2737
+
2738
+ /**
2739
+ * Where the file was deleted, if there is a modify/delete conflict
2740
+ */
2741
+ interface MergeConflictDeletion {
2742
+ deleteRef: string;
2743
+ }
2744
+
2745
+ /**
2746
+ * Represents a single file with conflicts in the MergeSummary
2747
+ */
2748
+ interface MergeConflict {
2749
+
2750
+ /**
2751
+ * Type of conflict
2752
+ */
2753
+ reason: string;
2754
+
2755
+ /**
2756
+ * Path to file
2757
+ */
2758
+ file: string | null;
2759
+
2760
+ /**
2761
+ * Additional detail for the specific type of conflict
2762
+ */
2763
+ meta?: MergeConflictDeletion;
2764
+ }
2765
+
2766
+ type MergeResultStatus = 'success' | string;
2767
+
2768
+ interface MergeDetail {
2769
+ conflicts: MergeConflict[];
2770
+ merges: string[];
2771
+ result: MergeResultStatus;
2772
+ readonly failed: boolean;
2773
+ }
2774
+
2775
+ type MergeResult = PullResult & MergeDetail;
2776
+
2777
+ /**
2778
+ *
2779
+ */
2780
+ interface PushResultPushedItem {
2781
+ local: string;
2782
+ remote: string;
2783
+
2784
+ readonly deleted: boolean;
2785
+ readonly tag: boolean;
2786
+ readonly branch: boolean;
2787
+ readonly new: boolean;
2788
+ readonly alreadyUpdated: boolean;
2789
+ }
2790
+
2791
+ interface RemoteMessagesObjectEnumeration {
2792
+ enumerating: number,
2793
+ counting: number,
2794
+ compressing: number,
2795
+ total: {
2796
+ count: number,
2797
+ delta: number,
2798
+ },
2799
+ reused: {
2800
+ count: number,
2801
+ delta: number,
2802
+ },
2803
+ packReused: number,
2804
+ }
2805
+
2806
+ interface RemoteMessages {
2807
+ all: string[];
2808
+ objects?: RemoteMessagesObjectEnumeration;
2809
+ }
2810
+
2811
+ interface PushResultRemoteMessages extends RemoteMessages {
2812
+ pullRequestUrl?: string;
2813
+ vulnerabilities?: {
2814
+ count: number;
2815
+ summary: string;
2816
+ url: string;
2817
+ };
2818
+ }
2819
+
2820
+ interface RemoteMessageResult<T extends RemoteMessages = RemoteMessages> {
2821
+ remoteMessages: T;
2822
+ }
2823
+
2824
+ interface PushResultBranchUpdate {
2825
+ head: {
2826
+ local: string;
2827
+ remote: string;
2828
+ };
2829
+ hash: {
2830
+ from: string;
2831
+ to: string;
2832
+ };
2833
+ }
2834
+
2835
+ interface PushDetail {
2836
+ repo?: string;
2837
+ ref?: {
2838
+ local: string;
2839
+ };
2840
+ pushed: PushResultPushedItem[];
2841
+ branch?: {
2842
+ local: string;
2843
+ remote: string;
2844
+ remoteName: string;
2845
+ };
2846
+ update?: PushResultBranchUpdate;
2847
+ }
2848
+
2849
+ interface PushResult extends PushDetail, RemoteMessageResult<PushResultRemoteMessages> {
2850
+ }
2851
+
2852
+ type MoveSummary = MoveResult;
2853
+
2854
+ interface RemoteWithoutRefs {
2855
+ name: string;
2856
+ }
2857
+ interface RemoteWithRefs extends RemoteWithoutRefs {
2858
+ refs: {
2859
+ fetch: string;
2860
+ push: string;
2861
+ };
2862
+ }
2863
+
2864
+ declare type ApplyOptions = Options$1 & OptionFlags<'--stat' | '--numstat' | '--summary' | '--check' | '--index' | '--intent-to-add' | '--3way' | '--apply' | '--no-add' | '-R' | '--reverse' | '--allow-binary-replacement' | '--binary' | '--reject' | '-z' | '--inaccurate-eof' | '--recount' | '--cached' | '--ignore-space-change' | '--ignore-whitespace' | '--verbose' | '--unsafe-paths'> & OptionFlags<'--whitespace', 'nowarn' | 'warn' | 'fix' | 'error' | 'error-all'> & OptionFlags<'--build-fake-ancestor' | '--exclude' | '--include' | '--directory', string> & OptionFlags<'-p' | '-C', number>;
2865
+
2866
+ declare enum CheckRepoActions {
2867
+ BARE = "bare",
2868
+ IN_TREE = "tree",
2869
+ IS_REPO_ROOT = "root"
2870
+ }
2871
+
2872
+ /**
2873
+ * All supported option switches available for use in a `git.clean` operation
2874
+ */
2875
+ declare enum CleanOptions {
2876
+ DRY_RUN = "n",
2877
+ FORCE = "f",
2878
+ IGNORED_INCLUDED = "x",
2879
+ IGNORED_ONLY = "X",
2880
+ EXCLUDING = "e",
2881
+ QUIET = "q",
2882
+ RECURSIVE = "d"
2883
+ }
2884
+ /**
2885
+ * The two modes `git.clean` can run in - one of these must be supplied in order
2886
+ * for the command to not throw a `TaskConfigurationError`
2887
+ */
2888
+ declare type CleanMode = CleanOptions.FORCE | CleanOptions.DRY_RUN;
2889
+
2890
+ declare enum GitConfigScope {
2891
+ system = "system",
2892
+ global = "global",
2893
+ local = "local",
2894
+ worktree = "worktree"
2895
+ }
2896
+
2897
+ interface GitGrepQuery extends Iterable<string> {
2898
+ /** Adds one or more terms to be grouped as an "and" to any other terms */
2899
+ and(...and: string[]): this;
2900
+ /** Adds one or more search terms - git.grep will "or" this to other terms */
2901
+ param(...param: string[]): this;
2902
+ }
2903
+
2904
+ declare enum ResetMode {
2905
+ MIXED = "mixed",
2906
+ SOFT = "soft",
2907
+ HARD = "hard",
2908
+ MERGE = "merge",
2909
+ KEEP = "keep"
2910
+ }
2911
+ declare type ResetOptions = Options$1 & OptionFlags<'-q' | '--quiet' | '--no-quiet' | '--pathspec-from-nul'> & OptionFlags<'--pathspec-from-file', string>;
2912
+
2913
+ interface SimpleGitFactory {
2914
+ (baseDir?: string, options?: Partial<SimpleGitOptions>): SimpleGit;
2915
+
2916
+ (baseDir: string): SimpleGit;
2917
+
2918
+ (options: Partial<SimpleGitOptions>): SimpleGit;
2919
+ }
2920
+
2921
+ type Response$2<T> = SimpleGit & Promise<T>;
2922
+
2923
+ interface SimpleGitBase {
2924
+ /**
2925
+ * Adds one or more files to source control
2926
+ */
2927
+ add(files: string | string[], callback?: SimpleGitTaskCallback<string>): Response$2<string>;
2928
+
2929
+ /**
2930
+ * Sets the working directory of the subsequent commands.
2931
+ */
2932
+ cwd(directory: { path: string, root?: boolean }, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
2933
+
2934
+ cwd<path extends string>(directory: path, callback?: SimpleGitTaskCallback<path>): Response$2<path>;
2935
+
2936
+ /**
2937
+ * Compute object ID from a file
2938
+ */
2939
+ hashObject(path: string, callback?: SimpleGitTaskCallback): Response$2<string>;
2940
+
2941
+ hashObject(path: string, write ?: boolean, callback?: SimpleGitTaskCallback): Response$2<string>;
2942
+
2943
+ /**
2944
+ * Initialize a git repo
2945
+ */
2946
+ init(bare: boolean, options?: TaskOptions, callback?: SimpleGitTaskCallback<InitResult>): Response$2<InitResult>;
2947
+
2948
+ init(bare: boolean, callback?: SimpleGitTaskCallback<InitResult>): Response$2<InitResult>;
2949
+
2950
+ init(options?: TaskOptions, callback?: SimpleGitTaskCallback<InitResult>): Response$2<InitResult>;
2951
+
2952
+ init(callback?: SimpleGitTaskCallback<InitResult>): Response$2<InitResult>;
2953
+
2954
+ /**
2955
+ * Runs a merge, `options` can be either an array of arguments
2956
+ * supported by the [`git merge`](https://git-scm.com/docs/git-merge)
2957
+ * or an options object.
2958
+ *
2959
+ * Conflicts during the merge result in an error response,
2960
+ * the response type whether it was an error or success will be a MergeSummary instance.
2961
+ * When successful, the MergeSummary has all detail from a the PullSummary
2962
+ *
2963
+ * @see https://github.com/steveukx/git-js/blob/master/src/responses/MergeSummary.js
2964
+ * @see https://github.com/steveukx/git-js/blob/master/src/responses/PullSummary.js
2965
+ */
2966
+ merge(options: TaskOptions, callback?: SimpleGitTaskCallback<MergeResult>): Response$2<MergeResult>;
2967
+
2968
+ /**
2969
+ * Merges from one branch to another, equivalent to running `git merge ${remote} ${branch}`, the `options` argument can
2970
+ * either be an array of additional parameters to pass to the command or null / omitted to be ignored.
2971
+ */
2972
+ mergeFromTo<E extends GitError>(remote: string, branch: string, options?: TaskOptions, callback?: SimpleGitTaskCallback<MergeResult, E>): Response$2<MergeResult>;
2973
+
2974
+ mergeFromTo<E extends GitError>(remote: string, branch: string, callback?: SimpleGitTaskCallback<MergeResult, E>): Response$2<MergeResult>;
2975
+
2976
+ /**
2977
+ * Sets a handler function to be called whenever a new child process is created, the handler function will be called
2978
+ * with the name of the command being run and the stdout & stderr streams used by the ChildProcess.
2979
+ *
2980
+ * @example
2981
+ * require('simple-git')
2982
+ * .outputHandler(function (command, stdout, stderr) {
2983
+ * stdout.pipe(process.stdout);
2984
+ * })
2985
+ * .checkout('https://github.com/user/repo.git');
2986
+ *
2987
+ * @see https://nodejs.org/api/child_process.html#child_process_class_childprocess
2988
+ * @see https://nodejs.org/api/stream.html#stream_class_stream_readable
2989
+ */
2990
+ outputHandler(handler: outputHandler | void): this;
2991
+
2992
+ /**
2993
+ * Pushes the current committed changes to a remote, optionally specify the names of the remote and branch to use
2994
+ * when pushing. Supply multiple options as an array of strings in the first argument - see examples below.
2995
+ */
2996
+ push(remote?: string, branch?: string, options?: TaskOptions, callback?: SimpleGitTaskCallback<PushResult>): Response$2<PushResult>;
2997
+
2998
+ push(options?: TaskOptions, callback?: SimpleGitTaskCallback<PushResult>): Response$2<PushResult>;
2999
+
3000
+ push(callback?: SimpleGitTaskCallback<PushResult>): Response$2<PushResult>;
3001
+
3002
+ /**
3003
+ * Stash the local repo
3004
+ */
3005
+ stash(options?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3006
+
3007
+ stash(callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3008
+
3009
+ /**
3010
+ * Show the working tree status.
3011
+ */
3012
+ status(options?: TaskOptions, callback?: SimpleGitTaskCallback<StatusResult>): Response$2<StatusResult>;
3013
+
3014
+ status(callback?: SimpleGitTaskCallback<StatusResult>): Response$2<StatusResult>;
3015
+
3016
+ }
3017
+
3018
+ interface SimpleGit extends SimpleGitBase {
3019
+
3020
+ /**
3021
+ * Add an annotated tag to the head of the current branch
3022
+ */
3023
+ addAnnotatedTag(tagName: string, tagMessage: string, callback?: SimpleGitTaskCallback<{ name: string }>): Response$2<{ name: string }>;
3024
+
3025
+ /**
3026
+ * Add config to local git instance for the specified `key` (eg: user.name) and value (eg: 'your name').
3027
+ * Set `append` to true to append to rather than overwrite the key
3028
+ */
3029
+ addConfig(key: string, value: string, append?: boolean, scope?: keyof typeof GitConfigScope, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3030
+
3031
+ addConfig(key: string, value: string, append?: boolean, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3032
+
3033
+ addConfig(key: string, value: string, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3034
+
3035
+ /**
3036
+ * Applies a patch to the repo
3037
+ */
3038
+ applyPatch(patches: string | string[], options: TaskOptions<ApplyOptions>, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3039
+
3040
+ applyPatch(patches: string | string[], callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3041
+
3042
+ /**
3043
+ * Configuration values visible to git in the current working directory
3044
+ */
3045
+ listConfig(scope: keyof typeof GitConfigScope, callback?: SimpleGitTaskCallback<ConfigListSummary>): Response$2<ConfigListSummary>;
3046
+
3047
+ listConfig(callback?: SimpleGitTaskCallback<ConfigListSummary>): Response$2<ConfigListSummary>;
3048
+
3049
+ /**
3050
+ * Adds a remote to the list of remotes.
3051
+ *
3052
+ * - `remoteName` Name of the repository - eg "upstream"
3053
+ * - `remoteRepo` Fully qualified SSH or HTTP(S) path to the remote repo
3054
+ * - `options` Optional additional settings permitted by the `git remote add` command, merged into the command prior to the repo name and remote url
3055
+ */
3056
+ addRemote(remoteName: string, remoteRepo: string, options?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3057
+
3058
+ addRemote(remoteName: string, remoteRepo: string, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3059
+
3060
+ /**
3061
+ * Add a lightweight tag to the head of the current branch
3062
+ */
3063
+ addTag(name: string, callback?: SimpleGitTaskCallback<{ name: string }>): Response$2<{ name: string }>;
3064
+
3065
+ /**
3066
+ * Equivalent to `catFile` but will return the native `Buffer` of content from the git command's stdout.
3067
+ */
3068
+ binaryCatFile(options: string[], callback?: SimpleGitTaskCallback<any>): Response$2<any>;
3069
+
3070
+ /**
3071
+ * List all branches
3072
+ */
3073
+ branch(options?: TaskOptions, callback?: SimpleGitTaskCallback<BranchSummary>): Response$2<BranchSummary>;
3074
+
3075
+ /**
3076
+ * List of local branches
3077
+ */
3078
+ branchLocal(callback?: SimpleGitTaskCallback<BranchSummary>): Response$2<BranchSummary>;
3079
+
3080
+ /**
3081
+ * Returns a list of objects in a tree based on commit hash.
3082
+ * Passing in an object hash returns the object's content, size, and type.
3083
+ *
3084
+ * Passing "-p" will instruct cat-file to determine the object type, and display its formatted contents.
3085
+ *
3086
+ * @see https://git-scm.com/docs/git-cat-file
3087
+ */
3088
+ catFile(options: string[], callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3089
+
3090
+ catFile(callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3091
+
3092
+ /**
3093
+ * Check if a pathname or pathnames are excluded by .gitignore
3094
+ *
3095
+ */
3096
+ checkIgnore(pathNames: string[], callback?: SimpleGitTaskCallback<string[]>): Response$2<string[]>;
3097
+
3098
+ checkIgnore(path: string, callback?: SimpleGitTaskCallback<string[]>): Response$2<string[]>;
3099
+
3100
+ /**
3101
+ * Validates that the current working directory is a valid git repo file path.
3102
+ *
3103
+ * To make a more specific assertion of the repo, add the `action` argument:
3104
+ *
3105
+ * - `bare` to validate that the working directory is inside a bare repo.
3106
+ * - `root` to validate that the working directory is the root of a repo.
3107
+ * - `tree` (default value when omitted) to simply validate that the working
3108
+ * directory is the descendent of a repo
3109
+ */
3110
+ checkIsRepo(action?: CheckRepoActions, callback?: SimpleGitTaskCallback<boolean>): Response$2<boolean>;
3111
+
3112
+ checkIsRepo(callback?: SimpleGitTaskCallback<boolean>): Response$2<boolean>;
3113
+
3114
+ /**
3115
+ * Checkout a tag or revision, any number of additional arguments can be passed to the `git checkout` command
3116
+ * by supplying either a string or array of strings as the `what` parameter.
3117
+ */
3118
+ checkout(what: string, options?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3119
+
3120
+ checkout(what: string, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3121
+
3122
+ checkout(options?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3123
+
3124
+ /**
3125
+ * Checkout a remote branch.
3126
+ *
3127
+ * - branchName name of branch.
3128
+ * - startPoint (e.g origin/development).
3129
+ */
3130
+ checkoutBranch(branchName: string, startPoint: string, callback?: SimpleGitTaskCallback<void>): Response$2<void>;
3131
+
3132
+ /**
3133
+ * Internally uses pull and tags to get the list of tags then checks out the latest tag.
3134
+ */
3135
+ checkoutLatestTag(branchName: string, startPoint: string, callback?: SimpleGitTaskCallback<void>): Response$2<void>;
3136
+
3137
+ /**
3138
+ * Checkout a local branch
3139
+ */
3140
+ checkoutLocalBranch(branchName: string, callback?: SimpleGitTaskCallback<void>): Response$2<void>;
3141
+
3142
+ /**
3143
+ * Deletes unwanted content from the local repo - when supplying the first argument as
3144
+ * an array of `CleanOptions`, the array must include one of `CleanOptions.FORCE` or
3145
+ * `CleanOptions.DRY_RUN`.
3146
+ *
3147
+ * eg:
3148
+ *
3149
+ * ```typescript
3150
+ await git.clean(CleanOptions.FORCE);
3151
+ await git.clean(CleanOptions.DRY_RUN + CleanOptions.RECURSIVE);
3152
+ await git.clean(CleanOptions.FORCE, ['./path']);
3153
+ await git.clean(CleanOptions.IGNORED + CleanOptions.FORCE, {'./path': null});
3154
+ * ```
3155
+ */
3156
+ clean(args: CleanOptions[], options?: TaskOptions, callback?: SimpleGitTaskCallback<CleanSummary>): Response$2<CleanSummary>;
3157
+
3158
+ clean(mode: CleanMode | string, options?: TaskOptions, callback?: SimpleGitTaskCallback<CleanSummary>): Response$2<CleanSummary>;
3159
+
3160
+ clean(mode: CleanMode | string, callback?: SimpleGitTaskCallback<CleanSummary>): Response$2<CleanSummary>;
3161
+
3162
+ clean(options?: TaskOptions): Response$2<CleanSummary>;
3163
+
3164
+ clean(callback?: SimpleGitTaskCallback<CleanSummary>): Response$2<CleanSummary>;
3165
+
3166
+ /**
3167
+ * Clears the queue of pending commands and returns the wrapper instance for chaining.
3168
+ */
3169
+ clearQueue(): this;
3170
+
3171
+ /**
3172
+ * Clone a repository into a new directory.
3173
+ *
3174
+ * - repoPath repository url to clone e.g. https://github.com/steveukx/git-js.git
3175
+ * - localPath local folder path to clone to.
3176
+ * - options supported by [git](https://git-scm.com/docs/git-clone).
3177
+ */
3178
+ clone(repoPath: string, localPath: string, options?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3179
+
3180
+ clone(repoPath: string, options?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3181
+
3182
+ /**
3183
+ * Commits changes in the current working directory - when specific file paths are supplied, only changes on those
3184
+ * files will be committed.
3185
+ */
3186
+ commit(
3187
+ message: string | string[],
3188
+ files?: string | string[],
3189
+ options?: Options$1,
3190
+ callback?: SimpleGitTaskCallback<CommitResult>): Response$2<CommitResult>;
3191
+
3192
+ commit(
3193
+ message: string | string[],
3194
+ options?: TaskOptions,
3195
+ callback?: SimpleGitTaskCallback<CommitResult>): Response$2<CommitResult>;
3196
+
3197
+ commit(
3198
+ message: string | string[],
3199
+ files?: string | string[],
3200
+ callback?: SimpleGitTaskCallback<CommitResult>): Response$2<CommitResult>;
3201
+
3202
+ commit(
3203
+ message: string | string[],
3204
+ callback?: SimpleGitTaskCallback<CommitResult>): Response$2<CommitResult>;
3205
+
3206
+ /**
3207
+ * Sets the path to a custom git binary, should either be `git` when there is an installation of git available on
3208
+ * the system path, or a fully qualified path to the executable.
3209
+ */
3210
+ customBinary(command: string): this;
3211
+
3212
+ /**
3213
+ * Delete one local branch. Supply the branchName as a string to return a
3214
+ * single `BranchDeletionSummary` instances.
3215
+ *
3216
+ * - branchName name of branch
3217
+ * - forceDelete (optional, defaults to false) set to true to forcibly delete unmerged branches
3218
+ */
3219
+ deleteLocalBranch(branchName: string, forceDelete?: boolean, callback?: SimpleGitTaskCallback<BranchSingleDeleteResult>): Response$2<BranchSingleDeleteResult>;
3220
+
3221
+ deleteLocalBranch(branchName: string, callback?: SimpleGitTaskCallback<BranchSingleDeleteResult>): Response$2<BranchSingleDeleteResult>;
3222
+
3223
+ /**
3224
+ * Delete one or more local branches. Supply the branchName as a string to return a
3225
+ * single `BranchDeletionSummary` or as an array of branch names to return an array of
3226
+ * `BranchDeletionSummary` instances.
3227
+ *
3228
+ * - branchNames name of branch or array of branch names
3229
+ * - forceDelete (optional, defaults to false) set to true to forcibly delete unmerged branches
3230
+ */
3231
+ deleteLocalBranches(branchNames: string[], forceDelete?: boolean, callback?: SimpleGitTaskCallback<BranchMultiDeleteResult>): Response$2<BranchMultiDeleteResult>;
3232
+
3233
+ /**
3234
+ * Get the diff of the current repo compared to the last commit with a set of options supplied as a string.
3235
+ */
3236
+ diff(options?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3237
+
3238
+ /**
3239
+ * Gets a summary of the diff for files in the repo, uses the `git diff --stat` format to calculate changes.
3240
+ *
3241
+ * in order to get staged (only): `--cached` or `--staged`.
3242
+ */
3243
+ diffSummary(command: string | number, options: TaskOptions, callback?: SimpleGitTaskCallback<DiffResult>): Response$2<DiffResult>;
3244
+
3245
+ diffSummary(command: string | number, callback?: SimpleGitTaskCallback<DiffResult>): Response$2<DiffResult>;
3246
+
3247
+ diffSummary(options: TaskOptions, callback?: SimpleGitTaskCallback<DiffResult>): Response$2<DiffResult>;
3248
+
3249
+ diffSummary(callback?: SimpleGitTaskCallback<DiffResult>): Response$2<DiffResult>;
3250
+
3251
+ /**
3252
+ * Sets an environment variable for the spawned child process, either supply both a name and value as strings or
3253
+ * a single object to entirely replace the current environment variables.
3254
+ *
3255
+ * @param {string|Object} name
3256
+ * @param {string} [value]
3257
+ */
3258
+ env(name: string, value: string): this;
3259
+
3260
+ env(env: object): this;
3261
+
3262
+ /**
3263
+ * Calls the supplied `handle` function at the next step in the chain, used to run arbitrary functions synchronously
3264
+ * before the next task in the git api.
3265
+ */
3266
+ exec(handle: () => void): Response$2<void>;
3267
+
3268
+ /**
3269
+ * Updates the local working copy database with changes from the default remote repo and branch.
3270
+ */
3271
+ fetch(remote: string, branch: string, options?: TaskOptions, callback?: SimpleGitTaskCallback<FetchResult>): Response$2<FetchResult>;
3272
+
3273
+ fetch(remote: string, branch: string, callback?: SimpleGitTaskCallback<FetchResult>): Response$2<FetchResult>;
3274
+
3275
+ fetch(remote: string, options?: TaskOptions, callback?: SimpleGitTaskCallback<FetchResult>): Response$2<FetchResult>;
3276
+
3277
+ fetch(options?: TaskOptions, callback?: SimpleGitTaskCallback<FetchResult>): Response$2<FetchResult>;
3278
+
3279
+ fetch(callback?: SimpleGitTaskCallback<FetchResult>): Response$2<FetchResult>;
3280
+
3281
+ /**
3282
+ * Gets the current value of a configuration property by it key, optionally specify the scope in which
3283
+ * to run the command (omit / set to `undefined` to check in the complete overlaid configuration visible
3284
+ * to the `git` process).
3285
+ */
3286
+ getConfig(key: string, scope?: keyof typeof GitConfigScope, callback?: SimpleGitTaskCallback<string>): Response$2<ConfigGetResult>;
3287
+
3288
+ /**
3289
+ * Gets the currently available remotes, setting the optional verbose argument to true includes additional
3290
+ * detail on the remotes themselves.
3291
+ */
3292
+ getRemotes(callback?: SimpleGitTaskCallback<RemoteWithoutRefs[]>): Response$2<RemoteWithoutRefs[]>;
3293
+
3294
+ getRemotes(verbose?: false, callback?: SimpleGitTaskCallback<RemoteWithoutRefs[]>): Response$2<RemoteWithoutRefs[]>;
3295
+
3296
+ getRemotes(verbose: true, callback?: SimpleGitTaskCallback<RemoteWithRefs[]>): Response$2<RemoteWithRefs[]>;
3297
+
3298
+ /**
3299
+ * Search for files matching the supplied search terms
3300
+ */
3301
+ grep(searchTerm: string | GitGrepQuery, callback?: SimpleGitTaskCallback<GrepResult>): Response$2<GrepResult>;
3302
+
3303
+ grep(searchTerm: string | GitGrepQuery, options?: TaskOptions, callback?: SimpleGitTaskCallback<GrepResult>): Response$2<GrepResult>;
3304
+
3305
+ /**
3306
+ * List remotes by running the `ls-remote` command with any number of arbitrary options
3307
+ * in either array of object form.
3308
+ */
3309
+ listRemote(args?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3310
+
3311
+ /**
3312
+ * Show commit logs from `HEAD` to the first commit.
3313
+ * If provided between `options.from` and `options.to` tags or branch.
3314
+ *
3315
+ * You can provide `options.file`, which is the path to a file in your repository. Then only this file will be considered.
3316
+ *
3317
+ * To use a custom splitter in the log format, set `options.splitter` to be the string the log should be split on.
3318
+ *
3319
+ * By default the following fields will be part of the result:
3320
+ * `hash`: full commit hash
3321
+ * `date`: author date, ISO 8601-like format
3322
+ * `message`: subject + ref names, like the --decorate option of git-log
3323
+ * `author_name`: author name
3324
+ * `author_email`: author mail
3325
+ * You can specify `options.format` to be an mapping from key to a format option like `%H` (for commit hash).
3326
+ * The fields specified in `options.format` will be the fields in the result.
3327
+ *
3328
+ * Options can also be supplied as a standard options object for adding custom properties supported by the git log command.
3329
+ * For any other set of options, supply options as an array of strings to be appended to the git log command.
3330
+ *
3331
+ * @returns Response<ListLogSummary>
3332
+ *
3333
+ * @see https://git-scm.com/docs/git-log
3334
+ */
3335
+ log<T = DefaultLogFields>(options?: TaskOptions | LogOptions<T>, callback?: SimpleGitTaskCallback<LogResult<T>>): Response$2<LogResult<T>>;
3336
+
3337
+ /**
3338
+ * Mirror a git repo
3339
+ *
3340
+ * Equivalent to `git.clone(repoPath, localPath, ['--mirror'])`, `clone` allows
3341
+ * for additional task options.
3342
+ */
3343
+ mirror(repoPath: string, localPath: string, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3344
+
3345
+ /**
3346
+ * Moves one or more files to a new destination.
3347
+ *
3348
+ * @see https://git-scm.com/docs/git-mv
3349
+ */
3350
+ mv(from: string | string[], to: string, callback?: SimpleGitTaskCallback<MoveSummary>): Response$2<MoveSummary>;
3351
+
3352
+ /**
3353
+ * Fetch from and integrate with another repository or a local branch. In the case that the `git pull` fails with a
3354
+ * recognised fatal error, the exception thrown by this function will be a `GitResponseError<PullFailedResult>`.
3355
+ */
3356
+ pull(remote?: string, branch?: string, options?: TaskOptions, callback?: SimpleGitTaskCallback<PullResult>): Response$2<PullResult>;
3357
+
3358
+ pull(options?: TaskOptions, callback?: SimpleGitTaskCallback<PullResult>): Response$2<PullResult>;
3359
+
3360
+ pull(callback?: SimpleGitTaskCallback<PullResult>): Response$2<PullResult>;
3361
+
3362
+ /**
3363
+ * Pushes the current tag changes to a remote which can be either a URL or named remote. When not specified uses the
3364
+ * default configured remote spec.
3365
+ */
3366
+ pushTags(remote: string, options?: TaskOptions, callback?: SimpleGitTaskCallback<PushResult>): Response$2<PushResult>;
3367
+
3368
+ pushTags(options?: TaskOptions, callback?: SimpleGitTaskCallback<PushResult>): Response$2<PushResult>;
3369
+
3370
+ pushTags(callback?: SimpleGitTaskCallback<PushResult>): Response$2<PushResult>;
3371
+
3372
+ /**
3373
+ * Executes any command against the git binary.
3374
+ */
3375
+ raw(commands: string | string[] | TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3376
+
3377
+ raw(options: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3378
+
3379
+ raw(...commands: string[]): Response$2<string>;
3380
+
3381
+ // leading varargs with trailing options/callback
3382
+ raw(a: string, options: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3383
+
3384
+ raw(a: string, b: string, options: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3385
+
3386
+ raw(a: string, b: string, c: string, options: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3387
+
3388
+ raw(a: string, b: string, c: string, d: string, options: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3389
+
3390
+ raw(a: string, b: string, c: string, d: string, e: string, options: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3391
+
3392
+ // leading varargs with trailing callback
3393
+ raw(a: string, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3394
+
3395
+ raw(a: string, b: string, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3396
+
3397
+ raw(a: string, b: string, c: string, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3398
+
3399
+ raw(a: string, b: string, c: string, d: string, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3400
+
3401
+ raw(a: string, b: string, c: string, d: string, e: string, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3402
+
3403
+ /**
3404
+ * Rebases the current working copy. Options can be supplied either as an array of string parameters
3405
+ * to be sent to the `git rebase` command, or a standard options object.
3406
+ */
3407
+ rebase(options?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3408
+
3409
+ rebase(callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3410
+
3411
+ /**
3412
+ * Call any `git remote` function with arguments passed as an array of strings.
3413
+ */
3414
+ remote(options: string[], callback?: SimpleGitTaskCallback<void | string>): Response$2<void | string>;
3415
+
3416
+ /**
3417
+ * Removes an entry from the list of remotes.
3418
+ *
3419
+ * - remoteName Name of the repository - eg "upstream"
3420
+ */
3421
+ removeRemote(remoteName: string, callback?: SimpleGitTaskCallback<void>): Response$2<void>;
3422
+
3423
+ /**
3424
+ * Reset a repo. Called without arguments this is a soft reset for the whole repo,
3425
+ * for explicitly setting the reset mode, supply the first argument as one of the
3426
+ * supported reset modes.
3427
+ *
3428
+ * Trailing options argument can be either a string array, or an extension of the
3429
+ * ResetOptions, use this argument for supplying arbitrary additional arguments,
3430
+ * such as restricting the pathspec.
3431
+ *
3432
+ * ```typescript
3433
+ // equivalent to each other
3434
+ simpleGit().reset(ResetMode.HARD, ['--', 'my-file.txt']);
3435
+ simpleGit().reset(['--hard', '--', 'my-file.txt']);
3436
+ simpleGit().reset(ResetMode.HARD, {'--': null, 'my-file.txt': null});
3437
+ simpleGit().reset({'--hard': null, '--': null, 'my-file.txt': null});
3438
+ ```
3439
+ */
3440
+ reset(mode: ResetMode, options?: TaskOptions<ResetOptions>, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3441
+
3442
+ reset(mode: ResetMode, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3443
+
3444
+ reset(options?: TaskOptions<ResetOptions>, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3445
+
3446
+ /**
3447
+ * Revert one or more commits in the local working copy
3448
+ *
3449
+ * - commit The commit to revert. Can be any hash, offset (eg: `HEAD~2`) or range (eg: `master~5..master~2`)
3450
+ */
3451
+ revert(commit: String, options?: TaskOptions, callback?: SimpleGitTaskCallback<void>): Response$2<void>;
3452
+
3453
+ revert(commit: String, callback?: SimpleGitTaskCallback<void>): Response$2<void>;
3454
+
3455
+ /**
3456
+ * Passes the supplied options to `git rev-parse` and returns the string response. Options can be either a
3457
+ * string array or `Options` object of options compatible with the [rev-parse](https://git-scm.com/docs/git-rev-parse)
3458
+ *
3459
+ * Example uses of `rev-parse` include converting friendly commit references (ie: branch names) to SHA1 hashes
3460
+ * and retrieving meta details about the current repo (eg: the root directory, and whether it was created as
3461
+ * a bare repo).
3462
+ */
3463
+ revparse(option: string, options?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3464
+
3465
+ revparse(options?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3466
+
3467
+ /**
3468
+ * Removes the named files from source control.
3469
+ */
3470
+ rm(paths: string | string[], callback?: SimpleGitTaskCallback<void>): Response$2<void>;
3471
+
3472
+ /**
3473
+ * Removes the named files from source control but keeps them on disk rather than deleting them entirely. To
3474
+ * completely remove the files, use `rm`.
3475
+ */
3476
+ rmKeepLocal(paths: string | string[], callback?: SimpleGitTaskCallback<void>): Response$2<void>;
3477
+
3478
+ /**
3479
+ * Show various types of objects, for example the file at a certain commit
3480
+ */
3481
+ show(option: string | TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3482
+
3483
+ show(callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3484
+
3485
+ /**
3486
+ * @deprecated
3487
+ *
3488
+ * From version 2.7.0, use of `silent` is deprecated in favour of using the `debug` library, this method will
3489
+ * be removed in version 3.x.
3490
+ *
3491
+ * Please see the [readme](https://github.com/steveukx/git-js/blob/master/readme.md#enable-logging) for more details.
3492
+ *
3493
+ * Disables/enables the use of the console for printing warnings and errors, by default messages are not shown in
3494
+ * a production environment.
3495
+ *
3496
+ * @param {boolean} silence
3497
+ */
3498
+ silent(silence?: boolean): this;
3499
+
3500
+ /**
3501
+ * List the stash(s) of the local repo
3502
+ */
3503
+ stashList(options?: TaskOptions, callback?: SimpleGitTaskCallback<LogResult>): Response$2<LogResult>;
3504
+
3505
+ stashList(callback?: SimpleGitTaskCallback<LogResult>): Response$2<LogResult>;
3506
+
3507
+ /**
3508
+ * Call any `git submodule` function with arguments passed as an array of strings.
3509
+ */
3510
+ subModule(options?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3511
+
3512
+ /**
3513
+ * Add a submodule
3514
+ */
3515
+ submoduleAdd(repo: string, path: string, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3516
+
3517
+ /**
3518
+ * Initialise submodules
3519
+ */
3520
+ submoduleInit(moduleName: string, options?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3521
+
3522
+ submoduleInit(moduleName: string, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3523
+
3524
+ submoduleInit(options?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3525
+
3526
+ submoduleInit(callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3527
+
3528
+ /**
3529
+ * Update submodules
3530
+ */
3531
+ submoduleUpdate(moduleName: string, options?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3532
+
3533
+ submoduleUpdate(moduleName: string, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3534
+
3535
+ submoduleUpdate(options?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3536
+
3537
+ submoduleUpdate(callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3538
+
3539
+ /**
3540
+ * List all tags. When using git 2.7.0 or above, include an options object with `"--sort": "property-name"` to
3541
+ * sort the tags by that property instead of using the default semantic versioning sort.
3542
+ *
3543
+ * Note, supplying this option when it is not supported by your Git version will cause the operation to fail.
3544
+ */
3545
+ tag(options?: TaskOptions, callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3546
+
3547
+ /**
3548
+ * Gets a list of tagged versions.
3549
+ */
3550
+ tags(options?: TaskOptions, callback?: SimpleGitTaskCallback<TagResult>): Response$2<TagResult>;
3551
+
3552
+ tags(callback?: SimpleGitTaskCallback<TagResult>): Response$2<TagResult>;
3553
+
3554
+ /**
3555
+ * Updates repository server info
3556
+ */
3557
+ updateServerInfo(callback?: SimpleGitTaskCallback<string>): Response$2<string>;
3558
+ }
3559
+
3560
+ declare const factory: SimpleGitFactory;
3561
+
3562
+ declare const git_factory: typeof factory;
3563
+ declare namespace git {
3564
+ export {
3565
+ git_factory as factory,
3566
+ };
3567
+ }
3568
+
1989
3569
  declare enum ContentTokenType {
1990
3570
  Command = 0,
1991
3571
  Path = 1,
1992
- Link = 2
3572
+ Link = 2,
3573
+ Yellow = 3,
3574
+ Cyan = 4,
3575
+ Magenta = 5,
3576
+ Green = 6
1993
3577
  }
1994
3578
  interface ContentMetadata {
1995
3579
  link?: string;
@@ -2004,6 +3588,10 @@ declare const token: {
2004
3588
  command: (value: string) => ContentToken;
2005
3589
  path: (value: string) => ContentToken;
2006
3590
  link: (value: string, link: string) => ContentToken;
3591
+ cyan: (value: string) => ContentToken;
3592
+ yellow: (value: string) => ContentToken;
3593
+ magenta: (value: string) => ContentToken;
3594
+ green: (value: string) => ContentToken;
2007
3595
  };
2008
3596
  declare class TokenizedString {
2009
3597
  value: string;
@@ -2062,6 +3650,7 @@ declare const error: (content: Fatal) => void;
2062
3650
  declare function stringifyMessage(message: Message): string;
2063
3651
 
2064
3652
  declare const output$1_token: typeof token;
3653
+ type output$1_Message = Message;
2065
3654
  declare const output$1_content: typeof content;
2066
3655
  type output$1_LogLevel = LogLevel;
2067
3656
  declare const output$1_currentLogLevel: typeof currentLogLevel;
@@ -2076,6 +3665,7 @@ declare const output$1_stringifyMessage: typeof stringifyMessage;
2076
3665
  declare namespace output$1 {
2077
3666
  export {
2078
3667
  output$1_token as token,
3668
+ output$1_Message as Message,
2079
3669
  output$1_content as content,
2080
3670
  output$1_LogLevel as LogLevel,
2081
3671
  output$1_currentLogLevel as currentLogLevel,
@@ -5307,5 +6897,5 @@ declare const constants: {
5307
6897
  };
5308
6898
  };
5309
6899
 
5310
- export { api, checksum, constants, dependency, environment, error$1 as error, file, http, os, output$1 as output, path, schema, session, store, string, system, template, toml, ui, version };
6900
+ export { api, checksum, constants, dependency, environment, error$1 as error, file, git, http, os, output$1 as output, path, schema, session, store, string, system, template, toml, ui, version };
5311
6901
  //# sourceMappingURL=index.d.ts.map