@digo-labs/common 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ export declare class ArrayHelpers {
2
+ static isArray(element: any): boolean;
3
+ static swapArrayElements<T>(array: T[], index1: number, index2: number): T[];
4
+ static getArraySwappedIndices<T>(originalArray: T[], newArray: T[]): {
5
+ original: number;
6
+ new: number;
7
+ } | undefined;
8
+ static duplicateArrayElement<T>(array: T[], index: number): void;
9
+ static insertElement<T>(array: T[], index: number, element: T): void;
10
+ static shuffleArray<T>(array: T[]): T[];
11
+ }
package/dist/auth.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export declare const AUTH_PROJECTS: {
2
+ readonly monorepo: {
3
+ readonly trustedOrigins: readonly ["http://localhost:2000", "https://*.digo-labs.com"];
4
+ };
5
+ };
6
+ export type AuthProject = keyof typeof AUTH_PROJECTS;
@@ -0,0 +1,40 @@
1
+ import { ImagePayload, Result, Time } from './';
2
+ export declare class CommonHelpers {
3
+ static copyToClipboard(text: string): void;
4
+ static removeBackground(image: ImagePayload): Promise<ImagePayload>;
5
+ static getTimeFormatted(seconds: number): Time;
6
+ static getTextFromClipboard(): Promise<string>;
7
+ static decodeBase64(base64: string): ArrayBuffer;
8
+ static getRandomInteger(min: number, max: number): number;
9
+ static encodeArrayBufferToBase64(arrayBuffer: ArrayBuffer): string;
10
+ static hexToRgb(hex: string): {
11
+ r: number;
12
+ g: number;
13
+ b: number;
14
+ };
15
+ static rgbArrayToHex(rgb: [number, number, number]): string;
16
+ static hexToRgbArray(hex: string): [number, number, number];
17
+ static getCssVariable(variable: string): string;
18
+ static setCssVariable(name: string, element: HTMLElement): void;
19
+ static lerp(start: number, end: number, t: number): number;
20
+ static lerpArray(start: number[], end: number[], t: number): number[];
21
+ static clamp(value: number, min: number, max: number): number;
22
+ static downloadURI(uri: string, name?: string): Promise<void>;
23
+ static getFileFromUrl(url: string, fileName?: string): Promise<File>;
24
+ static generateUUID(): string;
25
+ static getImagePayloadFromUrl(url: string, fileName?: string): Promise<Result<ImagePayload>>;
26
+ static getImagePayloadFromFile(file: File): Promise<Result<ImagePayload>>;
27
+ static getFileFromImagePayload(ImagePayload: ImagePayload): File;
28
+ static setTabName(name: string): void;
29
+ static openFileSelector(accepts: string, callback: (file: File) => void): void;
30
+ static formatNumberTwoDigits(number: number): string;
31
+ getFormatedTime(miliseconds: number, decimals?: number): string;
32
+ static preloadImage(url: string): Promise<void>;
33
+ static preloadImages(urls: string[]): Promise<void>;
34
+ static getUniqueLetters(word: string): string[];
35
+ static compressImage(base64: string, mediaType: string, maxWidth?: number, quality?: number): Promise<ImagePayload>;
36
+ static downloadCsvFromUrl(url: string): Promise<string>;
37
+ static getLastUpdated(timeStamptz: string): string;
38
+ static getUniqueIdInList(baseId: string, ids: string[]): string;
39
+ static scrollToBottom(container: HTMLDivElement | null): void;
40
+ }
@@ -0,0 +1,5 @@
1
+ import { CodeLanguageMetadata, ModelPayload } from './types/common-types';
2
+ export declare const BACKEND_URL = "https://api.digo-labs.com";
3
+ export declare const AWS_DEFAULT_REGION = "us-east-1";
4
+ export declare const AI_MODELS: ModelPayload[];
5
+ export declare const LANGUAGE_MAP: Record<string, CodeLanguageMetadata>;
@@ -0,0 +1,2 @@
1
+ import { FontFaceData } from './font-types';
2
+ export declare const FONT_FACES: FontFaceData[];
@@ -0,0 +1,11 @@
1
+ export type FontFormat = 'ttf' | 'otf';
2
+ export interface FontFaceData {
3
+ family: string;
4
+ weightMin: number;
5
+ weightMax: number;
6
+ style: string;
7
+ format: FontFormat;
8
+ filePath: string;
9
+ fileName: string;
10
+ cssVariable: string | null;
11
+ }
@@ -0,0 +1,24 @@
1
+ export declare const FONTS: {
2
+ aalto: string;
3
+ being: string;
4
+ benzol: string;
5
+ clashGrotesk: string;
6
+ digital7Mono: string;
7
+ disket: string;
8
+ generalSans: string;
9
+ half: string;
10
+ heming: string;
11
+ humane: string;
12
+ jersey10: string;
13
+ karmaticArcade: string;
14
+ kodeMono: string;
15
+ miratrix: string;
16
+ nippo: string;
17
+ obrazec: string;
18
+ pixelony: string;
19
+ triakis: string;
20
+ unknown: string;
21
+ yeager: string;
22
+ geist: string;
23
+ geistMono: string;
24
+ };