wikimedia/minify
Minification of JavaScript code and CSS stylesheets
Loading...
Searching...
No Matches
Wikimedia\Minify\IndexMap Class Reference

A class representing an index map, as defined by the source map specification. More...

Public Member Functions

 __construct ()
 Create an empty index map.
 
 outputFile (string $file)
 Set the name of the output file, to be given as the "file" key.
 
 addEncodedMap (string $mapJson, IndexMapOffset $generatedSize)
 Add a section with a source map which was encoded in the "raw" JSON format.
 
 getMap ()
 Get the index map, encoded as JSON.
 

Detailed Description

A class representing an index map, as defined by the source map specification.

This allows several mapped sources to be combined into a single file.

Member Function Documentation

◆ addEncodedMap()

Wikimedia\Minify\IndexMap::addEncodedMap ( string $mapJson,
IndexMapOffset $generatedSize )

Add a section with a source map which was encoded in the "raw" JSON format.

Parameters
string$mapJsonThe JSON-encoded source map.
IndexMapOffset$generatedSizeThe size of the generated output corresponding to $mapJson. This is used to advance the current offset and will be used to calculate the offset of the next section, if there is one.
Returns
$this

◆ getMap()

Wikimedia\Minify\IndexMap::getMap ( )

Get the index map, encoded as JSON.

Returns
string

◆ outputFile()

Wikimedia\Minify\IndexMap::outputFile ( string $file)

Set the name of the output file, to be given as the "file" key.

Parameters
string$file
Returns
$this

The documentation for this class was generated from the following file: