Skip to main content

Core Types

This page documents the public C# API for core types, generated from the XML documentation of the compiled library. Values are immutable, constructors take named arguments and validate them, and read-only properties return what was passed.

ISlackObject​

A value that can be written as Slack Block Kit JSON.

Every slackblocks type implements this interface, including the role interfaces such as IBlock, so a collection of blocks can be serialized without knowing each concrete type.

ToJson​

Returns this value as compact Slack JSON.

string ToJson()

Returns: Compact JSON text.

ToJsonNode​

Returns a mutable copy of this value's Slack JSON.

JsonObject ToJsonNode()

Returns: A new JSON object.

NumberInputBound​

A number-input bound sent as a JSON string. Numeric conversions use invariant culture.

NumberInputBound​

Creates a bound; the containing number input validates its numeric value.

public NumberInputBound(string value)
ParameterDescription
value

Related types: NumberInputBound

Value​

Gets the supplied wire string.

public string Value { get; }

Implicit conversion — string?​

Preserves a supplied decimal string.

public static implicit operator NumberInputBound?(string? value)
ParameterDescription
value

Related types: NumberInputBound

Implicit conversion — double​

Converts a numeric convenience argument using invariant culture.

public static implicit operator NumberInputBound(double value)
ParameterDescription
value

Related types: NumberInputBound

Implicit conversion — double?​

Preserves nullable numeric arguments and omission.

public static implicit operator NumberInputBound?(double? value)
ParameterDescription
value

Related types: NumberInputBound

Implicit conversion — Decimal​

Preserves exact decimal arithmetic.

public static implicit operator NumberInputBound(Decimal value)
ParameterDescription
value

Related types: NumberInputBound

Implicit conversion — long​

Preserves an exact integer bound.

public static implicit operator NumberInputBound(long value)
ParameterDescription
value

Related types: NumberInputBound

Implicit conversion — UInt64​

Preserves an exact unsigned integer bound, including native unsigned integers.

public static implicit operator NumberInputBound(UInt64 value)
ParameterDescription
value

Related types: NumberInputBound

Implicit conversion — UInt32​

Preserves an unsigned integer without an ambiguous signed conversion.

public static implicit operator NumberInputBound(UInt32 value)
ParameterDescription
value

Related types: NumberInputBound

Implicit conversion — UInt16​

Preserves an unsigned integer without an ambiguous signed conversion.

public static implicit operator NumberInputBound(UInt16 value)
ParameterDescription
value

Related types: NumberInputBound

Implicit conversion — Byte​

Preserves an unsigned integer without an ambiguous signed conversion.

public static implicit operator NumberInputBound(Byte value)
ParameterDescription
value

Related types: NumberInputBound

Implicit conversion — Char​

Preserves the numeric value accepted by the former double parameter.

public static implicit operator NumberInputBound(Char value)
ParameterDescription
value

Related types: NumberInputBound

Implicit conversion — int​

Preserves an exact integer bound.

public static implicit operator NumberInputBound(int value)
ParameterDescription
value

Related types: NumberInputBound

SlackblocksInfo​

Package metadata shared with the slackblocks conformance corpus.

SlackObject​

Base class for every immutable slackblocks value. A value is validated once, when it is constructed, and cannot change afterwards.

Two values are equal when they are the same type and produce the same Slack JSON, ignoring object key order. Object.ToString returns the compact JSON.

ToJson​

Returns this value as compact Slack JSON.

public string ToJson()

Returns: Compact JSON text.

ToJsonNode​

Returns a mutable copy of this value's Slack JSON.

public JsonObject ToJsonNode()

Returns: A new JSON object.