-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
1,207 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
init(data: [any]){} | ||
|
||
function contains(data: any): boolean; | ||
|
||
function index(data: any): integer; | ||
|
||
function length(): integer; | ||
|
||
function get(index: integer): $type; | ||
|
||
function join(sep: string): string; | ||
|
||
function full(data: any): [ $type ]; | ||
|
||
function shift(): $type; | ||
|
||
function pop(): $type; | ||
|
||
function push(data: any): integer; | ||
|
||
function unshift(data: any): integer; | ||
|
||
function concat(data: any): [ $type ]; | ||
|
||
function sort(order: string): [ $type ]; | ||
|
||
function append(data: any, index: integer): void; | ||
|
||
function remove(data: any): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
init(data: bytes){} | ||
|
||
function toString(): string; | ||
|
||
function toHex(): string; | ||
|
||
function toBase64(): string; | ||
|
||
function length(): integer; | ||
|
||
function toJSON(): string; | ||
|
||
static function from(data: string, type: string): bytes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* HmacSHA1 Signature | ||
* @param stringToSign string | ||
* @param secret string | ||
* @return signed bytes | ||
*/ | ||
static function HmacSHA1Sign(stringToSign: string, secret: string): bytes; | ||
|
||
|
||
/** | ||
* HmacSHA256 Signature | ||
* @param stringToSign string | ||
* @param secret string | ||
* @return signed bytes | ||
*/ | ||
static function HmacSHA256Sign(stringToSign: string, secret: string): bytes; | ||
|
||
|
||
/** | ||
* HmacSM3 Signature | ||
* @param stringToSign string | ||
* @param secret string | ||
* @return signed bytes | ||
*/ | ||
static function HmacSM3Sign(stringToSign: string, secret: string): bytes; | ||
|
||
|
||
/** | ||
* SHA256withRSA Signature | ||
* @param stringToSign string | ||
* @param secret string | ||
* @return signed bytes | ||
*/ | ||
static function SHA256withRSASign(stringToSign: string, secret: string): bytes; | ||
|
||
/** | ||
* MD5 Signature | ||
* @param stringToSign string | ||
* @return signed bytes | ||
*/ | ||
static function MD5Sign(stringToSign: string): bytes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
init(date: string) {} | ||
|
||
function format(format: string): string; | ||
|
||
function unix(): integer; | ||
|
||
function diff(unit: string, date: $Date): integer; | ||
|
||
function UTC(): string; | ||
|
||
function add(unit: string, timeLong: integer): $Date; | ||
|
||
function sub(unit: string, timeLong: integer): $Date; | ||
|
||
function hour(): integer; | ||
|
||
function minute(): integer; | ||
|
||
function second(): integer; | ||
|
||
function dayOfYear(): integer; | ||
|
||
function dayOfMonth(): integer; | ||
|
||
function dayOfWeek(): integer; | ||
|
||
function weekOfYear(): integer; | ||
|
||
function weekOfMonth(): integer; | ||
|
||
function month(): integer; | ||
|
||
function year(): integer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
init(key: string, value: any) {} | ||
|
||
function key(): string; | ||
|
||
function value(): $type; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* This is a env module | ||
*/ | ||
|
||
/** | ||
* Get environment variable according to the key | ||
* @param key the name of environment variable | ||
* @return environment variable | ||
*/ | ||
static function get(key: string): string; | ||
|
||
/** | ||
* Get environment variable according to the key | ||
* @param key the name of environment variable | ||
* @param value the value of environment variable | ||
* @return void | ||
*/ | ||
static function set(key: string, value: string) throws: void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
init(path: string) {} | ||
|
||
function path(): string; | ||
|
||
function length(): integer; | ||
|
||
function createTime(): $Date; | ||
|
||
function modifyTime(): $Date; | ||
|
||
function read(size: number): bytes; | ||
|
||
function write(data: bytes): void; | ||
|
||
static async function createReadStream(path: string): readable; | ||
|
||
static async function createWriteStream(path: string): writable; | ||
|
||
static async function exists(path: string): boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Format a map to form string, like a=a%20b%20c | ||
* @return the form string | ||
*/ | ||
static function toFormString(val: object): string; | ||
|
||
/** | ||
* Gets a boundary string | ||
* @return the random boundary string | ||
*/ | ||
static function getBoundary(): string; | ||
|
||
/** | ||
* Give a form and boundary string, wrap it to a readable stream | ||
* @param form The form map | ||
* @param boundary the boundary string | ||
* @return the readable from file form | ||
*/ | ||
static function toFileForm(form: object, boundary: string): readable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Parse it by JSON format | ||
* @return the parsed result | ||
*/ | ||
static function parseJSON(val: string): any; | ||
|
||
/** | ||
* Stringify a value by JSON format | ||
* @return the JSON format string | ||
*/ | ||
static function stringify(val: any): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* This is a console module | ||
*/ | ||
|
||
/** | ||
* Console val with log level into stdout | ||
* @param val the printing string | ||
* @return void | ||
* @example \[LOG\] tea console example | ||
*/ | ||
static function log(val: string): void; | ||
|
||
/** | ||
* Console val with info level into stdout | ||
* @param val the printing string | ||
* @return void | ||
* @example \[INFO\] tea console example | ||
*/ | ||
static function info(val: string): void; | ||
|
||
/** | ||
* Console val with warning level into stdout | ||
* @param val the printing string | ||
* @return void | ||
* @example \[WARNING\] tea console example | ||
*/ | ||
static function warning(val: string): void; | ||
|
||
/** | ||
* Console val with debug level into stdout | ||
* @param val the printing string | ||
* @return void | ||
* @example \[DEBUG\] tea console example | ||
*/ | ||
static function debug(val: string): void; | ||
|
||
/** | ||
* Console val with error level into stderr | ||
* @param val the printing string | ||
* @return void | ||
* @example \[ERROR\] tea console example | ||
*/ | ||
static function error(val: string): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
init(data: any){} | ||
|
||
function length(): integer; | ||
|
||
function keySet(): [ string ]; | ||
|
||
function entries(): [ entry[ $type ] ]; | ||
|
||
function toJSON(): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
init(data: number){} | ||
|
||
function parseInt(): integer; | ||
|
||
function parseLong(): long; | ||
|
||
function parseFloat(): float; | ||
|
||
function parseDouble(): double; | ||
|
||
function itol(): long; | ||
|
||
function ltoi(): integer; | ||
|
||
static function random(): number; | ||
|
||
static function floor(num: number): integer; | ||
|
||
static function round(num: number): integer; | ||
|
||
static function min(a: number, b: number): number; | ||
|
||
static function max(a: number, b: number): number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
init(){} | ||
|
||
function read(size: number): bytes; | ||
|
||
function write(data: bytes): void; | ||
|
||
function pipe(rs: writable): void; | ||
|
||
/** | ||
* Read data from a readable stream, and compose it to a bytes | ||
* @param stream the readable stream | ||
* @return the bytes result | ||
*/ | ||
static async function readAsBytes(stream: readable): bytes; | ||
|
||
/** | ||
* Read data from a readable stream, and parse it by JSON format | ||
* @param stream the readable stream | ||
* @return the parsed result | ||
*/ | ||
static async function readAsJSON(stream: readable): any ; | ||
|
||
/** | ||
* Read data from a readable stream, and compose it to a string | ||
* @param stream the readable stream | ||
* @return the string result | ||
*/ | ||
static async function readAsString(stream: readable): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
init(data: string){} | ||
|
||
function split(sep: string, limit: number): [ string ]; | ||
|
||
function replace(oldStr: string, newStr: string, count: integer): string; | ||
|
||
function contains(substr: string): boolean; | ||
|
||
function length(): integer; | ||
|
||
function hasPrefix(prefix: string): boolean; | ||
|
||
function hasSuffix(substr: string): boolean; | ||
|
||
function index(substr: string): integer; | ||
|
||
function toLower(): string; | ||
|
||
function toUpper(): string; | ||
|
||
function subString(start: integer, end: integer): string; | ||
|
||
function equals(actual: string): boolean; | ||
|
||
function trim(): string; | ||
|
||
/** | ||
* @param encoding string, eg: UTF-8 | ||
* @return result bytes | ||
*/ | ||
|
||
function toBytes(encoding: string): bytes; | ||
|
||
function empty(): boolean; | ||
|
||
function parseInt(): integer; | ||
|
||
function parseLong(): long; | ||
|
||
function parseFloat(): float; | ||
|
||
function parseDouble(): double; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
init(url: string) {} | ||
|
||
function format(type: string): string; | ||
|
||
function path(): string; | ||
|
||
function pathname(): string; | ||
|
||
function protocol(): string; | ||
|
||
function hostname(): string; | ||
|
||
function hash(): string; | ||
|
||
function search(): string; | ||
|
||
function href(): string; | ||
|
||
function auth(): string; | ||
|
||
static function parse(url: string): $URL; | ||
|
||
static function urlEncode(url: string): string; | ||
|
||
static function percentEncode(raw: string): string; | ||
|
||
static function pathEncode(path: string): string; |
Oops, something went wrong.