From fbe95c0b1a1d99de3309fbc4e49c752113ee94d0 Mon Sep 17 00:00:00 2001 From: Erik Moldtmann Date: Tue, 27 Mar 2018 17:24:14 +0200 Subject: [PATCH] allow JS strings and string arrays where Git.Strarray is required, because nodegit can automatically convert it to Git.Strarray --- types/nodegit/checkout-options.d.ts | 2 +- types/nodegit/diff-options.d.ts | 2 +- types/nodegit/fetch-options.d.ts | 2 +- types/nodegit/index_.d.ts | 6 +++--- types/nodegit/path-spec.d.ts | 2 +- types/nodegit/push-options.d.ts | 2 +- types/nodegit/remote.d.ts | 2 +- types/nodegit/reset.d.ts | 2 +- types/nodegit/status-options.d.ts | 2 +- types/nodegit/tag.d.ts | 2 +- types/nodegit/transport.d.ts | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/types/nodegit/checkout-options.d.ts b/types/nodegit/checkout-options.d.ts index d711ae7ba9..6971f59f3a 100644 --- a/types/nodegit/checkout-options.d.ts +++ b/types/nodegit/checkout-options.d.ts @@ -14,7 +14,7 @@ export class CheckoutOptions { notifyPayload?: undefined; progressCb?: any; progressPayload?: undefined; - paths?: Strarray; + paths?: Strarray | string | string[]; baseline?: Tree; baselineIndex?: Index; targetDirectory?: string; diff --git a/types/nodegit/diff-options.d.ts b/types/nodegit/diff-options.d.ts index 408a0530e1..3925f5c70c 100644 --- a/types/nodegit/diff-options.d.ts +++ b/types/nodegit/diff-options.d.ts @@ -4,7 +4,7 @@ export interface DiffOptions { version?: number; flags?: number; ignoreSubmodules?: number; - pathspec?: Strarray; + pathspec?: Strarray | string | string[]; notifyCb?: Function; contextLines?: number; interhunkLines?: number; diff --git a/types/nodegit/fetch-options.d.ts b/types/nodegit/fetch-options.d.ts index 77b5a9586c..6907db6bca 100644 --- a/types/nodegit/fetch-options.d.ts +++ b/types/nodegit/fetch-options.d.ts @@ -7,7 +7,7 @@ export interface FetchOptions { prune?: number; updateFetchhead?: number; downloadTags?: number; - customHeaders?: Strarray; + customHeaders?: Strarray | string | string[]; proxyOpts?: any; [key: string]: any; } diff --git a/types/nodegit/index_.d.ts b/types/nodegit/index_.d.ts index 3bf55c229d..aeea3c9b5a 100644 --- a/types/nodegit/index_.d.ts +++ b/types/nodegit/index_.d.ts @@ -26,7 +26,7 @@ export class Index { static open(indexPath: string): Promise; add(sourceEntry: IndexEntry): number; - addAll(pathspec: Strarray, flags: number, callback?: Function): Promise; + addAll(pathspec: Strarray | string | string[], flags: number, callback?: Function): Promise; addByPath(path: string): Promise; caps(): number; checksum(): Oid; @@ -44,11 +44,11 @@ export class Index { read(force: number): number; readTree(tree: Tree): number; remove(path: string, stage: number): number; - removeAll(pathspec: Strarray, callback?: Function): Promise; + removeAll(pathspec: Strarray | string | string[], callback?: Function): Promise; removeByPath(path: string): Promise; removeDirectory(dir: string, stage: number): number; setCaps(caps: number): number; - updateAll(pathspec: Strarray, callback?: Function): Promise; + updateAll(pathspec: Strarray | string | string[], callback?: Function): Promise; write(): number; writeTree(): Promise; writeTreeTo(repo: Repository): Promise; diff --git a/types/nodegit/path-spec.d.ts b/types/nodegit/path-spec.d.ts index 99435d5e0d..31b58f0149 100644 --- a/types/nodegit/path-spec.d.ts +++ b/types/nodegit/path-spec.d.ts @@ -23,7 +23,7 @@ export class Pathspec { static matchListEntrycount(m: any): number; static matchListFailedEntry(m: any, pos: number): string; static matchListFailedEntrycount(m: any): number; - static create(pathspec: Strarray): Pathspec; + static create(pathspec: Strarray | string | string[]): Pathspec; free(): void; matchDiff(diff: Diff, flags: number): Promise; diff --git a/types/nodegit/push-options.d.ts b/types/nodegit/push-options.d.ts index b736325f91..5f7625db2e 100644 --- a/types/nodegit/push-options.d.ts +++ b/types/nodegit/push-options.d.ts @@ -6,7 +6,7 @@ export interface PushOptions { version?: number; pbParallelism?: number; callbacks?: RemoteCallbacks; - customHeaders?: Strarray; + customHeaders?: Strarray | string | string[]; proxyOpts?: ProxyOptions; [key: string]: any; } diff --git a/types/nodegit/remote.d.ts b/types/nodegit/remote.d.ts index 61fdc63d1c..8a77f4ea69 100644 --- a/types/nodegit/remote.d.ts +++ b/types/nodegit/remote.d.ts @@ -62,7 +62,7 @@ export class Remote { stop(): void; updateTips(callbacks: RemoteCallbacks, updateFetchhead: number, downloadTags: number, reflogMessage: string): number; - upload(refspecs: Strarray, opts?: PushOptions): number; + upload(refspecs: Strarray | string | string[], opts?: PushOptions): number; url(): string; /** * Lists advertised references from a remote. You must connect to the remote before using referenceList. diff --git a/types/nodegit/reset.d.ts b/types/nodegit/reset.d.ts index 800ad34434..9051fa693b 100644 --- a/types/nodegit/reset.d.ts +++ b/types/nodegit/reset.d.ts @@ -20,7 +20,7 @@ export class Reset { /** * Look up a refs's commit. */ - static default(repo: Repository, target: Object, pathspecs: Strarray): Promise; + static default(repo: Repository, target: Object, pathspecs: Strarray | string | string[]): Promise; /** * Sets the current head to the specified commit oid and optionally resets the index and working tree to match. * This behaves like reset but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages. diff --git a/types/nodegit/status-options.d.ts b/types/nodegit/status-options.d.ts index 363dcd1fbb..f0189706bd 100644 --- a/types/nodegit/status-options.d.ts +++ b/types/nodegit/status-options.d.ts @@ -4,6 +4,6 @@ export interface StatusOptions { version?: number; show?: number; flags?: number; - pathspec?: Strarray; + pathspec?: Strarray | string | string[]; [key: string]: any; } diff --git a/types/nodegit/tag.d.ts b/types/nodegit/tag.d.ts index 3f6b5aa836..08d25859d2 100644 --- a/types/nodegit/tag.d.ts +++ b/types/nodegit/tag.d.ts @@ -10,7 +10,7 @@ export class Tag { static createLightweight(repo: Repository, tagName: string, target: Object, force: number): Promise; static delete(repo: Repository, tagName: string): Promise; static list(repo: Repository): Promise; - static listMatch(tagNames: Strarray, pattern: string, repo: Repository): number; + static listMatch(tagNames: Strarray | string | string[], pattern: string, repo: Repository): number; /** * Retrieves the tag pointed to by the oid * diff --git a/types/nodegit/transport.d.ts b/types/nodegit/transport.d.ts index 4cdd39f400..f4f4721333 100644 --- a/types/nodegit/transport.d.ts +++ b/types/nodegit/transport.d.ts @@ -9,7 +9,7 @@ export namespace Transport { } export class Transport { - static sshWithPaths(owner: Remote, payload: Strarray): Promise; + static sshWithPaths(owner: Remote, payload: Strarray | string | string[]): Promise; static unregister(prefix: string): number; init(version: number): number; smartCertificateCheck(cert: Cert, valid: number, hostName: string): number;