/** * The `ASCII` module defines basic string and char newtypes in Move that verify * that characters are valid ASCII, and that strings consist of only valid ASCII characters. */ import type { ClientWithCoreApi, SuiClientTypes } from '@mysten/sui/client'; import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from '../../../_framework/reified'; import { FieldsWithTypes } from '../../../_framework/util'; import { Vector } from '../../../_framework/vector'; export declare function isString(type: string): boolean; export interface StringFields { bytes: ToField>; } export type StringReified = Reified; export type StringJSONField = { bytes: number[]; }; export type StringJSON = { $typeName: typeof String.$typeName; $typeArgs: []; } & StringJSONField; /** * The `String` struct holds a vector of bytes that all represent * valid ASCII characters. Note that these ASCII characters may not all * be printable. To determine if a `String` contains only "printable" * characters you should use the `all_characters_printable` predicate * defined in this module. */ export declare class String implements StructClass { __StructClass: true; static readonly $typeName: `0x1::ascii::String`; static readonly $numTypeParams = 0; static readonly $isPhantom: readonly []; readonly $typeName: typeof String.$typeName; readonly $fullTypeName: `0x1::ascii::String`; readonly $typeArgs: []; readonly $isPhantom: typeof String.$isPhantom; readonly bytes: ToField>; private constructor(); static reified(): StringReified; static get r(): StringReified; static phantom(): PhantomReified>; static get p(): PhantomReified>; private static instantiateBcs; private static cachedBcs; static get bcs(): ReturnType; static fromFields(fields: Record): String; static fromFieldsWithTypes(item: FieldsWithTypes): String; static fromBcs(data: Uint8Array): String; toJSONField(): StringJSONField; toJSON(): StringJSON; static fromJSONField(field: any): String; static fromJSON(json: Record): String; static fromCoreObject(obj: SuiClientTypes.Object<{ content: true; }>): String; static fetch(client: ClientWithCoreApi, id: string): Promise; } export declare function isChar(type: string): boolean; export interface CharFields { byte: ToField<'u8'>; } export type CharReified = Reified; export type CharJSONField = { byte: number; }; export type CharJSON = { $typeName: typeof Char.$typeName; $typeArgs: []; } & CharJSONField; /** An ASCII character. */ export declare class Char implements StructClass { __StructClass: true; static readonly $typeName: `0x1::ascii::Char`; static readonly $numTypeParams = 0; static readonly $isPhantom: readonly []; readonly $typeName: typeof Char.$typeName; readonly $fullTypeName: `0x1::ascii::Char`; readonly $typeArgs: []; readonly $isPhantom: typeof Char.$isPhantom; readonly byte: ToField<'u8'>; private constructor(); static reified(): CharReified; static get r(): CharReified; static phantom(): PhantomReified>; static get p(): PhantomReified>; private static instantiateBcs; private static cachedBcs; static get bcs(): ReturnType; static fromFields(fields: Record): Char; static fromFieldsWithTypes(item: FieldsWithTypes): Char; static fromBcs(data: Uint8Array): Char; toJSONField(): CharJSONField; toJSON(): CharJSON; static fromJSONField(field: any): Char; static fromJSON(json: Record): Char; static fromCoreObject(obj: SuiClientTypes.Object<{ content: true; }>): Char; static fetch(client: ClientWithCoreApi, id: string): Promise; }