KC's Workspace
    Preparing search index...
    Index

    Constructors

    Accessors

    • get filename(): string | null

      Returns string | null

    Methods

    • Parameters

      • content: string

      Returns this

    • Parameters

      • index: number
      • content: string

      Returns this

    • Parameters

      • index: number
      • content: string

      Returns this

    • Returns a clone of the MagicString instance.

      Returns BindingMagicString

    • Generates a decoded source map for the transformations applied to this MagicString. Returns a BindingDecodedMap object with mappings as an array of arrays.

      Parameters

      Returns BindingDecodedMap

    • Generates a source map for the transformations applied to this MagicString. Returns a BindingSourceMap object with version, file, sources, sourcesContent, names, mappings.

      Parameters

      Returns BindingSourceMap

    • Returns boolean

    • Parameters

      • Optionalindentor: string | null

      Returns this

    • Deprecated method that throws an error directing users to use prependRight or appendLeft. This matches the original magic-string API which deprecated this method.

      Parameters

      • index: number
      • content: string

      Returns void

    • Returns boolean

    • Returns the last character of the generated string, or an empty string if empty.

      Returns string

    • Returns the content after the last newline in the generated string.

      Returns string

    • Returns number

    • Alias for relocate to match the original magic-string API. Moves the characters from start to end to index. Returns this for method chaining.

      Parameters

      • start: number
      • end: number
      • index: number

      Returns this

    • Parameters

      • start: number
      • end: number
      • content: string

      Returns this

    • Parameters

      • content: string

      Returns this

    • Parameters

      • index: number
      • content: string

      Returns this

    • Parameters

      • index: number
      • content: string

      Returns this

    • Parameters

      • start: number
      • end: number
      • to: number

      Returns this

    • Parameters

      • start: number
      • end: number

      Returns this

    • Parameters

      • from: string
      • to: string

      Returns this

    • Parameters

      • from: string
      • to: string

      Returns this

    • Resets the portion of the string from start to end to its original content. This undoes any modifications made to that range. Supports negative indices (counting from the end).

      Parameters

      • start: number
      • end: number

      Returns this

    • Returns the content between the specified original character positions. Supports negative indices (counting from the end).

      Parameters

      • Optionalstart: number | null
      • Optionalend: number | null

      Returns string

    • Returns a clone with content outside the specified range removed.

      Parameters

      • start: number
      • end: number

      Returns BindingMagicString

    • Returns string

    • Trims whitespace or specified characters from the start and end.

      Parameters

      • OptionalcharType: string | null

      Returns this

    • Trims whitespace or specified characters from the end.

      Parameters

      • OptionalcharType: string | null

      Returns this

    • Trims newlines from the start and end.

      Returns this

    • Trims whitespace or specified characters from the start.

      Parameters

      • OptionalcharType: string | null

      Returns this

    • Parameters

      • start: number
      • end: number
      • content: string

      Returns this