@types/properties-parser
Version:
TypeScript definitions for properties-parser
57 lines (42 loc) • 1.89 kB
Markdown
# Installation
> `npm install --save @types/properties-parser`
# Summary
This package contains type definitions for properties-parser (https://github.com/xavi-/node-properties-parser).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/properties-parser.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/properties-parser/index.d.ts)
````ts
/// <reference types="node" />
import type * as fs from "fs";
import type { promisify } from "util";
export type Properties = Record<string, string>;
export interface EditorOptions {
separator?: string;
path?: string;
callback?: (err: Error | null, editor: Editor) => void;
}
export function parse(text: string): Properties;
export function read(path: fs.PathLike): Properties;
export function read(path: fs.PathLike, callback: (err: Error | null, data: Properties) => void): void;
export const createEditor: {
(options?: EditorOptions): Editor;
(path: fs.PathLike, options?: EditorOptions): Editor;
(path: fs.PathLike, options?: EditorOptions, callback?: (err: Error | null, editor: Editor) => void): void;
[promisify.custom]: (path: fs.PathLike, options?: EditorOptions) => Promise<Editor>;
};
export interface Editor {
get(key: string): string | undefined;
set(key: string, value?: string | null, comment?: string): void;
unset(key: string): void;
save(callback: (err: Error | null) => void, path?: fs.PathLike): void;
save(path?: fs.PathLike, callback?: (err: Error | null) => void): void;
addHeadComment(comment: string): void;
toString(): string;
valueOf(): string;
}
````
### Additional Details
* Last updated: Tue, 07 Nov 2023 09:09:39 GMT
* Dependencies: [@types/node](https://npmjs.com/package/@types/node)
# Credits
These definitions were written by .