Installation
npm install --save @types/season
Summary
This package contains type definitions for season (http://atom.github.io/season).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/season.
index.d.ts
export interface ParseOptions {
allowDuplicateKeys?: boolean | undefined;
}
/** Set the cache directory to use for storing compiled CSON files. */
export function setCacheDir(cacheDirectory: string): void;
/** Convert the object to a CSON string. */
export function stringify(object: any): string;
/** Read the CSON or JSON object at the given path and return it to the callback once it is read and parsed. */
export function readFile(objectPath: string, callback: (err: Error | null, object: any) => void): void;
export function readFile(
objectPath: string,
options: ParseOptions,
callback: (err: Error | null, object: any) => void,
): void;
/** Synchronous version of `CSON.readFile(objectPath, callback)`. */
export function readFileSync(objectPath: string, options?: ParseOptions): any;
/** Write the object to the given path as either JSON or CSON depending on the path's extension. */
export function writeFile(objectPath: string, object: any, callback: (err: Error | null) => void): void;
/** Synchronous version of `CSON.writeFile(objectPath, object, callback)` */
export function writeFileSync(objectPath: string, object: any): void;
/** Is the given path a valid object path? Returns true if the path has a .json or .cson file extension, false otherwise. */
export function isObjectPath(objectPath: string): boolean;
/** Resolve the path to an existent file that has a .json or .cson extension. Returns the path to an existent CSON or JSON file or null if none found. */
export function resolve(objectPath: string): string | null;
Additional Details
- Last updated: Tue, 07 Nov 2023 15:11:36 GMT
- Dependencies: none
Credits
These definitions were written by Piotr Roszatycki.