/** * Low-level scanning of Sass source. Every function here works on the original text and keeps * offsets intact, so its results can address the stylesheet directly. * * The scanner tells code from non-code the way Sass does: strings, with the interpolations in * them as code; `//` and `/* *\/` comments; and unquoted URLs, with their escapes and the * interpolations in them as code. A `url()` that holds anything else, such as `url($icon)`, is a * function call and so code. The context matrix in changes.spec.ts checks each case against the * Sass compiler. */ /** The line ending a stylesheet uses, so that inserted lines match the rest of it. */ export declare const lineEnding: (content: string) => string; /** * Returns the index of the quote closing the string opened at `start`. A quote inside an * interpolation, such as `"#{map.get($m, "key")}"`, belongs to the interpolation. */ export declare const skipString: (content: string, start: number) => number; /** * When a string, a comment or an unquoted URL starts at `index`, returns the index of its last * character so that a scan can carry on past it. Returns -1 when `index` is on code. */ export declare const skipNonCode: (content: string, index: number) => number; /** * Masks non-code with whitespace, preserving offsets and line endings. With `interpolation`, * the `#{...}` parts of quoted strings and unquoted URLs stay unmasked, because Sass evaluates * them as code. */ export declare const maskNonCode: (content: string, interpolation?: boolean) => string; /** Masks comments with whitespace, preserving offsets and line endings, and keeps strings. */ export declare const maskComments: (content: string) => string; /** * Returns the index of the bracket closing the one `start` is inside of, or -1 when the * content is unbalanced. Brackets in strings, comments and unquoted URLs are ignored. */ export declare const findClosingBracket: (content: string, start: number) => number; /** * Safe split of an argument list by `','`, considering inner calls, maps, lists and * interpolations. E.g.: * ``` * prop: inner-func(), * prop2: inner2(inner-param: 3, inner-param: inner-func(..)), * prop3: [1px, 2px], * prop4: #{$a, $b} * ``` * * Strings, comments and unquoted URLs are scanned over, so a `','` inside one of them is not * taken for an argument separator. */ export declare const splitArguments: (body: string) => string[]; /** Index where an argument's code starts, after its leading whitespace and comments. */ export declare const leadingCommentsEnd: (param: string) => number; /** The line break a carried `//` comment needs so that it does not swallow what follows it. */ export declare const commentBreak: (carried: string, next: string, eol: string) => string; /** The name a keyword argument passes, such as `$color` for `$color: red`, or null for a positional one. */ export declare const argumentName: (code: string) => string | null; /** Sass treats underscores and hyphens in identifiers as the same character. */ export declare const normalizeName: (name: string) => string;