Fixed incorrect types in nodegit class DiffDelta and Blob (#41314)

* Fixes incorrect return types in diff-delta and blob. Should be functions, not direct accessor properties. Also, `rawcontent` returns a wrapper around a Buffer, not a Buffer directly, as `content` does.

* updated package description and version

* fixed missing argument

* Updates jackrabbit types to export namespace for interface and type access. Adds missing options and arguments to a few methods.

* fixed linting issue

* revert changes to jackrabbit
This commit is contained in:
Benjamin Schuster-Boeckler 2020-01-03 00:11:55 +01:00 committed by Ryan Cavanaugh
parent 98a81158b7
commit 158b37a44f
4 changed files with 13 additions and 9 deletions

View File

@ -1,5 +1,5 @@
import { WriteStream } from 'fs';
import { Wrapper } from "./wrapper";
import { Repository } from './repository';
import { Oid } from './oid';
@ -31,7 +31,7 @@ export class Blob {
id(): Oid;
isBinary(): number;
owner(): Repository;
rawcontent(): Buffer;
rawcontent(): Wrapper;
rawsize(): number;
content(): Buffer;
toString(): string;

View File

@ -1,10 +1,10 @@
import { DiffFile } from './diff-file';
export class DiffDelta {
status: number;
flags: number;
similarity: number;
nfiles: number;
oldFile: DiffFile;
newFile: DiffFile;
status: () => number;
flags: () => number;
similarity: () => number;
nfiles: () => number;
oldFile: () => DiffFile;
newFile: () => DiffFile;
}

View File

@ -1,9 +1,10 @@
// Type definitions for nodegit 0.24
// Type definitions for nodegit 0.26
// Project: https://github.com/nodegit/nodegit, http://nodegit.org
// Definitions by: Dolan Miu <https://github.com/dolanmiu>,
// Tobias Nießen <https://github.com/tniessen>,
// Pierre Vigier <https://github.com/pvigier>
// Jibril Saffi <https://github.com/IGI-111>
// Benjamin Schuster-Boeckler <https://github.com/DaGaMs>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export { AnnotatedCommit } from './annotated-commit';

3
types/nodegit/wrapper.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
export class Wrapper {
toBuffer(bufSize: number): Buffer;
}