import { MemberKind, NameMatch, SassStylesheet } from './stylesheet'; /** A replacement of `content.substring(start, end)` with `text`. */ export interface SassEdit { start: number; end: number; text: string; } /** Something a change could not do on its own, for the person running the migration to review. */ export interface SassManualChange { /** Offset of the code to review. */ index: number; message: string; } /** The edits a change makes to one stylesheet, and what it left for manual review. */ export interface SassChangeResult { edits: SassEdit[]; manual: SassManualChange[]; } /** Applies edits to the content they were collected on. */ export declare const applyEdits: (content: string, edits: SassEdit[]) => string; /** * Applies edits and returns the result with a function that maps an offset in the content to * the matching offset in the result. An offset inside a replaced range maps to its start. */ export declare const applyEditsWithMap: (content: string, edits: SassEdit[]) => { content: string; map: (offset: number) => number; }; /** The range removing `start`-`end` takes: the whole line when nothing else is on it. */ export declare const removalRange: (content: string, start: number, end: number) => { start: number; end: number; }; /** * Renames a function or a mixin wherever the stylesheet references it, bare or through any * namespace, since an app can forward Ignite UI through a module of its own. Members the * stylesheet declares itself, and other members whose names merely contain this one, are left. */ export declare const renameMember: (sheet: SassStylesheet, name: string, replaceWith: string) => SassChangeResult; /** * Removes the include statements of a mixin, together with their line when they are alone on it. * With `namespace`, only the includes through it are removed; `null` removes only bare includes. */ export declare const removeIncludes: (sheet: SassStylesheet, name: string, namespace?: string | null) => SassChangeResult; /** A change to the arguments a function or mixin call passes. */ export interface SassArgumentChange { /** The argument, such as `$background`. */ name: string; replaceWith?: string; remove?: boolean; /** * The argument's 1-based index in the owner's parameter list. It only detects calls that pass * the argument by position: removing it from one of those would shift the arguments after it, * so such a call is left for manual review. */ parameterIndex?: number; } /** * Renames or removes a keyword argument in every call of `owner`. Formatting and comments are * kept: a comment in front of a removed argument usually describes the previous one, so it stays. * Renaming onto a name the call already passes would make it a duplicate, so the argument is * removed instead. A call passing the argument by position keeps it through a rename, and is left * for manual review by a removal. */ export declare const updateArgument: (sheet: SassStylesheet, owner: string, change: SassArgumentChange, match?: NameMatch, kind?: MemberKind) => SassChangeResult; /** An argument to add to calls of a function or mixin. */ export interface SassArgumentAddition { /** The argument, such as `$generator`. */ name: string; /** The value to pass, as Sass source, such as `'legacy'`. */ value: string; /** Adds the argument only where the owner is called as a function or included as a mixin. */ kind?: MemberKind; /** * The argument's 1-based index in the owner's parameter list. It only detects calls that pass * the argument by position already, so they are left alone; the argument is always added by * name after the last one. */ parameterIndex?: number; } /** * Adds a keyword argument to every call of `owner` that does not pass it already. A call with * its arguments on one line gets it after the last one; a call with one argument per line gets * it on a line of its own, in the same indentation. Trailing commas and a comment closing the * last argument's line are kept. A call that spreads its arguments cannot take another one after * them, so it is left for manual review. */ export declare const addArgument: (sheet: SassStylesheet, owner: string, addition: SassArgumentAddition, match?: NameMatch) => SassChangeResult; /** * Renames a variable wherever the stylesheet reads or declares it, including interpolations in * strings and references through a namespace. A name followed by a colon inside brackets is a * keyword argument, a map key or a parameter, none of which is the variable, so it is left. */ export declare const renameVariable: (sheet: SassStylesheet, name: string, replaceWith: string) => SassChangeResult; /** * Removes a variable the library no longer has. A declaration of it overrode the library's * value, so the statement goes, together with its line when it is alone on it. Any other * reference has no automatic replacement, so it is left for manual review. */ export declare const removeVariable: (sheet: SassStylesheet, name: string) => SassChangeResult; /** A change to the URL of a module the stylesheet loads with `@use` or `@forward`. */ export interface SassModuleChange { module: string; replaceWith?: string; remove?: boolean; /** With `remove`, a mixin of the module whose includes go with it. */ member?: string; } /** * Moves or removes a module. A move rewrites the URL of every rule loading it. A removal drops * those rules, and with `member`, the includes of that mixin through each namespace the module * was used through; any other reference through such a namespace is left for manual review. */ export declare const updateModule: (sheet: SassStylesheet, change: SassModuleChange) => SassChangeResult;