-
Notifications
You must be signed in to change notification settings - Fork 0
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
10 changed files
with
19 additions
and
110 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 |
---|---|---|
@@ -1,68 +1,10 @@ | ||
/** | ||
* Finds a value in array recursively. | ||
* @param {any[]} array The array to query. | ||
* @param {*} value The search element. | ||
* @return {boolean} Returns `true` if `value` is in `array`, else `false`. | ||
*/ | ||
export function has(array: any[], value: any): boolean; | ||
/** | ||
* Checks if value or array is empty. | ||
* @param {*} value The value to inspect | ||
* @return {boolean} Returns `true` if `value` is empty, else `false`. | ||
*/ | ||
export function isEmpty(value: any): boolean; | ||
/** | ||
* Returns last element from array. | ||
* @param {any[]} array The array The array to query. | ||
* @return {*} Returns the last element of `array`. | ||
*/ | ||
export function last(array: any[]): any; | ||
/** | ||
* Returns next element from array. | ||
* @param {number} index | ||
* @param {any[]} array The array to query. | ||
* @param {boolean} [loop=true] Disable infinite array loop. | ||
* @returns {*} Return the previous element of `array`. | ||
*/ | ||
export function next(index: number, array: any[], loop?: boolean): any; | ||
/** | ||
* Returns previous element from array. | ||
* @param {number} index | ||
* @param {any[]} array The array to query. | ||
* @param {boolean} [loop=true] Disable infinite array loop. | ||
* @returns {*} Returns the previous element of `array`. | ||
*/ | ||
export function prev(index: number, array: any[], loop?: boolean): any; | ||
/** | ||
* Prints a value or an array of values. | ||
* @param {*} value The value to print | ||
* @param {*} [separator=', '] The join separator | ||
* @returns {*} Returns value or joined array of `value` | ||
*/ | ||
export function print(value: any, separator?: any): any; | ||
/** | ||
* Pushs a value or an array of values recursively. | ||
* @param {any[]} array The array to query. | ||
* @param {*} value The value to be added. | ||
* @param {boolean} [unique=true] Unique push of strings or numbers to `array`. | ||
* @returns {*} Returns the size of `array` or undefined. | ||
*/ | ||
export function push(array: any[], value: any, unique?: boolean): any; | ||
/** | ||
* Returns random element from array. | ||
* @param {any[]} array The array to query. | ||
* @return {*} Returns a random element of `array`. | ||
*/ | ||
export function random(array: any[]): any; | ||
/** | ||
* Randomize array. | ||
* @param {any[]} array The array to be shuffled through. | ||
* @returns {*} Returns the shuffled array. | ||
*/ | ||
export function shuffle(array: any[]): any; | ||
/** | ||
* Returns value as an array if it's not one. | ||
* @param {*} args The value to inspect. | ||
* @returns {*} Returns the value as an array. | ||
*/ | ||
export function toArray(...args: any): any; |
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 |
---|---|---|
@@ -1,6 +1 @@ | ||
/** | ||
* Conditional class name helper. | ||
* @param {*} args Input of class names. | ||
* @return {string} Returns `args` as string. | ||
*/ | ||
export function classnames(...args: 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 |
---|---|---|
@@ -1,25 +1,4 @@ | ||
/** | ||
* Get cookie by name. | ||
* @param {string} name The name of the cookie. | ||
* @return {boolean|string} Returns value of cookie, else false. | ||
*/ | ||
export function getCookie(name: string): boolean | string; | ||
/** | ||
* Set cookie. | ||
* @param {string} name The name of the cookie. | ||
* @param {string} value The value of the cookie. | ||
* @param {number} [days=1] The expiration date. | ||
* @return {*} | ||
*/ | ||
export function setCookie(name: string, value: string, days?: number): any; | ||
/** | ||
* Remove cookie. | ||
* @param {string} name The name of the cookie. | ||
* @return {*} | ||
*/ | ||
export function removeCookie(name: string): any; | ||
/** | ||
* Clear all cookies. | ||
* @return {*} | ||
*/ | ||
export function clearCookies(): any; |
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 |
---|---|---|
@@ -1,5 +1 @@ | ||
/** | ||
* Copy text to the clipboard | ||
* @param {string} text | ||
*/ | ||
export declare function copy(text: 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
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 @@ | ||
export declare function addDays(date: Date, days: number): Date; | ||
export declare function addMonths(date: Date, months: number): Date; | ||
export declare function addYears(date: Date, years: number): Date; | ||
export declare function diffInDays(date1: Date, date2: Date): number; | ||
export declare function daysInMonth(date: Date): number; | ||
export declare function formatDate(date: Date, format?: string): 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
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
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 |
---|---|---|
@@ -1,6 +1 @@ | ||
/** | ||
* Type-checking with Object.prototype.toString() method. | ||
* @param {*} value The value to inspect. | ||
* @returns {string} Returns type as lowercase string. | ||
*/ | ||
export function typeOf(value: 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 |
---|---|---|
@@ -1,6 +1 @@ | ||
/** | ||
* Returns if the DOM element is visible on the users viewport. | ||
* @param {Element} el The DOM element to be inspected. | ||
* @return {*} Return `true` if element is visible, else `false` or ``undefined`. | ||
*/ | ||
export function isVisible(el: Element): any; |