// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; namespace Microsoft.Extensions.WebEncoders { /// /// Provides services for JavaScript-escaping strings. /// public interface IJavaScriptStringEncoder { /// /// JavaScript-escapes a character array and writes the result to the /// supplied output. /// /// /// The encoded value is appropriately encoded for inclusion inside a quoted JSON string. /// void JavaScriptStringEncode(char[] value, int startIndex, int charCount, TextWriter output); /// /// JavaScript-escapes a given input string. /// /// /// The JavaScript-escaped value, or null if the input string was null. /// The encoded value is appropriately encoded for inclusion inside a quoted JSON string. /// string JavaScriptStringEncode(string value); /// /// JavaScript-escapes a given input string and writes the /// result to the supplied output. /// /// /// The encoded value is appropriately encoded for inclusion inside a quoted JSON string. /// void JavaScriptStringEncode(string value, int startIndex, int charCount, TextWriter output); } }