0.1.3 • Published 6 months ago
@types/node-hrx v0.1.3
Installation
npm install --save @types/node-hrx
Summary
This package contains type definitions for node-hrx (https://github.com/issa-tseng/node-hrx#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-hrx.
index.d.ts
// Type definitions for node-hrx 0.1
// Project: https://github.com/issa-tseng/node-hrx#readme
// Definitions by: Christophe Coevoet <https://github.com/stof>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 3.7
/// <reference types="node" />
import { Readable } from 'stream';
export class Directory implements Iterable<string> {
constructor(path: string, contents?: Record<string, HrxItem>, comment?: string | null);
readonly path: string;
readonly contents: Record<string, HrxItem>;
readonly comment?: string;
get(path: string): HrxItem | undefined;
isDirectory(): this is Directory;
isFile(): this is File;
list(): string[];
[Symbol.iterator](): Iterator<string>;
}
export class Archive extends Directory {
constructor(contents?: Record<string, HrxItem>, comment?: string | null);
readonly path: '';
}
export class File {
constructor(path: string, body: string, comment?: string | null);
readonly path: string;
readonly body: string;
readonly comment?: string;
isDirectory(): this is Directory;
isFile(): this is File;
}
export type HrxItem = File | Directory;
export class ParseProblem extends Error {
constructor(message: string, position: { line: number, col: number }, details?: Record<string, unknown>);
readonly line: number;
readonly col: number;
readonly details: {};
}
export class LexicalProblem extends Error {
constructor(message: string, line: number, details?: { path?: string, [key: string]: unknown });
readonly line: number;
readonly details: {
path?: string;
};
}
export function archiveFromStream(stream: Readable): Promise<Archive>;
Additional Details
- Last updated: Tue, 14 Sep 2021 08:31:23 GMT
- Dependencies: @types/node
- Global values: none
Credits
These definitions were written by Christophe Coevoet.