### Install MirrorSharp Client Library Source: https://github.com/ashmind/mirrorsharp/blob/main/README.md Install the client-side library via NPM. ```bash npm install mirrorsharp-codemirror-6-preview --save ``` -------------------------------- ### Install MirrorSharp.Owin NuGet Package Source: https://github.com/ashmind/mirrorsharp/blob/main/README.md Install the server-side package for .NET Framework applications. ```powershell Install-Package MirrorSharp.Owin ``` -------------------------------- ### Install MirrorSharp.AspNetCore NuGet Package Source: https://github.com/ashmind/mirrorsharp/blob/main/README.md Install the server-side package for ASP.NET Core applications. ```powershell Install-Package MirrorSharp.AspNetCore ``` -------------------------------- ### MirrorSharp.MirrorSharpOptionsExtensions.EnableVisualBasic Source: https://github.com/ashmind/mirrorsharp/blob/main/VisualBasic/PublicAPI.Shipped.txt Enables Visual Basic support for the MirrorSharp instance. This method is an extension on MirrorSharpOptions and accepts an optional setup action for further configuration. ```APIDOC ## EnableVisualBasic ### Description Enables Visual Basic support for the MirrorSharp configuration. This method allows for optional configuration of Visual Basic specific options. ### Signature `MirrorSharpOptions EnableVisualBasic(this MirrorSharpOptions options, Action setup = null)` ### Parameters - **options** (MirrorSharpOptions) - Required - The current MirrorSharp configuration instance. - **setup** (Action) - Optional - A delegate to configure specific Visual Basic options. ### Returns - **MirrorSharpOptions** - The updated configuration instance. ``` -------------------------------- ### Get and Set Editor Value Source: https://github.com/ashmind/mirrorsharp/blob/main/WebAssets/docs/migration-from-2.md Use the getText and setText methods on the editor instance to manipulate content after initialization. ```typescript const ms = mirrorsharp(container); ms.setText(ms.getText() + " // changed"); ``` -------------------------------- ### Initialize MirrorSharp Client Source: https://github.com/ashmind/mirrorsharp/blob/main/README.md Import and initialize the MirrorSharp client with a service URL. ```javascript import mirrorsharp from 'mirrorsharp-codemirror-6-preview'; mirrorsharp(container, { serviceUrl: 'wss://your_app_root/mirrorsharp' }); ``` -------------------------------- ### Configure MirrorSharp in Owin Startup Source: https://github.com/ashmind/mirrorsharp/blob/main/README.md Map the MirrorSharp endpoint within the Owin Startup class. ```csharp app.MapMirrorSharp("/mirrosharp"); ``` -------------------------------- ### MirrorSharpOptionsExtensions.EnablePhp Source: https://github.com/ashmind/mirrorsharp/blob/main/Php/PublicAPI.Shipped.txt Enables PHP support for the MirrorSharp options instance. ```APIDOC ## EnablePhp ### Description Enables PHP support for the MirrorSharp configuration. ### Signature `public static MirrorSharpOptions EnablePhp(this MirrorSharpOptions options, Action setup = null)` ### Parameters - **options** (MirrorSharpOptions) - Required - The MirrorSharp options instance. - **setup** (Action) - Optional - A configuration action to customize PHP options. ``` -------------------------------- ### UseMirrorSharp Source: https://github.com/ashmind/mirrorsharp/blob/main/Owin/PublicAPI.Shipped.txt Adds the MirrorSharp middleware to the OWIN pipeline. ```APIDOC ## UseMirrorSharp ### Description Adds the MirrorSharp middleware to the OWIN application builder. ### Signature - `UseMirrorSharp(this IAppBuilder app, MirrorSharpOptions? options = null)` ### Parameters - **app** (IAppBuilder) - Required - The OWIN application builder. - **options** (MirrorSharpOptions) - Optional - Configuration options for MirrorSharp. ``` -------------------------------- ### Initialize Mirrorsharp Editor Source: https://github.com/ashmind/mirrorsharp/blob/main/WebAssets/docs/migration-from-2.md The initialization contract now requires a container element instead of a textarea. ```typescript // New: // HTML:
mirrorsharp(document.getElementById('editor')); // Old: // HTML: mirrorsharp(document.getElementById('editor')); ``` -------------------------------- ### MirrorSharpOptionsExtensions.EnableFSharp Source: https://github.com/ashmind/mirrorsharp/blob/main/FSharp/PublicAPI.Shipped.txt Extension method to enable F# support within the MirrorSharp configuration. ```APIDOC ## EnableFSharp ### Description Enables F# support for a MirrorSharp instance using the provided configuration options. ### Signature `static MirrorSharp.MirrorSharpOptions.EnableFSharp(this MirrorSharpOptions options, Action? setup = null)` ``` -------------------------------- ### UseMirrorSharp Source: https://github.com/ashmind/mirrorsharp/blob/main/AspNetCore/PublicAPI.Shipped.txt Adds the MirrorSharp middleware to the application request pipeline. ```APIDOC ## UseMirrorSharp ### Description Adds the MirrorSharp middleware to the application request pipeline. ### Signature `IApplicationBuilder UseMirrorSharp(this IApplicationBuilder app, MirrorSharpOptions? options = null)` ### Parameters - **app** (IApplicationBuilder) - Required - The application builder instance. - **options** (MirrorSharpOptions) - Optional - Configuration options for MirrorSharp. ``` -------------------------------- ### MapMirrorSharp Source: https://github.com/ashmind/mirrorsharp/blob/main/Owin/PublicAPI.Shipped.txt Maps the MirrorSharp middleware to a specific path in the OWIN pipeline. ```APIDOC ## MapMirrorSharp ### Description Maps the MirrorSharp middleware to the specified path within the OWIN application builder. ### Signature - `MapMirrorSharp(this IAppBuilder app, string path)` - `MapMirrorSharp(this IAppBuilder app, string path, MirrorSharpOptions? options = null)` - `MapMirrorSharp(this IAppBuilder app, string path, MirrorSharpOptions? options = null, MirrorSharpServices? services = null)` ### Parameters - **app** (IAppBuilder) - Required - The OWIN application builder. - **path** (string) - Required - The path to map the middleware to. - **options** (MirrorSharpOptions) - Optional - Configuration options for MirrorSharp. - **services** (MirrorSharpServices) - Optional - Custom services for MirrorSharp. ``` -------------------------------- ### MapMirrorSharp (IApplicationBuilder) Source: https://github.com/ashmind/mirrorsharp/blob/main/AspNetCore/PublicAPI.Shipped.txt Maps the MirrorSharp middleware to a specific path using the IApplicationBuilder interface. ```APIDOC ## MapMirrorSharp(IApplicationBuilder) ### Description Maps the MirrorSharp middleware to the specified path within the application request pipeline. ### Signature `IApplicationBuilder MapMirrorSharp(this IApplicationBuilder app, PathString path, MirrorSharpOptions? options = null)` ### Parameters - **app** (IApplicationBuilder) - Required - The application builder instance. - **path** (PathString) - Required - The path at which to map MirrorSharp. - **options** (MirrorSharpOptions) - Optional - Configuration options for MirrorSharp. ``` -------------------------------- ### FSharpFileSystem.RegisterVirtualFile Source: https://github.com/ashmind/mirrorsharp/blob/main/FSharp/PublicAPI.Shipped.txt Registers a virtual file within the F# file system. ```APIDOC ## RegisterVirtualFile ### Description Registers a memory stream as a virtual file for the F# compiler to consume. ### Signature `static FSharpFileSystem.RegisterVirtualFile(MemoryStream stream) -> FSharpVirtualFile` ``` -------------------------------- ### IFSharpSession.CompileAsync Source: https://github.com/ashmind/mirrorsharp/blob/main/FSharp/PublicAPI.Unshipped.txt Compiles the current F# session into an assembly stream. ```APIDOC ## CompileAsync ### Description Compiles the F# session code into the provided memory stream and returns diagnostic information along with an integer result. ### Signature `ValueTask> CompileAsync(MemoryStream assemblyStream, CancellationToken cancellationToken)` ### Parameters - **assemblyStream** (System.IO.MemoryStream) - Required - The stream where the compiled assembly will be written. - **cancellationToken** (System.Threading.CancellationToken) - Required - Token to monitor for cancellation requests. ### Returns - **ValueTask>** - A task representing the asynchronous operation, containing an array of FSharpDiagnostic objects and an integer result code. ``` -------------------------------- ### IFSharpSession Source: https://github.com/ashmind/mirrorsharp/blob/main/FSharp/PublicAPI.Shipped.txt The primary interface for interacting with an F# work session, providing access to compiler results, diagnostics, and project options. ```APIDOC ## IFSharpSession ### Description Provides methods and properties to manage an F# session, including parsing, checking, and diagnostic conversion. ### Methods - **ParseAndCheckAsync(CancellationToken)**: Performs parsing and checking of the current file asynchronously. - **GetLastParseResults()**: Retrieves the most recent F# parse results. - **GetLastCheckAnswer()**: Retrieves the most recent F# check results. - **ConvertToDiagnostic(FSharpDiagnostic)**: Converts an F# diagnostic into a Roslyn-compatible diagnostic. - **ConvertToOffset(int, int)**: Converts line and column coordinates to a character offset. ``` -------------------------------- ### Configure MirrorSharp in ASP.NET Core Source: https://github.com/ashmind/mirrorsharp/blob/main/README.md Configure the MirrorSharp endpoint using either Endpoint Routing or direct mapping. ```csharp app.UseEndpoints(endpoints => { // ... endpoints.MapMirrorSharp("/mirrorsharp"); }); ``` ```csharp app.MapMirrorSharp("/mirrosharp"); ``` -------------------------------- ### Set Initial Editor Value Source: https://github.com/ashmind/mirrorsharp/blob/main/WebAssets/docs/migration-from-2.md Use the text option to define the initial content of the editor. ```typescript mirrorsharp(container, { text: 'initial' }); ``` -------------------------------- ### MapMirrorSharp (IEndpointRouteBuilder) Source: https://github.com/ashmind/mirrorsharp/blob/main/AspNetCore/PublicAPI.Shipped.txt Maps the MirrorSharp middleware using the IEndpointRouteBuilder interface for endpoint routing. ```APIDOC ## MapMirrorSharp(IEndpointRouteBuilder) ### Description Maps the MirrorSharp middleware to the specified pattern using endpoint routing. ### Signature `IEndpointConventionBuilder MapMirrorSharp(this IEndpointRouteBuilder endpoints, string pattern, MirrorSharpOptions? options = null)` ### Parameters - **endpoints** (IEndpointRouteBuilder) - Required - The endpoint route builder instance. - **pattern** (string) - Required - The route pattern. - **options** (MirrorSharpOptions) - Optional - Configuration options for MirrorSharp. ``` -------------------------------- ### MirrorSharpRoslynOptions.AnalyzerReferences Source: https://github.com/ashmind/mirrorsharp/blob/main/Common/PublicAPI.Shipped.txt Access and modify analyzer references for Roslyn-based configurations. ```APIDOC ## MirrorSharp.Advanced.MirrorSharpRoslynOptions.AnalyzerReferences ### Description Provides access to the list of analyzer references used by the Roslyn configuration. ### Methods - **get**: Returns `System.Collections.Immutable.ImmutableList` - **set**: Sets the analyzer references list. ``` -------------------------------- ### WorkSessionExtensions.Php Source: https://github.com/ashmind/mirrorsharp/blob/main/Php/PublicAPI.Shipped.txt Retrieves the PHP session interface from a work session. ```APIDOC ## Php ### Description Accesses the IPhpSession interface from the current work session. ### Signature `public static IPhpSession Php(this IWorkSession session)` ### Parameters - **session** (IWorkSession) - Required - The current work session. ``` -------------------------------- ### FastJsonWriterExtensions.WriteProperty Source: https://github.com/ashmind/mirrorsharp/blob/main/Common/PublicAPI.Shipped.txt Extension methods for writing properties to an IFastJsonWriter instance. ```APIDOC ## MirrorSharp.Advanced.FastJsonWriterExtensions.WriteProperty ### Description Writes a property with a specified name and value to the provided IFastJsonWriter. ### Supported Types - ArraySegment - ImmutableArray - StringBuilder - bool - char - int - string ``` -------------------------------- ### MirrorSharpOptions.SlowUpdate Source: https://github.com/ashmind/mirrorsharp/blob/main/Common/PublicAPI.Shipped.txt Configures the SlowUpdate setting for MirrorSharp instances. ```APIDOC ## MirrorSharp.MirrorSharpOptions.SlowUpdate.set ### Description Sets the SlowUpdate configuration for the MirrorSharp options. ### Signature `void SlowUpdate(Action<...> value)` ``` -------------------------------- ### WorkSessionExtensions.IsPhp Source: https://github.com/ashmind/mirrorsharp/blob/main/Php/PublicAPI.Shipped.txt Checks if the current work session is a PHP session. ```APIDOC ## IsPhp ### Description Determines whether the provided work session is a PHP session. ### Signature `public static bool IsPhp(this IWorkSession session)` ### Parameters - **session** (IWorkSession) - Required - The current work session. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.