mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Use namespace with 'export =' to model self-referential chaining API in 'temp'.
This commit is contained in:
Vendored
+37
-34
@@ -5,41 +5,44 @@
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as temp from ".";
|
||||
import * as fs from "fs";
|
||||
|
||||
export interface OpenFile {
|
||||
path: string;
|
||||
fd: number;
|
||||
declare namespace temp {
|
||||
export interface OpenFile {
|
||||
path: string;
|
||||
fd: number;
|
||||
}
|
||||
|
||||
export interface Stats {
|
||||
files: number;
|
||||
dirs: number;
|
||||
}
|
||||
|
||||
export interface AffixOptions {
|
||||
prefix?: string;
|
||||
suffix?: string;
|
||||
dir?: string;
|
||||
}
|
||||
|
||||
export let dir: string;
|
||||
|
||||
export function track(value?: boolean): typeof temp;
|
||||
|
||||
export function mkdir(affixes?: string | AffixOptions, callback?: (err: any, dirPath: string) => void): void;
|
||||
|
||||
export function mkdirSync(affixes?: string | AffixOptions): string;
|
||||
|
||||
export function open(affixes?: string | AffixOptions, callback?: (err: any, result: OpenFile) => void): void;
|
||||
|
||||
export function openSync(affixes?: string | AffixOptions): OpenFile;
|
||||
|
||||
export function path(affixes?: string | AffixOptions, defaultPrefix?: string): string;
|
||||
|
||||
export function cleanup(callback?: (result: boolean | Stats) => void): void;
|
||||
|
||||
export function cleanupSync(): boolean | Stats;
|
||||
|
||||
export function createWriteStream(affixes?: string | AffixOptions): fs.WriteStream;
|
||||
}
|
||||
|
||||
export interface Stats {
|
||||
files: number;
|
||||
dirs: number;
|
||||
}
|
||||
|
||||
export interface AffixOptions {
|
||||
prefix?: string;
|
||||
suffix?: string;
|
||||
dir?: string;
|
||||
}
|
||||
|
||||
export let dir: string;
|
||||
|
||||
export function track(value?: boolean): typeof temp;
|
||||
|
||||
export function mkdir(affixes?: string | AffixOptions, callback?: (err: any, dirPath: string) => void): void;
|
||||
|
||||
export function mkdirSync(affixes?: string | AffixOptions): string;
|
||||
|
||||
export function open(affixes?: string | AffixOptions, callback?: (err: any, result: OpenFile) => void): void;
|
||||
|
||||
export function openSync(affixes?: string | AffixOptions): OpenFile;
|
||||
|
||||
export function path(affixes?: string | AffixOptions, defaultPrefix?: string): string;
|
||||
|
||||
export function cleanup(callback?: (result: boolean | Stats) => void): void;
|
||||
|
||||
export function cleanupSync(): boolean | Stats;
|
||||
|
||||
export function createWriteStream(affixes?: string | AffixOptions): fs.WriteStream;
|
||||
export = temp;
|
||||
|
||||
Reference in New Issue
Block a user