RenderResult
Hierarchy (View Summary)
- RenderResult
Index
Accessors
Constructors
Methods
Properties
Accessors
code
-
get code(): string
Rendered CSS. The bytes of RenderResult.write are decoded the first time the property is read
Returns string
Constructors
constructor
new RenderResult(
write: Uint8Array,
errors: ErrorDescription[],
stats: RenderResultStats,
map?: SourceMap,
codeLength?: number,
): RenderResult
Parameters
write: Uint8Arrayrendered css, encoded as UTF-8
errors: ErrorDescription[]stats: RenderResultStatsOptionalmap: SourceMapcodeLength: number = -1length of the decoded css (
code.length), computed when it is not provided
Returns RenderResult
Methods
to JSON
toJSON(): Record<string, any>
JSON representation: the css is serialized as a string, the bytes are not serialized
Returns Record<string, any>
Staticcode Length
codeLength(result: RenderResult): number
Internal
length of the rendered css once decoded (result.code.length), without decoding it
Parameters
result: RenderResult
Returns number
Properties
errors
Render errors
Optionalmap
Source map
stats
Render stats
write
write: Uint8Array
Rendered CSS, encoded as UTF-8
Static Readonly Internalshape
An instance is kept alive: the hidden class of the instances would otherwise be collected by a full garbage collection when no instance is alive, and the optimized code that depends on it discarded (deoptimized)
Render result.
The generated css is stored as UTF-8 bytes in RenderResult.write: it can be written to a file or sent over the network as is. RenderResult.code decodes the bytes the first time it is read, the string is kept.