import AnnotationsApi from "./annotation.js"; import SassCommentParser, { type ParserConfig } from "./sass-comment-parser.js"; import type { ParseResult } from "./types.js"; /** * If you're running {@link parse} or {@link parseSync} on a hot code path, * you might discover a noticable time is spent constructing this Parser class * since they create a new instance of this parser for each invocation. * * For performance sensitive applications you may want to import this class and * reuse the parser instance. * * @example * const parser = new Parser(); * const result = parser.parseStringSync(` * /// Keep it secret * $_secret: 'keep-it-safe'; * `); */ export declare class Parser { annotations: AnnotationsApi; commentParser: SassCommentParser; constructor(parserConfig?: ParserConfig); parseString(code: string, options?: ParseOptions): Promise; parseStringSync(code: string, options?: ParseOptions): ParseResult[]; } export type ParseOptions = { id?: string; parserConfig?: ParserConfig; }; /** * Try to parse any SassDoc in the input * * @example SCSS * await parse(` * /// Main color * $stardew: #ffffff; * `); * @example Indented * await parse(` * /// Main color * $stardew: #ffffff * `); */ export declare function parse(code: string, options?: ParseOptions): Promise>; /** * Try to parse any SassDoc in the input * * @example * parseSync(` * /// Main color * $stardew: #ffffff; * `); * @example Indented * parseSync(` * /// Main color * $stardew: #ffffff * `); */ export declare function parseSync(code: string, options?: ParseOptions): Array;