diff --git a/Directory.Packages.props b/Directory.Packages.props index 1b724c73..038b7d8f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -27,6 +27,7 @@ + diff --git a/SpreadCheetah.Test/SpreadCheetah.Test.csproj b/SpreadCheetah.Test/SpreadCheetah.Test.csproj index 07efda1c..e9e45eb1 100644 --- a/SpreadCheetah.Test/SpreadCheetah.Test.csproj +++ b/SpreadCheetah.Test/SpreadCheetah.Test.csproj @@ -23,6 +23,8 @@ + + all diff --git a/SpreadCheetah.Test/Tests/PublicApiTests.PublicApi_Generate.DotNet6_0.verified.txt b/SpreadCheetah.Test/Tests/PublicApiTests.PublicApi_Generate.DotNet6_0.verified.txt new file mode 100644 index 00000000..43aa6e23 --- /dev/null +++ b/SpreadCheetah.Test/Tests/PublicApiTests.PublicApi_Generate.DotNet6_0.verified.txt @@ -0,0 +1,461 @@ +[assembly: System.CLSCompliant(true)] +[assembly: System.Reflection.AssemblyMetadata("IsTrimmable", "True")] +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/sveinungf/spreadcheetah")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("SpreadCheetah.Test")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName=".NET 6.0")] +namespace SpreadCheetah +{ + public readonly struct Cell : System.IEquatable + { + public Cell(SpreadCheetah.Formula formula, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(bool value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(System.DateTime value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(System.DateTime? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(decimal value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(double value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(int value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(long value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(float value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(bool? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(decimal? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(double? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(float? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(int? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(long? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(string? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, bool cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, System.DateTime cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, System.DateTime? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, decimal cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, double cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, int cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, long cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, float cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, bool? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, decimal? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, double? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, float? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, int? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, long? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, string? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + } + public readonly struct DataCell : System.IEquatable + { + public DataCell(bool value) { } + public DataCell(System.DateTime value) { } + public DataCell(System.DateTime? value) { } + public DataCell(decimal value) { } + public DataCell(double value) { } + public DataCell(int value) { } + public DataCell(long value) { } + public DataCell(float value) { } + public DataCell(bool? value) { } + public DataCell(decimal? value) { } + public DataCell(double? value) { } + public DataCell(float? value) { } + public DataCell(int? value) { } + public DataCell(long? value) { } + public DataCell(string? value) { } + } + public readonly struct Formula : System.IEquatable + { + public Formula(string? formulaText) { } + } + public enum SpreadCheetahCompressionLevel + { + Optimal = 0, + Fastest = 1, + } + public class SpreadCheetahException : System.Exception + { + public SpreadCheetahException() { } + public SpreadCheetahException(string message) { } + public SpreadCheetahException(string message, System.Exception exception) { } + } + public class SpreadCheetahOptions + { + public static readonly int DefaultBufferSize; + public static readonly SpreadCheetah.SpreadCheetahCompressionLevel DefaultCompressionLevel; + public static readonly int MinimumBufferSize; + public SpreadCheetahOptions() { } + public int BufferSize { get; set; } + public SpreadCheetah.SpreadCheetahCompressionLevel CompressionLevel { get; set; } + public SpreadCheetah.Styling.NumberFormat? DefaultDateTimeFormat { get; set; } + [System.Obsolete("Use SpreadCheetahOptions.DefaultDateTimeFormat instead")] + public string? DefaultDateTimeNumberFormat { get; set; } + public bool WriteCellReferenceAttributes { get; set; } + } + public sealed class Spreadsheet : System.IAsyncDisposable, System.IDisposable + { + public int NextRowNumber { get; } + public System.Threading.Tasks.ValueTask AddAsRowAsync(T obj, SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo typeInfo, System.Threading.CancellationToken token = default) { } + public void AddDataValidation(string reference, SpreadCheetah.Validations.DataValidation validation) { } + public System.Threading.Tasks.ValueTask AddHeaderRowAsync(SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo typeInfo, SpreadCheetah.Styling.StyleId? styleId = null, System.Threading.CancellationToken token = default) { } + public void AddImage(SpreadCheetah.Images.ImageCanvas canvas, SpreadCheetah.Images.EmbeddedImage image, SpreadCheetah.Images.ImageOptions? options = null) { } + public void AddNote(string cellReference, string noteText) { } + public System.Threading.Tasks.ValueTask AddRangeAsRowsAsync(System.Collections.Generic.IEnumerable objs, SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo typeInfo, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.Cell[] cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.DataCell[] cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.StyledCell[] cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.Cell[] cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.DataCell[] cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.StyledCell[] cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public SpreadCheetah.Styling.StyleId AddStyle(SpreadCheetah.Styling.Style style) { } + public void Dispose() { } + public System.Threading.Tasks.ValueTask DisposeAsync() { } + public System.Threading.Tasks.ValueTask EmbedImageAsync(System.IO.Stream stream, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask FinishAsync(System.Threading.CancellationToken token = default) { } + public void MergeCells(string cellRange) { } + public System.Threading.Tasks.ValueTask StartWorksheetAsync(string name, SpreadCheetah.Worksheets.WorksheetOptions? options = null, System.Threading.CancellationToken token = default) { } + public bool TryAddDataValidation(string reference, SpreadCheetah.Validations.DataValidation validation) { } + public static System.Threading.Tasks.ValueTask CreateNewAsync(System.IO.Stream stream, SpreadCheetah.SpreadCheetahOptions? options = null, System.Threading.CancellationToken cancellationToken = default) { } + } + public static class SpreadsheetUtility + { + public static string GetColumnName(int columnNumber) { } + public static bool TryGetColumnNameUtf8(int columnNumber, System.Span destination, out int bytesWritten) { } + public static bool TryParseColumnName(System.ReadOnlySpan columnName, out int columnNumber) { } + } + public readonly struct StyledCell : System.IEquatable + { + public StyledCell(bool value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(System.DateTime value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(System.DateTime? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(decimal value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(double value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(int value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(long value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(float value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(bool? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(decimal? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(double? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(float? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(int? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(long? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(string? value, SpreadCheetah.Styling.StyleId? styleId) { } + } +} +namespace SpreadCheetah.Images +{ + public sealed class EmbeddedImage + { + public int Height { get; } + public int Width { get; } + } + public readonly struct ImageCanvas : System.IEquatable + { + public static SpreadCheetah.Images.ImageCanvas Dimensions(System.ReadOnlySpan upperLeftReference, int width, int height, bool moveWithCells = true) { } + public static SpreadCheetah.Images.ImageCanvas FillCell(System.ReadOnlySpan cellReference, bool moveWithCells = true, bool resizeWithCells = true) { } + public static SpreadCheetah.Images.ImageCanvas FillCells(System.ReadOnlySpan upperLeftReference, System.ReadOnlySpan lowerRightReference, bool moveWithCells = true, bool resizeWithCells = true) { } + public static SpreadCheetah.Images.ImageCanvas OriginalSize(System.ReadOnlySpan upperLeftReference, bool moveWithCells = true) { } + public static SpreadCheetah.Images.ImageCanvas Scaled(System.ReadOnlySpan upperLeftReference, float scale, bool moveWithCells = true) { } + } + public readonly struct ImageOffset : System.IEquatable + { + public static SpreadCheetah.Images.ImageOffset Pixels(int left, int top, int right, int bottom) { } + } + public sealed class ImageOptions + { + public ImageOptions() { } + public SpreadCheetah.Images.ImageOffset? Offset { get; set; } + } +} +namespace SpreadCheetah.SourceGeneration +{ + [System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false)] + public sealed class ColumnHeaderAttribute : System.Attribute + { + public ColumnHeaderAttribute(string name) { } + } + [System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false)] + public sealed class ColumnOrderAttribute : System.Attribute + { + public ColumnOrderAttribute(int order) { } + } + public static class EmptyWorksheetRowContext + { + public static SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo CreateTypeInfo() { } + } + [System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true)] + public sealed class WorksheetRowAttribute : System.Attribute + { + public WorksheetRowAttribute(System.Type type) { } + } + public abstract class WorksheetRowContext + { + protected WorksheetRowContext() { } + } + [System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false)] + public sealed class WorksheetRowGenerationOptionsAttribute : System.Attribute + { + public WorksheetRowGenerationOptionsAttribute() { } + public bool SuppressWarnings { get; set; } + } + public static class WorksheetRowMetadataServices + { + public static SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo CreateObjectInfo(System.Func headerHandler, System.Func rowHandler, System.Func, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask> rowRangeHandler) { } + } + public abstract class WorksheetRowTypeInfo + { + public System.Func HeaderHandler { get; } + public System.Func RowHandler { get; } + public System.Func, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask> RowRangeHandler { get; } + } +} +namespace SpreadCheetah.Styling +{ + public sealed class Alignment : System.IEquatable + { + public Alignment() { } + public SpreadCheetah.Styling.HorizontalAlignment Horizontal { get; set; } + public int Indent { get; set; } + public SpreadCheetah.Styling.VerticalAlignment Vertical { get; set; } + public bool WrapText { get; set; } + } + public sealed class Border : System.IEquatable + { + public Border() { } + public SpreadCheetah.Styling.EdgeBorder Bottom { get; set; } + public SpreadCheetah.Styling.DiagonalBorder Diagonal { get; set; } + public SpreadCheetah.Styling.EdgeBorder Left { get; set; } + public SpreadCheetah.Styling.EdgeBorder Right { get; set; } + public SpreadCheetah.Styling.EdgeBorder Top { get; set; } + } + public enum BorderStyle + { + None = 0, + Thin = 1, + Medium = 2, + Dashed = 3, + Dotted = 4, + Thick = 5, + DoubleLine = 6, + Hair = 7, + MediumDashed = 8, + DashDot = 9, + MediumDashDot = 10, + DashDotDot = 11, + MediumDashDotDot = 12, + SlantDashDot = 13, + } + public sealed class DiagonalBorder : System.IEquatable + { + public DiagonalBorder() { } + public SpreadCheetah.Styling.BorderStyle BorderStyle { get; set; } + public System.Drawing.Color? Color { get; set; } + public SpreadCheetah.Styling.DiagonalBorderType Type { get; set; } + } + [System.Flags] + public enum DiagonalBorderType + { + None = 0, + DiagonalUp = 1, + DiagonalDown = 2, + CrissCross = 3, + } + public sealed class EdgeBorder : System.IEquatable + { + public EdgeBorder() { } + public SpreadCheetah.Styling.BorderStyle BorderStyle { get; set; } + public System.Drawing.Color? Color { get; set; } + } + public sealed class Fill : System.IEquatable + { + public Fill() { } + public System.Drawing.Color? Color { get; set; } + } + public sealed class Font : System.IEquatable + { + public Font() { } + public bool Bold { get; set; } + public System.Drawing.Color? Color { get; set; } + public bool Italic { get; set; } + public string? Name { get; set; } + public double Size { get; set; } + public bool Strikethrough { get; set; } + } + public enum HorizontalAlignment + { + None = 0, + Left = 1, + Center = 2, + Right = 3, + } + public readonly struct NumberFormat : System.IEquatable + { + public override string ToString() { } + public static SpreadCheetah.Styling.NumberFormat Custom(string formatString) { } + public static SpreadCheetah.Styling.NumberFormat Standard(SpreadCheetah.Styling.StandardNumberFormat format) { } + } + public static class NumberFormats + { + public const string DateTimeSortable = "yyyy\\-mm\\-dd\\ hh:mm:ss"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.Fraction)")] + public const string Fraction = "# ?/?"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.FractionTwoDenominatorPlaces)")] + public const string FractionTwoDenominatorPlaces = "# ??/??"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.General)")] + public const string General = "General"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.NoDecimalPlaces)")] + public const string NoDecimalPlaces = "0"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.Percent)")] + public const string Percent = "0%"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.PercentTwoDecimalPlaces)")] + public const string PercentTwoDecimalPlaces = "0.00%"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.Scientific)")] + public const string Scientific = "0.00E+00"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.Text)")] + public const string Text = "@"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.ThousandsSeparator)")] + public const string ThousandsSeparator = "#,##0"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.ThousandsSeparatorTwoDecimalPlaces" + + ")")] + public const string ThousandsSeparatorTwoDecimalPlaces = "#,##0.00"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.TwoDecimalPlaces)")] + public const string TwoDecimalPlaces = "0.00"; + } + public enum StandardNumberFormat + { + General = 0, + NoDecimalPlaces = 1, + TwoDecimalPlaces = 2, + ThousandsSeparator = 3, + ThousandsSeparatorTwoDecimalPlaces = 4, + Percent = 9, + PercentTwoDecimalPlaces = 10, + Scientific = 11, + Fraction = 12, + FractionTwoDenominatorPlaces = 13, + ShortDate = 14, + LongDate = 15, + DayMonth = 16, + MonthYear = 17, + ShortTime12hour = 18, + LongTime12hour = 19, + ShortTime = 20, + LongTime = 21, + DateAndTime = 22, + NoDecimalPlacesNegativeParenthesis = 37, + NoDecimalPlacesNegativeParenthesisRed = 38, + TwoDecimalPlacesNegativeParenthesis = 39, + TwoDecimalPlacesNegativeParenthesisRed = 40, + MinutesAndSeconds = 45, + Duration = 46, + DecimalDuration = 47, + Exponential = 48, + Text = 49, + } + public sealed class Style : System.IEquatable + { + public Style() { } + public SpreadCheetah.Styling.Alignment Alignment { get; set; } + public SpreadCheetah.Styling.Border Border { get; set; } + public SpreadCheetah.Styling.Fill Fill { get; set; } + public SpreadCheetah.Styling.Font Font { get; set; } + public SpreadCheetah.Styling.NumberFormat? Format { get; set; } + [System.Obsolete("Use Style.Format instead")] + public string? NumberFormat { get; set; } + } + public sealed class StyleId + { + public int Id { get; } + } + public enum VerticalAlignment + { + Bottom = 0, + Center = 1, + Top = 2, + } +} +namespace SpreadCheetah.Validations +{ + public sealed class DataValidation + { + public string? ErrorMessage { get; set; } + public string? ErrorTitle { get; set; } + public SpreadCheetah.Validations.ValidationErrorType ErrorType { get; set; } + public bool IgnoreBlank { get; set; } + public string? InputMessage { get; set; } + public string? InputTitle { get; set; } + public bool ShowErrorAlert { get; set; } + public bool ShowInputMessage { get; set; } + public static SpreadCheetah.Validations.DataValidation DecimalBetween(double min, double max) { } + public static SpreadCheetah.Validations.DataValidation DecimalEqualTo(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalGreaterThan(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalGreaterThanOrEqualTo(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalLessThan(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalLessThanOrEqualTo(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalNotBetween(double min, double max) { } + public static SpreadCheetah.Validations.DataValidation DecimalNotEqualTo(double value) { } + public static SpreadCheetah.Validations.DataValidation IntegerBetween(int min, int max) { } + public static SpreadCheetah.Validations.DataValidation IntegerEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerGreaterThan(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerGreaterThanOrEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerLessThan(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerLessThanOrEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerNotBetween(int min, int max) { } + public static SpreadCheetah.Validations.DataValidation IntegerNotEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation ListValues(System.Collections.Generic.IEnumerable values, bool showDropdown = true) { } + public static SpreadCheetah.Validations.DataValidation ListValuesFromCells(string cellRange, bool showDropdown = true) { } + public static SpreadCheetah.Validations.DataValidation ListValuesFromCells(string worksheetName, string cellRange, bool showDropdown = true) { } + public static SpreadCheetah.Validations.DataValidation TextLengthBetween(int min, int max) { } + public static SpreadCheetah.Validations.DataValidation TextLengthEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthGreaterThan(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthGreaterThanOrEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthLessThan(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthLessThanOrEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthNotBetween(int min, int max) { } + public static SpreadCheetah.Validations.DataValidation TextLengthNotEqualTo(int value) { } + public static bool TryCreateListValues(System.Collections.Generic.IEnumerable values, bool showDropdown, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out SpreadCheetah.Validations.DataValidation? dataValidation) { } + } + public enum ValidationErrorType + { + Blocking = 0, + Warning = 1, + Information = 2, + } +} +namespace SpreadCheetah.Worksheets +{ + public class AutoFilterOptions + { + public AutoFilterOptions(string cellRange) { } + } + public class ColumnOptions + { + public ColumnOptions() { } + public double? Width { get; set; } + } + public class RowOptions + { + public RowOptions() { } + public double? Height { get; set; } + } + public class WorksheetOptions + { + public WorksheetOptions() { } + public SpreadCheetah.Worksheets.AutoFilterOptions? AutoFilter { get; set; } + public int? FrozenColumns { get; set; } + public int? FrozenRows { get; set; } + public SpreadCheetah.Worksheets.WorksheetVisibility Visibility { get; set; } + public SpreadCheetah.Worksheets.ColumnOptions Column(int columnNumber) { } + } + public enum WorksheetVisibility + { + Visible = 0, + Hidden = 1, + VeryHidden = 2, + } +} \ No newline at end of file diff --git a/SpreadCheetah.Test/Tests/PublicApiTests.PublicApi_Generate.DotNet7_0.verified.txt b/SpreadCheetah.Test/Tests/PublicApiTests.PublicApi_Generate.DotNet7_0.verified.txt new file mode 100644 index 00000000..b37116a7 --- /dev/null +++ b/SpreadCheetah.Test/Tests/PublicApiTests.PublicApi_Generate.DotNet7_0.verified.txt @@ -0,0 +1,461 @@ +[assembly: System.CLSCompliant(true)] +[assembly: System.Reflection.AssemblyMetadata("IsTrimmable", "True")] +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/sveinungf/spreadcheetah")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("SpreadCheetah.Test")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v7.0", FrameworkDisplayName=".NET 7.0")] +namespace SpreadCheetah +{ + public readonly struct Cell : System.IEquatable + { + public Cell(SpreadCheetah.Formula formula, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(bool value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(System.DateTime value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(System.DateTime? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(decimal value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(double value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(int value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(long value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(float value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(bool? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(decimal? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(double? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(float? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(int? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(long? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(string? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, bool cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, System.DateTime cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, System.DateTime? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, decimal cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, double cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, int cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, long cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, float cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, bool? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, decimal? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, double? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, float? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, int? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, long? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, string? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + } + public readonly struct DataCell : System.IEquatable + { + public DataCell(bool value) { } + public DataCell(System.DateTime value) { } + public DataCell(System.DateTime? value) { } + public DataCell(decimal value) { } + public DataCell(double value) { } + public DataCell(int value) { } + public DataCell(long value) { } + public DataCell(float value) { } + public DataCell(bool? value) { } + public DataCell(decimal? value) { } + public DataCell(double? value) { } + public DataCell(float? value) { } + public DataCell(int? value) { } + public DataCell(long? value) { } + public DataCell(string? value) { } + } + public readonly struct Formula : System.IEquatable + { + public Formula(string? formulaText) { } + } + public enum SpreadCheetahCompressionLevel + { + Optimal = 0, + Fastest = 1, + } + public class SpreadCheetahException : System.Exception + { + public SpreadCheetahException() { } + public SpreadCheetahException(string message) { } + public SpreadCheetahException(string message, System.Exception exception) { } + } + public class SpreadCheetahOptions + { + public static readonly int DefaultBufferSize; + public static readonly SpreadCheetah.SpreadCheetahCompressionLevel DefaultCompressionLevel; + public static readonly int MinimumBufferSize; + public SpreadCheetahOptions() { } + public int BufferSize { get; set; } + public SpreadCheetah.SpreadCheetahCompressionLevel CompressionLevel { get; set; } + public SpreadCheetah.Styling.NumberFormat? DefaultDateTimeFormat { get; set; } + [System.Obsolete("Use SpreadCheetahOptions.DefaultDateTimeFormat instead")] + public string? DefaultDateTimeNumberFormat { get; set; } + public bool WriteCellReferenceAttributes { get; set; } + } + public sealed class Spreadsheet : System.IAsyncDisposable, System.IDisposable + { + public int NextRowNumber { get; } + public System.Threading.Tasks.ValueTask AddAsRowAsync(T obj, SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo typeInfo, System.Threading.CancellationToken token = default) { } + public void AddDataValidation(string reference, SpreadCheetah.Validations.DataValidation validation) { } + public System.Threading.Tasks.ValueTask AddHeaderRowAsync(SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo typeInfo, SpreadCheetah.Styling.StyleId? styleId = null, System.Threading.CancellationToken token = default) { } + public void AddImage(SpreadCheetah.Images.ImageCanvas canvas, SpreadCheetah.Images.EmbeddedImage image, SpreadCheetah.Images.ImageOptions? options = null) { } + public void AddNote(string cellReference, string noteText) { } + public System.Threading.Tasks.ValueTask AddRangeAsRowsAsync(System.Collections.Generic.IEnumerable objs, SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo typeInfo, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.Cell[] cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.DataCell[] cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.StyledCell[] cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.Cell[] cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.DataCell[] cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.StyledCell[] cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public SpreadCheetah.Styling.StyleId AddStyle(SpreadCheetah.Styling.Style style) { } + public void Dispose() { } + public System.Threading.Tasks.ValueTask DisposeAsync() { } + public System.Threading.Tasks.ValueTask EmbedImageAsync(System.IO.Stream stream, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask FinishAsync(System.Threading.CancellationToken token = default) { } + public void MergeCells(string cellRange) { } + public System.Threading.Tasks.ValueTask StartWorksheetAsync(string name, SpreadCheetah.Worksheets.WorksheetOptions? options = null, System.Threading.CancellationToken token = default) { } + public bool TryAddDataValidation(string reference, SpreadCheetah.Validations.DataValidation validation) { } + public static System.Threading.Tasks.ValueTask CreateNewAsync(System.IO.Stream stream, SpreadCheetah.SpreadCheetahOptions? options = null, System.Threading.CancellationToken cancellationToken = default) { } + } + public static class SpreadsheetUtility + { + public static string GetColumnName(int columnNumber) { } + public static bool TryGetColumnNameUtf8(int columnNumber, System.Span destination, out int bytesWritten) { } + public static bool TryParseColumnName(System.ReadOnlySpan columnName, out int columnNumber) { } + } + public readonly struct StyledCell : System.IEquatable + { + public StyledCell(bool value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(System.DateTime value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(System.DateTime? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(decimal value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(double value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(int value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(long value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(float value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(bool? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(decimal? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(double? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(float? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(int? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(long? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(string? value, SpreadCheetah.Styling.StyleId? styleId) { } + } +} +namespace SpreadCheetah.Images +{ + public sealed class EmbeddedImage + { + public int Height { get; } + public int Width { get; } + } + public readonly struct ImageCanvas : System.IEquatable + { + public static SpreadCheetah.Images.ImageCanvas Dimensions(System.ReadOnlySpan upperLeftReference, int width, int height, bool moveWithCells = true) { } + public static SpreadCheetah.Images.ImageCanvas FillCell(System.ReadOnlySpan cellReference, bool moveWithCells = true, bool resizeWithCells = true) { } + public static SpreadCheetah.Images.ImageCanvas FillCells(System.ReadOnlySpan upperLeftReference, System.ReadOnlySpan lowerRightReference, bool moveWithCells = true, bool resizeWithCells = true) { } + public static SpreadCheetah.Images.ImageCanvas OriginalSize(System.ReadOnlySpan upperLeftReference, bool moveWithCells = true) { } + public static SpreadCheetah.Images.ImageCanvas Scaled(System.ReadOnlySpan upperLeftReference, float scale, bool moveWithCells = true) { } + } + public readonly struct ImageOffset : System.IEquatable + { + public static SpreadCheetah.Images.ImageOffset Pixels(int left, int top, int right, int bottom) { } + } + public sealed class ImageOptions + { + public ImageOptions() { } + public SpreadCheetah.Images.ImageOffset? Offset { get; set; } + } +} +namespace SpreadCheetah.SourceGeneration +{ + [System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false)] + public sealed class ColumnHeaderAttribute : System.Attribute + { + public ColumnHeaderAttribute(string name) { } + } + [System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false)] + public sealed class ColumnOrderAttribute : System.Attribute + { + public ColumnOrderAttribute(int order) { } + } + public static class EmptyWorksheetRowContext + { + public static SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo CreateTypeInfo() { } + } + [System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true)] + public sealed class WorksheetRowAttribute : System.Attribute + { + public WorksheetRowAttribute(System.Type type) { } + } + public abstract class WorksheetRowContext + { + protected WorksheetRowContext() { } + } + [System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false)] + public sealed class WorksheetRowGenerationOptionsAttribute : System.Attribute + { + public WorksheetRowGenerationOptionsAttribute() { } + public bool SuppressWarnings { get; set; } + } + public static class WorksheetRowMetadataServices + { + public static SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo CreateObjectInfo(System.Func headerHandler, System.Func rowHandler, System.Func, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask> rowRangeHandler) { } + } + public abstract class WorksheetRowTypeInfo + { + public System.Func HeaderHandler { get; } + public System.Func RowHandler { get; } + public System.Func, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask> RowRangeHandler { get; } + } +} +namespace SpreadCheetah.Styling +{ + public sealed class Alignment : System.IEquatable + { + public Alignment() { } + public SpreadCheetah.Styling.HorizontalAlignment Horizontal { get; set; } + public int Indent { get; set; } + public SpreadCheetah.Styling.VerticalAlignment Vertical { get; set; } + public bool WrapText { get; set; } + } + public sealed class Border : System.IEquatable + { + public Border() { } + public SpreadCheetah.Styling.EdgeBorder Bottom { get; set; } + public SpreadCheetah.Styling.DiagonalBorder Diagonal { get; set; } + public SpreadCheetah.Styling.EdgeBorder Left { get; set; } + public SpreadCheetah.Styling.EdgeBorder Right { get; set; } + public SpreadCheetah.Styling.EdgeBorder Top { get; set; } + } + public enum BorderStyle + { + None = 0, + Thin = 1, + Medium = 2, + Dashed = 3, + Dotted = 4, + Thick = 5, + DoubleLine = 6, + Hair = 7, + MediumDashed = 8, + DashDot = 9, + MediumDashDot = 10, + DashDotDot = 11, + MediumDashDotDot = 12, + SlantDashDot = 13, + } + public sealed class DiagonalBorder : System.IEquatable + { + public DiagonalBorder() { } + public SpreadCheetah.Styling.BorderStyle BorderStyle { get; set; } + public System.Drawing.Color? Color { get; set; } + public SpreadCheetah.Styling.DiagonalBorderType Type { get; set; } + } + [System.Flags] + public enum DiagonalBorderType + { + None = 0, + DiagonalUp = 1, + DiagonalDown = 2, + CrissCross = 3, + } + public sealed class EdgeBorder : System.IEquatable + { + public EdgeBorder() { } + public SpreadCheetah.Styling.BorderStyle BorderStyle { get; set; } + public System.Drawing.Color? Color { get; set; } + } + public sealed class Fill : System.IEquatable + { + public Fill() { } + public System.Drawing.Color? Color { get; set; } + } + public sealed class Font : System.IEquatable + { + public Font() { } + public bool Bold { get; set; } + public System.Drawing.Color? Color { get; set; } + public bool Italic { get; set; } + public string? Name { get; set; } + public double Size { get; set; } + public bool Strikethrough { get; set; } + } + public enum HorizontalAlignment + { + None = 0, + Left = 1, + Center = 2, + Right = 3, + } + public readonly struct NumberFormat : System.IEquatable + { + public override string ToString() { } + public static SpreadCheetah.Styling.NumberFormat Custom(string formatString) { } + public static SpreadCheetah.Styling.NumberFormat Standard(SpreadCheetah.Styling.StandardNumberFormat format) { } + } + public static class NumberFormats + { + public const string DateTimeSortable = "yyyy\\-mm\\-dd\\ hh:mm:ss"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.Fraction)")] + public const string Fraction = "# ?/?"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.FractionTwoDenominatorPlaces)")] + public const string FractionTwoDenominatorPlaces = "# ??/??"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.General)")] + public const string General = "General"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.NoDecimalPlaces)")] + public const string NoDecimalPlaces = "0"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.Percent)")] + public const string Percent = "0%"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.PercentTwoDecimalPlaces)")] + public const string PercentTwoDecimalPlaces = "0.00%"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.Scientific)")] + public const string Scientific = "0.00E+00"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.Text)")] + public const string Text = "@"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.ThousandsSeparator)")] + public const string ThousandsSeparator = "#,##0"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.ThousandsSeparatorTwoDecimalPlaces" + + ")")] + public const string ThousandsSeparatorTwoDecimalPlaces = "#,##0.00"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.TwoDecimalPlaces)")] + public const string TwoDecimalPlaces = "0.00"; + } + public enum StandardNumberFormat + { + General = 0, + NoDecimalPlaces = 1, + TwoDecimalPlaces = 2, + ThousandsSeparator = 3, + ThousandsSeparatorTwoDecimalPlaces = 4, + Percent = 9, + PercentTwoDecimalPlaces = 10, + Scientific = 11, + Fraction = 12, + FractionTwoDenominatorPlaces = 13, + ShortDate = 14, + LongDate = 15, + DayMonth = 16, + MonthYear = 17, + ShortTime12hour = 18, + LongTime12hour = 19, + ShortTime = 20, + LongTime = 21, + DateAndTime = 22, + NoDecimalPlacesNegativeParenthesis = 37, + NoDecimalPlacesNegativeParenthesisRed = 38, + TwoDecimalPlacesNegativeParenthesis = 39, + TwoDecimalPlacesNegativeParenthesisRed = 40, + MinutesAndSeconds = 45, + Duration = 46, + DecimalDuration = 47, + Exponential = 48, + Text = 49, + } + public sealed class Style : System.IEquatable + { + public Style() { } + public SpreadCheetah.Styling.Alignment Alignment { get; set; } + public SpreadCheetah.Styling.Border Border { get; set; } + public SpreadCheetah.Styling.Fill Fill { get; set; } + public SpreadCheetah.Styling.Font Font { get; set; } + public SpreadCheetah.Styling.NumberFormat? Format { get; set; } + [System.Obsolete("Use Style.Format instead")] + public string? NumberFormat { get; set; } + } + public sealed class StyleId + { + public int Id { get; } + } + public enum VerticalAlignment + { + Bottom = 0, + Center = 1, + Top = 2, + } +} +namespace SpreadCheetah.Validations +{ + public sealed class DataValidation + { + public string? ErrorMessage { get; set; } + public string? ErrorTitle { get; set; } + public SpreadCheetah.Validations.ValidationErrorType ErrorType { get; set; } + public bool IgnoreBlank { get; set; } + public string? InputMessage { get; set; } + public string? InputTitle { get; set; } + public bool ShowErrorAlert { get; set; } + public bool ShowInputMessage { get; set; } + public static SpreadCheetah.Validations.DataValidation DecimalBetween(double min, double max) { } + public static SpreadCheetah.Validations.DataValidation DecimalEqualTo(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalGreaterThan(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalGreaterThanOrEqualTo(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalLessThan(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalLessThanOrEqualTo(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalNotBetween(double min, double max) { } + public static SpreadCheetah.Validations.DataValidation DecimalNotEqualTo(double value) { } + public static SpreadCheetah.Validations.DataValidation IntegerBetween(int min, int max) { } + public static SpreadCheetah.Validations.DataValidation IntegerEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerGreaterThan(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerGreaterThanOrEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerLessThan(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerLessThanOrEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerNotBetween(int min, int max) { } + public static SpreadCheetah.Validations.DataValidation IntegerNotEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation ListValues(System.Collections.Generic.IEnumerable values, bool showDropdown = true) { } + public static SpreadCheetah.Validations.DataValidation ListValuesFromCells(string cellRange, bool showDropdown = true) { } + public static SpreadCheetah.Validations.DataValidation ListValuesFromCells(string worksheetName, string cellRange, bool showDropdown = true) { } + public static SpreadCheetah.Validations.DataValidation TextLengthBetween(int min, int max) { } + public static SpreadCheetah.Validations.DataValidation TextLengthEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthGreaterThan(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthGreaterThanOrEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthLessThan(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthLessThanOrEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthNotBetween(int min, int max) { } + public static SpreadCheetah.Validations.DataValidation TextLengthNotEqualTo(int value) { } + public static bool TryCreateListValues(System.Collections.Generic.IEnumerable values, bool showDropdown, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out SpreadCheetah.Validations.DataValidation? dataValidation) { } + } + public enum ValidationErrorType + { + Blocking = 0, + Warning = 1, + Information = 2, + } +} +namespace SpreadCheetah.Worksheets +{ + public class AutoFilterOptions + { + public AutoFilterOptions(string cellRange) { } + } + public class ColumnOptions + { + public ColumnOptions() { } + public double? Width { get; set; } + } + public class RowOptions + { + public RowOptions() { } + public double? Height { get; set; } + } + public class WorksheetOptions + { + public WorksheetOptions() { } + public SpreadCheetah.Worksheets.AutoFilterOptions? AutoFilter { get; set; } + public int? FrozenColumns { get; set; } + public int? FrozenRows { get; set; } + public SpreadCheetah.Worksheets.WorksheetVisibility Visibility { get; set; } + public SpreadCheetah.Worksheets.ColumnOptions Column(int columnNumber) { } + } + public enum WorksheetVisibility + { + Visible = 0, + Hidden = 1, + VeryHidden = 2, + } +} \ No newline at end of file diff --git a/SpreadCheetah.Test/Tests/PublicApiTests.PublicApi_Generate.DotNet8_0.verified.txt b/SpreadCheetah.Test/Tests/PublicApiTests.PublicApi_Generate.DotNet8_0.verified.txt new file mode 100644 index 00000000..6dc35f4a --- /dev/null +++ b/SpreadCheetah.Test/Tests/PublicApiTests.PublicApi_Generate.DotNet8_0.verified.txt @@ -0,0 +1,461 @@ +[assembly: System.CLSCompliant(true)] +[assembly: System.Reflection.AssemblyMetadata("IsTrimmable", "True")] +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/sveinungf/spreadcheetah")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("SpreadCheetah.Test")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName=".NET 8.0")] +namespace SpreadCheetah +{ + public readonly struct Cell : System.IEquatable + { + public Cell(SpreadCheetah.Formula formula, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(bool value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(System.DateTime value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(System.DateTime? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(decimal value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(double value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(int value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(long value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(float value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(bool? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(decimal? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(double? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(float? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(int? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(long? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(string? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, bool cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, System.DateTime cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, System.DateTime? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, decimal cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, double cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, int cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, long cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, float cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, bool? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, decimal? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, double? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, float? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, int? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, long? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, string? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + } + public readonly struct DataCell : System.IEquatable + { + public DataCell(bool value) { } + public DataCell(System.DateTime value) { } + public DataCell(System.DateTime? value) { } + public DataCell(decimal value) { } + public DataCell(double value) { } + public DataCell(int value) { } + public DataCell(long value) { } + public DataCell(float value) { } + public DataCell(bool? value) { } + public DataCell(decimal? value) { } + public DataCell(double? value) { } + public DataCell(float? value) { } + public DataCell(int? value) { } + public DataCell(long? value) { } + public DataCell(string? value) { } + } + public readonly struct Formula : System.IEquatable + { + public Formula(string? formulaText) { } + } + public enum SpreadCheetahCompressionLevel + { + Optimal = 0, + Fastest = 1, + } + public class SpreadCheetahException : System.Exception + { + public SpreadCheetahException() { } + public SpreadCheetahException(string message) { } + public SpreadCheetahException(string message, System.Exception exception) { } + } + public class SpreadCheetahOptions + { + public static readonly int DefaultBufferSize; + public static readonly SpreadCheetah.SpreadCheetahCompressionLevel DefaultCompressionLevel; + public static readonly int MinimumBufferSize; + public SpreadCheetahOptions() { } + public int BufferSize { get; set; } + public SpreadCheetah.SpreadCheetahCompressionLevel CompressionLevel { get; set; } + public SpreadCheetah.Styling.NumberFormat? DefaultDateTimeFormat { get; set; } + [System.Obsolete("Use SpreadCheetahOptions.DefaultDateTimeFormat instead")] + public string? DefaultDateTimeNumberFormat { get; set; } + public bool WriteCellReferenceAttributes { get; set; } + } + public sealed class Spreadsheet : System.IAsyncDisposable, System.IDisposable + { + public int NextRowNumber { get; } + public System.Threading.Tasks.ValueTask AddAsRowAsync(T obj, SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo typeInfo, System.Threading.CancellationToken token = default) { } + public void AddDataValidation(string reference, SpreadCheetah.Validations.DataValidation validation) { } + public System.Threading.Tasks.ValueTask AddHeaderRowAsync(SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo typeInfo, SpreadCheetah.Styling.StyleId? styleId = null, System.Threading.CancellationToken token = default) { } + public void AddImage(SpreadCheetah.Images.ImageCanvas canvas, SpreadCheetah.Images.EmbeddedImage image, SpreadCheetah.Images.ImageOptions? options = null) { } + public void AddNote(string cellReference, string noteText) { } + public System.Threading.Tasks.ValueTask AddRangeAsRowsAsync(System.Collections.Generic.IEnumerable objs, SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo typeInfo, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.Cell[] cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.DataCell[] cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.StyledCell[] cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.Cell[] cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.DataCell[] cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.StyledCell[] cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public SpreadCheetah.Styling.StyleId AddStyle(SpreadCheetah.Styling.Style style) { } + public void Dispose() { } + public System.Threading.Tasks.ValueTask DisposeAsync() { } + public System.Threading.Tasks.ValueTask EmbedImageAsync(System.IO.Stream stream, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask FinishAsync(System.Threading.CancellationToken token = default) { } + public void MergeCells(string cellRange) { } + public System.Threading.Tasks.ValueTask StartWorksheetAsync(string name, SpreadCheetah.Worksheets.WorksheetOptions? options = null, System.Threading.CancellationToken token = default) { } + public bool TryAddDataValidation(string reference, SpreadCheetah.Validations.DataValidation validation) { } + public static System.Threading.Tasks.ValueTask CreateNewAsync(System.IO.Stream stream, SpreadCheetah.SpreadCheetahOptions? options = null, System.Threading.CancellationToken cancellationToken = default) { } + } + public static class SpreadsheetUtility + { + public static string GetColumnName(int columnNumber) { } + public static bool TryGetColumnNameUtf8(int columnNumber, System.Span destination, out int bytesWritten) { } + public static bool TryParseColumnName(System.ReadOnlySpan columnName, out int columnNumber) { } + } + public readonly struct StyledCell : System.IEquatable + { + public StyledCell(bool value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(System.DateTime value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(System.DateTime? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(decimal value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(double value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(int value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(long value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(float value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(bool? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(decimal? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(double? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(float? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(int? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(long? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(string? value, SpreadCheetah.Styling.StyleId? styleId) { } + } +} +namespace SpreadCheetah.Images +{ + public sealed class EmbeddedImage + { + public int Height { get; } + public int Width { get; } + } + public readonly struct ImageCanvas : System.IEquatable + { + public static SpreadCheetah.Images.ImageCanvas Dimensions(System.ReadOnlySpan upperLeftReference, int width, int height, bool moveWithCells = true) { } + public static SpreadCheetah.Images.ImageCanvas FillCell(System.ReadOnlySpan cellReference, bool moveWithCells = true, bool resizeWithCells = true) { } + public static SpreadCheetah.Images.ImageCanvas FillCells(System.ReadOnlySpan upperLeftReference, System.ReadOnlySpan lowerRightReference, bool moveWithCells = true, bool resizeWithCells = true) { } + public static SpreadCheetah.Images.ImageCanvas OriginalSize(System.ReadOnlySpan upperLeftReference, bool moveWithCells = true) { } + public static SpreadCheetah.Images.ImageCanvas Scaled(System.ReadOnlySpan upperLeftReference, float scale, bool moveWithCells = true) { } + } + public readonly struct ImageOffset : System.IEquatable + { + public static SpreadCheetah.Images.ImageOffset Pixels(int left, int top, int right, int bottom) { } + } + public sealed class ImageOptions + { + public ImageOptions() { } + public SpreadCheetah.Images.ImageOffset? Offset { get; set; } + } +} +namespace SpreadCheetah.SourceGeneration +{ + [System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false)] + public sealed class ColumnHeaderAttribute : System.Attribute + { + public ColumnHeaderAttribute(string name) { } + } + [System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false)] + public sealed class ColumnOrderAttribute : System.Attribute + { + public ColumnOrderAttribute(int order) { } + } + public static class EmptyWorksheetRowContext + { + public static SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo CreateTypeInfo() { } + } + [System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true)] + public sealed class WorksheetRowAttribute : System.Attribute + { + public WorksheetRowAttribute(System.Type type) { } + } + public abstract class WorksheetRowContext + { + protected WorksheetRowContext() { } + } + [System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false)] + public sealed class WorksheetRowGenerationOptionsAttribute : System.Attribute + { + public WorksheetRowGenerationOptionsAttribute() { } + public bool SuppressWarnings { get; set; } + } + public static class WorksheetRowMetadataServices + { + public static SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo CreateObjectInfo(System.Func headerHandler, System.Func rowHandler, System.Func, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask> rowRangeHandler) { } + } + public abstract class WorksheetRowTypeInfo + { + public System.Func HeaderHandler { get; } + public System.Func RowHandler { get; } + public System.Func, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask> RowRangeHandler { get; } + } +} +namespace SpreadCheetah.Styling +{ + public sealed class Alignment : System.IEquatable + { + public Alignment() { } + public SpreadCheetah.Styling.HorizontalAlignment Horizontal { get; set; } + public int Indent { get; set; } + public SpreadCheetah.Styling.VerticalAlignment Vertical { get; set; } + public bool WrapText { get; set; } + } + public sealed class Border : System.IEquatable + { + public Border() { } + public SpreadCheetah.Styling.EdgeBorder Bottom { get; set; } + public SpreadCheetah.Styling.DiagonalBorder Diagonal { get; set; } + public SpreadCheetah.Styling.EdgeBorder Left { get; set; } + public SpreadCheetah.Styling.EdgeBorder Right { get; set; } + public SpreadCheetah.Styling.EdgeBorder Top { get; set; } + } + public enum BorderStyle + { + None = 0, + Thin = 1, + Medium = 2, + Dashed = 3, + Dotted = 4, + Thick = 5, + DoubleLine = 6, + Hair = 7, + MediumDashed = 8, + DashDot = 9, + MediumDashDot = 10, + DashDotDot = 11, + MediumDashDotDot = 12, + SlantDashDot = 13, + } + public sealed class DiagonalBorder : System.IEquatable + { + public DiagonalBorder() { } + public SpreadCheetah.Styling.BorderStyle BorderStyle { get; set; } + public System.Drawing.Color? Color { get; set; } + public SpreadCheetah.Styling.DiagonalBorderType Type { get; set; } + } + [System.Flags] + public enum DiagonalBorderType + { + None = 0, + DiagonalUp = 1, + DiagonalDown = 2, + CrissCross = 3, + } + public sealed class EdgeBorder : System.IEquatable + { + public EdgeBorder() { } + public SpreadCheetah.Styling.BorderStyle BorderStyle { get; set; } + public System.Drawing.Color? Color { get; set; } + } + public sealed class Fill : System.IEquatable + { + public Fill() { } + public System.Drawing.Color? Color { get; set; } + } + public sealed class Font : System.IEquatable + { + public Font() { } + public bool Bold { get; set; } + public System.Drawing.Color? Color { get; set; } + public bool Italic { get; set; } + public string? Name { get; set; } + public double Size { get; set; } + public bool Strikethrough { get; set; } + } + public enum HorizontalAlignment + { + None = 0, + Left = 1, + Center = 2, + Right = 3, + } + public readonly struct NumberFormat : System.IEquatable + { + public override string ToString() { } + public static SpreadCheetah.Styling.NumberFormat Custom(string formatString) { } + public static SpreadCheetah.Styling.NumberFormat Standard(SpreadCheetah.Styling.StandardNumberFormat format) { } + } + public static class NumberFormats + { + public const string DateTimeSortable = "yyyy\\-mm\\-dd\\ hh:mm:ss"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.Fraction)")] + public const string Fraction = "# ?/?"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.FractionTwoDenominatorPlaces)")] + public const string FractionTwoDenominatorPlaces = "# ??/??"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.General)")] + public const string General = "General"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.NoDecimalPlaces)")] + public const string NoDecimalPlaces = "0"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.Percent)")] + public const string Percent = "0%"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.PercentTwoDecimalPlaces)")] + public const string PercentTwoDecimalPlaces = "0.00%"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.Scientific)")] + public const string Scientific = "0.00E+00"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.Text)")] + public const string Text = "@"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.ThousandsSeparator)")] + public const string ThousandsSeparator = "#,##0"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.ThousandsSeparatorTwoDecimalPlaces" + + ")")] + public const string ThousandsSeparatorTwoDecimalPlaces = "#,##0.00"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.TwoDecimalPlaces)")] + public const string TwoDecimalPlaces = "0.00"; + } + public enum StandardNumberFormat + { + General = 0, + NoDecimalPlaces = 1, + TwoDecimalPlaces = 2, + ThousandsSeparator = 3, + ThousandsSeparatorTwoDecimalPlaces = 4, + Percent = 9, + PercentTwoDecimalPlaces = 10, + Scientific = 11, + Fraction = 12, + FractionTwoDenominatorPlaces = 13, + ShortDate = 14, + LongDate = 15, + DayMonth = 16, + MonthYear = 17, + ShortTime12hour = 18, + LongTime12hour = 19, + ShortTime = 20, + LongTime = 21, + DateAndTime = 22, + NoDecimalPlacesNegativeParenthesis = 37, + NoDecimalPlacesNegativeParenthesisRed = 38, + TwoDecimalPlacesNegativeParenthesis = 39, + TwoDecimalPlacesNegativeParenthesisRed = 40, + MinutesAndSeconds = 45, + Duration = 46, + DecimalDuration = 47, + Exponential = 48, + Text = 49, + } + public sealed class Style : System.IEquatable + { + public Style() { } + public SpreadCheetah.Styling.Alignment Alignment { get; set; } + public SpreadCheetah.Styling.Border Border { get; set; } + public SpreadCheetah.Styling.Fill Fill { get; set; } + public SpreadCheetah.Styling.Font Font { get; set; } + public SpreadCheetah.Styling.NumberFormat? Format { get; set; } + [System.Obsolete("Use Style.Format instead")] + public string? NumberFormat { get; set; } + } + public sealed class StyleId + { + public int Id { get; } + } + public enum VerticalAlignment + { + Bottom = 0, + Center = 1, + Top = 2, + } +} +namespace SpreadCheetah.Validations +{ + public sealed class DataValidation + { + public string? ErrorMessage { get; set; } + public string? ErrorTitle { get; set; } + public SpreadCheetah.Validations.ValidationErrorType ErrorType { get; set; } + public bool IgnoreBlank { get; set; } + public string? InputMessage { get; set; } + public string? InputTitle { get; set; } + public bool ShowErrorAlert { get; set; } + public bool ShowInputMessage { get; set; } + public static SpreadCheetah.Validations.DataValidation DecimalBetween(double min, double max) { } + public static SpreadCheetah.Validations.DataValidation DecimalEqualTo(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalGreaterThan(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalGreaterThanOrEqualTo(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalLessThan(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalLessThanOrEqualTo(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalNotBetween(double min, double max) { } + public static SpreadCheetah.Validations.DataValidation DecimalNotEqualTo(double value) { } + public static SpreadCheetah.Validations.DataValidation IntegerBetween(int min, int max) { } + public static SpreadCheetah.Validations.DataValidation IntegerEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerGreaterThan(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerGreaterThanOrEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerLessThan(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerLessThanOrEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerNotBetween(int min, int max) { } + public static SpreadCheetah.Validations.DataValidation IntegerNotEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation ListValues(System.Collections.Generic.IEnumerable values, bool showDropdown = true) { } + public static SpreadCheetah.Validations.DataValidation ListValuesFromCells(string cellRange, bool showDropdown = true) { } + public static SpreadCheetah.Validations.DataValidation ListValuesFromCells(string worksheetName, string cellRange, bool showDropdown = true) { } + public static SpreadCheetah.Validations.DataValidation TextLengthBetween(int min, int max) { } + public static SpreadCheetah.Validations.DataValidation TextLengthEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthGreaterThan(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthGreaterThanOrEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthLessThan(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthLessThanOrEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthNotBetween(int min, int max) { } + public static SpreadCheetah.Validations.DataValidation TextLengthNotEqualTo(int value) { } + public static bool TryCreateListValues(System.Collections.Generic.IEnumerable values, bool showDropdown, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out SpreadCheetah.Validations.DataValidation? dataValidation) { } + } + public enum ValidationErrorType + { + Blocking = 0, + Warning = 1, + Information = 2, + } +} +namespace SpreadCheetah.Worksheets +{ + public class AutoFilterOptions + { + public AutoFilterOptions(string cellRange) { } + } + public class ColumnOptions + { + public ColumnOptions() { } + public double? Width { get; set; } + } + public class RowOptions + { + public RowOptions() { } + public double? Height { get; set; } + } + public class WorksheetOptions + { + public WorksheetOptions() { } + public SpreadCheetah.Worksheets.AutoFilterOptions? AutoFilter { get; set; } + public int? FrozenColumns { get; set; } + public int? FrozenRows { get; set; } + public SpreadCheetah.Worksheets.WorksheetVisibility Visibility { get; set; } + public SpreadCheetah.Worksheets.ColumnOptions Column(int columnNumber) { } + } + public enum WorksheetVisibility + { + Visible = 0, + Hidden = 1, + VeryHidden = 2, + } +} \ No newline at end of file diff --git a/SpreadCheetah.Test/Tests/PublicApiTests.PublicApi_Generate.Net4_7.verified.txt b/SpreadCheetah.Test/Tests/PublicApiTests.PublicApi_Generate.Net4_7.verified.txt new file mode 100644 index 00000000..65283dbe --- /dev/null +++ b/SpreadCheetah.Test/Tests/PublicApiTests.PublicApi_Generate.Net4_7.verified.txt @@ -0,0 +1,460 @@ +[assembly: System.CLSCompliant(true)] +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/sveinungf/spreadcheetah")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("SpreadCheetah.Test")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName=".NET Standard 2.0")] +namespace SpreadCheetah +{ + public readonly struct Cell : System.IEquatable + { + public Cell(SpreadCheetah.Formula formula, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(bool value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(System.DateTime value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(System.DateTime? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(decimal value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(double value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(int value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(long value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(float value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(bool? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(decimal? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(double? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(float? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(int? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(long? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(string? value, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, bool cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, System.DateTime cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, System.DateTime? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, decimal cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, double cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, int cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, long cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, float cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, bool? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, decimal? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, double? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, float? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, int? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, long? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + public Cell(SpreadCheetah.Formula formula, string? cachedValue, SpreadCheetah.Styling.StyleId? styleId = null) { } + } + public readonly struct DataCell : System.IEquatable + { + public DataCell(bool value) { } + public DataCell(System.DateTime value) { } + public DataCell(System.DateTime? value) { } + public DataCell(decimal value) { } + public DataCell(double value) { } + public DataCell(int value) { } + public DataCell(long value) { } + public DataCell(float value) { } + public DataCell(bool? value) { } + public DataCell(decimal? value) { } + public DataCell(double? value) { } + public DataCell(float? value) { } + public DataCell(int? value) { } + public DataCell(long? value) { } + public DataCell(string? value) { } + } + public readonly struct Formula : System.IEquatable + { + public Formula(string? formulaText) { } + } + public enum SpreadCheetahCompressionLevel + { + Optimal = 0, + Fastest = 1, + } + public class SpreadCheetahException : System.Exception + { + public SpreadCheetahException() { } + public SpreadCheetahException(string message) { } + public SpreadCheetahException(string message, System.Exception exception) { } + } + public class SpreadCheetahOptions + { + public static readonly int DefaultBufferSize; + public static readonly SpreadCheetah.SpreadCheetahCompressionLevel DefaultCompressionLevel; + public static readonly int MinimumBufferSize; + public SpreadCheetahOptions() { } + public int BufferSize { get; set; } + public SpreadCheetah.SpreadCheetahCompressionLevel CompressionLevel { get; set; } + public SpreadCheetah.Styling.NumberFormat? DefaultDateTimeFormat { get; set; } + [System.Obsolete("Use SpreadCheetahOptions.DefaultDateTimeFormat instead")] + public string? DefaultDateTimeNumberFormat { get; set; } + public bool WriteCellReferenceAttributes { get; set; } + } + public sealed class Spreadsheet : System.IAsyncDisposable, System.IDisposable + { + public int NextRowNumber { get; } + public System.Threading.Tasks.ValueTask AddAsRowAsync(T obj, SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo typeInfo, System.Threading.CancellationToken token = default) { } + public void AddDataValidation(string reference, SpreadCheetah.Validations.DataValidation validation) { } + public System.Threading.Tasks.ValueTask AddHeaderRowAsync(SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo typeInfo, SpreadCheetah.Styling.StyleId? styleId = null, System.Threading.CancellationToken token = default) { } + public void AddImage(SpreadCheetah.Images.ImageCanvas canvas, SpreadCheetah.Images.EmbeddedImage image, SpreadCheetah.Images.ImageOptions? options = null) { } + public void AddNote(string cellReference, string noteText) { } + public System.Threading.Tasks.ValueTask AddRangeAsRowsAsync(System.Collections.Generic.IEnumerable objs, SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo typeInfo, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.Cell[] cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.DataCell[] cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.StyledCell[] cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.Cell[] cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.DataCell[] cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(SpreadCheetah.StyledCell[] cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.Collections.Generic.IList cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask AddRowAsync(System.ReadOnlyMemory cells, SpreadCheetah.Worksheets.RowOptions? options, System.Threading.CancellationToken token = default) { } + public SpreadCheetah.Styling.StyleId AddStyle(SpreadCheetah.Styling.Style style) { } + public void Dispose() { } + public System.Threading.Tasks.ValueTask DisposeAsync() { } + public System.Threading.Tasks.ValueTask EmbedImageAsync(System.IO.Stream stream, System.Threading.CancellationToken token = default) { } + public System.Threading.Tasks.ValueTask FinishAsync(System.Threading.CancellationToken token = default) { } + public void MergeCells(string cellRange) { } + public System.Threading.Tasks.ValueTask StartWorksheetAsync(string name, SpreadCheetah.Worksheets.WorksheetOptions? options = null, System.Threading.CancellationToken token = default) { } + public bool TryAddDataValidation(string reference, SpreadCheetah.Validations.DataValidation validation) { } + public static System.Threading.Tasks.ValueTask CreateNewAsync(System.IO.Stream stream, SpreadCheetah.SpreadCheetahOptions? options = null, System.Threading.CancellationToken cancellationToken = default) { } + } + public static class SpreadsheetUtility + { + public static string GetColumnName(int columnNumber) { } + public static bool TryGetColumnNameUtf8(int columnNumber, System.Span destination, out int bytesWritten) { } + public static bool TryParseColumnName(System.ReadOnlySpan columnName, out int columnNumber) { } + } + public readonly struct StyledCell : System.IEquatable + { + public StyledCell(bool value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(System.DateTime value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(System.DateTime? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(decimal value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(double value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(int value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(long value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(float value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(bool? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(decimal? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(double? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(float? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(int? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(long? value, SpreadCheetah.Styling.StyleId? styleId) { } + public StyledCell(string? value, SpreadCheetah.Styling.StyleId? styleId) { } + } +} +namespace SpreadCheetah.Images +{ + public sealed class EmbeddedImage + { + public int Height { get; } + public int Width { get; } + } + public readonly struct ImageCanvas : System.IEquatable + { + public static SpreadCheetah.Images.ImageCanvas Dimensions(System.ReadOnlySpan upperLeftReference, int width, int height, bool moveWithCells = true) { } + public static SpreadCheetah.Images.ImageCanvas FillCell(System.ReadOnlySpan cellReference, bool moveWithCells = true, bool resizeWithCells = true) { } + public static SpreadCheetah.Images.ImageCanvas FillCells(System.ReadOnlySpan upperLeftReference, System.ReadOnlySpan lowerRightReference, bool moveWithCells = true, bool resizeWithCells = true) { } + public static SpreadCheetah.Images.ImageCanvas OriginalSize(System.ReadOnlySpan upperLeftReference, bool moveWithCells = true) { } + public static SpreadCheetah.Images.ImageCanvas Scaled(System.ReadOnlySpan upperLeftReference, float scale, bool moveWithCells = true) { } + } + public readonly struct ImageOffset : System.IEquatable + { + public static SpreadCheetah.Images.ImageOffset Pixels(int left, int top, int right, int bottom) { } + } + public sealed class ImageOptions + { + public ImageOptions() { } + public SpreadCheetah.Images.ImageOffset? Offset { get; set; } + } +} +namespace SpreadCheetah.SourceGeneration +{ + [System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false)] + public sealed class ColumnHeaderAttribute : System.Attribute + { + public ColumnHeaderAttribute(string name) { } + } + [System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false)] + public sealed class ColumnOrderAttribute : System.Attribute + { + public ColumnOrderAttribute(int order) { } + } + public static class EmptyWorksheetRowContext + { + public static SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo CreateTypeInfo() { } + } + [System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true)] + public sealed class WorksheetRowAttribute : System.Attribute + { + public WorksheetRowAttribute(System.Type type) { } + } + public abstract class WorksheetRowContext + { + protected WorksheetRowContext() { } + } + [System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false)] + public sealed class WorksheetRowGenerationOptionsAttribute : System.Attribute + { + public WorksheetRowGenerationOptionsAttribute() { } + public bool SuppressWarnings { get; set; } + } + public static class WorksheetRowMetadataServices + { + public static SpreadCheetah.SourceGeneration.WorksheetRowTypeInfo CreateObjectInfo(System.Func headerHandler, System.Func rowHandler, System.Func, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask> rowRangeHandler) { } + } + public abstract class WorksheetRowTypeInfo + { + public System.Func HeaderHandler { get; } + public System.Func RowHandler { get; } + public System.Func, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask> RowRangeHandler { get; } + } +} +namespace SpreadCheetah.Styling +{ + public sealed class Alignment : System.IEquatable + { + public Alignment() { } + public SpreadCheetah.Styling.HorizontalAlignment Horizontal { get; set; } + public int Indent { get; set; } + public SpreadCheetah.Styling.VerticalAlignment Vertical { get; set; } + public bool WrapText { get; set; } + } + public sealed class Border : System.IEquatable + { + public Border() { } + public SpreadCheetah.Styling.EdgeBorder Bottom { get; set; } + public SpreadCheetah.Styling.DiagonalBorder Diagonal { get; set; } + public SpreadCheetah.Styling.EdgeBorder Left { get; set; } + public SpreadCheetah.Styling.EdgeBorder Right { get; set; } + public SpreadCheetah.Styling.EdgeBorder Top { get; set; } + } + public enum BorderStyle + { + None = 0, + Thin = 1, + Medium = 2, + Dashed = 3, + Dotted = 4, + Thick = 5, + DoubleLine = 6, + Hair = 7, + MediumDashed = 8, + DashDot = 9, + MediumDashDot = 10, + DashDotDot = 11, + MediumDashDotDot = 12, + SlantDashDot = 13, + } + public sealed class DiagonalBorder : System.IEquatable + { + public DiagonalBorder() { } + public SpreadCheetah.Styling.BorderStyle BorderStyle { get; set; } + public System.Drawing.Color? Color { get; set; } + public SpreadCheetah.Styling.DiagonalBorderType Type { get; set; } + } + [System.Flags] + public enum DiagonalBorderType + { + None = 0, + DiagonalUp = 1, + DiagonalDown = 2, + CrissCross = 3, + } + public sealed class EdgeBorder : System.IEquatable + { + public EdgeBorder() { } + public SpreadCheetah.Styling.BorderStyle BorderStyle { get; set; } + public System.Drawing.Color? Color { get; set; } + } + public sealed class Fill : System.IEquatable + { + public Fill() { } + public System.Drawing.Color? Color { get; set; } + } + public sealed class Font : System.IEquatable + { + public Font() { } + public bool Bold { get; set; } + public System.Drawing.Color? Color { get; set; } + public bool Italic { get; set; } + public string? Name { get; set; } + public double Size { get; set; } + public bool Strikethrough { get; set; } + } + public enum HorizontalAlignment + { + None = 0, + Left = 1, + Center = 2, + Right = 3, + } + public readonly struct NumberFormat : System.IEquatable + { + public override string ToString() { } + public static SpreadCheetah.Styling.NumberFormat Custom(string formatString) { } + public static SpreadCheetah.Styling.NumberFormat Standard(SpreadCheetah.Styling.StandardNumberFormat format) { } + } + public static class NumberFormats + { + public const string DateTimeSortable = "yyyy\\-mm\\-dd\\ hh:mm:ss"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.Fraction)")] + public const string Fraction = "# ?/?"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.FractionTwoDenominatorPlaces)")] + public const string FractionTwoDenominatorPlaces = "# ??/??"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.General)")] + public const string General = "General"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.NoDecimalPlaces)")] + public const string NoDecimalPlaces = "0"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.Percent)")] + public const string Percent = "0%"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.PercentTwoDecimalPlaces)")] + public const string PercentTwoDecimalPlaces = "0.00%"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.Scientific)")] + public const string Scientific = "0.00E+00"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.Text)")] + public const string Text = "@"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.ThousandsSeparator)")] + public const string ThousandsSeparator = "#,##0"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.ThousandsSeparatorTwoDecimalPlaces" + + ")")] + public const string ThousandsSeparatorTwoDecimalPlaces = "#,##0.00"; + [System.Obsolete("Use NumberFormat.Standard(StandardNumberFormat.TwoDecimalPlaces)")] + public const string TwoDecimalPlaces = "0.00"; + } + public enum StandardNumberFormat + { + General = 0, + NoDecimalPlaces = 1, + TwoDecimalPlaces = 2, + ThousandsSeparator = 3, + ThousandsSeparatorTwoDecimalPlaces = 4, + Percent = 9, + PercentTwoDecimalPlaces = 10, + Scientific = 11, + Fraction = 12, + FractionTwoDenominatorPlaces = 13, + ShortDate = 14, + LongDate = 15, + DayMonth = 16, + MonthYear = 17, + ShortTime12hour = 18, + LongTime12hour = 19, + ShortTime = 20, + LongTime = 21, + DateAndTime = 22, + NoDecimalPlacesNegativeParenthesis = 37, + NoDecimalPlacesNegativeParenthesisRed = 38, + TwoDecimalPlacesNegativeParenthesis = 39, + TwoDecimalPlacesNegativeParenthesisRed = 40, + MinutesAndSeconds = 45, + Duration = 46, + DecimalDuration = 47, + Exponential = 48, + Text = 49, + } + public sealed class Style : System.IEquatable + { + public Style() { } + public SpreadCheetah.Styling.Alignment Alignment { get; set; } + public SpreadCheetah.Styling.Border Border { get; set; } + public SpreadCheetah.Styling.Fill Fill { get; set; } + public SpreadCheetah.Styling.Font Font { get; set; } + public SpreadCheetah.Styling.NumberFormat? Format { get; set; } + [System.Obsolete("Use Style.Format instead")] + public string? NumberFormat { get; set; } + } + public sealed class StyleId + { + public int Id { get; } + } + public enum VerticalAlignment + { + Bottom = 0, + Center = 1, + Top = 2, + } +} +namespace SpreadCheetah.Validations +{ + public sealed class DataValidation + { + public string? ErrorMessage { get; set; } + public string? ErrorTitle { get; set; } + public SpreadCheetah.Validations.ValidationErrorType ErrorType { get; set; } + public bool IgnoreBlank { get; set; } + public string? InputMessage { get; set; } + public string? InputTitle { get; set; } + public bool ShowErrorAlert { get; set; } + public bool ShowInputMessage { get; set; } + public static SpreadCheetah.Validations.DataValidation DecimalBetween(double min, double max) { } + public static SpreadCheetah.Validations.DataValidation DecimalEqualTo(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalGreaterThan(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalGreaterThanOrEqualTo(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalLessThan(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalLessThanOrEqualTo(double value) { } + public static SpreadCheetah.Validations.DataValidation DecimalNotBetween(double min, double max) { } + public static SpreadCheetah.Validations.DataValidation DecimalNotEqualTo(double value) { } + public static SpreadCheetah.Validations.DataValidation IntegerBetween(int min, int max) { } + public static SpreadCheetah.Validations.DataValidation IntegerEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerGreaterThan(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerGreaterThanOrEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerLessThan(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerLessThanOrEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation IntegerNotBetween(int min, int max) { } + public static SpreadCheetah.Validations.DataValidation IntegerNotEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation ListValues(System.Collections.Generic.IEnumerable values, bool showDropdown = true) { } + public static SpreadCheetah.Validations.DataValidation ListValuesFromCells(string cellRange, bool showDropdown = true) { } + public static SpreadCheetah.Validations.DataValidation ListValuesFromCells(string worksheetName, string cellRange, bool showDropdown = true) { } + public static SpreadCheetah.Validations.DataValidation TextLengthBetween(int min, int max) { } + public static SpreadCheetah.Validations.DataValidation TextLengthEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthGreaterThan(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthGreaterThanOrEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthLessThan(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthLessThanOrEqualTo(int value) { } + public static SpreadCheetah.Validations.DataValidation TextLengthNotBetween(int min, int max) { } + public static SpreadCheetah.Validations.DataValidation TextLengthNotEqualTo(int value) { } + public static bool TryCreateListValues(System.Collections.Generic.IEnumerable values, bool showDropdown, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out SpreadCheetah.Validations.DataValidation? dataValidation) { } + } + public enum ValidationErrorType + { + Blocking = 0, + Warning = 1, + Information = 2, + } +} +namespace SpreadCheetah.Worksheets +{ + public class AutoFilterOptions + { + public AutoFilterOptions(string cellRange) { } + } + public class ColumnOptions + { + public ColumnOptions() { } + public double? Width { get; set; } + } + public class RowOptions + { + public RowOptions() { } + public double? Height { get; set; } + } + public class WorksheetOptions + { + public WorksheetOptions() { } + public SpreadCheetah.Worksheets.AutoFilterOptions? AutoFilter { get; set; } + public int? FrozenColumns { get; set; } + public int? FrozenRows { get; set; } + public SpreadCheetah.Worksheets.WorksheetVisibility Visibility { get; set; } + public SpreadCheetah.Worksheets.ColumnOptions Column(int columnNumber) { } + } + public enum WorksheetVisibility + { + Visible = 0, + Hidden = 1, + VeryHidden = 2, + } +} \ No newline at end of file diff --git a/SpreadCheetah.Test/Tests/PublicApiTests.cs b/SpreadCheetah.Test/Tests/PublicApiTests.cs new file mode 100644 index 00000000..c61338a8 --- /dev/null +++ b/SpreadCheetah.Test/Tests/PublicApiTests.cs @@ -0,0 +1,18 @@ +using PublicApiGenerator; + +namespace SpreadCheetah.Test.Tests; + +public class PublicApiTests +{ + [Fact] + public Task PublicApi_Generate() + { + // Act + var publicApi = typeof(Spreadsheet).Assembly.GeneratePublicApi(); + + // Assert + var settings = new VerifySettings(); + settings.UniqueForTargetFrameworkAndVersion(); + return Verify(publicApi, settings); + } +} diff --git a/SpreadCheetah.sln b/SpreadCheetah.sln index f649c2c1..a91c20a4 100644 --- a/SpreadCheetah.sln +++ b/SpreadCheetah.sln @@ -31,7 +31,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpreadCheetah.AotCompatibil EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpreadCheetah.SourceGenerator.CSharp8Test", "SpreadCheetah.SourceGenerator.CSharp8Test\SpreadCheetah.SourceGenerator.CSharp8Test.csproj", "{922F3921-1783-44CC-AF2B-DDDE039913A8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpreadCheetah.TestHelpers", "SpreadCheetah.TestHelpers\SpreadCheetah.TestHelpers.csproj", "{35778347-6F42-484A-A50A-BA33B6892B3D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpreadCheetah.TestHelpers", "SpreadCheetah.TestHelpers\SpreadCheetah.TestHelpers.csproj", "{35778347-6F42-484A-A50A-BA33B6892B3D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution