lightningdevkit
Version:
Lightning Development Kit
50 lines (49 loc) • 1.66 kB
text/typescript
import { UntrustedString } from '../structs/UntrustedString.mjs';
import { Result_DescriptionCreationErrorZ } from '../structs/Result_DescriptionCreationErrorZ.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* Description string
*
* # Invariants
* The description can be at most 639 __bytes__ long
*/
export declare class Description extends CommonBase {
clone_ptr(): bigint;
/**
* Creates a copy of the Description
*/
clone(): Description;
/**
* Generates a non-cryptographic 64-bit hash of the Description.
*/
hash(): bigint;
/**
* Checks if two Descriptions contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
* Two objects with NULL inner values will be considered "equal" here.
*/
eq(b: Description): boolean;
/**
* Creates a new `Description` if `description` is at most 1023 * 5 bits (i.e., 639 bytes)
* long, and returns [`CreationError::DescriptionTooLong`] otherwise.
*
* Please note that single characters may use more than one byte due to UTF8 encoding.
*/
static constructor_new(description: string): Result_DescriptionCreationErrorZ;
/**
* Creates an empty `Description`.
*/
static constructor_empty(): Description;
/**
* Returns the underlying description [`UntrustedString`]
*/
into_inner(): UntrustedString;
/**
* Get a reference to the underlying description [`UntrustedString`]
*/
as_inner(): UntrustedString;
/**
* Get the string representation of a Description object
*/
to_str(): string;
}