Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add interfaces used by rollup #131

Merged
merged 3 commits into from Mar 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions index.d.ts
Expand Up @@ -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;
Expand All @@ -24,17 +25,18 @@ export interface SourceMap {
export class Bundle {
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<SourceMapOptions>): SourceMap;
getIndentString(): string;
indent(indentStr?: string): Bundle;
indentExclusionRanges: ExclusionRange | Array<ExclusionRange>;
prepend(str: string): Bundle;
toString(): string;
trimLines(): string;
trim(charType: string): string;
trimStart(charType: string): Bundle;
trimEnd(charType: string): Bundle;
trimLines(): Bundle;
trim(charType?: string): Bundle;
trimStart(charType?: string): Bundle;
trimEnd(charType?: string): Bundle;
}

export type ExclusionRange = [ number, number ];
Expand Down Expand Up @@ -66,6 +68,7 @@ export default class MagicString {

indent(options?: IndentOptions): MagicString;
indent(indentStr?: string, options?: IndentOptions): MagicString;
indentExclusionRanges: ExclusionRange | Array<ExclusionRange>;

move(start: number, end: number, index: number): MagicString;
overwrite(start: number, end: number, content: string, options?: boolean | OverwriteOptions): MagicString;
Expand Down