UNPKG

@bitbybit-dev/base

Version:

Bit By Bit Developers Base CAD Library to Program Geometry

94 lines (93 loc) 2.63 kB
import * as Inputs from "../inputs"; import * as Models from "../models"; import { Point } from "./point"; /** * Contains various text methods. */ export declare class TextBitByBit { private readonly point; constructor(point: Point); /** * Creates a text * @param inputs a text * @returns text * @group create * @shortname text * @drawable false */ create(inputs: Inputs.Text.TextDto): string; /** * Split the text to multiple pieces by a separator * @param inputs a text * @returns text * @group transform * @shortname split * @drawable false */ split(inputs: Inputs.Text.TextSplitDto): string[]; /** * Replace all occurrences of a text by another text * @param inputs a text * @returns text * @group transform * @shortname replaceAll * @drawable false */ replaceAll(inputs: Inputs.Text.TextReplaceDto): string; /** * Join multiple items by a separator into text * @param inputs a list of items * @returns text * @group transform * @shortname join * @drawable false */ join(inputs: Inputs.Text.TextJoinDto): string; /** * Transform any item to text * @param inputs any item * @returns text * @group transform * @shortname to string * @drawable false */ toString<T>(inputs: Inputs.Text.ToStringDto<T>): string; /** * Transform each item in list to text * @param inputs list of items * @returns texts * @group transform * @shortname to strings * @drawable false */ toStringEach<T>(inputs: Inputs.Text.ToStringEachDto<T>): string[]; /** * Format a text with values * @param inputs a text and values * @returns formatted text * @group transform * @shortname format * @drawable false */ format(inputs: Inputs.Text.TextFormatDto): string; /** * Creates a vector segments for character and includes width and height information * @param inputs a text * @returns width, height and segments as json * @group vector * @shortname vector char * @drawable false */ vectorChar(inputs: Inputs.Text.VectorCharDto): Models.Text.VectorCharData; /** * Creates a vector text lines for a given text and includes width and height information * @param inputs a text as string * @returns segments * @group vector * @shortname vector text * @drawable false */ vectorText(inputs: Inputs.Text.VectorTextDto): Models.Text.VectorTextData[]; private vectorParamsChar; private translateLine; }