UNPKG

@bitbybit-dev/base

Version:

Bit By Bit Developers Base CAD Library to Program Geometry

329 lines (328 loc) 7.74 kB
import { Base } from "./base-inputs"; export declare namespace Text { class TextDto { constructor(text?: string); /** * The text * @default Hello World */ text: string; } class TextSplitDto { constructor(text?: string, separator?: string); /** * Text to split * @default a,b,c */ text: string; /** * Text to split by * @default , */ separator: string; } class TextReplaceDto { constructor(text?: string, search?: string, replaceWith?: string); /** * Text to replace * @default a-c */ text: string; /** * Text to search for * @default - */ search: string; /** * Text to replace found occurences * @default b */ replaceWith: string; } class TextJoinDto { constructor(list?: string[], separator?: string); /** * Text to join * @default undefined */ list: string[]; /** * Text to join by * @default , */ separator: string; } class ToStringDto<T> { constructor(item?: T); /** * Item to stringify * @default undefined */ item: T; } class ToStringEachDto<T> { constructor(list?: T[]); /** * Item to stringify * @default undefined */ list: T[]; } class TextFormatDto { constructor(text?: string, values?: string[]); /** * Text to format * @default Hello {0} */ text: string; /** * Values to format * @default ["World"] */ values: string[]; } class TextSearchDto { constructor(text?: string, search?: string); /** * Text to search in * @default hello world */ text: string; /** * Text to search for * @default world */ search: string; } class TextSubstringDto { constructor(text?: string, start?: number, end?: number); /** * Text to extract from * @default hello world */ text: string; /** * Start index * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ start: number; /** * End index * @default 5 * @minimum 0 * @maximum Infinity * @step 1 */ end?: number; } class TextIndexDto { constructor(text?: string, index?: number); /** * Text to get character from * @default hello */ text: string; /** * Index of character * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; } class TextPadDto { constructor(text?: string, length?: number, padString?: string); /** * Text to pad * @default x */ text: string; /** * Target length * @default 3 * @minimum 0 * @maximum Infinity * @step 1 */ length: number; /** * String to pad with * @default a */ padString: string; } class TextRepeatDto { constructor(text?: string, count?: number); /** * Text to repeat * @default ha */ text: string; /** * Number of repetitions * @default 3 * @minimum 0 * @maximum Infinity * @step 1 */ count: number; } class TextConcatDto { constructor(texts?: string[]); /** * Texts to concatenate * @default ["hello", " ", "world"] */ texts: string[]; } class TextRegexDto { constructor(text?: string, pattern?: string, flags?: string); /** * Text to search in * @default hello123world */ text: string; /** * Regular expression pattern * @default [0-9]+ */ pattern: string; /** * Regular expression flags (g, i, m, s, u, y) * @default g */ flags: string; } class TextRegexReplaceDto { constructor(text?: string, pattern?: string, flags?: string, replaceWith?: string); /** * Text to search in * @default hello123world456 */ text: string; /** * Regular expression pattern * @default [0-9]+ */ pattern: string; /** * Regular expression flags (g, i, m, s, u, y) * @default g */ flags: string; /** * Text to replace matches with * @default X */ replaceWith: string; } class VectorCharDto { constructor(char?: string, xOffset?: number, yOffset?: number, height?: number, extrudeOffset?: number); /** * The text * @default A */ char: string; /** * The x offset * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ xOffset?: number; /** * The y offset * @minimum -Infinity * @maximum Infinity * @step 0.1 */ yOffset?: number; /** * The height of the text * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ height?: number; /** * The extrude offset * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ extrudeOffset?: number; } class VectorTextDto { constructor(text?: string, xOffset?: number, yOffset?: number, height?: number, lineSpacing?: number, letterSpacing?: number, align?: Base.horizontalAlignEnum, extrudeOffset?: number, centerOnOrigin?: boolean); /** * The text * @default Hello World */ text?: string; /** * The x offset * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ xOffset?: number; /** * The y offset * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ yOffset?: number; /** * The height of the text * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ height?: number; /** * The line spacing * @default 1.4 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ lineSpacing?: number; /** * The letter spacing offset * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ letterSpacing?: number; /** * The extrude offset * @default left */ align?: Base.horizontalAlignEnum; /** * The extrude offset * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ extrudeOffset?: number; /** * Will center text on 0, 0, 0 * @default false */ centerOnOrigin?: boolean; } }