diff --git a/Documentation/Function/Image.Image-2.html b/Documentation/Function/Image.Image-2.html new file mode 100644 index 00000000..94059c70 --- /dev/null +++ b/Documentation/Function/Image.Image-2.html @@ -0,0 +1,66 @@ +
Generated using TypeDoc
Creates a sharp instance from an image
+Optional
options: SharpOptionsObject with optional attributes.
+A sharp instance that can be used to chain operations
+ +Invalid parameters
+Optional
input: string | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array | ArrayBuffer | BufferOptional
options: SharpOptionsGenerated using TypeDoc
Generated using TypeDoc
Merges multiple objects of type Ts using the provided merge functions and built-in metadata.
+Rest
...Objects: TsGenerated using TypeDoc
Optional
afterCalled right after compress() is run.
+Optional
beforeCalled right after parse is run.
+Optional
cloneTransform a copy of input AST if true. Useful in case of AST reuse.
+false
+
+Optional
commentsSpecify what comments to leave:
+AstroCompress false
+
+
+csso true
+
+Optional
debugOutput debug information to stderr.
+false
+
+Optional
filenameFilename of input CSS, uses for source map generation.
+'<unknown>'
+
+Optional
forceEnables merging of
+rules with the same media query by splitted by other rules. +The optimisation is unsafe in general, but should work fine in most cases. Use it on your own risk.
+ +AstroCompress true
+
+
+csso false
+
+Optional
loggerFunction to track every step of transformation.
+Optional
restructureDisable or enable a structure optimisations.
+AstroCompress false
+
+
+csso true
+
+Optional
sourceGenerate a source map when true.
+false
+
+Optional
usageUsage data for advanced optimisations.
+Generated using TypeDoc
Optional
analyzeWhether to analyze dependencies (e.g. @import
and url()
).
+When enabled, @import
rules are removed, and url()
dependencies
+are replaced with hashed placeholders that can be replaced with the final
+urls later (after bundling). Dependencies are returned as part of the result.
Optional
cssWhether to compile this file as a CSS module.
+Optional
customDefines how to parse custom CSS at-rules. Each at-rule can have a prelude, defined using a CSS +syntax string, and +a block body. The body can be a declaration list, rule list, or style block as defined in the +css spec.
+Optional
draftsWhether to enable parsing various draft syntax.
+Optional
errorWhether to ignore invalid rules and declarations rather than erroring. +When enabled, warnings are returned, and the invalid rule or declaration is +omitted from the output code.
+Optional
excludeFeatures that should never be compiled, even when unsupported by targets.
+Optional
includeFeatures that should always be compiled, even when supported by targets.
+Optional
inputAn input source map to extend.
+Optional
minifyWhether to enable minification
+AstroCompress true
+
+
+lightningcss false
+
+Optional
nonWhether to enable various non-standard syntax.
+Optional
projectAn optional project root path, used as the source root in the output source map. +Also used to generate relative paths for sources used in CSS module hashes.
+Optional
pseudoReplaces user action pseudo classes with class names that can be applied from JavaScript. +This is useful for polyfills, for example.
+Optional
sourceWhether to output a source map.
+Optional
targetsThe browser targets for the generated code.
+Optional
unusedA list of class names, ids, and custom identifiers (e.g. @keyframes) that are known +to be unused. These will be removed during minification. Note that these are not +selectors but individual names (without any . or # prefixes).
+Optional
visitorAn AST visitor object. This allows custom transforms or analysis to be implemented in JavaScript.
+Multiple visitors can be composed into one using the composeVisitors
function.
+For optimal performance, visitors should be as specific as possible about what types of values
+they care about so that JavaScript has to be called as little as possible.
Generated using TypeDoc
Optional
avifOptional
gifOptional
heifOptional
jpegOptional
pngOptional
tiffOptional
webpGenerated using TypeDoc
The size after the action.
+The size before the action.
+The input file.
+The output file.
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Optional
ActionAction pipe configuration.
+Optional
CSScsso & lightningcss option properties
+Optional
CacheConfiguration for the target cache.
+{ Search: "./", Folder: "./Cache" }
+
+Optional
ExcludeCriteria for excluding files.
+Optional
FilesFile patterns to be matched.
+Optional
HTMLhtml-minifier-terser option properties
+Optional
Imagesharp option properties
+Optional
Javaterser option properties
+Optional
LoggerDebugging level.
+2
+
+Optional
MapMap to different file paths
+Optional
ParserParsers for different file types
+Optional
PathConfiguration for the target path(s).
+"./Target"
+
+Optional
SVGsvgo option properties
+Generated using TypeDoc
Optional
CSSOptional
HTMLOptional
ImageOptional
JavaOptional
SVGGenerated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
| |||
AstroCritters 🦔 AstroJS GoogleChromeLabs Critters integration. Inline your critical CSS with Astro. | AstroRome 🏛️ AstroJS Rome tools. Format, lint and check your Astro website with Rome. |
This Astro integration brings compression utilities to +your Astro project.
+CSS / HTML / JavaScript / +Image / SVG
+++Note
++
AstroCompress
will not compress your requests, only your statically +generated build and pre-rendered routes.
++[!IMPORTANT]
+Use
+AstroCompress
last in your integration list for the best optimization.
There are two ways to add integrations to your project. Let's try the most +convenient option first!
+astro add
commandAstro includes a CLI tool for adding first party integrations: astro add
. This
+command will:
astro.config.*
file to apply this integrationTo install AstroCompress
, run the following from your project directory and
+follow the prompts:
Using NPM:
+npx astro add astro-compress
+
+Using Yarn:
+yarn astro add astro-compress
+
+Using PNPM:
+pnpx astro add astro-compress
+
+First, install the AstroCompress
integration like so:
npm install -D -E astro-compress
+
+Then, apply this integration to your astro.config.*
file using the
+integrations
property:
astro.config.ts
import Compress from "astro-compress";
export default { integrations: [Compress()] };
+
+The utility will now automatically compress all your CSS, HTML, SVG, JavaScript
+and image files in the Astro outDir
folder.
The following image file types will be compressed via sharp:
+SVG compression is supported via svgo.
+You can override any of the default options from the configurations of:
+or disable them entirely:
+astro.config.ts
import Compress from "astro-compress";
export default {
integrations: [
Compress({
CSS: false,
HTML: false,
Image: false,
JavaScript: false,
SVG: false,
}),
],
};
+
+You can add multiple paths to compress by specifying an array as the Path
+variable.
astro.config.ts
import Compress from "astro-compress";
export default {
integrations: [
Compress({
Path: ["./Target", "./Build"],
}),
],
};
+
+You can also provide a map of paths for different input output directories.
+astro.config.ts
import Compress from "astro-compress";
export default {
integrations: [
Compress({
Path: new Map([["./Source", "./Target"]]),
}),
],
};
+
+Or an array of the two.
+astro.config.ts
import Compress from "astro-compress";
export default {
integrations: [
Compress({
Path: [
// Compress Target
"./Target",
// Compress Target one more time into a different directory
new Map([["./Target", "./TargetCompress"]]),
],
}),
],
};
+
+You can filter files to exclude specific ones from compression. A filter can be +an array of regular expressions or a single match. You can also use functions to +match on file names:
+astro.config.ts
import Compress from "astro-compress";
export default {
integrations: [
Compress({
Exclude: [
"File.png",
(File: string) =>
File === "./Target/Favicon/Image/safari-pinned-tab.svg",
],
}),
],
};
+
+You can control the logging level by setting the Logger
parameter. The default
+value is 2
, but you can set it to 0
if you don't want to see debug messages:
astro.config.ts
import Compress from "astro-compress";
export default {
integrations: [
Compress({
Logger: 0,
}),
],
};
+
+See CHANGELOG.md for a history of changes to this integration.
+Generated using TypeDoc
biome-ignore lint/suspicious/noExplicitAny:
+