name:
dist/Formulas/Text.d.ts
-rw-r--r--
9616
1/**
2 * Computes the value of a Roman numeral.
3 * @param text - The Roman numeral to format, whose value must be between 1 and 3999, inclusive.
4 * @returns {number} value in integer format
5 * @constructor
6 */
7declare let ARABIC: (text?: any) => number;
8/**
9 * Convert a number into a character according to the current Unicode table.
10 * @param value - The number of the character to look up from the current Unicode table in decimal format.
11 * @returns {string} character corresponding to Unicode number
12 * @constructor
13 */
14declare let CHAR: (value: any) => string;
15/**
16 * Returns the numeric Unicode map value of the first character in the string provided.
17 * @param value - The string whose first character's Unicode map value will be returned.
18 * @returns {number} number of the first character's Unicode value
19 * @constructor
20 */
21declare let CODE: (value: any) => number;
22/**
23 * Divides text around a specified character or string, and puts each fragment into a separate cell in the row.
24 * @param text - The text to divide.
25 * @param delimiter - The character or characters to use to split text.
26 * @param splitByEach - [optional] Whether or not to divide text around each character contained in
27 * delimiter.
28 * @returns {Array<string>} containing the split
29 * @constructor
30 * TODO: At some point this needs to return a more complex type than Array. Needs to return a type that has a dimension.
31 */
32declare let SPLIT: (text: any, delimiter: any, splitByEach?: any) => string[];
33/**
34 * Appends strings to one another.
35 * @param values - to append to one another. Must contain at least one value
36 * @returns {string} concatenated string
37 * @constructor
38 */
39declare let CONCATENATE: (...values: any[]) => string;
40/**
41 * Converts a numeric value to a different unit of measure.
42 * @param value - the numeric value in start_unit to convert to end_unit.
43 * @param startUnit - The starting unit, the unit currently assigned to value.
44 * @param endUnit - The unit of measure into which to convert value.
45 * @returns {number}
46 * @constructor
47 * TODO: Looking up units is not efficient at all. We should use an object instead of iterating through an array.
48 */
49declare let CONVERT: (value: any, startUnit: any, endUnit: any) => number;
50/**
51 * Removes leading and trailing spaces in a specified string.
52 * @param value - The string or reference to a cell containing a string to be trimmed.
53 * @returns {string}
54 * @constructor
55 */
56declare let TRIM: (value: any) => string;
57/**
58 * Converts text to lowercase.
59 * @param value - Text to convert.
60 * @constructor
61 */
62declare let LOWER: (value: any) => string;
63/**
64 * Converts text to uppercase.
65 * @param value - Text to convert.
66 * @constructor
67 */
68declare let UPPER: (value: any) => string;
69/**
70 * Returns string arguments as text, or the empty string if the value is not text.
71 * @param value - Value to return.
72 * @constructor
73 */
74declare let T: (value: any) => string;
75/**
76 * Converts a number into a Roman numeral.
77 * @param value - The value to convert. Must be between 0 and 3999.
78 * @constructor
79 * TODO: Second parameter should be 'rule_relaxation'.
80 */
81declare let ROMAN: (value: any) => string;
82/**
83 * Converts a number into text according to a given format.
84 * @param value - The value to be converted.
85 * @param format - Text which defines the format. "0" forces the display of zeros, while "#" suppresses the display of
86 * zeros. For example TEXT(22.1,"000.00") produces 022.10, while TEXT(22.1,"###.##") produces 22.1, and
87 * TEXT(22.405,"00.00") results in 22.41. To format days: "dddd" indicates full name of the day of the week, "ddd"
88 * short name of the day of the week, "dd" indicates the day of the month as two digits, "d" indicates day of the month
89 * as one or two digits, "mmmmm" indicates the first letter in the month of the year, "mmmm" indicates the full name of
90 * the month of the year, "mmm" indicates short name of the month of the year, "mm" indicates month of the year as two
91 * digits or the number of minutes in a time, depending on whether it follows yy or dd, or if it follows hh, "m" month
92 * of the year as one or two digits or the number of minutes in a time, depending on whether it follows yy or dd, or if
93 * it follows hh, "yyyy" indicates year as four digits, "yy" and "y" indicate year as two digits, "hh" indicates hour
94 * on a 24-hour clock, "h" indicates hour on a 12-hour clock, "ss.000" indicates milliseconds in a time, "ss" indicates
95 * seconds in a time, "AM/PM" or "A/P" indicate displaying hours based on a 12-hour clock and showing AM or PM
96 * depending on the time of day. Eg: `TEXT("01/09/2012 10:04:33AM", "mmmm-dd-yyyy, hh:mm AM/PM")` would result in
97 * "January-09-2012, 10:04 AM".
98 * @constructor
99 */
100declare let TEXT: (value: any, format: any) => string;
101/**
102 * Looks for a string of text within another string. Where to begin the search can also be defined. The search term can
103 * be a number or any string of characters. The search is case-sensitive.
104 * @param searchFor - The text to be found.
105 * @param searchIn - The text where the search takes place.
106 * @param startAt - [OPTIONAL defaults to 1] - The position in the text from which the search starts.
107 * @returns {number}
108 * @constructor
109 */
110declare let FIND: (searchFor: any, searchIn: any, startAt?: any) => any;
111/**
112 * Concatenates the values of one or more arrays using a specified delimiter.
113 * @param delimiter - The string to place between the values.
114 * @param values - The values to be appended using the delimiter.
115 * @returns {string}
116 * @constructor
117 */
118declare let JOIN: (delimiter: any, ...values: any[]) => string;
119/**
120 * Returns the length of a string including spaces.
121 * @param value - The text whose length is to be determined.
122 * @constructor
123 */
124declare let LEN: (value: any) => any;
125/**
126 * Returns the first character or characters in a text string.
127 * @param text - The text where the initial partial words are to be determined.
128 * @param numberOfCharacters [OPTIONAL] - The number of characters for the start text. If this parameter is not defined,
129 * one character is returned.
130 * @returns {string}
131 * @constructor
132 */
133declare let LEFT: (text: any, numberOfCharacters?: any) => any;
134/**
135 * Defines the last character or characters in a text string.
136 * @param text - The text where the initial partial words are to be determined.
137 * @param numberOfCharacters [OPTIONAL] - The number of characters for the start text. If this parameter is not defined,
138 * one character is returned.
139 * @returns {string}
140 * @constructor
141 */
142declare let RIGHT: (text: any, numberOfCharacters?: any) => any;
143/**
144 * Returns the position of a text segment within a character string. The start of the search can be set as an option.
145 * The search text can be a number or any sequence of characters. The search is not case-sensitive.
146 * @param findText - The text to be searched for.
147 * @param withinText - The text where the search will take place
148 * @param position - [OPTIONAL default 1] The position in the text where the search is to start.
149 * @constructor
150 */
151declare let SEARCH: (findText: any, withinText: any, position?: any) => any;
152/**
153 * Repeats a character string by the given number of copies.
154 * @param text - The text to be repeated.
155 * @param numberOfReps - The number of repetitions
156 * @constructor
157 */
158declare let REPT: (text: any, numberOfReps: any) => string;
159/**
160 * Converts a value into a number if possible.
161 * @param value - The value to convert to a number.
162 * @returns {number}
163 * @constructor
164 */
165declare let VALUE: (value: any) => number;
166/**
167 * Removes all non-printing characters from the string.
168 * @param text - The text from which to remove all non-printable characters.
169 * @returns {string}
170 * @constructor
171 */
172declare let CLEAN: (text: any) => any;
173/**
174 * Returns a text segment of a character string. The parameters specify the starting position and the number of
175 * characters.
176 * @param text - The text containing the characters to extract.
177 * @param start - The position of the first character in the text to extract.
178 * @param number - The number of characters in the part of the text.
179 * @returns {string}
180 * @constructor
181 */
182declare let MID: (text: any, start: any, number: any) => any;
183declare let PROPER: (text: any) => any;
184/**
185 * Replaces part of a text string with a different text string. This function can be used to replace both characters and
186 * numbers (which are automatically converted to text). The result of the function is always displayed as text.
187 * @param text - The text of which a part will be replaced.
188 * @param position - The position within the text where the replacement will begin.
189 * @param length - The number of characters in text to be replaced.
190 * @param newText - The text which replaces text.
191 * @constructor
192 */
193declare let REPLACE: (text: any, position: any, length: any, newText: any) => any;
194/**
195 * Substitutes new text for old text in a string.
196 * @param text - The text in which text segments are to be exchanged.
197 * @param searchFor - The text segment that is to be replaced (a number of times)
198 * @param replaceWith - The text that is to replace the text segment.
199 * @param occurrence - [OPTIONAL] - Indicates how many occurrences of the search text are to be replaced. If this
200 * parameter is missing, the search text is replaced throughout.
201 * @returns {string}
202 * @constructor
203 */
204declare let SUBSTITUTE: (text: any, searchFor: any, replaceWith: any, occurrence?: any) => any;
205export { ARABIC, CHAR, CODE, SPLIT, CONCATENATE, CONVERT, TRIM, LOWER, UPPER, T, ROMAN, TEXT, FIND, JOIN, LEN, LEFT, RIGHT, SEARCH, REPT, VALUE, CLEAN, MID, PROPER, REPLACE, SUBSTITUTE };