/** * The two string rules two engines have to share, written from the page. * * **A string is a sequence of code points** (`compiled-program.md` 3.1), and the * host this engine is written in stores one as sixteen bit units. Every rule * here counts code points and not units, because the two disagree the moment a * string holds a symbol outside the basic plane, and a rule written on the * host's units would be a rule a second engine could not follow. * * **Ordering.** Two strings are ordered by comparing code points from the * front, the first difference deciding, and a string that runs out first * ordering first (`language.md` 9.3, `stdlib.md` section 10). The host's own * `<` orders by unit, which puts every symbol outside the basic plane, stored * as a surrogate pair from U+D800, below the code points from U+E000 to U+FFFF * that come after it, so it is not used. * * **Whitespace.** `str.trim` removes, and `toNumber` ignores, exactly the code * points `stdlib.md` section 10 lists, which are the ones with the Unicode * White_Space property. The host's own `trim` removes a set that is nearly this * one: it takes the byte order mark U+FEFF as well, and a second engine's host * takes the four separators U+001C to U+001F and leaves the byte order mark, so * neither host's default is the set, and the set is implemented from the list. * `tests/engine/strings.test.ts` walks every code point of the basic plane * against the list read out of the page. */ /** Code points, which is what every index over a string counts. */ export declare function points(text: string): string[]; /** Whether one code point is in the trimmed set. */ export declare function isWhitespace(point: number): boolean; /** `text` with the whitespace of the written set taken off both ends. */ export declare function trimmed(text: string): string; /** * The order of two strings, negative when `a` comes first, by code point. * * Walked with the string iterator so a surrogate pair is one code point, and * compared as numbers so U+10000 comes after U+FFFF, which is the order the * page states and the one an engine with four byte strings gets for free. */ export declare function compareStrings(a: string, b: string): number; //# sourceMappingURL=code-points.d.ts.map