### Install Inline Integration with NPM Source: https://github.com/playform/inline/blob/Current/README.md Use the `astro add` command with NPM to install the Inline integration and update your configuration. ```sh npx astro add @playform/inline ``` -------------------------------- ### Manually Install Inline Integration Dependencies Source: https://github.com/playform/inline/blob/Current/README.md Install the Inline integration as a development dependency using npm. ```sh npm install -D -E @playform/inline ``` -------------------------------- ### Install Inline Integration with PNPM Source: https://github.com/playform/inline/blob/Current/README.md Use the `astro add` command with PNPM to install the Inline integration and update your configuration. ```sh pnpx astro add @playform/inline ``` -------------------------------- ### Install Inline Integration with Yarn Source: https://github.com/playform/inline/blob/Current/README.md Use the `astro add` command with Yarn to install the Inline integration and update your configuration. ```sh yarn astro add @playform/inline ``` -------------------------------- ### Example of npm overrides to fix transitive dependency issues Source: https://github.com/playform/inline/blob/Current/Documentation/GitHub/Why-Astro-Is-Not-In-peerDependencies.md This JSON snippet shows how to use the 'overrides' field in package.json to manually specify a version for a transitive dependency, which was a workaround for a version conflict with Astro. ```json { "overrides": { "@astrojs/internal-helpers": "0.8.0" } } ``` -------------------------------- ### Interface Source: https://github.com/playform/inline/blob/Current/docs/interfaces/Interface_Integration.Interface.html Initializes the Interface with optional settings and returns an AstroIntegration. ```APIDOC ## Interface Interface ### Description Initializes the Interface with optional settings and returns an AstroIntegration. ### Method (Constructor) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters #### Optional * **Option** ([Interface](Interface_Option.Interface.html)) - Optional - Configuration options for the Interface. ### Returns AstroIntegration * An AstroIntegration object. ### Response Example ```json { "example": "AstroIntegration object" } ``` ``` -------------------------------- ### Array of Paths with Map for Inlining Source: https://github.com/playform/inline/blob/Current/README.md Configure the Inline integration with an array that includes both direct paths and a Map for input-output mapping. ```ts export default { integrations: [ (await import("@playform/inline")).default({ Path: [ // Inline Target "./Target", // Inline Target one more time into a different directory new Map([["./Target", "./TargetInline"]]), ], }), ], }; ``` -------------------------------- ### Input-Output Path Mapping for Inlining Source: https://github.com/playform/inline/blob/Current/README.md Use a Map to define specific input-output directory mappings for the Inline integration. ```ts export default { integrations: [ (await import("@playform/inline")).default({ Path: new Map([["./Source", "./Target"]]), }), ], }; ``` -------------------------------- ### Add Multiple Paths for Inlining Source: https://github.com/playform/inline/blob/Current/README.md Specify an array of paths to inline multiple directories in your Astro configuration. ```ts export default { integrations: [ (await import("@playform/inline")).default({ Path: ["./Target", "./Build"], }), ], }; ``` -------------------------------- ### Input-Output Path Mapping for Inline Source: https://github.com/playform/inline/blob/Current/docs/index.html Provide a map or array of maps to specify distinct input and output directories for inlining. ```typescript export default { integrations: [ (await import("@playform/inline")).default({ Path: new Map([["./Source", "./Target"]]), }), ], }; ``` ```typescript export default { integrations: [ (await import("@playform/inline")).default({ Path: [ // Inline Target "./Target", // Inline Target one more time into a different directory new Map([["./Target", "./TargetInline"]]), ], }), ], }; ``` -------------------------------- ### Set Theme from Local Storage Source: https://github.com/playform/inline/blob/Current/docs/hierarchy.html This snippet sets the document's theme based on a value stored in local storage, defaulting to 'os' if no theme is found. It then hides the body and shows the app page or removes the display property after a delay. ```javascript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Apply Inline Integration Manually Source: https://github.com/playform/inline/blob/Current/README.md Apply the Inline integration to your Astro configuration file by adding it to the `integrations` property. ```ts export default { integrations: [(await import("@playform/inline")).default()], }; ``` -------------------------------- ### Interface Beasties Configuration Source: https://github.com/playform/inline/blob/Current/docs/interfaces/Interface_Beasties.Interface.html The Interface Beasties defines a set of optional properties that can be used to configure how assets are inlined or preloaded. These properties allow for fine-grained control over performance and resource loading. ```APIDOC ## Interface Beasties ### Description Defines configuration options for asset inlining and preloading. ### Properties #### `Optional` path - **Type**: `string` - **Description**: Overrides the default path. #### `Optional` publicPath - **Type**: `string` - **Description**: Overrides the default public path. #### `Optional` external - **Type**: `boolean` - **Description**: Determines if assets should be treated as external. #### `Optional` inlineThreshold - **Type**: `number` - **Description**: The threshold in bytes for inlining assets. #### `Optional` minimumExternalSize - **Type**: `number` - **Description**: The minimum size in bytes for an asset to be considered external. #### `Optional` pruneSource - **Type**: `boolean` - **Description**: Whether to prune source assets after processing. #### `Optional` mergeStylesheets - **Type**: `boolean` - **Description**: Whether to merge multiple stylesheets into one. #### `Optional` additionalStylesheets - **Type**: `string[]` - **Description**: An array of additional stylesheets to include. #### `Optional` preload - **Type**: `"body" | "media" | "swap" | "js" | "js-lazy"` - **Description**: Specifies the preload strategy for assets. #### `Optional` noscriptFallback - **Type**: `boolean` - **Description**: Enables a fallback for environments without JavaScript. #### `Optional` inlineFonts - **Type**: `boolean` - **Description**: Whether to inline font files. #### `Optional` preloadFonts - **Type**: `boolean` - **Description**: Whether to preload font files. #### `Optional` fonts - **Type**: `boolean` - **Description**: Enables font processing. #### `Optional` keyframes - **Type**: `string` - **Description**: Specifies CSS keyframes to include. #### `Optional` compress - **Type**: `boolean` - **Description**: Whether to compress assets. #### `Optional` logLevel - **Type**: `"info" | "warn" | "error" | "trace" | "debug" | "silent"` - **Description**: The logging level for the inline process. #### `Optional` reduceInlineStyles - **Type**: `boolean` - **Description**: Whether to reduce the size of inline styles. #### `Optional` logger - **Type**: `Interface` - **Description**: A custom logger instance. #### `Optional` remote - **Type**: `boolean` - **Description**: Whether to allow remote assets. #### `Optional` allowRules - **Type**: `(string | RegExp)[]` - **Description**: Rules to allow specific assets. #### `Optional` safeParser - **Type**: `boolean` - **Description**: Whether to use a safe parser for CSS. ``` -------------------------------- ### Interface Option Properties Source: https://github.com/playform/inline/blob/Current/docs/interfaces/Interface_Option.Interface.html Defines the configurable properties for the Interface Option, including Beasties, Cache, Path, Exclude, File, Action, and Logger. Each property can be configured with various types and may have default values. ```APIDOC ## Interface Option ### Description This interface defines the available configuration options for the @playform/inline package. It allows users to customize various aspects of the inline process, such as caching, path handling, file exclusion, and logging. ### Properties #### Beasties - **Type**: `boolean` | `Interface` (from `Interface_Beasties.Interface`) - **Optional** - **Description**: Configuration related to 'Beasties'. #### Cache - **Type**: `boolean` | `Interface` - **Optional** - **Description**: Configuration for the target cache. - **Default**: `{ Search: "./", Folder: "./Cache" }` #### Path - **Type**: `boolean` | `Type` | `Type[]` | `Set` - **Optional** - **Description**: Configuration for the target path(s). - **Default**: "./Target" #### Exclude - **Type**: `boolean` | `Type` | `Type[]` | `Set` - **Optional** - **Description**: Criteria for excluding files. #### File - **Type**: `string` | `boolean` | `string[]` - **Optional** - **Description**: File patterns to be matched. #### Action - **Type**: `boolean` | `Interface` - **Optional** - **Description**: Action pipe configuration. #### Logger - **Type**: `boolean` | `Type` - **Optional** - **Description**: Debugging level. - **Default**: `2` ``` -------------------------------- ### Interface Beasties Properties Source: https://github.com/playform/inline/blob/Current/docs/interfaces/Interface_Beasties.Interface.html This section details the optional properties available for the Interface.Beasties, which allow for customization of inline behavior such as font preloading, style compression, and logging. ```APIDOC ## Interface Beasties Properties This interface defines optional configuration properties for customizing the behavior of the PlayForm inline functionality. ### Properties - **noscriptFallback** (boolean) - Optional - Overrides Options.noscriptFallback. - **inlineFonts** (boolean) - Optional - Overrides Options.inlineFonts. - **preloadFonts** (boolean) - Optional - Overrides Options.preloadFonts. - **fonts** (boolean) - Optional - Overrides Options.fonts. - **keyframes** (string) - Optional - Overrides Options.keyframes. - **compress** (boolean) - Optional - Overrides Options.compress. - **logLevel** ("info" | "warn" | "error" | "trace" | "debug" | "silent") - Optional - Overrides Options.logLevel. - **reduceInlineStyles** (boolean) - Optional - Overrides Options.reduceInlineStyles. - **logger** ([Interface](Beasties.Interface.html)) - Optional - Overrides Options.logger. - **remote** (boolean) - Optional - Inherited from Options.remote. - **allowRules** (Array) - Optional - Inherited from Options.allowRules. - **safeParser** (boolean) - Optional - Inherited from Options.safeParser. ``` -------------------------------- ### Logger Methods Source: https://github.com/playform/inline/blob/Current/docs/interfaces/Beasties.Interface.html This interface defines optional methods for logging messages. Each method accepts a string message and is intended for a specific logging level. ```APIDOC ## Interface: Beasties.Interface ### Description Provides optional methods for logging messages at various severity levels. ### Methods #### trace - **Description**: Logs a trace message. - **Parameters**: - `message` (string) - The message to log. #### debug - **Description**: Logs a debug message. - **Parameters**: - `message` (string) - The message to log. #### info - **Description**: Logs an informational message. - **Parameters**: - `message` (string) - The message to log. #### warn - **Description**: Logs a warning message. - **Parameters**: - `message` (string) - The message to log. #### error - **Description**: Logs an error message. - **Parameters**: - `message` (string) - The message to log. ``` -------------------------------- ### Variable Option Type Declaration Source: https://github.com/playform/inline/blob/Current/docs/variables/Variable_Option.option.html This section details the structure of the 'option' variable, outlining its properties and their types. It includes nested structures for 'Cache' and 'Action', as well as specific methods within 'Action'. ```APIDOC ## Variable Option ### Description Represents a configuration option with various properties related to file handling, caching, logging, and actions. ### Type Declaration * **File**: `string` * **Cache**: `{ Search: string; Folder: string }` * **Search**: `string` * **Folder**: `string` * **Path**: `string` * **Logger**: `2` * **Action**: `{ ... }` * **Accomplished**: `false` * **Failed**: `(On: Interface) => Promise` * **Fulfilled**: `(__namedParameters: Interface) => Promise` * **Read**: `(__namedParameters: Interface) => Promise` * **Wrote**: `(__namedParameters: Interface) => Promise` * **Passed**: `(On: Interface) => Promise` * **Changed**: `(Plan: Interface) => Promise` * **Exclude**: `false` * **Beasties**: `Interface` (Referencing `Interface_Beasties.Interface`) ### Source Defined in [Application/PlayForm/NPM/Inline/Source/Variable/Option.ts:7](https://github.com/PlayForm/Inline/blob/Current/Source/Variable/Option.ts#L7) ``` -------------------------------- ### Info Method Signature Source: https://github.com/playform/inline/blob/Current/docs/interfaces/Beasties.Interface.html Signature for the optional info logging method. Use this for general informational messages. ```typescript info?: (message: string) => void; ``` -------------------------------- ### File Filtering for Exclusion Source: https://github.com/playform/inline/blob/Current/README.md Exclude specific files from inlining using an array of strings, regular expressions, or filter functions in the Inline integration configuration. ```ts export default { integrations: [ (await import("@playform/inline")).default({ Exclude: [ "File.html", (File: string) => File === "./Target/index.html", ], }), ], }; ``` -------------------------------- ### Interface Definition Source: https://github.com/playform/inline/blob/Current/docs/interfaces/Beasties.Interface.html Defines the structure of the Interface for logging methods. These methods are optional and accept a string message. ```typescript interface Interface { [trace](#trace)?: (message: string) => void; [debug](#debug)?: (message: string) => void; [info](#info)?: (message: string) => void; [warn](#warn)?: (message: string) => void; [error](#error)?: (message: string) => void; } ``` -------------------------------- ### Disable Beasties in Inline Integration Source: https://github.com/playform/inline/blob/Current/README.md Configure the Inline integration to disable Beasties by setting `Beasties` to `false`. ```ts export default { integrations: [ (await import("@playform/inline")).default({ Beasties: false, }), ], }; ``` -------------------------------- ### Trace Method Signature Source: https://github.com/playform/inline/blob/Current/docs/interfaces/Beasties.Interface.html Signature for the optional trace logging method. Use this for detailed, low-level message logging. ```typescript trace?: (message: string) => void; ``` -------------------------------- ### Warn Method Signature Source: https://github.com/playform/inline/blob/Current/docs/interfaces/Beasties.Interface.html Signature for the optional warn logging method. Use this for warning messages that do not stop execution. ```typescript warn?: (message: string) => void; ``` -------------------------------- ### Debug Method Signature Source: https://github.com/playform/inline/blob/Current/docs/interfaces/Beasties.Interface.html Signature for the optional debug logging method. Use this for debugging information. ```typescript debug?: (message: string) => void; ``` -------------------------------- ### Variable Option Type Declaration Source: https://github.com/playform/inline/blob/Current/docs/variables/Variable_Option.option.html This is the main type declaration for the 'option' variable. It defines the structure for file paths, cache settings, logging levels, and various action methods. ```typescript option: { File: string; Cache: { Search: string; Folder: string }; Path: string; Logger: 2; Action: { Accomplished: false; Failed: (On: Interface) => Promise; Fulfilled: (__namedParameters: Interface) => Promise; Read: (__namedParameters: Interface) => Promise; Wrote: (__namedParameters: Interface) => Promise; Passed: (On: Interface) => Promise; Changed: (Plan: Interface) => Promise; }; Exclude: false; Beasties: Interface; } ``` -------------------------------- ### Control Logging Level Source: https://github.com/playform/inline/blob/Current/README.md Set the `Logger` parameter to `0` in the Inline integration configuration to disable debug messages. ```ts export default { integrations: [ (await import("@playform/inline")).default({ Logger: 0, }), ], }; ``` -------------------------------- ### Error Method Signature Source: https://github.com/playform/inline/blob/Current/docs/interfaces/Beasties.Interface.html Signature for the optional error logging method. Use this for error messages. ```typescript error?: (message: string) => void; ``` -------------------------------- ### Merge Source: https://github.com/playform/inline/blob/Current/docs/variables/Function_Integration.Merge.html The Merge function is a utility for deep merging multiple objects. It supports custom configurations for merging records, arrays, sets, maps, and other types, providing a flexible way to combine data structures. ```APIDOC ## Merge ### Description Deeply merges multiple objects into a single object. This function allows for custom merge strategies for various data types like records, arrays, sets, and maps, offering fine-grained control over the merging process. ### Method (Not applicable, this is a function signature) ### Parameters #### Type Parameters * **Ts** - A readonly tuple of objects to be merged. #### Parameters * **...objects**: [Ts] - A variable number of objects to merge. ### Returns * **DeepMergeHKT, Readonly<...>>** - An object representing the deep merge result, with specific configurations for different data types and parent tracking. ### Type Declaration ```typescript (...objects: Ts) => DeepMergeHKT< Ts, Readonly<{ DeepMergeRecordsURI: "DeepMergeRecordsDefaultURI"; DeepMergeArraysURI: "DeepMergeArraysDefaultURI"; DeepMergeSetsURI: "DeepMergeSetsDefaultURI"; DeepMergeMapsURI: "DeepMergeMapsDefaultURI"; DeepMergeOthersURI: "DeepMergeLeafURI"; DeepMergeFilterValuesURI: "DeepMergeFilterValuesDefaultURI"; }>, Readonly<{ key: PropertyKey; parents: readonly Readonly>[] }> > ``` ``` -------------------------------- ### merge Source: https://github.com/playform/inline/blob/Current/docs/variables/Merge.merge.html Deeply merges multiple objects into a single object. It allows for customization of merge strategies for different data types like records, arrays, sets, and maps. ```APIDOC ## merge ### Description Deeply merges multiple objects into a single object. It allows for customization of merge strategies for different data types like records, arrays, sets, and maps. ### Method (Function Signature) ### Parameters #### Type Parameters * `Ts` extends `readonly unknown[]` #### Parameters * `...objects`: `Ts` - The objects to merge. ### Returns `DeepMergeHKT, Readonly<{ key: PropertyKey; parents: readonly Readonly>[] }> >` - The deeply merged object. ### Source * Defined in Application/PlayForm/NPM/Inline/Source/Function/Merge.ts:5 ``` -------------------------------- ### Merge Function Type Declaration Source: https://github.com/playform/inline/blob/Current/docs/variables/Merge.merge.html This is the type declaration for the merge function. It accepts a variable number of objects and returns a DeepMergeHKT, specifying merge strategies for different data types and including context about the merge operation. ```typescript merge: ( ...objects: Ts, ) => DeepMergeHKT< Ts, Readonly<{ DeepMergeRecordsURI: "DeepMergeRecordsDefaultURI"; DeepMergeArraysURI: "DeepMergeArraysDefaultURI"; DeepMergeSetsURI: "DeepMergeSetsDefaultURI"; DeepMergeMapsURI: "DeepMergeMapsDefaultURI"; DeepMergeOthersURI: "DeepMergeLeafURI"; DeepMergeFilterValuesURI: "DeepMergeFilterValuesDefaultURI"; }>, Readonly<{ key: PropertyKey; parents: readonly Readonly>[] }> > ``` -------------------------------- ### Merge Function Type Declaration Source: https://github.com/playform/inline/blob/Current/docs/variables/Function_Integration.Merge.html This is the type declaration for the Merge function. It uses generics and mapped types to define a flexible deep merging utility. It allows customization of how different data types are merged. ```typescript Ts extends readonly unknown[]>( ...objects: Ts, ) => DeepMergeHKT< Ts, Readonly<{ DeepMergeRecordsURI: "DeepMergeRecordsDefaultURI"; DeepMergeArraysURI: "DeepMergeArraysDefaultURI"; DeepMergeSetsURI: "DeepMergeSetsDefaultURI"; DeepMergeMapsURI: "DeepMergeMapsDefaultURI"; DeepMergeOthersURI: "DeepMergeLeafURI"; DeepMergeFilterValuesURI: "DeepMergeFilterValuesDefaultURI"; }>, Readonly<{ key: PropertyKey; parents: readonly Readonly>[] }> > ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.