mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Added type definitions for hidefile (#46712)
* Added type definitions for hidefile * hidefile: Fix incorrect typings definition structure * hidefile: Fix incorrect DT header
This commit is contained in:
parent
416202f3af
commit
fd8aaff6bb
48
types/hidefile/index.d.ts
vendored
Normal file
48
types/hidefile/index.d.ts
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
// Type definitions for hidefile 3.0
|
||||
// Project: https://github.com/stevenvachon/hidefile
|
||||
// Definitions by: Nicholas Nelson <https://github.com/nelsonni>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { URL } from 'url';
|
||||
|
||||
export function hide(
|
||||
path: string | Buffer | URL,
|
||||
callback: (error: Error | null, newpath?: string | Buffer | URL) => unknown
|
||||
): void;
|
||||
|
||||
export function hideSync(
|
||||
path: string | Buffer | URL
|
||||
): string | Buffer | URL;
|
||||
|
||||
export function isDotPrefixed(
|
||||
path: string | Buffer | URL
|
||||
): boolean;
|
||||
|
||||
export function isHidden(
|
||||
path: string | Buffer | URL,
|
||||
callback: (error: Error | null, result: boolean) => unknown
|
||||
): void;
|
||||
|
||||
export function isHiddenSync(
|
||||
path: string | Buffer | URL
|
||||
): boolean;
|
||||
|
||||
export function reveal(
|
||||
path: string | Buffer | URL,
|
||||
callback: (error: Error | null, newpath?: string | Buffer | URL) => unknown
|
||||
): void;
|
||||
|
||||
export function revealSync(
|
||||
path: string | Buffer | URL
|
||||
): string | Buffer | URL;
|
||||
|
||||
export function shouldBeHidden(
|
||||
path: string | Buffer | URL,
|
||||
callback: (error: Error | null, result: boolean) => unknown
|
||||
): void;
|
||||
|
||||
export function shouldBeHiddenSync(
|
||||
path: string | Buffer | URL
|
||||
): boolean;
|
||||
11
types/hidefile/test/hidefile-tests.cjs.ts
Normal file
11
types/hidefile/test/hidefile-tests.cjs.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import hidefile = require('hidefile');
|
||||
|
||||
hidefile.hide("./", () => {}); // $ExpectType void
|
||||
hidefile.hideSync("./"); // $ExpectType string | Buffer | URL
|
||||
hidefile.isDotPrefixed("./"); // $ExpectType boolean
|
||||
hidefile.isHidden("./", () => {}); // $ExpectType void
|
||||
hidefile.isHiddenSync("./"); // $ExpectType boolean
|
||||
hidefile.reveal("./", () => {}); // $ExpectType void
|
||||
hidefile.revealSync("./"); // $ExpectType string | Buffer | URL
|
||||
hidefile.shouldBeHidden("./", () => {}); // $ExpectType void
|
||||
hidefile.shouldBeHiddenSync("./"); // $ExpectType boolean
|
||||
23
types/hidefile/tsconfig.json
Normal file
23
types/hidefile/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"test/hidefile-tests.cjs.ts"
|
||||
]
|
||||
}
|
||||
1
types/hidefile/tslint.json
Normal file
1
types/hidefile/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user