UNPKG

@dotglitch/ngx-common

Version:

Angular components and utilities that are commonly used.

129 lines (128 loc) โ€ข 3.53 kB
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 {};