@posx/core 5.5.228 → 5.5.229

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.d.ts CHANGED
@@ -1,3 +1,226 @@
1
+ declare module '@posx/core/helpers/helpers.register' {
2
+ /**
3
+ * String Helpers Registration - Following handlebars-helpers API pattern
4
+ *
5
+ * This module follows the same API as the original handlebars-helpers library:
6
+ * helpers({ handlebars: Handlebars })
7
+ */
8
+ interface HelperOptions {
9
+ handlebars?: any;
10
+ hbs?: any;
11
+ }
12
+ /**
13
+ * Register string helpers with Handlebars
14
+ *
15
+ * @param options - Options object with handlebars instance
16
+ * @returns The registered helpers object
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * import Handlebars from 'handlebars';
21
+ * import helpers from '@posx/core/helpers/string-helpers-register/index';
22
+ *
23
+ * // Register all string helpers
24
+ * helpers({ handlebars: Handlebars });
25
+ *
26
+ * const template = Handlebars.compile('{{camelcase "foo bar baz"}}');
27
+ * console.log(template({})); // 'fooBarBaz'
28
+ * ```
29
+ */
30
+ function helpers(options?: HelperOptions): any;
31
+ /**
32
+ * Export default following the original API pattern
33
+ */
34
+ export default helpers;
35
+
36
+ }
37
+ declare module '@posx/core/helpers/string.helpers' {
38
+ /**
39
+ * String Helpers for Handlebars
40
+ * Browser-compatible string manipulation utilities
41
+ */
42
+ export interface StringHelpers {
43
+ camelcase: (str: string) => string;
44
+ capitalize: (str: string) => string;
45
+ capitalizeAll: (str: string) => string;
46
+ dashcase: (str: string) => string;
47
+ dotcase: (str: string) => string;
48
+ downcase: (str: string) => string;
49
+ lowercase: (str: string) => string;
50
+ pascalcase: (str: string) => string;
51
+ pathcase: (str: string) => string;
52
+ sentence: (str: string) => string;
53
+ snakecase: (str: string) => string;
54
+ titleize: (str: string) => string;
55
+ upcase: (str: string) => string;
56
+ uppercase: (str: string) => string;
57
+ append: (str: string, suffix: string) => string;
58
+ center: (str: string, spaces: number) => string;
59
+ chop: (str: string) => string;
60
+ hyphenate: (str: string) => string;
61
+ plusify: (str: string, ch?: string) => string;
62
+ prepend: (str: string, prefix: string) => string;
63
+ remove: (str: string, substring: string) => string;
64
+ removeFirst: (str: string, substring: string) => string;
65
+ replace: (str: string, a: string, b: string) => string;
66
+ replaceFirst: (str: string, a: string, b: string) => string;
67
+ reverse: (str: string) => string;
68
+ split: (str: string, ch?: string) => string[];
69
+ ellipsis: (str: string, limit: number) => string;
70
+ trim: (str: string) => string;
71
+ trimLeft: (str: string) => string;
72
+ trimRight: (str: string) => string;
73
+ truncate: (str: string, limit: number, suffix?: string) => string;
74
+ truncateWords: (str: string, count: number, suffix?: string) => string;
75
+ isString: (value: any) => boolean;
76
+ occurrences: (str: string, substring: string) => number;
77
+ }
78
+ /**
79
+ * camelCase the characters in the given string
80
+ */
81
+ export const camelcase: (str: string) => string;
82
+ /**
83
+ * Capitalize the first word in a sentence
84
+ */
85
+ export const capitalize: (str: string) => string;
86
+ /**
87
+ * Capitalize all words in a string
88
+ */
89
+ export const capitalizeAll: (str: string) => string;
90
+ /**
91
+ * dash-case the characters in string
92
+ */
93
+ export const dashcase: (str: string) => string;
94
+ /**
95
+ * dot.case the characters in string
96
+ */
97
+ export const dotcase: (str: string) => string;
98
+ /**
99
+ * Lowercase all characters (alias for lowercase)
100
+ */
101
+ export const downcase: (str: string) => string;
102
+ /**
103
+ * Lowercase all characters in the given string
104
+ */
105
+ export const lowercase: (str: string) => string;
106
+ /**
107
+ * PascalCase the characters in string
108
+ */
109
+ export const pascalcase: (str: string) => string;
110
+ /**
111
+ * path/case the characters in string
112
+ */
113
+ export const pathcase: (str: string) => string;
114
+ /**
115
+ * Sentence case the given string
116
+ */
117
+ export const sentence: (str: string) => string;
118
+ /**
119
+ * snake_case the characters in the given string
120
+ */
121
+ export const snakecase: (str: string) => string;
122
+ /**
123
+ * Title case the given string
124
+ */
125
+ export const titleize: (str: string) => string;
126
+ /**
127
+ * Uppercase all characters (alias for uppercase)
128
+ */
129
+ export const upcase: (str: string) => string;
130
+ /**
131
+ * Uppercase all of the characters in the given string
132
+ */
133
+ export const uppercase: (str: string) => string;
134
+ /**
135
+ * Append the specified suffix to the given string
136
+ */
137
+ export const append: (str: string, suffix: string) => string;
138
+ /**
139
+ * Center a string using non-breaking spaces
140
+ */
141
+ export const center: (str: string, spaces: number) => string;
142
+ /**
143
+ * Remove whitespace and non-word characters from beginning and end
144
+ */
145
+ export const chop: (str: string) => string;
146
+ /**
147
+ * Replace spaces in a string with hyphens
148
+ */
149
+ export const hyphenate: (str: string) => string;
150
+ /**
151
+ * Replace spaces (or custom character) with pluses
152
+ */
153
+ export const plusify: (str: string, ch?: string) => string;
154
+ /**
155
+ * Prepend the given string with the specified prefix
156
+ */
157
+ export const prepend: (str: string, prefix: string) => string;
158
+ /**
159
+ * Remove all occurrences of substring from the given string
160
+ */
161
+ export const remove: (str: string, substring: string) => string;
162
+ /**
163
+ * Remove the first occurrence of substring from the given string
164
+ */
165
+ export const removeFirst: (str: string, substring: string) => string;
166
+ /**
167
+ * Replace all occurrences of substring a with substring b
168
+ */
169
+ export const replace: (str: string, a: string, b: string) => string;
170
+ /**
171
+ * Replace the first occurrence of substring a with substring b
172
+ */
173
+ export const replaceFirst: (str: string, a: string, b: string) => string;
174
+ /**
175
+ * Reverse a string
176
+ */
177
+ export const reverse: (str: string) => string;
178
+ /**
179
+ * Split string by the given character
180
+ */
181
+ export const split: (str: string, ch?: string) => string[];
182
+ /**
183
+ * Truncate string and append ellipsis
184
+ */
185
+ export const ellipsis: (str: string, limit: number) => string;
186
+ /**
187
+ * Remove extraneous whitespace from beginning and end
188
+ */
189
+ export const trim: (str: string) => string;
190
+ /**
191
+ * Remove extraneous whitespace from the beginning
192
+ */
193
+ export const trimLeft: (str: string) => string;
194
+ /**
195
+ * Remove extraneous whitespace from the end
196
+ */
197
+ export const trimRight: (str: string) => string;
198
+ /**
199
+ * Truncate a string to the specified length
200
+ */
201
+ export const truncate: (str: string, limit: number, suffix?: string) => string;
202
+ /**
203
+ * Truncate a string to have the specified number of words
204
+ */
205
+ export const truncateWords: (str: string, count: number, suffix?: string) => string;
206
+ /**
207
+ * Check if value is a string
208
+ */
209
+ export const isString: (value: any) => value is string;
210
+ /**
211
+ * Return the number of occurrences of substring within the given string
212
+ */
213
+ export const occurrences: (str: string, substring: string) => number;
214
+ /**
215
+ * Export all helpers as a single object
216
+ */
217
+ export const stringHelpers: StringHelpers;
218
+ /**
219
+ * Default export
220
+ */
221
+ export default stringHelpers;
222
+
223
+ }
1
224
  declare module '@posx/core/index' {
2
225
  export * from '@posx/core/types/auto.query.type';
3
226
  export * from '@posx/core/types/wyo.customer.type';