mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-11 19:33:30 -07:00
JS: Types for chr(), .indexOf(), .slice()
This commit is contained in:
+21
@@ -56,6 +56,15 @@ declare const __filepath: string;
|
||||
*/
|
||||
declare function load(path: string): any;
|
||||
|
||||
/**
|
||||
* @brief Return 1-byte string whose ASCII code is the integer `n`
|
||||
*
|
||||
* If `n` is not numeric or outside of `0-255` range, `null` is returned
|
||||
*
|
||||
* @param n The ASCII code to convert to string
|
||||
*/
|
||||
declare function chr(n: number): string | null;
|
||||
|
||||
/**
|
||||
* @brief mJS Foreign Pointer type
|
||||
*
|
||||
@@ -189,6 +198,18 @@ declare class String {
|
||||
* See `charCodeAt`
|
||||
*/
|
||||
at(index: number): number;
|
||||
/**
|
||||
* @brief Return index of first occurence of substr within the string or `-1` if not found
|
||||
* @param substr The string to search for
|
||||
* @param fromIndex The index to start searching from
|
||||
*/
|
||||
indexOf(substr: string, fromIndex?: number): number;
|
||||
/**
|
||||
* @brief Return a substring between two indices
|
||||
* @param start The index to start substring at
|
||||
* @param end The index to end substring at
|
||||
*/
|
||||
slice(start: number, end?: number): string;
|
||||
}
|
||||
|
||||
declare class Boolean { }
|
||||
|
||||
Reference in New Issue
Block a user