import JsonhReaderOptions = require("./jsonh-reader-options.js"); import TextReader = require("./text-reader.js"); import JsonhToken = require("./jsonh-token.js"); import Result = require("./result.js"); /** * A reader that reads JSONH tokens from a string. */ declare class JsonhReader { #private; /** * The text reader to read characters from. */ get textReader(): TextReader; /** * The options to use when reading JSONH. */ get options(): JsonhReaderOptions; /** * The number of characters read from {@link string}. */ get charCounter(): number; /** * The current recursion depth of the reader. */ get depth(): number; /** * Constructs a reader that reads JSONH from a text reader. */ private constructor(); /** * Constructs a reader that reads JSONH from a text reader. */ static fromTextReader(textReader: TextReader, options?: JsonhReaderOptions): JsonhReader; /** * Constructs a reader that reads JSONH from a string. */ static fromString(string: string, options?: JsonhReaderOptions): JsonhReader; /** * Parses a single element from a text reader. */ static parseElementfromTextReader(textReader: TextReader, options?: JsonhReaderOptions): Result; /** * Parses a single element from a string. */ static parseElementFromString(string: string, options?: JsonhReaderOptions): Result; /** * Parses a single element from the reader. */ parseElement(): Result; /** * Parses a single element as JSON from the reader. * * If {@link includeComments} is true, comments are included (block comments are escaped as `/ *` and `* /`). * * If {@link indent} is not null, the output is pretty-printed with the given indentation. * * Note: The result is **NOT** safe to embed in HTML. To safely embed in HTML, you need to escape characters like `<`, `>` and `&`. */ parseJson(includeComments?: boolean, indent?: string | null): Result; /** * Tries to find the given property name in the reader. * For example, to find `c`: * ``` * // Original position * { * "a": "1", * "b": { * "c": "2" * }, * "c": // Final position * "3" * } * ``` */ findPropertyValue(propertyName: string): boolean; /** * Reads whitespace and returns whether the reader contains another token. */ hasToken(): boolean; /** * Reads comments and whitespace and errors if the reader contains another element. */ readEndOfElements(): Generator>; /** * Reads a single element from the reader. */ readElement(): Generator>; } export = JsonhReader; //# sourceMappingURL=jsonh-reader.d.ts.map