Skip to content

Commit

Permalink
update .d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Oct 4, 2022
1 parent 787b05e commit 4be135b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions index.d.ts
Expand Up @@ -98,6 +98,11 @@ export interface OverwriteOptions {
contentOnly?: boolean;
}

export interface UpdateOptions {
storeName?: boolean;
overwrite?: boolean;
}

export default class MagicString {
constructor(str: string, options?: MagicStringOptions);
/**
Expand Down Expand Up @@ -162,6 +167,14 @@ export default class MagicString {
* the content is overwritten, or anything that was appended/prepended to the range as well.
*/
overwrite(start: number, end: number, content: string, options?: boolean | OverwriteOptions): MagicString;
/**
* Replaces the characters from `start` to `end` with `content`. The same restrictions as `s.remove()` apply.
*
* The fourth argument is optional. It can have a storeName property — if true, the original name will be stored
* for later inclusion in a sourcemap's names array — and an overwrite property which determines whether only
* the content is overwritten, or anything that was appended/prepended to the range as well.
*/
update(start: number, end: number, content: string, options?: boolean | UpdateOptions): MagicString;
/**
* Prepends the string with the specified content.
*/
Expand Down

0 comments on commit 4be135b

Please sign in to comment.