@dotglitch/ngx-common
Version:
Angular components and utilities that are commonly used.
129 lines (128 loc) โข 3.53 kB
TypeScript
export declare const sleep: (ms: any) => Promise<unknown>;
/**
* Prompt the user to save a json file of the given object.
*/
export declare const saveObjectAsFile: (name: string, data: Object) => void;
/**
* Construct an emoticon with any unicode icon you specify
*/
export declare class Emoticon {
icon: string;
constructor(icon: string);
}
/**
* authorization ๐ \
* navigation ๐งญ \
* user ๐ชช \
* security ๐ก \
* system ๐ฅ \
* toolbox ๐งฐ \
* chore โ \
* config ๐ \
* renderer ๐ \
* package ๐ฆ \
* time โณ \
* download ๐ฅ \
* upload ๐ค \
* bug ๐ฆ \
* bomb ๐ฃ \
* tnt ๐งจ \
* warning โ ๏ธ \
* chart ๐ \
* chart_up ๐ \
* chart_down ๐ \
* circle_red ๐ด \
* circle_orange ๐ \
* circle_yellow ๐ก \
* circle_green ๐ข \
* circle_blue ๐ต \
* circle_violet ๐ฃ \
* circle_black โซ๏ธ \
* circle_white โช๏ธ \
* circle_brown ๐ค \
* square_red ๐ฅ \
* square_orange ๐ง \
* square_yellow ๐จ \
* square_green ๐ฉ \
* square_blue ๐ฆ \
* square_violet ๐ช \
* square_black โฌ๏ธ \
* square_white โฌ๏ธ \
* square_brown ๐ซ
*/
export declare const LogIcon: {
authorization: Emoticon;
navigation: Emoticon;
user: Emoticon;
security: Emoticon;
system: Emoticon;
toolbox: Emoticon;
chore: Emoticon;
config: Emoticon;
renderer: Emoticon;
package: Emoticon;
time: Emoticon;
download: Emoticon;
upload: Emoticon;
bug: Emoticon;
bomb: Emoticon;
tnt: Emoticon;
stop: Emoticon;
police: Emoticon;
rocket: Emoticon;
warning: Emoticon;
chart: Emoticon;
chart_up: Emoticon;
chart_down: Emoticon;
circle_red: Emoticon;
circle_orange: Emoticon;
circle_yellow: Emoticon;
circle_green: Emoticon;
circle_blue: Emoticon;
circle_violet: Emoticon;
circle_black: Emoticon;
circle_white: Emoticon;
circle_brown: Emoticon;
square_red: Emoticon;
square_orange: Emoticon;
square_yellow: Emoticon;
square_green: Emoticon;
square_blue: Emoticon;
square_violet: Emoticon;
square_black: Emoticon;
square_white: Emoticon;
square_brown: Emoticon;
};
declare class Log {
private context;
private contextColor;
private textColor;
constructor(context: string, contextColor: string, textColor: string);
log(icon: Emoticon, message: string, ...args: any[]): any;
log(message: string, ...args: any[]): any;
warn(icon: Emoticon, message: string, ...args: any[]): any;
warn(message: string, ...args: any[]): any;
err(icon: Emoticon, message: string, ...args: any[]): any;
err(message: string, ...args: any[]): any;
error(icon: Emoticon, message: string, ...args: any[]): any;
error(message: string, ...args: any[]): any;
}
/**
* Formatted logger that will print a bit of context before the message.
* @returns
*/
export declare const ConsoleLogger: (context: string, contextColor: string, textColor?: string) => Log;
/**
* Convert a string `fooBAR baz_160054''"1]"` into a slug: `foobar-baz-1600541`
*/
export declare const stringToSlug: (text: string) => string;
/**
* Helper to update the page URL.
* @param page component page ID to load.
* @param data string or JSON data for query params.
*/
export declare const updateUrl: (page?: string, data?: string | string[][] | Record<string, string | number> | URLSearchParams, replaceState?: boolean) => void;
export declare const getUrlData: (source?: string) => {
[x: number]: any;
};
export {};