From b9654afc96a6ca7d26fb10328f921e183d6865ac Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Fri, 22 Dec 2017 09:51:42 +0200 Subject: [PATCH 1/3] add interfaces used by rollup --- index.d.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/index.d.ts b/index.d.ts index e3985a7..0dc3c54 100644 --- a/index.d.ts +++ b/index.d.ts @@ -22,9 +22,10 @@ export interface SourceMap { } export class Bundle { + indentExclusionRanges: ExclusionRange | Array; constructor(options?: BundleOptions); addSource(source: MagicString | { filename?: string, content: MagicString }): Bundle; - append(str: string, options: BundleOptions): Bundle; + append(str: string, options?: BundleOptions): Bundle; clone(): Bundle; generateMap(options?: Partial): SourceMap; getIndentString(): string; @@ -32,9 +33,9 @@ export class Bundle { prepend(str: string): Bundle; toString(): string; trimLines(): string; - trim(charType: string): string; - trimStart(charType: string): Bundle; - trimEnd(charType: string): Bundle; + trim(charType?: string): string; + trimStart(charType?: string): Bundle; + trimEnd(charType?: string): Bundle; } export type ExclusionRange = [ number, number ]; @@ -55,6 +56,8 @@ export interface OverwriteOptions { } export default class MagicString { + indentExclusionRanges: ExclusionRange | Array; + constructor(str: string, options?: MagicStringOptions); addSourcemapLocation(char: number): void; append(content: string): MagicString; From 50b50e0ec17ff143448958ab130ec861f2a10e6a Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Fri, 22 Dec 2017 10:09:59 +0200 Subject: [PATCH 2/3] update source map interface --- index.d.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/index.d.ts b/index.d.ts index 0dc3c54..c411ad6 100644 --- a/index.d.ts +++ b/index.d.ts @@ -11,11 +11,12 @@ export interface SourceMapOptions { } export interface SourceMap { + version: string; file: string; sources: string[]; - sourcesContent: string; + sourcesContent: string[]; names: string[]; - mappings: string[]; + mappings: string; toString(): string; toUrl(): string; @@ -32,8 +33,8 @@ export class Bundle { indent(indentStr?: string): Bundle; prepend(str: string): Bundle; toString(): string; - trimLines(): string; - trim(charType?: string): string; + trimLines(): Bundle; + trim(charType?: string): Bundle; trimStart(charType?: string): Bundle; trimEnd(charType?: string): Bundle; } @@ -56,7 +57,7 @@ export interface OverwriteOptions { } export default class MagicString { - indentExclusionRanges: ExclusionRange | Array; + indentExclusionRanges: Array; constructor(str: string, options?: MagicStringOptions); addSourcemapLocation(char: number): void; From eb8b2fdb5409912a91a1d7ea621dc58f50a391c2 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Mon, 12 Mar 2018 10:32:52 +0200 Subject: [PATCH 3/3] more general indentExclusionRanges type --- index.d.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index c411ad6..9d762db 100644 --- a/index.d.ts +++ b/index.d.ts @@ -23,7 +23,6 @@ export interface SourceMap { } export class Bundle { - indentExclusionRanges: ExclusionRange | Array; constructor(options?: BundleOptions); addSource(source: MagicString | { filename?: string, content: MagicString }): Bundle; append(str: string, options?: BundleOptions): Bundle; @@ -31,6 +30,7 @@ export class Bundle { generateMap(options?: Partial): SourceMap; getIndentString(): string; indent(indentStr?: string): Bundle; + indentExclusionRanges: ExclusionRange | Array; prepend(str: string): Bundle; toString(): string; trimLines(): Bundle; @@ -57,8 +57,6 @@ export interface OverwriteOptions { } export default class MagicString { - indentExclusionRanges: Array; - constructor(str: string, options?: MagicStringOptions); addSourcemapLocation(char: number): void; append(content: string): MagicString; @@ -70,6 +68,7 @@ export default class MagicString { indent(options?: IndentOptions): MagicString; indent(indentStr?: string, options?: IndentOptions): MagicString; + indentExclusionRanges: ExclusionRange | Array; move(start: number, end: number, index: number): MagicString; overwrite(start: number, end: number, content: string, options?: boolean | OverwriteOptions): MagicString;