Repository navigation
Expand file tree
/
Copy pathStrings.d.ts
More file actions
194 lines (194 loc) · 13.6 KB
/
Copy pathStrings.d.ts
File metadata and controls
194 lines (194 loc) · 13.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
import type { PHPEngine } from "../PHPEngine.js";
import type { PHPContext } from "../PHPContext.js";
import { PHPReference } from "./PHPVariable.js";
export declare class StringRuntime {
/** Gets string length. */
static strlen(ctx: PHPContext, strArg?: any): Promise<number>;
/** Count the number of substring occurrences. */
static substr_count(ctx: PHPContext, haystackArg?: PHPReference, needleArg?: PHPReference, offsetArg?: PHPReference, lengthArg?: PHPReference): Promise<number>;
/** Return part of a string. */
static substr(ctx: PHPContext, strArg?: any, startArg?: any, lengthArg?: any): Promise<string>;
/** Replace text within a portion of a string. */
static substr_replace(ctx: PHPContext, subjectArg?: PHPReference, replacementArg?: PHPReference, offsetArg?: PHPReference, lengthArg?: PHPReference): Promise<string | string[]>;
/** Find the position of the first occurrence of a substring in a string. */
static strpos(ctx: PHPContext, haystackArg?: PHPReference, needleArg?: PHPReference, offsetArg?: PHPReference): Promise<number | false>;
/** Find the position of the first occurrence of a case-insensitive substring in a string. */
static stripos(ctx: PHPContext, haystackArg?: PHPReference, needleArg?: PHPReference, offsetArg?: PHPReference): Promise<number | false>;
/** Find the position of the last occurrence of a substring in a string. */
static strrpos(ctx: PHPContext, haystackArg?: PHPReference, needleArg?: PHPReference, offsetArg?: PHPReference): Promise<number | false>;
/** Find the position of the last occurrence of a case-insensitive substring in a string. */
static strripos(ctx: PHPContext, haystackArg?: PHPReference, needleArg?: PHPReference, offsetArg?: PHPReference): Promise<number | false>;
/** Find the first occurrence of a string. */
static strstr(ctx: PHPContext, haystackArg?: PHPReference, needleArg?: PHPReference, beforeNeedleArg?: PHPReference): Promise<string | false>;
/** Find the first case-insensitive occurrence of a string. */
static stristr(ctx: PHPContext, haystackArg?: PHPReference, needleArg?: PHPReference, beforeNeedleArg?: PHPReference): Promise<string | false>;
/**
* Replace all occurrences of the search string with the replacement string.
* @param countRef Output variable passed by reference to receive replacement count.
*/
static str_replace(ctx: PHPContext, searchArg?: PHPReference, replaceArg?: PHPReference, subjectArg?: PHPReference, countRef?: PHPReference): Promise<any>;
/** Translate characters or replace substrings. */
static strtr(ctx: PHPContext, subjectArg?: PHPReference, fromArg?: PHPReference, toArg?: PHPReference): Promise<string>;
/** Case-insensitive version of str_replace. */
static str_ireplace(ctx: PHPContext, searchArg?: PHPReference, replaceArg?: PHPReference, subjectArg?: PHPReference, countRef?: PHPReference): Promise<any>;
/** Return a formatted string. */
static sprintf(ctx: PHPContext, fmtArg?: PHPReference, ...args: PHPReference[]): Promise<string>;
/** Output a formatted string. */
static printf(ctx: PHPContext, fmtArg?: PHPReference, ...args: PHPReference[]): Promise<number>;
/** Split a string by a string. */
static explode(ctx: PHPContext, delimiterArg?: PHPReference, stringArg?: PHPReference, limitArg?: PHPReference): Promise<string[]>;
/** Join array elements with a string. */
static implode(ctx: PHPContext, glueArg?: PHPReference, piecesArg?: PHPReference): Promise<string>;
/** Strip whitespace (or other characters) from the beginning and end of a string. */
static trim(ctx: PHPContext, strArg?: PHPReference, charlistArg?: PHPReference): Promise<string>;
/** Strip whitespace (or other characters) from the beginning of a string. */
static ltrim(ctx: PHPContext, strArg?: PHPReference, charlistArg?: PHPReference): Promise<string>;
/** Strip whitespace (or other characters) from the end of a string. */
static rtrim(ctx: PHPContext, strArg?: PHPReference, charlistArg?: PHPReference): Promise<string>;
/** Strip HTML and PHP tags from a string. */
static strip_tags(ctx: PHPContext, strArg?: PHPReference, allowable_tagsArg?: PHPReference): Promise<string>;
/** Make a string lowercase. */
static strtolower(ctx: PHPContext, strArg?: PHPReference): Promise<string>;
/** Make a string uppercase. */
static strtoupper(ctx: PHPContext, strArg?: PHPReference): Promise<string>;
/** Make a string's first character uppercase. */
static ucfirst(ctx: PHPContext, strArg?: PHPReference): Promise<string>;
/** Make a string's first character lowercase. */
static lcfirst(ctx: PHPContext, strArg?: PHPReference): Promise<string>;
/** Uppercase the first character of each word in a string. */
static ucwords(ctx: PHPContext, strArg?: PHPReference): Promise<string>;
/** Binary safe string comparison. */
static strcmp(ctx: PHPContext, str1Arg?: PHPReference, str2Arg?: PHPReference): Promise<number>;
/** Binary safe string comparison of the first n characters. */
static strncmp(ctx: PHPContext, str1Arg?: PHPReference, str2Arg?: PHPReference, lengthArg?: PHPReference): Promise<number>;
/** Binary safe case-insensitive string comparison. */
static strcasecmp(ctx: PHPContext, str1Arg?: PHPReference, str2Arg?: PHPReference): Promise<number>;
/** Binary safe case-insensitive string comparison of the first n characters. */
static strncasecmp(ctx: PHPContext, str1Arg?: PHPReference, str2Arg?: PHPReference, lengthArg?: PHPReference): Promise<number>;
static strnatcmp(ctx: PHPContext, str1Arg?: PHPReference, str2Arg?: PHPReference): Promise<number>;
static strnatcasecmp(ctx: PHPContext, str1Arg?: PHPReference, str2Arg?: PHPReference): Promise<number>;
/** Quote string with slashes. */
static addslashes(ctx: PHPContext, strArg?: PHPReference): Promise<string>;
static addcslashes(ctx: PHPContext, strArg?: PHPReference, charlistArg?: PHPReference): Promise<string>;
/** Un-quotes a quoted string. */
static stripslashes(ctx: PHPContext, strArg?: PHPReference): Promise<string>;
static stripcslashes(ctx: PHPContext, strArg?: PHPReference): Promise<string>;
/** Convert special characters to HTML entities. */
static htmlspecialchars(ctx: PHPContext, strArg?: PHPReference): Promise<string>;
/** Convert special HTML entities back to characters. */
static htmlspecialchars_decode(ctx: PHPContext, strArg?: PHPReference): Promise<string>;
static htmlentities(ctx: PHPContext, strArg?: PHPReference): Promise<string>;
static html_entity_decode(ctx: PHPContext, strArg?: PHPReference): Promise<string>;
static unpack(ctx: PHPContext, formatArg?: PHPReference, stringArg?: PHPReference, offsetArg?: PHPReference): Promise<Record<string, number> | false>;
static pack(ctx: PHPContext, formatArg?: PHPReference, ...args: PHPReference[]): Promise<string>;
private static strtokState;
static strtok(ctx: PHPContext, strArg?: PHPReference, tokenArg?: PHPReference): Promise<string | false>;
/** Inserts HTML line breaks before all newlines in a string. */
static nl2br(ctx: PHPContext, strArg?: PHPReference, isXhtmlArg?: PHPReference): Promise<string>;
/** Repeat a string. */
static str_repeat(ctx: PHPContext, inputArg?: PHPReference, multiplierArg?: PHPReference): Promise<string>;
/** Pad a string to a certain length with another string. */
static str_pad(ctx: PHPContext, inputArg?: PHPReference, padLengthArg?: PHPReference, padStringArg?: PHPReference, padTypeArg?: PHPReference): Promise<string>;
/** Convert a string to an array. */
static str_split(ctx: PHPContext, stringArg?: PHPReference, lengthArg?: PHPReference): Promise<string[]>;
/** Reverse a string. */
static strrev(ctx: PHPContext, stringArg?: PHPReference): Promise<string>;
/** Generate a single-byte string from a number. */
static chr(ctx: PHPContext, asciiArg?: any): Promise<string>;
/** Convert the first byte of a string to a value between 0 and 255. */
static ord(ctx: PHPContext, characterArg?: any): Promise<number>;
/** Format a number with grouped thousands. */
static number_format(ctx: PHPContext, numArg?: any, decimalsArg?: any, decPointArg?: any, thousandsSepArg?: any): Promise<string>;
/** Convert binary data into hexadecimal representation. */
static bin2hex(ctx: PHPContext, stringArg?: PHPReference): Promise<string>;
/** Decodes a hexadecimally encoded binary string. */
static hex2bin(ctx: PHPContext, hexStringArg?: PHPReference): Promise<string>;
static substr_compare(ctx: PHPContext, mainStrArg?: PHPReference, strArg?: PHPReference, offsetArg?: PHPReference, lengthArg?: PHPReference, caseInsensitiveArg?: PHPReference): Promise<number>;
static base64_encode(ctx: PHPContext, stringArg?: any): Promise<string>;
static base64_decode(ctx: PHPContext, stringArg?: any): Promise<string>;
/** Compares two "PHP-standardized" version number strings. */
static version_compare(ctx: PHPContext, v1Arg?: PHPReference, v2Arg?: PHPReference, opArg?: PHPReference): Promise<any>;
/**
* Parses encoded query string into variables.
* @param result Output variable passed by reference to receive parsed key-value pairs.
*/
static parse_str(ctx: PHPContext, queryArg?: PHPReference, result?: PHPReference): Promise<void>;
static strspn(ctx: PHPContext, stringArg?: PHPReference, charactersArg?: PHPReference, offsetArg?: PHPReference, lengthArg?: PHPReference): Promise<number>;
static strcspn(ctx: PHPContext, stringArg?: PHPReference, charactersArg?: PHPReference, offsetArg?: PHPReference, lengthArg?: PHPReference): Promise<number>;
static vsprintf(ctx: PHPContext, formatArg?: PHPReference, valuesArg?: PHPReference): Promise<string>;
static str_starts_with(ctx: PHPContext, haystackArg?: PHPReference, needleArg?: PHPReference): Promise<boolean>;
static str_ends_with(ctx: PHPContext, haystackArg?: PHPReference, needleArg?: PHPReference): Promise<boolean>;
static str_contains(ctx: PHPContext, haystackArg?: PHPReference, needleArg?: PHPReference): Promise<boolean>;
/** Search a string for any of a set of characters. */
static strpbrk(ctx: PHPContext, stringArg?: any, charlistArg?: any): Promise<string | false>;
static vprintf(ctx: PHPContext, formatArg?: PHPReference, valuesArg?: PHPReference): Promise<number>;
static functions: {
str_starts_with: typeof StringRuntime.str_starts_with;
str_ends_with: typeof StringRuntime.str_ends_with;
str_contains: typeof StringRuntime.str_contains;
parse_str: typeof StringRuntime.parse_str;
version_compare: typeof StringRuntime.version_compare;
unpack: typeof StringRuntime.unpack;
pack: typeof StringRuntime.pack;
strlen: typeof StringRuntime.strlen;
substr_count: typeof StringRuntime.substr_count;
substr: typeof StringRuntime.substr;
substr_compare: typeof StringRuntime.substr_compare;
substr_replace: typeof StringRuntime.substr_replace;
strpos: typeof StringRuntime.strpos;
stripos: typeof StringRuntime.stripos;
strrpos: typeof StringRuntime.strrpos;
strripos: typeof StringRuntime.strripos;
strstr: typeof StringRuntime.strstr;
stristr: typeof StringRuntime.stristr;
str_replace: typeof StringRuntime.str_replace;
strtr: typeof StringRuntime.strtr;
str_ireplace: typeof StringRuntime.str_ireplace;
sprintf: typeof StringRuntime.sprintf;
printf: typeof StringRuntime.printf;
vsprintf: typeof StringRuntime.vsprintf;
vprintf: typeof StringRuntime.vprintf;
number_format: typeof StringRuntime.number_format;
strspn: typeof StringRuntime.strspn;
strcspn: typeof StringRuntime.strcspn;
strpbrk: typeof StringRuntime.strpbrk;
explode: typeof StringRuntime.explode;
implode: typeof StringRuntime.implode;
trim: typeof StringRuntime.trim;
ltrim: typeof StringRuntime.ltrim;
rtrim: typeof StringRuntime.rtrim;
strip_tags: typeof StringRuntime.strip_tags;
strtolower: typeof StringRuntime.strtolower;
strtoupper: typeof StringRuntime.strtoupper;
ucfirst: typeof StringRuntime.ucfirst;
lcfirst: typeof StringRuntime.lcfirst;
ucwords: typeof StringRuntime.ucwords;
strcmp: typeof StringRuntime.strcmp;
strncmp: typeof StringRuntime.strncmp;
strcasecmp: typeof StringRuntime.strcasecmp;
strncasecmp: typeof StringRuntime.strncasecmp;
strnatcmp: typeof StringRuntime.strnatcmp;
strnatcasecmp: typeof StringRuntime.strnatcasecmp;
addslashes: typeof StringRuntime.addslashes;
addcslashes: typeof StringRuntime.addcslashes;
stripslashes: typeof StringRuntime.stripslashes;
stripcslashes: typeof StringRuntime.stripcslashes;
htmlspecialchars: typeof StringRuntime.htmlspecialchars;
htmlspecialchars_decode: typeof StringRuntime.htmlspecialchars_decode;
htmlentities: typeof StringRuntime.htmlentities;
html_entity_decode: typeof StringRuntime.html_entity_decode;
strtok: typeof StringRuntime.strtok;
nl2br: typeof StringRuntime.nl2br;
str_repeat: typeof StringRuntime.str_repeat;
str_pad: typeof StringRuntime.str_pad;
str_split: typeof StringRuntime.str_split;
strrev: typeof StringRuntime.strrev;
chr: typeof StringRuntime.chr;
ord: typeof StringRuntime.ord;
bin2hex: typeof StringRuntime.bin2hex;
hex2bin: typeof StringRuntime.hex2bin;
base64_encode: typeof StringRuntime.base64_encode;
base64_decode: typeof StringRuntime.base64_decode;
};
static register(engine: PHPEngine): void;
}