mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
* initial commit for git-init * modified * addressed @jakebailey's code review
This commit is contained in:
14
types/git-init/git-init-tests.ts
Normal file
14
types/git-init/git-init-tests.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import init = require('git-init');
|
||||
|
||||
// $ExpectType void
|
||||
init((err: Error | null, stdout: any, stderr: any) => {
|
||||
// something here
|
||||
});
|
||||
// $ExpectType void
|
||||
init('./something/', (err: Error | null, stdout: any, stderr: any) => {
|
||||
// something here
|
||||
});
|
||||
// @ts-expect-error
|
||||
init(5);
|
||||
// @ts-expect-error
|
||||
init('./something', 5);
|
||||
23
types/git-init/index.d.ts
vendored
Normal file
23
types/git-init/index.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
// Type definitions for git-init 1.0
|
||||
// Project: https://github.com/yoshuawuyts/git-init#readme
|
||||
// Definitions by: Santi <https://github.com/santi100a>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
import type { ExecException } from 'node:child_process';
|
||||
|
||||
type ExecCallback = (error: ExecException | null, stdout: string, stderr: string) => void;
|
||||
/**
|
||||
* Initializes a new Git repo in `path` asynchronously.
|
||||
*
|
||||
* @param path The path of the folder to be initialized as a Git repo.
|
||||
* @param cb An `exec`-compatible callback defined in {@link ExecCallback}.
|
||||
*/
|
||||
declare function init(path: string, cb: ExecCallback): void;
|
||||
/**
|
||||
* Initializes a new Git repo in the current directory asynchronously.
|
||||
*
|
||||
* @param cb An `exec`-compatible callback defined in {@link ExecCallback}.
|
||||
*/
|
||||
declare function init(cb: ExecCallback): void;
|
||||
export = init;
|
||||
23
types/git-init/tsconfig.json
Normal file
23
types/git-init/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"git-init-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/git-init/tslint.json
Normal file
1
types/git-init/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "@definitelytyped/dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user